|
@@ -113,10 +113,29 @@ namespace UAS_PLCDataReader
|
|
|
ComboBoxData cbd17 = new ComboBoxData();
|
|
|
cbd17.Text = "忽略";
|
|
|
cbd17.Value = "INGORE";
|
|
|
+ ComboBoxData cbd18 = new ComboBoxData();
|
|
|
+ cbd18.Text = "待料时间";
|
|
|
+ cbd18.Value = "WAITTIME";
|
|
|
+ ComboBoxData cbd19 = new ComboBoxData();
|
|
|
+ cbd19.Text = "故障时长";
|
|
|
+ cbd19.Value = "BREAKTIME";
|
|
|
+ ComboBoxData cbd20 = new ComboBoxData();
|
|
|
+ cbd20.Text = "人工停机时长";
|
|
|
+ cbd20.Value = "MANSTOPTIME";
|
|
|
+ ComboBoxData cbd21 = new ComboBoxData();
|
|
|
+ cbd21.Text = "正常工作时长";
|
|
|
+ cbd21.Value = "WORKTIME";
|
|
|
+ ComboBoxData cbd22 = new ComboBoxData();
|
|
|
+ cbd22.Text = "开机时长";
|
|
|
+ cbd22.Value = "STARTTIME";
|
|
|
+ ComboBoxData cbd23 = new ComboBoxData();
|
|
|
+ cbd22.Text = "设备运行时长";
|
|
|
+ cbd22.Value = "RUNTIME";
|
|
|
+ ComboBoxData cbd24 = new ComboBoxData();
|
|
|
+ cbd22.Text = "不良明细";
|
|
|
+ cbd22.Value = "BADDETAIL";
|
|
|
DataItemRepositoryItemComboBox1.Items.Add(cbd3);
|
|
|
DataItemRepositoryItemComboBox1.Items.Add(cbd4);
|
|
|
- DataItemRepositoryItemComboBox1.Items.Add(cbd16);
|
|
|
- DataItemRepositoryItemComboBox1.Items.Add(cbd17);
|
|
|
DataItemRepositoryItemComboBox1.Items.Add(cbd5);
|
|
|
DataItemRepositoryItemComboBox1.Items.Add(cbd6);
|
|
|
DataItemRepositoryItemComboBox1.Items.Add(cbd7);
|
|
@@ -128,6 +147,15 @@ namespace UAS_PLCDataReader
|
|
|
DataItemRepositoryItemComboBox1.Items.Add(cbd13);
|
|
|
DataItemRepositoryItemComboBox1.Items.Add(cbd14);
|
|
|
DataItemRepositoryItemComboBox1.Items.Add(cbd15);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd16);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd17);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd18);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd19);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd20);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd21);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd22);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd23);
|
|
|
+ DataItemRepositoryItemComboBox1.Items.Add(cbd24);
|
|
|
#endregion
|
|
|
}
|
|
|
|
|
@@ -197,7 +225,7 @@ namespace UAS_PLCDataReader
|
|
|
ButtonDeleteCommandSet.Grid = GridPollingSetting;
|
|
|
|
|
|
//指令设置界面
|
|
|
- GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_ifng,dc_name,dc_type,case when dc_type='INQTY' then '投入' when dc_type='INGORE' then '忽略' when dc_type='NGQTY' then '不良' when dc_type='OUTQTY' then '产出' when dc_type='TEMPERATURE' then '温度' when dc_type='PARAM1' then '参数1' when dc_type='PARAM2' then '参数2' when dc_type='PARAM3' then '参数3' when dc_type='PARAM4' then '参数4' when dc_type='PARAM5' then '参数5' when dc_type='PARAM6' then '参数6' when dc_type='PARAM7' then '参数7' when dc_type='PARAM8' then '参数8' when dc_type='PARAM9' then '参数9' when dc_type='PARAM10' then '参数10' when dc_type='PARAM3' then '参数3' when dc_type='WAITTIME' then '待料时间' when dc_type='BREAKTIME' then '故障时长' when dc_type='MANSTOPTIME' then '人工停机时长' when dc_type='WORKTIME' then '正常工作时长' when dc_type='STARTTIME' then '开机时长' end dc_typename,dc_value,dc_dataindex,dc_sendcoding,dc_receivecoding,db_name,dc_man,dc_date,dc_address from devicecommand left join devicebrand on db_code=dc_debrand ".ToUpper();
|
|
|
+ GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_ifng,dc_name,dc_type,case when dc_type='INQTY' then '投入' when dc_type='INGORE' then '忽略' when dc_type='NGQTY' then '不良' when dc_type='OUTQTY' then '产出' when dc_type='TEMPERATURE' then '温度' when dc_type='PARAM1' then '参数1' when dc_type='PARAM2' then '参数2' when dc_type='PARAM3' then '参数3' when dc_type='PARAM4' then '参数4' when dc_type='PARAM5' then '参数5' when dc_type='PARAM6' then '参数6' when dc_type='PARAM7' then '参数7' when dc_type='PARAM8' then '参数8' when dc_type='PARAM9' then '参数9' when dc_type='PARAM10' then '参数10' when dc_type='PARAM3' then '参数3' when dc_type='WAITTIME' then '待料时间' when dc_type='BREAKTIME' then '故障时长' when dc_type='MANSTOPTIME' then '人工停机时长' when dc_type='WORKTIME' then '正常工作时长' when dc_type='STARTTIME' then '开机时长' when dc_type='RUNTIME' then '设备运行时长' end dc_typename,dc_value,dc_dataindex,dc_sendcoding,dc_receivecoding,db_name,dc_man,dc_date,dc_address from devicecommand left join devicebrand on db_code=dc_debrand ".ToUpper();
|
|
|
GridCommandSetting.TableName = "devicecommand";
|
|
|
GridCommandSetting.ID = "dc_id";
|
|
|
GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_value,dc_debrand,dc_sendcoding,dc_receivecoding,dc_man,dc_date,dc_dataindex,dc_type,dc_address) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding,'" + User.UserName + "',sysdate,:dc_dataindex,:dc_type,:)";
|
|
@@ -649,19 +677,31 @@ namespace UAS_PLCDataReader
|
|
|
Dictionary<string, string> ItemData = new Dictionary<string, string>();
|
|
|
int[] Arr = BaseUtil.GetDecimalData(BaseUtil.ASCIIToString(client[IP].Returnvalue[IP]), 8);
|
|
|
Console.WriteLine(IP + " " + Arr.Length + " " + dc_dr.Length);
|
|
|
- //返回的参数个数和定义的参数个数相等或者小于的时候
|
|
|
- if (Arr.Length == dc_dr.Length || dc_dr.Length > Arr.Length)
|
|
|
+ //如果返回的是不良代码的集合,则表示连续的不良
|
|
|
+ if (dc_dr[0]["dc_type"].ToString() == "BADDETAIL")
|
|
|
{
|
|
|
+ //命令行只需要设置一条指令,通过参数长度来设置Key
|
|
|
for (int j = 0; j < Arr.Length; j++)
|
|
|
{
|
|
|
- ItemData.Add(dc_dr[j]["dc_type"].ToString(), Arr[j].ToString());
|
|
|
+ ItemData.Add(dc_dr[j]["dc_type"].ToString() + j, Arr[j].ToString());
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- for (int j = 0; j < dc_dr.Length; j++)
|
|
|
+ //返回的参数个数和定义的参数个数相等或者小于的时候
|
|
|
+ if (Arr.Length == dc_dr.Length || dc_dr.Length > Arr.Length)
|
|
|
+ {
|
|
|
+ for (int j = 0; j < Arr.Length; j++)
|
|
|
+ {
|
|
|
+ ItemData.Add(dc_dr[j]["dc_type"].ToString(), Arr[j].ToString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- ItemData.Add(dc_dr[j]["dc_type"].ToString(), Arr[j].ToString());
|
|
|
+ for (int j = 0; j < dc_dr.Length; j++)
|
|
|
+ {
|
|
|
+ ItemData.Add(dc_dr[j]["dc_type"].ToString(), Arr[j].ToString());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (!ReturnData.ContainsKey(Decode + Dccode[i]))
|