Exemplo n.º 1
0
        private void SnmpUpdateThread(object sender, DoWorkEventArgs args)
        {
            if (m_bIsSnmpUpdating)
            {
                return;
            }
            IIndicateurProgression indicateur = sender as IIndicateurProgression;

            m_bIsSnmpUpdating = true;
            try
            {
                if (indicateur != null)
                {
                    indicateur.SetBornesSegment(0, 100);
                    indicateur.SetValue(0);
                    indicateur.Masquer(false);
                }
                CSchemaReseau            schema = m_stackCheminsReseau.Peek();
                CListeCouplesEntiteChamp liste  = schema.GetListeValeursSnmpAffichees();
                liste.UpdateValeurs(schema.ContexteDonnee, indicateur);
                if (indicateur != null)
                {
                    indicateur.Masquer(true);
                }
            }
            catch { }
            finally
            {
                m_bIsSnmpUpdating = false;
            }
        }
Exemplo n.º 2
0
        //--------------------------------------------------------------------
        private void UpdateDateSNMP()
        {
            DateTime?                dtOld   = null;
            CSchemaReseau            schema  = m_stackCheminsReseau.Peek();
            CListeCouplesEntiteChamp couples = schema.GetListeValeursSnmpAffichees();

            foreach (CCoupleEntiteSnmp_Champ couple in couples)
            {
                CRelationEntiteSnmp_ChampCustom rel = CUtilElementAChamps.GetRelationToChamp(couple.Entite, couple.ChampCustom.Id) as CRelationEntiteSnmp_ChampCustom;
                if (rel != null && rel.DateSynchroSnmp != null)
                {
                    if (dtOld == null || rel.DateSynchroSnmp.DateTimeValue < dtOld.Value)
                    {
                        dtOld = rel.DateSynchroSnmp.DateTimeValue;
                    }
                }
            }
            m_bHasSnmpEntities  = couples.Count > 0;
            m_panelSNMP.Visible = m_bHasSnmpEntities;
            m_lastSnmpUpdate    = dtOld;
            UpdateLabelSnmpUpdate();
        }