Example #1
0
        private void PoseDifference_Load(object sender, EventArgs e)
        {
            FilesINI ConfigController = new FilesINI();

            CurrentIP    = ConfigController.INIRead("UR控制参数", "RemoteIP", DefaultINIPath);
            Control_Port = ConfigController.INIRead("UR控制参数", "RemoteControlPort", DefaultINIPath);;

            URRegisterHandle.RemoteIP      = CurrentIP;
            URRegisterHandle.RemotePort    = 502;
            URRegisterHandle.SocketTimeOut = 1000;

            RefPos1 = ConfigController.INIRead("UR运动参数", "BasePos1", DefaultINIPath);
            RefPos2 = ConfigController.INIRead("UR运动参数", "BasePos2", DefaultINIPath);
            RefPos3 = ConfigController.INIRead("UR运动参数", "BasePos3", DefaultINIPath);

            txtPose1.Text = RefPos1;
            txtPose2.Text = RefPos2;
            txtPose3.Text = RefPos3;

            HomeVector = RefPos1;

            //尝试连接,如果不能连接,则某些按钮不可用
            try
            {
                URController.Creat_client(CurrentIP, Convert.ToInt32(Control_Port));
                ifConnected = true;
            }
            catch
            {
                ifConnected = false;
                MessageBox.Show("未连接UR,某些功能不可用");
            }
        }
Example #2
0
        private void Teach_Load(object sender, EventArgs e)
        {
            FilesINI ConfigController = new FilesINI();
            string   Target_IP        = ConfigController.INIRead("UR控制参数", "RemoteIP", DefaultINIPath);
            string   Control_Port     = ConfigController.INIRead("UR控制参数", "RemoteControlPort", DefaultINIPath);;

            URController.Creat_client(Target_IP, Convert.ToInt32(Control_Port));
            //MessageBox.Show(Target_IP + "|" + Control_Port);
        }
Example #3
0
        private void Register_Load(object sender, EventArgs e)
        {
            //读取配置文件的IP
            FilesINI ConfigController = new FilesINI();
            string   CurrentIP        = ConfigController.INIRead("UR控制参数", "RemoteIP", DefaultINIPath);

            URRegisterHandle.RemoteIP      = CurrentIP;
            URRegisterHandle.RemotePort    = 502;
            URRegisterHandle.SocketTimeOut = 1000;

            URRegisterHandle.connectServer();
        }
Example #4
0
        private void Register_Load(object sender, EventArgs e)
        {
            //读取配置文件的IP
            FilesINI ConfigController = new FilesINI();
            string   CurrentIP        = ConfigController.INIRead("UR控制参数", "RemoteIP", DefaultINIPath);

            URRegisterHandle.RemoteIP      = CurrentIP;
            URRegisterHandle.RemotePort    = 502;
            URRegisterHandle.SocketTimeOut = 1000;

            //同样只是初始化的时候执行一次,由于是传统的读写寄存器,不需要保持连接,也就不需要实时的initialServer
            //URRegisterHandle.initialServer();
        }
Example #5
0
        private void Dashboard_Load(object sender, EventArgs e)
        {
            FilesINI ConfigController = new FilesINI();
            string   Target_IP        = ConfigController.INIRead("UR控制参数", "RemoteIP", DefaultINIPath);
            int      Control_Port     = 29999;

            //创建Dashboard客户端
            URController.Creat_client(Target_IP, Control_Port);

            //一开始连接到UR之后UR会主动发过来一条信息
            string Feedback = URController.No_command_WaitFeedback();

            txtFeedback.Items.Add(Feedback);

            //设置这个Combobox
            UserRoleBox.Items.Add("程序员");
            UserRoleBox.Items.Add("操作员");
            UserRoleBox.Items.Add("完全锁定");
        }