设备管理参数自动加载

dep
我叫锄头 10 months ago
parent 25ff6b1279
commit 88b2ffbbfd

@ -22,15 +22,12 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
.FirstOrDefault(); //获取物料数据控件 .FirstOrDefault(); //获取物料数据控件
if (MessageBox.Show("确定上传变频参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) DoWord();
{
DoWord();
};
} }
private void DoWord() public void DoWord()
{ {
var view = ElectricalPlc.UpFromPlc(); var view = ElectricalPlc.UpFromPlc();
foreach (var v in view) foreach (var v in view)

@ -22,20 +22,22 @@ namespace Mesnac.Action.ChemicalWeighing.LjMetage
.FirstOrDefault(); //获取物料数据控件 .FirstOrDefault(); //获取物料数据控件
if (MessageBox.Show("确定上传称量频参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) //if (MessageBox.Show("确定上传称量频参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK)
{ //{
LoadingHelper.ShowLoadingScreen(); // LoadingHelper.ShowLoadingScreen();
var watchDog = LjHelp.WatchDog; // var watchDog = LjHelp.WatchDog;
if (watchDog == 0) // if (watchDog == 0)
{ // {
LoadingHelper.CloseForm(); // LoadingHelper.CloseForm();
MessageBox.Show("PLC通讯失败"); // MessageBox.Show("PLC通讯失败");
return; // return;
} // }
DoWord();
LoadingHelper.CloseForm(); // LoadingHelper.CloseForm();
}; //};
DoWord();
} }

@ -21,10 +21,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
.FirstOrDefault(); //获取物料数据控件 .FirstOrDefault(); //获取物料数据控件
if (MessageBox.Show("确定上传压力参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) DoWord();
{
DoWord();
};
} }

@ -22,21 +22,23 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
.FirstOrDefault(); //获取物料数据控件 .FirstOrDefault(); //获取物料数据控件
if (MessageBox.Show("确定上传比例阀参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) //if (MessageBox.Show("确定上传比例阀参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK)
{ //{
// LoadingHelper.ShowLoadingScreen();
// var watchDog = LjHelp.WatchDog;
// if (watchDog == 0)
// {
// LoadingHelper.CloseForm();
// MessageBox.Show("PLC通讯失败");
// return;
// }
// LoadingHelper.CloseForm();
//};
LoadingHelper.ShowLoadingScreen(); DoWord();
var watchDog = LjHelp.WatchDog;
if (watchDog == 0)
{
LoadingHelper.CloseForm();
MessageBox.Show("PLC通讯失败");
return;
}
DoWord();
LoadingHelper.CloseForm();
};
} }

@ -22,21 +22,23 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
.FirstOrDefault(); //获取物料数据控件 .FirstOrDefault(); //获取物料数据控件
if (MessageBox.Show("确定上传重量参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) //if (MessageBox.Show("确定上传重量参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK)
{ //{
// LoadingHelper.ShowLoadingScreen();
// var watchDog = LjHelp.WatchDog;
// if (watchDog == 0)
// {
// LoadingHelper.CloseForm();
// MessageBox.Show("PLC通讯失败");
// return;
// }
// LoadingHelper.CloseForm();
//};
LoadingHelper.ShowLoadingScreen(); DoWord();
var watchDog = LjHelp.WatchDog;
if (watchDog == 0)
{
LoadingHelper.CloseForm();
MessageBox.Show("PLC通讯失败");
return;
}
DoWord();
LoadingHelper.CloseForm();
};
} }

@ -8,6 +8,13 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
{ {
public class InItDbAction: ChemicalWeighingAction, IAction public class InItDbAction: ChemicalWeighingAction, IAction
{ {
LjElectrical.UpAction UpActionElectrical = new LjElectrical.UpAction();
LjMetage.UpAction UpActionMetage = new LjMetage.UpAction();
LjPressure.UpAction UpActionPressure = new LjPressure.UpAction();
LjProportional.UpAction UpActionProportional = new LjProportional.UpAction();
LjWeight.UpAction UpActionWeight = new LjWeight.UpAction();
public void Run(RuntimeParameter runtime) public void Run(RuntimeParameter runtime)
{ {
base.RunIni(runtime); //必须调用 base.RunIni(runtime); //必须调用
@ -17,6 +24,12 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
FillElectricalSetting(); FillElectricalSetting();
FillMetageSetting(); FillMetageSetting();
InitEvent(); InitEvent();
UpActionElectrical.Run(runtime);
UpActionMetage.Run(runtime);
UpActionPressure.Run(runtime);
UpActionProportional.Run(runtime);
UpActionWeight.Run(runtime);
} }
private void InitEvent() private void InitEvent()

Loading…
Cancel
Save