天津投入产出系统后端
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.
 
 
 
 
 
 

87 lines
5.0 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 QMAPP.FJC.BLL.Process;
namespace EQUIPINTERFACETEST.NewFolder1
{
public class SlushInsertTest
{
public void Test()
{
#region 获取数据库中所有的生产设备信息
MachineInfoDAL machineDal = new MachineInfoDAL();
List<MachineInfo> machineList = new List<MachineInfo>();
machineList = machineDal.GetList(new MachineInfo() { PROCESSTYPE = EnumGeter.ProcessType.tangsu.GetHashCode().ToString() });
#endregion
#region 获取所有的配置信息
List<ParameterConfig> paraConfigList = new List<ParameterConfig>();
ParameterConfigDAL paraConDal = new QMAPP.FJC.DAL.Basic.ParameterConfigDAL();
paraConfigList = paraConDal.GetList(new ParameterConfig() { MACHINECODDE = machineList[0].MACHINECODDE });
paraConfigList = paraConfigList.Where(o => (o.MOLDNUMBER == "1" || o.MOLDNUMBER == "0") && (o.COLUMNTYPE == "0" || o.COLUMNTYPE == "5")).ToList<ParameterConfig>();
//
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("YEAR1")).PARAVALUE = ConvertClass.HexToDec("15");
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("MONTH")).PARAVALUE = ConvertClass.HexToDec("11");
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("DAY")).PARAVALUE = ConvertClass.HexToDec("12");
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("HOUR")).PARAVALUE = ConvertClass.HexToDec(System.DateTime.Now.Hour.ToString());
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("MINUTE")).PARAVALUE = ConvertClass.HexToDec(System.DateTime.Now.Minute.ToString());
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE == ("SECOND1")).PARAVALUE = ConvertClass.HexToDec(System.DateTime.Now.Second.ToString());
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("MACHINENO")).PARAVALUE = "2";
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("PRODUCT")).PARAVALUE ="A";
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("HUDORBASIC")).PARAVALUE = "H/H";
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("COLOR")).PARAVALUE = "1";
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("CAVITYTYPE")).PARAVALUE = "A/B";
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("ARMNUMBER1")).PARAVALUE = "2";
paraConfigList.First(o => o.MOLDNUMBER == "1" && o.COLUMNCODE.Contains("MOULDCARRIER1")).PARAVALUE = "1/2";
foreach (var p in paraConfigList)
{
if (p.CONNECTIONSTRING.Contains("_Angle_"))
p.PARAVALUE = -222;
if (p.CONNECTIONSTRING.Contains("_Speed_"))
p.PARAVALUE = 80;
}
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("PREHEATING")).PARAVALUE = 600;
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("PREHEATETEMP")).PARAVALUE = 265.0463;
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("COOLINGTEMPERATURE")).PARAVALUE = 264.9306;
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("COOLINGTIME")).PARAVALUE = 300;
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("HB")).PARAVALUE = "B/B";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("PRODUCTSTATUS")).PARAVALUE = "1";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("PRODUCTCODE")).PARAVALUE = "A";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("FRANUMBER")).PARAVALUE = "3";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("SRANUMBER")).PARAVALUE = "4";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("FRACOLOR")).PARAVALUE = "3";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("SRACOLOR")).PARAVALUE = "2";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("COLORCODE")).PARAVALUE = "1";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("ARMNUMBER")).PARAVALUE = "2";
paraConfigList.First(o => o.MOLDNUMBER == "0" && o.COLUMNCODE == ("RECIPENUMBER")).PARAVALUE = "11";
#endregion
SlushProcess process = new SlushProcess();
List<string> barCodeList = process.Process(machineList[0], paraConfigList);
//BarCodePrintClient client=new BarCodePrintClient();
//foreach (var barcode in barCodeList)
//{
// client.Print(barcode + ",*" + barcode + "*", "TS");
//}
}
}
}