设备管理参数自动加载

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

@ -20,17 +20,14 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
DbMCControl materialGridControl = DbMCControl materialGridControl =
this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ElectricalSetting") this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ElectricalSetting")
.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)

@ -20,23 +20,25 @@ namespace Mesnac.Action.ChemicalWeighing.LjMetage
DbMCControl materialGridControl = DbMCControl materialGridControl =
this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "MetageSetting") this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "MetageSetting")
.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();
} }
private void DoWord() private void DoWord()

@ -19,14 +19,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
DbMCControl materialGridControl = DbMCControl materialGridControl =
this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "pressureSetting") this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "pressureSetting")
.FirstOrDefault(); //获取物料数据控件 .FirstOrDefault(); //获取物料数据控件
if (MessageBox.Show("确定上传压力参数到数据库?","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information) == DialogResult.OK) DoWord();
{
DoWord();
};
} }
private void DoWord() private void DoWord()

@ -20,24 +20,26 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
DbMCControl materialGridControl = DbMCControl materialGridControl =
this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ProportionalSetting") this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ProportionalSetting")
.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();
} }
private void DoWord() private void DoWord()

@ -20,24 +20,26 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
DbMCControl materialGridControl = DbMCControl materialGridControl =
this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "WeightSetting") this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "WeightSetting")
.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();
} }
private void DoWord() private void DoWord()

@ -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