参数管理 大于0 才开始跟新

dep
我叫锄头 10 months ago
parent 9f68524f3e
commit ebb9677066

@ -152,12 +152,17 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var pressureSettingViews = PressurePLC.UpdateFromPlc(); var pressureSettingViews = PressurePLC.UpdateFromPlc();
foreach (var v in pressureSettingViews) foreach (var v in pressureSettingViews)
{
if(v.LowLimit>0 || v.HighLimit > 0)
{ {
string sql = string sql =
$"update PressureSetting set LowLimit={v.LowLimit},HighLimit={v.HighLimit} where Id={v.Id}"; $"update PressureSetting set LowLimit={v.LowLimit},HighLimit={v.HighLimit} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql); DBHelp.ExecuteNonQuery(sql);
} }
}
DataTable table = DataTable table =
DBHelp.GetTable(@"select Id,Name,ActualValue,LowLimit,HighLimit,Alarm, DBHelp.GetTable(@"select Id,Name,ActualValue,LowLimit,HighLimit,Alarm,
case Alarm when 1 then '' else '' end as AlarmValue from pressureSetting;"); case Alarm when 1 then '' else '' end as AlarmValue from pressureSetting;");
@ -181,12 +186,16 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var views = ProportionalPlc.UpFromPlc(); var views = ProportionalPlc.UpFromPlc();
foreach (var v in views) foreach (var v in views)
{
if(v.SV>0 || v.PV > 0)
{ {
string sql = string sql =
$"update ProportionalSetting set SV={v.SV},PV={v.PV} where Id={v.Id}"; $"update ProportionalSetting set SV={v.SV},PV={v.PV} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql); DBHelp.ExecuteNonQuery(sql);
} }
}
DataTable table = DataTable table =
DBHelp.GetTable(@"select Id, Name, PV, SV from ProportionalSetting"); DBHelp.GetTable(@"select Id, Name, PV, SV from ProportionalSetting");
@ -210,12 +219,16 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var views = WeightSettingPlc.UpFromPlc(); var views = WeightSettingPlc.UpFromPlc();
foreach (var v in views) foreach (var v in views)
{
if(v.LowWeight>0 || v.HighWeight > 0)
{ {
string sql = string sql =
$"update WeightSetting set LowWeight={v.LowWeight},HighWeight={v.HighWeight} where Id={v.Id}"; $"update WeightSetting set LowWeight={v.LowWeight},HighWeight={v.HighWeight} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql); DBHelp.ExecuteNonQuery(sql);
} }
}
DataTable table = DataTable table =
DBHelp.GetTable(@"select Id,Name,ActWeight,HighLevel,HighWeight,LowLevel,LowWeight from WeightSetting"); DBHelp.GetTable(@"select Id,Name,ActWeight,HighLevel,HighWeight,LowLevel,LowWeight from WeightSetting");
@ -237,12 +250,16 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var view = ElectricalPlc.UpFromPlc(); var view = ElectricalPlc.UpFromPlc();
foreach (var v in view) foreach (var v in view)
{
if (v.Speed > 0)
{ {
string sql = string sql =
$"update ElectricalSetting set Speed={v.Speed} where Id={v.Id}"; $"update ElectricalSetting set Speed={v.Speed} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql); DBHelp.ExecuteNonQuery(sql);
} }
}
DataTable table = DataTable table =
DBHelp.GetTable(@"select Id, Name, Speed from ElectricalSetting"); DBHelp.GetTable(@"select Id, Name, Speed from ElectricalSetting");
@ -263,12 +280,17 @@ namespace Mesnac.Action.ChemicalWeighing.OliveEQSetting
var view = MetagePlc.UpFromPlc(); var view = MetagePlc.UpFromPlc();
foreach (var v in view) foreach (var v in view)
{
if(v.HighSpeed > 0 || v.LowSpeed>0 || v.WeightSlow>0 || v.Precut>0 || v.JogTime > 0)
{ {
string sql = string sql =
$"update MetageSetting set HighSpeed={v.HighSpeed},LowSpeed={v.LowSpeed},WeightSlow={v.WeightSlow},Precut={v.Precut},JogTime={v.JogTime} where Id={v.Id}"; $"update MetageSetting set HighSpeed={v.HighSpeed},LowSpeed={v.LowSpeed}," +
$"WeightSlow={v.WeightSlow},Precut={v.Precut},JogTime={v.JogTime} where Id={v.Id}";
DBHelp.ExecuteNonQuery(sql); DBHelp.ExecuteNonQuery(sql);
} }
}
DataTable table = DataTable table =
DBHelp.GetTable(@"select Id, Name, HighSpeed, LowSpeed, WeightSlow, Precut, JogTime from MetageSetting"); DBHelp.GetTable(@"select Id, Name, HighSpeed, LowSpeed, WeightSlow, Precut, JogTime from MetageSetting");

Loading…
Cancel
Save