using System; using Microsoft.SPOT; using Microsoft.VisualStudio.TestTools.UnitTesting; using CPF; using System.Text; using System.Threading; using HWModules; using SWModules; using CPF.Surface_States; namespace CPFUnitTests { [TestClass] public class SurfaceOpsUnitTests { [TestMethod] public void TestSurfaceOps() { HWModules.MotherBoard motherboard = MotherBoard.Instance; motherboard.EnableChannelPower((int)MotherBoard.ChannelNames.GPSChannel); motherboard.EnableChannelPower(MotherBoard.ChannelNames.IridiumChannel); motherboard.EnableChannelPower(MotherBoard.ChannelNames.OptodeChannel); motherboard.EnableChannelPower(MotherBoard.ChannelNames.PTHSensorChannel); motherboard.EnableChannelPower(MotherBoard.ChannelNames.BluetoothChannel); Thread.Sleep(2000); MessageQueue messageQ = MessageQueue.Instance; StateBase stateSurfaceOps = new SurfaceOps("Surface Ops"); BTConsole btConsole = BTConsole.Instance; btConsole.init(); EngrLogger.SendConsoleLine += btConsole.SendLine; BuoyancyEngine buoyancyEngine = BuoyancyEngine.Instance; buoyancyEngine.init(); IridiumModem1 iModem = IridiumModem1.Instance; iModem.init(); GPS1 gps = GPS1.Instance; Optode1 optode = Optode1.Instance; optode.init(); RMG185_PTHSensor pthSensor = new RMG185_PTHSensor(); pthSensor.init(); pthSensor.getPTH(); Mission.createStandardMission(); iModem.sendCICCID(); for (int j = 0; j < 5; j++) { messageQ.processQ(); Thread.Sleep(1000); } stateSurfaceOps.doStateEntryActions(); int stateReturn = 0; do { stateReturn = stateSurfaceOps.doStateActions(); for (int j = 0; j < 5; j++) { messageQ.processQ(); Thread.Sleep(1000); } } while(stateReturn < 11); } } }