Exemple #1
0
        public void ExecuteInteractiveDiagnosticsButNoTestsEnabled()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4);

            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);
            InteractiveDiagnosticEvent     diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.DoesNotContain("Controller.Key", diag.Details);
        }
Exemple #2
0
        // This test is for testing the instrument's battery charging, so dock expects instrument to be present
        public void ExecuteInteractiveDiagnosticsForBatteryChargingWhenInstrumentNotDocked()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4);

            action.DiagnoseBatteryCharging = true;
            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.Contains("Instrument present:                  FAILED", diag.Details);
        }
Exemple #3
0
        public void ExecuteInteractiveDiagnosticsForBatteryChargingForNonRechargableBatteries()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.TX1);

            action.DiagnoseBatteryCharging = true;
            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.DoesNotContain("Controller.Key", diag.Details);
        }
Exemple #4
0
        public void ExecuteInteractiveDiagnosticsForTestInstrumentCommunicationWithoutInstrument()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4);

            action.DiagnoseInstrumentCommunication = true;
            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.Contains("Instrument present:                  FAILED", diag.Details);
        }
Exemple #5
0
        // For docking stations with no lid switches, there's no need to perform the test.
        public void ExecuteInteractiveDiagnosticsForTestiGas()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX6);

            action.DiagnoseIGas = true;
            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.Contains("Pressure switch #3 pressure:         PASSED", diag.Details);
        }
Exemple #6
0
        // For docking stations with no lid switches, there's no need to perform the test.
        public void ExecuteInteractiveDiagnosticsForTestLidSwitches()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX6);

            action.DiagnoseLidSwitches = true;
            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.Contains("Pump adapter present:", diag.Details);
        }
Exemple #7
0
        // For docking stations with no lid switches, there's no need to perform the test.
        public void SkipInteractiveDiagnosticsForTestLidSwitchesForDiffusionOnlyDocks()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.GBPRO);

            action.DiagnoseLidSwitches = true;
            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.DoesNotContain("Pump adapter present:", diag.Details);
        }
Exemple #8
0
        public void ExecuteInteractiveDiagnosticsForTestBuzzer()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX6);

            action.DiagnoseBuzzer = true;
            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.Contains("Buzzer works correctly:              PASSED", diag.Details);
        }
Exemple #9
0
        public void ExecuteInteractiveDiagnosticsForTestCradleGasFlowForSC()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.SC);

            action.DiagnoseCradleGasFlow = true;
            InitializeForTest(action);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.Contains("Cradle flow through hose:            PASSED", diag.Details);
            Assert.DoesNotContain("Cradle routes flow to lid:", diag.Details);
        }
Exemple #10
0
        // For new Ventis Cradle docking station, there's no need to perform the test.
        public void SkipInteractiveDiagnosticsForTestLidSwitchesForNewVentisCradle()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4);

            action.DiagnoseLidSwitches = true;
            InitializeForTest(action);

            Configuration.DockingStation.HasNewVentisCradle = true;

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.DoesNotContain("Pump adapter present:", diag.Details);
        }
Exemple #11
0
        // This test is for testing the instrument's battery charging, so dock expects instrument to be present
        // This calls discoverdocked instrument and thereby throws exception, however is exception is NOT thrown
        public void ExecuteInteractiveDiagnosticsForBatteryChargingWhenInstrumentIsDockedAndFetchInstrumentBatteryDetails() // TODO
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4);

            action.DiagnoseBatteryCharging = true;
            InitializeForTest(action);

            controllerWrapper.Setup(x => x.IsDocked()).Returns(true);

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.Contains("Battery installed:                   PASSED", diag.Details);
        }
Exemple #12
0
        public void SkipInteractiveDiagnosticsForTestCradleGasFlowForVentisLS()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4);

            action.DiagnoseCradleGasFlow = true;
            InitializeForTest(action);

            Configuration.DockingStation.PartNumber = Configuration.VENTISLS_PARTNUMBER;

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.DoesNotContain("Cradle routes flow to lid:", diag.Details);
            Assert.DoesNotContain("Cradle routes flow to hose:", diag.Details);
        }
Exemple #13
0
        // For docking stations with no lid switches, there's no need to perform the test.
        public void ExecuteInteractiveDiagnosticsForTestLidSwitchesOnlyForDiffusionLidForVentisLS()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4);

            action.DiagnoseLidSwitches = true;
            InitializeForTest(action);

            Configuration.DockingStation.PartNumber = Configuration.VENTISLS_PARTNUMBER;

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.DoesNotContain("Pump adapter present:", diag.Details);
            Assert.Contains("Diffusion lid raised:                PASSED", diag.Details);
        }
Exemple #14
0
        public void ExecuteInteractiveDiagnosticsForTestFlowRateForDSX()
        {
            // arrange
            InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4);

            action.DiagnoseFlowRate = true;
            InitializeForTest(action);

            controllerWrapper.SetupSequence(x => x.GetKeyPress())
            .Returns(new KeyPress(Key.Left, new TimeSpan(0, 0, 5)))
            .Returns(new KeyPress(Key.Right, new TimeSpan(0, 0, 5)))
            .Returns(new KeyPress(Key.Middle, new TimeSpan(0, 0, 5)));

            InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action);

            InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute();

            Assert.Contains("Flow Offset:                         PASSED", diag.Details);
        }
Exemple #15
0
		/// <summary>
		/// Executes a docking station interactive diagnostic operation.
		/// </summary>
		/// <returns>Docking station event</returns>
		public DockingStationEvent Execute()
		{
            // Initialize resource manager's culture to be same as current configuration culture.
            DiagnosticResources.Culture = Configuration.DockingStation.Language.Culture;

			// Make the return event.
            InteractiveDiagnosticEvent dsEvent = new InteractiveDiagnosticEvent( this );

			// Retrieve the docking station's complete information.
            dsEvent.DockingStation = Master.Instance.ControllerWrapper.GetDockingStation();

            // Print to log the selections made by the user
            Log.Debug( Name + ": DiagnoseKeypad = " + DiagnoseKeypad.ToString() ); // SGF  03-Jun-2011  INS-1730
            Log.Debug( Name + ": DiagnoseLcd = " + DiagnoseLcd.ToString() ); // SGF  03-Jun-2011  INS-1730
            Log.Debug( Name + ": DiagnoseLeds = " + DiagnoseLeds.ToString() );
            Log.Debug( Name + ": DiagnoseBuzzer = " + DiagnoseBuzzer.ToString() );
            Log.Debug( Name + ": DiagnoseLidSwitches = " + DiagnoseLidSwitches.ToString() );
            Log.Debug( Name + ": DiagnoseIGas = " + DiagnoseIGas.ToString() );
            Log.Debug( Name + ": DiagnoseCradleGasFlow = " + DiagnoseCradleGasFlow.ToString() ); // SGF  03-Jun-2011  INS-1730
            Log.Debug( Name + ": DiagnoseFlowRate = " + DiagnoseFlowRate.ToString() ); // SGF  03-Jun-2011  INS-1730
            Log.Debug( Name + ": DiagnoseInstrumentDetection = " + DiagnoseInstrumentDetection.ToString() );
            Log.Debug( Name + ": DiagnoseInstrumentCommunication = " + DiagnoseInstrumentCommunication.ToString() );
            Log.Debug( Name + ": DiagnoseBatteryCharging = " + DiagnoseBatteryCharging.ToString() );

            _details.AddDockingStation( dsEvent.DockingStation );

            // SGF  23-May-2011  INS-1741
            ReportDiagnosticDate();

			Pump.DoCheckFlow = false;

            for ( int valve = 1; valve <= Configuration.DockingStation.NumGasPorts; valve++ )
            {
                Master.Instance.PumpWrapper.OpenValve( valve, false );
                Thread.Sleep( 500 );
                Master.Instance.PumpWrapper.CloseValve( valve, false );
            }
            Master.Instance.PumpWrapper.Stop();
            Master.Instance.ControllerWrapper.TurnLEDsOff();
            Master.Instance.LCDWrapper.Backlight(true);
            Master.Instance.LCDWrapper.Display( "<a>               <a>" );

            if (Master.Instance.ControllerWrapper.IsDocked() )
            {
                Log.Debug( "ERROR: Remove the instrument from the cradle." );
                // Pause for the tech to remove the instrument.
                Thread.Sleep( 5000 );
            }

			Log.Debug( "Beginning interactive diagnostics." );

            // SGF  NEW CODE FOR INTERACTIVE DIAGNOSTIC CONTROL
            bool continueTesting = true;

            // SGF  03-Jun-2011  INS-1730 -- split keypad testing from LCD testing
            // Keypad
            if ( continueTesting && DiagnoseKeypad )
            {
                Log.Debug( "Interactive Diagnostics:  Testing Keypad" );
                continueTesting = TestKeypad();
            }

            // SGF  03-Jun-2011  INS-1730 -- split keypad testing from LCD testing
            // LCD
            if ( continueTesting && DiagnoseLcd )
            {
                Log.Debug( "Interactive Diagnostics:  Testing LCD" );
                continueTesting = TestLCD();
            }

            // LEDs
            if ( continueTesting && DiagnoseLeds )
            {
                Log.Debug( "Interactive Diagnostics:  Testing LEDs" );
                TestLEDs();
            }

            // Buzzer
            if ( continueTesting && DiagnoseBuzzer )
            {
                Log.Debug( "Interactive Diagnostics:  Testing Buzzer" );
                TestBuzzer();
            }

            // Lid Switches
            if ( continueTesting && DiagnoseLidSwitches )
            {
                Log.Debug( "Interactive Diagnostics:  Testing Lid Switches" );
                TestLidSwitches();
            }

            // iGas Connections
            if ( continueTesting && DiagnoseIGas )
            {
                Log.Debug( "Interactive Diagnostics:  Testing iGas Connections" );
                TestiGas();
            }

            // SGF  03-Jun-2011  INS-1730 -- split cradle solenoid testing from flow rate testing
            // Cradle Solenoid
            if ( continueTesting && DiagnoseCradleGasFlow )
            {
                Log.Debug( "Interactive Diagnostics:  Testing Cradle Gas Flow" );
                TestCradleGasFlow();
            }

            // SGF  03-Jun-2011  INS-1730 -- split cradle solenoid testing from flow rate testing
            // Flow Rate
            if ( continueTesting && DiagnoseFlowRate )
            {
                Log.Debug( "Interactive Diagnostics:  Testing Flow Rate" );
                TestFlowRate();
            }

            // Instrument Detection
            if ( continueTesting && DiagnoseInstrumentDetection )
            {
                Log.Debug( "Interactive Diagnostics:  Testing Instrument Detection" );
                TestInstrumentDetect();
            }
        
            // Instrument Communication
            if ( continueTesting && DiagnoseInstrumentCommunication )
            {
                Log.Debug( "Interactive Diagnostics:  Testing Instrument Communication" );
                continueTesting = TestInstrumentCommunication();               
            }

            // Battery Charging.
            if ( continueTesting && DiagnoseBatteryCharging )
            {
                Log.Debug( "Interactive Diagnostics:  Testing Battery Charging" );
                TestBatteryCharging();
            }

            Master.Instance.LCDWrapper.Display( GetMessage( DiagnosticResources.DONE ) );

			Pump.DoCheckFlow = true;
			Master.Instance.PumpWrapper.Stop();
            for ( int valve = 1; valve <= Configuration.DockingStation.NumGasPorts; valve++ )
            {
                Master.Instance.PumpWrapper.OpenValve( valve, false );
                Thread.Sleep( 500 );
                Master.Instance.PumpWrapper.CloseValve( valve, false );
            }
            Log.Debug( "Finished interactive diagnostics." );

			// Retrieve the details.
			dsEvent.Details = _details.ToString();

			// Write the details to a log file.
            FlashCard.WriteTextFile( LAST_RUN_DETAILS_FILE_NAME, dsEvent.Details );

            return dsEvent; // Return the event.
		}