예제 #1
0
        private void m_btnMask_Click(object sender, EventArgs e)
        {
            CSpvAlarmeDonnee spvAlarmData = null;

            if (m_AlarmInfo != null)
            {
                spvAlarmData = m_AlarmInfo.GetSpvAlarme(m_ctxDonnee);
            }

            if (spvAlarmData == null)
            {
                return;
            }
            int id = spvAlarmData.SpvLienAccesAlarme.Id;//test
            //   CFormEditionMasquage editionMask = new CFormEditionMasquage(spvAlarm.SpvAccesAccesc, false);
            //   editionMask.ShowDialog();

            //CFormEditionCablageAccesAlarmeBoucle form = new CFormEditionCablageAccesAlarmeBoucle(spvAlarm.SpvAccesAccesc);
            CFormEditionAccesAlarmeEquipement form = new CFormEditionAccesAlarmeEquipement(spvAlarmData.SpvLienAccesAlarme);

            Navigateur.AffichePage(form);

            /*  CReferenceTypeForm refTypeForm = CFormFinder.GetRefFormToEdit(objTimos.GetType());
             * if (refTypeForm != null)
             * {
             *    IFormNavigable frm = refTypeForm.GetForm(objTimos) as IFormNavigable;
             *    Navigateur.AffichePage(frm);
             * }*/
        }
예제 #2
0
 private void InitButtonsInfo()
 {
     m_NbMasqCreat = CSpvLienAccesAlarme.ListeLienAccesMasqueACreation(m_consultationEnCours.ContexteDonnee).Count;
     m_NbMaskBrig  = CSpvLienAccesAlarme.ListeLienAccesMasqueBriq(m_consultationEnCours.ContexteDonnee).Count;
     m_NbMaskAdm   = CSpvLienAccesAlarme.ListeLienAccesMasqueAdmin(m_consultationEnCours.ContexteDonnee).Count;
     m_NbAlFreq    = CSpvAlarmeDonnee.ListCurrentFrequentAlarms(m_consultationEnCours.ContexteDonnee).Count;
 }
예제 #3
0
        private void m_btnAcquit_Click(object sender, EventArgs e)
        {
            CSpvAlarmeDonnee spvAlarmData = null;

            if (m_AlarmInfo != null)
            {
                spvAlarmData = m_AlarmInfo.GetSpvAlarme(m_ctxDonnee);
            }

            if (spvAlarmData == null)
            {
                return;
            }


            CResultAErreur result = spvAlarmData.AcquitterNow();

            if (!result)
            {
                CFormAlerte.Afficher(result);
            }

            m_AlarmInfo.EstAcquittee = spvAlarmData.Acquittee;

            if (!m_AlarmInfo.WaiteToBeAcknowledged())
            {
                m_btnAcquit.Enabled = false;
            }
            else
            {
                m_btnAcquit.Enabled = true;
            }
        }
예제 #4
0
        public CListeObjetsDonnees GetFrequentAlarms()
        {
            CListeObjetsDonnees lst = CSpvAlarmeDonnee.ListCurrentFrequentAlarms(m_consultationEnCours.ContexteDonnee);

            lst.Tri = CSpvAlarmeDonnee.c_champALARMEDONNEE_SECDEBUT + " asc";

            return(lst);
        }
예제 #5
0
        //----------------------------------------------------------------------------------------------
        private void StopAlarme(int?nIdAlarme)
        {
            if (nIdAlarme == null)
            {
                return;
            }

            // Traitement de l'état opérationnel des schémas
            CSpvAlarmeDonnee alarmeData = new CSpvAlarmeDonnee(ContexteDonnee);

            if (alarmeData.ReadIfExists(nIdAlarme.Value))
            {
                List <CElementDeArbreOperationnel> listeNoeudsConcernes = new List <CElementDeArbreOperationnel>();
                if (alarmeData.EquipId != null)
                {
                    m_dicEquipementToNoeudArbreOp.TryGetValue(alarmeData.EquipId.Value, out listeNoeudsConcernes);
                }
                else if (alarmeData.SiteId != null)
                {
                    m_dicSiteToNoeudArbreOp.TryGetValue(alarmeData.SiteId.Value, out listeNoeudsConcernes);
                }
                else if (alarmeData.LiaiId != null)
                {
                    m_dicLiaisonToNoeudArbreOp.TryGetValue(alarmeData.LiaiId.Value, out listeNoeudsConcernes);
                }

                // Passe tous les coef opérationnels à 1 = OK
                PropageCoefOperationnel(listeNoeudsConcernes, 1.0);
            }


            List <CInfoElementDeSchemaSupervise> lst = null;

            if (m_dicAlarmeToElementsConcernes.TryGetValue((int)nIdAlarme, out lst))
            {
                List <CInfoElementDeSchemaSupervise> lstAPrevenir = new List <CInfoElementDeSchemaSupervise>(lst);
                while (lstAPrevenir.Count != 0)
                {
                    lstAPrevenir.Sort();
                    CInfoElementDeSchemaSupervise[] infos = lstAPrevenir.ToArray();
                    lstAPrevenir.Clear();
                    foreach (CInfoElementDeSchemaSupervise info in infos)
                    {
                        info.StopAlarme(nIdAlarme.Value);
                        CInfoElementDeSchemaSupervise parent = info.Parent;
                        if (parent != null)
                        {
                            lstAPrevenir.Add(parent);
                        }
                    }
                }
            }

            if (lst != null && lst.Count > 0)
            {
                Refresh();
            }
        }
예제 #6
0
        public CSpvAlarmeDonnee GetSpvAlarme(CContexteDonnee contexteDonnee)
        {
            AssureData();

            CSpvAlarmeDonnee alarme = new CSpvAlarmeDonnee(contexteDonnee);

            if (alarme.ReadIfExists(m_nIdAlarmData))
            {
                return(alarme);
            }
            return(null);
        }
예제 #7
0
        private void m_btnRetombe_Click(object sender, EventArgs e)
        {
            // Pour faire retomber l'alarme, on crée
            //CSpvAlarmeDonnee.Retomber(m_AlarmInfo.IdSpvEvtAlarme, m_ctxDonnee);
            CResultAErreur result =
                CSpvAlarmeDonnee.Retomber(m_AlarmInfo.IdSpvAlarmeData, m_ctxDonnee);

            if (!result)
            {
                CFormAlerte.Afficher(result);
            }
            //CSpvAlarmeEvenement.Retomber(m_AlarmInfo.IdSpvAlarme, m_ctxDonnee);
        }
예제 #8
0
        //----------------------------------------------------------------------------------------------
        private void StartAlarme(CInfoAlarmeAffichee infoAlarme)
        {
            //int nIdAlarme = infoAlarme.IdSpvEvtAlarme;
            int nIdAlarmeData = infoAlarme.IdSpvAlarmeData;

            m_dicAlarmes[nIdAlarmeData] = infoAlarme;

            // Traitement de l'état opérationnel des schémas
            CSpvAlarmeDonnee alarmeData = new CSpvAlarmeDonnee(ContexteDonnee);

            if (infoAlarme.SeverityCode >= (int)EGraviteAlarme.Major &&
                alarmeData.ReadIfExists(nIdAlarmeData))
            {
                List <CElementDeArbreOperationnel> listeNoeudsConcernes = new List <CElementDeArbreOperationnel>();
                if (alarmeData.EquipId != null)
                {
                    m_dicEquipementToNoeudArbreOp.TryGetValue(alarmeData.EquipId.Value, out listeNoeudsConcernes);
                }
                else if (alarmeData.SiteId != null)
                {
                    m_dicSiteToNoeudArbreOp.TryGetValue(alarmeData.SiteId.Value, out listeNoeudsConcernes);
                }
                else if (alarmeData.LiaiId != null)
                {
                    m_dicLiaisonToNoeudArbreOp.TryGetValue(alarmeData.LiaiId.Value, out listeNoeudsConcernes);
                }

                PropageCoefOperationnel(listeNoeudsConcernes, 0.0);
            }


            List <CInfoElementDeSchemaSupervise> lstConcernes = null;

            if (infoAlarme.InfoEquipement != null)
            {
                m_dicDirectementConcernesParEquipement.TryGetValue(infoAlarme.InfoEquipement.Id, out lstConcernes);
            }
            if (infoAlarme.InfoLiaison != null)
            {
                m_dicDirectementConcernesParLiaison.TryGetValue(infoAlarme.InfoLiaison.Id, out lstConcernes);
            }
            if (infoAlarme.InfoSite != null && infoAlarme.InfoSite.Id != null)
            {
                m_dicDirectementConcernesParSite.TryGetValue(infoAlarme.InfoSite.Id.Value, out lstConcernes);
            }
            Dictionary <CInfoElementDeSchemaSupervise, bool> dicConcernes = new Dictionary <CInfoElementDeSchemaSupervise, bool>();

            if (lstConcernes != null)
            {
                List <CInfoElementDeSchemaSupervise> lstAPrevenir = new List <CInfoElementDeSchemaSupervise>(lstConcernes);
                bool bFirstNiveau = true;
                while (lstAPrevenir.Count != 0)
                {
                    lstAPrevenir.Sort();
                    CInfoElementDeSchemaSupervise[] infos = lstAPrevenir.ToArray();
                    lstAPrevenir.Clear();
                    foreach (CInfoElementDeSchemaSupervise info in infos)
                    {
                        if (bFirstNiveau)
                        {
                            dicConcernes[info] = true;
                        }
                        info.StartAlarme(infoAlarme, false);
                        CInfoElementDeSchemaSupervise parent = info.Parent;
                        if (parent != null)
                        {
                            lstAPrevenir.Add(parent);
                        }
                    }
                    bFirstNiveau = false;
                }
                if (lstConcernes.Count > 0)
                {
                    Refresh();
                }
            }
            List <CInfoElementDeSchemaSupervise> lst = new List <CInfoElementDeSchemaSupervise>();

            lst.AddRange(dicConcernes.Keys);
            m_dicAlarmeToElementsConcernes[nIdAlarmeData] = lst;
        }
예제 #9
0
        public Image GetImage(object obj)
        {
            CSpvAlarmeDonnee alarm = obj as CSpvAlarmeDonnee;

            return(m_ImageListSeverity.Images[alarm.CodeGravite]);
        }
예제 #10
0
        private void ReadData()
        {
            using (CContexteDonnee contexte = new CContexteDonnee(0, true, false))
            {
                CSpvEvenementReseau evt;
                if (m_spvAlarm == null)     // Init. à partir de l'événement réseau
                {
                    evt = new CSpvEvenementReseau(contexte);
                    if (evt.ReadIfExists(m_nIdSpvEvtAlarme))
                    {
                        m_spvAlarm = evt.SpvAlarme;
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    evt = m_spvAlarm.EvenementDebut;
                }

                CDivers div = new CDivers();

                m_lstTrapInfo     = new List <string>();
                m_lstInfoClients  = new List <CInfoClientAlarmeAffichee>();
                m_lstInfoServices = new List <CInfoServiceAlarmeAffichee>();

                m_nIdAlarmData = m_spvAlarm.Id;

                m_InfoAlarmGeree = new CInfoAlarmeGereeAffichee();
                if (evt.SpvAlarmgeree != null)
                {
                    m_InfoAlarmGeree.Id   = (int)evt.SpvAlarmgeree.Id;
                    m_InfoAlarmGeree.Name = evt.SpvAlarmgeree.Alarmgeree_Name;
                }

                if (m_spvAlarm.SpvSite != null)
                {
                    if (m_InfoSite == null)
                    {
                        m_InfoSite = new CInfoSiteAlarmeAffichee();
                    }
                    m_InfoSite.Id   = (int)m_spvAlarm.SpvSite.Id;
                    m_InfoSite.Name = m_spvAlarm.SpvSite.SiteNom;
                    if (m_spvAlarm.SpvSite.TypeSite != null)
                    {
                        m_InfoSite.TypeName = m_spvAlarm.SpvSite.TypeSite.TypeSiteNom;
                    }
                }

                else if (m_spvAlarm.SpvEquip != null)
                {
                    m_InfoEquip          = new CInfoEquipementAlarmeAffichee();
                    m_InfoEquip.Id       = (int)m_spvAlarm.EquipId;
                    m_InfoEquip.TypeName = m_spvAlarm.SpvEquip.TypeEquipement.Libelle;
                    m_InfoEquip.Name     = m_spvAlarm.SpvEquip.CommentairePourSituer;
                }

                else if (m_spvAlarm.SpvLiai != null)
                {
                    m_InfoLiai          = new CInfoLiaiAlarmeAffichee();
                    m_InfoLiai.Id       = (int)m_spvAlarm.LiaiId;
                    m_InfoLiai.TypeName = m_spvAlarm.SpvLiai.Typeliaison.Libelle;
                    m_InfoLiai.Name     = m_spvAlarm.SpvLiai.NomComplet;
                }

                //if (m_InfoSite == null)
                //    m_InfoSite = new CInfoSiteAlarmeAffichee();

                m_nIddeb    = evt.Id;
                m_stAlarmCl = evt.AlarmCategory;
                m_nNumObj   = evt.AlarmNumObj;
                m_InfoAlarmGeree.CodeAlarmEvent = (EAlarmEvent)m_spvAlarm.CodeEvenementX733;

                if (evt.TypeEvenementReseau == ETypeEvenementReseau.DebutAlarme)
                {
                    m_AlarmDate      = m_spvAlarm.DateDebut;
                    m_StartAlarmDate = m_AlarmDate;
                }
                else
                {
                    m_AlarmDate      = (System.DateTime)m_spvAlarm.DateFin;
                    m_StopAlarmDate  = m_AlarmDate;
                    m_StartAlarmDate = m_spvAlarm.DateDebut;
                }

                m_nGrave   = m_spvAlarm.CodeGravite;
                m_stNSeuil = m_spvAlarm.NomSeuilAlarme;
                m_nVSeuil  = m_spvAlarm.ValeurSeuilAlarme;
                m_stNumal  = evt.AlarmNumAl;
                m_nTexte   = evt.CodeAlarmNature;

                m_stCommentaire = m_spvAlarm.Commententaire;
                m_stInfo        = evt.AlarmInfo;

                if (m_spvAlarm.SpvLienAccesAlarme != null)
                {
                    m_bAAcquitter = (bool)m_spvAlarm.SpvLienAccesAlarme.Acquitter;
                    m_bSonne      = (bool)m_spvAlarm.SpvLienAccesAlarme.SonActive;
                }

                if (evt.SpvAlarmgeree != null)
                {
                    m_InfoAlarmGeree.CodeRingType = evt.SpvAlarmgeree.CodeAlarmgereeTypeSon;
                }
                m_bCommut = evt.AlarmCommut;

                m_nIdSpvEvtAlarme = evt.Id;
                if (evt.ElementGereNomSite != null && evt.ElementGereNomSite.Length > 0)
                {
                    if (m_InfoSite == null)
                    {
                        m_InfoSite = new CInfoSiteAlarmeAffichee();
                    }
                    m_InfoSite.Name = evt.ElementGereNomSite;
                }
                m_InfoAlarmGeree.Name = m_spvAlarm.NomAlarmeGeree;

                //string stProgConcNom = m_spvAlarm.ProgrammesConcernes;
                if (m_spvAlarm.ServicesConcernes != null)
                {
                    foreach (System.Int32 nServiceId in m_spvAlarm.ServicesConcernes)
                    {
                        CInfoServiceAlarmeAffichee serviceAff = new CInfoServiceAlarmeAffichee();
                        serviceAff.Id = nServiceId;
                        CSpvSchemaReseau service = serviceAff.GetSpvService(contexte);
                        serviceAff.Name = service.Libelle;
                        m_lstInfoServices.Add(serviceAff);
                    }
                }


                if (m_spvAlarm.ClientsConcernes != null)
                {
                    foreach (System.Int32 nClientId in m_spvAlarm.ClientsConcernes)
                    {
                        CInfoClientAlarmeAffichee clientAff = new CInfoClientAlarmeAffichee();
                        clientAff.Id = nClientId;
                        CSpvClient client = clientAff.GetSpvClient(contexte);
                        clientAff.Name = client.CLIENT_NOM;
                        m_lstInfoClients.Add(clientAff);
                    }
                }

                if (m_spvAlarm.ProgsOper != null)
                {
                    CInfoServiceAlarmeAffichee infoService;
                    for (int i = 0; i < m_lstInfoServices.Count; i++)
                    {
                        infoService = m_lstInfoServices[i];
                        if (m_spvAlarm.ProgsOper.Length > i)
                        {
                            infoService.EtatOper = m_spvAlarm.ProgsOper[i];
                        }
                    }
                }

                m_stBindingVarInfo = m_spvAlarm.GetBindingVarInfo();
                FillTrapInfo();

                //m_bAcquittee = (m_spvAlarm.Acquittee == null) ? false : m_spvAlarm.Acquittee;
                m_bAcquittee = m_spvAlarm.Acquittee;

                m_bLectureFaite = true;
            }
        }
예제 #11
0
 public CInfoAlarmeAffichee(CSpvAlarmeDonnee spvAlarm)
 {
     m_spvAlarm = spvAlarm;
 }