Exemplo n.º 1
0
        //------------------------------------------------------------------------------------
        public void Init(CMemoryDb db, CParametreAffichageListeAlarmes parametres, Dictionary <string, Image> tableauImages, bool bAlarmesEnCours)
        {
            BeginUpdate();

            m_database = db;
            m_bTraiteAlarmesEnCours = bAlarmesEnCours;
            m_parametreAffichage    = parametres;
            m_dicIdTypeAlarmeImage  = tableauImages;

            m_timerUpdateAlarms          = new Timer();
            m_timerUpdateAlarms.Interval = 1000;
            m_timerUpdateAlarms.Tick    += new EventHandler(m_timerUpdateAlarms_Tick);
            m_timerUpdateAlarms.Enabled  = true;

            if (!bAlarmesEnCours)
            {
                m_timerPersistanceAlarmesRetombees          = new Timer();
                m_timerPersistanceAlarmesRetombees.Interval = 60000; // 1 minute
                m_timerPersistanceAlarmesRetombees.Tick    += new EventHandler(m_timerPersistanceAlarmesRetombees_Tick);
                m_timerPersistanceAlarmesRetombees.Start();
            }

            AppliqueParametresAffichage();

            if (bAlarmesEnCours)
            {
                RemplirListeAlarmes();
            }

            InitContextMenu();

            EndUpdate();
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------------
        private void AppliqueParametresAffichage()
        {
            if (m_parametreAffichage == null)
            {
                m_parametreAffichage = CParametreAffichageListeAlarmes.ParametreParDefaut;
            }

            ColumnsOptions.HeaderHeight   = m_parametreAffichage.HauteurEnteteColonne;
            RowOptions.ItemHeight         = m_parametreAffichage.HauteurLigne;
            RowOptions.HeaderWidth        = m_parametreAffichage.LargeurEnteteLigne;
            m_nDurreePersistanceRetombees = m_parametreAffichage.DureePersistanceAlarmesRetombees;

            // Création des Colonnes
            Columns.Clear();
            foreach (CColonneAlarmeAffichee colonneParametree in m_parametreAffichage.Colonnes)
            {
                TreeListColumn col = new TreeListColumn(
                    colonneParametree.Title,
                    colonneParametree.Title,
                    colonneParametree.Width);
                col.HeaderFormat.BackColor = colonneParametree.BackColor;
                col.HeaderFormat.ForeColor = colonneParametree.TextColor;
                col.HeaderFormat.Font      = colonneParametree.Font;

                Columns.Add(col);

                if (colonneParametree.ActionSurLink != null)
                {
                    m_dicIndexColonneAction.Add(col.Index, colonneParametree.ActionSurLink);
                }
            }
        }
Exemplo n.º 3
0
        //-------------------------------------------------------------------------------------
        public static void AfficheAlarmes(CMemoryDb database, CParametrageAffichageListeAlarmes paramConsultation, CFormNavigateur nav)
        {
            CFormConsultationAlarmesEnCours form = new CFormConsultationAlarmesEnCours();

            form.Text         = paramConsultation.Libelle;
            form.m_dataBase   = database;
            form.m_navigateur = nav;
            form.TopMost      = false;
            CParametreAffichageListeAlarmes parametre = paramConsultation.ParametreAffichageAlarmes;

            if (parametre == null)
            {
                parametre = CParametreAffichageListeAlarmes.ParametreParDefaut;
            }

            form.m_parametreAffichage = parametre;

            CDocumentGED docSonnerie = paramConsultation.DocumentFichierSon;

            if (docSonnerie != null && docSonnerie.ReferenceDoc != null)
            {
                CProxyGED proxySonnerie = new CProxyGED(paramConsultation.ContexteDonnee.IdSession, docSonnerie.ReferenceDoc);
                if (proxySonnerie.CopieFichierEnLocal())
                {
                    form.m_proxySonnerie = proxySonnerie;
                }
                else
                {
                    proxySonnerie.Dispose();
                    proxySonnerie = null;
                }
            }

            form.m_dicImages.Clear();
            CListeObjetsDonnees listTypesAlarmes = new CListeObjetsDonnees(paramConsultation.ContexteDonnee, typeof(CTypeAlarme));

            foreach (CTypeAlarme typeAlarme in listTypesAlarmes)
            {
                if (typeAlarme.Image != null)
                {
                    form.m_dicImages.Add(typeAlarme.Id.ToString(), typeAlarme.Image);
                }
            }

            form.Show();
        }
 //-------------------------------------------------------------------------------
 internal void Init(CMemoryDb db, CParametreAffichageListeAlarmes parametreAffichage, Dictionary <string, Image> tableauImages, bool bAlarmesEnCours)
 {
     m_database = db;
     m_treeListViewAlarmes.Init(db, parametreAffichage, tableauImages, bAlarmesEnCours);
     m_treeListViewAlarmes.FiltreAlarmes = GetFiltreAlarmesParDefaut();
 }