Пример #1
0
        private void Parse10()
        {
            Logger.Log("D10: move axis n steps");

            char axis  = GCodeParser.ReadChar();
            int  steps = GCodeParser.ParseInt();

            if (steps == -1)
            {
                return;
            }

            switch (axis)
            {
            case 'x':
            case 'X':
                DeviceFactory.Get().MoveRawX(steps);
                break;

            case 'y':
            case 'Y':
                DeviceFactory.Get().MoveRawY(steps);
                break;

            case 'z':
            case 'Z':
                DeviceFactory.Get().MoveRawZ(steps);
                break;
            }
        }
Пример #2
0
        private void Setup3dViewer()
        {
            m3dTargetControl           = new Viewer3d();
            m3dTargetControl.Dock      = DockStyle.Fill;
            m3dTargetControl.BackColor = RenderPanel.BackColor;
            this.RenderPanel.Controls.Add(m3dTargetControl);

            mViewDevice = new Viewer3dDevice(m3dTargetControl);
            mViewDevice.Initialize();
            mViewDevice.CodeChanged += new EventHandler(mDevice_CodeChanged);

            DeviceFactory.RegisterDevice(mViewDevice);
        }
Пример #3
0
        private void Setup2dViewer()
        {
            m2dTargetControl      = new Canvas();
            m2dTargetControl.Dock = DockStyle.Fill;

            this.RenderPanel.Controls.Add(m2dTargetControl);

            mViewDevice = new ViewerDevice(m2dTargetControl);
            mViewDevice.Initialize();
            mViewDevice.CodeChanged += new EventHandler(mDevice_CodeChanged);

            DeviceFactory.RegisterDevice(mViewDevice);
        }
Пример #4
0
        // __ Helpers _________________________________________________________


        private static void Initialize()
        {
            if (mDev != null)
            {
                return;
            }

            // Lazy initialization, to allow device registration.

            mDev = DeviceFactory.Get();

            if (mDev == null)
            {
                Logger.Error("Device is not initialized. Can't continue.");
            }
        }
Пример #5
0
        private void Test()
        {
            Device d = DeviceFactory.Get();

            d.MoveAbsoluteLinear(100, 100, 0);
            d.MoveAbsoluteLinear(100, 100, -7);

            //d.MoveRelativeLinear(50, 0, 0);
            //d.MoveRelativeLinear(0, 50, 0);
            //d.MoveRelativeLinear(-50, 0, 0);
            //d.MoveRelativeLinear(0, -50, 0);

            //d.MoveRelativeLinear(0, 0, 7);
            //d.MoveAbsoluteLinear(80, 200, 0);

            //d.MoveRelativeLinear(0, 0, -7);

            //d.MoveRelativeLinear(50, 0, 0);
            //d.MoveRelativeLinear(0, 50, 0);
            //d.MoveRelativeLinear(-50, 0, 0);
            //d.MoveRelativeLinear(0, -50, 0);
        }
Пример #6
0
        public override void Parse()
        {
            float feedRate = (float)GCodeParser.ParseDouble();

            DeviceFactory.Get().SetFeedRate(feedRate);
        }
Пример #7
0
        private void Parse1()
        {
            Logger.Log("D1: Reset axis to 0, 0 on current location");

            DeviceFactory.Get().ResetAxis();
        }