private async void buttonS1_Click(object sender, RoutedEventArgs e) { buttonS1.Background = ButtonOnBrush; General.S1On(); await Task.Delay(400); buttonS1.Background = ButtonOffBrush; }
private async void SetLed() { General.SetRL1(false); General.SetRL2(false); General.SetRL3(false); General.SetRL4(false); General.SetRL5(true); General.SetRL6(true); await Task.Delay(500); General.PowSupply(true);//RL1 Thread.Sleep(2000); General.S1On(); FlagSetLed = true; }
private void buttonS1On_Click(object sender, RoutedEventArgs e) { buttonS1On.Background = ButtonOnBrush; General.S1On(); buttonS1On.Background = ButtonOffBrush; }
public static async Task <bool> CheckDout() { const bool on = true; const bool off = false; bool FlagTimeout = false; var tmTimeout = new System.Timers.Timer(); tmTimeout.Elapsed += (sender, e) => { FlagTimeout = true; }; return(await Task <bool> .Run(() => { try { General.ResetIo(); Thread.Sleep(1500); Flags.AddDecision = false; ResetViewModel(); InitList();//テストスペック初期化 //テストログの更新 State.VmTestStatus.TestLog += "\r\nテストモード + 電源投入"; General.SetRL1(false); General.SetRL2(false); General.SetRL3(false); General.SetRL4(false); General.SetRL5(true); General.SetRL6(true); Thread.Sleep(500); General.PowSupply(true);//RL1 SetInput(on, off, off, off, on, on, off); //SetExp(off, off, off, off, off, on, off);//マイコン特採対応 2017.11.9 ※限定です SetExp(off, off, off, off, on, off, off); Thread.Sleep(2000); State.VmTestStatus.TestLog += "\r\nソフトVerチェック"; ErrTitle = "ソフトVerチェック"; if (!AnalysisInputData()) { return false; } State.VmTestStatus.TestLog += "---PASS"; ////マイコン特採対応 2017.11.9 ※限定です //State.VmTestStatus.TestLog += "\r\nLED2(緑)カラーチェック"; //ErrTitle = "LED2(緑)カラーチェック"; //if (!Test_Led.CheckColor(Test_Led.NAME.LED2)) return false; //State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nLED1(黄)カラーチェック"; ErrTitle = "LED1(黄)カラーチェック"; if (!Test_Led.CheckColor(Test_Led.NAME.LED1)) { return false; } State.VmTestStatus.TestLog += "---PASS"; //ここで製品のRY1、RY2がOFFしているはずなので、VCC2(RelayOff状態)を計測する State.VmTestStatus.TestLog += "\r\n電源電圧チェック Vcc2(RY1,RY2 ON)"; ErrTitle = "電源電圧チェック Vcc2(RY1,RY2 ON)"; if (!電圧チェック.CheckVolt(電圧チェック.CH.VCC2_RELAY_OFF)) { return false; } State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nS1 OnOffチェック"; ErrTitle = "S1 OnOffチェック"; SetInput(on, off, off, off, on, on, on); SetExp(off, off, off, off, off, off, off); General.S1On(); Thread.Sleep(2000); if (!AnalysisInputData()) { return false; } State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nフロートスイッチ下限チェック"; ErrTitle = "フロートスイッチ下限チェック"; SetInput(on, on, off, off, on, on, off); SetExp(off, off, off, off, on, off, off); General.SetRL2(true); Thread.Sleep(2000); if (!AnalysisInputData()) { return false; } State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nフロートスイッチ上限チェック 1"; ErrTitle = "フロートスイッチ上限チェック 1"; SetInput(on, on, on, off, on, on, off); SetExp(off, off, off, on, off, on, off); FlagTimeout = false; tmTimeout.Interval = 2000; tmTimeout.Start(); General.SetRL3(true); while (true) { if (FlagTimeout) { return false; } if (AnalysisInputData()) { break; } } State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nフロートスイッチ上限チェック 2"; ErrTitle = "フロートスイッチ上限チェック 2"; SetExp(off, on, off, on, off, on, off); FlagTimeout = false; tmTimeout.Interval = 4000; tmTimeout.Start(); while (true) { if (FlagTimeout) { return false; } if (AnalysisInputData()) { break; } } State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nLED2(緑)カラーチェック"; ErrTitle = "LED2(緑)カラーチェック"; if (!Test_Led.CheckColor(Test_Led.NAME.LED2)) { return false; } State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nフロートスイッチ漏れチェック①"; ErrTitle = "フロートスイッチ漏れチェック①"; SetInput(on, on, on, on, on, on, off); SetExp(off, off, off, off, off, off, on); General.SetRL4(true); Thread.Sleep(2000); if (!AnalysisInputData()) { return false; } State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nLED3(赤)カラーチェック"; ErrTitle = "LED3(赤)カラーチェック"; if (!Test_Led.CheckColor(Test_Led.NAME.LED3)) { return false; } State.VmTestStatus.TestLog += "---PASS"; State.VmTestStatus.TestLog += "\r\nフロートスイッチ漏れチェック②"; ErrTitle = "フロートスイッチ漏れチェック②"; SetInput(on, on, on, on, off, on, off); SetExp(off, off, on, off, off, off, off); General.SetRL5(false); Thread.Sleep(2000); if (!AnalysisInputData()) { return false; } State.VmTestStatus.TestLog += "---PASS"; Thread.Sleep(2000); return true; } catch { return false; } })); }