void btnCurrPos_Click(object sender, EventArgs e)
        {
            if (parameters.WPos == "") // If not blank then MPG is polling
            {
                Comms.com.WriteByte(GrblLegacy.ConvertRTCommand(GrblConstants.CMD_STATUS_REPORT_ALL));
            }

            awaitCoord = true;

            while (awaitCoord)
            {
                Application.DoEvents(); // TODO: add timeout?
            }
            //System.Threading.Thread.Sleep(500);

            double[] position;

            if (parameters.MPos == "")
            {
                position = Parse.Decimals(parameters.WPos);
                double[] offset = Parse.Decimals(parameters.WCO);
                for (int i = 0; i < offset.Length; i++)
                {
                    position[i] += offset[i];
                }
            }
            else
            {
                position = Parse.Decimals(parameters.MPos);
            }

            if (position.Length >= 3)
            {
                cvXOffset.Value = position[0];
                cvYOffset.Value = position[1];
                cvZOffset.Value = position[2];
            }

            parameters.Clear();
        }
Exemple #2
0
 public void CycleStart()
 {
     if (this.grblState.State == GrblStates.Hold || this.grblState.State == GrblStates.Tool || (this.grblState.State == GrblStates.Run && this.grblState.Substate == 1))
     {
         Comms.com.WriteByte(GrblLegacy.ConvertRTCommand(GrblConstants.CMD_CYCLE_START));
     }
     else if (this.file.Loaded)
     {
         txtRunTime.Text = "";
         this.ACKPending = this.CurrLine = this.serialUsed = 0;
         this.pgmStarted = false;
         System.Threading.Thread.Sleep(250);
         Comms.com.PurgeQueue();
         if (GrblMessage != null)
         {
             GrblMessage("");
         }
         this.nextRow = file.Data.Rows[0];
         JobTimer.Start();
         SetStreamingState(StreamingState.Send);
         //         this.DataReceived("!start");
     }
 }
 void pollTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     Comms.com.WriteByte(GrblLegacy.ConvertRTCommand(GrblConstants.CMD_STATUS_REPORT));
 }
Exemple #4
0
 void btnHold_Click(object sender, EventArgs e)
 {
     Comms.com.WriteByte(GrblLegacy.ConvertRTCommand(GrblConstants.CMD_FEED_HOLD));
 }