public static void ShowcaseAlarm(int probeNumber, String highAlarmSetpoint, bool enableHighAlarm, String lowAlarmSetpoint, bool enableLowAlarm) { Stopwatch watch = new Stopwatch(); watch.Start(); PacificDisplayHandling.ClickProbe(probeNumber); PacificDisplayHandling.ProbeHandler.ClickMenuItem(3); //Clicks "Config" PacificDisplayHandling.ConfigurationHandler.SetTab(2); //Clicks "Alarms/Warnings" PacificDisplayHandling.ConfigurationHandler.ClickMenuItem(1); //Clicks "Setpoint" for the Alarms/Warnings Menu Console.WriteLine("Setting Alarm High"); SetAlarmEnabled(probeNumber, enableHighAlarm, 1); //<-- Complete Action, will switch tabs SetAlarmSetpoint(probeNumber, highAlarmSetpoint, "High"); //<-- Complete Action, will switch tabs Console.WriteLine("Setting Alarm High"); SetAlarmEnabled(probeNumber, enableLowAlarm, 2); //<-- Complete Action, will switch tabs SetAlarmSetpoint(probeNumber, lowAlarmSetpoint, "Low"); //<-- Complete Action, will switch tabs Thread.Sleep(500); PacificDisplayHandling.ClickTaskbarItem(4); Thread.Sleep(300); watch.Stop(); Console.WriteLine("Took {0} seconds to set the high & low alarms.", ((double)watch.ElapsedMilliseconds) / 1000); }
public static void ShowcaseSetIP(String ip) { Stopwatch watch = new Stopwatch(); watch.Start(); PacificDisplayHandling.ClickTaskbarItem(4); PacificDisplayHandling.ClickMenuItem(4); PacificDisplayHandling.ClickMenuItem(2); PacificDisplayHandling.ClickMenuItem(1); PacificDisplayHandling.ClickMenuItem(1); PacificDisplayHandling.KeypadHandler.SelectKeypadInput((4 - ip.Split('.').Length) + 1); PacificDisplayHandling.KeypadHandler.ClickKeypad("Clear"); PacificDisplayHandling.KeypadHandler.ClickKeypad(ip); PacificDisplayHandling.ClickTaskbarItem(3); PacificDisplayHandling.ClickTaskbarItem(4); watch.Stop(); Console.WriteLine("Took {0} seconds to set the ip.", ((double)watch.ElapsedMilliseconds) / 1000); }
static void Main() { /* * for (int i = 0; i < 200; i++) { * ShowcaseSetIP("192.168.80.216"); * } */ /* * bool testVal = true; * for (int i = 0; i < 999; i++) { * //ShowcaseSetIP("192.168.80.241"); * ShowcaseAlarm(1, "26." + i, testVal, "24." + i, !testVal); * testVal = !testVal; * Console.WriteLine("Finished Iteration #{0}", (i + 1)); * } */ //RunApplication(); //TestReport(); PacificDisplayHandling.ClickTaskbarItem(1); }
public static void SetAlarmSetpoint(int probeNumber, String setpoint, String alarmType) { CompleteAction("SetAlarmSetpoint " + alarmType + ": " + setpoint, () => { //High alarm Setpoint PacificDisplayHandling.AlarmHandler.ClickMenuItem(2); Thread.Sleep(300); PacificDisplayHandling.KeypadHandler.ClickKeypad(PacificDisplayHandling.KeypadHandler.KeypadKeys.Clr); PacificDisplayHandling.KeypadHandler.ClickKeypad(setpoint); Thread.Sleep(300); PacificDisplayHandling.ClickTaskbarItem(3); Thread.Sleep(600); }, () => { //Is the value set correctly? String vigoSetPoint = VigoHandling.GetValueAsString("Commander6:Master_Box_1.Pacific.Pacific_127.Probe_0" + probeNumber + ".Temperature.Measurement.Temperature.Setpoints." + alarmType + " alarm.Setpoint"); //Console.WriteLine("High alarm Setpoint: ", highAlarm.Replace(",", ".").Equals(vigoSetPoint.Replace(",", "."))); return(parseDoubleCustom(setpoint).Equals(parseDoubleCustom(vigoSetPoint))); }, () => { //Fail-safe int index = alarmType.Equals("High") ? 1 : 2; PacificDisplayHandling.AlarmHandler.SetTab(index); Thread.Sleep(200); }, 1, 2000); }