|
- using System.ComponentModel;
- using System.Reflection;
- using System.Reflection.Emit;
-
- namespace BPASmartClient.MessageName
- {
- /// <summary>
- /// 消息名称管理中心---不在使用
- /// 特性:Category,消息分组
- /// Description,消息备注
- /// Browsable,是否使用
- /// 消息发送案例:
- /// Class_InnerMessageBus.GetInstance().PostMessage(this, MessageName.xxx, "12321");
- /// 接收数据案例:
- /// Class_InnerMessageBus.GetInstance().ListenMessage(this, MessageName.xxx, "xxnameHandler");
- /// public void xxnameHandler(object sender, InnerMessageEventArgs e) { }
- /// </summary>
- //public class MessageName
- //{
- // #region XX消息
- // /// <summary>
- // /// xxx消息
- // /// </summary>
- // [Category("消息分组"),Description("消息备注"),Browsable(true)]
- // public static string xxx = "xxx";
- // #endregion
-
-
- // #region 滚动线消息事件管理中心
- // /// <summary>
- // /// 滚动线控制滚动消息
- // /// </summary>
- // [Category("滚动线"), Description("滚动线控制滚动"), Browsable(true)]
- // public static string ConveyorBeltIsRun = "ConveyorBeltIsRun";
- // /// <summary>
- // /// 滚动线控制左转
- // /// </summary>
- // [Category("滚动线"), Description("滚动线控制左转"), Browsable(true)]
- // public static string ConveyorBeltLeft = "ConveyorBeltLeft";
- // /// <summary>
- // /// 滚动线控制右转
- // /// </summary>
- // [Category("滚动线"), Description("滚动线控制右转"), Browsable(true)]
- // public static string ConveyorBeltRight = "ConveyorBeltRight";
- // /// <summary>
- // /// 滚动线控制停止
- // /// </summary>
- // [Category("滚动线"), Description("滚动线控制停止"), Browsable(true)]
- // public static string ConveyorBeltStop = "ConveyorBeltStop";
- // #endregion
- //}
-
- /// <summary>
- /// 消息名称管理中心-枚举
- /// </summary>
- public enum MessageNameEnum
- {
- /// <summary>
- /// 无
- /// </summary>
- Null,
- /// <summary>
- /// 物料仓运行状态
- /// </summary>
- SilosRunStatus,
- /// <summary>
- /// 物料仓数据设置
- /// </summary>
- SilosSetData,
-
- /// <summary>
- /// 滚动线运行状态
- /// </summary>
- ConveyorBeltRunStatus,
-
- /// <summary>
- /// 发送消息
- /// </summary>
- SendMessageName,
- /// <summary>
- /// 接收消息
- /// </summary>
- ReceiveMessageName,
- }
-
- /// <summary>
- /// 消息基类
- /// </summary>
- public class MessageBase
- {
- /// <summary>
- /// 消息号
- /// </summary>
- public string MeaageID { get; set; }
- // <summary>
- /// 消息名称:枚举
- /// </summary>
- public MessageNameEnum MeaageName { get; set; }
-
- public MessageBase()
- {
- MeaageID = GetMessageID.GetID();
- }
- }
-
- /// <summary>
- /// 四位消息号
- /// </summary>
- public static class GetMessageID
- {
- public static int i = 0;
- public static string GetID()
- {
- i++;
- return ((Convert.ToInt32(i) + 1).ToString().PadLeft(8, '0'));
- }
- }
-
- }
|