aboutsummaryrefslogtreecommitdiff
path: root/cutter.go
diff options
context:
space:
mode:
Diffstat (limited to 'cutter.go')
-rw-r--r--cutter.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/cutter.go b/cutter.go
index 7134c09..27a6490 100644
--- a/cutter.go
+++ b/cutter.go
@@ -3,6 +3,7 @@ package main
import (
"bufio"
"fmt"
+ "time"
)
type Point struct {
@@ -262,6 +263,19 @@ func (c Cutter) Status() (string, error) {
}
}
+func (c Cutter) Ready() bool {
+ c.WriteString("\x1b\x05")
+ c.Flush()
+ ans, _ := c.readResponse()
+ return ans == "0"
+}
+
+func (c Cutter) Wait() {
+ for !c.Ready() {
+ time.Sleep(100 * time.Millisecond)
+ }
+}
+
func (c Cutter) Bezier(a int, p0, p1, p2, p3 Point) {
defer c.EOT()
fmt.Fprintf(c, "BZ%v,%v,%v,%v,%v", a, p0, p1, p2, p3)