示例#1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="psem">The PSEM communications object for the current sessions</param>
 /// <param name="amiDevice">The current device object.</param>
 // Revision History
 // MM/DD/YY who Version Issue# Description
 // -------- --- ------- ------ ---------------------------------------
 // 02/17/10 RCG 2.40.15		   Created
 //  11/14/13 AF  3.50.03	    Class re-architecture - replace CENTRON_AMI parameter
 //                              with CANSIDevice
 //
 public RFLANCommModule(CPSEM psem, CANSIDevice amiDevice)
     : base(psem, amiDevice)
 {
     m_Table2068 = null;
     m_Table2078 = null;
     m_Table2113 = null;
     m_Table2121 = null;
 }
示例#2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="psem">The PSEM communications object for the current session</param>
 /// <param name="amiDevice">The current device object.</param>
 // Revision History
 // MM/DD/YY who Version Issue# Description
 // -------- --- ------- ------ ---------------------------------------
 // 02/17/10 RCG 2.40.15		   Created
 //  11/14/13 AF  3.50.03	    Class re-architecture - replace CENTRON_AMI parameter
 //                              with CANSIDevice
 //
 public PLANCommModule(CPSEM psem, CANSIDevice amiDevice)
     : base(psem, amiDevice)
 {
     m_Table2194     = null;
     m_PLANTable2210 = null;
     m_PLANTable2211 = null;
     m_PLANTable2212 = null;
     m_PLANTable2215 = null;
 }
示例#3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ANSIDevice">ANSIDevice Object</param>
 //  Revision History
 //  MM/DD/YY Who Version Issue# Description
 //  -------- --- ------- ------ ---------------------------------------------
 //  02/14/07 mrj 8.00.12		Created
 //  06/09/11 jrf 2.51.10 173353 Making changes required due to update to Instantaneous Quantity class.
 //
 internal ANSIInstantaneousQuantity(CANSIDevice ANSIDevice)
     : base("")
 {
     m_ANSIDevice   = ANSIDevice;
     m_PhaseALID    = null;
     m_PhaseBLID    = null;
     m_PhaseCLID    = null;
     m_AggregateLID = null;
 }
示例#4
0
        /// <summary>
        /// Creates a new device object
        /// </summary>
        /// <param name="psem">The current PSEM object</param>
        /// <param name="key">Signed authorization security key</param>
        //  Revision History
        //  MM/DD/YY Who Version Issue# Description
        //  -------- --- ------- ------ -------------------------------------------
        //  09/17/09 RCG 2.30.00        Created
        //  02/17/11 RCG 2.50.04        Adding Support for ITRD, ITRE, ITRF meters
        //  03/22/11 jrf 2.80.10        Adding support for creating new ITRJ device object.
        //  12/04/13 jrf 3.50.13        Moved logic to create device into CANSIDevice.CreateDevice(...).
        //  10/31/14 jrf 4.00.82  WR 542694 Added support for identifying Bridge meter with signed authorizaion.
        protected CENTRON_AMI CreateDevice(CPSEM psem, SignedAuthorizationKey key)
        {
            CENTRON_AMI CreatedDevice = CANSIDevice.CreateDevice(m_Comm, psem, key) as CENTRON_AMI;

            if (null == CreatedDevice)
            {
                throw new InvalidOperationException(TestResources.MeterTypeNotSupported);
            }

            return(CreatedDevice);
        }
示例#5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="psem">The PSEM communications object for the current device.</param>
        /// <param name="amiDevice">The device object for the current device</param>
        // Revision History
        // MM/DD/YY who Version Issue# Description
        // -------- --- ------- ------ ---------------------------------------
        // 02/17/10 RCG 2.40.15		   Created
        // 11/14/13 AF  3.50.03	        Class re-architecture - replace CENTRON_AMI parameter
        //                              with CANSIDevice
        //
        public CommModuleBase(CPSEM psem, CANSIDevice amiDevice)
        {
            m_PSEM      = psem;
            m_AMIDevice = amiDevice;

            m_Table121 = null;
            m_Table122 = null;
            m_Table123 = null;
            m_Table126 = null;
            m_Table127 = null;
        }
示例#6
0
 /// <summary>
 /// The Constructor. Used to access common FWDL methods and properites. Usually instantiated
 /// by classes that are implementing the IFirmwareDownload Interface. At this time it only
 /// applies to ICS Gateway devices.
 /// </summary>
 /// <param name="PSEM">The PSEM object to be used in the class.</param>
 /// <param name="ANSIDevice">The ANSIDevice to be used in the class.</param>
 /// <param name="DebugLogger">The DebugLogger to be used in the class.</param>
 //  Revision History
 //  MM/DD/YY Who Version Issue#   Description
 //  -------- --- ------- -------- -------------------------------------------
 //  01/06/14 DLG 3.50.14          Created.
 //
 public CommonFirmwareDownload(CPSEM PSEM, CANSIDevice ANSIDevice, Logger DebugLogger)
 {
     m_PSEM       = PSEM;
     m_ANSIDevice = ANSIDevice;
     m_Logger     = DebugLogger;
 }
示例#7
0
        /// <summary>
        /// Creates the appropriate Comm Module class based on the Comm Module device class
        /// </summary>
        /// <param name="psem">The PSEM communications object for the current session</param>
        /// <param name="amiDevice">The Device Object for the current device</param>
        /// <returns>The Comm Module object.</returns>
        // Revision History
        // MM/DD/YY who Version Issue# Description
        // -------- --- ------- ------ ---------------------------------------
        // 02/17/10 RCG 2.40.15		   Created
        // 10/11/11 AF  2.53.00        Added code for Cisco comm module.
        // 07/20/12 AF  2.60.46 201155 Removed the firmware version check and substituted a check
        //                              on the comm module id from Mfg table 17
        // 01/16/13 mah 2.70.58        Added support for SL7000 Gateway
        // 03/26/13 mah 2.80.11        Added support for ICS devices and comm modules
        // 11/14/13 AF  3.50.03	        Class re-architecture - replace CENTRON_AMI parameter
        //                              with CANSIDevice
        // 12/26/13 AF  3.50.16 TQ9484 Added code to deal with a Bridge meter in ChoiceConnect mode. Try
        //                             to avoid reading RFLAN tables
        // 11/17/14 jrf 4.00.89 TBD    Added special identification of comm module types for Bridge meters in ChoicConnect mode.
        // 03/10/15 AF  4.10.05 WR569364 Added support for ITRK
        //
        public static CommModuleBase CreateCommModule(CPSEM psem, CANSIDevice amiDevice)
        {
            CommModuleBase NewCommModule   = null;
            string         CG_MESH_MODULE  = "CISCO CGMesh Module ";
            string         strCommModuleID = "";

            if (amiDevice is SL7000_Gateway)
            {
                // This is a Cisco module
                NewCommModule = new CiscoCommModule(psem, amiDevice);
            }
            else if ((amiDevice is OpenWayITRJ) || (amiDevice is OpenWayPolyITRK) || (amiDevice is ICS_Gateway))
            {
                // This is an ICS communications module
                NewCommModule = new ICSCommModule(psem, amiDevice);
            }
            else if ((amiDevice is IBridge) && (((IBridge)amiDevice).CurrentRegisterCommOpMode == OpenWayMFGTable2428.ChoiceConnectCommOpMode.ChoiceConnectOperationalMode))
            {
                if (OpenWayMFGTable2428.ChoiceConnectCommMfgMode.ChoiceConnectManufacturingModeRFMesh == ((IBridge)amiDevice).ChoiceConnectManufacturedMode)
                {
                    // This is a Cisco module
                    NewCommModule = new CiscoCommModule(psem, amiDevice);
                }
                else if (OpenWayMFGTable2428.ChoiceConnectCommMfgMode.ChoiceConnectManufacturingModeRFLAN == ((IBridge)amiDevice).ChoiceConnectManufacturedMode)
                {
                    // This is a RFLAN Module
                    NewCommModule = new RFLANCommModule(psem, amiDevice);
                }
            }
            else
            {
                switch (amiDevice.CommModuleDeviceClass)
                {
                case ITR2_DEVICE_CLASS:
                case ITRL_DEVICE_CLASS:
                {
                    try
                    {
                        RFLANMfgTable2065 table2065 = new RFLANMfgTable2065(psem);
                        strCommModuleID = table2065.RFLANIdentification;
                    }
                    catch (PSEMException)
                    {
                        // It's possible that reading table 2065 could fail in a meter whose Comm Module
                        // is not working.
                        strCommModuleID = null;
                    }
                    catch (TimeOutException)
                    {
                        // It's possible that reading table 2065 could fail in a meter whose Comm Module
                        // is not working.
                        strCommModuleID = null;
                    }

                    if (null != strCommModuleID)
                    {
                        if (String.CompareOrdinal(strCommModuleID, CG_MESH_MODULE) == 0)
                        {
                            // This is a Cisco module
                            NewCommModule = new CiscoCommModule(psem, amiDevice);
                        }
                        else
                        {
                            // This is a RFLAN or PrismLite Module
                            NewCommModule = new RFLANCommModule(psem, amiDevice);
                        }
                    }
                    else
                    {
                        // This is a Third Party or Unknown Comm Module
                        NewCommModule = new CommModuleBase(psem, amiDevice);
                    }
                    break;
                }

                case ITRP_DEVICE_CLASS:
                {
                    // This is a PLAN Comm Module
                    NewCommModule = new PLANCommModule(psem, amiDevice);
                    break;
                }

                default:
                {
                    // This is a Third Party or Unknown Comm Module
                    NewCommModule = new CommModuleBase(psem, amiDevice);
                    break;
                }
                }
            }
            return(NewCommModule);
        }
示例#8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="PSEM"></param>
 /// <param name="device"></param>
 // Revision History
 // MM/DD/YY Who Version ID Number Description
 // -------- --- ------- -- ------ -------------------------------------------
 // 11/21/13 DLG 3.50.07           Created.
 // 01/09/14 DLG 3.50.23 TR 9993   Also related to TREQ 9996. Added ANSIDevice as parameter.
 //
 public ICSTableReader(CPSEM PSEM, CANSIDevice device)
 {
     m_PSEM       = PSEM;
     m_ANSIDevice = device;
 }
示例#9
0
        /// <summary>
        /// Gets the device information from the meter.
        /// </summary>
        //  Revision History
        //  MM/DD/YY Who Version ID Number Description
        //  -------- --- ------- -- ------ -------------------------------------------
        //  08/28/09 RCG 2.30.00           Created
        //  09/19/14 jrf 4.00.63 WR 534158 Modified to use the CANSIDevice.CreateDevice()
        //                                 method to instantiate the correct device and switched
        //                                 to store the name of the meter instead of device class.
        //  10/31/14 jrf 4.00.82  WR 542694 Added support for identifying Bridge meter with signed authorizaion.
        private TestRun GetDeviceInfo()
        {
            CXMLOpenWaySystemSettings SystemSettings = new CXMLOpenWaySystemSettings("");
            CPSEM        PSEM       = new CPSEM(m_Comm);
            PSEMResponse Response   = PSEMResponse.Ok;
            string       strModel   = null;
            TestRun      NewTestRun = new TestRun();
            string       MeterType  = "";

            Response = PSEM.Identify();

            if (Response == PSEMResponse.Ok)
            {
                Response = PSEM.Negotiate(CPSEM.DEFAULT_MAX_PACKET_LEGNTH,
                                          CPSEM.DEFAULT_MAX_NUMBER_OF_PACKETS, m_uiBaudRate);
            }

            if (Response == PSEMResponse.Ok)
            {
                Response = PSEM.Logon("", CPSEM.DEFAULT_HH_PRO_USER_ID);
            }

            if (Response == PSEMResponse.Ok)
            {
                CTable00 Table0 = new CTable00(PSEM);
                CTable01 Table1 = new CTable01(PSEM, Table0.StdVersion);
                strModel = Table1.Model;

                if (strModel == AMI_CENT)
                {
                    CANSIDevice ANSIDevice = CANSIDevice.CreateDevice(m_Comm, PSEM, Settings.Default.AuthenticationKey);
                    CENTRON_AMI AMIDevice  = ANSIDevice as CENTRON_AMI;

                    if (null != AMIDevice)
                    {
                        if (SystemSettings.UseSignedAuthorization && AMIDevice.SignedAuthorizationState != null &&
                            AMIDevice.SignedAuthorizationState.Value != FeatureState.Disabled &&
                            Settings.Default.AuthenticationKey != null)
                        {
                            // Use Signed Authenticaiton
                            AMIDevice.Authenticate(Settings.Default.AuthenticationKey);
                        }
                        else
                        {
                            // Use standard security
                            AMIDevice.Security(GetPasswords());
                        }

                        MeterType = AMIDevice.MeterName;

                        if (AMIDevice.CommModule != null)
                        {
                            m_strMeterID = AMIDevice.CommModule.ElectronicSerialNumber;
                        }
                    }
                }
            }

            try
            {
                PSEM.Logoff();
                PSEM.Terminate();
            }
            catch (Exception)
            {
                // Make sure we log off.
            }

            // Handle any errors that may have occurred
            if (Response != PSEMResponse.Ok)
            {
                throw new PSEMException(PSEMException.PSEMCommands.PSEM_READ, Response, Resources.ErrorRetrievingDeviceIdentification);
            }
            else if (strModel != AMI_CENT)
            {
                throw new InvalidOperationException(Resources.MeterTypeNotSupported);
            }

            // Set up the TestRun results
            NewTestRun.MeterType   = MeterType;
            NewTestRun.MeterID     = m_strMeterID;
            NewTestRun.TestDate    = DateTime.Now;
            NewTestRun.ProgramName = m_strProgramFile;
            NewTestRun.SWVersion   = Application.ProductVersion;

            return(NewTestRun);
        }