aboutsummaryrefslogtreecommitdiff
path: root/media.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-11-14 00:42:23 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-11-14 00:42:23 +0100
commit05af31880498bf60316b85415f9d4c1dfa0d1577 (patch)
treee7040c967ee8e98ae67c3c89ab9bf6d9d5acb5f8 /media.go
parent360abb4272dea659de237b1c58d46acc1746ffa7 (diff)
wip
Diffstat (limited to 'media.go')
-rw-r--r--media.go76
1 files changed, 29 insertions, 47 deletions
diff --git a/media.go b/media.go
index d30481f..6576e7b 100644
--- a/media.go
+++ b/media.go
@@ -1,102 +1,84 @@
package robo
-import (
- "bufio"
- "fmt"
-)
-
// Overcut: depends on blade, 0 for pens
type Media struct {
Descr string // Description
- ID int // FW111
- Speed int // !10
- Force int // FX10,0
- Overcut int // FC ?
-}
-
-var MediaID = make(map[int]Media)
-
-func init() {
- for _, m := range Medias {
- MediaID[m.ID] = m
- }
-}
-
-func (m Media) String() string {
- return fmt.Sprintf("%v: Speed %2d, Force %2d %s",
- m.ID, m.Speed, m.Force, m.Descr)
+ ID Unit // FW111
+ Speed Unit // !10
+ Force Unit // FX10,0
+ Overcut Unit // FC ?
}
-func (m Media) Apply(c *bufio.Writer) {
- Unit(m.ID).Media(c)
- Unit(m.Speed).Speed(c)
- Unit(m.Force).Force(c)
- Unit(m.Overcut).Overcut(c)
+func (r Robo) SetMedia(m Media) {
+ r.Media(m.ID)
+ r.Speed(m.Speed)
+ r.Force(m.Force)
+ r.Overcut(m.Overcut)
}
-var Medias = []Media{
- {
+var (
+ MediaCardWithoutCraftPaperBacking = Media{
Descr: "Card without Craft Paper Backing",
ID: 100,
Speed: 10,
Force: 27,
Overcut: 18,
- },
- {
+ }
+ MediaCardWithCraftPaperBacking = Media{
Descr: "Card with Craft Paper Backing",
ID: 101,
Speed: 10,
Force: 27,
Overcut: 18,
- },
- {
+ }
+ MediaVinylSticker = Media{
Descr: "Vinyl Sticker",
ID: 102,
Speed: 10,
Force: 10,
Overcut: 18,
- },
- {
+ }
+ MediaFilmLables = Media{
Descr: "Film Labels",
ID: 106,
Speed: 10,
Force: 14,
Overcut: 18,
- },
- {
+ }
+ MediaMagneticSheet = Media{
Descr: "Magnetic Sheet",
ID: 107,
Speed: 10,
Force: 12,
Overcut: 18,
- },
- {
+ }
+ MediaThick = Media{
Descr: "Thick Media",
ID: 111,
Speed: 10,
Force: 27,
Overcut: 18,
- },
- {
+ }
+ MediaThin = Media{
Descr: "Thin Media",
ID: 112,
Speed: 10,
Force: 2,
Overcut: 18,
- },
- {
+ }
+ MediaPen = Media{
Descr: "Pen",
ID: 113,
Speed: 10,
Force: 10,
Overcut: 0,
- },
- {
+ }
+ MediaCustom = Media{
Descr: "Custom",
ID: 300,
Speed: 10,
Force: 10,
Overcut: 18,
- },
-}
+ }
+)