示例#1
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            LingVariable temp;

            if (TypeCombo.SelectedItem.Equals("Input"))
            {
                temp = new LingVariable(NameTxT.Text, VarType.Input);
                List <double> rang = FuzzyApp.tokString(RangeTxT.Text);
                temp.setRange(rang[0], rang[1]);
                double value = (rang[1] - rang[0]) * 0.5;
                temp.addMF(new Trimf("mf", rang[0], (rang[0] + value), rang[1]));
                FuzzyApp.InputVariables.Add(temp);
                ParentTab.SelectedTab = ParentTab.TabPages[0];
            }
            else
            {
                temp = new LingVariable(NameTxT.Text, VarType.Output);
                List <double> rang = FuzzyApp.tokString(RangeTxT.Text);
                temp.setRange(rang[0], rang[1]);
                double value = (rang[1] - rang[0]) * 0.5;
                temp.addMF(new Trimf("mf", rang[0], (rang[0] + value), rang[1]));
                FuzzyApp.OutputVariables.Add(temp);
                ParentTab.SelectedTab = ParentTab.TabPages[1];
            }
            this.Close();
        }
示例#2
0
 static void Main()
 {
     FuzzyApp.Initalize();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1());
 }
示例#3
0
 private void closeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FuzzyApp.Initalize();
     variable1.ClearVariable();
     InputView.Clear();
     OutputView.Clear();
     reultsUI1.loadVariables();
 }
示例#4
0
 private void test2ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FuzzyApp.Initalize();
     variable1.ClearVariable();
     InputView.Clear();
     OutputView.Clear();
     FuzzyApp.defaultSettings2();
     if (FuzzyApp.InputVariables.Count > 0)
     {
         variable1.Current = FuzzyApp.InputVariables[0];
         variable1.Populate();
         populateVariables();
     }
 }