aboutsummaryrefslogtreecommitdiff
path: root/robo.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-16 14:24:59 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-16 14:24:59 +0200
commit0d0c55fafb5442f0ba11055b13fa54c983bd4a4c (patch)
treec6225a34b607c70a2e5d7da255ba43742108be7e /robo.go
parent234d7a09d640a7faee142d7dd8bd91e2292eba65 (diff)
Add Step
Diffstat (limited to 'robo.go')
-rw-r--r--robo.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/robo.go b/robo.go
index d2ca8a7..b1264ae 100644
--- a/robo.go
+++ b/robo.go
@@ -42,6 +42,13 @@ func (p Point) SearchMarks(c *bufio.ReadWriter) bool {
return parseUnit(recv(c.Reader)) == 0
}
+func (p Point) SearchMarksManual(c *bufio.ReadWriter) bool {
+ send(c.Writer, "TB99")
+ send(c.Writer, "TB55,1")
+ send(c.Writer, "TB23,", p)
+ return parseUnit(recv(c.Reader)) == 0
+}
+
func (ph Path) send(c *bufio.Writer, a ...interface{}) {
fmt.Fprint(c, a...)
for _, p := range ph {
@@ -195,3 +202,15 @@ func Initialize(c *bufio.ReadWriter, mid int, o Orientation) {
Unit(400).RegMarkLen(c.Writer)
o.Orientation(c.Writer)
}
+
+type StepDirection byte
+
+const (
+ StepStop StepDirection = 1 << iota >> 1
+ StepDown
+ StepUp
+ StepRight
+ StepLeft
+)
+
+func (s StepDirection) Step(c *bufio.Writer) { esc(c, NUL, byte(s)) }