//-----------------------------------------------------------------------------------------
        protected override void MyUpdateValeursCalculees()
        {
            CContexteEvaluationExpression ctx = CUtilControlesWnd.GetContexteEval(this, EditedElement);

            if (WndSchemaReseau.ElementFormula != null)
            {
                CResultAErreur resultExpression = WndSchemaReseau.ElementFormula.Eval(ctx);
                if (resultExpression)
                {
                    // Schema de réseau
                    CSchemaReseau schema = resultExpression.Data as CSchemaReseau;
                    if (schema != null)
                    {
                        // Init ici
                        m_controleSchemaReseau.Init(schema.GetSchema(false), schema);
                        m_controleSchemaReseau.LockEdition = true;
                        m_controleSchemaReseau.ModeEdition = EModeEditeurSchema.Selection;
                    }
                }
            }

            if (WndSchemaReseau.DynamicNetworkViewFormula != null)
            {
                CResultAErreur resultExpression = WndSchemaReseau.DynamicNetworkViewFormula.Eval(ctx);
                if (resultExpression)
                {
                    // Parametre de vue dynamique
                    CParametreVueSchemaDynamique parametre = resultExpression.Data as CParametreVueSchemaDynamique;
                    if (parametre != null)
                    {
                        m_controleSchemaReseau.ParametreDynamique = parametre.ParametreRepresentation;
                    }
                }
            }
        }
示例#2
0
        //-----------------------------
        public void Home()
        {
            if (m_stackCheminsReseau.Count == 1)
            {
                return;
            }
            while (m_stackCheminsReseau.Count > 1)
            {
                m_stackCheminsReseau.Pop();
            }
            CSchemaReseau schema = m_stackCheminsReseau.Peek();

            m_dessinDeSchema = schema.GetSchema(false);
            SetSelection(null);
            RedrawSchema();
        }
示例#3
0
        //-----------------------------
        public bool DrillDown(IElementDeSchemaReseau eltDeSchema)
        {
            CSchemaReseau schema = eltDeSchema as CSchemaReseau;

            if (schema == null)
            {
                CLienReseau lien = eltDeSchema as CLienReseau;
                if (lien != null)
                {
                    schema = lien.SchemaReseau;
                }
            }
            if (schema == null)
            {
                CSite site = eltDeSchema as CSite;
                if (site != null)
                {
                    //S'il y a un cablage, affiche le cablage
                    foreach (CSchemaReseau sousSchema in SchemaAffiche.SchemaFils)
                    {
                        if (site.Equals(sousSchema.SiteApparenance))
                        {
                            schema = sousSchema;
                            break;
                        }
                    }
                }
            }

            if (schema != null)
            {
                m_stackCheminsReseau.Push(schema);
                m_dessinDeSchema = schema.GetSchema(false);
                SetSelection(null);
                RedrawSchema();
                UpdateTraitementSNMP();
                if (OnChangeSchemaAffiche != null)
                {
                    OnChangeSchemaAffiche(this, new EventArgs());
                }
                SnmpUpdate();
                return(true);
            }
            return(false);
        }
示例#4
0
 public void Init(CSchemaReseau schemaReseau, CBasePourVueAnimee basePourVue, CFormNavigateur navigateur)
 {
     m_baseVue = basePourVue;
     m_baseVue.RefreshVueSupervision = new RefreshVueSupervisionDelegate(RefreshVueSupervision);
     m_baseVue.AfterLoadElement      = new CBasePourVueAnimee.AfterLoadElementDelegate(AfterLoadElement);
     m_navigateur        = navigateur;
     m_schemaReseau      = schemaReseau;
     m_nNbElementsToLoad = m_schemaReseau.ElementsDeSchema.Count;
     m_stackCheminsReseau.Clear();
     m_stackCheminsReseau.Push(m_schemaReseau);
     if (schemaReseau == null)
     {
         m_dessinDeSchema = null;
         return;
     }
     m_dessinDeSchema = schemaReseau.GetSchema(false);
     RedrawSchema();
 }
示例#5
0
        //-----------------------------
        public bool DrillUp()
        {
            if (m_stackCheminsReseau.Count > 1)
            {
                m_stackCheminsReseau.Pop();
                CSchemaReseau schema = m_stackCheminsReseau.Peek();
                m_dessinDeSchema = schema.GetSchema(false);
                SetSelection(null);
                RedrawSchema();
                if (OnChangeSchemaAffiche != null)
                {
                    OnChangeSchemaAffiche(this, new EventArgs());
                }

                return(true);
            }
            return(false);
        }
示例#6
0
        public CSchemaReseau GetSchemaReseauCreateIfNull()
        {
            CSchemaReseau schema = SchemaReseau;

            if (schema != null)
            {
                if (schema.Libelle == "")
                {
                    schema.Libelle = Libelle;
                }
                return(schema);
            }
            schema = new CSchemaReseau(ContexteDonnee);
            schema.CreateNewInCurrentContexte();
            schema.LienReseau = this;
            schema.Libelle    = Libelle;
            if (schema.GetSchema(true) == null)
            {
                schema.SetSchema(new C2iSchemaReseau(schema));
            }


            return(schema);
        }
示例#7
0
        public C2iSchemaReseau GetSchemaReseauADessiner(bool bCreationAutorisee)
        {
            C2iSchemaReseau schemaADessiner;

            if (SchemaReseau != null)
            {
                if (SchemaReseau.GetSchema(bCreationAutorisee) != null)
                {
                    schemaADessiner = SchemaReseau.GetSchema(bCreationAutorisee);
                }
                else
                {
                    schemaADessiner = new C2iSchemaReseau(SchemaReseau);
                }
            }
            else if (bCreationAutorisee)
            {
                CSchemaReseau schema = GetSchemaReseauCreateIfNull();
                schema.CreateNewInCurrentContexte();
                schema.LienReseau = this;
                schema.Libelle    = this.Libelle;

                schemaADessiner = schema.GetSchema(bCreationAutorisee);
            }
            else
            {
                return(null);
            }

            bool bFindObjet1 = false;
            bool bFindObjet2 = false;

            foreach (C2iObjetDeSchema objet in schemaADessiner.Childs)
            {
                if (objet.ElementDeSchema != null && objet.ElementDeSchema.ElementAssocie != null)
                {
                    if (objet.ElementDeSchema.ElementAssocie.Equals(Element1))
                    {
                        bFindObjet1 = true;
                    }

                    if (objet.ElementDeSchema.ElementAssocie.Equals(Element2))
                    {
                        bFindObjet2 = true;
                    }
                }
            }

            if (!bFindObjet1 && Element1 != null)
            {
                CElementDeSchemaReseau elt1 = new CElementDeSchemaReseau(ContexteDonnee);
                elt1.CreateNewInCurrentContexte();
                elt1.SchemaReseau   = SchemaReseau;
                elt1.ElementAssocie = Element1;
                C2iObjetDeSchema objet1 = elt1.ObjetDeSchema;
                schemaADessiner.AddChild(objet1);
                objet1.Parent   = schemaADessiner;
                objet1.Position = new Point(10, 10);
                elt1.X          = objet1.Position.X;
                elt1.Y          = objet1.Position.Y;
            }

            if (!bFindObjet2 && Element2 != null)
            {
                CElementDeSchemaReseau elt2 = new CElementDeSchemaReseau(ContexteDonnee);
                elt2.CreateNewInCurrentContexte();
                elt2.SchemaReseau   = SchemaReseau;
                elt2.ElementAssocie = Element2;
                C2iObjetDeSchema objet2 = elt2.ObjetDeSchema;
                schemaADessiner.AddChild(objet2);
                objet2.Parent   = schemaADessiner;
                objet2.Position = new Point(10, 400);
                elt2.X          = objet2.Position.X;
                elt2.Y          = objet2.Position.Y;
            }

            C2iLienDeSchemaReseauNoDelete lienGraphiqueEdite = new C2iLienDeSchemaReseauNoDelete();

            lienGraphiqueEdite.LienReseau = this;
            schemaADessiner.AddChild(lienGraphiqueEdite);
            lienGraphiqueEdite.Parent = schemaADessiner;
            schemaADessiner.FrontToBack(lienGraphiqueEdite);



            return(schemaADessiner);
        }