You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
3.4 KiB
97 lines
3.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using QMAPP.FJC.DAL.Basic;
|
|
using QMAPP.FJC.Entity.Basic;
|
|
using QMAPP.FJC.Entity;
|
|
using QMFrameWork.Common.Serialization;
|
|
|
|
namespace EQUIPINTERFACETEST
|
|
{
|
|
public class InterruptTest
|
|
{
|
|
public void Test()
|
|
{
|
|
|
|
#region 获取数据库中所有的生产设备信息
|
|
|
|
MachineInfoDAL machineDal = new MachineInfoDAL();
|
|
List<MachineInfo> machineList = new List<MachineInfo>();
|
|
|
|
machineList = machineDal.GetList(new MachineInfo() { PROCESSTYPE = EnumGeter.ProcessType.xixiao.GetHashCode().ToString() });
|
|
|
|
#endregion
|
|
|
|
#region 获取所有的配置信息
|
|
|
|
ParameterConfigDAL paraConDal = new QMAPP.FJC.DAL.Basic.ParameterConfigDAL();
|
|
List<ParameterConfig> paraConfigList = new List<ParameterConfig>();
|
|
paraConfigList = paraConDal.GetList(new ParameterConfig() { MACHINECODDE = machineList[0].MACHINECODDE });
|
|
|
|
#endregion
|
|
List<ParameterConfig> paraList = new List<ParameterConfig>();
|
|
paraList = paraConfigList
|
|
.Where(o =>
|
|
o.MOLDNUMBER == "1"
|
|
&&
|
|
(
|
|
o.COLUMNTYPE == "0"
|
|
)
|
|
)
|
|
.ToList<ParameterConfig>();
|
|
ParameterConfig result = paraList.First(o => o.COLUMNCODE == "RESULT");
|
|
result.PARAVALUE = "NOK";
|
|
|
|
|
|
#region 铣削冷刀设备红外焊接的处理
|
|
|
|
ParameterConfig currentPC = result;
|
|
|
|
if (result.PARAVALUE.ToString() == "OK")
|
|
{
|
|
if (currentPC.PROCESSTYPE == EnumGeter.ProcessType.xixiao.GetHashCode().ToString()
|
|
|| currentPC.PROCESSTYPE == EnumGeter.ProcessType.lengdaoruohua.GetHashCode().ToString()
|
|
|| currentPC.PROCESSTYPE == EnumGeter.ProcessType.hongwaihanjie.GetHashCode().ToString())
|
|
{
|
|
List<ParameterConfig> paraReadList = paraConfigList
|
|
.Where(o =>
|
|
o.MOLDNUMBER == "1"
|
|
&& (
|
|
o.COLUMNTYPE == "2"
|
|
)
|
|
)
|
|
.ToList<ParameterConfig>();
|
|
foreach (var p in paraReadList)
|
|
{
|
|
if (p.COLUMNCODE == "BARCODEOK")
|
|
{
|
|
//opcplcConnection.WritetagValue(parameterValueDict[p.MACHINECODDE + ":" + p.MOLDNUMBER + ":" + p.COLUMNCODE], true);
|
|
Console.WriteLine("BARCODEOK");
|
|
}
|
|
else
|
|
{
|
|
//opcplcConnection.WritetagValue(parameterValueDict[p.MACHINECODDE + ":" + p.MOLDNUMBER + ":" + p.COLUMNCODE], false);
|
|
Console.WriteLine("BARCODENOK");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
//OpcServiceClient client = new OpcServiceClient();
|
|
|
|
|
|
////异步调用服务提交信息
|
|
//client.SubmitInterruptParameters(JsonConvertHelper.GetSerializes(paraList));
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
|