예제 #1
0
        private void RobotForm_Load(object sender, EventArgs e)
        {
//           asc.controllInitializeSize(this);

//            MultiLanguage.lang = MultiLanguage.ReadDefaultLanguage();
//             MultiLanguage.getNames(this);
//
//             IList list = MultiLanguage.GetLanguageList(MultiLanguage.lang);
//            asc.controllInitializeSize(this);
//            if (Localization.HasLang)
//            {
//                Localization.RefreshLanguage(this);
//                changeDGV();
//            }
            robotPtr = Handle;

            switchRobot.Items.Clear();
            foreach (ROBOT eachRobot in MainForm.robotlist)
            {
                string str = "Robot:";
                str += eachRobot.EQUIP_CODE;
                switchRobot.Items.Add(str);
            }


            if (switchRobot.Items.Count > 0 && PLCDataShare.m_plclist.Count > 0)
            {
                plc = PLCDataShare.m_plclist[0];
                switchRobot.SelectedIndex = 0;
                robot          = MainForm.robotlist[switchRobot.SelectedIndex];
                timer1.Enabled = true;
            }
        }
예제 #2
0
 private void switchRobot_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (plc != null || robot == null)
     {
         robot                = MainForm.robotlist[switchRobot.SelectedIndex];
         ROBOTIndex           = switchRobot.SelectedIndex;
         switchRobot_Selected = true;
     }
 }
예제 #3
0
 private void UpdateRobotSignal(ROBOT robot)
 {
     if (switchRobot_Selected)
     {
         getRobotSingalList2plcDGV("X", robot.PLCAdressStar_X, robot.AdressSum_X, robotDGVInPut
                                   , ref MITSUBISHIPLC_SignalList_result1, ref HNC8PLC_SignalList_result1);
         getRobotSingalList2plcDGV("Y", robot.PLCAdressStar_Y, robot.AdressSum_Y, robotDGVOutPut
                                   , ref MITSUBISHIPLC_SignalList_result2, ref HNC8PLC_SignalList_result2);
         switchRobot_Selected = false;
     }
     else
     {
         UpdateRobotSignal("X", robot.PLCAdressStar_X, ref robotDGVInPut
                           , ref MITSUBISHIPLC_SignalList_result1, ref HNC8PLC_SignalList_result1);
         UpdateRobotSignal("Y", robot.PLCAdressStar_Y, ref robotDGVOutPut
                           , ref MITSUBISHIPLC_SignalList_result2, ref HNC8PLC_SignalList_result2);
     }
 }
예제 #4
0
            /// <summary>
            /// 鼠标停留事件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void MouseHoverTooltip(object sender, System.EventArgs e)
            {
                ToolTip m_tooltip = new ToolTip();

                if (m_showtype == 0)//CNC
                {
                    CNC    m_cnc = MainForm.cnclist[m_showitemserial];
                    string str   = "";
                    str += HomeForm.ToolTip_str[0] + m_cnc.JiTaiHao + "\r\n";
                    str += ToolTip_str[1] + m_cnc.ip + "\r\n";
                    str += ToolTip_str[2] + m_cnc.get_gCodeName() + "\r\n";
                    m_tooltip.SetToolTip((Control)sender, str);
                }
                else if (m_showtype == 1)//robot
                {
                    ROBOT  m_robot = MainForm.robotlist[m_showitemserial];
                    string str     = "";
                    str += HomeForm.ToolTip_str[0] + m_robot.EQUIP_CODE + "\r\n";
//                     str += ToolTip_str[1] + m_cnc.ip + "\r\n";
//                     str += ToolTip_str[2] + m_cnc.get_gCodeName() + "\r\n";
                    m_tooltip.SetToolTip((Control)sender, str);
                }
            }