|
|
@@ -22,16 +22,23 @@ namespace BPASmartClient.Academy.ViewModel |
|
|
|
switch (Content) |
|
|
|
{ |
|
|
|
case "系统启动": |
|
|
|
IsChecked = true; |
|
|
|
DataFeedBack_50 dataFeedback = new (); |
|
|
|
dataFeedback.Name = Name; |
|
|
|
var snd = new SaveNameData(Name); |
|
|
|
dataFeedback.ProductNumberId = snd.Id; |
|
|
|
SqliteOperate.GetInstance.Add(snd); |
|
|
|
PlcControl.GetInstance.id = snd.Id; |
|
|
|
SqliteOperate.GetInstance.DataFeedBacks = dataFeedback; |
|
|
|
PlcControl.GetInstance.Write(BoolAddEnum.系统启动, true); |
|
|
|
Content = "系统停止"; |
|
|
|
var result = PlcControl.GetInstance.Write(BoolAddEnum.系统启动, true); |
|
|
|
if (result!= null && result.IsSuccess) |
|
|
|
{ |
|
|
|
IsChecked = true; |
|
|
|
DataFeedBack_50 dataFeedback = new(); |
|
|
|
dataFeedback.Name = Name; |
|
|
|
var snd = new SaveNameData(Name); |
|
|
|
dataFeedback.ProductNumberId = snd.Id; |
|
|
|
SqliteOperate.GetInstance.Add(snd); |
|
|
|
PlcControl.GetInstance.id = snd.Id; |
|
|
|
SqliteOperate.GetInstance.DataFeedBacks = dataFeedback; |
|
|
|
Content = "系统停止"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
LogHelper.GetInstance.AddRun(result.Message); |
|
|
|
} |
|
|
|
break; |
|
|
|
case "系统停止": |
|
|
|
IsChecked = false; |
|
|
|