|
@@ -97,15 +97,15 @@ namespace WCS.Service
|
|
|
{
|
|
|
case "WCSDB"://WCS基本数据库
|
|
|
SqlSugarHelper.SetDefault(connectionString.Key);
|
|
|
- _db.CodeFirst.InitTables(typeof(WCS_PlcSet));
|
|
|
- _db.CodeFirst.InitTables(typeof(WCS_PlcDataBlock));
|
|
|
+ //_db.CodeFirst.InitTables(typeof(WCS_PlcSet));
|
|
|
+ //_db.CodeFirst.InitTables(typeof(WCS_PlcDataBlock));
|
|
|
_db.CodeFirst.InitTables(typeof(WCS_PlcData));
|
|
|
- _db.CodeFirst.InitTables(typeof(WCS_DeviceInfo));
|
|
|
- _db.CodeFirst.InitTables(typeof(WCS_DeviceGrp));
|
|
|
- _db.CodeFirst.InitTables(typeof(WCS_DeviceProt));
|
|
|
- _db.CodeFirst.InitTables(typeof(WCS_PathInfo));
|
|
|
- _db.CodeFirst.InitTables(typeof(WCS_PathGrp));
|
|
|
- _db.CodeFirst.InitTables(typeof(WCS_Route));
|
|
|
+ //_db.CodeFirst.InitTables(typeof(WCS_DeviceInfo));
|
|
|
+ //_db.CodeFirst.InitTables(typeof(WCS_DeviceGrp));
|
|
|
+ //_db.CodeFirst.InitTables(typeof(WCS_DeviceProt));
|
|
|
+ //_db.CodeFirst.InitTables(typeof(WCS_PathInfo));
|
|
|
+ //_db.CodeFirst.InitTables(typeof(WCS_PathGrp));
|
|
|
+ //_db.CodeFirst.InitTables(typeof(WCS_Route));
|
|
|
_db.CodeFirst.InitTables(typeof(WCS_TaskInfo));
|
|
|
_db.CodeFirst.InitTables(typeof(WCS_TaskDtl));
|
|
|
_db.CodeFirst.InitTables(typeof(WCS_TaskOld));
|
|
@@ -146,29 +146,29 @@ namespace WCS.Service
|
|
|
|
|
|
#region 创建虚拟PLC
|
|
|
|
|
|
- var isOpenVirtualPlc = RedisHub.Default.Check("isOpenVirtualPLC") ?? throw new Exception("请在Redsi中配置是否启用虚拟PLC");
|
|
|
- if (isOpenVirtualPlc == "1")
|
|
|
- {
|
|
|
- var plcDataConnectionString = RedisHub.Default.Check("plcDataConnectionString") ?? throw new Exception("请在Redsi中配置虚拟PLC使用的Redis连接字符串");
|
|
|
-
|
|
|
- //从现有结构解析出需要的结构
|
|
|
- var list = new List<PLCData>();
|
|
|
- SqlSugarHelper.Do(db =>
|
|
|
- {
|
|
|
- var _db = db.Connect;
|
|
|
- var dataBlocks = _db.Queryable<WCS_PlcDataBlock>().Includes(v => v.PLC).ToList();
|
|
|
- list.AddRange(dataBlocks.Select(dataBlock => new PLCData()
|
|
|
- {
|
|
|
- IP = dataBlock.PLC.IP,
|
|
|
- DB = dataBlock.NO,
|
|
|
- Length = dataBlock.Length,
|
|
|
- DataLength = dataBlock.DataLength,
|
|
|
- }));
|
|
|
- });
|
|
|
- PlcData.Init(plcDataConnectionString).InitPlcData(list);
|
|
|
-
|
|
|
- ServiceHub.AddSystemMode(SystemMode.虚拟plc);
|
|
|
- }
|
|
|
+ //var isOpenVirtualPlc = RedisHub.Default.Check("isOpenVirtualPLC") ?? throw new Exception("请在Redsi中配置是否启用虚拟PLC");
|
|
|
+ //if (isOpenVirtualPlc == "1")
|
|
|
+ //{
|
|
|
+ // var plcDataConnectionString = RedisHub.Default.Check("plcDataConnectionString") ?? throw new Exception("请在Redsi中配置虚拟PLC使用的Redis连接字符串");
|
|
|
+
|
|
|
+ // //从现有结构解析出需要的结构
|
|
|
+ // var list = new List<PLCData>();
|
|
|
+ // SqlSugarHelper.Do(db =>
|
|
|
+ // {
|
|
|
+ // var _db = db.Connect;
|
|
|
+ // var dataBlocks = _db.Queryable<WCS_PlcDataBlock>().Includes(v => v.PLC).ToList();
|
|
|
+ // list.AddRange(dataBlocks.Select(dataBlock => new PLCData()
|
|
|
+ // {
|
|
|
+ // IP = dataBlock.PLC.IP,
|
|
|
+ // DB = dataBlock.NO,
|
|
|
+ // Length = dataBlock.Length,
|
|
|
+ // DataLength = dataBlock.DataLength,
|
|
|
+ // }));
|
|
|
+ // });
|
|
|
+ // PlcData.Init(plcDataConnectionString).InitPlcData(list);
|
|
|
+
|
|
|
+ // ServiceHub.AddSystemMode(SystemMode.虚拟plc);
|
|
|
+ //}
|
|
|
|
|
|
#endregion 创建虚拟PLC
|
|
|
|