static void Main(string[] args) { IQueue CommanderDispatcherMessageQueue = new PriorityQueue(30); IQueue DispatcherSerialMessageQueue = new PriorityQueue(30); //IQueue SerialStatusMessageQueue = new PriorityQueue(30); // IQueue StatusCommanderMessageQueue = new PriorityQueue(30); //IQueue MicrocontrollerCommanderMessageBox = new PriorityQueue(30); Thread dispatcher = new Thread(() => Dispatcher(CommanderDispatcherMessageQueue)); //Thread serialManager = new Thread(() => SerialManager(DispatcherSerialMessageQueue, MicrocontrollerCommanderMessageBox)); //Thread statusUpdater = new Thread(() => StatusUpdater(SerialStatusMessageQueue)); //Thread commandSender = new Thread(() => CommandSender(MicrocontrollerCommanderMessageBox)); RoverCameraFactory.GetInstance().Initialize(Properties.NetworkSettings.Default.OperatorIPAddress, Properties.NetworkSettings.Default.CameraBasePort); dispatcher.Start(); //serialManager.Start(); //statusUpdater.Start(); // commandSender.Start(); //Start the commands listener var commandsListener = new GuardedMessageListener( Properties.NetworkSettings.Default.CommandsPort, CommanderDispatcherMessageQueue, Properties.NetworkSettings.Default.OperatorIPAddress, new WatchDog()); commandsListener.StartListening(); }
public void Execute() { Console.WriteLine("Turning Camera {0} {1}", this.camIndex, this.status == true ? "On" : "Off"); if (this.camIndex <= RoverCameraFactory.GetInstance().GetCameras().Count - 1) { RoverCameraDevice c = RoverCameraFactory.GetInstance().GetCameras().ElementAt(this.camIndex); if (this.status == true) { c.Start(c.GetCapabilities(new Size(320, 240))); } else { c.Stop(); } } }