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


C# Telegram.objectInfo方法代码示例

本文整理汇总了C#中NewWDS.Telegram.objectInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Telegram.objectInfo方法的具体用法?C# Telegram.objectInfo怎么用?C# Telegram.objectInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NewWDS.Telegram的用法示例。


在下文中一共展示了Telegram.objectInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: telegramFromPortHandler

        public int telegramFromPortHandler(Telegram telegram)
        {
            if (telegram.type == TelegramType.PortHandlerTerminated)
            {
                this._closeCtrl.portHandlerClosed(telegram.portHandler);
                return 0;
            }
            GlobalServices.LogMsg(this._uniqAppId, telegram.objectInfo());
            this.txtReplyTele.Text = telegram.objectInfo();
            switch (telegram.type)
            {
                case TelegramType.AcknowledgeOK:
                    this.txtTelegramData.Text = telegram.data.objectInfo(true);
                    break;

                case TelegramType.AcknowledgeERROR:
                    this.txtTelegramData.Text = telegram.data.objectInfo(true);
                    break;

                case TelegramType.DataAcknowledgeOK:
                    this.txtDataPacket.Text = telegram.data.objectInfo(telegram.data.NumItems - 12, telegram.data.NumItems - 9, true);
                    this.txtTelegramData.Text = telegram.data.objectInfo(true);
                    break;

                case TelegramType.DataAcknowledgeERROR:
                    this.txtTelegramData.Text = telegram.data.objectInfo(true);
                    break;

                case TelegramType.SeriesEndOK:
                case TelegramType.SeriesEndERROR:
                    this.txtCommandTele.Text = "Series execution finished";
                    break;

                case TelegramType.DeviceFailure:
                    GlobalServices.ErrMsg("telegramFromPortHandler()", "DeviceFailure telegram type received: " + ((TelegramType) telegram.type).ToString());
                    break;

                default:
                    GlobalServices.ErrMsg("telegramFromPortHandler()", "Unexpected telegram type received: " + ((TelegramType) telegram.type).ToString());
                    break;
            }
            return 0;
        }
开发者ID:x893,项目名称:WDS,代码行数:43,代码来源:AppWin_IOPHTest.cs

示例2: telegramFromPortHandler

        public int telegramFromPortHandler(Telegram telegram)
        {
            if (telegram.type == TelegramType.PortHandlerTerminated)
            {
                this._closeCtrl.portHandlerClosed(telegram.portHandler);
                return 0;
            }
            switch (telegram.userData)
            {
                case 2:
                {
                    this.ButtonWrite2.Enabled = true;
                    object obj2 = this.textBoxWrite2Result.Text;
                    this.textBoxWrite2Result.Text = string.Concat(new object[] {
                        obj2, "Telegram received: uniqId: '", ((int) telegram.uniqId).ToString(), "'  parentUniqId: '", ((int) telegram.parentUniqId).ToString(), "'  type: '", ((TelegramType) telegram.type).ToString(), "'  protocol: '", telegram.protocol.ToString(), "'  expectedReplySize: '", ((int) telegram.replySize).ToString(), "'  receivedSize: '", telegram.data.NumItems, "'  usedData: '", ((UsrAppID) telegram.userData).ToString(), "'  data:--|",
                        telegram.data.objectInfo(true), "|--\r\n"
                     });
                    this.textBoxWrite2.Clear();
                    goto Label_02D7;
                }
                case 3:
                    switch (telegram.type)
                    {
                        case TelegramType.AcknowledgeOK:
                        case TelegramType.DataAcknowledgeOK:
                            if (this.btnLED2.Text == "LED")
                            {
                                this.btnLED2.Text = "LED C";
                            }
                            else
                            {
                                this.btnLED2.Text = "LED";
                            }
                            goto Label_0097;
                    }
                    break;

                default:
                    GlobalServices.ErrMsg(this._appId, "telegramFromPortHandler(): Unexpected telegram received: " + telegram.objectInfo());
                    goto Label_02D7;
            }
            Label_0097:
            this.btnLED2.Enabled = true;
            string text = this.textBoxWrite2Result.Text;
            this.textBoxWrite2Result.Text = text + "Telegram received: uniqId: '" + ((int) telegram.uniqId).ToString() + "'  parentUniqId: '" + ((int) telegram.parentUniqId).ToString() + "'  type: '" + ((TelegramType) telegram.type).ToString() + "'  protocol: '" + telegram.protocol.ToString() + "'  replySize: '" + ((int) telegram.replySize).ToString() + "'  usedData: '" + ((UsrAppID) telegram.userData).ToString() + "'  data:--|" + telegram.data.objectInfo(true) + "|--\r\n";
            Label_02D7:
            switch (telegram.type)
            {
                case TelegramType.AcknowledgeOK:
                case TelegramType.AcknowledgeERROR:
                case TelegramType.DataAcknowledgeOK:
                case TelegramType.DataAcknowledgeERROR:
                case TelegramType.SeriesEndOK:
                case TelegramType.SeriesEndERROR:
                    break;

                case TelegramType.DeviceFailure:
                    GlobalServices.ErrMsg("DeviceFailure telegram type received: " + ((TelegramType) telegram.type).ToString(), "telegramFromPortHandler()");
                    break;

                default:
                    GlobalServices.ErrMsg(this._appId, "telegramFromPortHandler(): Unexpected telegram type received: " + ((TelegramType) telegram.type).ToString());
                    break;
            }
            return 0;
        }
开发者ID:x893,项目名称:WDS,代码行数:66,代码来源:AppWin_FTDITest.cs


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