package cfg import "math" // CFG returns the configuration func CFG() Config { cfg := Config{ CircleResolution: 30, MachineWidth: 1225, MachineHeight: 800, MachineMmPerRev: 37.7, MachineStepsPerRev: 200, MachineMotorAccel: 400, MachineMotorSpeed: 800, MachineStepMultiplier: 1, DrawingArea: Area{ TopLeft: Point{X: 400, Y: 250}, BottomRight: Point{X: 800, Y: 500}, Home: Point{X: 612.44, Y: 217.61}, }, } cfg.DrawingArea.Width = math.Abs(cfg.DrawingArea.BottomRight.X - cfg.DrawingArea.TopLeft.X) cfg.DrawingArea.Height = math.Abs(cfg.DrawingArea.BottomRight.Y - cfg.DrawingArea.TopLeft.Y) return cfg } // Point ... type Point struct { X float64 Y float64 } // Area ... type Area struct { Home Point TopLeft Point BottomRight Point Width float64 Height float64 } // Config ... type Config struct { DrawingArea Area MachineWidth float64 MachineHeight float64 MachineMmPerRev float64 MachineStepsPerRev float64 MachineMotorSpeed float64 MachineMotorAccel float64 MachineStepMultiplier float64 CircleResolution float64 }