Exemplo n.º 1
0
 void UpdateHistogramValues(Histogram histogram, CurveItem values)
 {
     values.Clear();
     for (int i = 0; i < 256; i++)
     {
         values.AddPoint(i, histogram.QueryValue(i));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Handle our reset button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnReset_Click(object sender, EventArgs e)
 {
     BaseValue = 0;
     LastTime  = default(DateTime);
     foreach (MM_Element Elem in Elements)
     {
         float CurVal = FieldToCheck != null ? (float)FieldToCheck.GetValue(Elem) : (float)PropertyToCheck.GetValue(Elem);
         if (!float.IsNaN(CurVal))
         {
             BaseValue += CurVal;
         }
     }
     lblBaseValue.Text       = BaseValue.ToString(NumberFormat);
     lblDeltaValue.Text      = (0).ToString(NumberFormat);
     lblDeltaValue.ForeColor = Color.White;
     TrackingCurve.Clear();
     tmrUpdate_Tick(tmrUpdate, EventArgs.Empty);
 }
Exemplo n.º 3
0
        private void btnSimBaslat_Click(object sender, EventArgs e)
        {
            InitFuzzySystem();
            LinguisticVariable aci;
            LinguisticVariable hiz;
            double             a = double.Parse(txtIlkAci.Text);
            double             v = double.Parse(textBox2.Text);
            double             m = 0;

            aci = fengine.LinguisticVariableCollection[0];
            hiz = fengine.LinguisticVariableCollection[1];

            aci.InputValue = a;
            hiz.InputValue = v;
            string s;

            listBox1.Items.Clear();
            //


            aciliste.Clear();
            hizliste.Clear();
            momentliste.Clear();
            if (notfirst)
            {
                aciEgrisi.Clear();
                hizEgrisi.Clear();
                momentEgrisi.Clear();
            }
            else
            {
                notfirst     = true;
                aciEgrisi    = zedGraphControl1.GraphPane.AddCurve("AÇI", aciliste, Color.Green, SymbolType.Diamond);
                hizEgrisi    = zedGraphControl1.GraphPane.AddCurve("HIZ", hizliste, Color.Blue, SymbolType.Diamond);
                momentEgrisi = zedGraphControl1.GraphPane.AddCurve("MOMENTUM", momentliste, Color.Red, SymbolType.Diamond);
            }

            aciliste.Add(0, a);
            hizliste.Add(0, v);
            momentliste.Add(0, m);


            for (int i = 1; i < 20; i++)
            {
                try
                {
                    m = fengine.Defuzzify();
                    s = String.Format("AÇI : {0:f2} \t HIZ : {1:f2} \t MOMENT : {2:f2}", a, v, m);

                    aciliste.Add(i, a);
                    hizliste.Add(i, v);
                    momentliste.Add(i, m);
                    listBox1.Items.Add(s);
                    aci.InputValue = a + v;
                    hiz.InputValue = a + v - m;
                    a = aci.InputValue;
                    v = hiz.InputValue;



                    zedGraphControl1.Refresh();
                    zedGraphControl1.AxisChange();
                    zedGraphControl1.Refresh();
                }
                catch (Exception hata)
                {
                    MessageBox.Show(hata.ToString());
                }
            }
        }