- UID
- 783
- 帖子
- 529
- 主題
- 64
- 精華
- 3
- 積分
- 270
- 楓幣
- 10242
- 威望
- 186
- 存款
- 0
- 贊助金額
- 0
- 推廣
- 0
- GP
- 0
- 閱讀權限
- 30
- 性別
- 保密
- 在線時間
- 488 小時
- 註冊時間
- 2011-12-24
- 最後登入
- 2015-12-7
|
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.windows.Forms;
- namespace FuzzyLogicUI
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- if (FuzzyApp.InputVariables.Count > 0)
- {
- variable1.Current = FuzzyApp.InputVariables[0];
- variable1.Populate();
- populateVariables();
- }
- reloadStrip();
- configurationUI1.loadData();
- }
- private void reloadStrip()
- {
- toolStripStatusLabel1.Text = "Inputs : " + FuzzyApp.InputVariables.Count.ToString();
- toolStripStatusLabel2.Text = "Outputs : " + FuzzyApp.OutputVariables.Count.ToString();
- toolStripStatusLabel3.Text = "Rules : " + FuzzyApp.Rules.Count.ToString();
- }
- private void populateVariables()
- {
- for (int i = 0; i < FuzzyApp.InputVariables.Count; i++)
- {
- if (InputView.Items.ContainsKey(FuzzyApp.InputVariables[i].Name) == false)
- {
- InputView.Items.Add(FuzzyApp.InputVariables[i].Name, FuzzyApp.InputVariables[i].Name, 1);
- }
- }
- for (int i = 0; i < FuzzyApp.OutputVariables.Count; i++)
- {
- if (OutputView.Items.ContainsKey(FuzzyApp.OutputVariables[i].Name) == false)
- {
- OutputView.Items.Add(FuzzyApp.OutputVariables[i].Name, FuzzyApp.OutputVariables[i].Name, 1);
- }
- }
- }
- private void AddVariable_Click(object sender, EventArgs e)
- {
- NewVariable var = new NewVariable();
- var.ParentTab = InOutTabs;
- var.ShowDialog();
- populateVariables();
- }
- private void InputView_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (InputView.SelectedIndices.Count > 0)
- {
- int index = InputView.SelectedIndices[0];
- variable1.ClearVariable();
- variable1.Current = FuzzyApp.InputVariables[index];
- variable1.Populate();
- }
- }
- private void OutputView_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (OutputView.SelectedIndices.Count > 0)
- {
- int index = OutputView.SelectedIndices[0];
- variable1.ClearVariable();
- variable1.Current = FuzzyApp.OutputVariables[index];
- variable1.Populate();
- }
- }
- private void MainPanel_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (MainPanel.SelectedTab.Text.Equals("Rules"))
- {
- rule1.loadVariables();
- rule1.loadRules();
- }
複製代碼 以上是程式碼
我需要的是好比說像開始頭是定義所需的指示詞為那些蛙歌=ˇ=++
然而簡單來講就是能解釋這個程式碼裡頭的東西XD
麻煩各位大大=ˋ= |
|