private void StartCounterCoolant() { if (!FLAG_COUNTER_COOLANT) { ModbusInput DeviceInput = GlobalProperties.DevicesInput[0]; CounterValveCoolant.Reset(); CounterValveCoolant.Start(); FLAG_COUNTER_COOLANT = true; Task task = new Task(() => { while (FLAG_COUNTER_COOLANT) { DeviceInput.GetData("CHA12", out int FeedbackOn); DeviceInput.GetData("CHA13", out int FeedbackOff); if (FeedbackOn == 1 && FeedbackOff == 0) { CounterValveCoolant.Stop(); FLAG_COUNTER_COOLANT = false; } else { if (CounterValveCoolant.ElapsedMilliseconds > CounterCoolantTimeout) { Emergency("Valve Coolant Error\nCant Open Valve Coolant", "Unknown Feedback Result", true); FLAG_COUNTER_COOLANT = false; } } Thread.Sleep(1000); } }); task.Start(); } }
public Changedrum() { InitializeComponent(); Region = System.Drawing.Region.FromHrgn(Actions.CreateRoundRectRgn(0, 0, Width, Height, 25, 25)); Actions.RecenterLocation(this); Transition t1 = new Transition(new TransitionType_Bounce(500)); t1.add(this, "Top", this.Location.Y + 15); Transition.runChain(t1); DeviceInput = PublicProperties.DevicesInput[0]; DeviceOutput = PublicProperties.DevicesOutput[0]; AddToDict(); Step(0); pbNext.Visible = true; }
public Changedrum() { InitializeComponent(); Region = System.Drawing.Region.FromHrgn(Actions.CreateRoundRectRgn(0, 0, Width, Height, 25, 25)); Actions.SetDoubleBuffered(this); Actions.RecenterLocation(this); Transition t1 = new Transition(new TransitionType_Bounce(500)); t1.add(this, "Top", this.Location.Y + 15); Transition.runChain(t1); DeviceInput = GlobalProperties.ModbusInput; DeviceOutput = GlobalProperties.ModbusOutput; AddToDict(); Step(0); pbNext.Visible = true; // Set Changedrum Flag GlobalProperties.FLAG_CHANGEDRUM = true; }