示例#1
0
 public Form1()
 {
     InitializeComponent();
     index = 0;
     fresadora = new Main(
         Settings.Default.portName,
         Settings.Default.baudRate,
         Settings.Default.axisXStepsPercm,
         Settings.Default.axisYStepsPercm,
         Settings.Default.axisZStepsPercm,
         Settings.Default.xyMaxFeedRate,
         Settings.Default.zMaxFeedRate
         );
     fresadora.makeStep += new CNCEventHandler(HandlemakeStep);
     g = cboxFresado.CreateGraphics();
     z = 200;
     x = y = 0;
 }
示例#2
0
        public Program()
        {
            x = new Axis(Settings.Default.axisXStepsPercm,
                new byte[]{
                    Settings.Default.axisXStep1,
                    Settings.Default.axisXStep2,
                    Settings.Default.axisXStep3,
                    Settings.Default.axisXStep4
                },
                Settings.Default.axisXMask,
                "x");

            y = new Axis(Settings.Default.axisYStepsPercm,
                new byte[]{
                    Settings.Default.axisYStep1,
                    Settings.Default.axisYStep2,
                    Settings.Default.axisYStep3,
                    Settings.Default.axisYStep4
                },
                Settings.Default.axisYMask,
                "y");

            z = new Axis(Settings.Default.axisZStepsPercm,
                new byte[]{
                    Settings.Default.axisZStep1,
                    Settings.Default.axisZStep2,
                    Settings.Default.axisZStep3,
                    Settings.Default.axisZStep4
                },
                Settings.Default.axisZMask,
                "z");
            port = new SerialPort(
                Settings.Default.portName,
                Settings.Default.baudRate);
            axisXY = new AxisXY(x, y, Settings.Default.xyMasFeedRate);
            axisZ = new AxisZ(z, Settings.Default.zMasFeedRate);
            taladro = new Taladro();

            fresadora = new Main(port,axisXY,axisZ,taladro);
            index = 0;
        }