public ConfigurationResult Configure(string sProgramName, PromptForData PFData)
#endif
        {
            AMIConfigureCentronII ConfigureDevice = new AMIConfigureCentronII(m_PSEM);
            ConfigurationError    ConfigError     = ConfigurationError.GENERAL_ERROR;

            // Set up the progress bar event handlers
            ConfigureDevice.ShowProgressEvent += this.ShowProgressEvent;
            ConfigureDevice.StepProgressEvent += this.StepProgressEvent;
            ConfigureDevice.HideProgressEvent += this.HideProgressEvent;

            ConfigureDevice.IsCanadian = IsCanadian;

            ConfigureDevice.UnitID = PFData.UnitID;
            ConfigureDevice.CustomerSerialNumber = PFData.SerialNumber;
            ConfigureDevice.InitialDateTime      = PFData.InitialDateTime;

            ConfigError = ConfigureDevice.Configure(sProgramName);

            // Translate to the ItronDevice ConfigurationResult error code since
            // the factory is using ConfigurationError and we do not want to always
            // rely on having the version in AMIConfiguration.dll

            return(TranslateConfigError(ConfigError));
        }
Exemple #2
0
        public ConfigurationResult Configure(string sProgramName)
#endif
        {
            PromptForData PFData = new PromptForData();

            PFData.UnitID          = UnitID;
            PFData.SerialNumber    = SerialNumber;
            PFData.InitialDateTime = null;

            return(Configure(sProgramName, PFData));
        }
Exemple #3
0
        /// <summary>
        /// Configures a device with the specified program and Prompt for data.
        /// </summary>
        /// <param name="sProgramName">Name or path of the program.</param>
        /// <param name="PFData">The prompt for data for the program.</param>
        /// <returns>A ConfigurationError code.</returns>
        //  Revision History
        //  MM/DD/YY Who Version Issue# Description
        //  -------- --- ------- ------ -------------------------------------------
        //  03/27/08 RCG 10.00          Created

        public virtual ConfigurationResult Configure(string sProgramName, PromptForData PFData)
        {
            // We currently don't have a prompt for for most devices so just call configure.
            return(Configure(sProgramName));
        }
        /// <summary>
        /// Configures the meter with the specified program
        /// </summary>
        /// <param name="sProgramName">The path to the program file</param>
        /// <param name="PFData">Prompt For data Object</param>
        /// <returns></returns>
        /// Revision History
        /// MM/DD/YY who Version Issue# Description
        /// -------- --- ------- ------ ---------------------------------------
        /// 06/08/10 AF  2.41.07		Created
#if (!WindowsCE)
        public override ConfigurationResult Configure(string sProgramName, PromptForData PFData)
Exemple #5
0
        public ConfigurationResult Configure(string sProgramName, PromptForData PFData)
#endif
        {
            ConfigurationResult  Result          = ConfigurationResult.SUCCESS;
            AMIConfigureDevice   ConfigureDevice = new AMIConfigureDevice(m_PSEM);
            ConfigurationError   ConfigError     = ConfigurationError.GENERAL_ERROR;
            ProcedureResultCodes ProcResult      = ProcedureResultCodes.UNRECOGNIZED_PROC;

            // Set up the progress bar event handlers
            ConfigureDevice.ShowProgressEvent += this.ShowProgressEvent;
            ConfigureDevice.StepProgressEvent += this.StepProgressEvent;
            ConfigureDevice.HideProgressEvent += this.HideProgressEvent;

            ConfigureDevice.IsCanadian = IsCanadian;

            // We always need to set the Prompt for data so we should just use what is
            // currently in the meter.

            ConfigureDevice.UnitID = PFData.UnitID;
            ConfigureDevice.CustomerSerialNumber = PFData.SerialNumber;
            ConfigureDevice.InitialDateTime      = PFData.InitialDateTime;

            // If the meter uses Base Backed Values we need to configure the base energies
            if (UsesBaseBackedValues || ConfigureBaseEnergiesSupported)
            {
                ProcResult = ConfigureBase(sProgramName);

                if (ProcResult != ProcedureResultCodes.COMPLETED)
                {
                    switch (ProcResult)
                    {
                    case ProcedureResultCodes.DEVICE_SETUP_CONFLICT:
                    {
                        Result = ConfigurationResult.INVALID_CONFIG;
                        break;
                    }

                    case ProcedureResultCodes.NO_AUTHORIZATION:
                    {
                        Result = ConfigurationResult.SECURITY_ERROR;
                        break;
                    }

                    case ProcedureResultCodes.UNRECOGNIZED_PROC:
                    {
                        Result = ConfigurationResult.UNSUPPORTED_FUNCTION;
                        break;
                    }

                    default:
                    {
                        Result = ConfigurationResult.ERROR;
                        break;
                    }
                    }
                }
            }

            if (Result == ConfigurationResult.SUCCESS)
            {
                ConfigError = ConfigureDevice.Configure(sProgramName);

                // Translate to the ItronDevice ConfigurationResult error code since
                // the factory is using ConfigurationError and we do not want to always
                // rely on having the version in AMIConfiguration.dll
                Result = TranslateConfigError(ConfigError);
            }

            return(Result);
        }