aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2019-04-13 00:16:58 +0200
committerPřemysl Janouch <p@janouch.name>2019-04-13 00:16:58 +0200
commitfab0a52189baadd854d293ed076cdf7459d5b7f6 (patch)
tree71d73cac6ba4a90af0a6608109396a7b78120625
parent3080194dc11f6fb6fd40bc51ccc7595a602b7b68 (diff)
downloadsklad-fab0a52189baadd854d293ed076cdf7459d5b7f6.tar.gz
sklad-fab0a52189baadd854d293ed076cdf7459d5b7f6.tar.xz
sklad-fab0a52189baadd854d293ed076cdf7459d5b7f6.zip
Cleanup
-rw-r--r--bdf-sample/main.go3
-rw-r--r--ql/status.go20
2 files changed, 12 insertions, 11 deletions
diff --git a/bdf-sample/main.go b/bdf-sample/main.go
index ae9072f..1850118 100644
--- a/bdf-sample/main.go
+++ b/bdf-sample/main.go
@@ -4,9 +4,10 @@ import (
"image"
"image/draw"
"image/png"
- "janouch.name/sklad/bdf"
"log"
"os"
+
+ "janouch.name/sklad/bdf"
)
func main() {
diff --git a/ql/status.go b/ql/status.go
index ab3e675..8be89a3 100644
--- a/ql/status.go
+++ b/ql/status.go
@@ -151,28 +151,28 @@ func (s *Status) Dump(f io.Writer) {
fmt.Fprintln(f, "media length:", s[17], "mm")
// Status type.
- switch t := s[18]; t {
- case 0x00:
+ switch t := s[18]; StatusType(t) {
+ case StatusTypeReplyToRequest:
fmt.Fprintln(f, "status type: reply to status request")
- case 0x01:
+ case StatusTypePrintingCompleted:
fmt.Fprintln(f, "status type: printing completed")
- case 0x02:
+ case StatusTypeErrorOccurred:
fmt.Fprintln(f, "status type: error occurred")
- case 0x04:
+ case StatusTypeTurnedOff:
fmt.Fprintln(f, "status type: turned off")
- case 0x05:
+ case StatusTypeNotification:
fmt.Fprintln(f, "status type: notification")
- case 0x06:
+ case StatusTypePhaseChange:
fmt.Fprintln(f, "status type: phase change")
default:
fmt.Fprintln(f, "status type:", t)
}
// Phase type.
- switch t := s[19]; t {
- case 0x00:
+ switch t := s[19]; StatusPhase(t) {
+ case StatusPhaseReceiving:
fmt.Fprintln(f, "phase state: receiving state")
- case 0x01:
+ case StatusPhasePrinting:
fmt.Fprintln(f, "phase state: printing state")
default:
fmt.Fprintln(f, "phase state:", t)