예제 #1
0
        private static void DoTheJob()
        {
            while (!EX.WaitOne(0))
            {
                int handle = System.Threading.WaitHandle.WaitAny(new System.Threading.WaitHandle[] { EV, EX });

                if (handle == 0)
                {
                    if (C.CanSendFile)
                    {
                        C.RunProgram();
                    }
                    else if (C.CanResumeHold)
                    {
                        C.CycleStartResume(false);
                    }
                    else if (C.CanFeedHold)
                    {
                        C.FeedHold(false);
                    }

                    System.Threading.Thread.Sleep(1000);                     //do not test the flag for 1 sec
                }
            }
        }
예제 #2
0
        private static void DoTheJob()
        {
            while (true)
            {
                EV.WaitOne();

                if (C.CanSendFile)
                {
                    C.RunProgram();
                }
                else if (C.CanResumeHold)
                {
                    C.CycleStartResume(false);
                }

                System.Threading.Thread.Sleep(1000);                 //do not test the flag for 1 sec
            }
        }
예제 #3
0
        private bool PerformAction(HotKey.Actions action)
        {
            switch (action)
            {
            case HotKey.Actions.ConnectDisconnect:
                mCore.HKConnectDisconnect(); break;

            case HotKey.Actions.Connect:
                mCore.HKConnect(); break;

            case HotKey.Actions.Disconnect:
                mCore.HKDisconnect(); break;

            case HotKey.Actions.OpenFile:
                mCore.OpenFile(Application.OpenForms[0]); break;

            case HotKey.Actions.ReopenLastFile:
                mCore.ReOpenFile(Application.OpenForms[0]); break;

            case HotKey.Actions.SaveFile:
                mCore.SaveProgram(); break;

            case HotKey.Actions.ExecuteFile:
                mCore.RunProgram(); break;

            case HotKey.Actions.AbortFile:
                mCore.AbortProgram(); break;

            case HotKey.Actions.HelpOnline:
                mCore.HelpOnLine(); break;

            case HotKey.Actions.Reset:
                mCore.GrblReset(); break;

            case HotKey.Actions.Homing:
                mCore.GrblHoming(); break;

            case HotKey.Actions.Unlock:
                mCore.GrblUnlock(); break;

            case HotKey.Actions.PauseJob:
                mCore.FeedHold(); break;

            case HotKey.Actions.ResumeJob:
                mCore.CycleStartResume(); break;

            case HotKey.Actions.SetNewZero:
                mCore.SetNewZero(); break;

            case HotKey.Actions.JogHome:
                RequestJog(GrblCore.JogDirection.Home); break;

            case HotKey.Actions.JogN:
                RequestJog(GrblCore.JogDirection.N); break;

            case HotKey.Actions.JogNE:
                RequestJog(GrblCore.JogDirection.NE); break;

            case HotKey.Actions.JogE:
                RequestJog(GrblCore.JogDirection.E); break;

            case HotKey.Actions.JogSE:
                RequestJog(GrblCore.JogDirection.SE); break;

            case HotKey.Actions.JogS:
                RequestJog(GrblCore.JogDirection.S); break;

            case HotKey.Actions.JogSW:
                RequestJog(GrblCore.JogDirection.SW); break;

            case HotKey.Actions.JogW:
                RequestJog(GrblCore.JogDirection.W); break;

            case HotKey.Actions.JogNW:
                RequestJog(GrblCore.JogDirection.NW); break;

            case HotKey.Actions.OverridePowerDefault:
            case HotKey.Actions.OverridePowerUp:
            case HotKey.Actions.OverridePowerDown:
            case HotKey.Actions.OverrideLinearDefault:
            case HotKey.Actions.OverrideLinearUp:
            case HotKey.Actions.OverrideLinearDown:
            case HotKey.Actions.OverrideRapidDefault:
            case HotKey.Actions.OverrideRapidUp:
            case HotKey.Actions.OverrideRapidDown:
                mCore.HotKeyOverride(action); break;

            case HotKey.Actions.CustomButton1:
                EmulateCustomButtonDown(0); break;

            case HotKey.Actions.CustomButton2:
                EmulateCustomButtonDown(1); break;

            case HotKey.Actions.CustomButton3:
                EmulateCustomButtonDown(2); break;

            case HotKey.Actions.CustomButton4:
                EmulateCustomButtonDown(3); break;

            case HotKey.Actions.CustomButton5:
                EmulateCustomButtonDown(4); break;

            case HotKey.Actions.CustomButton6:
                EmulateCustomButtonDown(5); break;

            case HotKey.Actions.CustomButton7:
                EmulateCustomButtonDown(6); break;

            case HotKey.Actions.CustomButton8:
                EmulateCustomButtonDown(7); break;

            case HotKey.Actions.CustomButton9:
                EmulateCustomButtonDown(8); break;

            case HotKey.Actions.CustomButton10:
                EmulateCustomButtonDown(9); break;

            default:
                break;
            }

            //ConnectDisconnect = 10, Connect = 11, Disconnect = 12,
            //OpenFile = 20, ReopenLastFile = 21, SaveFile = 22, ExecuteFile = 23,
            //HelpOnline = 30,
            //Reset = 100, Homing = 101, Unlock = 102,  PauseJob = 103, ResumeJob = 104, SetNewZero = 105,
            //JogHome = 1000, JogN = 1001, JogNE = 1002, JogE = 1003, JogSE = 1004, JogS = 1005, JogSO = 1006, JogO = 1007, JogNO = 1008,
            //CustomButton1 = 2000, CustomButton2 = 2001, CustomButton3 = 2002, CustomButton4 = 2003, CustomButton5 = 2004, CustomButton6 = 2005, CustomButton7 = 2006, CustomButton8 = 2007, CustomButton9 = 2008, CustomButton10 = 2009

            return(true);
        }
예제 #4
0
 void BtnResumeClick(object sender, EventArgs e)
 {
     Core.CycleStartResume(false);
 }
예제 #5
0
 private void ResumeButtonClick(object sender, EventArgs e)
 {
     Core.CycleStartResume(false);
 }