aboutsummaryrefslogtreecommitdiff
path: root/cutter.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-02 11:55:44 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-02 11:55:44 +0200
commit64d999c0dc45065dc563bb075a4db2bd33df5918 (patch)
tree843181e71119d29ebf9dea2d213ef08aafc02555 /cutter.go
parent33809820ebd9dd5aee23a3020f47104e5ddeb68e (diff)
Add FQ5
Diffstat (limited to 'cutter.go')
-rw-r--r--cutter.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cutter.go b/cutter.go
index 11f3918..f056072 100644
--- a/cutter.go
+++ b/cutter.go
@@ -241,6 +241,11 @@ func (c Cutter) UnknownFE(n int) {
c.Emit()
}
+func parseDigit(s string) (n int) {
+ fmt.Sscanf(s, "%v", &n)
+ return
+}
+
func parsePoint(s string) (p Point) {
fmt.Sscanf(s, "%v,%v", &p.X, &p.Y)
return
@@ -264,6 +269,14 @@ func (c Cutter) GetCalibration() Point {
return parsePoint(s)
}
+// Emited after calibration
+func (c Cutter) UnknownFQ5() int {
+ fmt.Fprint(c, "FQ5")
+ c.Emit()
+ s, _ := c.readResponse()
+ return parseDigit(s)
+}
+
func (c Cutter) SetCalibration(p Point) {
if p.X > 40 || p.Y > 40 || p.X < -40 || p.Y < -40 {
return