class: Form1

public class: Form1
Author: Lukáš Civín
Project: Phase: 1.0; Status: Proposed; Version: 1.0; Complexity: 1
Dates: Created: 15.12.2005 0:19:43; Modified: 15.12.2005 0:19:43;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {1EE57A38-2B86-4388-BC7A-7A2FA519C93E}
Summary description for Form1 - main window of this module.

 

Goto: Fields, Methods

Extends: CommonWindow

See also: BP_network, BP_net_list, BP_Visualiss, CommonWindow

Appears in: Classes of module

Connections
 
Form1 Attributes
Attribute Details
private System.Data.DataSet
  dataSet1
Notes: feeding dataGrid1

private System.Data.DataTable
  LayersNet
Notes: numbers of nodes of layers network

private BP_network
  NN
Notes: current selected network

private BP_net_list
  NN_list
Notes: Entry point to the list of networks

private ArrayList
  InputColumns
Notes: Arraylist of numbers of input columns

private ArrayList
  OutputColumns
Notes: Arraylist of numbers of output columns

private ArrayList
  ClassOutputColumns
Notes: Arraylist of numbers of output columns for classification (preparation for a new version)

private System.Windows.Forms.ListBox
  listBox1
Notes: Listbox with networks as items - for users information

private System.Windows.Forms.Label
  label1
Notes: Informations about selected network

private DMTransformStruct.DBDataAdmin
  db
Notes: Central point do db

private DMTransformStruct.OneTransform
  ot
Notes: Module information

private DMTransformStruct.Version
  ver
Notes: Current selected version of data

private System.Data.DataColumn
  dataColumn1
private System.Windows.Forms.MainMenu
  mainMenu1
private System.Windows.Forms.MenuItem
  menuItem1
private System.Windows.Forms.MenuItem
  MI_GetVersion
private System.Windows.Forms.MenuItem
  BPNet
private System.Windows.Forms.MenuItem
  MI_NewNet
private System.Windows.Forms.MenuItem
  MI_Learn
private System.Windows.Forms.MenuItem
  MI_Classify
private System.Windows.Forms.MenuItem
  menuItem3
private System.Windows.Forms.MenuItem
  MI_LoadNetwork
private System.Windows.Forms.MenuItem
  MI_SaveNetwork
private System.Windows.Forms.MenuItem
  menuItem2
private System.Windows.Forms.MenuItem
  MI_Delete
private System.Windows.Forms.MenuItem
  MI_Update
private System.Windows.Forms.MenuItem
  menuItem4
private System.Windows.Forms.MenuItem
  MI_InputCol
private System.Windows.Forms.MenuItem
  MI_OutputCol
private System.Windows.Forms.ProgressBar
  ProgressB
private System.Windows.Forms.SaveFileDialog
  DlgSaveNet
private System.Windows.Forms.OpenFileDialog
  DlgOpenNet
private System.Windows.Forms.ToolBar
  toolBar1
private System.Windows.Forms.ToolBarButton
  B_Learn
private System.Windows.Forms.ImageList
  imageList1
private System.Windows.Forms.ToolBarButton
  B_Separ2
private System.Windows.Forms.ToolBarButton
  B_NewNet
private System.Windows.Forms.ToolBarButton
  B_SaveNet
private System.Windows.Forms.ToolBarButton
  B_LoadNet
private System.Windows.Forms.ToolBarButton
  B_StepTrain
private System.Windows.Forms.MenuItem
  menuItem6
private System.Windows.Forms.MenuItem
  MI_StepLearn
private System.ComponentModel.IContainer
  components
private System.Windows.Forms.MenuItem
  menuItem5
private System.Windows.Forms.ToolBarButton
  B_Separ1
private System.Windows.Forms.ToolBarButton
  B_Visul
private System.Windows.Forms.MenuItem
  MI_Visualiss
private System.Windows.Forms.MenuItem
  MI_ErrorVisul
private System.Windows.Forms.ToolBarButton
  B_CancelTrain
private System.Windows.Forms.MenuItem
  MI_CancelTrain
private GuiExt.DataGridEx
  dataGrid1
private BP_Visualiss
  visul
Notes: Window for visualization

private bool
  CanTrain
Notes: IF training can start

private Thread
  TrainingThread
Notes: thread used for training network

private ManualResetEvent
  m_EventStopThread
Notes: events used to stop training thread

private ManualResetEvent
  m_EventThreadStopped
public DelegateUpdateError
  m_DelegateUpdateError
Notes: Delegate instances used to call user interface functions from training thread:

private System.Windows.Forms.Label
  L_err
private System.Windows.Forms.Label
  L_steps
public DelegateThreadFinished
  m_DelegateThreadFinished
Notes: Delegate instances used to call user interface functions from training thread:

 
Form1 Methods
Operation Details
public
Form1(
   DBDataAdmin dbAd,
   DMTransformStruct.OneTransform Ot):
Sequential
Notes: A constructor of main Form - has no network and from dbadmin creates new version inside
protected
Dispose(
   bool disposing):void
Sequential
Tags: override=true
Notes: Clean up any resources being used.
private
InitializeComponent():void
Sequential
Notes: Required method for Designer support - do not modify the contents of this method with the code editor.
public
CreateNet(
   double learnPar,
   double learnMom,
   double initThreshold,
   double initWeights,
   long timeout,
   int cycle,
   double minErr,
   double Slope,
   int iter):BP_network
Sequential
Notes: Creates the BP_net with given parameters and this net is Active

@param ="laernPar" Learning parameter
public
AttachNetwork(
   BP_network net):void
Sequential
Notes: Attach the network to the list of networks and set this as current used network
public
VisulNet():void
Sequential
Notes: To visualise the net after creating
private
FillDataGrid():void
Sequential
Notes: fills datagrid with actual data
private
MI_NewNet_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: New network Will show the dialog to make a new BP_network and then construct it by its parameters.
public
CreateRowInt(
   DataTable tabl,
   int cislo):void
Sequential
Notes: Creates a table row with one Integer number
private
MI_SaveNetwork_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: saves the current net into the XML file
private
MI_LoadNetwork_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: loads the net from XML file
private
MI_Delete_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: delete the active(selected) net from memory
private
MI_Learn_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: the start of learning of the actual network
private
MI_GetVersion_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: get version from DBAdmin
private
MI_Update_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: Dialog to update update-able parameters of the net
private
MI_InputCol_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: Choose input columns for BP_network from the list (not all columns have to be used)
private
MI_OutputCol_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: Set output columns of the net
private
ChangeCols(
   ColumnsInfo ColsInfo,
   ArrayList arr,
   bool input):void
Sequential
Notes: Change the array ColumnsInfo (are the columns selected or not) by the information in array of numbers
private
GetColumns(
   ArrayList arr,
   ColumnsInfo ColsInfo):void
Sequential
Notes: Get the numbers of columns returned in selected array
private
ControlNet(
   BP_network Network):int
Sequential
Notes: Control the network against inputs and outputs
private
ControlNet(
   BP_network Network,
   ArrayList Input,
   ArrayList Output):int
Sequential
Notes: Control the network against given inputs and outputs

@returns
private
MI_Classify_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: Classification data with current network
private
OutputClassCols():ColumnsInfo
Sequential
Notes: Choose the columns for classification
public
NewTable(
   ColumnsInfo csi):DataSrc
Sequential
Notes: Creates a new data source according to given columns info

@returns Data Source
private
Classify(
   BP_network net,
   DataSrc targetSrc,
   bool round,
   string versName):void
Sequential
Notes: Classify the input through the BP network
private
ExistNet():bool
Sequential
Notes: checkes if there is selected network
private
toolBar1_ButtonClick(
   object sender,
   System.Windows.Forms.ToolBarButtonClickEventArgs e):void
Sequential
Notes: Binds clicking of button to menu item
private
MI_StepLearn_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: One training step - with current version
private
listBox1_SelectedIndexChanged(
   object sender,
   System.EventArgs e):void
Sequential
Notes: Function to choose a network from the list of created networks Also provides informations about selected network
private
ReturnFromList(
   int index):BP_network
Sequential
Notes: Finds a network from the list

@returns network that was looked for
private
PrintNet(
   int index):void
Sequential
Notes: Function to print informations about selected net
private
MI_Visualiss_Click(
   object sender,
   System.EventArgs e):void
Sequential
private
MI_ErrorVisul_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: shows window with error function of the network
private
Form1_Closing(
   object sender,
   System.ComponentModel.CancelEventArgs e):void
Sequential
Notes: before closing the form
private
Form1_Load(
   object sender,
   System.EventArgs e):void
Sequential
Notes: When main window opens, try to fill data Grid
private
MI_CancelTrain_Click(
   object sender,
   System.EventArgs e):void
Sequential
Notes: Stop the training
private
PrintError(
   ErrStep error):void
Sequential
Notes: Print changing information about network
private
ThreadFinished():void
Sequential
Notes: Called from train thread using delegate and Control.Invoke
private
TrainThreadFunction():void
Sequential