📄 gpdppg.frm
字号:
VERSION 5.00Begin VB.Form GPDPpg BorderStyle = 4 'Fixed ToolWindow Caption = "Select Channel Properties" ClientHeight = 3570 ClientLeft = 45 ClientTop = 285 ClientWidth = 7410 Icon = "gpdppg.frx":0000 LinkTopic = "Form1" LockControls = -1 'True MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 3570 ScaleWidth = 7410 ShowInTaskbar = 0 'False StartUpPosition = 3 'Windows Default Begin VB.Frame frm_ChannelNGridSpace Caption = "Channel Name And Grid Space Allocation" Height = 1695 Left = 0 TabIndex = 22 Top = 0 Width = 3615 Begin VB.TextBox txt_MaxMembers BeginProperty DataFormat Type = 1 Format = "0" HaveTrueFalseNull= 0 FirstDayOfWeek = 0 FirstWeekOfYear = 0 LCID = 1033 SubFormatType = 1 EndProperty BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 1560 TabIndex = 8 ToolTipText = "The number of integers per message." Top = 1200 Width = 1935 End Begin VB.TextBox txt_MaxMessages BeginProperty DataFormat Type = 1 Format = "0" HaveTrueFalseNull= 0 FirstDayOfWeek = 0 FirstWeekOfYear = 0 LCID = 1033 SubFormatType = 1 EndProperty BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 1560 TabIndex = 7 ToolTipText = "The number of target messages to read." Top = 720 Width = 1935 End Begin VB.TextBox txt_ChannelName BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 1560 MaxLength = 32 TabIndex = 6 Text = "ALL" ToolTipText = "Enter the channel name as declared in target application." Top = 240 Width = 1935 End Begin VB.Label lbl_MaxMembers Caption = "MAX MEMBERS:" Height = 375 Left = 120 TabIndex = 2 Top = 1200 Width = 1455 End Begin VB.Label lbl_MaxMessages Caption = "MAX MESSAGES:" Height = 375 Left = 120 TabIndex = 3 Top = 720 Width = 1455 End Begin VB.Label lbl_ChannelName Caption = "CHANNEL NAME:" Height = 375 Left = 120 TabIndex = 4 Top = 240 Width = 1455 End End Begin VB.Frame frm_BoardNProcessor Caption = "Board And Processor" Height = 1215 Left = 0 TabIndex = 21 Top = 2280 Width = 5655 Begin VB.ListBox list_Boards Height = 540 IntegralHeight = 0 'False Left = 120 TabIndex = 16 Top = 600 Width = 3255 End Begin VB.ListBox list_Processors Height = 540 IntegralHeight = 0 'False Left = 3480 TabIndex = 17 Top = 600 Width = 2055 End Begin VB.Label label_Board Caption = "Board:" Height = 255 Left = 120 TabIndex = 1 Top = 240 Width = 3255 End Begin VB.Label Label_Processor Caption = "Processor:" Height = 255 Left = 3480 TabIndex = 0 Top = 240 Width = 2175 End End Begin VB.CommandButton cmd_Cancel Cancel = -1 'True Caption = "Cancel" Height = 375 Left = 5760 TabIndex = 19 Top = 3120 Width = 1575 End Begin VB.CommandButton cmd_OK Caption = "OK" Default = -1 'True Height = 375 Left = 5760 TabIndex = 18 Top = 2760 Width = 1575 End Begin VB.Frame frm_ChannelReadWrite BackColor = &H8000000A& Caption = "Channel Type" Height = 1215 Left = 3720 TabIndex = 20 Top = 0 Width = 1935 Begin VB.OptionButton opt_WriteChannel Caption = "Write Only Channel" Height = 375 Left = 120 TabIndex = 10 Top = 720 Width = 1695 End Begin VB.OptionButton opt_ReadChannel BackColor = &H8000000A& Caption = "Read Only Channel" Height = 375 Left = 120 TabIndex = 9 Top = 240 Width = 1695 End End Begin VB.Frame frm_ChannelIntSize BackColor = &H8000000A& Caption = "Data Type" Height = 2655 Left = 5760 TabIndex = 5 Top = 0 Width = 1575 Begin VB.OptionButton opt_64BitFloat Caption = "64-Bit Float" Enabled = 0 'False Height = 375 Left = 120 TabIndex = 15 Top = 2160 Width = 1335 End Begin VB.OptionButton opt_32BitFloat Caption = "32-Bit Float" Enabled = 0 'False Height = 375 Left = 120 TabIndex = 14 Top = 1680 Width = 1335 End Begin VB.OptionButton opt_32BitInteger Caption = "32-Bit Integer" Height = 375 Left = 120 TabIndex = 13 Top = 1200 Width = 1335 End Begin VB.OptionButton opt_16BitInteger Caption = "16-Bit Integer" Height = 375 Left = 120 TabIndex = 12 Top = 720 Width = 1335 End Begin VB.OptionButton opt_8BitInteger Caption = "8-Bit Integer" Enabled = 0 'False Height = 375 Left = 120 TabIndex = 11 Top = 240 Width = 1335 End EndEndAttribute VB_Name = "GPDPpg"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseOption ExplicitPublic CCSetup As ObjectPublic CurrentSelectedBoard As StringPublic CurrentSelectedProcessor As StringPublic DataTypeOption As StringPublic ChannelTypeOption As StringPublic DataValid As BooleanPrivate Sub Form_Load() Dim status As Long Dim BoardName As String Dim ProcessorName As String ' Instantiate the Code Composer Setup SystemSetup coclass and obtain a ' pointer to the ISystemSetup interface Set CCSetup = CreateObject("CodeComposerSetup.SystemSetup") ' Get Available Boards and Processors If (GetAvailableBoards) Then ' Set the selected board to 0 list_Boards.Selected(0) = True End If ' Set default values for text boxes txt_ChannelName = "" txt_MaxMessages = "" txt_MaxMembers = "" ' Set current channel type to Read opt_ReadChannel.Value = True ChannelTypeOption = TYPE_READ_ONLY ' Set current data type to 16-bit integer opt_16BitInteger.Value = True DataTypeOption = TYPE_16BIT_INTEGER DataValid = FalseEnd SubPrivate Sub Form_Unload(Cancel As Integer) Set CCSetup = NothingEnd SubPrivate Sub cmd_Cancel_Click() ' Hide the property page GPDPpg.HideEnd SubPrivate Sub cmd_OK_Click() ' If input values are valid then hide the property page If (Input_Values_Valid()) Then GPDPpg.Hide End IfEnd SubPrivate Function Input_Values_Valid() As Boolean Dim char_incr As Integer ' Test input values If (txt_ChannelName.Text = "") Then MsgBox ("Error: Channel name has not been included") DataValid = False Input_Values_Valid = DataValid Exit Function End If If (((Val(txt_MaxMessages.Text)) <= 0) Or (txt_MaxMessages.Text = "")) Then MsgBox ("Error: MAX MESSAGES must be greater than 0!") DataValid = False Input_Values_Valid = DataValid Exit Function End If If (((Val(txt_MaxMembers.Text)) <= 0) Or (txt_MaxMembers.Text = "")) Then MsgBox ("Error: MAX MEMBERS must be greater than 0!") DataValid = False Input_Values_Valid = DataValid Exit Function End If DataValid = True Input_Values_Valid = DataValid End FunctionPrivate Function GetAvailableBoards() As Boolean Dim status As Long Dim BoardName As String Dim ccsBoards As Object Dim ccsBoard As Object ' Initialize List list_Boards.Clear ' Get a pointer to the IBoards interface status = CCSetup.GetBoards(ccsBoards) ' Loop through the available boards, get the names of the boards, ' and add the board names to the boards list control For Each ccsBoard In ccsBoards ' Get the board name status = ccsBoard.GetName(BoardName) ' Append board name to the board list list_Boards.AddItem BoardName Next ' return True GetAvailableBoards = True Set ccsBoards = Nothing Set ccsBoard = NothingEnd FunctionPrivate Function GetAvailableProcessors(SelectedBoardName As String) As Boolean Dim status As Long Dim ProcessorName As String Dim ProcessorType As String Dim ccsBoard As Object Dim ccsProcessors As Object Dim ccsProcessor As Object ' Initialize List list_Processors.Clear ' Get a pointer to the IBoard interface for the selected board status = CCSetup.GetBoardByName(SelectedBoardName, ccsBoard) ' Get a pointer to the IProcessors interface status = ccsBoard.GetProcessors(ccsProcessors) ' Loop through the available processors, get the names of the ' processors, and add the processors to the processors list ' control For Each ccsProcessor In ccsProcessors ' Get the processor name status = ccsProcessor.GetName(ProcessorName) status = ccsProcessor.GetType(ProcessorType) ' Append processor name to the processor list list_Processors.AddItem ProcessorName Next ' Return True GetAvailableProcessors = TrueEnd FunctionPrivate Sub list_Boards_Click() ' Clear processor list list_Processors.Clear ' Get current selected board CurrentSelectedBoard = list_Boards.List(list_Boards.ListIndex) ' Get available processors for that board If (GetAvailableProcessors(CurrentSelectedBoard)) Then ' Set the selected processor to 0 list_Processors.Selected(0) = True End IfEnd SubPrivate Sub list_Processors_Click() ' Get current selected processor CurrentSelectedProcessor = list_Processors.List(list_Processors.ListIndex) ' Set data type based on target type. ' - not done yet... End SubPrivate Sub opt_16BitInteger_Click() DataTypeOption = TYPE_16BIT_INTEGEREnd SubPrivate Sub opt_32BitFloat_Click() DataTypeOption = TYPE_32BIT_FLOATEnd SubPrivate Sub opt_32BitInteger_Click() DataTypeOption = TYPE_32BIT_INTEGEREnd SubPrivate Sub opt_64BitFloat_Click() DataTypeOption = TYPE_64BIT_FLOATEnd SubPrivate Sub opt_8BitInteger_Click() DataTypeOption = TYPE_8BIT_INTEGEREnd SubPrivate Sub opt_ReadChannel_Click() ChannelTypeOption = TYPE_READ_ONLYEnd SubPrivate Sub opt_WriteChannel_Click() ChannelTypeOption = TYPE_WRITE_ONLYEnd SubPrivate Sub txt_ChannelName_KeyPress(KeyAscii As Integer) If (KeyAscii = 8) Then ' backspace ElseIf ((KeyAscii >= Asc("A")) And (KeyAscii <= Asc("Z"))) Then ElseIf ((KeyAscii >= Asc("a")) And (KeyAscii <= Asc("z"))) Then ElseIf (KeyAscii = Asc("_")) Then ElseIf ((Len(txt_ChannelName) > 0) And _ ((KeyAscii >= Asc("0")) And (KeyAscii <= Asc("9")))) Then ' first character must be non-numeric. Else KeyAscii = 0 ' reject all special characters. End If End SubPrivate Sub txt_MaxMembers_KeyPress(KeyAscii As Integer) ' Reject all non-numeric characters If (KeyAscii = 8) Then ' backspace ElseIf ((KeyAscii >= Asc("0")) And (KeyAscii <= Asc("9"))) Then Else KeyAscii = 0 End IfEnd SubPrivate Sub txt_MaxMessages_KeyPress(KeyAscii As Integer) ' Make sure that key pressed is a numeric character If (KeyAscii = 8) Then ' backspace ElseIf ((KeyAscii >= Asc("0")) And (KeyAscii <= Asc("9"))) Then Else KeyAscii = 0 End IfEnd Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -