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); }
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."); } } }
public RotaryMeterTestViewModel(RotaryDrive rotaryDrive) { RotaryDriveType = rotaryDrive; }