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
        public static async Task <MechanicalTestManager> Create(IUnityContainer container, EvcCommunicationClient commClient)
        {
            await commClient.Connect();

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

            await commClient.Disconnect();

            var instrument = new Instrument(InstrumentType.MiniAT, itemValues);
            var driveType  = new MechanicalDrive(instrument);

            CreateVerificationTests(instrument, driveType);

            var volumeTest    = instrument.VolumeTest;
            var volumeManager = new MechanicalVolumeVerification(container.Resolve <IEventAggregator>(), volumeTest,
                                                                 commClient);

            var manager = new MechanicalTestManager(container, instrument, commClient, volumeManager, null);

            container.RegisterInstance <TestManager>(manager);

            return(manager);
        }