本文整理汇总了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;
}
示例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;
}