public static void BuildUp(TestContext testContext) { string ip = PLCConstants.LOCAL_HOST_IP; int port = 8091; CommsHandler = new PLCClientCommunicationHandler(ip, port); TestDriver = new TestPLCDriver(ip, ip, port, port); TestDriver.StartAsyncAcceptingClients(); CommsHandler.ConnectToServer(); }
public static void SetUp(TestContext context) { //PLCClientCommunicationHandler PLCClientCommHandler = new PLCClientCommunicationHandler(ip, port); TestRTPLC = new TestPLCDriver(ip, ip, port, port); SpectraCyberSimulatorController SCSimController = new SpectraCyberSimulatorController(new SpectraCyberSimulator()); Location location = MiscellaneousConstants.JOHN_RUDY_PARK; RadioTelescope TestRT = new RadioTelescope(SCSimController, TestRTPLC, location, new Orientation(0, 0)); TestRadioTelescopeController = new RadioTelescopeController(TestRT); TestRTPLC.StartAsyncAcceptingClients(); //TestRT.PLCClient.ConnectToServer(); }
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); }
public void TestStartAndStopAsync() { Assert.AreEqual(true, DerivedAbstractPLCDriver.StartAsyncAcceptingClients()); Thread.Sleep(200); Assert.AreEqual(true, DerivedAbstractPLCDriver.RequestStopAsyncAcceptingClientsAndJoin()); }