⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmbasicconfig.frm

📁 一个不错的数控源码是vb的
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         End
         Begin VB.HScrollBar ScroFactor0 
            Height          =   255
            Index           =   2
            Left            =   2640
            TabIndex        =   4
            Top             =   1320
            Width           =   2175
         End
         Begin VB.HScrollBar ScroFactor0 
            Height          =   255
            Index           =   1
            Left            =   2640
            TabIndex        =   3
            Top             =   840
            Width           =   2175
         End
         Begin VB.HScrollBar ScroFactor0 
            Height          =   255
            Index           =   0
            Left            =   2640
            TabIndex        =   2
            Top             =   360
            Width           =   2175
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            Caption         =   "一轴比例"
            Height          =   180
            Index           =   0
            Left            =   480
            TabIndex        =   10
            Top             =   360
            Width           =   720
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            Caption         =   "二轴比例"
            Height          =   180
            Index           =   3
            Left            =   480
            TabIndex        =   9
            Top             =   840
            Width           =   720
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            Caption         =   "三轴比例"
            Height          =   180
            Index           =   6
            Left            =   480
            TabIndex        =   8
            Top             =   1320
            Width           =   720
         End
      End
      Begin VB.HScrollBar scroGFactor 
         Height          =   255
         Left            =   -72960
         Max             =   1000
         TabIndex        =   36
         Top             =   2880
         Width           =   1335
      End
      Begin VB.HScrollBar scroSpaceHight 
         Height          =   255
         Left            =   2280
         Max             =   200
         TabIndex        =   38
         Top             =   3000
         Width           =   1095
      End
      Begin VB.HScrollBar scroButtom 
         Height          =   255
         Left            =   -72840
         Max             =   20
         TabIndex        =   49
         Top             =   5160
         Width           =   1455
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         Caption         =   "加工后退刀距离:"
         Height          =   180
         Left            =   960
         TabIndex        =   53
         Top             =   4560
         Width           =   1440
      End
      Begin VB.Label Label8 
         Caption         =   "    在这里设置第一次和第二次铣底的深度占一次铣底深度的比率。"
         Height          =   375
         Left            =   -74040
         TabIndex        =   52
         Top             =   960
         Width           =   3855
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "清根深度"
         Height          =   180
         Left            =   -74160
         TabIndex        =   51
         Top             =   5160
         Width           =   720
      End
      Begin VB.Label Label6 
         Caption         =   "mm"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   -71160
         TabIndex        =   50
         Top             =   5160
         Width           =   375
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "请在这里设置刀具悬留在材料上方的安全高度。"
         Height          =   180
         Left            =   960
         TabIndex        =   40
         Top             =   1920
         Width           =   3780
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "安全高度:"
         Height          =   180
         Left            =   1200
         TabIndex        =   39
         Top             =   3000
         Width           =   900
      End
      Begin VB.Label Label1 
         Caption         =   "    在这里输入在主界面的图形框中显示的刀具运动轨迹的比例。"
         Height          =   615
         Left            =   -74040
         TabIndex        =   34
         Top             =   1680
         Width           =   3495
      End
   End
End
Attribute VB_Name = "frmBasicConfig"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim MaxFactor As Long

Private Sub cmdApply_Click()
    GetfrmBasicConfigParam
End Sub

Private Sub cmdCancel_Click()
    Unload frmBasicConfig
End Sub

Private Sub cmdOK_Click()
    GetfrmBasicConfigParam
    Unload frmBasicConfig
End Sub

Public Sub GetfrmBasicConfigParam()
    Dim i As Long
    
    For i = 0 To 2
        ProcessFactor(0, i) = txtFactor0(i)
        ProcessFactor(1, i) = txtFactor1(i)
        ProcessFactor(2, i) = txtFactor2(i)
    Next i
        
    gFactor = Val(txtGFactor.Text)
    SpaceHight = Val(txtSpaceHight.Text)
    Buttom = txtButtom.Text
    BackSpace = txtBackSpace.Text
    
    SwapFactor(0) = txtSwapFactor(0).Text
    SwapFactor(1) = txtSwapFactor(1).Text
End Sub

Private Sub Form_Load()
    Dim i As Long
    
    ''''''''''''''''''''''''''''''''''''''''''''''
    '根据参数设定界面
    ''''''''''''''''''''''
    '加工比例选项卡
    For i = 0 To 2
        txtFactor0(i).Text = ProcessFactor(0, i)
        txtFactor1(i).Text = ProcessFactor(1, i)
        txtFactor2(i).Text = ProcessFactor(2, i)
    Next i
    
    GetMaxFactor
    
    For i = 0 To 2
        ScroFactor0(i).Max = MaxFactor * 2
        ScroFactor1(i).Max = MaxFactor * 2
        ScroFactor2(i).Max = MaxFactor * 2
        
        ScroFactor0(i).Value = Val(txtFactor0(i).Text)
        ScroFactor1(i).Value = Val(txtFactor1(i).Text)
        ScroFactor2(i).Value = Val(txtFactor2(i).Text)
    Next i
    ''''''''''''''''''''''
    '图形比例选项卡
    txtGFactor.Text = gFactor
    txtSpaceHight.Text = SpaceHight
    txtButtom.Text = Buttom
    txtBackSpace.Text = BackSpace

    txtSwapFactor(0).Text = SwapFactor(0)
    txtSwapFactor(1).Text = SwapFactor(1)
End Sub

Private Sub GetMaxFactor()
    Dim i As Long
    
    MaxFactor = ProcessFactor(0, 0)
    
    For i = 0 To 2
        If txtFactor0(i).Text > MaxFactor Then
            MaxFactor = txtFactor0(i).Text
        End If
        
        If txtFactor1(i).Text > MaxFactor Then
            MaxFactor = txtFactor1(i).Text
        End If
        
        If txtFactor1(i).Text > MaxFactor Then
            MaxFactor = txtFactor1(i).Text
        End If
    Next i
End Sub

Private Sub HScroll1_Change()

End Sub

Private Sub scroButtom_Change()
    txtButtom.Text = scroButtom.Value
End Sub

Private Sub ScroFactor0_Change(Index As Integer)
    txtFactor0(Index).Text = ScroFactor0(Index).Value
End Sub

Private Sub ScroFactor1_Change(Index As Integer)
    txtFactor1(Index).Text = ScroFactor1(Index).Value
End Sub

Private Sub ScroFactor2_Change(Index As Integer)
    txtFactor2(Index).Text = ScroFactor2(Index).Value
End Sub

Private Sub scroSpaceHight_Change()
    txtSpaceHight.Text = scroSpaceHight.Value
End Sub

Private Sub scroSwapFactor_Change(Index As Integer)
    txtSwapFactor(Index).Text = scroSwapFactor(Index).Value / 10#
End Sub

Private Sub Text1_Change()

End Sub

Private Sub txtButtom_Change()
    If txtButtom.Text >= 20 Then
        txtButtom.Text = 20
    End If
    
    scroButtom.Value = txtButtom.Text
End Sub

Private Sub txtFactor0_Change(Index As Integer)
    Dim i As Long
    
    If txtFactor0(Index).Text > 20000 Then
        txtFactor0(Index).Text = 20000
    End If
    
    If txtFactor0(Index).Text > MaxFactor * 2 Then
        MaxFactor = txtFactor0(Index)
    Else
        GetMaxFactor
    End If
    
    If MaxFactor > 10000 Then
        MaxFactor = 10000
    End If
    
    For i = 0 To 2
        ScroFactor0(i).Max = MaxFactor * 2
        ScroFactor1(i).Max = MaxFactor * 2
        ScroFactor2(i).Max = MaxFactor * 2
        
        ScroFactor0(i).Value = Val(txtFactor0(i).Text)
        ScroFactor1(i).Value = Val(txtFactor1(i).Text)
        ScroFactor2(i).Value = Val(txtFactor2(i).Text)
    Next i
    
    ScroFactor0(Index).Value = txtFactor0(Index).Text
End Sub

Private Sub txtFactor1_Change(Index As Integer)
    Dim i As Long
    
    If txtFactor1(Index).Text > 20000 Then
        txtFactor0(Index).Text = 20000
    End If
    
    If txtFactor1(Index).Text > MaxFactor * 2 Then
        MaxFactor = txtFactor1(Index)
    Else
        GetMaxFactor
    End If
    
    If MaxFactor > 10000 Then
        MaxFactor = 10000
    End If
    
    For i = 0 To 2
        ScroFactor0(i).Max = MaxFactor * 2
        ScroFactor1(i).Max = MaxFactor * 2
        ScroFactor2(i).Max = MaxFactor * 2
        
        ScroFactor0(i).Value = Val(txtFactor0(i).Text)
        ScroFactor1(i).Value = Val(txtFactor1(i).Text)
        ScroFactor2(i).Value = Val(txtFactor2(i).Text)
    Next i
    
    ScroFactor1(Index).Value = txtFactor1(Index).Text
End Sub

Private Sub txtFactor2_Change(Index As Integer)
    Dim i As Long
    
    If txtFactor2(Index).Text > 20000 Then
        txtFactor2(Index).Text = 20000
    End If
    
    If txtFactor2(Index).Text > MaxFactor * 2 Then
        MaxFactor = txtFactor2(Index)
    Else
        GetMaxFactor
    End If
    
    If MaxFactor > 10000 Then
        MaxFactor = 10000
    End If
    
    For i = 0 To 2
        ScroFactor0(i).Max = MaxFactor * 2
        ScroFactor1(i).Max = MaxFactor * 2
        ScroFactor2(i).Max = MaxFactor * 2
        
        ScroFactor0(i).Value = Val(txtFactor0(i).Text)
        ScroFactor1(i).Value = Val(txtFactor1(i).Text)
        ScroFactor2(i).Value = Val(txtFactor2(i).Text)
    Next i
    
    ScroFactor2(Index).Value = txtFactor2(Index).Text
End Sub

Private Sub txtGFactor_Change()
    If txtGFactor.Text >= 1 Then
        txtGFactor.Text = 1
    End If
    
    scroGFactor.Value = txtGFactor.Text * 1000#
End Sub

Private Sub scroGFactor_Change()
    txtGFactor.Text = scroGFactor.Value / 1000#
End Sub

Private Sub txtSpaceHight_Change()
    If txtSpaceHight.Text >= 200 Then
        txtSpaceHight.Text = 200
    End If
    
    scroSpaceHight.Value = txtSpaceHight.Text
End Sub

Private Sub txtSwapFactor_Change(Index As Integer)
    If txtSwapFactor(Index).Text >= 1# Then
        txtSwapFactor(Index).Text = 1#
    End If
    
    scroSwapFactor(Index).Value = txtSwapFactor(Index).Text * 10#
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -