Esempio n. 1
0
        public async static Task <bool> DoWash()
        {
            log.Info("Wash");
            VsmdController vsmdController        = VsmdController.GetVsmdController();
            PumpController pumpController        = PumpController.GetPumpController();
            BoardSetting   curBoardSetting       = BoardSetting.GetInstance();
            int            washDelayMilliSeconds = (int)(1000 * curBoardSetting.CurrentBoard.WashDelaySeconds);

            int delayMicroSecondsBetweenSamples = (int)(Preference.GetInstace().DelaySeconds * 1000);
            await vsmdController.MoveTo(VsmdAxis.Z, curBoardSetting.CurrentBoard.ZTravel);

            await vsmdController.MoveTo(VsmdAxis.X, curBoardSetting.CurrentBoard.WashX);

            await vsmdController.MoveTo(VsmdAxis.Y, curBoardSetting.CurrentBoard.WashY);

            await vsmdController.MoveTo(VsmdAxis.Z, curBoardSetting.CurrentBoard.WashZ);

            Random rnd  = new Random();
            var    port = rnd.Next(1, 4);

            for (int i = 0; i < curBoardSetting.CurrentBoard.WashTimes; i++)
            {
                await pumpController.SwitchOnOff(port);

                Thread.Sleep(washDelayMilliSeconds);
            }
            await vsmdController.MoveTo(VsmdAxis.Z, curBoardSetting.CurrentBoard.ZTravel);

            log.Info("finished wash");
            return(true);
        }
		public ReadoutViewModel(
			PumpController pumpController,
			ElementController elementController,
			Hardware hardware,
			HardwareInitializer hardwareInitializer 
			)
		{
			_hardwareInitializer = hardwareInitializer;
			PumpController = pumpController;
			ElementController = elementController;
			Hardware = hardware;

			// When the PumpController changes state, so should our text, so notify of that change.
			Hardware.PumpOutputConnection.PropertyChanged += (s, e) => NotifyOfPropertyChange(() => PumpStateText);
			Hardware.ElementOutputConnection.PropertyChanged += (s, e) => NotifyOfPropertyChange(() => ElementStateText);
			Hardware.RoofTemperatureReader.PropertyChanged += (s, e) => NotifyOfPropertyChange(() => RoofDegC);
			Hardware.InletTemperatureReader.PropertyChanged += (s, e) => NotifyOfPropertyChange(() => InletDegC);
			Hardware.TankTemperatureReader.PropertyChanged += (s, e) => NotifyOfPropertyChange(() => TankDegC);
		}
Esempio n. 3
0
        public ReadoutViewModel(
            PumpController pumpController,
            ElementController elementController,
            Hardware hardware,
            HardwareInitializer hardwareInitializer
            )
        {
            _hardwareInitializer = hardwareInitializer;
            PumpController       = pumpController;
            ElementController    = elementController;
            Hardware             = hardware;

            // When the PumpController changes state, so should our text, so notify of that change.
            Hardware.PumpOutputConnection.PropertyChanged    += (s, e) => NotifyOfPropertyChange(() => PumpStateText);
            Hardware.ElementOutputConnection.PropertyChanged += (s, e) => NotifyOfPropertyChange(() => ElementStateText);
            Hardware.RoofTemperatureReader.PropertyChanged   += (s, e) => NotifyOfPropertyChange(() => RoofDegC);
            Hardware.InletTemperatureReader.PropertyChanged  += (s, e) => NotifyOfPropertyChange(() => InletDegC);
            Hardware.TankTemperatureReader.PropertyChanged   += (s, e) => NotifyOfPropertyChange(() => TankDegC);
        }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.E))
     {
         if (interactedObject)
         {
             LockOnObject.Invoke(interactedObject);
             GroundController groundController = interactedObject.GetComponent <GroundController>();
             if (groundController)
             {
                 groundController.Interact();
             }
             PumpController pumpController = interactedObject.GetComponent <PumpController>();
             if (pumpController)
             {
                 pumpController.Interact();
             }
         }
     }
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         gameMenu.SetActive(!gameMenu.activeSelf);
     }
 }
Esempio n. 5
0
 public void Activate(PumpController pump)
 {
     pumpController = pump.GetComponent <PumpController>();
     ShowInteractionButtons.Invoke();
     SharePumpController.Invoke(pump);
 }
Esempio n. 6
0
 public void GetPumpController(PumpController pumpController)
 {
     pump = pumpController;
 }