Beispiel #1
0
        public void Run()
        {
            #region Wire up all Classes
            positionComputer.Initialize(razorVenus, imuLed, gpsLed);
            xbee.Initialize(positionComputer, firingSolution, deadLed, razorVenus);
            firingSolution.Initialize(positionComputer, xbee, trigger, killLed, statusLed, razorVenus, gpsLed);
            #endregion

            #region System Ready Blinks
            statusLed.On();
            Thread.Sleep(300);
            imuLed.On();
            Thread.Sleep(300);
            gpsLed.On();
            Thread.Sleep(300);
            deadLed.On();
            Thread.Sleep(300);
            killLed.On();
            Thread.Sleep(3000); // LTN March 20, 2012: This is a long LED startup sequence, giving the imu time to fully initialize before the imu data is being used to affect imuLed.  Otherwise you get the imuLed blinkyblinking as if it's north because while initializing it outputs a yaw angle of 0mrads.
            statusLed.Off();
            imuLed.Off();
            gpsLed.Off();
            deadLed.Off();
            killLed.Off();
            #endregion

            string lineToPrint = "\n\rSystem Wired and Ready for Action\n\r\n\r";
            razorVenus.TerminalPrintOut(lineToPrint);

            //DLC subscription to test DLC output via serial debug
            xbee.ReceivedImDeadDLC += new Radio.DLCReceivedDelegate(xbee_ReceivedDLCMe);

            // Call Testing here, after all wiring has been completed.
            Testing();


            for (; ;)
            {
                positionComputer.Compute();
                Thread.Sleep(100); // Main loop clock cycle Timer

                // StatusLed Flashes to confirm Loop is still running.
                if (statusLed.CurrentState == Led.State.Off)
                {
                    statusLed.On();
                }
                else
                {
                    statusLed.Off();
                }
            }
        }
 void trigger_sevenTimesKeyed(bool state)
 {
     magCal();
     forDebugPrint.TerminalPrintOut("\r\n!!!!!!!!!\r\n!!!!!!!!!!!!!!!!\r\n!!!!!!!!!!!!!\r\n!!!!!!!!just did a magCal!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n!!!!!!!!\r\n!!!!!!!!!!\r\n");
     //Debug.Print("magCal()!!");
 }