Esempio n. 1
0
        private void UpdateOhtInfo(OhtInfoData info)
        {
            DataRow row = m_tableOHTInfo.Rows.Find(info.ID);

            if (null != row)
            {
                SetRowOHTInfoData(row, info);
                row.AcceptChanges();
            }
            else
            {
                row       = m_tableOHTInfo.NewRow();
                row["ID"] = info.ID;
                SetRowOHTInfoData(row, info);
                m_tableOHTInfo.Rows.Add(row);
                m_tableOHTInfo.AcceptChanges();
            }
        }
Esempio n. 2
0
 private void ProcessOHTInfo(ArrayList item)
 {
     if (3 == item.Count)
     {
         OhtInfoData info   = null;
         string      strTCP = item[1] + ":" + item[2];
         int         nID    = Convert.ToInt16(item[0]);
         m_dictOhtInfo.TryGetValue(nID, out info);
         if (null != info)
         {
             info.TcpInfo = strTCP;
         }
         else
         {
             info         = new OhtInfoData();
             info.ID      = nID;
             info.TcpInfo = strTCP;
             m_dictOhtInfo.Add(nID, info);
         }
         UpdateOhtInfo(info);
     }
 }
Esempio n. 3
0
 private void UpdateOhtInfo(OhtInfoData info)
 {
     DataRow row = m_tableOHTInfo.Rows.Find(info.ID);
     if (null != row)
     {
         SetRowOHTInfoData(row, info);
         row.AcceptChanges();
     }
     else
     {
         row = m_tableOHTInfo.NewRow();
         row["ID"] = info.ID;
         SetRowOHTInfoData(row, info);
         m_tableOHTInfo.Rows.Add(row);
         m_tableOHTInfo.AcceptChanges();
     }
 }
Esempio n. 4
0
 private void SetRowOHTInfoData(DataRow row, OhtInfoData info)
 {
     row["Position"] = info.Position;
     row["Hand"] = info.Hand;
     row["Status"] = info.Status;
     row["Alarm"] = info.Alarm;
     row["TcpInfo"] = info.TcpInfo;
 }
Esempio n. 5
0
        private void ProcessOHTPos(ArrayList item)
        {
            if (4 == item.Count)
            {
                OhtInfoData info = null;
                int nID = Convert.ToInt16(item[0]);
                long nPosition = Convert.ToInt64(item[1]);
                int nHand = Convert.ToInt16(item[2]);
                int nStatus = TryConver.ToByte(item[3].ToString());

                m_dictOhtInfo.TryGetValue(nID, out info);
                if (null != info)
                {
                    info.Position = nPosition;
                    info.Hand = nHand;
                    info.Status = nStatus;
                }
                else
                {
                    info = new OhtInfoData();
                    info.ID = nID;
                    info.Position = nPosition;
                    info.Hand = nHand;
                    info.Status = nStatus;
                    m_dictOhtInfo.Add(nID, info);
                }
                UpdateOhtInfo(info);
            }
        }
Esempio n. 6
0
 private void ProcessOHTInfo(ArrayList item)
 {
     if (3 == item.Count)
     {
         OhtInfoData info = null;
         string strTCP = item[1] + ":" + item[2];
         int nID = Convert.ToInt16(item[0]);
         m_dictOhtInfo.TryGetValue(nID, out info);
         if (null != info)
         {
             info.TcpInfo = strTCP;
         }
         else
         {
             info = new OhtInfoData();
             info.ID = nID;
             info.TcpInfo = strTCP;
             m_dictOhtInfo.Add(nID, info);
         }
         UpdateOhtInfo(info);
     }
 }