/// <summary> /// Runs the test. /// </summary> // Revision History // MM/DD/YY Who Version ID Number Description // -------- --- ------- -- ------ ------------------------------------------- // 09/17/09 RCG 2.30.00 Created // 08/15/12 MAH 2.60.54 WR 201902 Added more time between switch operations to allow the meter to recharge its capacitor // 09/19/14 jrf 4.00.63 WR 534158 Using new method to set test result string and also checking user permissions. // 10/02/14 jrf 4.00.66 WR 431248 Making sure if logon is called and exception occurs then a logoff is // attempted so other tests may continue if possible. // 04/27/15 jrf 4.20.03 WR 574470 Increased wait between disconnect/connect to allow capacitor more time to charge // for hw 2.0 meter. public override Test RunTest() { PSEMResponse Response = PSEMResponse.Ok; CXMLOpenWayUserAccessPolicy UserAccess = new CXMLOpenWayUserAccessPolicy(); bool bIsUserAllowed = UserAccess.CheckUserAccess(CXMLOpenWayUserAccessPolicy.FunctionalCapability.MeterSwitchOperations); m_TestResults = new Test(); m_TestResults.Name = TestName; m_bTestPassed = true; try { Response = LogonToDevice(); if (false == bIsUserAllowed) { m_bTestSkipped = true; m_TestResults.Reason = TestResources.ReasonSwitchOperationPermissions; } else if (Response == PSEMResponse.Ok) { // First make sure the meter supports connect disconnect. if (m_AmiDevice.IsServiceLimitingTablePresent && m_AmiDevice.DisconnectHardwareExists && m_AmiDevice.IsDisconnectHardwareFunctioning) { DisconnectMeter(); if (IsAborted == false) { m_AmiDevice.SendWait(); // Thread.Sleep(2000); // MAH - 8/15/12 - Increased the time between switch operations to allow the capacitor to recharge //Thread.Sleep(12500); // jrf - 4/27/15 - Increased the time between switch operations slightly more to allow the capacitor // to recharge for HW 2.0 meter. Thread.Sleep(15000); } CheckStatus(false); ConnectMeter(); if (IsAborted == false) { m_AmiDevice.SendWait(); Thread.Sleep(2000); } CheckStatus(true); } else { // Disconnect is not supported m_bTestSkipped = true; m_TestResults.Reason = TestResources.ReasonDisconnectNotSupported; } } else { m_TestResults.Reason = TestResources.ReasonLogonFailed; m_bTestPassed = false; } } catch (Exception e) { throw (e); } finally { if (m_AmiDevice != null) { m_AmiDevice.Logoff(); } } // Set the final result. m_TestResults.Result = GetTestResultString(m_bTestSkipped, m_bTestPassed); return(m_TestResults); }
/// <summary> /// Runs the test. /// </summary> // Revision History // MM/DD/YY Who Version ID Number Description // -------- --- ------- -- ------ ------------------------------------------- // 09/17/09 RCG 2.30.00 Created // 09/19/14 jrf 4.00.63 WR 534158 Using new method to set test result string. // 10/02/14 jrf 4.00.66 WR 431248 Making sure if logon is called and exception occurs then a logoff is // attempted so other tests may continue if possible. // 10/13/14 jrf 4.00.72 WR 537980 Skipping test on sealed canadian meter. public override Test RunTest() { CXMLOpenWayUserAccessPolicy UserAccess = new CXMLOpenWayUserAccessPolicy(); bool bIsUserAllowed = UserAccess.CheckUserAccess(CXMLOpenWayUserAccessPolicy.FunctionalCapability.ResetBillingRegisters); PSEMResponse Response = PSEMResponse.Ok; m_TestResults = new Test(); m_TestResults.Name = TestName; m_bTestPassed = true; try { Response = LogonToDevice(); if (true == m_AmiDevice.IsSealedCanadian) { m_bTestSkipped = true; m_TestResults.Reason = TestResources.ReasonBillingResetSealedCanadian; } else if (false == bIsUserAllowed) { m_bTestSkipped = true; m_TestResults.Reason = TestResources.ReasonBillingResetPermissions; } else if (Response == PSEMResponse.Ok) { // Reset the billing registers DisplayRegisterValues(TestResources.PrefixInitial); ClearBilling(); // This can take a little while so we should wait and make sure it's cleared before // we display the values again. if (IsAborted == false) { m_AmiDevice.SendWait(); Thread.Sleep(5000); } DisplayRegisterValues(TestResources.PrefixFinal); } else { m_TestResults.Reason = TestResources.ReasonLogonFailed; m_bTestPassed = false; } } catch (Exception e) { throw (e); } finally { if (m_AmiDevice != null) { m_AmiDevice.Logoff(); } } // Set the final result. m_TestResults.Result = GetTestResultString(m_bTestSkipped, m_bTestPassed); return(m_TestResults); }
/// <summary> /// Runs the test. /// </summary> // Revision History // MM/DD/YY Who Version ID Number Description // -------- --- ------- -- ------ ------------------------------------------- // 09/17/09 RCG 2.30.00 Created // 09/19/14 jrf 4.00.63 WR 534158 Using new method to set test result string. // 10/02/14 jrf 4.00.66 WR 431248 Making sure if logon is called and exception occurs then a logoff is // attempted so other tests may continue if possible. // 10/13/14 jrf 4.00.72 WR 537980 Skipping test on sealed canadian meter. public override Test RunTest() { CXMLOpenWayUserAccessPolicy UserAccess = new CXMLOpenWayUserAccessPolicy(); bool bIsUserAllowed = UserAccess.CheckUserAccess(CXMLOpenWayUserAccessPolicy.FunctionalCapability.ResetActivityStatus); PSEMResponse Response = PSEMResponse.Ok; m_TestResults = new Test(); m_TestResults.Name = TestName; m_bTestPassed = true; try { Response = LogonToDevice(); if (true == m_AmiDevice.IsSealedCanadian) { m_bTestSkipped = true; m_TestResults.Reason = TestResources.ReasonActivityStatusSealedCanadian; } else if (false == bIsUserAllowed) { m_bTestSkipped = true; m_TestResults.Reason = TestResources.ReasonActivityStatusPermissions; } else if (Response == PSEMResponse.Ok) { ClearDemandResetCount(); ClearOutageCount(); ClearProgrammedCount(); ClearInversionTampers(); ClearRemovalTampers(); ClearSiteScanDiagCounts(); ClearEventLogs(); Thread.Sleep(1000); ShowCounters(); } else { m_TestResults.Reason = TestResources.ReasonLogonFailed; m_bTestPassed = false; } } catch (Exception e) { throw (e); } finally { if (m_AmiDevice != null) { m_AmiDevice.Logoff(); } } // Set the final result. m_TestResults.Result = GetTestResultString(m_bTestSkipped, m_bTestPassed); return(m_TestResults); }