当前位置: 首页>>代码示例>>C#>>正文


C# CommandMessenger.ReceivedCommand类代码示例

本文整理汇总了C#中CommandMessenger.ReceivedCommand的典型用法代码示例。如果您正苦于以下问题:C# ReceivedCommand类的具体用法?C# ReceivedCommand怎么用?C# ReceivedCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ReceivedCommand类属于CommandMessenger命名空间,在下文中一共展示了ReceivedCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnPlotDataPoint

        // Callback function that plots a data point for the current temperature, the goal temperature,
        // the heater steer value and the Pulse Width Modulated (PWM) value.
        private void OnPlotDataPoint(ReceivedCommand arguments)
        {
            var time = arguments.ReadBinFloatArg();
            var currTemp = arguments.ReadBinFloatArg();
            var goalTemp = arguments.ReadBinFloatArg();
            var heaterValue = arguments.ReadBinFloatArg();
            var heaterPwm = arguments.ReadBinBoolArg();

            _chartForm.UpdateGraph(time, currTemp, goalTemp, heaterValue, heaterPwm);
        }
开发者ID:nkiest,项目名称:Arduino-Libraries,代码行数:12,代码来源:TemperatureControl.cs

示例2: InvokeCallBack

 /// <summary> Helper function to Invoke or directly call callback function. </summary>
 /// <param name="messengerCallbackFunction"> The messenger callback function. </param>
 /// <param name="command">                   The command. </param>
 private void InvokeCallBack(MessengerCallbackFunction messengerCallbackFunction, ReceivedCommand command)
 {
     if (messengerCallbackFunction != null)
     {
         if (_controlToInvokeOn != null && _controlToInvokeOn.InvokeRequired)
         {
             //Asynchronously call on UI thread
             _controlToInvokeOn.Invoke(new MessengerCallbackFunction(messengerCallbackFunction), (object) command);
         }
         else
         {
             //Directly call
             messengerCallbackFunction(command);
         }
     }
 }
开发者ID:nuclearcanary,项目名称:Arduino-Libraries,代码行数:19,代码来源:CmdMessenger.cs

示例3: OnReceiveSeries

        // Callback function To receive the plain text float series from the Arduino
        void OnReceiveSeries(ReceivedCommand arguments)
        {
            if (_receivedItemsCount % (SeriesLength / 10) == 0)
                Common.WriteLine(_receivedItemsCount+ " Received value: " + arguments.ReadFloatArg());
            if (_receivedItemsCount == 0)
            {
                // Received first value, start stopwatch
                _beginTime = Millis;
            }

            _receivedItemsCount++;
            _receivedBytesCount += CountBytesInCommand(arguments, false);
        }
开发者ID:nkiest,项目名称:Arduino-Libraries,代码行数:14,代码来源:TransferSpeed.cs

示例4: OnUnknownCommand

 // ------------------  C A L L B A C K S ---------------------
 // Called when a received command has no attached function.
 void OnUnknownCommand(ReceivedCommand arguments)
 {
     Console.WriteLine("Command without attached callback received");
 }
开发者ID:c37-cae,项目名称:T-Bone,代码行数:6,代码来源:SendAndReceiveBinaryArguments.cs

示例5: HandleMessage

 /// <summary> Handle message. </summary>
 /// <param name="receivedCommand"> The received command. </param>
 public void HandleMessage(ReceivedCommand receivedCommand)
 {
     MessengerCallbackFunction callback = null;
     //var commandId = -1;
     //ReceivedCommand receivedCommand;
     if (receivedCommand.Ok)
     {
         //receivedCommand = new ReceivedCommand(commandString);
         if (_callbackList.ContainsKey(receivedCommand.CommandId))
         {
             callback = _callbackList[receivedCommand.CommandId];
         }
         else
         {
             if (_defaultCallback != null) callback = _defaultCallback;
         }
     }
     else
     {
         // Empty command
         receivedCommand = new ReceivedCommand();
     }
     InvokeCallBack(callback, receivedCommand);
 }
开发者ID:nuclearcanary,项目名称:Arduino-Libraries,代码行数:26,代码来源:CmdMessenger.cs

示例6: UnknownCommand

 private void UnknownCommand(ReceivedCommand args)
 {
     throw new NotSupportedException(Properties.Resources.UnknownCommand);
 }
开发者ID:tostiheld,项目名称:portfolio,代码行数:4,代码来源:Commander.cs

示例7: InvokeCallBack

        /// <summary> Helper function to Invoke or directly call callback function. </summary>
        /// <param name="messengerCallbackFunction"> The messenger callback function. </param>
        /// <param name="command">                   The command. </param>
        private void InvokeCallBack(MessengerCallbackFunction messengerCallbackFunction, ReceivedCommand command)
        {
            if (messengerCallbackFunction == null || (ControlToInvokeOn != null && ControlToInvokeOn.IsDisposed)) return;

            if (ControlToInvokeOn != null)
            {
                //Asynchronously call on UI thread
                ControlToInvokeOn.BeginInvoke(new MessengerCallbackFunction(messengerCallbackFunction), (object)command);
            }
            else
            {
                //Directly call
                messengerCallbackFunction(command);
            }
        }
开发者ID:DiLRandI,项目名称:Arduino-CmdMessenger,代码行数:18,代码来源:CmdMessenger.cs

示例8: OnUnknownCommand

 private void OnUnknownCommand(ReceivedCommand receivedCommand)
 {
     Debug.WriteLine("Unknown command");
     OnErrorEvent("Error > Unknown command");
 }
开发者ID:zigorrom,项目名称:MeasurementChannelSwitch,代码行数:5,代码来源:ChannelSwitch.cs

示例9: OnWatchdog

 private void OnWatchdog(ReceivedCommand receivedCommand)
 {
     Debug.WriteLine(String.Format("Watchdog > {0}", receivedCommand.CommandString()));
 }
开发者ID:zigorrom,项目名称:MeasurementChannelSwitch,代码行数:4,代码来源:ChannelSwitch.cs

示例10: OnAcknowledge

 private void OnAcknowledge(ReceivedCommand receivedCommand)
 {
     Debug.WriteLine(receivedCommand.CommandString());
     //var a = receivedCommand.ReadInt16Arg();
     //var b = receivedCommand.ReadBoolArg();
     //Debug.WriteLine(String.Format("channel number: {0}, status {1}", a,b));
 }
开发者ID:zigorrom,项目名称:MeasurementChannelSwitch,代码行数:7,代码来源:ChannelSwitch.cs

示例11: OnError

 private void OnError(ReceivedCommand receivedCommand)
 {
     Debug.WriteLine(String.Format("Error > {0}", receivedCommand.CommandString()));
     OnErrorEvent(String.Format("Error > {0}", receivedCommand.CommandString()));
 }
开发者ID:zigorrom,项目名称:MeasurementChannelSwitch,代码行数:5,代码来源:ChannelSwitch.cs

示例12: OnButton1

        void OnButton1(ReceivedCommand arguments)
        {
            //Thread.Sleep(1000);
            Debug.Log("Arduino Button1: ");
              //  test = arguments.ReadInt32Arg();
               // Debug.Log(test);

               // var cmd_return = new SendCommand((int)Command.SetLed);

               // _cmdMessenger.SendCommand(cmd_return);
        }
开发者ID:Michaelwolf95,项目名称:ArduinoProject,代码行数:11,代码来源:SandR_mono_ui.cs

示例13: OnUnknownCommand

 void OnUnknownCommand(ReceivedCommand arguments)
 {
     Debug.Log("Command without attached callback received");
 }
开发者ID:Michaelwolf95,项目名称:ArduinoProject,代码行数:4,代码来源:SandR_mono_ui.cs

示例14: InvokeCallBack

        /// <summary> Helper function to Invoke or directly call callback function. </summary>
        /// <param name="messengerCallbackFunction"> The messenger callback function. </param>
        /// <param name="command">                   The command. </param>
        private void InvokeCallBack(MessengerCallbackFunction messengerCallbackFunction, ReceivedCommand command)
        {
            if (messengerCallbackFunction == null) return;

            //Directly call
            messengerCallbackFunction(command);
        }
开发者ID:Vrijdagonline,项目名称:petduino-connect,代码行数:10,代码来源:CmdMessenger.cs

示例15: OnAcknowledge

 // Callback function that prints that the Arduino has acknowledged
 void OnAcknowledge(ReceivedCommand arguments)
 {
     Console.WriteLine(@" Arduino is ready");
 }
开发者ID:vikramt,项目名称:Arduino,代码行数:5,代码来源:ArduinoController.cs


注:本文中的CommandMessenger.ReceivedCommand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。