Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub FixSockets()
- 'Dim BaseAddrServer As String
- Dim tmpSection As String
- Dim tmpPort As String
- Dim FirstDrive As Boolean
- DeleteIfExists("c:\iris\ini\sockets.ini")
- Dim SocketsIni As New PrivateIniFile("c:\iris\ini\sockets.ini")
- '***********************************************************************************************************
- ' 2/27/2015 Paul E.
- ' Starting using the 10.77 IP's instade of the WAN, to do this I have to seperate the server from registers
- ' hence two BaseAddr (BaseAddrServer, BaseAddrRegister)
- 'Dim BaseAddr = PosMaint.IPNetworkNumber + ".7"
- Dim BaseAddrServer = "10.77.77."
- Dim BaseAddrRegister = "10.77.79."
- '2/27/2015 For some reason Kitchen does not like the 10.77 so for now I am patching the address back to the
- ' WAN IP.
- '6/17/2010 With the store of registers number 10 or grater, we can no long just append the register number as part of the
- ' IP. So now we need to add the register number to 70
- BaseAddrServer = PosMaint.StoreIP + "."
- BaseAddrRegister = PosMaint.StoreIP + "."
- '***********************************************************************************************************
- tmpSection = "POSKIT" : tmpPort = "7500"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrServer & "70")
- tmpSection = "TIMESRVR" : tmpPort = "7600"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrServer & "70")
- tmpSection = "EXTSVC" : tmpPort = "24192"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrServer & "70")
- SocketsIni.WriteString(tmpSection, "LogFile", "c:\iris\log\extsvc.log")
- SocketsIni.WriteString(tmpSection, "SocketTimeOut", "5000")
- tmpSection = "POSPRTFRM" : tmpPort = "7501"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", "127.0.0.1")
- FirstDrive = True
- For xLoop As Integer = 0 To PosMaint.RegisterInformations.Count - 1
- Dim RegInfo As RegInfo = PosMaint.RegisterInformations(xLoop)
- tmpSection = "rcpt" + RegInfo.RegisterNumber.ToString : tmpPort = "7600"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- '================== Cash Drawer ===============================
- tmpSection = "CDRW" + RegInfo.RegisterNumber.ToString : tmpPort = "7601"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- '================== End Cash Drawer ===========================
- '================== Display ===============================
- tmpSection = "disp" + RegInfo.RegisterNumber.ToString : tmpPort = "7602"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- '================== End Display ===========================
- If RegInfo.HardwareType = eHardwareType.Panasonic Then
- tmpSection = "PanMSR" + RegInfo.RegisterNumber.ToString : tmpPort = "7603"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- ElseIf RegInfo.HardwareType = eHardwareType.TCx800 Then
- tmpSection = "TCxMSR" + RegInfo.RegisterNumber.ToString : tmpPort = "7603"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- End If
- If RegInfo.RegisterNumber = PosMaint.PrtExpoNumberRegNum Then
- tmpSection = "grill1" : tmpPort = "7608"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- End If
- If (PosMaint.OutSideDisplay1 = eOutSideDisplayType.AccuviewNG OrElse PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomDigitalDisplay OrElse PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomOCU) AndAlso
- (RegInfo.DefaultConcept = eDefaultConcept.SplitScreen OrElse RegInfo.DefaultConcept = eDefaultConcept.DualLane1) Then
- tmpSection = "OCBDisp1" : tmpPort = "7614"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- 'If PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomOCU Then
- ' SocketsIni.WriteString(tmpSection, "cmdPort", "7117")
- 'End If
- End If
- If (PosMaint.OutSideDisplay2 = eOutSideDisplayType.AccuviewNG OrElse PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomOCU) AndAlso
- (RegInfo.DefaultConcept = eDefaultConcept.DualLane2) Then
- tmpSection = "OCBDisp2" : tmpPort = "7614"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- 'If PosMaint.OutSideDisplay2 = eOutSideDisplayType.SicomOCU Then
- ' SocketsIni.WriteString(tmpSection, "cmdPort", "7117")
- 'End If
- End If
- If RegInfo.ScannerType <> eScannerType.None Then
- tmpSection = RegInfo.ScannerServiceObjectName : tmpPort = "7610"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- End If
- If RegInfo.ScaleType <> eScaleType.None Then
- tmpSection = RegInfo.ScaleServiceObjectName : tmpPort = "7611"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
- End If
- Next
- If PosMaint.RedundantKitchen Then
- tmpSection = "SECONDARYKIT1" : tmpPort = "7500"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & "72")
- Else
- SocketsIni.DeleteSection("SECONDARYKIT1")
- End If
- 'Try and disable SysLoger
- SocketsIni.WriteString("SysLogServer", "Disable", "1")
- 'Set the Cam Manager Port and Address
- If PosMaint.IsDualLane Then
- tmpSection = "CamManager" : tmpPort = "9659"
- SocketsIni.WriteString(tmpSection, "Port", tmpPort)
- SocketsIni.WriteString(tmpSection, "Addr", BaseAddrServer & "70")
- End If
- SocketsIni = Nothing
- CopyINIToRegInfo("Sockets.ini")
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement