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

📄 frmsetup.frm

📁 多达5路DTu的信息接收客户端
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Top             =   2040
         Width           =   375
      End
      Begin VB.CheckBox ChkTongDao2 
         Caption         =   "8"
         Height          =   255
         Index           =   7
         Left            =   1680
         TabIndex        =   64
         Top             =   2040
         Width           =   375
      End
      Begin VB.Label Label15 
         Caption         =   "搜索以下模块:"
         Height          =   255
         Left            =   120
         TabIndex        =   79
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label Label14 
         Caption         =   "搜索以下通道:"
         Height          =   255
         Left            =   120
         TabIndex        =   78
         Top             =   1440
         Width           =   1335
      End
   End
   Begin VB.OptionButton OptDtu 
      Caption         =   "五"
      Height          =   255
      Index           =   4
      Left            =   2640
      Style           =   1  'Graphical
      TabIndex        =   45
      Top             =   1200
      Width           =   495
   End
   Begin VB.OptionButton OptDtu 
      Caption         =   "四"
      Height          =   255
      Index           =   3
      Left            =   2640
      Style           =   1  'Graphical
      TabIndex        =   44
      Top             =   960
      Width           =   495
   End
   Begin VB.OptionButton OptDtu 
      Caption         =   "三"
      Height          =   255
      Index           =   2
      Left            =   2640
      Style           =   1  'Graphical
      TabIndex        =   43
      Top             =   720
      Width           =   495
   End
   Begin VB.OptionButton OptDtu 
      Caption         =   "二"
      Height          =   255
      Index           =   1
      Left            =   2640
      Style           =   1  'Graphical
      TabIndex        =   42
      Top             =   480
      Width           =   495
   End
   Begin VB.OptionButton OptDtu 
      Caption         =   "一"
      Height          =   255
      Index           =   0
      Left            =   2640
      Style           =   1  'Graphical
      TabIndex        =   41
      Top             =   240
      Value           =   -1  'True
      Width           =   495
   End
   Begin VB.Frame Frame4 
      Caption         =   "系统配置"
      Height          =   615
      Left            =   120
      TabIndex        =   37
      Top             =   3480
      Width           =   5295
      Begin VB.OptionButton OptCommand 
         Caption         =   "不接受"
         Height          =   255
         Index           =   0
         Left            =   3480
         TabIndex        =   40
         Top             =   240
         Width           =   975
      End
      Begin VB.OptionButton OptCommand 
         Caption         =   "接受"
         Height          =   255
         Index           =   1
         Left            =   2160
         TabIndex        =   39
         Top             =   240
         Value           =   -1  'True
         Width           =   975
      End
      Begin VB.Label Label11 
         Caption         =   "是否接受命令行命令:"
         Height          =   255
         Left            =   240
         TabIndex        =   38
         Top             =   240
         Width           =   1935
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "断线检测"
      Height          =   615
      Left            =   5520
      TabIndex        =   32
      Top             =   1440
      Width           =   5295
      Begin VB.TextBox TxtXtDis 
         Height          =   270
         Left            =   3480
         TabIndex        =   36
         Top             =   240
         Width           =   1695
      End
      Begin VB.TextBox TxtXt 
         Height          =   270
         Left            =   1200
         TabIndex        =   35
         Top             =   240
         Width           =   1095
      End
      Begin VB.Label Label9 
         Caption         =   "间隔时间:"
         Height          =   255
         Left            =   2520
         TabIndex        =   34
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label8 
         Caption         =   "心 跳 包:"
         Height          =   255
         Left            =   240
         TabIndex        =   33
         Top             =   240
         Width           =   975
      End
   End
   Begin VB.CommandButton CmdOk 
      Caption         =   "保存并退出设置"
      Height          =   375
      Left            =   7320
      TabIndex        =   31
      Top             =   3720
      Width           =   1575
   End
   Begin VB.CommandButton CmdExit 
      Caption         =   "取消"
      Height          =   375
      Left            =   9360
      TabIndex        =   30
      Top             =   3720
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Caption         =   "DTU标识设置"
      Height          =   2535
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2415
      Begin VB.OptionButton OptDtuSort 
         Caption         =   "按照DTU连接顺序排序"
         Height          =   255
         Index           =   0
         Left            =   240
         TabIndex        =   13
         Top             =   2160
         Width           =   2055
      End
      Begin VB.OptionButton OptDtuSort 
         Caption         =   "按照DTU标识设置排序"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   12
         Top             =   1920
         Value           =   -1  'True
         Width           =   2055
      End
      Begin VB.TextBox TxtSim 
         Height          =   270
         Index           =   5
         Left            =   1080
         MaxLength       =   11
         TabIndex        =   11
         Top             =   1320
         Width           =   1095
      End
      Begin VB.TextBox TxtSim 
         Height          =   270
         Index           =   4
         Left            =   1080
         MaxLength       =   11
         TabIndex        =   10
         Top             =   1080
         Width           =   1095
      End
      Begin VB.TextBox TxtSim 
         Height          =   270
         Index           =   3
         Left            =   1080
         MaxLength       =   11
         TabIndex        =   9
         Top             =   840
         Width           =   1095
      End
      Begin VB.TextBox TxtSim 
         Height          =   270
         Index           =   2
         Left            =   1080
         MaxLength       =   11
         TabIndex        =   8
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox TxtSim 
         Height          =   270
         Index           =   1
         Left            =   1080
         MaxLength       =   11
         TabIndex        =   7
         Top             =   360
         Width           =   1095
      End
      Begin VB.Line Line1 
         X1              =   240
         X2              =   2160
         Y1              =   1800
         Y2              =   1800
      End
      Begin VB.Label Label5 
         Caption         =   "五号DTU:"
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   1400
         Width           =   855
      End
      Begin VB.Label Label4 
         Caption         =   "四号DTU:"
         Height          =   255
         Left            =   240
         TabIndex        =   5
         Top             =   1150
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "三号DTU:"
         Height          =   255
         Left            =   240
         TabIndex        =   4
         Top             =   900
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "二号DTU:"
         Height          =   255
         Left            =   240
         TabIndex        =   3
         Top             =   650
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "一号DTU:"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   400
         Width           =   855
      End
   End
End
Attribute VB_Name = "FrmSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub CmdExit_Click()
    Unload Me
End Sub

Private Sub CmdOk_Click()
    If FunCheck Then
        Call SetToRam
        Call SaveSetup
        
        FrmMain.TimerTestRemote.Interval = RemoteTime * 1000
        FrmMain.TimerTestRemote = isUseRemote
        
        FrmMain.TimerClose = isUseClose
        
        Unload Me
    Else
        MsgBox "1,数据为空或重复,DTU SIM卡号码必须为11位" & vbNewLine & _
        "2,模块和通道至少要选一项!" & vbNewLine & _
        "3,等待时间与心跳包间隔不能小于等于0", vbInformation, "发生错误"
    End If
End Sub

Private Sub Form_Load()
    Call LoadSetup
    Call SetToTxt
End Sub
Sub SetToRam()
    Dim x As Integer
    
    For x = 1 To 5
        sDianId(x, 2) = TxtSim(x)
    Next
    
    For x = 1 To 6
        SerMod(1, x) = (Not ChkMod(x).Value) + 1
        SerMod(2, x) = (Not ChkMod1(x).Value) + 1
        SerMod(3, x) = (Not ChkMod2(x).Value) + 1
        SerMod(4, x) = (Not ChkMod3(x).Value) + 1
        SerMod(5, x) = (Not ChkMod4(x).Value) + 1
    Next
    
    For x = 0 To 7
        SerTongDao(1, x) = (Not ChkTongDao(x).Value) + 1
        SerTongDao(2, x) = (Not ChkTongDao1(x).Value) + 1
        SerTongDao(3, x) = (Not ChkTongDao2(x).Value) + 1
        SerTongDao(4, x) = (Not ChkTongDao3(x).Value) + 1
        SerTongDao(5, x) = (Not ChkTongDao4(x).Value) + 1
    Next
    
    isSort = OptDtuSort(1).Value
    isReCommand = OptCommand(1).Value
    isUseRemote = OptRemote(1).Value
    iWaitTime = CInt(TxtTongDaoTime)
    iTimer = CInt(TxtTimer)
    sXinTiao = TxtXt.Text
    iXinTiao = CInt(TxtXtDis.Text)
    RemoteUrl = TxtRemote
    RemoteTime = CInt(TxtRemoteTime)
    isUseClose = OptIsClose(1).Value
    iCloseTime = CInt(TxtCloseTime)
End Sub
Sub SetToTxt()
    Dim x As Integer
    
    For x = 1 To 5
        TxtSim(x) = sDianId(x, 2)
    Next
    
    For x = 1 To 6
        ChkMod(x).Value = CInt(Not SerMod(1, x)) + 1
        ChkMod1(x).Value = CInt(Not SerMod(2, x)) + 1
        ChkMod2(x).Value = CInt(Not SerMod(3, x)) + 1
        ChkMod3(x).Value = CInt(Not SerMod(4, x)) + 1
        ChkMod4(x).Value = CInt(Not SerMod(5, x)) + 1
    Next
    
    For x = 0 To 7
        ChkTongDao(x).Value = CInt(Not SerTongDao(1, x)) + 1
        ChkTongDao1(x).Value = CInt(Not SerTongDao(2, x)) + 1
        ChkTongDao2(x).Value = CInt(Not SerTongDao(3, x)) + 1
        ChkTongDao3(x).Value = CInt(Not SerTongDao(4, x)) + 1
        ChkTongDao4(x).Value = CInt(Not SerTongDao(5, x)) + 1
    Next
    
    OptDtuSort(CInt(Not isSort) + 1).Value = True
    OptCommand(CInt(Not isReCommand) + 1).Value = True
    OptRemote(CInt(Not isUseRemote) + 1).Value = True
    OptIsClose(CInt(Not isUseRemote) + 1).Value = True
    
    TxtTongDaoTime = CStr(iWaitTime)
    TxtTimer = CStr(iTimer)
    TxtXt = CStr(sXinTiao)
    TxtXtDis = CStr(iXinTiao)
    TxtRemote = RemoteUrl
    TxtRemoteTime = CStr(RemoteTime)
    TxtCloseTime = CStr(iCloseTime)
End Sub

Private Sub OptDtu_Click(Index As Integer)
    For x = 0 To 4
        FamDtu(x).Visible = False
    Next
    FamDtu(Index).Visible = True
End Sub

Private Sub TxtSim_KeyPress(Index As Integer, KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 Then
        If KeyAscii <> 8 Then KeyAscii = 0
    End If
End Sub


Function FunCheck() As Boolean
    Dim x, y As Integer
    Dim BooChek As Boolean
    BooChek = False
    
    For x = 1 To 5
        If Len(TxtSim(x).Text) <> 11 Then FunCheck = False: Exit Function
        For y = 1 To 5
            If x <> y Then
                If TxtSim(x) = TxtSim(y) Then FunCheck = False: Exit Function
            End If
        Next
    Next
    
    For x = 1 To 6
        If ChkMod(x).Value = 1 Then BooChek = True
    Next
    If Not BooChek Then FunCheck = False: Exit Function
    
    For x = 0 To 7
        If ChkTongDao(x).Value = 1 Then BooChek = True
    Next
    If Not BooChek Then FunCheck = False: Exit Function
    
    If CInt(TxtTongDaoTime.Text) <= 0 Or CInt(TxtXtDis.Text) <= 0 Then
        FunCheck = False: Exit Function
    End If
    
    FunCheck = True
End Function

Private Sub TxtTongDaoTime_KeyPress(KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 Then
        If KeyAscii <> 8 Then KeyAscii = 0
    End If
End Sub

Private Sub TxtXtDis_KeyPress(KeyAscii As Integer)
    If KeyAscii > 57 Or KeyAscii < 48 Then
        If KeyAscii <> 8 Then KeyAscii = 0
    End If
End Sub

⌨️ 快捷键说明

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