예제 #1
0
 public void RunJogCommand(string direction, bool goplus, Mach4.IMyScriptObject script)
 {
     Script = script;
     //doJOG(direction, goplus);
     var t = new Thread(() => doJOG(direction, goplus));
        t.Start();
 }
예제 #2
0
        public Form1()
        {
            InitializeComponent();

            Mach   = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
            Script = (Mach4.IMyScriptObject)Mach.GetScriptDispatch();

            InitializeBackgroundWorker();
            this.FormClosing += new FormClosingEventHandler(Form_FormClosing);

            dtFeeders = cf.POPFeedersTable();

            LoadSettings();
            Thread thrdRemote = new Thread(new ThreadStart(initRemote));

            thrdRemote.Start();
            thrdRemote.IsBackground = true;

            /*
             * comboBoxManualReelFeeder.DisplayMember = "feederNumber";
             * comboBoxManualReelFeeder.ValueMember = "feederNumber";
             * comboBoxManualReelFeeder.DataSource = dtFeeders;
             * comboBoxManualReelFeeder.SelectedIndex = 0;
             */
            csvload.SetupGridView(dataGridView1);


            // setup manual feeder single picker list
        }
예제 #3
0
 private void CheckFeederReady(Mach4.IMyScriptObject script)
 {
     while (script.IsActive(INPUT1) != 0)
     {
         Thread.Sleep(50);
     }
 }
예제 #4
0
파일: Form1.cs 프로젝트: DXPower/M3EX
        // Hook into running Mach3 instance.
        // TODO: Detect if Mach3 is not running, then start it manually through referenced EXE
        public Form1()
        {
            InitializeComponent();

            directory = System.IO.Directory.GetCurrentDirectory();
            mach      = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
            script    = (Mach4.IMyScriptObject)mach.GetScriptDispatch();
        }
예제 #5
0
        public void RunJogCommand(string direction, bool goplus, Mach4.IMyScriptObject script)

        {
            Script = script;
            //doJOG(direction, goplus);
            var t = new Thread(() => doJOG(direction, goplus));

            t.Start();
        }
예제 #6
0
 public bool RunMach3Command(Mach4.IMyScriptObject script, string command)
 {
     try
     {
         Script.Code(command);
     }
     catch (Exception e) { MessageBox.Show(e.ToString()); }
     try
     {
         while (script.IsMoving() != 0)
         {
             Thread.Sleep(10);
         }
     }
     catch (Exception e) { MessageBox.Show(e.ToString()); }
     return(true);
 }
예제 #7
0
 public bool RunMach3Command(Mach4.IMyScriptObject script, string command)
 {
     SetCurrentCommandText(command);
     try
     {
         script.Code(command);
     }
     catch { }
     try
     {
         while (script.IsMoving() != 0)
         {
             Thread.Sleep(10);
         }
     }
     catch { }
     return(true);
 }
예제 #8
0
        public Form1()
        {
            InitializeComponent();

            // Create the USB reference device object (passing VID and PID)
            usbController = new usbDevice(0x04D8, 0x0042);

            // Add a listener for usb events
            usbController.usbEvent += new usbDevice.usbEventsHandler(usbEvent_receiver);

            // Perform an initial search for the target device
            usbController.findTargetDevice();


            Mach   = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
            Script = (Mach4.IMyScriptObject)Mach.GetScriptDispatch();

            InitializeBackgroundWorker();
            this.FormClosing += new FormClosingEventHandler(Form_FormClosing);

            dtFeeders = cf.POPFeedersTable();

            LoadSettings();


            RunBoardInit();
            Thread thrdRemote = new Thread(new ThreadStart(initRemote));

            thrdRemote.Start();
            thrdRemote.IsBackground = true;

            /*
             * comboBoxManualReelFeeder.DisplayMember = "feederNumber";
             * comboBoxManualReelFeeder.ValueMember = "feederNumber";
             * comboBoxManualReelFeeder.DataSource = dtFeeders;
             * comboBoxManualReelFeeder.SelectedIndex = 0;
             */
            csvload.SetupGridView(dataGridView1);


            // setup manual feeder single picker list
        }
예제 #9
0
        public Form1()
        {
            InitializeComponent();

            Mach = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
            Script = (Mach4.IMyScriptObject)Mach.GetScriptDispatch();

            InitializeBackgroundWorker();
            this.FormClosing += new FormClosingEventHandler(Form_FormClosing);

            dtFeeders = cf.POPFeedersTable();

            LoadSettings();
            Thread thrdRemote = new Thread(new ThreadStart(initRemote));
            thrdRemote.Start();
            thrdRemote.IsBackground = true;

            /*
            comboBoxManualReelFeeder.DisplayMember = "feederNumber";
            comboBoxManualReelFeeder.ValueMember = "feederNumber";
            comboBoxManualReelFeeder.DataSource = dtFeeders;
            comboBoxManualReelFeeder.SelectedIndex = 0;
            */
            csvload.SetupGridView(dataGridView1);

            // setup manual feeder single picker list
        }
예제 #10
0
        public Form1()
        {
            InitializeComponent();

            // Create the USB reference device object (passing VID and PID)
            usbController = new usbDevice(0x04D8, 0x0042);

            // Add a listener for usb events
            usbController.usbEvent += new usbDevice.usbEventsHandler(usbEvent_receiver);

            // Perform an initial search for the target device
            usbController.findTargetDevice();

            Mach = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
            Script = (Mach4.IMyScriptObject)Mach.GetScriptDispatch();

            InitializeBackgroundWorker();
            this.FormClosing += new FormClosingEventHandler(Form_FormClosing);

            dtFeeders = cf.POPFeedersTable();

            LoadSettings();

            RunBoardInit();
            Thread thrdRemote = new Thread(new ThreadStart(initRemote));
            thrdRemote.Start();
            thrdRemote.IsBackground = true;

            /*
            comboBoxManualReelFeeder.DisplayMember = "feederNumber";
            comboBoxManualReelFeeder.ValueMember = "feederNumber";
            comboBoxManualReelFeeder.DataSource = dtFeeders;
            comboBoxManualReelFeeder.SelectedIndex = 0;
            */
            csvload.SetupGridView(dataGridView1);

            // setup manual feeder single picker list
        }