Click here to Skip to main content
15,884,177 members
Articles / Programming Languages / Visual Basic

Mathemathics Framework

Rate me:
Please Sign up or sign in to vote.
4.76/5 (56 votes)
16 Sep 2008CPOL6 min read 75.3K   6.2K   171  
.NET Mathematical Framework
Imports System.Windows.Forms
Imports System.Drawing
Imports System.IO
Imports BV.Core
Imports BV.Math
Imports BV.Controls
Imports BV.TopLevel
Imports BV.TopLevel.Parsing
Imports BV.TopLevel.Laplace
Imports IMidRange
Imports GraphicsObjects
Imports MidRange
Imports SecundaryForms
Imports FormUtils
Imports GraphicsUtilities

'no usar pictureBox, ya que funciona mal el refresh del picturebox
Public Class Frm2DLaplaceDemo
    Inherits System.Windows.Forms.Form


#Region " C�digo generado por el Dise�ador de Windows Forms "

    Public Sub New()
        MyBase.New()

        'El Dise�ador de Windows Forms requiere esta llamada.
        InitializeComponent()
        'Agregar cualquier inicializaci�n despu�s de la llamada a InitializeComponent()
        Initialize()
    End Sub

    'Form reemplaza a Dispose para limpiar la lista de componentes.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Requerido por el Dise�ador de Windows Forms
    Private components As System.ComponentModel.IContainer

    'NOTA: el Dise�ador de Windows Forms requiere el siguiente procedimiento
    'Puede modificarse utilizando el Dise�ador de Windows Forms. 
    'No lo modifique con el editor de c�digo.    
    Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
    Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItemView As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItemEdit As System.Windows.Forms.MenuItem
    Friend WithEvents SttsBrMain As System.Windows.Forms.StatusBar
    Friend WithEvents SttsBrPnl1 As System.Windows.Forms.StatusBarPanel
    Friend WithEvents TabCtlMain As System.Windows.Forms.TabControl
    Friend WithEvents MenuItem9 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItemPrinterMode As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItemScreenMode As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItemCopy As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItemHelp As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem17 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem19 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItemAbout As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItemUserMode As System.Windows.Forms.MenuItem
    Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
    Friend WithEvents MnuItmFullScreen As System.Windows.Forms.MenuItem
    Friend WithEvents ImageList2 As System.Windows.Forms.ImageList
    Friend WithEvents SttsBrPnl2 As System.Windows.Forms.StatusBarPanel
    Friend WithEvents SttsBrPnl3 As System.Windows.Forms.StatusBarPanel
    Friend WithEvents PropertyGrid1 As System.Windows.Forms.PropertyGrid
    Friend WithEvents ImageViewer1 As BV.Controls.ImageViewer
    Friend WithEvents ImgVwrSubItems As BV.Controls.ImageViewer
    Friend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu
    Friend WithEvents MnuItmModule As System.Windows.Forms.MenuItem
    Friend WithEvents MnuItmPhase As System.Windows.Forms.MenuItem
    Friend WithEvents MnuItmModPhase As System.Windows.Forms.MenuItem
    Friend WithEvents VisorCtl1 As BV.Controls.VisorCtl
    Friend WithEvents ContextMenu2 As System.Windows.Forms.ContextMenu
    Friend WithEvents MnuItm741 As System.Windows.Forms.MenuItem
    Friend WithEvents BvToolBar1 As BVToolBar
    Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
    Friend WithEvents TabPageMG As System.Windows.Forms.TabPage
    Friend WithEvents TabPagePG As System.Windows.Forms.TabPage
    Friend WithEvents VisorCtl2 As BV.Controls.VisorCtl
    Friend WithEvents TabPageCP As System.Windows.Forms.TabPage
    Friend WithEvents VisorCtl3 As BV.Controls.VisorCtl
    Friend WithEvents BvToolBar2 As BV.Controls.BVToolBar
    Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
    Friend WithEvents VisorCtl4 As BV.Controls.VisorCtl
    Friend WithEvents VisorCtl5 As BV.Controls.VisorCtl
    Friend WithEvents VisorCtl6 As BV.Controls.VisorCtl
    Friend WithEvents ImageList3 As System.Windows.Forms.ImageList

    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Frm2DLaplaceDemo))
        Me.TabCtlMain = New System.Windows.Forms.TabControl
        Me.TabPage1 = New System.Windows.Forms.TabPage
        Me.ImgVwrSubItems = New BV.Controls.ImageViewer
        Me.ImageViewer1 = New BV.Controls.ImageViewer
        Me.PropertyGrid1 = New System.Windows.Forms.PropertyGrid
        Me.MainMenu1 = New System.Windows.Forms.MainMenu
        Me.MenuItem1 = New System.Windows.Forms.MenuItem
        Me.MenuItem9 = New System.Windows.Forms.MenuItem
        Me.MenuItemView = New System.Windows.Forms.MenuItem
        Me.MenuItemScreenMode = New System.Windows.Forms.MenuItem
        Me.MenuItemPrinterMode = New System.Windows.Forms.MenuItem
        Me.MenuItemUserMode = New System.Windows.Forms.MenuItem
        Me.MenuItem19 = New System.Windows.Forms.MenuItem
        Me.MnuItmFullScreen = New System.Windows.Forms.MenuItem
        Me.MenuItemEdit = New System.Windows.Forms.MenuItem
        Me.MenuItemCopy = New System.Windows.Forms.MenuItem
        Me.MenuItemHelp = New System.Windows.Forms.MenuItem
        Me.MenuItemAbout = New System.Windows.Forms.MenuItem
        Me.SttsBrMain = New System.Windows.Forms.StatusBar
        Me.SttsBrPnl1 = New System.Windows.Forms.StatusBarPanel
        Me.SttsBrPnl2 = New System.Windows.Forms.StatusBarPanel
        Me.SttsBrPnl3 = New System.Windows.Forms.StatusBarPanel
        Me.ContextMenu1 = New System.Windows.Forms.ContextMenu
        Me.MnuItmModule = New System.Windows.Forms.MenuItem
        Me.MnuItmPhase = New System.Windows.Forms.MenuItem
        Me.MnuItmModPhase = New System.Windows.Forms.MenuItem
        Me.BvToolBar1 = New BV.Controls.BVToolBar
        Me.ImageList2 = New System.Windows.Forms.ImageList(Me.components)
        Me.MenuItem17 = New System.Windows.Forms.MenuItem
        Me.VisorCtl1 = New BV.Controls.VisorCtl
        Me.ContextMenu2 = New System.Windows.Forms.ContextMenu
        Me.MnuItm741 = New System.Windows.Forms.MenuItem
        Me.TabControl1 = New System.Windows.Forms.TabControl
        Me.TabPageCP = New System.Windows.Forms.TabPage
        Me.VisorCtl3 = New BV.Controls.VisorCtl
        Me.BvToolBar2 = New BV.Controls.BVToolBar
        Me.TabPageMG = New System.Windows.Forms.TabPage
        Me.TabPagePG = New System.Windows.Forms.TabPage
        Me.VisorCtl2 = New BV.Controls.VisorCtl
        Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
        Me.VisorCtl4 = New BV.Controls.VisorCtl
        Me.VisorCtl5 = New BV.Controls.VisorCtl
        Me.VisorCtl6 = New BV.Controls.VisorCtl
        Me.ImageList3 = New System.Windows.Forms.ImageList(Me.components)
        Me.TabCtlMain.SuspendLayout()
        Me.TabPage1.SuspendLayout()
        CType(Me.SttsBrPnl1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.SttsBrPnl2, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.SttsBrPnl3, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.TabControl1.SuspendLayout()
        Me.TabPageCP.SuspendLayout()
        Me.TabPageMG.SuspendLayout()
        Me.TabPagePG.SuspendLayout()
        Me.SuspendLayout()
        '
        'TabCtlMain
        '
        Me.TabCtlMain.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.TabCtlMain.Controls.Add(Me.TabPage1)
        Me.TabCtlMain.Location = New System.Drawing.Point(0, 44)
        Me.TabCtlMain.Multiline = True
        Me.TabCtlMain.Name = "TabCtlMain"
        Me.TabCtlMain.SelectedIndex = 0
        Me.TabCtlMain.Size = New System.Drawing.Size(224, 372)
        Me.TabCtlMain.TabIndex = 22
        '
        'TabPage1
        '
        Me.TabPage1.Controls.Add(Me.ImgVwrSubItems)
        Me.TabPage1.Controls.Add(Me.ImageViewer1)
        Me.TabPage1.Controls.Add(Me.PropertyGrid1)
        Me.TabPage1.Location = New System.Drawing.Point(4, 22)
        Me.TabPage1.Name = "TabPage1"
        Me.TabPage1.Size = New System.Drawing.Size(216, 346)
        Me.TabPage1.TabIndex = 0
        Me.TabPage1.Text = "Main Control"
        '
        'ImageViewer2
        '
        Me.ImgVwrSubItems.AllowDeletions = BV.Controls.ImageViewer.EAllowDeletions.None
        Me.ImgVwrSubItems.BackColor = System.Drawing.Color.White
        Me.ImgVwrSubItems.EnablePreview = False
        Me.ImgVwrSubItems.IsSelected = False
        Me.ImgVwrSubItems.Location = New System.Drawing.Point(112, 8)
        Me.ImgVwrSubItems.Name = "ImageViewer2"
        Me.ImgVwrSubItems.Size = New System.Drawing.Size(96, 160)
        Me.ImgVwrSubItems.TabIndex = 55
        '
        'ImageViewer1
        '
        Me.ImageViewer1.AllowDeletions = BV.Controls.ImageViewer.EAllowDeletions.None
        Me.ImageViewer1.BackColor = System.Drawing.Color.White
        Me.ImageViewer1.EnablePreview = False
        Me.ImageViewer1.IsSelected = False
        Me.ImageViewer1.Location = New System.Drawing.Point(0, 8)
        Me.ImageViewer1.Name = "ImageViewer1"
        Me.ImageViewer1.Size = New System.Drawing.Size(112, 160)
        Me.ImageViewer1.TabIndex = 54
        '
        'PropertyGrid1
        '
        Me.PropertyGrid1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.PropertyGrid1.CommandsVisibleIfAvailable = True
        Me.PropertyGrid1.HelpVisible = False
        Me.PropertyGrid1.LargeButtons = False
        Me.PropertyGrid1.LineColor = System.Drawing.SystemColors.ScrollBar
        Me.PropertyGrid1.Location = New System.Drawing.Point(0, 168)
        Me.PropertyGrid1.Name = "PropertyGrid1"
        Me.PropertyGrid1.Size = New System.Drawing.Size(208, 172)
        Me.PropertyGrid1.TabIndex = 52
        Me.PropertyGrid1.Text = "PropertyGrid1"
        Me.PropertyGrid1.ToolbarVisible = False
        Me.PropertyGrid1.ViewBackColor = System.Drawing.SystemColors.Window
        Me.PropertyGrid1.ViewForeColor = System.Drawing.SystemColors.WindowText
        '
        'MainMenu1
        '
        Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItemView, Me.MenuItemEdit, Me.MenuItemHelp})
        '
        'MenuItem1
        '
        Me.MenuItem1.Index = 0
        Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem9})
        Me.MenuItem1.Text = "File"
        '
        'MenuItem9
        '
        Me.MenuItem9.Index = 0
        Me.MenuItem9.Text = "-"
        '
        'MenuItemView
        '
        Me.MenuItemView.Index = 1
        Me.MenuItemView.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItemScreenMode, Me.MenuItemPrinterMode, Me.MenuItemUserMode, Me.MenuItem19, Me.MnuItmFullScreen})
        Me.MenuItemView.Text = "View"
        '
        'MenuItemScreenMode
        '
        Me.MenuItemScreenMode.Index = 0
        Me.MenuItemScreenMode.Text = "Screen Mode"
        '
        'MenuItemPrinterMode
        '
        Me.MenuItemPrinterMode.Index = 1
        Me.MenuItemPrinterMode.Text = "Printer Mode"
        '
        'MenuItemUserMode
        '
        Me.MenuItemUserMode.Checked = True
        Me.MenuItemUserMode.Index = 2
        Me.MenuItemUserMode.Text = "User Mode"
        '
        'MenuItem19
        '
        Me.MenuItem19.Index = 3
        Me.MenuItem19.Text = "-"
        '
        'MnuItmFullScreen
        '
        Me.MnuItmFullScreen.Index = 4
        Me.MnuItmFullScreen.Text = "Toggle Full Screen"
        '
        'MenuItemEdit
        '
        Me.MenuItemEdit.Index = 2
        Me.MenuItemEdit.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItemCopy})
        Me.MenuItemEdit.Text = "Edit"
        '
        'MenuItemCopy
        '
        Me.MenuItemCopy.Index = 0
        Me.MenuItemCopy.Text = "Copy To ClipBoard"
        '
        'MenuItemHelp
        '
        Me.MenuItemHelp.Index = 3
        Me.MenuItemHelp.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItemAbout})
        Me.MenuItemHelp.Text = "Help"
        '
        'MenuItemAbout
        '
        Me.MenuItemAbout.Index = 0
        Me.MenuItemAbout.Text = "About"
        '
        'SttsBrMain
        '
        Me.SttsBrMain.Location = New System.Drawing.Point(0, 424)
        Me.SttsBrMain.Name = "SttsBrMain"
        Me.SttsBrMain.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.SttsBrPnl1, Me.SttsBrPnl2, Me.SttsBrPnl3})
        Me.SttsBrMain.ShowPanels = True
        Me.SttsBrMain.Size = New System.Drawing.Size(712, 22)
        Me.SttsBrMain.TabIndex = 28
        '
        'SttsBrPnl1
        '
        Me.SttsBrPnl1.Width = 350
        '
        'SttsBrPnl2
        '
        Me.SttsBrPnl2.Width = 150
        '
        'SttsBrPnl3
        '
        Me.SttsBrPnl3.Width = 150
        '
        'ContextMenu1
        '
        Me.ContextMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MnuItmModule, Me.MnuItmPhase, Me.MnuItmModPhase})
        '
        'MnuItmModule
        '
        Me.MnuItmModule.Index = 0
        Me.MnuItmModule.Text = "Only Module"
        '
        'MnuItmPhase
        '
        Me.MnuItmPhase.Index = 1
        Me.MnuItmPhase.Text = "Only Phase"
        '
        'MnuItmModPhase
        '
        Me.MnuItmModPhase.Index = 2
        Me.MnuItmModPhase.Text = "Module Phase"
        '
        'BvToolBar1
        '
        Me.BvToolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
        Me.BvToolBar1.AutoSize = False
        Me.BvToolBar1.BackColor = System.Drawing.SystemColors.Control
        Me.BvToolBar1.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.BvToolBar1.ButtonSize = New System.Drawing.Size(32, 32)
        Me.BvToolBar1.Divider = False
        Me.BvToolBar1.Dock = System.Windows.Forms.DockStyle.Top
        Me.BvToolBar1.ImageList = Me.ImageList2
        Me.BvToolBar1.Name = "BvToolBar1"
        Me.BvToolBar1.TabIndex = 29
        '
        'ImageList2
        '
        Me.ImageList2.ColorDepth = System.Windows.Forms.ColorDepth.Depth16Bit
        Me.ImageList2.ImageSize = New System.Drawing.Size(32, 32)
        Me.ImageList2.ImageStream = CType(resources.GetObject("ImageList2.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageList2.TransparentColor = System.Drawing.Color.Transparent
        '
        'MenuItem17
        '
        Me.MenuItem17.Index = -1
        Me.MenuItem17.Text = ""
        '
        'VisorCtl1
        '
        Me.VisorCtl1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.VisorCtl1.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(224, Byte), CType(192, Byte))
        Me.VisorCtl1.Location = New System.Drawing.Point(0, 0)
        Me.VisorCtl1.Name = "VisorCtl1"
        Me.VisorCtl1.Size = New System.Drawing.Size(480, 348)
        Me.VisorCtl1.TabIndex = 30
        '
        'ContextMenu2
        '
        Me.ContextMenu2.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MnuItm741})
        '
        'MnuItm741
        '
        Me.MnuItm741.Index = 0
        Me.MnuItm741.Text = "741 example"
        '
        'TabControl1
        '
        Me.TabControl1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.TabControl1.Controls.Add(Me.TabPageCP)
        Me.TabControl1.Controls.Add(Me.TabPageMG)
        Me.TabControl1.Controls.Add(Me.TabPagePG)
        Me.TabControl1.Location = New System.Drawing.Point(224, 48)
        Me.TabControl1.Name = "TabControl1"
        Me.TabControl1.SelectedIndex = 0
        Me.TabControl1.Size = New System.Drawing.Size(488, 372)
        Me.TabControl1.TabIndex = 31
        '
        'TabPageCP
        '
        Me.TabPageCP.Controls.Add(Me.VisorCtl3)
        Me.TabPageCP.Controls.Add(Me.BvToolBar2)
        Me.TabPageCP.Location = New System.Drawing.Point(4, 22)
        Me.TabPageCP.Name = "TabPageCP"
        Me.TabPageCP.Size = New System.Drawing.Size(480, 346)
        Me.TabPageCP.TabIndex = 2
        Me.TabPageCP.Text = "Complex Plain"
        '
        'VisorCtl3
        '
        Me.VisorCtl3.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.VisorCtl3.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.VisorCtl3.Location = New System.Drawing.Point(48, 0)
        Me.VisorCtl3.Name = "VisorCtl3"
        Me.VisorCtl3.Size = New System.Drawing.Size(432, 344)
        Me.VisorCtl3.TabIndex = 0
        '
        'BvToolBar2
        '
        Me.BvToolBar2.Appearance = System.Windows.Forms.ToolBarAppearance.Normal
        Me.BvToolBar2.AutoSize = False
        Me.BvToolBar2.BackColor = System.Drawing.SystemColors.Control
        Me.BvToolBar2.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.BvToolBar2.ButtonSize = New System.Drawing.Size(32, 32)
        Me.BvToolBar2.Divider = False
        Me.BvToolBar2.Dock = System.Windows.Forms.DockStyle.Left
        Me.BvToolBar2.Name = "BvToolBar2"
        Me.BvToolBar2.TabIndex = 1
        '
        'TabPageMG
        '
        Me.TabPageMG.Controls.Add(Me.VisorCtl1)
        Me.TabPageMG.Location = New System.Drawing.Point(4, 22)
        Me.TabPageMG.Name = "TabPageMG"
        Me.TabPageMG.Size = New System.Drawing.Size(480, 346)
        Me.TabPageMG.TabIndex = 0
        Me.TabPageMG.Text = "Module Graph"
        '
        'TabPagePG
        '
        Me.TabPagePG.Controls.Add(Me.VisorCtl2)
        Me.TabPagePG.Location = New System.Drawing.Point(4, 22)
        Me.TabPagePG.Name = "TabPagePG"
        Me.TabPagePG.Size = New System.Drawing.Size(480, 346)
        Me.TabPagePG.TabIndex = 1
        Me.TabPagePG.Text = "Phase Graph"
        '
        'VisorCtl2
        '
        Me.VisorCtl2.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.VisorCtl2.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(255, Byte), CType(192, Byte))
        Me.VisorCtl2.Location = New System.Drawing.Point(0, 0)
        Me.VisorCtl2.Name = "VisorCtl2"
        Me.VisorCtl2.Size = New System.Drawing.Size(480, 348)
        Me.VisorCtl2.TabIndex = 0
        '
        'ImageList1
        '
        Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth16Bit
        Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)
        Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
        '
        'VisorCtl4
        '
        Me.VisorCtl4.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(192, Byte), CType(192, Byte))
        Me.VisorCtl4.Location = New System.Drawing.Point(232, 48)
        Me.VisorCtl4.Name = "VisorCtl4"
        Me.VisorCtl4.Size = New System.Drawing.Size(224, 176)
        Me.VisorCtl4.TabIndex = 32
        '
        'VisorCtl5
        '
        Me.VisorCtl5.Anchor = System.Windows.Forms.AnchorStyles.Top
        Me.VisorCtl5.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(64, Byte), CType(0, Byte))
        Me.VisorCtl5.Location = New System.Drawing.Point(464, 48)
        Me.VisorCtl5.Name = "VisorCtl5"
        Me.VisorCtl5.Size = New System.Drawing.Size(240, 176)
        Me.VisorCtl5.TabIndex = 33
        '
        'VisorCtl6
        '
        Me.VisorCtl6.Anchor = System.Windows.Forms.AnchorStyles.Left
        Me.VisorCtl6.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.VisorCtl6.Location = New System.Drawing.Point(232, 232)
        Me.VisorCtl6.Name = "VisorCtl6"
        Me.VisorCtl6.Size = New System.Drawing.Size(224, 184)
        Me.VisorCtl6.TabIndex = 34
        '
        'ImageList3
        '
        Me.ImageList3.ColorDepth = System.Windows.Forms.ColorDepth.Depth16Bit
        Me.ImageList3.ImageSize = New System.Drawing.Size(32, 32)
        Me.ImageList3.ImageStream = CType(resources.GetObject("ImageList3.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageList3.TransparentColor = System.Drawing.Color.Transparent
        '
        'Frm2DDemo
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(712, 446)
        Me.Controls.Add(Me.BvToolBar1)
        Me.Controls.Add(Me.SttsBrMain)
        Me.Controls.Add(Me.TabCtlMain)
        Me.Controls.Add(Me.VisorCtl5)
        Me.Controls.Add(Me.VisorCtl4)
        Me.Controls.Add(Me.VisorCtl6)
        Me.Controls.Add(Me.TabControl1)
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Menu = Me.MainMenu1
        Me.MinimumSize = New System.Drawing.Size(640, 480)
        Me.Name = "Frm2DDemo"
        Me.Text = "Bode Viewer XP V7 - Bode Demo"
        Me.TabCtlMain.ResumeLayout(False)
        Me.TabPage1.ResumeLayout(False)
        CType(Me.SttsBrPnl1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.SttsBrPnl2, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.SttsBrPnl3, System.ComponentModel.ISupportInitialize).EndInit()
        Me.TabControl1.ResumeLayout(False)
        Me.TabPageCP.ResumeLayout(False)
        Me.TabPageMG.ResumeLayout(False)
        Me.TabPagePG.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub



#End Region

#Region "Enumeraciones"

    Private Enum DemoRuning
        None
        Linear
        Logaritmic
    End Enum

#End Region

    Friend TlBarBtnBodeSelect As BVToolBarButton
    Friend TlBarBtnConjugate As BVToolBarButton
    Friend TlBarBtnAllowInsertion As BVToolBarButton
    Friend TlBarBtnMoveSing As BVToolBarButton
    Friend TlBarBtnEnableParametric As BVToolBarButton
    Friend TlBrBtnRunParametric As BVToolBarButton
    Friend TlBrBtnViewOption As BVToolBarButton

    Private CursorToolbar As CursorToolBarUtility
    Private WithEvents BvTlBrBandMain As BV.Controls.BVToolBarBand
    Private WithEvents BvTlBrBandCP As BV.Controls.BVToolBarBand
    Private WithEvents BvTlBrBandParam As BV.Controls.BVToolBarBand

    Private WithEvents intVisor As VisorXYAdvanced
    Private WithEvents intVisorP As VisorXYAdvanced
    Private WithEvents intVisor2CP As VisorComplexPlain
    Private GoV As GraphOfVisorComplexS
    Private SelectedSing As GraphicsSingularity
    Private selectedObj As Object
    Private WithEvents Config As BodeConfig

    Private Pr As BodeParametrics
    Public Grid As GridBase

    Private Sub Initialize()

        Me.TabPagePG.Visible = False
        ImgVwrSubItems.EnablePreview = False
        ImageViewer1.AllowDeletions = ImageViewer.EAllowDeletions.Yes

        AddHandler MessageManager.SendMessage, AddressOf Me.OnMessageReicived


        intVisor = New VisorXYAdvanced(Me.VisorCtl1)
        intVisor.SetRanges(0.1, 10000, 0.01, 100)
        intVisor.XAxisProperties.AxisType = EAxisType.Logarithmic
        intVisor.XAxisProperties.AxisLabel = "f"
        intVisor.XAxisProperties.AxisUnit = "[Hz]"
        intVisor.XAxisProperties.UnitIsVisible = True
        intVisor.AutoScale = AutoScaleCplxTypes.YReal
        intVisor.AutoResize = True

        intVisorP = New VisorXYAdvanced(Me.VisorCtl2)
        intVisorP.SetRanges(0.1, 10000, 0.01, 100)
        intVisorP.YAxisProperties.AxisType = EAxisType.Degree
        intVisorP.XAxisProperties.AxisType = EAxisType.Logarithmic
        intVisorP.XAxisProperties.AxisLabel = "f"
        intVisorP.XAxisProperties.AxisUnit = "[Hz]"
        intVisorP.XAxisProperties.UnitIsVisible = True
        'objVisor2DP.AutoScale = AutoScaleCplxTypes.YImaginary
        intVisorP.AutoResize = True

        intVisor2CP = New VisorComplexPlain(Me.VisorCtl3)
        intVisor2CP.SetRanges(-10000, 10000, -10000, 10000)
        intVisor2CP.XAxisProperties.AxisLabel = "s"
        'objVisor2CP.XAxisProperties.AxisLabe = "s"
        intVisor2CP.XAxisProperties.AxisUnit = "[Hz]"
        intVisor2CP.XAxisProperties.UnitIsVisible = True
        intVisor2CP.YAxisProperties.AxisLabel = "f"
        intVisor2CP.YAxisProperties.AxisUnit = "[Hz]"
        intVisor2CP.YAxisProperties.UnitIsVisible = True
        'objVisor2CP.AutoScale = AutoScaleCplxTypes.YReal
        intVisor2CP.AutoResize = True
        intVisor2CP.IsSimetrical = True

        Config = New BodeConfig(Me.intVisor, Me.BvToolBar1)
        Config.InitializeCommonToolBar()
        ImageViewer1.Add(Config, Config.Icon.ToBitmap, Config.Description)

        Grid = New GridBase(Me.intVisor2CP.XRange.dx, Me.intVisor2CP.YRange.dx, 100)

        InitializeToolBar()
        InitializeToolBar2()
        InitializeToolBar3()

        CursorToolbar = New CursorToolBarUtility(Me.intVisor, Me.BvToolBar1)
        CursorToolbar.ShowToolBar()

        ViewOptions()
        Pr = New BodeParametrics

        AddGraph()
        'Me.CursorToolbar.SelectedGoV = Me.Config.LaplaceSystem

        PropertyGrid1.CommandsVisibleIfAvailable = True

        MnuBodeSelect(Me.MnuItmModule, New EventArgs)
    End Sub


    Private Sub Frm2DDemo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AddHandler intVisor.Selected, AddressOf Me.onSelectItm
        AddHandler intVisorP.Selected, AddressOf Me.onSelectItm
        AddHandler intVisor2CP.Selected, AddressOf Me.onSelectItm
        AddHandler intVisor2CP.MouseDown, AddressOf Me.CaptureClick
        AddHandler ImageViewer1.ItemFocused, AddressOf Me.onSelectItm
        AddHandler ImgVwrSubItems.ItemFocused, AddressOf Me.onSelectItm
        AddHandler CursorToolbar.PropertiesAvailable, AddressOf Me.ShowProperties
        AddHandler CursorToolbar.CursorsChange, AddressOf Me.RefreshPropertyGrid
    End Sub

#Region "ToolBArInitialize"

    Private Sub InitializeToolBar()
        Dim BvTlBarBtn As BV.controls.BVToolBarButton

        BvTlBrBandMain = New BV.controls.BVToolBarBand
        '   BvTlBrBandMain.BorderStyle = BorderStyle.None


        BvTlBarBtn = New BVToolBarButton
        BvTlBarBtn.ImageIndex = 0
        BvTlBarBtn.ToolTipText = "Create New Transfer Function"
        BvTlBrBandMain.Buttons.Add(BvTlBarBtn, AddressOf AddGraph)

        BvTlBarBtn = New BVToolBarButton
        BvTlBarBtn.ImageIndex = 1
        BvTlBarBtn.ToolTipText = "Add New Insertion"
        BvTlBrBandMain.Buttons.Add(BvTlBarBtn, AddressOf NewSing)

        Me.TlBarBtnConjugate = New BVToolBarButton
        Me.TlBarBtnConjugate.ImageIndex = 2
        Me.TlBarBtnConjugate.Style = ToolBarButtonStyle.ToggleButton
        TlBarBtnConjugate.ToolTipText = "Select Complex Conjugate Singularity"
        BvTlBrBandMain.Buttons.Add(Me.TlBarBtnConjugate)

        'Me.TlBarBtnEnableParametric = New BVToolBarButton

        BvTlBarBtn = New BVToolBarButton
        BvTlBarBtn.ImageIndex = 3
        BvTlBarBtn.ToolTipText = "Remove Singularity From Selected Function"
        BvTlBrBandMain.Buttons.Add(BvTlBarBtn, AddressOf Remove)


        BvTlBarBtn = New BVToolBarButton
        BvTlBarBtn.Style = ToolBarButtonStyle.Separator
        BvTlBrBandMain.Buttons.Add(BvTlBarBtn)

        TlBarBtnBodeSelect = New BVToolBarButton
        TlBarBtnBodeSelect.DropDownMenu = Me.ContextMenu1
        TlBarBtnBodeSelect.ImageIndex = 4
        TlBarBtnBodeSelect.Style = ToolBarButtonStyle.DropDownButton
        TlBarBtnBodeSelect.ToolTipText = "Select Module, Phase or Both"
        BvTlBrBandMain.Buttons.Add(TlBarBtnBodeSelect, AddressOf BtnBodeSelect)


        BvTlBarBtn = New BVToolBarButton
        BvTlBarBtn.Style = ToolBarButtonStyle.Separator
        BvTlBrBandMain.Buttons.Add(BvTlBarBtn)



        Me.TlBrBtnViewOption = New BVToolBarButton
        Me.TlBrBtnViewOption.ImageIndex = 7
        Me.TlBrBtnViewOption.PushedImageIndex = 8
        Me.TlBrBtnViewOption.Style = ToolBarButtonStyle.ToggleButton
        Me.TlBrBtnViewOption.ToolTipText = "View Mode Selector - Tabs or Tiled"
        BvTlBrBandMain.Buttons.Add(Me.TlBrBtnViewOption, AddressOf ViewOptions)


        Me.BvToolBar1.Bands.Add(Me.BvTlBrBandMain)

        Me.Config.ToolBarBand.Buttons("BvTlBarBtnRefresh").Style = ToolBarButtonStyle.DropDownButton
        Me.Config.ToolBarBand.Buttons("BvTlBarBtnRefresh").DropDownMenu = Me.ContextMenu2


    End Sub

    Private Sub InitializeToolBar3()
        'Dim BvTlBarBtn As BV.Controls.BVToolBarButton

        BvTlBrBandParam = New BVToolBarBand
        BvTlBrBandParam.ImageList = Me.ImageList3

        'Me.TlBarBtnEnableParametric = New BVToolBarButton
        'Me.TlBarBtnEnableParametric.ImageIndex = 0
        'Me.TlBarBtnEnableParametric.Style = ToolBarButtonStyle.ToggleButton
        'Me.TlBarBtnEnableParametric.ToolTipText = "Enable Parametrics Analisys"
        'BvTlBrBandParam.Buttons.Add(Me.TlBarBtnEnableParametric, AddressOf BtnEnableParametrics)

        Me.TlBrBtnRunParametric = New BVToolBarButton
        Me.TlBrBtnRunParametric.ImageIndex = 1
        Me.TlBrBtnRunParametric.PushedImageIndex = 0
        Me.TlBrBtnRunParametric.ToolTipText = "Run Parametrics Analisys"
        Me.TlBrBtnRunParametric.Style = ToolBarButtonStyle.ToggleButton
        BvTlBrBandParam.Buttons.Add(Me.TlBrBtnRunParametric, AddressOf BtnRunParametrics)


        Me.BvToolBar1.Bands.Add(Me.BvTlBrBandParam)

    End Sub

    Private Sub InitializeToolBar2()
        Dim BvTlBarBtn As BV.controls.BVToolBarButton

        BvTlBrBandCP = New BV.controls.BVToolBarBand
        BvTlBrBandCP.Name = "SingularityInsertionBand"
        BvTlBrBandCP.BorderStyle = BorderStyle.FixedSingle
        BvTlBrBandCP.ImageList = Me.ImageList1


        TlBarBtnAllowInsertion = New BVToolBarButton
        TlBarBtnAllowInsertion.ImageIndex = 0
        TlBarBtnAllowInsertion.ToolTipText = "Allow Singularity Insertion"
        TlBarBtnAllowInsertion.Style = ToolBarButtonStyle.ToggleButton
        BvTlBrBandCP.Buttons.Add(TlBarBtnAllowInsertion)

        TlBarBtnMoveSing = New BVToolBarButton
        TlBarBtnMoveSing.ImageIndex = 1
        TlBarBtnMoveSing.ToolTipText = "Move Singularity"
        TlBarBtnMoveSing.Style = ToolBarButtonStyle.ToggleButton
        BvTlBrBandCP.Buttons.Add(TlBarBtnMoveSing)

        BvTlBarBtn = New BVToolBarButton
        BvTlBarBtn.Style = ToolBarButtonStyle.Separator
        BvTlBrBandCP.Buttons.Add(BvTlBarBtn)

        BvTlBarBtn = New BVToolBarButton
        BvTlBarBtn.ImageIndex = 2
        BvTlBarBtn.Name = "GridUp"
        BvTlBarBtn.ToolTipText = "Grid Up, Setted to " & Me.Grid.XSpace
        BvTlBrBandCP.Buttons.Add(BvTlBarBtn, CType(AddressOf Grid.GridUp, BasicDelegate))

        BvTlBarBtn = New BVToolBarButton
        BvTlBarBtn.ImageIndex = 3
        BvTlBarBtn.Name = "GridDown"
        BvTlBarBtn.ToolTipText = "Grid Down, Setted to " & Me.Grid.XSpace
        BvTlBrBandCP.Buttons.Add(BvTlBarBtn, CType(AddressOf Grid.GridDown, BasicDelegate))

        'Me.BvToolBar2.Bands.Add(Me.BvTlBrBandCP)

    End Sub

#End Region

#Region "Parametrics Buttons Events"

    'Private Sub BtnEnableParametrics()
    '    If Not TypeOf Me.selectedObj Is Singularity Then
    '        Exit Sub
    '    End If
    '    If Me.Config.LaplaceSystem Is Nothing Then
    '        Exit Sub
    '    End If
    '    'if BtnEnableParametrics.
    '    Pr.LaplaceSystems = Config.LaplaceSystem
    '    Pr.Parameter = SelectedSing
    '    ImageViewer1.Add(Pr, Pr.Icon.ToBitmap, "Parametric Analisys")
    '    Pr.StartValue = 10
    '    Pr.EndValue = 100
    '    Pr.Step = 10
    '    PropertyGrid1.SelectedObject = Pr

    '    'me.
    'End Sub

    Private Sub BtnRunParametrics()
        Pr.Start()

        Dim i As Integer
        For i = 0 To Me.Config.Count - 1
            Stop
            'Me.Config.ParalleManager = New AutoSystemCalc

            Me.intVisor.Add(Me.Config.System)
            GoV = Me.intVisor.CurrentGoV
            GoV.Show = EGraphShowOne.Real
        Next
    End Sub

#End Region

    Sub ViewOptions()
        If Me.TlBrBtnViewOption.Pushed Then
            Me.TabControl1.Show()
            Me.VisorCtl4.Hide()
            Me.VisorCtl5.Hide()
            Me.VisorCtl6.Hide()
            Me.intVisor.RenderControl = Me.VisorCtl1
            Me.intVisorP.RenderControl = Me.VisorCtl2
            Me.intVisor2CP.RenderControl = Me.VisorCtl3
            Me.BvToolBar1.Bands.Remove(Me.BvTlBrBandCP)
            Me.BvToolBar2.Bands.Add(Me.BvTlBrBandCP)
        Else
            Me.TabControl1.Hide()
            Me.VisorCtl4.Show()
            Me.VisorCtl5.Show()
            Me.VisorCtl6.Show()
            Me.intVisor.RenderControl = Me.VisorCtl4
            Me.intVisorP.RenderControl = Me.VisorCtl5
            Me.intVisor2CP.RenderControl = Me.VisorCtl6
            Me.BvToolBar1.Bands.Add(Me.BvTlBrBandCP)
            Me.BvToolBar2.Bands.Remove(Me.BvTlBrBandCP)
        End If
    End Sub

    Sub CaptureClick(ByVal sender As Object, ByVal e As MouseEventArgs)
        If Me.TlBarBtnAllowInsertion.Pushed AndAlso e.Button = Windows.Forms.MouseButtons.Left Then
            Dim x, y As Single
            x = Grid.ConvertX(Me.intVisor2CP.Cursor1Position.X)
            y = Grid.ConvertY(Me.intVisor2CP.Cursor1Position.Y)
            Me.NewSing(x, y)
            'Me.TlBarBtnAllowInsertion.Pushed = False
        End If
    End Sub

#Region "Add & Remove Buttons Events"

    Sub AddGraph()
        AddGraph(10)
    End Sub

    Sub AddGraph(ByVal KReal As Single, ByVal ico As Icon, ByVal Desc As String)
        Me.Config.LaplaceFunction = New LaplaceFunction
        Me.Config.Add(Me.Config.LaplaceFunction)
        Me.Config.LaplaceFunction.Real = KReal
        'Me.Config.LaplaceSystem.TypeOfGraph = ETypeOfComplex.Polar

        If Desc = "" Then
            If ico Is Nothing Then
                ImageViewer1.Add(Me.Config.LaplaceFunction)
            Else
                ImageViewer1.Add(Me.Config.LaplaceFunction, ico.ToBitmap)
            End If
        Else
            ImageViewer1.Add(Me.Config.LaplaceFunction, ico.ToBitmap, Desc)
        End If

        Stop
        'Me.Config.ParalleManager = New AutoSystemCalc
        'Me.Config.System = New AutoSystemCalc(Me.Config.LaplaceSystem)

        Me.intVisor.Add(Me.Config.System)
        GoV = Me.intVisor.CurrentGoV
        GoV.Show = EGraphShowOne.Module
        GoV.Name = "Module Graph " & intVisor.GraphCount

        Me.Config.Add(Me.Config.LaplaceFunction, GoV)
        AddHandler Me.Config.LaplaceFunction.DataChange, AddressOf Me.Config.Laplace_Change

        Me.intVisorP.Add(Me.Config.System)
        GoV = Me.intVisorP.CurrentGoV
        GoV.Show = EGraphShowOne.Angle
        GoV.Name = "Phase Graph " & intVisorP.GraphCount
        Me.intVisor2CP.Add(Me.Config.LaplaceFunction) ', Visor2DGoV.GovCreation.Replace)
    End Sub

    'Add
    Sub AddGraph(ByVal KReal As Single)
        Dim LF As LaplaceFunction
        LF = New LaplaceFunction
        LF.Real = KReal
        Me.Config.Add(LF)
        'Me.Config.LaplaceSystem.TypeOfGraph = ETypeOfComplex.Polar

        ImageViewer1.Add(LF, LF.Icon.ToBitmap)
        Me.Config.LaplaceFunction = LF

        Me.intVisor.Add(Me.Config.System)
        GoV = Me.intVisor.CurrentGoV
        GoV.Show = EGraphShowOne.Module
        GoV.Name = "Module Graph " & intVisor.GraphCount

        Me.Config.Add(Me.Config.LaplaceFunction, GoV)
        AddHandler Me.Config.LaplaceFunction.DataChange, AddressOf Me.Config.Laplace_Change

        Me.intVisorP.Add(Me.Config.System)
        GoV = Me.intVisorP.CurrentGoV
        GoV.Show = EGraphShowOne.Angle
        GoV.Name = "Phase Graph " & intVisorP.GraphCount
        Me.intVisor2CP.Add(Me.Config.LaplaceFunction) ', Visor2DGoV.GovCreation.Replace)
    End Sub

    Sub NewSing(ByVal Real As Single, ByVal Imag As Single)
        If Me.Config.LaplaceFunction Is Nothing Then
            Exit Sub
        End If
        If Me.TlBarBtnConjugate.Pushed Then
            SelectedSing = New GraphicsSingularity(Real, Imag)

            Dim SelectedSing2 As GraphicsSingularity
            SelectedSing2 = New GraphicsSingularity
            SelectedSing2.Conjugate = SelectedSing
            Me.Config.LaplaceFunction.Add(SelectedSing)

            If TypeOf PropertyGrid1.SelectedObject Is Singularity Or _
            TypeOf PropertyGrid1.SelectedObject Is LaplaceFunction Or _
            PropertyGrid1.SelectedObject Is Nothing Then
                Me.ImgVwrSubItems.Add(SelectedSing, SelectedSing.Icon.ToBitmap)
                ImgVwrSubItems.SelectItem(SelectedSing)
                Me.ImgVwrSubItems.Add(SelectedSing2, SelectedSing.Icon.ToBitmap)
            End If
            selectedObj = SelectedSing
            PropertyGrid1.SelectedObject = SelectedSing
        Else
            SelectedSing = New GraphicsSingularity(Real, 0)

            If TypeOf PropertyGrid1.SelectedObject Is Singularity Or _
            TypeOf PropertyGrid1.SelectedObject Is LaplaceFunction Or _
            PropertyGrid1.SelectedObject Is Nothing Then
                Me.ImgVwrSubItems.Add(SelectedSing, SelectedSing.Icon.ToBitmap)
                ImgVwrSubItems.SelectItem(SelectedSing)
            End If
            Me.Config.LaplaceFunction.Add(SelectedSing)
            selectedObj = SelectedSing
            PropertyGrid1.SelectedObject = selectedObj
        End If
        SelectedSing = Nothing
    End Sub

    Sub NewSing()
        NewSing(-CInt(Rnd() * 100), CInt(Rnd() * 100))
    End Sub

    Sub Remove()
        If Not selectedObj Is Nothing Then
            If TypeOf selectedObj Is Singularity Then
                Me.Config.LaplaceFunction.Remove(selectedObj)
                ImgVwrSubItems.Remove(selectedObj)
                selectedObj = Nothing
                SelectedSing = Nothing
                'ElseIf TypeOf selectedObj Is SingularityConjugatesContainer Then
                '    Me.Config.LaplaceSystem.Remove(selectedObj)
                '    ImageViewer2.Remove(selectedObj)
                '    selectedObj = Nothing
                '    Conj.Dispose()
                '    Me.Conj = Nothing
            ElseIf TypeOf selectedObj Is LaplaceFunction Then
                If Me.Config.Count > 1 Then
                    Me.ImgVwrSubItems.Clear()
                    Me.Config.LaplaceFunction = selectedObj
                    GoV = Me.Config.Graph(Me.Config.LaplaceFunction)
                    Me.Config.Remove(Me.Config.LaplaceFunction)
                    Me.intVisor.Remove(GoV)
                    Me.Config.Remove(Me.Config.LaplaceFunction)
                    ImageViewer1.Remove(Me.Config.LaplaceFunction)
                    If Me.CursorToolbar.SelectedGoV Is Me.Config.LaplaceFunction Then
                        Me.CursorToolbar.SelectedGoV = Nothing
                    End If

                    selectedObj = Nothing
                    Me.Config.LaplaceFunction = Nothing
                Else
                    Me.OnMessageReicived(Me, New MessageEventArgs("At least a graphics must remain", MessageEventArgs.EMessageType.Info))
                End If
            End If
        End If
    End Sub

#End Region

#Region "Demo Buttons Events"

#End Region

#Region "Selection"

    Sub RefreshPropertyGrid(ByVal sender As Object, ByVal e As EventArgs)
        PropertyGrid1.SelectedObject = Me.CursorToolbar.SelectedCursor
        PropertyGrid1.Refresh()
    End Sub

    Sub ShowProperties(ByVal sender As Object, ByVal e As EventArgs)
        If TypeOf sender Is CursorToolBarUtility Then
            PropertyGrid1.SelectedObject = CType(sender, CursorToolBarUtility).SelectedCursor
        End If
    End Sub

    Sub onSelectItm(ByVal sender As Object, ByVal e As EventArgs)
        If TypeOf sender Is VisorBase Then
            If Me.TlBarBtnAllowInsertion.Pushed AndAlso sender Is Me.intVisor2CP Then
                Me.TlBarBtnAllowInsertion.Pushed = False
                Exit Sub
            End If
            If Me.TlBarBtnMoveSing.Pushed AndAlso sender Is Me.intVisor2CP Then
                Exit Sub
            End If
            If Me.CursorToolbar.CursorsVisibles Then
                Exit Sub
            End If
            Me.CursorToolbar.Visor = sender
            Me.Config.SelectedVisorForZoom = sender
            ImgVwrSubItems.Clear()
            Dim g() As GraphOfVisorBase
            Dim i As Integer

            If sender Is Me.intVisor Then
                g = intVisor.ArrGraphs
            ElseIf sender Is Me.intVisor2CP Then
                g = intVisor2CP.ArrGraphs
            Else
                g = intVisorP.ArrGraphs
            End If
            For i = 0 To g.GetUpperBound(0)
                Me.ImgVwrSubItems.Add(CType(g(i), IImageChange))
            Next
        End If
        PropertyGrid1.SelectedObject = sender
    End Sub

    Sub onSelectItm(ByVal sender As Object, ByVal e As ItmEventArgs)
        selectedObj = e.Obj
        If TypeOf e.Obj Is GraphOfVisorComplex Then
            Me.GoV = e.Obj
            PropertyGrid1.SelectedObject = GoV
            Me.CursorToolbar.SelectedGoV = GoV

        ElseIf TypeOf e.Obj Is LaplaceFunction Then
            Me.Config.LaplaceFunction = e.Obj
            ImgVwrSubItems.Clear()

            Dim c() As Singularity
            Dim i As Integer

            If Not Me.Config.LaplaceFunction.Singularities Is Nothing Then
                c = Me.Config.LaplaceFunction.Singularities
                For i = 0 To Me.Config.LaplaceFunction.Singularities.GetUpperBound(0)
                    If TypeOf c(i) Is IIconnable Then
                        Me.ImgVwrSubItems.Add(CType(c(i), IIconnable))     ', Description)
                    Else
                        Stop
                    End If
                Next
            End If
            PropertyGrid1.SelectedObject = Me.Config.LaplaceFunction 'Constelation

        ElseIf TypeOf e.Obj Is NSMemberContainer Then
            Me.ImgVwrSubItems.Clear()
            For Each o As Object In CType(e.Obj, NSMemberContainer).Members
                If TypeOf o Is IIconnable Then
                    Me.ImgVwrSubItems.Add(CType(o, IIconnable))
                ElseIf TypeOf o Is IImageChange Then
                    Me.ImgVwrSubItems.Add(CType(o, IImageChange))
                End If
            Next

        ElseIf TypeOf e.Obj Is Singularity Then
            SelectedSing = e.Obj
            PropertyGrid1.SelectedObject = SelectedSing
            'ElseIf TypeOf e.Obj Is SingularityConjugatesContainer Then
            '    Conj = e.Obj
            '    PropertyGrid1.SelectedObject = Conj.Singularities(0)
        ElseIf TypeOf e.Obj Is Parametrics Then
            PropertyGrid1.SelectedObject = e.Obj
        Else
            PropertyGrid1.SelectedObject = e.Obj
        End If
    End Sub

#End Region

#Region "Message"

    Private Sub OnMessageReicived(ByVal sender As Object, ByVal s As MessageEventArgs)
        Me.SttsBrPnl1.Text = s.Message
    End Sub

#End Region

#Region "Main"


    '/ <summary>
    '/ The main entry point for the application.
    '/ </summary>
    Shared Sub Main()
        Dim frm As New Frm2DLaplaceDemo

        frm.Show()
        frm.SttsBrPnl1.Text = "Loading..."
        frm.SttsBrPnl1.Text = ""

        While frm.Created
            System.Windows.Forms.Application.DoEvents()
        End While

    End Sub

#End Region

#Region "ToolBar Section"

    Private Sub BvToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As BVToolBarButtonClickEventArgs) Handles BvTlBrBandMain.ButtonClick
        Me.BvTlBrBandMain.Buttons.Execute(e.Button)
    End Sub

    Private Sub BvToolBar2_ButtonClick(ByVal sender As System.Object, ByVal e As BVToolBarButtonClickEventArgs) Handles BvTlBrBandCP.ButtonClick
        'Me.ConfigUtil.Execute(e.Button, sender, e)
        Me.BvTlBrBandCP.Buttons.Execute(e.Button)
        If e.Button.Name = "GridDown" Then
            e.Button.ToolTipText = "Grid Down, Setted to " & Me.Grid.XSpace
        ElseIf e.Button.Name = "GridUp" Then
            e.Button.ToolTipText = "Grid Up, Setted to " & Me.Grid.XSpace
        End If
    End Sub

    Private Sub BvToolBar3_ButtonClick(ByVal sender As System.Object, ByVal e As BVToolBarButtonClickEventArgs) Handles BvTlBrBandParam.ButtonClick
        Me.BvTlBrBandParam.Buttons.Execute(e.Button)
    End Sub

#End Region

#Region "Controls Events"

#Region "Render Control Events"

    Sub OnRenderControl_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles intVisor.MouseDown, _
                                                                                            intVisor.MouseMove, _
                                                                                            intVisorP.MouseMove, _
                                                                                            intVisorP.MouseDown

        If TypeOf sender Is VisorBase Then
            Me.SttsBrPnl2.Text = CType(sender, VisorBase).Cursor1Position.ToString
            Me.SttsBrPnl3.Text = CType(sender, VisorBase).Cursor2Position.ToString
            If Not SelectedSing Is Nothing Then
                If sender Is Me.intVisor2CP AndAlso TlBarBtnMoveSing.Pushed Then
                    Me.SelectedSing.Value = New ComplexUndefinied(Me.intVisor2CP.Cursor1Position.X, Me.intVisor2CP.Cursor1Position.Y)
                End If
            End If
        End If

    End Sub

    Sub OnRenderControl_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles intVisor2CP.MouseMove, _
                                                                                               intVisor2CP.MouseDown

        If TypeOf sender Is VisorBase Then
            Me.SttsBrPnl2.Text = CType(sender, VisorBase).Cursor1Position.ToString
            Me.SttsBrPnl3.Text = CType(sender, VisorBase).Cursor2Position.ToString
            If Not SelectedSing Is Nothing Then
                If TlBarBtnMoveSing.Pushed AndAlso e.Button = Windows.Forms.MouseButtons.Left Then
                    If SelectedSing.IsConjugated Then
                        Me.SelectedSing.Value = New ComplexUndefinied(Me.Grid.ConvertX(Me.intVisor2CP.Cursor1Position.X), _
                                                                        Me.Grid.ConvertY(Me.intVisor2CP.Cursor1Position.Y))
                    Else
                        Me.SelectedSing.Value = New ComplexUndefinied(Me.Grid.ConvertX(Me.intVisor2CP.Cursor1Position.X), 0)
                    End If
                End If
            End If
        End If
    End Sub


    Sub OnRenderControl_Resize(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Resize
        Me.VisorCtl4.Width = (Me.Width - Me.TabCtlMain.Width) / 2 - 10
        Me.VisorCtl4.Height = (Me.TabCtlMain.Height) / 2 - 10
        Me.VisorCtl5.Left = Me.VisorCtl4.Left + Me.VisorCtl4.Width + 10
        Me.VisorCtl5.Width = Me.VisorCtl4.Width
        Me.VisorCtl5.Height = Me.VisorCtl4.Height
        Me.VisorCtl6.Top = Me.VisorCtl4.Top + Me.VisorCtl4.Height + 10
        Me.VisorCtl6.Width = Me.VisorCtl4.Width
        Me.VisorCtl6.Height = Me.VisorCtl4.Height
    End Sub

#End Region

#End Region

#Region "Color Mode Section"

    Private Sub UnCheckModeMenus()
        MenuItemScreenMode.Checked = False
        MenuItemUserMode.Checked = False
        MenuItemPrinterMode.Checked = False
    End Sub

    Private Sub MenuItemPrinterMode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItemPrinterMode.Click
        UnCheckModeMenus()
        MenuItemPrinterMode.Checked = True
        intVisor.GraphColorMode = GraphColorMode.CPrinter
    End Sub

    Private Sub MenuItemUserMode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItemUserMode.Click
        UnCheckModeMenus()
        MenuItemUserMode.Checked = True
        intVisor.GraphColorMode = GraphColorMode.CUser
    End Sub

    Private Sub MenuItemScreenMode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItemScreenMode.Click
        UnCheckModeMenus()
        MenuItemScreenMode.Checked = True
        intVisor.GraphColorMode = GraphColorMode.CScreen
    End Sub

#End Region

#Region "Bode Selection"

    Private Sub BtnBodeSelect()
        Dim g() As GraphOfVisorBase
        Dim i As Integer

        If MnuItmModule.Checked Then
            g = intVisor.ArrGraphs
            Me.TabPagePG.Visible = False
            TlBarBtnBodeSelect.ImageIndex = 4
            'objVisor2D.YAxisType = EAxisType.Linear
            intVisor.YRange = New RangeF(0.01, 100)
            intVisor.YAxisProperties.AxisType = EAxisType.Decibell
            intVisor.YAxisProperties.AxisUnit = "[dB]"
            intVisor.YAxisProperties.AxisLabel = "A"
            For i = 0 To g.GetUpperBound(0)
                CType(g(i), GraphOfVisorComplexS).Show = EGraphShowOne.Module
            Next
        ElseIf MnuItmPhase.Checked Then
            g = intVisorP.ArrGraphs
            Me.TabPagePG.Visible = True
            TlBarBtnBodeSelect.ImageIndex = 5
            intVisorP.YAxisProperties.AxisType = EAxisType.Degree
            intVisorP.YRange = New RangeF(0, 370)
            For i = 0 To g.GetUpperBound(0)
                CType(g(i), GraphOfVisorComplexS).Show = EGraphShowOne.Angle
            Next
            intVisor.YAxisProperties.AxisLabel = "Phi"
            intVisor.YAxisProperties.AxisUnit = "[�]"
        Else
            'Me.TabPagePG.Visible = True
            TlBarBtnBodeSelect.ImageIndex = 6
            intVisor.YAxisProperties.AxisType = EAxisType.Linear
            intVisor.YRange = New RangeF(0.01, 20)
            g = intVisorP.ArrGraphs
            For i = 0 To g.GetUpperBound(0)
                CType(g(i), GraphOfVisorComplexS).Show = EGraphShowOne.Real
            Next
            g = intVisor.ArrGraphs
            For i = 0 To g.GetUpperBound(0)
                CType(g(i), GraphOfVisorComplexS).Show = EGraphShowOne.Real
            Next
            intVisor.YAxisProperties.AxisLabel = "A & Phi"
            intVisor.YAxisProperties.AxisUnit = "[-]"
        End If
        intVisor.Refresh()
    End Sub

    Private Sub MnuBodeSelect(ByVal sender As Object, ByVal e As EventArgs) Handles MnuItmModule.Click, _
                                                                                    MnuItmPhase.Click, _
                                                                                    MnuItmModPhase.Click
        MnuItmModule.Checked = False
        MnuItmPhase.Checked = False
        MnuItmModPhase.Checked = False

        If TypeOf sender Is MenuItem Then
            CType(sender, MenuItem).Checked = True
        End If
        BtnBodeSelect()
    End Sub

#End Region

    Private Sub MnuItm741_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MnuItm741.Click
        Me.ImgVwrSubItems.Clear()
        Dim ico As Icon

        ico = New Icon([GetType], "AO741.ico")
        Me.AddGraph(200000, ico, "")
        Me.Config.LaplaceFunction.Icon = ico
        NameSpaceManager.Add("LM741System")
        Me.Config.LaplaceFunction.NameSpace = "LM741System"

        Me.Config.LaplaceFunction.Name = "LM741"
        Me.Config.LaplaceFunction.BriefDescription = "LM741 constelation"
        Me.Config.LaplaceFunction.Description = "This represents the LM741 poles and zeros constelation." & ControlChars.CrLf
        Me.Config.LaplaceFunction.Description += "The LM741 Operational Amplifier have two poles, first at 5Hz, and second at 5MHz." & ControlChars.CrLf
        Me.Config.LaplaceFunction.Description += "DC gain is 200.000 or 106dB"
        'Me.Config.LaplaceSystem.BriefDescription = Me.Config.LaplaceSystem.Description
        GoV.Name = "Bode Graph of LM741"

        TlBarBtnConjugate.Pushed = False
        Me.NewSing(-5, 0)
        Me.NewSing(-5000000, 0)
        Me.Config.XRange = New RangeF(1, 10000000)
        Me.Config.SelectedVisorForZoom = Me.intVisor
        Me.Config.ToolBar.Bands("ZoomBand").Buttons.Execute("ZoomFull")
        Me.Config.SelectedVisorForZoom = Me.intVisorP
        Me.Config.ToolBar.Bands("ZoomBand").Buttons.Execute("ZoomFull")
        Me.intVisor2CP.XRange = New RangeF(-10000000.0, 10000000.0)
        Me.intVisor2CP.YRange = New RangeF(-10000000.0, 10000000.0)
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer Universidad Tecnológica Nacional
Argentina Argentina
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions