/// <summary> /// Received when the grind station has completed /// </summary> /// <param name="sender"></param> /// <param name="proceed"></param> /// <param name="message"></param> private void GrindStation_OnGrindUpdateEventReceived(ViewModel_GrindStation sender, bool proceed, string message) { if (proceed) { // Update vial to be ground _InputRack.SetCurrentVialFullFine((_SimulationParameters.TargetOutputVialWeight_mg) * _SimulationParameters.OutputDivisionFactor); DoProceed(); } RaiseEventOnTopLevel(OnSimulationUpdateEvent, new object[] { this, message }); }
public ViewModel_SimulationRunner() { // Fill in some defaults SimulationParameters = new ViewModel_SimulationParameters(96, 288, 3, 1, 10, 0); _SimulationTimer.Elapsed += _Simulationtimer_Elapsed; Arm = new ViewModel_Arm(); GrindStation = new ViewModel_GrindStation(); DispenseStation = new ViewModel_DispenseStation(); // Tie in events when parts of the system have completed their job _Arm.OnArmUpdateEvent += new ViewModel_Arm.OnArmUpdateEventHandler(Arm_OnArmUpdateEventReceived); _Arm.OnGripUpdateEvent += new ViewModel_Arm.OnGripUpdateEventHandler(Arm_OnGripUpdateEventReceived); _GrindStation.OnGrindUpdateEvent += new ViewModel_GrindStation.OnGrindUpdateEventHandler(GrindStation_OnGrindUpdateEventReceived); _DispenseStation.OnDispenseUpdateEvent += new ViewModel_DispenseStation.OnDispenseUpdateEventHandler(DispenseStation_OnDispenseUpdateEventReceived); }