Esempio n. 1
0
        public static async Task <RotaryTestManager> CreateRotaryTest(IUnityContainer container, EvcCommunicationClient instrumentCommClient, string tachometerPortName, IVerifier verifier)
        {
            TachometerCommunicator tachComm = null;

            if (!string.IsNullOrEmpty(tachometerPortName))
            {
                tachComm = new TachometerCommunicator(tachometerPortName);
            }

            await instrumentCommClient.Connect();

            var itemValues = await instrumentCommClient.GetItemValues(instrumentCommClient.ItemDetails.GetAllItemNumbers());

            await instrumentCommClient.Disconnect();

            var instrument = new Instrument(InstrumentType.MiniMax, itemValues);
            var driveType  = new RotaryDrive(instrument);

            CreateVerificationTests(instrument, driveType);

            var volumeTest       = instrument.VolumeTest;
            var rotaryVolumeTest = new RotaryVolumeVerification(container.Resolve <IEventAggregator>(), volumeTest, instrumentCommClient, tachComm);

            var manager = new RotaryTestManager(container, instrument, instrumentCommClient, rotaryVolumeTest, verifier);

            container.RegisterInstance <TestManager>(manager);

            return(manager);
        }
Esempio n. 2
0
        private void CreateDriveType()
        {
            if (DriveType == null && DriveTypeDiscriminator != null && VerificationTest != null)
            {
                switch (DriveTypeDiscriminator)
                {
                case "Rotary":
                    DriveType = new RotaryDrive(this.VerificationTest.Instrument);
                    break;

                case "Mechanical":
                    DriveType    = new MechanicalDrive(this.VerificationTest.Instrument);
                    AppliedInput = DriveType.MaxUnCorrected();
                    break;

                default:
                    throw new NotSupportedException($"Drive type {DriveTypeDiscriminator} is not supported.");
                }
            }
        }
Esempio n. 3
0
 public RotaryMeterTestViewModel(RotaryDrive rotaryDrive)
 {
     RotaryDriveType = rotaryDrive;
 }