/// <summary> /// 获取当前装船机对象 /// </summary> /// <returns></returns> private void UpdateShiploader() { DataTable table = (new DataService_Shiploader()).GetShiploader(this.shiploader_id); Shiploader loader = null; if (table != null && table.Rows.Count > 0) { DataRow row = table.Rows[0]; loader = new Shiploader() { Id = int.Parse(row["shiploader_id"].ToString()), Name = row["shiploader_name"].ToString(), OpcServerIp = row["opcserver_ip"].ToString(), OpcServerName = row["opcserver_name"].ToString(), TopicName = row["topic_name"].ToString(), TopicNameWalkingPos = row["topic_name_walking_pos"].ToString(), TopicNamePitchAngle = row["topic_name_pitch_angle"].ToString(), TopicNameStretchLength = row["topic_name_stretch_length"].ToString(), TopicNameBucketPitch = row["topic_name_bucket_pitch"].ToString(), TopicNameBucketYaw = row["topic_name_bucket_yaw"].ToString(), TopicNameBeltSpeed = row["topic_name_belt_speed"].ToString(), TopicNameStream = row["topic_name_stream"].ToString(), ItemNameWalkingPos = row["item_name_walking_pos"].ToString(), ItemNamePitchAngle = row["item_name_pitch_angle"].ToString(), ItemNameStretchLength = row["item_name_stretch_length"].ToString(), ItemNameBucketPitch = row["item_name_bucket_pitch"].ToString(), ItemNameBucketYaw = row["item_name_bucket_yaw"].ToString(), ItemNameBeltSpeed = row["item_name_belt_speed"].ToString(), ItemNameStream = row["item_name_stream"].ToString() }; } this.Shiploader = loader; //return loader; }
/// <summary> /// 构造器 /// </summary> /// <param name="opcServer">OPC服务端</param> public OpcUtilHelper(Shiploader shiploader) { this.OpcServer = new OPCServer(); this.Shiploader = shiploader; this.UnitRatio = int.Parse(BaseConst.IniHelper.ReadData("OPC", "PositionUnitRatio")); this.ReadInterval = int.Parse(BaseConst.IniHelper.ReadData("OPC", "ReadInterval")); this.WriteItemValue = BaseConst.IniHelper.ReadData("OPC", "WriteItemValue").Equals("1"); }
/// <summary> /// 构造器 /// </summary> /// <param name="opcServer">OPC服务端</param> public OpcUtilHelper(Shiploader shiploader) { this.Shiploader = shiploader; this.UnitRatio = int.Parse(BaseConst.IniHelper.ReadData("OPC", "PositionUnitRatio")); this.ReadInterval = int.Parse(BaseConst.IniHelper.ReadData("OPC", "ReadInterval")); }