Ejemplo n.º 1
0
 private bool IsBoardOnLine(int slotSn, SystemInformation sysInfo)
 {
     try
     {
         var slotInfo = sysInfo._boardsInfo[slotSn];
         return(slotInfo._isOnline == 1);
     }
     catch (IndexOutOfRangeException e)
     {
         MainForm.SetOutPutText(e.Message + "\n" + e.StackTrace);
         return(false);
     }
 }
Ejemplo n.º 2
0
        private void ProcessNodeInfo(SystemInformation sysInfo, Dictionary <int, SlotInfo> infos)
        {
            try
            {
                //解析数据
                int slotNum = sysInfo._slotNum;       //槽位数
                _slotNum = slotNum;
                for (int i = 0; i < slotNum; i++)
                {
                    var slotInfo = sysInfo._boardsInfo[i];
                    int slotSn   = i + 1;

                    SlotInfo sInfo = new SlotInfo();
                    sInfo.slotChan = slotSn;
                    sInfo._type    = "板卡" + slotSn.ToString();
                    if (slotInfo._isOnline == 1) //在线
                    {
                        sInfo._temp     = slotInfo._temp;
                        sInfo._voltage  = slotInfo._vol;
                        sInfo._electric = slotInfo._cur;
                        sInfo._power    = slotInfo._power;
                        sInfo._status   = IsException(sInfo) ? "异常" : "正常";
                    }
                    else
                    {
                        sInfo._status = "异常";
                    }
                    infos.Add(i, sInfo);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("ProcessNodeInfo:" + e.Message);
                return;
            }
        }