func (s *StringCodeGenerator) Feedrate(feedrate float64) {
	s.put(fmt.Sprintf("F%s", floatToString(feedrate, s.Precision)))
}
Sets feedrate (Fn)
package export
import "github.com/kennylevinsen/gocnc/vm"
import "fmt"
import "strings"
type StringCodeGenerator struct {
	BaseGenerator
	Precision      int
	Lines          []string
	Tool           int
	ForceModeWrite bool
}
func (s *StringCodeGenerator) Init() {
	s.Position = vm.Position{State: vm.NewState()}
	s.Lines = []string{"(Exported by gocnc)", "G21G90\n"}
}
func (s *StringCodeGenerator) put(x string) {
	s.Lines = append(s.Lines, x)
}
func (s *StringCodeGenerator) Retrieve() string {
	return strings.Join(s.Lines, "\n")
}
func (s *StringCodeGenerator) ToolChange(t int) {
	if s.Tool == t {
		if s.Lines[len(s.Lines)-1] == fmt.Sprintf("T%d", t) {
			s.Lines[len(s.Lines)-1] = fmt.Sprintf("M6 T%d", t)
		} else {
			s.put("M6")
		}
	} else {
		s.put(fmt.Sprintf("M6 T%d", t))
		s.Tool = t
	}
	s.ForceModeWrite = true
}
func (s *StringCodeGenerator) ToolChangeSuggestion(t int) {
	if s.Tool != t {
		s.put(fmt.Sprintf("T%d", t))
		s.Tool = t
		s.ForceModeWrite = true
	}
}
func (s *StringCodeGenerator) ToolLengthChange(h int) {
	switch h {
	case 0:
		s.put("G49")
	default:
		s.put(fmt.Sprintf("G43H%d", h))
	}
}
func (s *StringCodeGenerator) Spindle(enabled, clockwise bool, speed float64) {
	x := ""
	if s.Position.State.SpindleEnabled != enabled || s.Position.State.SpindleClockwise != clockwise {
		s.ForceModeWrite = true
		if enabled && clockwise {
			x += "M3"
		} else if enabled && !clockwise {
			x += "M4"
		} else {
			x += "M5"
		}
	}
	if enabled && s.Position.State.SpindleSpeed != speed {
		x += fmt.Sprintf("S%s", floatToString(speed, s.Precision))
	}
	s.put(x)
}
func (s *StringCodeGenerator) Coolant(floodCoolant, mistCoolant bool) {
	if !floodCoolant && !mistCoolant {
		s.put("M9")
	} else {
		if floodCoolant {
			s.put("M8")
		}
		if mistCoolant {
			s.put("M7")
		}
	}
	s.ForceModeWrite = true
}
func (s *StringCodeGenerator) FeedMode(feedMode int) {
	switch feedMode {
	case vm.FeedModeInvTime:
		s.put("G93")
	case vm.FeedModeUnitsMin:
		s.put("G94")
	case vm.FeedModeUnitsRev:
		s.put("G95")
	default:
		panic("Unknown feed mode")
	}
}