Пример #1
0
        //private CSpvAlarmeEvenement m_spvAlarm = null;

        public CInfoAlarmeAffichee(CEvenementAlarmStartStop evenementAlarme)
        {
            m_lstTrapInfo     = new List <string>();
            m_lstInfoClients  = new List <CInfoClientAlarmeAffichee>();
            m_lstInfoServices = new List <CInfoServiceAlarmeAffichee>();

            m_nIdAlarmData        = evenementAlarme.IdAlarmData;
            m_nIdSpvEvtAlarme     = evenementAlarme.IdEvtAlarme;
            m_InfoAlarmGeree      = new CInfoAlarmeGereeAffichee();
            m_InfoAlarmGeree.Id   = evenementAlarme.IdAlarmeGeree;
            m_InfoAlarmGeree.Name = evenementAlarme.NomAlarmeGeree;

            if (evenementAlarme.NomSite != null && evenementAlarme.NomSite.Length > 0)
            {
                m_InfoSite      = new CInfoSiteAlarmeAffichee();
                m_InfoSite.Name = evenementAlarme.NomSite;
            }

            if (evenementAlarme.IdSite > 0)
            {
                if (m_InfoSite == null)
                {
                    m_InfoSite = new CInfoSiteAlarmeAffichee();
                }
                m_InfoSite.Id       = evenementAlarme.IdSite;
                m_InfoSite.TypeName = evenementAlarme.NomTypeObjet;
            }
            else if (evenementAlarme.IdEquipement > 0)
            {
                m_InfoEquip          = new CInfoEquipementAlarmeAffichee();
                m_InfoEquip.Id       = (int)evenementAlarme.IdEquipement;
                m_InfoEquip.TypeName = evenementAlarme.NomTypeObjet;
                m_InfoEquip.Name     = evenementAlarme.NomObjet;
            }
            else if (evenementAlarme.IdLiaison > 0)
            {
                m_InfoLiai          = new CInfoLiaiAlarmeAffichee();
                m_InfoLiai.Id       = (int)evenementAlarme.IdLiaison;
                m_InfoLiai.TypeName = evenementAlarme.NomTypeObjet;
                m_InfoLiai.Name     = evenementAlarme.NomObjet;
            }

            m_nIddeb    = evenementAlarme.IdAlarmeDebut;
            m_stAlarmCl = evenementAlarme.ClasseAlarme;
            m_nNumObj   = evenementAlarme.NumeroObjetDeCollecteOuTrap;
            m_InfoAlarmGeree.CodeAlarmEvent = evenementAlarme.TypeEvenementAlarme;

            m_AlarmDate = evenementAlarme.DateEvenementAlarme;
            if (m_nIddeb > 0)   // C'est un événement de fin d'alarme
            {
                m_StopAlarmDate = m_AlarmDate;
            }
            else
            {
                m_StartAlarmDate = m_AlarmDate;
            }

            m_nGrave   = (int)evenementAlarme.Gravite;
            m_stNSeuil = evenementAlarme.NomSeuil;
            m_nVSeuil  = evenementAlarme.ValeurSeuil;
            m_stNumal  = evenementAlarme.NumeroSortieAlarmeOuIP;
            m_nTexte   = (int)evenementAlarme.NatureAlarme;

            m_stCommentaire = evenementAlarme.Commentaire;
            m_stInfo        = evenementAlarme.InfoAdditionnelle;

            m_bAAcquitter = evenementAlarme.AAcquitter;
            m_bSonne      = evenementAlarme.Sonner;

            m_InfoAlarmGeree.CodeRingType = (int?)evenementAlarme.TypeSonnerie;
            m_bCommut = evenementAlarme.EstPositionCommutateur;

            for (int i = 0; evenementAlarme.ServicesConcernes != null &&
                 i < evenementAlarme.ServicesConcernes.Length; i++)
            {
                CInfoServiceAlarmeAffichee service = new CInfoServiceAlarmeAffichee();
                service.Name     = evenementAlarme.ServicesConcernes[i];
                service.Id       = evenementAlarme.IdServicesConcernes[i];
                service.EtatOper = evenementAlarme.EtatServices[i];
                m_lstInfoServices.Add(service);
            }

            if (evenementAlarme.ClientsConcernes != null)
            {
                foreach (string strClient in evenementAlarme.ClientsConcernes)
                {
                    CInfoClientAlarmeAffichee client = new CInfoClientAlarmeAffichee();
                    client.Name = strClient;
                    m_lstInfoClients.Add(client);
                }
            }

            if (evenementAlarme.VariablesTrap != null)
            {
                foreach (string strVariableTrap in evenementAlarme.VariablesTrap)
                {
                    m_lstTrapInfo.Add(strVariableTrap);
                }
            }

            m_bLectureFaite = true;
        }
Пример #2
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;
            }
        }