示例#1
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;
        }
示例#2
0
 public AxisXY(Axis axisX, Axis axisY, float maxFeedRate)
 {
     this.axisX = axisX;
     this.axisY = axisY;
     this.maxFeedRate = maxFeedRate;
 }
示例#3
0
 void stepsToDo(Axis axis, float position)
 {
     if (position > axis.actualPosition && position < 0)
         axis.setStepsToDo((axis.actualPosition - position) * -1);
     else
         axis.setStepsToDo(position - axis.actualPosition);
 }
示例#4
0
 void setTime(Axis axis)
 {
     if (axis.stepsToDo != 0)
     {
         axis.setTimePerStep(msecondsToDoThis);
         axis.setTimeNextStep(time);
     }
 }
示例#5
0
 void doStep(Axis axis)
 {
     Main.data &= axis.mask;
     Main.data |= axis.getNextStep();
     axis.setTimeNextStep(axis.timeNextStep);
     Main.Refresh();
 }
示例#6
0
 public AxisZ(Axis axisZ, float maxFeedRate)
 {
     this.axisZ = axisZ;
     this.maxFeedRate = maxFeedRate;
 }