Exemplo n.º 1
0
        private int Init_objet_dépassement_seuil(int xpos, int xpos2, int xpos3, int xpos4, int ypos)
        {
            this.L_titre_détection_dépassement_seuil = new LLabel("L_titre_détection_dépassement_seuil", xpos, ypos + 3, "Détection dépassement seuil")
            {
                Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)))
            };
            ypos += 21;
            string type = "max";

            for (int i = 0; i < 8; i++)
            {
                this.Li_L_détection_valeur.Add(this.Init_label_dépassement_seuil(xpos, ypos + 3, type, "Valeur " + type + " CAN ", i));
                this.Li_détection_valeur.Add(this.Init_textbox(xpos2, ypos));
                this.Li_détection_valeur_10bits.Add(this.Init_textbox10bits(xpos3, ypos));
                this.Li_détection_valeur_validé.Add(Init_checkbox_dépassement_seuil(xpos4, ypos, "Activer limite"));
                ypos += 21;
                if (type == "max")
                {
                    type = "min";
                }
                else
                {
                    type = "max";
                }
            }
            return(ypos);
        }
Exemplo n.º 2
0
        private void Init_Textbox_et_label(int xpos, int ypos)
        {
            int xpos2 = xpos + 124;
            int xpos3 = xpos + 165;
            int xpos4 = xpos + 210;
            int lypos = 3;

            this.L_titre_étalonnage = new LLabel("L_titre_étalonnage", xpos, ypos + lypos, "Étalonnage")
            {
                Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)))
            };
            this.L_entete_Mesure = new LLabel("L_entete_Mesure", xpos2, ypos + lypos, "Valeurs");
            this.L_entete_10Bits = new LLabel("L_entete_10Bits", xpos3, ypos + lypos, "10Bits");
            ypos += 21;
            this.L_valeur_étatlonage_max         = new LLabel("L_valeur_étatlonage_max", xpos, ypos + lypos, "Max possible en entrée :");
            this.Tb_valeur_étalonnage_max        = new TTextBox("tb_valeur_étalonnage_max", xpos2, ypos, "30");
            this.Tb_valeur_étalonnage_max_10bits = new TTextBox("tb_valeur_étalonnage_max_10bits", xpos3, ypos, "1023", 0, 1023, 1);
            ypos += 21;
            this.L_valeur_étatlonage_min         = new LLabel("L_valeur_étatlonage_min", xpos, ypos + lypos, "min possible en entrée :");
            this.Tb_valeur_étalonnage_min        = new TTextBox("Tb_valeur_étalonnage_min", xpos2, ypos, "-30");
            this.Tb_valeur_étalonnage_min_10bits = new TTextBox("Tb_valeur_étalonnage_min_10bits", xpos3, ypos, "0", 0, 1023, 1);
            ypos += 21;
            ypos  = this.Init_objet_dépassement_seuil(xpos, xpos2, xpos3, xpos4, ypos);
            ypos  = this.Init_objet_mesure(xpos, xpos2, xpos3, xpos4, ypos);

            this.L_can_quantum = new LLabel("L_can_quantum", xpos, ypos, "TODO");
        }
Exemplo n.º 3
0
        private void Init_Textbox_et_label(int xpos, int ypos)
        {
            int lxpos = 6;
            int lypos = 3;


            this.Chb_Rouecodeuse = new CCheckBox("Chb_Rouecodeuse", lxpos, ypos, false, "Utiliser roue codeuse pour temps mort");
            ypos           += 21;
            this.Tb_tpsmort = new TTextBox("Tb_tpsmort", xpos, ypos, "100", 0, 2555, 5);
            this.L_tpsmort  = new LLabel("L_Pulse_t_1", lxpos, ypos + lypos, "Temps mort par pas de 5ns :                  ns");
            ypos           += 21;
            this.L_Nbbras   = new LLabel("L_Nbbras", lxpos, ypos + lypos, "Nombre de bras actifs :");
            this.Tb_Nbbras  = new TTextBox("Tb_Nbbras", xpos, ypos, "2", 0, 4, 1)
            {
                Enabled = false
            };
        }
Exemplo n.º 4
0
 private int Init_objet_mesure(int xpos, int xpos2, int xpos3, int xpos4, int ypos)
 {
     this.L_titre_mesure = new LLabel("L_titre_mesure", xpos, ypos + 3, "Mesure")
     {
         Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)))
     };
     ypos += 21;
     for (int i = 0; i < 4; i++)
     {
         this.Li_L_mesure.Add(this.Init_label_dépassement_seuil(xpos, ypos + 3, "max", "Valeur max CAN ", i));
         this.Li_mesure.Add(this.Init_textbox(xpos2, ypos));
         this.Li_mesure_10bits.Add(this.Init_textbox10bits(xpos3, ypos));
         this.Li_mesure_activé.Add(Init_checkbox_dépassement_seuil(xpos4, ypos, "CAN activé"));
         ypos += 21;
     }
     return(ypos);
 }
Exemplo n.º 5
0
        private void Init_Label_et_Textbox(int xpos, int ypos)
        {
            int lxpos = 2;
            int lypos = 3;
            int xpos2 = xpos + 46;

            this.L_10bits = new LLabel("L_10bits", lxpos + xpos, ypos, "10Bits");
            this.L_pour   = new LLabel("L_pour", lxpos + xpos2, ypos, "En %");
            ypos         += 21;

            this.Cmb_type_consigne = new CComboBox("Cmb_type_consigne", xpos - 100, ypos - 2, 91,
                                                   new List <string>()
            {
                "continue ===>", "Sinus FPGA", "extérieur"
            }, 0);
            this.Tb_consigne = new TTextBox("Tb_consigne", xpos, ypos, "512", 0, 1023, 1);
            this.Tb_con_pour = new TTextBox("Tb_con_pour", xpos2, ypos, "50", 0, 100, 0.1);

            lxpos                = 30;
            ypos                += 21;
            this.L_con_max       = new LLabel("L_con_max", lxpos, ypos + lypos, "Consigne max");
            this.Tb_con_max      = new TTextBox("Tb_con_max", xpos, ypos, "972", 0, 1023, 1);
            this.Tb_con_max_pour = new TTextBox("Tb_con_max_pour", xpos2, ypos, "95", 0, 100, 0.1);

            lxpos                = 30;
            ypos                += 21;
            this.L_con_min       = new LLabel("L_con_min", lxpos, ypos + lypos, "Consigne min");
            this.Tb_con_min      = new TTextBox("Tb_con_min", xpos, ypos, "51", 0, 1023, 1);
            this.Tb_con_min_pour = new TTextBox("Tb_con_min_pour", xpos2, ypos, "5", 0, 100, 0.1);
            lxpos                = 6;
            xpos                += -4;
            ypos                += 26;
            this.L_consigne_CAN  = new LLabel("L_consigne_CAN", lxpos, ypos + lypos, "Consigne d'origine :")
            {
                Visible = false
            };
            this.Cmb_consigne_CAN = new CComboBox("Cmb_type_consigne", xpos, ypos, 91,
                                                  new List <string>()
            {
                "CAN1", "CAN2", "CAN3", "CAN4"
            }, 0)
            {
                Visible = false
            };
        }
Exemplo n.º 6
0
        private void Init_Textbox_et_label(int xpos, int ypos)
        {
            int lxpos = 6;
            int lypos = 3;

            this.L_diviseur           = new LLabel("L_diviseur", lxpos, ypos + lypos, "Diviseur de fréquence :");
            this.Tb_freq_div          = new TTextBox("Tb_freq_div", xpos, ypos, "1", 1, 1023, 1);
            ypos                     += 21;
            this.L_freq_countmax      = new LLabel("L_freq_countmax", lxpos, ypos + lypos, "Valeur max des triangles :");
            this.Tb_freq_countmax     = new TTextBox("Tb_freq_countmax", xpos, ypos, "1023", 16, 1023, 1);
            ypos                     += 21;
            this.L_frequencedecoupage = new LLabel("L_frequencedecoupage", lxpos, ypos + lypos, "Fréquence de découpage :                 kHz");
            this.Tb_fdec              = new TTextBox("Tb_fdec", xpos, ypos, "97,75")
            {
                Enabled = false
            };
            ypos += 21;
            this.L_exp_calcul = new LLabel("L_exp_calcul", lxpos, ypos + lypos, "Fdec = 100MHz / trianglemax  / Diviseur");
        }
Exemplo n.º 7
0
        private void Init_Textbox_et_label(int xpos, int ypos)
        {
            int lxpos = 50;
            int lypos = 3;

            this.Tb_db_T_Pulse1 = new TTextBox("Tb_db_T_Pulse1", xpos, ypos, "4,5", 0.1, 102.3, 0.1);
            this.L_Pulse_t_1    = new LLabel("L_Pulse_t_1", lxpos, ypos + lypos, "µs T1 : Durée de la première impulsion");
            ypos += 21;
            this.Tb_db_T_Pulse2 = new TTextBox("Tb_db_T_Pulse2", xpos, ypos, "7,5", 0.1, 102.3, 0.1);
            this.L_Pulse_t_2    = new LLabel("L_Pulse_t_2", lxpos, ypos + lypos, "µs T2 : Durée du temps de repos");
            ypos += 21;
            this.Tb_db_T_Pulse3 = new TTextBox("Tb_db_T_Pulse3", xpos, ypos, "0,9", 0.1, 102.3, 0.1);
            this.L_Pulse_t_3    = new LLabel("L_Pulse_t_3", lxpos, ypos + lypos, "µs T3 : Durée de la seconde impulsion");
            ypos += 21;
            this.Cmb_Choix_DP_Transistor = new CComboBox("Cmb_Choix_DP_Transistor", xpos, ypos, 116, new List <string>()
            {
                "Bas", "Haut"
            }, 0);
            this.L_choix_dp_transistor = new LLabel("L_choix_dp_transistor", lxpos + 76, ypos + lypos, "Choix du transistor affecté");
            ypos           += 21;
            this.Tb_bras_DP = new TTextBox("Tb_bras_DP", xpos, ypos, "1", 1, 4, 1);
            this.L_chx_dp   = new LLabel("L_chx_dp", lxpos, ypos + lypos, "Choix du bras testé");
        }
Exemplo n.º 8
0
        /// <summary>
        /// Initialise les textbox et les label
        /// </summary>
        /// <param name="xpos">position en x</param>
        /// <param name="ypos">position en y</param>
        private void Init_Textbox_et_label(int xpos, int ypos)
        {
            int lxpos    = 10;
            int lypos    = 3;
            int Tb_xpos2 = xpos + 42;

            this.L_valtri             = new LLabel("L_valtri", lxpos, ypos + lypos, "Valeur initiale du triangle");
            ypos                     += 21;
            this.L_l0bits             = new LLabel("L_l0bits", xpos, ypos + lypos, "10Bits");
            this.L_enpour             = new LLabel("L_enpour", Tb_xpos2, ypos + lypos, "En %");
            ypos                     += 21;
            this.L_départ             = new LLabel("L_départ", lxpos, ypos + lypos, "Départ");
            this.Tb_val_tri_init      = new TTextBox("Tb_tri", xpos, ypos, "512", 0, 1023, 1);
            this.Tb_val_tri_init_Pour = new TTextBox("Tb_tri_pour", Tb_xpos2, ypos, "50", 0, 100, 0.1);
            ypos                     += 21;
            this.L_limite             = new LLabel("L_limite", xpos, ypos + lypos, "Limite");
            ypos                     += 21;
            this.L_max_bras           = new LLabel("L_max_bras", lxpos, ypos + lypos, "Max :");
            this.Tb_multinivmax       = new TTextBox("Tb_multinivmax", xpos, ypos, "1023", 0, 1023, 1);
            this.Tb_multinivmax_Pour  = new TTextBox("Tb_multinivmax_Pour", Tb_xpos2, ypos, "100", 0, 100, 0.1);
            ypos                     += 21;
            this.L_min_bras           = new LLabel("L_min_bras", lxpos, ypos + lypos, "Min :");
            this.Tb_multinivmin       = new TTextBox("Tb_multinivmin", xpos, ypos, "0", 0, 1023, 1);
            this.Tb_multinivmin_Pour  = new TTextBox("Tb_multinivmin_Pour", Tb_xpos2, ypos, "0", 0, 100, 0.1);
            ypos                     += 21;
            this.Chb_inv_bras         = new CCheckBox("Chb_inv_bras", lxpos, ypos, false, "inversion bras haut-bas", false);
            ypos                     += 21;
            this.Cmb_sens_tri         = new CComboBox("cmb_tri", lxpos, ypos, 116, new List <string>()
            {
                "Monté", "Descente"
            }, 0);
            ypos += 21;
            this.Cmb_cons_Bras = new CComboBox("Cmb_cons_Bras", lxpos, ypos, 116, new List <string>()
            {
                "Consigne 1", "Consigne 2"
            }, 0, false);
        }
Exemplo n.º 9
0
        private void Label_box_LostFocus(object sender, RoutedEventArgs e)
        {
            var editingObj = _graphViewer.LayoutEditor.EditingObject;

            if (editingObj == null)
            {
                return;
            }
            var obj = editingObj.DrawingObject as DrawingObject2;

            if (obj == null)
            {
                return;
            }

            if (obj.Label == null)
            {
                if (label_box.Text == "")
                {
                    return;
                }
            }
            else if (obj.Label.Text == label_box.Text)
            {
                return;
            }

            var node = obj as Node;

            if (node != null)
            {
                _graphViewer.updateVNodeLabelText(editingObj as VNode, label_box.Text);
                //var sz = Common.MeasureLabel(label);
                //node.GeometryNode.BoundaryCurve = NodeBoundaryCurves.GetNodeBoundaryCurve(node,sz.Width,sz.Height );
                //(editingObj as VNode).Invalidate();
            }
            else
            {
                var edge = obj as Edge;
                if (edge == null)
                {
                    return;
                }
                var vedge = editingObj as VEdge;
                var label = edge.Label;
                if (label == null)
                {
                    label       = new DrawingLabel(label_box.Text);
                    edge.Label  = label;
                    label.Owner = edge;
                    //var sz = Common.MeasureLabel(label);
                    //edge.GeometryEdge.Label = new Microsoft.Msagl.Core.Layout.Label(sz.Width, sz.Height, edge.GeometryEdge);
                    var llabel = new LLabel();
                    edge.GeometryEdge.Label = llabel;
                    llabel.GeometryParent   = edge.GeometryEdge;
                    label.GeometryLabel     = llabel;

                    //edge.GeometryEdge.Label.UserData = edge.Label;
                    //var fe = _graphViewer.CreateDefaultFrameworkElementForDrawingObject(edge);
                    //var vlabel = new VLabel(edge, fe);
                    //fe.Tag = vlabel;
                    //(editingObj as VEdge).VLabel = vlabel;

                    _graphViewer.SetVEdgeLabel(edge, vedge, _graphViewer.ZIndexOfEdge(edge));
                    _graphViewer.LayoutEditor.AttachLayoutChangeEvent(vedge.VLabel);
                }
                else
                {
                    label.Text = label_box.Text;
                    var textBlock = _graphViewer.drawingObjectsToFrameworkElements[edge] as TextBlock;
                    textBlock.Text = label.Text;
                    //textBlock.InvalidateMeasure();
                    textBlock.Width = Double.NaN;
                    textBlock.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                    textBlock.Width = textBlock.DesiredSize.Width;
                    //textBlock.Height = textBlock.DesiredSize.Height;
                    //label.GeometryLabel.Width
                }
                //var vedge = _graphViewer.GetIViewerObject(edge) as VEdge;
                //_graphViewer.SetVEdgeLabel(edge, vedge, _graphViewer.ZIndexOfEdge(edge));
                _graphViewer.AssignLabelWidthHeight(edge.GeometryEdge, edge);
                //_graphViewer.LayoutEditor.AttachLayoutChangeEvent(vedge.VLabel);

                //var labelCol = new List<LLabel>();
                //labelCol.Add(label.GeometryLabel);
                //EdgeLabelPlacement lp = new EdgeLabelPlacement(_graphViewer.Graph.GeometryGraph,labelCol);//,label.GeometryLabel)
                //var lp=new EdgeLabelPlacement(_graphViewer.Graph.GeometryGraph, new List<LLabel> { label.GeometryLabel});
                var lp = new EdgeLabelPlacement(_graphViewer.Graph.GeometryGraph, new [] { label.GeometryLabel });
                lp.Run();
                vedge.Invalidate();
                //edge.LabelText = label_box.Text;
                //var vedge = _graphViewer.GetIViewerObject(edge) as VEdge;
                //_graphViewer.SetVEdgeLabel(edge, vedge, _graphViewer.ZIndexOfEdge(edge));
                //vedge.Invalidate();
            }


            //if (label.Text == label_box.Text)
            //    return;
            //label.Text = label_box.Text;
            //obj.Label = label;
        }