aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-15 13:49:12 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-15 13:49:12 +0200
commitf8a3589bb9842ccf11a015be6fb26e50529ca040 (patch)
tree47e383bfa5c2eb8725e3bd847668c0d1762c1704
parent45d4b0df550fe3e2d56e25bc84717c289a134259 (diff)
Prepare to switch
-rw-r--r--main.go14
-rw-r--r--marks.go22
-rw-r--r--misc.go2
-rw-r--r--robo.go17
4 files changed, 36 insertions, 19 deletions
diff --git a/main.go b/main.go
index 72c2896..6510a42 100644
--- a/main.go
+++ b/main.go
@@ -29,9 +29,9 @@ func main() {
handle := dev.Handle()
- c := NewCutter(handle, Portrait, 0)
+ //c := NewCutter(handle, Portrait, 0)
- defer c.Home()
+ defer Home(handle.Writer)
//defer c.LineType(Solid)
//c.Raw([]string{"L100,1,400,100"})
@@ -47,11 +47,7 @@ func main() {
//fmt.Println("Call Gin", c.CallGin())
//c.MustMarks(Point{18 * CM, 19 * CM}, Type2)
- if *cmd != "" {
- c.Send(*cmd)
- //log.Println(c.returnString())
- } else {
- PrintStdin(handle.Writer)
- //DrawPic(handle.Writer)
- }
+
+ PrintStdin(handle.Writer)
+ //DrawPic(handle.Writer)
}
diff --git a/marks.go b/marks.go
index 916381e..2bbd2f1 100644
--- a/marks.go
+++ b/marks.go
@@ -1,5 +1,7 @@
package main
+import "bufio"
+
/* Landscape Portrait
+- H -+ +- W -+
|x1 3| |2 1x|
@@ -30,16 +32,16 @@ package main
+-
*/
-func (c Cutter) DrawMarks(offset, size Point, length int) {
- c.Move(Point{600, 3800})
- c.Draw(Point{200, 3800})
- c.Draw(Point{200, 3400})
+func DrawMarks(c *bufio.Writer, offset, size Point, length int) {
+ Point{600, 3800}.Move(c)
+ Point{200, 3800}.Draw(c)
+ Point{200, 3400}.Draw(c)
- c.Move(Point{200, 600})
- c.Draw(Point{200, 200})
- c.Draw(Point{600, 200})
+ Point{200, 600}.Move(c)
+ Point{200, 200}.Draw(c)
+ Point{600, 200}.Draw(c)
- c.Move(Point{4840, 200})
- c.Draw(Point{5240, 200})
- c.Draw(Point{5240, 600})
+ Point{4840, 200}.Move(c)
+ Point{5240, 200}.Draw(c)
+ Point{5240, 600}.Draw(c)
}
diff --git a/misc.go b/misc.go
index 9b756c2..e0cb624 100644
--- a/misc.go
+++ b/misc.go
@@ -1,5 +1,6 @@
package main
+/*
import "log"
func (c Cutter) DrawAtom() {
@@ -32,3 +33,4 @@ func (c Cutter) MustMarks(p Point, typ MarksType) {
log.Fatal("marks not found")
}
}
+*/
diff --git a/robo.go b/robo.go
index b7a39c6..976eacf 100644
--- a/robo.go
+++ b/robo.go
@@ -143,3 +143,20 @@ func (t Triple) send(c *bufio.Writer, cmd string) {
}
func (t Triple) Factor(c *bufio.Writer) { t.send(c, "&") }
+
+func Initialize(c *bufio.ReadWriter, mid int) {
+ Init(c.Writer)
+ if !Ready(c) {
+ fmt.Println("not ready")
+ }
+ GoHome(c.Writer)
+ fmt.Println(craftRobo, "Ver.", Version(c))
+
+ /*
+ pen := MediaID[mid]
+ pen.ID.Media(c.Writer)
+ pen.Speed.Speed(c.Writer)
+ pen.Force.Force(c.Writer)
+ pen.Overcut.Overcut(c.Writer)
+ */
+}