| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- using System;
- using System.Collections;
- using System.Data;
- using System.Diagnostics;
- using System.Reflection;
- namespace Core.StlMes.Client.LgClassModel
- {
- [Serializable]
- public class COM_STL_COMMAND
- {
- private string _id_ = ""; //ID
- private string _stationcode = ""; //岗位编号(如:BOF、CAS)
- private decimal _sortid = 0; //岗位编号内顺序
- private string _opttype = ""; //操作类型(1:正常操作、2:异常操作、3:切换岗位信息)
- private string _objectpos = ""; //执行目标位置(如:LFS01_DEVICE)
- private string _optcaption = ""; //操作说明
- /// <summary>
- /// 操作命令类型:
- /// TAPPING:出钢;
- /// GONEXT:出下道工序;
- /// ASSIGNEDPOS:指定位置;
- /// ARRIVE:进站/上台;
- /// LEAVE:出站/下台;
- /// TRANS:位置对换;
- /// OPENCAST:开浇;
- /// STOPCAST:停浇;
- /// OVER:强制结束;
- /// SWITCH:切换信息显示;
- /// MELTDOWN:钢水回炉
- /// </summary>
- private COM_STL_COMMAND_CMDTYPE _optcommandtype = COM_STL_COMMAND_CMDTYPE.NONE;
- private string _filedname01 = ""; //更新时间字段名称1
- private string _filedname02 = ""; //更新时间字段名称2
- private string _filedname03 = ""; //更新时间字段名称3
- private string _visible_idle = ""; //IDLE位可见
- private string _visible_front = ""; //FRONT位可见
- private string _visible_device = ""; //DEVICE位可见
- private string _visible_back = ""; //BACK位可见
- /// <summary>
- /// ID
- /// </summary>
- public string ID_
- {
- get { return this._id_; }
- set { if (value != this._id_) this._id_ = value; }
- }
- /// <summary>
- ///岗位编号(如:BOF、CAS)
- /// </summary>
- public string STATIONCODE
- {
- get { return this._stationcode; }
- set { if (value != this._stationcode) this._stationcode = value; }
- }
- /// <summary>
- /// 岗位编号内顺序
- /// </summary>
- public decimal SORTID
- {
- get { return this._sortid; }
- set { if (value != this._sortid) this._sortid = value; }
- }
-
- /// <summary>
- /// 操作类型(1:正常操作、2:异常操作、3:切换岗位信息)
- /// </summary>
- public string OPTTYPE
- {
- get { return this._opttype; }
- set { if (value != this._opttype) this._opttype = value; }
- }
- /// <summary>
- /// 执行目标位置(如:LFS01_DEVICE)
- /// </summary>
- public string OBJECTPOS
- {
- get { return this._objectpos; }
- set { if (value != this._objectpos) this._objectpos = value; }
- }
- /// <summary>
- /// 操作说明
- /// </summary>
- public string OPTCAPTION
- {
- get { return this._optcaption; }
- set { if (value != this._optcaption) this._optcaption = value; }
- }
- /// <summary>
- /// 操作命令类型:
- /// TAPPING:出钢;
- /// GONEXT:出下道工序;
- /// ASSIGNEDPOS:指定位置;
- /// ARRIVE:进站/上台;
- /// LEAVE:出站/下台;
- /// TRANS:位置对换;
- /// OPENCAST:开浇;
- /// STOPCAST:停浇;
- /// OVER:强制结束;
- /// SWITCH:切换信息显示;
- /// MELTDOWN:钢水回炉
- /// </summary>
- public COM_STL_COMMAND_CMDTYPE OPTCOMMANDTYPE
- {
- get { return this._optcommandtype; }
- set { if (value != this._optcommandtype) this._optcommandtype = value; }
- }
- /// <summary>
- /// 更新时间字段名称1
- /// </summary>
- public string FILEDNAME01
- {
- get { return this._filedname01; }
- set { if (value != this._filedname01) this._filedname01 = value; }
- }
- /// <summary>
- /// 更新时间字段名称2
- /// </summary>
- public string FILEDNAME02
- {
- get { return this._filedname02; }
- set { if (value != this._filedname02) this._filedname02 = value; }
- }
- /// <summary>
- /// 更新时间字段名称3
- /// </summary>
- public string FILEDNAME03
- {
- get { return this._filedname03; }
- set { if (value != this._filedname03) this._filedname03 = value; }
- }
- /// <summary>
- /// IDLE位可见
- /// </summary>
- public string VISIBLE_IDLE
- {
- get { return this._visible_idle; }
- set { if (value != this._visible_idle) this._visible_idle = value; }
- }
- /// <summary>
- /// FRONT位可见
- /// </summary>
- public string VISIBLE_FRONT
- {
- get { return this._visible_front; }
- set { if (value != this._visible_front) this._visible_front = value; }
- }
- /// <summary>
- /// DEVICE位可见
- /// </summary>
- public string VISIBLE_DEVICE
- {
- get { return this._visible_device; }
- set { if (value != this._visible_device) this._visible_device = value; }
- }
- /// <summary>
- /// BACK位可见
- /// </summary>
- public string VISIBLE_BACK
- {
- get { return this._visible_back; }
- set { if (value != this._visible_back) this._visible_back = value; }
- }
- /// <summary>
- /// 数据重置
- /// </summary>
- public void Reset()
- {
- PropertyInfo[] PropertyInfos = this.GetType().GetProperties();
- if (PropertyInfos == null || PropertyInfos.Length == 0) return;
- object value = null;
- foreach (PropertyInfo oPropertyInfo in PropertyInfos)
- {
- try
- {
- if (oPropertyInfo.Name.ToUpper().Equals("OPTCOMMANDTYPE"))
- oPropertyInfo.SetValue(this, COM_STL_COMMAND_CMDTYPE.NONE, null);
- else
- oPropertyInfo.SetValue(this, value, null);
- }
- catch (Exception ex)
- {
- Debug.Print(ex.Message);
- }
- }
- }
- /// <summary>
- /// 复制
- /// </summary>
- /// <param name="par"></param>
- public void Copy(ref STL_IRON_ARRIVE par)
- {
- if (par != null)
- {
- PropertyInfo[] PropertyInfos = this.GetType().GetProperties();
- if (PropertyInfos == null || PropertyInfos.Length == 0) return;
- object value;
- foreach (PropertyInfo oPropertyInfo in PropertyInfos)
- {
- try
- {
- value = oPropertyInfo.GetValue(par, null);
- oPropertyInfo.SetValue(this, value, null);
- }
- catch (Exception ex)
- {
- Debug.Print(ex.Message);
- }
- }
- }
- }
- /// <summary>
- ///设置数据
- /// </summary>
- /// <param name="Row"></param>
- public void SetData(DataRow Row)
- {
- if (Row == null) return;
- PropertyInfo[] PropertyInfos = this.GetType().GetProperties();
- if (PropertyInfos == null || PropertyInfos.Length == 0) return;
- COM_STL_COMMAND_CMDTYPE cmdType = COM_STL_COMMAND_CMDTYPE.NONE;
- foreach (PropertyInfo oPropertyInfo in PropertyInfos)
- {
- try
- {
- if (Row.Table.Columns.Contains(oPropertyInfo.Name.ToUpper()))
- {
- if (oPropertyInfo.Name.ToUpper().Equals("OPTCOMMANDTYPE"))
- {
- try
- {
- cmdType = (COM_STL_COMMAND_CMDTYPE)Enum.Parse(typeof(COM_STL_COMMAND_CMDTYPE), Convert.ToString(Row[oPropertyInfo.Name.ToUpper()]), true);
- }
- catch
- {
- cmdType = COM_STL_COMMAND_CMDTYPE.NONE;
- }
- oPropertyInfo.SetValue(this, cmdType, null);
- }
- else oPropertyInfo.SetValue(this, Row[oPropertyInfo.Name.ToUpper()], null);
- }
- }
- catch (Exception ex)
- {
- Debug.Print(ex.Message);
- }
- }
- }
- }
- public class CommandCollection
- {
- private ArrayList _Keys;
- private Hashtable _Values;
- public CommandCollection()
- {
- _Keys = new ArrayList();
- _Values = new Hashtable();
- }
- public bool Contains(COM_STL_COMMAND Item)
- {
- return (Item != null && _Keys.Contains(Item.ID_));
- }
- public int Count
- {
- get
- {
- return _Keys.Count;
- }
- }
- public COM_STL_COMMAND this[int index]
- {
- get
- {
- if (_Keys != null && index >= 0 && index < _Keys.Count)
- {
- return (COM_STL_COMMAND)_Values[_Keys[index]];
- }
- return null;
- }
- }
- public COM_STL_COMMAND this[string Key]
- {
- get
- {
- if (_Keys != null && _Keys.Contains(Key))
- {
- return (COM_STL_COMMAND)_Values[Key];
- }
- return null;
- }
- }
- public COM_STL_COMMAND Add(COM_STL_COMMAND Item)
- {
- if (Item == null || _Keys.Contains(Item.ID_))
- {
- return null;
- }
- else
- {
- _Keys.Add(Item.ID_);
- _Values.Add(Item.ID_, Item);
- return Item;
- }
- }
- public void Remove(COM_STL_COMMAND Item)
- {
- if (Item != null && _Keys.Contains(Item.ID_))
- {
- _Keys.Remove(Item.ID_);
- _Values.Remove(Item.ID_);
- }
- }
- public void RemoveAt(int index)
- {
- if (index >= 0 && index < _Keys.Count)
- {
- object obj = _Keys[index];
- if (obj != null)
- {
- _Keys.Remove(obj);
- _Values.Remove(obj);
- }
- }
- }
- public void RemoveAll()
- {
- Clear();
- }
- public void Clear()
- {
- _Keys.Clear();
- _Values.Clear();
- }
- }
- /// <summary>
- /// 炼钢作业手动操作命令类型
- /// </summary>
- public enum COM_STL_COMMAND_CMDTYPE
- {
- /// <summary>
- /// 空
- /// </summary>
- NONE,
- /// <summary>
- /// 出钢
- /// </summary>
- TAPPING,
- /// <summary>
- /// 出下道工序
- /// </summary>
- GONEXT,
- /// <summary>
- /// 指定位置
- /// </summary>
- ASSIGNEDPOS,
- /// <summary>
- /// 进站/上台
- /// </summary>
- ARRIVE,
- /// <summary>
- /// 出站/下台
- /// </summary>
- LEAVE,
- /// <summary>
- /// 位置对换
- /// </summary>
- TRANS,
- /// <summary>
- /// 开浇
- /// </summary>
- OPENCAST,
- /// <summary>
- /// 停浇
- /// </summary>
- STOPCAST,
- /// <summary>
- /// 强制结束
- /// </summary>
- OVER,
- /// <summary>
- /// 切换信息显示
- /// </summary>
- SWITCH,
- /// <summary>
- /// 钢水回炉
- /// </summary>
- MELTDOWN,
- }
- }
|