Пример #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);
            }
        }
Пример #2
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;
                    }
                }
            }
        }
Пример #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();
         }
     }
 }
Пример #4
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);
                    }
                }
            }
        }
Пример #5
0
        private byte GetBufID()
        {
            byte uBufID = 0;

            uBufID        = TryConver.ToByte(tBBuffID.Text);
            tBBuffID.Text = uBufID.ToString();
            return(uBufID);
        }
Пример #6
0
        private void dataGridViewKeyPos_SelectionChanged(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection rows = dataGridViewKeyPos.SelectedRows;

            if (rows.Count > 0)
            {
                DataGridViewRow row = rows[0];
                m_nPathPosition = TryConver.ToInt32(row.Cells[0].Value.ToString());
            }
        }
Пример #7
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;
        }
Пример #8
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);
        }
Пример #9
0
        private void btnBackTimeFoups_Click(object sender, EventArgs e)
        {
            string strTime = tBBackTimeFoups.Text;
            byte   nID     = stockorId;
            Int32  nTime   = 0;

            nTime = TryConver.ToInt32(strTime);
            string strVal;

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

            int nWRet = m_dataHub.WriteData(GuiCommand.StkSetFoupInfoBackTime, strVal);
        }
Пример #10
0
 private void btnStkAlarmQuery_Click(object sender, EventArgs e)
 {
     if (dateTimePickerAlarmET.Value < dateTimePickerAlarmST.Value)
     {
         MessageBox.Show("please choose End Time again");
         return;
     }
     DateTime startTime = dateTimePickerAlarmST.Value;
     DateTime endTime   = dateTimePickerAlarmET.Value;
     string   strStart  = TryConver.ToString(startTime);
     string   strEnd    = TryConver.ToString(endTime);
     string   strVal    = strStart + "," + strEnd;
 }
Пример #11
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;
                    }
                }
            }
        }
Пример #12
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();
             }
         }
     }
 }
Пример #13
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();
         }
     }
 }
Пример #14
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);
        }
Пример #15
0
        private void bnSetPath_Click(object sender, EventArgs e)
        {
            int    nFrom  = TryConver.ToInt32(textBoxPathFrom.Text);
            int    nTo    = TryConver.ToInt32(textBoxPathTo.Text);
            string strSQL = String.Format("Position >= {0} and Position <= {1}", nFrom, nTo);

            DataRow[] rows = m_tableKeyPos.Select(strSQL);
            m_tablePathView.Rows.Clear();
            string strPathData = "";

            foreach (DataRow row in rows)
            {
                DataRow newRow = m_tablePathView.NewRow();
                newRow.ItemArray = row.ItemArray;
                m_tablePathView.Rows.Add(newRow);
                string strKeyPoint = "";
                strKeyPoint = string.Format("<{0},{1},{2}>", newRow[TKeyP_Pos].ToString(),
                                            newRow[TKeyP_Type].ToString(), newRow[TKeyP_Speed].ToString());
                strPathData += strKeyPoint;
            }

            string strSetPath = "";
            int    nPathCache = 0;

            if (checkBoxPathCache.Checked)
            {
                nPathCache = 1;
            }
            else
            {
                nPathCache = 0;
            }
            strSetPath = String.Format("<{0},{1}>{2}", m_uIdSelected,
                                       nPathCache, strPathData);


            m_dataHub.Async_WriteData(GuiCommand.OhtSetPath, strSetPath);
        }
Пример #16
0
 private void ProcessFoupTable(ArrayList item)
 {
     if (7 == item.Count)
     {
         UInt32  uBarCode  = TryConver.ToUInt32(item[0].ToString());
         UInt32  uLot      = TryConver.ToUInt32(item[1].ToString());
         UInt32  uCarrier  = TryConver.ToUInt32(item[2].ToString());
         uint    uPort     = TryConver.ToUInt32(item[3].ToString());
         int     nLocation = TryConver.ToInt32(item[4].ToString());
         uint    uLocType  = TryConver.ToUInt32(item[5].ToString());
         uint    uStatus   = TryConver.ToUInt32(item[6].ToString());
         DataRow row       = m_tableFoup.Rows.Find(uBarCode);
         if (null != row)
         {
             row[1] = uLot;
             row[2] = uCarrier;
             row[3] = uPort;
             row[4] = nLocation;
             row[5] = uLocType;
             row[6] = uStatus;
             row.AcceptChanges();
         }
         else
         {
             row    = m_tableFoup.NewRow();
             row[0] = uBarCode;
             row[1] = uLot;
             row[2] = uCarrier;
             row[3] = uPort;
             row[4] = nLocation;
             row[5] = uLocType;
             row[6] = uStatus;
             m_tableFoup.Rows.Add(row);
             m_tableFoup.AcceptChanges();
         }
     }
 }
Пример #17
0
 private void GetOHTIDbyTextBox()
 {
     m_uIdSelected = TryConver.ToByte(tBOHTID.Text);
 }
Пример #18
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);
                    }
                }
            }
        }