예제 #1
0
        public override void Simulate(int clock)
        {
            base.Simulate(clock);

            HeatOk = HeatAverage() > (MaxTemp * 0.8);


            queue.Delay = SimDelayMs;

            TempSensors(Brenner.Running);

            switch (State)
            {
            case OperationState.Stopped:
                Brenner.SwitchOff();
                Motor.SwitchOff();
                ValveWasteHeate.SwitchOff();
                break;

            case OperationState.Started:
                Brenner.SwitchOn();
                Motor.SwitchOn();

                if (HeatOk)
                {
                    ValveWasteHeate.SwitchOn();
                }

                if (Receiver == null)
                {
                    return;
                }

                if (Receiver.ReceiverReady)
                {
                    queue.Tick(clock);
                    double mat = RetrieveFromQueue();

                    if (mat > 0)
                    {
                        Receiver.PushMaterial(mat);
                    }
                }
                break;

            case OperationState.CriticalStop:
                Brenner.SwitchOff();
                Motor.SwitchOff();
                ValveWasteHeate.SwitchOff();
                break;

            default:
                Brenner.SwitchOff();
                Motor.SwitchOff();
                ValveWasteHeate.SwitchOff();
                break;
            }
        }
예제 #2
0
        public override void Simulate(int clock)
        {
            base.Simulate(clock);


            queue.Delay = 5000;

            switch (State)
            {
            case OperationState.Stopped:
                motors.ForEach(m => m.SwitchOff());
                break;

            case OperationState.Started:


                if (Receiver == null)
                {
                    motors.ForEach(m => m.SwitchOff());
                    return;
                }

                if (Receiver.ReceiverReady)
                {
                    queue.Tick(clock);
                    motors.ForEach(m => m.SwitchOn());
                    double mat = RetrieveFromQueue();

                    if (mat > 0)
                    {
                        Receiver.PushMaterial(mat);
                    }
                }
                break;

            case OperationState.CriticalStop:
                motors.ForEach(m => m.SwitchOff());
                break;

            default:
                motors.ForEach(m => m.SwitchOff());
                break;
            }
        }
예제 #3
0
        public override void Simulate(int clock)
        {
            base.Simulate(clock);

            queue.Delay = 2000;

            switch (State)
            {
            case OperationState.Stopped:
                Abfüllung.SwitchOff();
                break;

            case OperationState.Started:
                Abfüllung.SwitchOn();
                queue.Tick(clock);
                double mat = RetrieveFromQueue();

                _sum += mat;

                if (_sum > 25)
                {
                    while (_sum > 25)
                    {
                        NumberOfBags += 1;
                        _sum         -= 25;
                    }
                }

                break;

            case OperationState.CriticalStop:
                Abfüllung.SwitchOff();
                break;

            default:
                Abfüllung.SwitchOff();
                break;
            }
        }