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

📄 form_multicli.frm

📁 VB库存管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Frm_MultiCli 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "主机"
   ClientHeight    =   4395
   ClientLeft      =   150
   ClientTop       =   855
   ClientWidth     =   4590
   Icon            =   "Form_MultiCli.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4395
   ScaleWidth      =   4590
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame2 
      Height          =   1095
      Left            =   120
      TabIndex        =   3
      Top             =   2880
      Width           =   4455
      Begin VB.Frame Frame4 
         Height          =   735
         Left            =   120
         TabIndex        =   8
         Top             =   240
         Width           =   1695
         Begin VB.CommandButton Command4 
            Caption         =   "连接堆剁机"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   120
            TabIndex        =   9
            Top             =   240
            Width           =   1455
         End
      End
      Begin VB.Frame Frame3 
         Height          =   735
         Left            =   1920
         TabIndex        =   5
         Top             =   240
         Width           =   2415
         Begin VB.CommandButton Command2 
            Caption         =   "存  货"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   120
            TabIndex        =   7
            Top             =   240
            Width           =   975
         End
         Begin VB.CommandButton Command7 
            Caption         =   "取  货"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   1320
            TabIndex        =   6
            Top             =   240
            Width           =   975
         End
      End
      Begin VB.CommandButton Command1 
         Height          =   375
         Left            =   -1200
         TabIndex        =   4
         Top             =   1320
         Width           =   1815
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "堆剁机返回数据:"
      Height          =   2895
      Left            =   120
      TabIndex        =   1
      Top             =   0
      Width           =   4455
      Begin VB.TextBox Text2 
         Height          =   2535
         Left            =   120
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   2
         Top             =   240
         Width           =   4215
      End
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   2000
      Left            =   4320
      Top             =   2040
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   0
      Top             =   4020
      Width           =   4590
      _ExtentX        =   8096
      _ExtentY        =   661
      Style           =   1
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   1
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
      EndProperty
   End
   Begin MSWinsockLib.Winsock wsk_client 
      Left            =   4320
      Top             =   1440
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.Menu file 
      Caption         =   "文件"
      Begin VB.Menu exit 
         Caption         =   "退出"
      End
   End
   Begin VB.Menu set 
      Caption         =   "配置"
      Begin VB.Menu setIP 
         Caption         =   "设置IP"
      End
   End
End
Attribute VB_Name = "Frm_MultiCli"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim status As String
Dim myData As String
Dim RunType As String
Public IPStr As String
Private Sub Command4_Click()
    wsk_client.RemoteHost = IPStr
    wsk_client.RemotePort = 1001
    wsk_client.Connect
    Command4.Enabled = False
End Sub

Private Sub Command2_Click()
'    If Text2.Text = "" Then
'        MsgBox "请输入昵称!!"
'        Exit Sub
'    End If
'
'    If Text1.Text = "" Then
'        MsgBox "请输入信息!!"
'        Exit Sub
'    End If
'
'    wsk_client.SendData Text3.Text + ":" + Text1.Text
Timer1.Enabled = True
RunType = "Stock"
End Sub

Private Sub Command7_Click()
Timer1.Enabled = True
RunType = "Get"
End Sub

Private Sub exit_Click()
Unload Frm_MultiTCP
Unload Me
End Sub

Private Sub Form_Activate()


'Private Sub Form_Load()
Me.Top = 1500
Me.Left = 1500
status = "0StepOK"
RunType = ""
IPStr = "localhost"

Call Command4_Click
 Timer1.Interval = 3000
 If Me.Caption = "正在进行存货工作" Then
    Command7.Enabled = False
    Call Command2_Click
    
 ElseIf Me.Caption = "正在进行取货工作" Then
    Command2.Enabled = False
    Call Command7_Click
    
 Else
    Exit Sub
 End If

 Command2.Enabled = False
 Command7.Enabled = False
End Sub

Private Sub Form_Unload(Cancel As Integer)
Unload Frm_MultiTCP
Unload Me
End Sub

Private Sub setIP_Click()
FormSetIP.Show
End Sub

Private Sub Timer1_Timer()
'MsgBox "主机收到:" + status
Timer1.Enabled = False
Select Case status
Case "0StepOK"
wsk_client.SendData "TC接通电源要求启动"
Case "1StepOK"
wsk_client.SendData "系统开始指令"
Case "2StepOK"
wsk_client.SendData "系统开始完上报"
Case "3StepOK"
'************************
If RunType = "Stock" Then
   wsk_client.SendData "存货开始指令"
ElseIf RunType = "Get" Then
   wsk_client.SendData "取货开始指令"
End If
'***************************
'(1)存货
'Case "4Step(Stock)OK"
'wsk_client.SendData "存货开始指令"
Case "4Step(Stock)OK"
wsk_client.SendData "存货开始完了指令"
Case "5Step(Stock)OK"
Text2.Text = Text2.Text + "堆剁机:完成存货工作!!" + vbCrLf
MsgBox "存货工作已经完成!该批货物已经存入到" & FrmRuKu.Combo3.Text & "货位中" & vbCrLf & " 请退出堆垛机"
Me.Enabled = True
status = "0StepOK"
'(2)取货
'Case "4Step(Get)OK"
'wsk_client.SendData "取货开始指令"
Case "4Step(Get)OK"
wsk_client.SendData "取货开始完了指令"

Case "5Step(Get)OK"
Text2.Text = Text2.Text + "堆剁机:完成取货工作!!" + vbCrLf
status = "0StepOK"
MsgBox "取货工作已经完成!该批货物已经从" & frmChuKu.Text3.Text & "货位中取出" & vbCrLf & " 请退出堆垛机"
Me.Enabled = True
End Select
End Sub

'Private Sub wsk_client_Close()
'    StatusBar1.SimpleText "服务器关闭!!!"
'End Sub

Private Sub wsk_client_DataArrival(ByVal bytesTotal As Long)
'Dim myData As String
wsk_client.GetData myData
If myData = "堆剁机:准备就绪!!" Then
  Text2.Text = Text2.Text + myData + vbCrLf
Else
  Text2.Text = Text2.Text + "堆剁机:" + myData + vbCrLf
  status = myData
  Timer1.Enabled = True
End If
'Text2.Text = Text2.Text + myData + vbCrLf
End Sub

Private Sub wsk_client_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
    wsk_client.Close
End Sub

⌨️ 快捷键说明

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