using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEA_Core.FreeDB; using WIDESEA_Entity.DomainModels; namespace WIDESEA_WCS.JobsPart.Common { public class Createplcinfodetail { FreeDB FreeDB = new FreeDB(); public void PLCinfodetail() { try { //for (int i = 1; i <= 3; i++) //{ int i = 7; string name = "3单元链条机"; dt_plcinfodetail plcinfodetail = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 0.0 + (i - 1) * 330 + "", plcdetail_valtype = "int16", plcdetail_name = "R_oi_on", plcdetail_number = name, plcdetail_remark = "PLC->1, PMS->0 after setting i_ variables" }; FreeDB.Add(plcinfodetail); dt_plcinfodetail plcinfodetail1 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 2.0 + (i - 1) * 330 + "", plcdetail_len = 20, plcdetail_valtype = "string", plcdetail_name = "R_o_wp_id", plcdetail_number = name, plcdetail_remark = "车轮SN" }; FreeDB.Add(plcinfodetail1); dt_plcinfodetail plcinfodetail2 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 22.0 + (i - 1) * 330 + "", plcdetail_valtype = "datetime", plcdetail_name = "R_o_mach_start_time", plcdetail_number = name, plcdetail_remark = "开始时间" }; FreeDB.Add(plcinfodetail2); dt_plcinfodetail plcinfodetail3 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 38.0 + (i - 1) * 330 + "", plcdetail_valtype = "datetime", plcdetail_name = "R_o_mach_finish_time", plcdetail_number = name, plcdetail_remark = "完成时间" }; FreeDB.Add(plcinfodetail3); dt_plcinfodetail plcinfodetail4 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 54.0 + (i - 1) * 330 + "", plcdetail_len = 20, plcdetail_valtype = "string", plcdetail_name = "R_o_operator", plcdetail_number = name, plcdetail_remark = "操作人" }; FreeDB.Add(plcinfodetail4); dt_plcinfodetail plcinfodetail5 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 74.0 + (i - 1) * 330 + "", plcdetail_len = 20, plcdetail_valtype = "string", plcdetail_name = "R_o_shift", plcdetail_number = name, plcdetail_remark = "去向" }; FreeDB.Add(plcinfodetail5); dt_plcinfodetail plcinfodetail6 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 94.0 + (i - 1) * 330 + "", plcdetail_valtype = "int16", plcdetail_name = "R_o_wp_status", plcdetail_number = name, plcdetail_remark = "质检状态 0:未定义,1:OK,2:NG" }; FreeDB.Add(plcinfodetail6); dt_plcinfodetail plcinfodetail7 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 96.0 + (i - 1) * 330 + "", plcdetail_valtype = "int16", plcdetail_name = "R_o_result", plcdetail_number = name, plcdetail_remark = "结果" }; FreeDB.Add(plcinfodetail7); dt_plcinfodetail plcinfodetail8 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 98.0 + (i - 1) * 330 + "", plcdetail_valtype = "int16", plcdetail_name = "R_o_error_code", plcdetail_number = name, plcdetail_remark = "错误代码" }; FreeDB.Add(plcinfodetail8); dt_plcinfodetail plcinfodetail9 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 100.0 + (i - 1) * 330 + "", plcdetail_valtype = "int16", plcdetail_name = "R_o_substation", plcdetail_number = name, plcdetail_remark = " " }; FreeDB.Add(plcinfodetail9); dt_plcinfodetail plcinfodetail10 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 102.0 + (i - 1) * 330 + "", plcdetail_valtype = "string", plcdetail_len = 55, plcdetail_name = "R_o_value_result_real_1", plcdetail_number = name, plcdetail_remark = "结果1" }; FreeDB.Add(plcinfodetail10); dt_plcinfodetail plcinfodetail11 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 157.0 + (i - 1) * 330 + "", plcdetail_valtype = "string", plcdetail_len = 55, plcdetail_name = "R_o_value_result_real_2", plcdetail_number = name, plcdetail_remark = "结果2" }; FreeDB.Add(plcinfodetail11); dt_plcinfodetail plcinfodetail12 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 212.0 + (i - 1) * 330 + "", plcdetail_valtype = "string", plcdetail_len = 55, plcdetail_name = "R_o_value_result_real_3", plcdetail_number = name, plcdetail_remark = "结果3" }; FreeDB.Add(plcinfodetail12); dt_plcinfodetail plcinfodetail13 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 267 + (i - 1) * 330 + "", plcdetail_valtype = "string", plcdetail_len = 55, plcdetail_name = "R_o_value_result_real_4", plcdetail_number = name, plcdetail_remark = "结果4" }; FreeDB.Add(plcinfodetail13); dt_plcinfodetail plcinfodetail14 = new dt_plcinfodetail() { plcdetail_id = Guid.NewGuid(), plcdetail_iotype = "Truss", plcdetail_db = "DB611", plcdetail_value = 322.1 + (i - 1) * 330 + "", plcdetail_valtype = "boolean", plcdetail_name = "R_o_value_result_bool", plcdetail_number = name, plcdetail_remark = " " }; FreeDB.Add(plcinfodetail14); //dt_plcinfodetail plcinfodetail15 = new dt_plcinfodetail() //{ // plcdetail_id = Guid.NewGuid(), // plcdetail_iotype = "Truss", // plcdetail_db = "DB611", // plcdetail_value = 4.0 + (i - 1) * 330 + "", // plcdetail_valtype = "string", // plcdetail_len = 18, // plcdetail_name = "fault_channel", // plcdetail_number = name, // plcdetail_remark = "错误消息频道" //}; //FreeDB.Add(plcinfodetail15); //dt_plcinfodetail plcinfodetail16 = new dt_plcinfodetail() //{ // plcdetail_id = Guid.NewGuid(), // plcdetail_iotype = "Truss", // plcdetail_db = "DB611", // plcdetail_value = 22.0 + (i - 1) * 330 + "", // plcdetail_valtype = "string", // plcdetail_len = 14, // plcdetail_name = "fault_axes_drives", // plcdetail_number = name, // plcdetail_remark = "错误消息axes(轴)驱动器" //}; //FreeDB.Add(plcinfodetail16); //dt_plcinfodetail plcinfodetail17 = new dt_plcinfodetail() //{ // plcdetail_id = Guid.NewGuid(), // plcdetail_iotype = "Truss", // plcdetail_db = "DB611", // plcdetail_value = 36.0 + (i - 1) * 330 + "", // plcdetail_valtype = "string", // plcdetail_len = 16, // plcdetail_name = "fault_user_0_to1", // plcdetail_number = name, // plcdetail_remark = "错误消息用户区域0...1" //}; //FreeDB.Add(plcinfodetail17); //} } catch (Exception ex) { throw; } } } }