⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ruleitemui.cs

📁 Fuzzy logic controller that uses mamdani logic.
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using FuzzyLogicController;
using FuzzyLogicController.RuleEngine;


namespace FuzzyLogicUI.Controls
{
    public partial class RuleItemUI : UserControl
    {
        private LingVariable _current;
        private RuleItem _item;

        public RuleItemUI(String var,InOutType Type)
        {
            this.Name = var;
            InitializeComponent();

            if (Type == InOutType.In) {  _current = FuzzyApp.getVariablebyName(FuzzyApp.InputVariables, var); }
           else { _current = FuzzyApp.getVariablebyName(FuzzyApp.OutputVariables, var); }

            VarText.Text = _current.Name;
            this.Name = var;
            MFCombo.DataSource = _current.MFs;
            MFCombo.ValueMember = "Name";
            MFCombo.DisplayMember = "Name";
            MFCombo.SelectedValue = ((FuzzyLogicController.MFs.MemberShipFunction)MFCombo.Items[0]).Name;

            _item = new RuleItem(_current.Name, (String)MFCombo.SelectedValue);
          
        }

        public RuleItem RuleItem
        {
            get
            {
                _item = new RuleItem(VarText.Text,(String)MFCombo.SelectedValue);
                return _item;
            }
        }

        private void closeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

    }

    public enum InOutType
    {
        In = 0, Out=1
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -