/// <summary> /// Reconfigures SiteScan information /// </summary> /// <param name="serviceType">The new service type to use.</param> /// <param name="nominalVoltage">The new nominal voltage to use.</param> /// <returns>The result of the reconfigure</returns> // Revision History // MM/DD/YY who Version Issue# Description // -------- --- ------- ------ --------------------------------------- // 04/29/09 RCG 2.20.03 N/A Created public SiteScanReconfigResult ReconfigureSiteScan(ServiceTypes serviceType, float nominalVoltage) { CloseConfigErrors Errors = CloseConfigErrors.None; ProcedureResultCodes ProcResult = ProcedureResultCodes.COMPLETED; PSEMResponse Response = PSEMResponse.Ok; SiteScanReconfigResult ReconfigResult = SiteScanReconfigResult.SUCCESS; // First make sure we have read the SiteScan config so we have the correct data. Response = SiteScanConfig.Read(); if (Response == PSEMResponse.Ok) { // Open the config so that we can write to it. ProcResult = OpenConfig(); if (ProcResult == ProcedureResultCodes.COMPLETED) { // Set the new values. SiteScanConfig.ServiceType = serviceType; SiteScanConfig.NominalVoltage = nominalVoltage; // Write the new values Response = SiteScanConfig.Write(); if (Response == PSEMResponse.Ok) { ProcResult = CloseConfig(CloseConfigOptions.SiteScan, out Errors); } } } if (ProcResult == ProcedureResultCodes.NO_AUTHORIZATION) { ReconfigResult = SiteScanReconfigResult.SECURITY_ERROR; } else if (ProcResult != ProcedureResultCodes.COMPLETED) { ReconfigResult = SiteScanReconfigResult.ERROR; } if (Response == PSEMResponse.Isc) { ReconfigResult = SiteScanReconfigResult.SECURITY_ERROR; } else if (Response != PSEMResponse.Ok) { ReconfigResult = SiteScanReconfigResult.PROTOCOL_ERROR; } return(ReconfigResult); }
/// <summary> /// Reconfigures SiteScan information /// </summary> /// <param name="serviceType">The new service type to use.</param> /// <param name="nominalVoltage">The new nominal voltage to use.</param> /// <param name="diag1CurrentTolerance">The Diag 1 Current Tolerance</param> /// <param name="diag2VoltDeviation">The Diag 2 Voltage Deviation</param> /// <param name="diag3CurrentThreshold">The Diag 3 Current Threshold</param> /// <param name="diag4PhaseDeviation">The Diag 4 Phase Deviation</param> /// <param name="diag4CurrentThreshold">The Diag 4 Current Threshold</param> /// <returns>The result of the reconfigure</returns> // Revision History // MM/DD/YY who Version Issue# Description // -------- --- ------- ------ --------------------------------------- // 04/29/09 RCG 2.20.03 N/A Created // 07/08/10 jrf 2.42.02 157552 Setting clear sitescan flag on close config. public SiteScanReconfigResult ReconfigureSiteScan(ServiceTypes serviceType, float nominalVoltage, float diag1CurrentTolerance, byte diag2VoltDeviation, float diag3CurrentThreshold, float diag4PhaseDeviation, float diag4CurrentThreshold) { CloseConfigErrors Errors = CloseConfigErrors.None; ProcedureResultCodes ProcResult = ProcedureResultCodes.COMPLETED; PSEMResponse Response = PSEMResponse.Ok; SiteScanReconfigResult ReconfigResult = SiteScanReconfigResult.SUCCESS; // First make sure we have read the SiteScan config so we have the correct data. Response = SiteScanConfig.Read(); if (Response == PSEMResponse.Ok) { // Open the config so that we can write to it. ProcResult = OpenConfig(); if (ProcResult == ProcedureResultCodes.COMPLETED) { // Set the new values. SiteScanConfig.ServiceType = serviceType; SiteScanConfig.NominalVoltage = nominalVoltage; // Diag 1 values SiteScanConfig.Diag1CurrentLeadTolerance = diag1CurrentTolerance; SiteScanConfig.Diag1CurrentLagTolerance = diag1CurrentTolerance; // Diag 2 values SiteScanConfig.Diag2VoltagePercentDeviation = diag2VoltDeviation; // Diag 3 values SiteScanConfig.Diag3CurrentThreshold = diag3CurrentThreshold; // Diag 4 values SiteScanConfig.Diag4CurrentPhaseDeviation = diag4PhaseDeviation; SiteScanConfig.Diag4MinCurrent = diag4CurrentThreshold; // Write the new values Response = SiteScanConfig.Write(); if (Response == PSEMResponse.Ok) { ProcResult = CloseConfig(CloseConfigOptions.SiteScan, out Errors); } } } if (ProcResult == ProcedureResultCodes.NO_AUTHORIZATION) { ReconfigResult = SiteScanReconfigResult.SECURITY_ERROR; } else if (ProcResult != ProcedureResultCodes.COMPLETED) { ReconfigResult = SiteScanReconfigResult.ERROR; } if (Response == PSEMResponse.Isc) { ReconfigResult = SiteScanReconfigResult.SECURITY_ERROR; } else if (Response != PSEMResponse.Ok) { ReconfigResult = SiteScanReconfigResult.PROTOCOL_ERROR; } return(ReconfigResult); }