ソースを参照

告警信息添加

master
pry 2年前
コミット
ad577d3e21
4個のファイルの変更130行の追加48行の削除
  1. +2
    -1
      HKCardOUT/Helper/BigScreen/DataCenter.cs
  2. +2
    -2
      HKCardOUT/ViewModels/RootViewModel.cs
  3. +76
    -16
      HKControl/DataModel.cs
  4. +50
    -29
      HKControl/Main.cs

+ 2
- 1
HKCardOUT/Helper/BigScreen/DataCenter.cs ファイルの表示

@@ -40,9 +40,10 @@ namespace Helper.BigScreen
AlarmMs = param,
AlarmTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
});
HKLog.HKLogImport.WriteInfo(param);
});

ThreadManage.GetInstance().StartLong(() =>
{
var model = new HKCore().GetDayData();


+ 2
- 2
HKCardOUT/ViewModels/RootViewModel.cs ファイルの表示

@@ -136,7 +136,7 @@ namespace HKCardOUT.ViewModels
Device = t.Name,
Stalls = x.Name
}).ToList();
/* if (Init != null)
if (Init != null)
{
Ad = new ObservableCollection<AdDTO>(Init);
var route = SyncStatic.CreateFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AD.txt"));
@@ -148,7 +148,7 @@ namespace HKCardOUT.ViewModels
var jsons = SyncStatic.Decompress(SyncStatic.ReadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AD.txt")), SecurityType.Base64);
Ad = new ObservableCollection<AdDTO>(jsons.ToModel<List<AdDTO>>());
AdOpen();
}*/
}
}));

}


+ 76
- 16
HKControl/DataModel.cs ファイルの表示

@@ -11,6 +11,29 @@ namespace HKControl
{
public WindowDataModel LeftWindowData { get; set; } = new WindowDataModel();
public WindowDataModel RightWindowData { get; set; } = new WindowDataModel();

[Alarm("1号通道缺碗")]
public bool LackBowl1 { get; set; }

[Alarm("2号通道缺碗")]
public bool LackBowl2 { get; set; }

[Alarm("3号通道缺碗")]
public bool LackBowl3 { get; set; }

[Alarm("4号通道缺碗")]
public bool LackBowl4 { get; set; }

[Alarm("水温过低")]
public bool WaterTemperatureLow { get; set; }

[Alarm("变频器故障")]
public bool FrequencyConverterFault { get; set; }

[Alarm("机器人通讯异常")]
public bool RobotCommFault { get; set; }

public RobotStatus RBStatus { get; set; }
}

public class WindowDataModel
@@ -37,42 +60,79 @@ namespace HKControl

[Alarm("警告左侧机构餐盘无盘")]
public bool L1 { get; set; }
[Alarm("警告左侧升降气缸下降不到位")]

[Alarm("左侧机构餐盘掉落无餐盘报警")]
public bool L2 { get; set; }
[Alarm("警告左侧升降气缸中间不到位")]

[Alarm("左侧升降气缸下降不到位报警")]
public bool L3 { get; set; }
[Alarm("警告左侧升降气缸上升不到位")]

[Alarm("左侧升降气缸中间位置不到位报警")]
public bool L4 { get; set; }
[Alarm("警告左侧升降气缸上升不到位")]

[Alarm("左侧升降气缸上升不到位报警")]
public bool L5 { get; set; }
[Alarm("警告左侧机构推空餐盘不到位")]

[Alarm("左侧机构推空餐盘不到位报警")]
public bool L6 { get; set; }
[Alarm("警告左侧出餐推不到位")]

[Alarm("左侧机构推空餐盘回退不到位报警")]
public bool L7 { get; set; }
[Alarm("警告左侧出餐回退不到位")]

[Alarm("左侧出餐推不到位报警")]
public bool L8 { get; set; }
[Alarm("警告左餐盘掉落位置有餐盘")]

[Alarm("左侧出餐回退不到位报警")]
public bool L9 { get; set; }

[Alarm("左餐盘掉落位置有餐盘报警")]
public bool L10 { get; set; }

[Alarm("左侧套餐完成")]
public bool L11 { get; set; }


[Alarm("警告右侧机构餐盘无盘")]
public bool R1 { get; set; }
[Alarm("警告右侧升降气缸下降不到位")]

[Alarm("右侧机构餐盘掉落无餐盘报警")]
public bool R2 { get; set; }
[Alarm("警告右侧升降气缸中间不到位")]

[Alarm("右侧升降气缸下降不到位报警")]
public bool R3 { get; set; }
[Alarm("警告右侧升降气缸上升不到位")]

[Alarm("右侧升降气缸中间位置不到位报警")]
public bool R4 { get; set; }
[Alarm("警告右侧升降气缸上升不到位")]

[Alarm("右侧升降气缸上升不到位报警")]
public bool R5 { get; set; }
[Alarm("警告右侧机构推空餐盘不到位")]

[Alarm("右侧机构推空餐盘不到位报警")]
public bool R6 { get; set; }
[Alarm("警告右侧出餐推不到位")]

[Alarm("右侧机构推空餐盘回退不到位报警")]
public bool R7 { get; set; }
[Alarm("警告右侧出餐回退不到位")]

[Alarm("右侧出餐推不到位报警")]
public bool R8 { get; set; }
[Alarm("警告右餐盘掉落位置有餐盘")]

[Alarm("右侧出餐回退不到位报警")]
public bool R9 { get; set; }

[Alarm("右餐盘掉落位置有餐盘报警")]
public bool R10 { get; set; }

[Alarm("右侧套餐完成")]
public bool R11 { get; set; }

}

public enum RobotStatus
{
运行,
停止,
暂停,
准备,
故障,
}
}

+ 50
- 29
HKControl/Main.cs ファイルの表示

@@ -132,45 +132,66 @@ namespace HKControl
{
SiemensDicitonary[item.DeviceNum].ConnectOk = new Action(() =>
{
AlarmHelper<DataModel>.GetInstance($"{item.DeviceNum}号档口");
AlarmHelper<DataModel>.Init();
//AlarmHelper<DataModel>.GetInstance($"{item.DeviceNum}号档口");
HKLog.HKLogImport.WriteInfo($"{item.DeviceNum}:连接成功");
ThreadManage.GetInstance().StartLong(new Action(() =>
{
try
{
var md = AlarmHelper<DataModel>.GetInstance($"{item.DeviceNum}号档口");
var res = SiemensDicitonary[item.DeviceNum].Read<byte>("MB7");
var res1 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB10");
var res2 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB11");
md.LeftWindowData.L1 = Get8bitValue(res1, 2);
md.LeftWindowData.L2 = Get8bitValue(res1, 3);
md.LeftWindowData.L3 = Get8bitValue(res1, 4);
md.LeftWindowData.L4 = Get8bitValue(res1, 5);
md.LeftWindowData.L5 = Get8bitValue(res1, 6);
md.LeftWindowData.L6 = Get8bitValue(res1, 7);
md.LeftWindowData.L7 = Get8bitValue(res1, 8);
md.LeftWindowData.L8 = Get8bitValue(res2, 1);
md.LeftWindowData.L9 = Get8bitValue(res2, 2);
var md = AlarmHelper<DataModel>.GetInstance($"{item.DeviceNum}");

var MB7 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB7");
DataModels[item.DeviceNum].LeftWindowData.IsSwipe = Get8bitValue(MB7, 1);
DataModels[item.DeviceNum].LeftWindowData.Complete = Get8bitValue(MB7, 2);
DataModels[item.DeviceNum].RightWindowData.IsSwipe = Get8bitValue(MB7, 3);
DataModels[item.DeviceNum].RightWindowData.Complete = Get8bitValue(MB7, 4);

var res3 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB12");
var res4 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB13");
md.RightWindowData.R1 = Get8bitValue(res3, 2);
md.RightWindowData.R2 = Get8bitValue(res3, 3);
md.RightWindowData.R3 = Get8bitValue(res3, 4);
md.RightWindowData.R4 = Get8bitValue(res3, 5);
md.RightWindowData.R5 = Get8bitValue(res3, 6);
md.RightWindowData.R6 = Get8bitValue(res3, 7);
md.RightWindowData.R7 = Get8bitValue(res3, 8);
md.RightWindowData.R8 = Get8bitValue(res4, 1);
md.RightWindowData.R9 = Get8bitValue(res4, 2);
var MB10 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB10");
var MB11 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB11");
md.LeftWindowData.L2 = Get8bitValue(MB10, 2);
md.LeftWindowData.L3 = Get8bitValue(MB10, 3);
md.LeftWindowData.L4 = Get8bitValue(MB10, 4);
md.LeftWindowData.L5 = Get8bitValue(MB10, 5);
md.LeftWindowData.L6 = Get8bitValue(MB10, 6);
md.LeftWindowData.L7 = Get8bitValue(MB10, 7);
md.LeftWindowData.L8 = Get8bitValue(MB10, 8);
md.LeftWindowData.L9 = Get8bitValue(MB11, 1);

DataModels[item.DeviceNum].LeftWindowData.IsSwipe = Get8bitValue(res, 1);
DataModels[item.DeviceNum].LeftWindowData.Complete = Get8bitValue(res, 2);
var MB12 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB12");
var MB13 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB13");
md.RightWindowData.R2 = Get8bitValue(MB12, 2);
md.RightWindowData.R3 = Get8bitValue(MB12, 3);
md.RightWindowData.R4 = Get8bitValue(MB12, 4);
md.RightWindowData.R5 = Get8bitValue(MB12, 5);
md.RightWindowData.R6 = Get8bitValue(MB12, 6);
md.RightWindowData.R7 = Get8bitValue(MB12, 7);
md.RightWindowData.R8 = Get8bitValue(MB12, 8);
md.RightWindowData.R9 = Get8bitValue(MB13, 1);

var MB14 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB14");
md.WaterTemperatureLow = Get8bitValue(MB14, 5);
md.FrequencyConverterFault = Get8bitValue(MB14, 6);

var MB15 = SiemensDicitonary[item.DeviceNum].Read<byte>("MB15");
md.RobotCommFault = Get8bitValue(MB15, 6);
bool TempFault = Get8bitValue(MB15, 5);
if (TempFault)
{
md.RBStatus = RobotStatus.故障;
}
else
{
if (Get8bitValue(MB15, 1))
md.RBStatus = RobotStatus.运行;
else if (Get8bitValue(MB15, 2))
md.RBStatus = RobotStatus.停止;
else if (Get8bitValue(MB15, 3))
md.RBStatus = RobotStatus.暂停;
else if (Get8bitValue(MB15, 4))
md.RBStatus = RobotStatus.准备;
}

DataModels[item.DeviceNum].RightWindowData.IsSwipe = Get8bitValue(res, 3);
DataModels[item.DeviceNum].RightWindowData.Complete = Get8bitValue(res, 4);
}
catch (Exception ex)
{


読み込み中…
キャンセル
保存