| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.IO;
- using System.Text;
- using WCS.Entity;
- namespace WCS.Core
- {
- /// <summary>
- /// 配置中心
- /// </summary>
- public static class Configs
- {
- #region 配置中心
-
- #endregion
- /// <summary>
- /// ProtocolProxyBase在业务中具体实现类的Type
- /// </summary>
- public static Type ProtocolProxyBaseType { get; set; }
- #region 系统运行模式
- /// <summary>
- /// 系统运行模式
- /// </summary>
- private static List<SystemMode> SystemModes { get; set; } = new List<SystemMode>();
- /// <summary>
- /// 添加一种模式
- /// </summary>
- /// <param name="mode">系统模式</param>
- public static void AddSystemMode(SystemMode mode)
- {
- if (SystemModes.Contains(mode)) return;
- SystemModes.Add(mode);
- }
- /// <summary>
- /// 是否包含传入模式
- /// </summary>
- /// <param name="mode">系统模式</param>
- /// <returns></returns>
- public static bool Any(SystemMode mode)
- {
- return SystemModes.Contains(mode);
- }
- #endregion
- /// <summary>
- /// 默认的字符串编码类型
- /// </summary>
- public static Encoding StringEncoding { get; set; }
- /// <summary>
- /// 用户写入PLC记录
- /// </summary>
- public static Action<Action<WCS_CMD>> DoCmds { get; set; }
- #region 异常上抛WMS
- /// <summary>
- /// 异常发布事件
- /// </summary>
- public static event Action PublishEvent;
- /// <summary>
- /// 触发一下异常发布
- /// </summary>
- internal static void Publish()
- {
- PublishEvent?.Invoke();
- }
- /// <summary>
- /// 待上传的WMS的异常信息队列
- /// </summary>
- public static Action<string, string> UploadException { get; set; }
- #endregion 异常上抛WMS
- }
- /// <summary>
- /// 系统模式
- /// </summary>
- public enum SystemMode
- {
- /// <summary>
- /// 虚拟plc,启用该模式后,将在Redis中建立一个虚拟PLC用于流程测试
- /// </summary>
- 虚拟plc = 1,
- }
- }
|