예제 #1
0
        /// <summary>
        /// Reconfigures TOU in the connected meter.
        /// </summary>
        /// <param name="TOUFileName">The filename including path for the
        /// configuration containing the TOU schedule.</param>
        /// <param name="iSeasonIndex">The number of seasons from the current
        /// season to write.</param>
        //  Revision History
        //  MM/DD/YY who Version Issue# Description
        //  -------- --- ------- ------ ---------------------------------------
        //  11/27/13 jrf 3.50.10 TQ9523 Created

        public override TOUReconfigResult ReconfigureTOU(string TOUFileName, int iSeasonIndex)
        {
            TOUReconfigResult ReconfigResult = TOUReconfigResult.ERROR;

            if (m_BridgeDevice != null)
            {
                ReconfigResult = m_BridgeDevice.ReconfigureTOU(TOUFileName, iSeasonIndex);
            }

            return(ReconfigResult);
        }
예제 #2
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);
        }