|
|
|
@ -68,14 +68,14 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
List<BaseConfigInfo> configInfos = _configInfoBusiness.GetConfigInfos();
|
|
|
|
|
|
|
|
|
|
UnpackSet1Txt.Text = configInfos.Where(x => x.ConfigKey == "拆包机翻转机频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
UnpackSet2Txt.Text = configInfos.Where(x => x.ConfigKey == "拆包机滚筒筛频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
// UnpackSet1Txt.Text = configInfos.Where(x => x.ConfigKey == "拆包机翻转机频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
// UnpackSet2Txt.Text = configInfos.Where(x => x.ConfigKey == "拆包机滚筒筛频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
UnpackSet3Txt.Text = configInfos.Where(x => x.ConfigKey == "拆包机螺旋1频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
UnpackSet4Txt.Text = configInfos.Where(x => x.ConfigKey == "拆包机螺旋2频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
UnpackSet5Txt.Text = configInfos.Where(x => x.ConfigKey == "拆包机废袋机频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
// UnpackSet5Txt.Text = configInfos.Where(x => x.ConfigKey == "拆包机废袋机频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
BagsAmountTxt.Text = configInfos.Where(x => x.ConfigKey == "包装袋余量").FirstOrDefault().ConfigValue;
|
|
|
|
|
Speed1Txt.Text = configInfos.Where(x => x.ConfigKey == "螺旋1速度值").FirstOrDefault().ConfigValue;
|
|
|
|
|
Speed2Txt.Text = configInfos.Where(x => x.ConfigKey == "螺旋2速度值").FirstOrDefault().ConfigValue;
|
|
|
|
|
Speed1Txt.Text = configInfos.Where(x => x.ConfigKey == "螺旋1速度设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
Speed2Txt.Text = configInfos.Where(x => x.ConfigKey == "螺旋2速度设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
HotSpiralSpeedTxt.Text = configInfos.Where(x => x.ConfigKey == "烘干机螺旋频率设定值").FirstOrDefault().ConfigValue;
|
|
|
|
|
|
|
|
|
|
//HotTempTxt.Text = configInfos.Where(x => x.ConfigKey == "烘干机温度设定值").FirstOrDefault().ConfigValue;
|
|
|
|
@ -357,11 +357,11 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
SendPulseSignal("拆包机远程启动");
|
|
|
|
|
|
|
|
|
|
//频率设定
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定值")));
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定值")));
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定值")));
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定值")));
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋1频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋1频率设定值")));
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋2频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋2频率设定值")));
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定值")));
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定值")));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
@ -648,7 +648,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int value2 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度值"));
|
|
|
|
|
int value2 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设定值"));
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2启动"), true);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设置"), value2);
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
@ -678,7 +678,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
#region 启动磁选机 / 前提:check螺旋2启动及速度是否达标
|
|
|
|
|
int value2 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度值")) * 100;
|
|
|
|
|
int value2 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设定值")) * 100;
|
|
|
|
|
bool startFlag = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2启动"));
|
|
|
|
|
int speed2 = plc.readInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度反馈"));
|
|
|
|
|
if (!startFlag)
|
|
|
|
@ -736,7 +736,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int value1 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度值"));
|
|
|
|
|
int value1 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设定值"));
|
|
|
|
|
plc.writeBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1启动"), true);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设置"), value1);
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
@ -761,7 +761,7 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
bool result = false;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
int value1 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度值"));
|
|
|
|
|
int value1 = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设定值"));
|
|
|
|
|
bool startFlag = plc.readBoolByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1启动"));
|
|
|
|
|
int speed1 = plc.readInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度反馈"));
|
|
|
|
|
if (!startFlag)
|
|
|
|
@ -868,11 +868,11 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
SendPulseSignal("拆包机远程启动");
|
|
|
|
|
|
|
|
|
|
//频率设定
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定值")));
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定值")));
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定值")));
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定值")));
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋1频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋1频率设定值")));
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋2频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋2频率设定值")));
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定值")));
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定"), int.Parse(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定值")));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(MachineSleep);
|
|
|
|
@ -998,8 +998,8 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
double speed2 = plc.readInt16ByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度反馈")) / 100;
|
|
|
|
|
|
|
|
|
|
// 螺旋速度预设值
|
|
|
|
|
int speed1Set = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度值"));
|
|
|
|
|
int speed2Set = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度值"));
|
|
|
|
|
int speed1Set = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设定值"));
|
|
|
|
|
int speed2Set = int.Parse(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设定值"));
|
|
|
|
|
|
|
|
|
|
await App.Current.Dispatcher.BeginInvoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
@ -1166,8 +1166,8 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
if (result == MessageBoxResult.Yes)
|
|
|
|
|
{
|
|
|
|
|
List<BaseConfigInfo> configInfos = _configInfoBusiness.GetConfigInfos();
|
|
|
|
|
BaseConfigInfo configInfo1 = configInfos.Where(x => x.ConfigKey == "螺旋1速度值").FirstOrDefault();
|
|
|
|
|
BaseConfigInfo configInfo2 = configInfos.Where(x => x.ConfigKey == "螺旋2速度值").FirstOrDefault();
|
|
|
|
|
BaseConfigInfo configInfo1 = configInfos.Where(x => x.ConfigKey == "螺旋1速度设定值").FirstOrDefault();
|
|
|
|
|
BaseConfigInfo configInfo2 = configInfos.Where(x => x.ConfigKey == "螺旋2速度设定值").FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋1速度设置"), speed1);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("螺旋2速度设置"), speed2);
|
|
|
|
@ -1235,14 +1235,14 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bool isValidSpeed1 = int.TryParse(UnpackSet1Txt.Text, out int speed1) && speed1 >= 0 && speed1 <= 50;
|
|
|
|
|
bool isValidSpeed2 = int.TryParse(UnpackSet2Txt.Text, out int speed2) && speed2 >= 0 && speed2 <= 50;
|
|
|
|
|
// bool isValidSpeed1 = int.TryParse(UnpackSet1Txt.Text, out int speed1) && speed1 >= 0 && speed1 <= 50;
|
|
|
|
|
// bool isValidSpeed2 = int.TryParse(UnpackSet2Txt.Text, out int speed2) && speed2 >= 0 && speed2 <= 50;
|
|
|
|
|
bool isValidSpeed3 = int.TryParse(UnpackSet3Txt.Text, out int speed3) && speed3 >= 0 && speed3 <= 50;
|
|
|
|
|
bool isValidSpeed4 = int.TryParse(UnpackSet4Txt.Text, out int speed4) && speed4 >= 0 && speed4 <= 50;
|
|
|
|
|
bool isValidSpeed5 = int.TryParse(UnpackSet5Txt.Text, out int speed5) && speed5 >= 0 && speed5 <= 50;
|
|
|
|
|
// bool isValidSpeed5 = int.TryParse(UnpackSet5Txt.Text, out int speed5) && speed5 >= 0 && speed5 <= 50;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isValidSpeed1 && isValidSpeed2 && isValidSpeed3 && isValidSpeed4 && isValidSpeed5)
|
|
|
|
|
if ( isValidSpeed3 && isValidSpeed4 )
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var result = MessageBox.Show("是否确认更改?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Information);
|
|
|
|
@ -1251,28 +1251,28 @@ namespace SlnMesnac.WPF.Page
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//频率设定
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定"), speed1);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定"), speed2);
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机翻转机频率设定"), speed1);
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机滚筒筛频率设定"), speed2);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋1频率设定"), speed3);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机螺旋2频率设定"), speed4);
|
|
|
|
|
plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定"), speed5);
|
|
|
|
|
// plc.writeFloatByAddress(baseBusiness.GetPlcAddressByConfigKey("拆包机废袋机频率设定"), speed5);
|
|
|
|
|
|
|
|
|
|
List<BaseConfigInfo> configInfos = _configInfoBusiness.GetConfigInfos();
|
|
|
|
|
BaseConfigInfo configInfo1 = configInfos.Where(x => x.ConfigKey == "拆包机翻转机频率设定值").FirstOrDefault();
|
|
|
|
|
BaseConfigInfo configInfo2 = configInfos.Where(x => x.ConfigKey == "拆包机滚筒筛频率设定值").FirstOrDefault();
|
|
|
|
|
// BaseConfigInfo configInfo1 = configInfos.Where(x => x.ConfigKey == "拆包机翻转机频率设定值").FirstOrDefault();
|
|
|
|
|
// BaseConfigInfo configInfo2 = configInfos.Where(x => x.ConfigKey == "拆包机滚筒筛频率设定值").FirstOrDefault();
|
|
|
|
|
BaseConfigInfo configInfo3 = configInfos.Where(x => x.ConfigKey == "拆包机螺旋1频率设定值").FirstOrDefault();
|
|
|
|
|
BaseConfigInfo configInfo4 = configInfos.Where(x => x.ConfigKey == "拆包机螺旋2频率设定值").FirstOrDefault();
|
|
|
|
|
BaseConfigInfo configInfo5 = configInfos.Where(x => x.ConfigKey == "拆包机废袋机频率设定值").FirstOrDefault();
|
|
|
|
|
configInfo1.ConfigValue = UnpackSet1Txt.Text;
|
|
|
|
|
configInfo2.ConfigValue = UnpackSet2Txt.Text;
|
|
|
|
|
// BaseConfigInfo configInfo5 = configInfos.Where(x => x.ConfigKey == "拆包机废袋机频率设定值").FirstOrDefault();
|
|
|
|
|
// configInfo1.ConfigValue = UnpackSet1Txt.Text;
|
|
|
|
|
// configInfo2.ConfigValue = UnpackSet2Txt.Text;
|
|
|
|
|
configInfo3.ConfigValue = UnpackSet3Txt.Text;
|
|
|
|
|
configInfo4.ConfigValue = UnpackSet4Txt.Text;
|
|
|
|
|
configInfo5.ConfigValue = UnpackSet5Txt.Text;
|
|
|
|
|
_configInfoBusiness.UpdateConfigInfo(configInfo1);
|
|
|
|
|
_configInfoBusiness.UpdateConfigInfo(configInfo2);
|
|
|
|
|
// configInfo5.ConfigValue = UnpackSet5Txt.Text;
|
|
|
|
|
// _configInfoBusiness.UpdateConfigInfo(configInfo1);
|
|
|
|
|
// _configInfoBusiness.UpdateConfigInfo(configInfo2);
|
|
|
|
|
_configInfoBusiness.UpdateConfigInfo(configInfo3);
|
|
|
|
|
_configInfoBusiness.UpdateConfigInfo(configInfo4);
|
|
|
|
|
_configInfoBusiness.UpdateConfigInfo(configInfo5);
|
|
|
|
|
// _configInfoBusiness.UpdateConfigInfo(configInfo5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|