Beispiel #1
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);
            }
        }
Beispiel #2
0
        private void ProcessStkRoomStatus(ArrayList item)
        {
            if (item.Count > 1)
            {
                byte nID = TryConver.ToByte(item[0].ToString());
                if (nID == stockorId)
                {
                    listViewPageStkRoom.Clear();
                    for (int i = 1; i < 142; i++)
                    {
                        Int32        nStatus  = TryConver.ToInt32(item[i].ToString());
                        ListViewItem listItem = new ListViewItem();
                        switch (nStatus)
                        {
                        case 0:
                            listItem.ImageKey = "green";
                            break;

                        case 1:
                            listItem.ImageKey = "blue";
                            break;

                        case 2:
                            listItem.ImageKey = "red";
                            break;
                        }
                        listItem.Text = i.ToString();
                        listViewPageStkRoom.Items.Add(listItem);
                    }
                }
            }
        }
Beispiel #3
0
 private void ProcessPosTable(ArrayList item)
 {
     if (4 == item.Count)
     {
         UInt32  uPos   = Convert.ToUInt32(item[1]);
         Byte    uType  = TryConver.ToByte(item[2].ToString());
         Byte    uSpeed = TryConver.ToByte(item[3].ToString());
         DataRow row    = m_tableKeyPos.Rows.Find(uPos);
         if (null != row)
         {
             row[TKeyP_Name]  = item[0].ToString();
             row[TKeyP_Type]  = uType;
             row[TKeyP_Speed] = uSpeed;
             row.AcceptChanges();
         }
         else
         {
             row              = m_tableKeyPos.NewRow();
             row[TKeyP_Pos]   = uPos;
             row[TKeyP_Name]  = item[0].ToString();
             row[TKeyP_Type]  = uType;
             row[TKeyP_Speed] = uSpeed;
             m_tableKeyPos.Rows.Add(row);
             m_tableKeyPos.AcceptChanges();
         }
     }
 }
Beispiel #4
0
        private void ProcessStkStatus(ArrayList item)
        {
            if (item.Count == 2)
            {
                byte nID = TryConver.ToByte(item[0].ToString());
                if (nID == stockorId)
                {
                    tBStkInfoStatus.Text = item[1].ToString();
                    switch (Convert.ToInt16(item[1]))
                    {
                    case 0:
                        tBStkInfoStatus.Text = "正常运行";
                        break;

                    case 1:
                        tBStkInfoStatus.Text = "报警运行";
                        break;

                    case 2:
                        tBStkInfoStatus.Text = "故障停机";
                        break;

                    default:
                        tBStkInfoStatus.Text = "";
                        break;
                    }
                }
            }
        }
Beispiel #5
0
        private byte GetBufID()
        {
            byte uBufID = 0;

            uBufID        = TryConver.ToByte(tBBuffID.Text);
            tBBuffID.Text = uBufID.ToString();
            return(uBufID);
        }
Beispiel #6
0
        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection rows = dataGridViewOHTInfo.SelectedRows;

            if (rows.Count > 0)
            {
                DataGridViewRow row = rows[0];
                m_uIdSelected = TryConver.ToByte(row.Cells[0].Value.ToString());
            }
            tBOHTID.Text      = m_uIdSelected.ToString();
            checkBox1.Checked = false;
        }
Beispiel #7
0
        private void bnSetStatusTime_Click(object sender, EventArgs e)
        {
            string strTime = tBStatusTime.Text;
            byte   nTime   = 0;

            GetOHTIDbyTextBox();
            nTime = TryConver.ToByte(strTime);
            string strVal;

            strVal = string.Format("<{0}, {1}>", m_uIdSelected, nTime);

            int nWRet = m_dataHub.WriteData(GuiCommand.OhtStatusTime, strVal);
        }
Beispiel #8
0
        private void ProcessStkInputStatus(ArrayList item)
        {
            if (item.Count > 1)
            {
                byte nID = TryConver.ToByte(item[0].ToString());
                if (nID == stockorId)
                {
                    switch (Convert.ToInt16(item[1]))
                    {
                    case 0:
                        tBPortStatusAuto.Text = "空闲";
                        break;

                    case 1:
                        tBPortStatusAuto.Text = "繁忙";
                        break;

                    case 2:
                        tBPortStatusAuto.Text = "故障";
                        break;

                    default:
                        tBPortStatusAuto.Text = "";
                        break;
                    }
                    switch (Convert.ToInt16(item[2]))
                    {
                    case 0:
                        tBPortStatusManu.Text = "空闲";
                        break;

                    case 1:
                        tBPortStatusManu.Text = "繁忙";
                        break;

                    case 2:
                        tBPortStatusManu.Text = "故障";
                        break;

                    default:
                        tBPortStatusManu.Text = "";
                        break;
                    }
                }
            }
        }
Beispiel #9
0
 private void ProcessFoupsTable(ArrayList item)
 {
     if (item.Count > 1)
     {
         byte nID = TryConver.ToByte(item[0].ToString());
         if (nID == stockorId)
         {
             UInt16  nBarCode  = Convert.ToUInt16(item[1]);
             UInt16  nFoupRoom = Convert.ToUInt16(item[2]);
             UInt16  nLot      = Convert.ToUInt16(item[3]);
             UInt16  nStatus   = Convert.ToUInt16(item[4]);
             UInt16  nIsErase  = Convert.ToUInt16(item[5]);
             DataRow row       = m_tableFoupsInfo.Rows.Find(nBarCode);
             if (null != row)
             {
                 if (0 == nIsErase)
                 {
                     row[TKey_BarCode]  = nBarCode;
                     row[TKey_FoupRoom] = nFoupRoom;
                     row[TKey_Lot]      = nLot;
                     row[TKey_Status]   = nStatus;
                     row.AcceptChanges();
                 }
                 else if (1 == nIsErase)
                 {
                     m_tableFoupsInfo.Rows.Remove(row);
                     m_tableFoupsInfo.AcceptChanges();
                 }
             }
             else
             {
                 row = m_tableFoupsInfo.NewRow();
                 row[TKey_BarCode]  = nBarCode;
                 row[TKey_FoupRoom] = nFoupRoom;
                 row[TKey_Lot]      = nLot;
                 row[TKey_Status]   = nStatus;
                 m_tableFoupsInfo.Rows.Add(row);
                 m_tableFoupsInfo.AcceptChanges();
             }
         }
     }
 }
Beispiel #10
0
 private void ProcessStkInfo(ArrayList item)
 {
     if (item.Count > 1)
     {
         int     nID = TryConver.ToByte(item[0].ToString());
         DataRow row = m_tableStocker.Rows.Find(nID);
         if (null != row)
         {
             row[TKey_ID] = item[0].ToString();
             row.AcceptChanges();
         }
         else
         {
             row          = m_tableStocker.NewRow();
             row[TKey_ID] = nID;
             m_tableStocker.Rows.Add(row);
             m_tableStocker.AcceptChanges();
             NotifyMainStockerChange();
         }
     }
 }
Beispiel #11
0
        private void btnFoupMoveInOut_Click(object sender, EventArgs e)
        {
            Button btn   = sender as Button;
            byte   nID   = stockorId;
            byte   nOpt  = 2;
            byte   nMode = TryConver.ToByte(cBFoupMove.SelectedIndex.ToString());
            int    nData = TryConver.ToInt32(tBFoupMove.Text);

            if (btn.Name == "btnFoupMoveIn")
            {
                nOpt = 0;
            }
            else if (btn.Name == "btnFoupMoveOut")
            {
                nOpt = 1;
            }
            string strVal;

            strVal = string.Format("<{0},{1},{2},{3}>", nID, nOpt, nMode, nData);

            int nWRet = m_dataHub.WriteData(GuiCommand.StkHandFoup, strVal);
        }
Beispiel #12
0
 private void GetOHTIDbyTextBox()
 {
     m_uIdSelected = TryConver.ToByte(tBOHTID.Text);
 }
Beispiel #13
0
        private void ProcessLastOptFoup(ArrayList item)
        {
            if (item.Count > 1)
            {
                byte nID = TryConver.ToByte(item[0].ToString());
                if (nID == stockorId)
                {
                    tBLastBarCode.Text      = item[1].ToString();
                    tBLastFoupID.Text       = item[2].ToString();
                    tBLastLot.Text          = item[3].ToString();
                    tBLastFoupEventDir.Text = item[4].ToString();
                    UInt16 nInput = Convert.ToUInt16(item[5].ToString());
                    if (1 == nInput)
                    {
                        tBLastFoupAuto.Text = "1";
                        tBLastFoupManu.Text = "0";
                    }
                    else if (2 == nInput)
                    {
                        tBLastFoupAuto.Text = "2";
                        tBLastFoupManu.Text = "0";
                    }
                    else if (3 == nInput)
                    {
                        tBLastFoupAuto.Text = "3";
                        tBLastFoupManu.Text = "0";
                    }
                    else if (4 == nInput)
                    {
                        tBLastFoupAuto.Text = "4";
                        tBLastFoupManu.Text = "0";
                    }
                    else if (5 == nInput)
                    {
                        tBLastFoupAuto.Text = "0";
                        tBLastFoupManu.Text = "1";
                    }
                    else if (6 == nInput)
                    {
                        tBLastFoupAuto.Text = "0";
                        tBLastFoupManu.Text = "2";
                    }
                    else if (7 == nInput)
                    {
                        tBLastFoupAuto.Text = "0";
                        tBLastFoupManu.Text = "3";
                    }
                    else if (8 == nInput)
                    {
                        tBLastFoupAuto.Text = "0";
                        tBLastFoupManu.Text = "4";
                    }

                    try
                    {
                        DateTime dt = new DateTime(TryConver.ToInt32(item[6].ToString()),
                                                   TryConver.ToInt32(item[7].ToString()),
                                                   TryConver.ToInt32(item[8].ToString()),
                                                   TryConver.ToInt32(item[9].ToString()),
                                                   TryConver.ToInt32(item[10].ToString()),
                                                   TryConver.ToInt32(item[11].ToString()));
                        string lastEventTime = dt.ToString();
                        tBLastEventTime.Text = lastEventTime;
                    }
                    catch (System.Exception ex)
                    {
                        //MessageBox.Show(ex.Message);
                    }
                }
            }
        }