📄 rtdxfrm.frm
字号:
Begin VB.Label Label2 BackColor = &H00800000& BorderStyle = 1 'Fixed Single Caption = "CHANNEL NAME" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FFFFFF& Height = 375 Left = 0 TabIndex = 14 Top = 2520 Width = 1815 End Begin VB.Label Label4 BackColor = &H00800000& BorderStyle = 1 'Fixed Single Caption = "MAX MEMBERS" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FFFFFF& Height = 375 Left = 0 TabIndex = 13 ToolTipText = "(COLUMNS)" Top = 3480 Width = 1815 End Begin VB.Label Label3 BackColor = &H00800000& BorderStyle = 1 'Fixed Single Caption = "MAX MESSAGES" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FFFFFF& Height = 375 Left = 0 TabIndex = 12 ToolTipText = "(ROWS)" Top = 3000 Width = 1815 End Begin VB.Image TI_logo BorderStyle = 1 'Fixed Single Enabled = 0 'False Height = 1815 Left = 0 Picture = "rtdxfrm.frx":0340 Stretch = -1 'True Top = 0 Width = 1815 End Begin VB.Menu mnu_Operations Caption = "&Operations" Begin VB.Menu mnu_Start Caption = "St&art" Shortcut = ^R End Begin VB.Menu mnu_Stop Caption = "&Stop" Shortcut = ^S End Begin VB.Menu mnu_Quit Caption = "&Quit" Shortcut = ^Q End EndEndAttribute VB_Name = "RTDX_frm"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseOption Explicit'*********************************************' This Display shows how a Visual Basic *' program can be used to analyze data with *' Texas Instruments' Real Time Data Exchange *' RTDX(TM) Technology. *' *' Need Msflxgrid.ocx for VB5.0 *' or Grid32.ocx for VB4.0 *' *' The Code located in between these comments *' '########## RTDX(TM) ##########' are *' important for RTDX(TM). *' *' Copyright 1997-1998 Texas Instruments *'*********************************************#Const DIRECT_INTERFACE_CONNECTION = 0Const RTDXHELPFILE = "\GPDISPLAY.HLP"' Form and control orignal size and positionsConst FORM_START_WIDTH = 3840Const FORM_START_HEIGHT = 5580Const TI_LOGO_START_WIDTH = 1815Const TI_LOGO_START_HEIGHT = 1815Const TI_LOGO_START_LEFT = 0Const TI_LOGO_START_TOP = 0Const CMD_TOGGLE_START_WIDTH = 1815Const CMD_TOGGLE_START_HEIGHT = 375Const CMD_TOGGLE_START_LEFT = 1920Const CMD_TOGGLE_START_TOP = 0Const CMD_ADD_CHANNEL_START_WIDTH = 1815Const CMD_ADD_CHANNEL_START_HEIGHT = 375Const CMD_ADD_CHANNEL_START_LEFT = 1920Const CMD_ADD_CHANNEL_START_TOP = 360Const CMD_MODIFY_CHANNEL_START_WIDTH = 1815Const CMD_MODIFY_CHANNEL_START_HEIGHT = 375Const CMD_MODIFY_CHANNEL_START_LEFT = 1920Const CMD_MODIFY_CHANNEL_START_TOP = 720Const CMD_DELETE_CHANNEL_START_WIDTH = 1815Const CMD_DELETE_CHANNEL_START_HEIGHT = 375Const CMD_DELETE_CHANNEL_START_LEFT = 1920Const CMD_DELETE_CHANNEL_START_TOP = 1080Const CMD_RESET_START_WIDTH = 1815Const CMD_RESET_START_HEIGHT = 375Const CMD_RESET_START_LEFT = 1920Const CMD_RESET_START_TOP = 1440Const CMD_VIEW_CHANNEL_START_WIDTH = 1815Const CMD_VIEW_CHANNEL_START_HEIGHT = 450Const CMD_VIEW_CHANNEL_START_LEFT = 1920Const CMD_VIEW_CHANNEL_START_TOP = 1920Const CHANNEL_NAME_START_WIDTH = 1815Const CHANNEL_NAME_START_HEIGHT = 375Const CHANNEL_NAME_START_LEFT = 1920Const CHANNEL_NAME_START_TOP = 2520Const MAX_MESSAGES_START_WIDTH = 1815Const MAX_MESSAGES_START_HEIGHT = 375Const MAX_MESSAGES_START_LEFT = 1920Const MAX_MESSAGES_START_TOP = 3000Const MAX_MEMBERS_START_WIDTH = 1815Const MAX_MEMBERS_START_HEIGHT = 375Const MAX_MEMBERS_START_LEFT = 1920Const MAX_MEMBERS_START_TOP = 3480Const IO_TYPE_START_WIDTH = 375Const IO_TYPE_START_HEIGHT = 450Const IO_TYPE_START_LEFT = 1080Const IO_TYPE_START_TOP = 3960Const INT_TYPE_START_WIDTH = 615Const INT_TYPE_START_HEIGHT = 450Const INT_TYPE_START_LEFT = 3120Const INT_TYPE_START_TOP = 3960Const NUM_CHANNELS_START_WIDTH = 975Const NUM_CHANNELS_START_HEIGHT = 375Const NUM_CHANNELS_START_LEFT = 2760Const NUM_CHANNELS_START_TOP = 4560Const LABEL1_START_WIDTH = 1815Const LABEL1_START_HEIGHT = 375Const LABEL1_START_LEFT = 0Const LABEL1_START_TOP = 1920Const LABEL2_START_WIDTH = 1815Const LABEL2_START_HEIGHT = 375Const LABEL2_START_LEFT = 0Const LABEL2_START_TOP = 2520Const LABEL3_START_WIDTH = 1815Const LABEL3_START_HEIGHT = 375Const LABEL3_START_LEFT = 0Const LABEL3_START_TOP = 3000Const LABEL4_START_WIDTH = 1815Const LABEL4_START_HEIGHT = 375Const LABEL4_START_LEFT = 0Const LABEL4_START_TOP = 3480Const LABEL5_START_WIDTH = 975Const LABEL5_START_HEIGHT = 375Const LABEL5_START_LEFT = 0Const LABEL5_START_TOP = 3960Const LABEL6_START_WIDTH = 1455Const LABEL6_START_HEIGHT = 375Const LABEL6_START_LEFT = 1560Const LABEL6_START_TOP = 3960Const LABEL7_START_WIDTH = 2655Const LABEL7_START_HEIGHT = 375Const LABEL7_START_LEFT = 0Const LABEL7_START_TOP = 4560' Array of Structures to hold channel AttributesDim RTDX_channel() As RTDX_Channel_Attributes' Array of Structures to hold Column break pointsDim Column_Point() As Column_Break_Points' Array of objects for multiple instatiation'########## RTDX(TM) ##########'Dim rtdx() As Object'########## RTDX(TM) ##########'' Array of Method attributesDim MethodValues() As RTDX_Method_AttributesDim chan_incr As Integer ' Channel incrementerDim on_off_toggle As Boolean ' On/Off toggle flagDim channel_number As Integer ' Global channel number variablePublic Sub Init_Prog() ' Shut off toggle switch on_off_toggle = False NUM_CHANNELS.Text = 0 CHANNEL_NAME.Text = "" IO_TYPE.Text = "R" MAX_MEMBERS.Text = "" MAX_MESSAGES.Text = "" INT_TYPE.Text = "32-Bit" chan_incr = 0 ' Disable controls that require an existing channel cmd_Delete_Channel.Enabled = False cmd_Reset.Enabled = False cmd_Modify_Channel.Enabled = False cmd_Toggle.Enabled = False mnu_Start.Enabled = False ' Disable Number of channel text box NUM_CHANNELS.Enabled = FalseEnd SubPublic Sub Init_Grid()'initialize gridDim total_columns As LongDim total_rows As LongDim channel_counter As IntegerDim colinc As LongDim rowinc As Long ' Set the number of Rows and Columns ' Find the biggest max message of all the channels For channel_counter = 0 To (Val(NUM_CHANNELS.Text) - 1) If total_rows < RTDX_channel(channel_counter).messages Then total_rows = RTDX_channel(channel_counter).messages End If Next channel_counter RTDX_gridfrm.RTDX_grid.Rows = total_rows + 1 ' Find the total amount of columns needed for all the channels For channel_counter = 0 To (Val(NUM_CHANNELS.Text) - 1) ' If the current channel is not the last channel then ' add max members to total columns, plus an additional ' column. Otherwise, just add max members. This will ' make sure that we have just enough columns. total_columns = total_columns + _ RTDX_channel(channel_counter).members If channel_counter < (Val(NUM_CHANNELS.Text) - 1) Then total_columns = total_columns + 1 End If Next channel_counter RTDX_gridfrm.RTDX_grid.Cols = total_columns + 1 ' Set up the range of cell values (Needed for VB4.0) 'RTDX_gridfrm.RTDX_grid.SelStartCol = 1 'RTDX_gridfrm.RTDX_grid.SelStartRow = 1 'RTDX_gridfrm.RTDX_grid.SelEndCol = total_columns 'RTDX_gridfrm.RTDX_grid.SelEndRow = Val(MAX_MESSAGES.Text) ' Clear Grid RTDX_gridfrm.RTDX_grid.Clear ' Label rows RTDX_gridfrm.RTDX_grid.Col = 0 For rowinc = 1 To total_rows RTDX_gridfrm.RTDX_grid.Row = rowinc RTDX_gridfrm.RTDX_grid = rowinc Next rowinc ' Make an array to hold column locations per channel object ReDim Column_Point(Val(NUM_CHANNELS.Text)) As Column_Break_Points ' Label columns & set column locations per channel RTDX_gridfrm.RTDX_grid.Row = 0 For channel_counter = 0 To (Val(NUM_CHANNELS.Text) - 1) If channel_counter = 0 Then Column_Point(0).Start_Point = 1 Column_Point(0).End_Point = (RTDX_channel(0).members) Else ' Leave blank column between channels Column_Point(channel_counter).Start_Point = _ Column_Point(channel_counter - 1).End_Point + 2 Column_Point(channel_counter).End_Point = _ Column_Point(channel_counter).Start_Point + _ Val(RTDX_channel(channel_counter).members) - 1 End If ' Label column with channel name and member number RTDX_gridfrm.RTDX_grid.Col = _ Column_Point(channel_counter).Start_Point RTDX_gridfrm.RTDX_grid = _ RTDX_channel(channel_counter).name For colinc = 2 To RTDX_channel(channel_counter).members RTDX_gridfrm.RTDX_grid.Col = _ colinc + Column_Point(channel_counter).Start_Point - 1 RTDX_gridfrm.RTDX_grid = colinc Next colinc Next channel_counter ' Set width of every column For colinc = 1 To total_columns RTDX_gridfrm.RTDX_grid.ColWidth(colinc) = 1000 Next colinc End SubPublic Sub Init_Row_Col_Start_Points()' Initialize column start points for all channelsDim RC_channel_counter As Integer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -