aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-16 18:56:01 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-16 18:56:01 +0200
commitd421ff27df0ad189bbd245ec3000eea5d8030da8 (patch)
tree00e8e42ea9d1937a8f337b7166faad57113cfdcc
parent8b10757e325f8c3247afa830fa4a456041688ade (diff)
Generalize return string cmd
-rw-r--r--cutter.go24
-rw-r--r--doc/A4.txt21
-rw-r--r--robo.go14
3 files changed, 29 insertions, 30 deletions
diff --git a/cutter.go b/cutter.go
index 5c5ba7e..b2f81a2 100644
--- a/cutter.go
+++ b/cutter.go
@@ -6,30 +6,6 @@ import (
"time"
)
-/*
- A4 Cutting area
-
- 10mm y 10mm
- +-----------------+
- | | 10mm
- | +-------------+ |
- | | | |
- . . . . x
- . . . .
- . . . .
- | | | |
- | +-------------+ |
- | |
- | | 20mm
- +-----------------+
-
- Default size: 20000, 4000
- 1000 pt == 50 mm
-
- A4: 210x297 mm => 4200x5940
- Usable: 4000x5440 pt
-*/
-
type Cutter struct {
*bufio.ReadWriter
}
diff --git a/doc/A4.txt b/doc/A4.txt
new file mode 100644
index 0000000..2213819
--- /dev/null
+++ b/doc/A4.txt
@@ -0,0 +1,21 @@
+A4 Cutting area
+
+10mm y 10mm
++-----------------+
+| | 10mm
+| +-------------+ |
+| | | |
+. . . . x
+. . . .
+. . . .
+| | | |
+| +-------------+ |
+| |
+| | 20mm
++-----------------+
+
+Default size: 20000, 4000
+1000 pt == 50 mm
+
+A4: 210x297 mm => 4200x5940
+Usable: 4000x5440 pt
diff --git a/robo.go b/robo.go
index d7757ce..c705020 100644
--- a/robo.go
+++ b/robo.go
@@ -126,11 +126,6 @@ func Raw(c *bufio.Writer, a ...interface{}) {
}
}
-func Version(c *bufio.ReadWriter) string {
- send(c.Writer, "FG")
- return recv(c.Reader)
-}
-
func GoHome(c *bufio.Writer) { send(c, "TT") }
func Home(c *bufio.Writer) { send(c, "H") }
func Origin(c *bufio.Writer) { send(c, "FJ") }
@@ -147,9 +142,16 @@ func Calibration(c *bufio.ReadWriter) Point { return point(c, "TB71") }
func Offset(c *bufio.ReadWriter) Point { return point(c, "?") }
func LowerLeft(c *bufio.ReadWriter) Point { return point(c, "[") }
func UpperRight(c *bufio.ReadWriter) Point { return point(c, "U") }
-func StatusWord(c *bufio.ReadWriter) Point { return point(c, "@") }
func DistanceCorrection(c *bufio.ReadWriter) Point { return point(c, "FA") }
+func str(c *bufio.ReadWriter, cmd string) string {
+ send(c.Writer, cmd)
+ return recv(c.Reader)
+}
+
+func Version(c *bufio.ReadWriter) string { return str(c, "FG") }
+func StatusWord(c *bufio.ReadWriter) string { return str(c, "@") }
+
type Orientation int
const (