Exemplo n.º 1
0
        /// <summary>
        /// Updates DST in the connected meter. This method does not reconfigure
        /// DST. Only future dates in 2007 and beyond are updated.
        /// </summary>
        /// <param name="DSTFileName">The filename including path for the DST file</param>
        /// <returns>A DSTUpdateResult</returns>
        ///
        //  Revision History
        //  MM/DD/YY who Version Issue# Description
        //  -------- --- ------- ------ ---------------------------------------
        //  06/16/06 mcm 7.30.00 N/A    Created
        //	01/24/07 mrj 8.00.08		Flushed status flags when updating dst
        //
        public override DSTUpdateResult UpdateDST(string DSTFileName)
        {
            FileStream    EDLFileStream;
            XmlTextReader EDLXMLReader;
            string        defaultEDLFileName;

            if (m_TOUTables == null)
            {
                m_TOUTables = new CentronTables();
            }

            defaultEDLFileName =
                CRegistryHelper.GetFilePath(CentronII_REPLICA) + CentronII_PROGRAM_FOLDER + DEFAULT_PROGRAM;
            if (File.Exists(defaultEDLFileName))
            {
                EDLFileStream = new FileStream(defaultEDLFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
                EDLXMLReader  = new XmlTextReader(EDLFileStream);

                // Load the Defaul EDL File as the file stream to process TOU and DST data
                m_TOUTables.LoadEDLFile(EDLXMLReader);
            }

            if (DSTFileName != null)
            {
                ClearDST(); // Key step to clear DST first
                ImportDST();
                DSTDataSet = m_TOUTables.BuildPSEMStreams(2260);
            }

            AMIConfigureCentronII configureDevice = new AMIConfigureCentronII(m_PSEM);
            DSTUpdateResult       result          = configureDevice.ReconfigureDST(DSTDataSet) ? DSTUpdateResult.SUCCESS : DSTUpdateResult.ERROR;

            return(result);
        }
Exemplo n.º 2
0
        public ConfigurationResult Configure(string sProgramName)
#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;

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

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

            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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Reconfigures TOU in the connected meter
        /// </summary>
        /// <param name="TOUFileName">The filename including path for the TOU</param>
        /// <param name="DSTFileName">The filename including path for the DST
        /// file.  If this parameter is emtpy then client only wants to
        /// reconfigure TOU, not DST. The DSTFileName MUST be included if the
        /// meter is configured for DST. If the meter is not configured for DST
        /// and this filename is given, the operation will succeed, but it will
        /// return a conditional success code.</param>
        /// <returns>A TOUReconfigResult</returns>
        ///
        //  Revision History
        //  MM/DD/YY who Version Issue# Description
        //  -------- --- ------- ------ ---------------------------------------
        //  12/04/10 SCW 9.70.14        Created

        public override TOUReconfigResult ReconfigureTOU(string TOUFileName, string DSTFileName)
        {
            FileStream    EDLFileStream;
            XmlTextReader EDLXMLReader;
            string        defaultEDLFileName;

            try
            {
                if (m_TOUTables == null)
                {
                    m_TOUTables = new CentronTables();
                }

                defaultEDLFileName =
                    CRegistryHelper.GetFilePath(CentronII_REPLICA) + CentronII_PROGRAM_FOLDER + DEFAULT_PROGRAM;
                if (File.Exists(defaultEDLFileName))
                {
                    EDLFileStream = new FileStream(defaultEDLFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
                    EDLXMLReader  = new XmlTextReader(EDLFileStream);

                    // Load the Defaul EDL File as the file stream to process TOU and DST data
                    m_TOUTables.LoadEDLFile(EDLXMLReader);
                }

                if (TOUFileName != null)
                {
                    ClearTOU(); // Key step to clear TOU first
                    ImportTOU(TOUFileName);
                    TOUDataSet = m_TOUTables.BuildPSEMStreams(2090);
                }
            }
            catch (Exception)
            {
                throw new ArgumentException("Failure in importing EDL or DST files !!");
            }
            CTable2048Header      m_2048Header    = new CTable2048Header(m_PSEM);
            AMIConfigureCentronII configureDevice = new AMIConfigureCentronII(m_PSEM);
            TOUReconfigResult     result          = configureDevice.ReconfigureTOU(TOUDataSet, m_2048Header.CalendarOffset, m_2048Header.TOUOffset) ?
                                                    TOUReconfigResult.SUCCESS : TOUReconfigResult.ERROR;

            return(result);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates Instance of AMIConfirguration Device
        /// </summary>
        ///  Revison History:
        // MM/DD/YY who Version Issue# Description
        // -------- --- ------- ------ ---------------------------------------
        // 23/12/19 MMD           N/A	   Created

        public override void CreateInstance(CPSEM m_PSEM)
        {
            m_ConfigureDevice = new AMIConfigureCentronII(m_PSEM);
        }