コード例 #1
0
        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);
        }
コード例 #2
0
        public void TestMoveRadioTelescope_HardStops()
        {
            // Set the Telescope Type to HARD STOPS
            TestRTPLC.setTelescopeType(RadioTelescopeTypeEnum.HARD_STOPS);

            // Create an Orientation object with an azimuth of 311 and elevation of 42
            Orientation Orientation = new Orientation(311.0, 42.0);

            // Set the RadioTelescope's CurrentOrientation field
            MovementResult response = TestRadioTelescopeController.MoveRadioTelescopeToOrientation(Orientation, MovementPriority.Appointment);

            // Call the GetCurrentOrientationMethod
            Orientation CurrentOrientation = TestRadioTelescopeController.GetCurrentOrientation();

            // Ensure the objects are identical
            Assert.AreEqual(response, MovementResult.Success);
            Assert.AreEqual(Orientation.Azimuth, CurrentOrientation.Azimuth, 0.001);
            Assert.AreEqual(Orientation.Elevation, CurrentOrientation.Elevation, 0.001);
        }