Esempio n. 1
0
        public void BuildUp()
        {
            SensorNetworkServer SN = new SensorNetworkServer(SnServerIp, SnServerPort, SnClientIp, SnClientPort, SnTelescopeId, true);

            rtManagementThreads = new List <RadioTelescopeControllerManagementThread>()
            {
                new RadioTelescopeControllerManagementThread(new RadioTelescopeController(
                                                                 new RadioTelescope(new SpectraCyberSimulatorController(new SpectraCyberSimulator()), new  SimulationPLCDriver(PlcIp, McuIp, McuPort, PlcPort, true, false), new Location(), new Orientation(), 1, SN))),
                new RadioTelescopeControllerManagementThread(new RadioTelescopeController(
                                                                 new RadioTelescope(new SpectraCyberSimulatorController(new SpectraCyberSimulator()), new  SimulationPLCDriver(PlcIp, McuIp, McuPort + 1, PlcPort + 1, true, false), new Location(), new Orientation(), 2, SN))),
                new RadioTelescopeControllerManagementThread(new RadioTelescopeController(
                                                                 new RadioTelescope(new SpectraCyberSimulatorController(new SpectraCyberSimulator()), new  SimulationPLCDriver(PlcIp, McuIp, McuPort + 2, PlcPort + 2, true, false), new Location(), new Orientation(), 3, SN))),
            };

            controlRoom = new ControlRoom(weatherStation, 87);

            // End the CR's listener's server. We have to do this until we stop hard-coding that dang value.
            // TODO: Remove this logic when the value is no longer hard-coded (issue #350)
            //PrivateObject listener = new PrivateObject(controlRoom.mobileControlServer);
            //((TcpListener)listener.GetFieldOrProperty("server")).Stop();

            controlRoom.RTControllerManagementThreads.Add(rtManagementThreads[0]);
            controlRoom.RTControllerManagementThreads.Add(rtManagementThreads[1]);
            controlRoom.RTControllerManagementThreads.Add(rtManagementThreads[2]);
        }
        public void ReinitializeRTs()
        {
            SensorNetworkServer server = new SensorNetworkServer(SnServerIp, SnServerPort, SnClientIp, SnClientPort, SnTelescopeId, true);


            RTController0 = new RadioTelescopeController(
                new RadioTelescope(
                    new SpectraCyberSimulatorController(new SpectraCyberSimulator()),
                    new TestPLCDriver(IP, IP, Port1, Port2, true),
                    MiscellaneousConstants.JOHN_RUDY_PARK,
                    CalibrationOrientation, 1, server
                    )
                );

            RTController1 = new RadioTelescopeController(
                new RadioTelescope(
                    new SpectraCyberSimulatorController(new SpectraCyberSimulator()),
                    new TestPLCDriver(IP, IP, Port1 + 3, Port2 + 3, true),
                    MiscellaneousConstants.JOHN_RUDY_PARK,
                    CalibrationOrientation, 2, server
                    )
                );

            RTController2 = new RadioTelescopeController(
                new RadioTelescope(
                    new SpectraCyberSimulatorController(new SpectraCyberSimulator()),
                    new TestPLCDriver(IP, IP, Port1 + 6, Port2 + 6, true),
                    MiscellaneousConstants.JOHN_RUDY_PARK,
                    CalibrationOrientation, 3, server
                    )
                );
        }
Esempio n. 3
0
 public RadioTelescope(AbstractSpectraCyberController spectraCyberController, AbstractPLCDriver plcCommsHandler, Location location, Orientation calibrationOrientation, int localDBID, SensorNetworkServer sensorNetworkServer)
 {
     PLCDriver = plcCommsHandler;
     SpectraCyberController = spectraCyberController;
     CalibrationOrientation = calibrationOrientation;
     Location           = location;
     CurrentOrientation = new Orientation();
     Id = localDBID;
     SensorNetworkServer = sensorNetworkServer;
     maxElevationDegrees = MiscellaneousConstants.MAX_SOFTWARE_STOP_EL_DEGREES;
     minElevationDegrees = MiscellaneousConstants.MIN_SOFTWARE_STOP_EL_DEGREES;
 }
Esempio n. 4
0
        public void Initialize()
        {
            RadioTelescope = new RadioTelescope();

            AbstractPLCDriver PLC = new SimulationPLCDriver(PlcIp, McuIp, McuPort, PlcPort, true, false);

            RadioTelescope.PLCDriver = PLC;

            SensorNetworkServer SN = new SensorNetworkServer(SnServerIp, SnServerPort, SnClientIp, SnClientPort, SnTelescopeId, true);

            RadioTelescope.SensorNetworkServer = SN;

            RtController = new RadioTelescopeController(RadioTelescope);

            AbstractWeatherStation WS = new SimulationWeatherStation(1000);

            ControlRoom = new ControlRoom(WS, 80);

            ControlRoom.mobileControlServer.rtController = RtController;

            PrivListener = new PrivateObject(ControlRoom.mobileControlServer);
        }
        public void testInit()
        {
            TestRTPLC = new TestPLCDriver(ip, ip, 15001, 15003, true);
            //     TestRTPLC = new ProductionPLCDriver("192.168.0.70", "192.168.0.50" , 502 , 502 );
            SpectraCyberSimulatorController SCSimController = new SpectraCyberSimulatorController(new SpectraCyberSimulator());
            Location location = MiscellaneousConstants.JOHN_RUDY_PARK;

            SensorNetworkServer = new SensorNetworkServer(IPAddress.Parse("127.0.0.1"), 3000, "127.0.0.1", 3001, 500, false);
            RadioTelescope TestRT = new RadioTelescope(SCSimController, TestRTPLC, location, new Orientation(0, 0));

            TestRT.SensorNetworkServer = SensorNetworkServer;
            //TestRT.SensorNetworkServer.StartSensorMonitoringRoutine();
            TestRT.WeatherStation        = new SimulationWeatherStation(1000);
            TestRadioTelescopeController = new RadioTelescopeController(TestRT);

            // Override motor temperature sensors
            TestRadioTelescopeController.overrides.overrideAzimuthMotTemp = true;
            TestRadioTelescopeController.overrides.overrideElevatMotTemp  = true;
            TestRTPLC.setTelescopeType(RadioTelescopeTypeEnum.HARD_STOPS);

            TestRTPLC.StartAsyncAcceptingClients();

            TestRTPLC.Configure_MCU(.06, .06, 300, 300);
        }
Esempio n. 6
0
 public void Initialize()
 {
     Server = new SensorNetworkServer(ServerIpAddress, ServerPort, ClientIpAddress, ClientPort, TelescopeId, IsSimulation);
 }