Exemple #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="PSEM">Protocol obj used to identify the meter</param>
 // Revision History
 // MM/DD/YY Who Version ID Number Description
 // -------- --- ------- -- ------ ----------------------------------------------------------
 // 03/18/13 AF  2.80.08 TR 7578   Created
 // 01/09/14 DLG 3.50.23 TR 9993   Also related to TREQ 9996. Added argument to new parameter
 //                                for ICSTableReader when it's instantiated.
 //
 public ICS_Gateway(CPSEM PSEM)
     : base(PSEM)
 {
     m_EventDictionary = new ICS_Gateway_EventDictionary();
     m_rmStrings       = new ResourceManager(RESOURCE_FILE_PROJECT_STRINGS,
                                             this.GetType().Assembly);
     m_ICSTableReader = new ICSTableReader(PSEM, this);
 }
        /// <summary>
        /// Gets the base class list of validation items plus the ICM events
        /// </summary>
        /// <param name="ValidationList"></param>
        //  Revision History
        //  MM/DD/YY Who Version  ID Number  Description
        //  -------- --- -------  -- ------  --------------------------------------------
        //  08/03/16 AF  4.60.02  WR 704376  Separated out from GetEventExceptionValidationItems so that
        //                                   ICM events will be contiguous with register events
        //
        protected override void GetEventValidationItems(List <EDLValidationItem> ValidationList)
        {
            base.GetEventValidationItems(ValidationList);

            // Remove the inversion tamper event
            for (int index = 0; index < ValidationList.Count; index++)
            {
                if (String.Compare(m_rmStrings.GetString("INVERSION_TAMPER"), ValidationList[index].Name, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    ValidationList.RemoveAt(index);
                    break;
                }
            }

            // Remove the removal tamper event. This has to be a separate loop because the indexes are adjusted after the previous removal
            for (int index = 0; index < ValidationList.Count; index++)
            {
                if (String.Compare(m_rmStrings.GetString("REMOVAL_TAMPER"), ValidationList[index].Name, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    ValidationList.RemoveAt(index);
                    break;
                }
            }


            ICS_Gateway_EventDictionary EventDictionary = new ICS_Gateway_EventDictionary();

            for (int iIndex = START_ICM_EVENT_ID; iIndex < END_ICM_EVENT_ID; iIndex++)
            {
                // Get the description from the EventDictionary
                string strDescription;
                bool   bValidString;

                // The event ids in the dictionary are for mfg table 2524, which are the 2523 ids plus 2048
                bValidString = EventDictionary.TryGetValue(iIndex + 2048, out strDescription);

                if (bValidString == false)
                {
                    // We don't have a description for the item.
                    strDescription = "Unknown Event " + iIndex.ToString(CultureInfo.InvariantCulture);
                }

                ValidationList.Add(new EDLValidationItem((long)CentronTblEnum.MFGTBL475_MFG_EVENTS_MONITORED_FLAGS,
                                                         new int[] { iIndex },
                                                         strDescription,
                                                         "Events"));
            }
        }
Exemple #3
0
        /// <summary>
        /// Shows the activity counters.
        /// </summary>
        //  Revision History
        //  MM/DD/YY Who Version ID Number Description
        //  -------- --- ------- -- ------ -------------------------------------------
        //  09/17/09 RCG 2.30.00           Created
        //  09/19/14 jrf 4.00.63 WR 534158 Modified way the test details are set.
        //  04/27/15 jrf 4.20.03 WR 576493 Added check for ICM event log cleared event.
        private void ShowCounters()
        {
            ISiteScan SiteScanDevice         = m_AmiDevice as ISiteScan;
            string    strLogClearedEventName = "";
            int       LogClearedEventCount   = 0;

            if (IsAborted == false)
            {
                AddTestDetail(TestResources.DemandResetCount,
                              GetResultString(m_AmiDevice.NumDemandResets == 0),
                              GetClearCountDetails(m_AmiDevice.NumDemandResets));
                AddTestDetail(TestResources.PowerOutageCount,
                              GetResultString(m_AmiDevice.NumOutages == 0),
                              GetClearCountDetails(m_AmiDevice.NumOutages));
                AddTestDetail(TestResources.ProgrammedCount,
                              GetResultString(m_AmiDevice.NumTimeProgrammed == 0),
                              GetClearCountDetails(m_AmiDevice.NumTimeProgrammed));
                AddTestDetail(TestResources.InversionTamperCount,
                              GetResultString(m_AmiDevice.NumberOfInversionTampers == 0),
                              GetClearCountDetails((int)m_AmiDevice.NumberOfInversionTampers));
                AddTestDetail(TestResources.RemovalTamperCount,
                              GetResultString(m_AmiDevice.NumberOfRemovalTampers == 0),
                              GetClearCountDetails((int)m_AmiDevice.NumberOfRemovalTampers));

                if (SiteScanDevice != null)
                {
                    foreach (CDiagnostics.Diag CurrentDiag in SiteScanDevice.Diagnostics.m_Diags)
                    {
                        AddTestDetail(CurrentDiag.Name,
                                      GetResultString(CurrentDiag.Count == 0),
                                      GetClearCountDetails(CurrentDiag.Count));
                    }
                }

                //Retrieve the register event log cleared event name
                m_AmiDevice.EventDescriptions.TryGetValue((int)CANSIDevice.HistoryEvents.HIST_LOG_CLEARED, out strLogClearedEventName);

                LogClearedEventCount = m_AmiDevice.HistoryLogEventList.Where(e => e.Description == strLogClearedEventName && e.Enabled).Count();


                //We need to look for the ICM Event Log Cleared event.  Because of a bug 3G ICM comm module firmware,
                //the ICM event log cleared event will show up as not supported when it actually is. This means it won't show up in
                //the HistoryLogEventList property showing all supported events and whether they are monitored. To get around this the
                //code below is only checking ICM comm module monitored events, not supported ones, to see if ICM event log cleared
                //event is configured.
                if (m_AmiDevice.CommModule is ICSCommModule)
                {
                    strLogClearedEventName = "";

                    //Retrieve the ICS event log cleared event name
                    ICS_Gateway_EventDictionary ICMEventDescriptions = new ICS_Gateway_EventDictionary();
                    ICMEventDescriptions.TryGetValue((int)ICS_Gateway_EventDictionary.CommModuleHistoryEvents.ICM_EVENT_LOG_CLEARED, out strLogClearedEventName);

                    LogClearedEventCount += ((ICSCommModule)m_AmiDevice.CommModule).CommModuleEventMonitored.Where(e => e.Description == strLogClearedEventName).Count();
                }

                AddTestDetail(TestResources.EventLogCount,
                              GetResultString(LogClearedEventCount == m_AmiDevice.Events.Count),
                              GetEventLogCountDetails(LogClearedEventCount, m_AmiDevice.Events.Count));
            }
        }