using System; using System.IO.Ports; using CPF; using System.Threading; using CPFUnitTests.PowerSwitchBoard; using GHI.IO.Storage; using HWModules; using MFUnitTest; using SWModules; using System.Text; using CPFUnitTests.UT_BuoyancyEngine; using GHI.Processor; using Microsoft.SPOT.Hardware; namespace CPFUnitTests { class Program { public static BTConsole btConsole; //public static StructQueue sQueue = new StructQueue(); public static StateBase[] cpfState = new StateBase[(int)CPFStates.cpfStatesLength]; private static HWModules.MotherBoard mbBoard; private static CpfConsole cpfConsole; private static SDStorage sdStorage; //Main Function public static void Main() { Initialize(); // UNIT TESTS // //TestManager.RunTest(typeof(UnitTest_MotherBoard_uSD)); //TestManager.RunTest(typeof(UnitTest_MotherBoard_EnergyMonitor)); //TestManager.RunTest(typeof(UT_MotherBoard.UnitTest_MotherBoard_GPS)); //TestManager.RunTest(typeof(UnitTest_MotherBoard_I2CSlots)); //TestManager.RunTest(typeof(UnitTestIridium)); //TestManager.RunTest(typeof(UT_BuoyancyEngine.BEUnitTests),"TestFullExtendRetract"); //TestManager.RunTest(typeof(PumpEffTests)); //TestManager.RunTest(typeof(MotorizedValveUnitTests)); //TestManager.RunTest(typeof(PumpMotorUnitTests), "IncreaseBuoyancy"); //TestManager.RunTest(typeof(PumpMotorUnitTests), "DecreaseBuoyancy"); //TestManager.RunTest(typeof(CTDUnitTests)); //TestManager.RunTest(typeof(OptodeUnitTests)); //TestManager.RunTest(typeof(UnitTest_PSB_SN1),"TestNativeUartSlot2C"); //TestManager.RunTest(typeof(FLBBUnitTest)); //TestManager.RunTest(typeof(UnitTest_PSB_SN2)); //TestManager.RunTest(typeof(UnitTest_PSB_SN3), "TestI2CSerialPortSlot3B"); //TestManager.RunTest(typeof(PTHUnitTest)); //TestManager.RunTest(typeof(OCR504UnitTest)); //TestManager.RunTest(typeof(PressureNoiseUnitTest)); //TestManager.RunTest(typeof(ElmoTwitterUnitTest)); //TestManager.RunTest(typeof(GPSUnitTests)); //TestManager.RunTest(typeof(SurfaceOpsUnitTests)); //TestManager.RunTest(typeof(ProfileUnitTests)); //TestManager.RunTest(typeof(BEUnitTests),"TestDualLeadController"); //TestManager.RunTest(typeof(SciLoggerUT)); //TestManager.RunTest(typeof(BEUnitTests), "TestPositionSensor"); //TestManager.RunTest(typeof(PumpMotorUnitTests), "TestRunMotor"); //TestManager.RunTest(typeof(SBDUnitTests)); //TestManager.RunTest(typeof(ABDecreaseBuoyancyUT)); TestManager.RunTest(typeof(UnitTestMsc),"TestPHandNO3Sample"); //TestManager.RunTest(typeof(ReadFile)); bool keepGoing = true; if (keepGoing) { //DisableFLBB(); InitConsole(); cpfConsole.welcomeMessage(); cpfConsole.printPrompt(); while (true) { try { cpfConsole.readUntilLN(); } catch (Exception e) { EngrLogger.writeToColumns("EXCEPTION: "+e.ToString()); } Thread.Sleep(20); } } } //private static SDCard sdCard = new SDCard(); private static void Initialize() { // //Debug.Print("Program Started"); Thread.Sleep(1000); Utility.SetLocalTime(RealTimeClock.GetDateTime()); mbBoard = HWModules.MotherBoard.Instance; mbBoard.Enable12V(); mbBoard.Enable5V(); sdStorage = SDStorage.Instance; GHI.Processor.Watchdog.Disable(); //Let the Gt console output engr logs EngrLogger.init(new StringBuilder("UnitTest")); } private static StateBase[] states; private static void InitConsole() { mbBoard.EnableChannelPower(MotherBoard.ChannelNames.BluetoothChannel); cpfConsole = new CpfConsole(new SerialPort("COM4", 115200, Parity.None, 8, StopBits.One)); EngrLogger.SendConsoleLine += cpfConsole.SendLine; } } }