public SettingsForm(RobotThread Robot, ControlsThread Controls, AppSettings Settings)
 {
     InitializeComponent();
     thread   = Robot;
     controls = Controls;
     settings = Settings;
 }
Esempio n. 2
0
        private void buttonStop_Click(object sender, EventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new Action(() =>
                {
                    buttonStart.Enabled = true;
                    buttonStop.Enabled  = false;
                }));
            }
            else
            {
                buttonStart.Enabled = true;
                buttonStop.Enabled  = false;
            }

            try
            {
                RobotThread.Abort();
            }
            catch
            {
            }
            RobotThread = null;
            try
            {
                if (ZlpIOHelper.DirectoryExists(UploadedPaths.TempPath))
                {
                    ZlpIOHelper.DeleteDirectory(UploadedPaths.TempPath, true);
                }
            }
            catch { }
        }
 public ControlsThread(InputThread Input, RobotThread Robot, ThreadPriority Priority = ThreadPriority.Normal) : base("Controls Thread", Priority)
 {
     inputThread                  = Input;
     robotThread                  = Robot;
     robotThread.OnConnected     += RobotThread_OnConnected;
     robotThread.OnDisconnecting += RobotThread_OnDisconnecting;
 }
 public RobotSimulatorUI(RobotThread RobotThread)
 {
     InitializeComponent();
     robotThread             = RobotThread;
     simulator               = new RobotSimulator();
     invokeClose             = false;
     simulator.OnDisconnect += () => {
         invokeClose = true;
     };
 }
        //Initialize window, create threads / thread switchers, and initialize logger.
        public MainInterface()
        {
            try {
                Thread.CurrentThread.Name = "Main UI";
            } catch (Exception) { }

            if (!InitializeLogging())
            {
                return;
            }
            Log.Info("Logging initialized.");

            InitializeComponent();
            Log.Info("Program initialized.");

            inputThread    = new InputThread(ThreadPriority.Normal);
            cameraThread   = new CameraThread(ThreadPriority.Normal);
            robotThread    = new RobotThread(ThreadPriority.Normal);
            controlsThread = new ControlsThread(inputThread, robotThread, ThreadPriority.Normal);
            Log.Info("Threads initialized.");

            settings = new AppSettings(robotThread);
        }
 public SensorsForm(RobotThread Robot)
 {
     InitializeComponent();
     robotThread = Robot;
 }
Esempio n. 7
0
 public AppSettings(RobotThread robot)
 {
     robot.OnConnected += Robot_OnConnected;
 }