コード例 #1
0
 private void OnRaiseDIYCommandEvent(object sender, CommandEventArgs e)
 {
     if (e.RealTimeCommand > 0x00)
     {
         if (!isStreaming || isStreamingPause)
         {
             sendRealtimeCommand(e.RealTimeCommand);
         }
     }
     else
     {
         if ((!isStreaming || isStreamingPause) && !_serial_form.isHeightProbing)  // only hand over DIY commands in normal mode
         {
             sendCommand(e.Command);
         }
         if (e.Command.StartsWith("(PRB:Z"))
         {
             string num = e.Command.Substring(6);
             double myZ;
             num        = num.Trim(')');
             alternateZ = null;
             if (double.TryParse(num, out myZ))
             {
                 alternateZ = myZ;
             }
             else
             {
                 _diyControlPad.sendFeedback("Error in parsing " + num, true);
             }
         }
     }
 }