Esempio n. 1
0
        public void DrawPaths( Job job, Graphics dc )
        {
            Pos pos = new Pos();

            foreach ( Path path in job.paths )
            {
                if (path.type == Path.Type.Move)
                {
                    DrawPath(job, dc, path);
                }
            }
        }
Esempio n. 2
0
        public void DrawPath(Job job, Graphics dc, Path path)
        {
            Pen pen = null;
            switch (path.type)
            {
                case Path.Type.Move:
                    pen = penMove;
                    break;
            }

            foreach (Command com in path.commands)
            {

            }
        }
Esempio n. 3
0
        public void DrawJob( Job job, Graphics dc )
        {
            if( job.commands == null )
            {
                return;
            }

            if( (mode & Mode.Raw) == Mode.Raw )
            {
                // Raw is exclusive
                DrawRaw( job, dc );
            }
            else
            {
                DrawPaths( job, dc );
            }
        }
Esempio n. 4
0
        public MainForm()
        {
            InitializeComponent();

            MainForm.CheckForIllegalCrossThreadCalls = false;

            this.MouseWheel += new MouseEventHandler( graphPanel_MouseWheel );
            job = new Job();
            comms = new Comms( new SerialOutput( OutputConsole ) );
            comms.Enumerate();

            comboBoxConnect.Items.Clear();
            foreach( string port in comms.portList )
            {	comboBoxConnect.Items.Add( port );}

            draw = new Draw();

            //			if(autoconnect)
            //			{
            //				comms.Connect();
            //			}
        }
Esempio n. 5
0
        public void DrawRaw( Job job, Graphics dc )
        {
            Pos pos = new Pos();

            foreach( Command com in job.commands )
            {
                if( com.type == 'G' )
                {
                    // Move
                    if( com.code == 0 )
                    {
                        Pos posDest = new Pos();
                        posDest.X = com.pos.X;
                        posDest.Y = com.pos.Y;
                        if( K40Controller.Properties.Settings.Default.drawMoves )
                        {
                            DrawLine( dc, penMove, pos, posDest );
                        }
                        pos = posDest;
                    }

                    // Move cut line
                    if( com.code == 1 )
                    {
                        Pos posDest = new Pos();
                        posDest.X = com.pos.X;
                        posDest.Y = com.pos.Y;
                        if( K40Controller.Properties.Settings.Default.drawCuts )
                        {
                            DrawLine( dc, penCut, pos, posDest );
                        }
                        pos = posDest;
                    }

                    // Move cut arc CW
                    if( com.code == 2 )
                    {
                        Pos posDest = new Pos();
                        posDest.X = com.pos.X;
                        posDest.Y = com.pos.Y;
                        if( K40Controller.Properties.Settings.Default.drawCuts )
                        {
                            DrawLine( dc, penCut, pos, posDest );
                        }
                        pos = posDest;
                    }

                    // Move cut arc CCW
                    if( com.code == 3 )
                    {
                        Pos posDest = new Pos();
                        posDest.X = com.pos.X;
                        posDest.Y = com.pos.Y;
                        if( K40Controller.Properties.Settings.Default.drawCuts )
                        {
                            DrawLine( dc, penCut, posDest, pos );
                        }
                        pos = posDest;
                    }
                }
            }
        }