aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-11 20:11:17 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-11 20:11:17 +0200
commit005049731e688de56aa50bfbb1ab68bda947fac0 (patch)
tree5e6e27792ddfdd43b1eb8eea25b7684da3dd5664
parent5be90d74b864a6485936f380509f3ee42c1363ab (diff)
Hide scan*
-rw-r--r--cutter.go16
-rw-r--r--units.go6
2 files changed, 11 insertions, 11 deletions
diff --git a/cutter.go b/cutter.go
index c73432c..0ed334e 100644
--- a/cutter.go
+++ b/cutter.go
@@ -233,19 +233,19 @@ func (c Cutter) returnString() string {
return s
}
-func (c Cutter) ReadUnit() Unit {
+func (c Cutter) returnUnit() Unit {
s, _ := c.GetResponse()
- return ScanUnit(s)
+ return scanUnit(s)
}
func (c Cutter) returnPoint() Point {
s, _ := c.GetResponse()
- return ScanPoint(s)
+ return scanPoint(s)
}
func (c Cutter) returnTriple() Triple {
s, _ := c.GetResponse()
- return ScanTriple(s)
+ return scanTriple(s)
}
func (c Cutter) RegMarkLen(n Unit) {
@@ -265,7 +265,7 @@ func (c Cutter) GetCalibration() Point {
// Emited after auto calibration
func (c Cutter) UnknownFQ5() Unit {
c.Send("FQ5")
- return c.ReadUnit()
+ return c.returnUnit()
}
func (c Cutter) SetCalibration(p Point) {
@@ -313,7 +313,7 @@ func (c Cutter) Initialize() {
func (c Cutter) Ready() bool {
c.Esc(5)
- return c.ReadUnit() == 0
+ return c.returnUnit() == 0
}
func (c Cutter) Wait() {
@@ -354,14 +354,14 @@ func (c Cutter) SearchMarks(p Point) bool {
c.Send("TB99")
c.Send("TB55,1")
c.Send("TB123,", p)
- return c.ReadUnit() == 0
+ return c.returnUnit() == 0
}
func (c Cutter) ManualSearchMarks(p Point) bool {
c.Send("TB99")
c.Send("TB55,1")
c.Send("TB23,", p)
- return c.ReadUnit() == 0
+ return c.returnUnit() == 0
}
func (c Cutter) Circle(p Point, start, end Polar) {
diff --git a/units.go b/units.go
index 5a8c88f..e5fb865 100644
--- a/units.go
+++ b/units.go
@@ -17,7 +17,7 @@ func (u Unit) String() string {
return fmt.Sprintf("%.2f", u)
}
-func ScanUnit(s string) (u Unit) {
+func scanUnit(s string) (u Unit) {
fmt.Sscanf(s, "%v", &u)
return
}
@@ -30,7 +30,7 @@ func (p Point) String() string {
return fmt.Sprintf("%v,%v", p.X, p.Y)
}
-func ScanPoint(s string) (p Point) {
+func scanPoint(s string) (p Point) {
fmt.Sscanf(s, "%v,%v", &p.X, &p.Y)
return
}
@@ -43,7 +43,7 @@ func (t Triple) String() string {
return fmt.Sprintf("%v,%v,%v", t.U, t.V, t.W)
}
-func ScanTriple(s string) (t Triple) {
+func scanTriple(s string) (t Triple) {
fmt.Sscanf(s, "%v,%v,%v", &t.U, &t.V, &t.W)
return
}