Advertisement
penright

Untitled

Oct 3rd, 2023
1,482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 7.27 KB | None | 0 0
  1.    Sub FixSockets()
  2.         'Dim BaseAddrServer As String
  3.         Dim tmpSection As String
  4.         Dim tmpPort As String
  5.         Dim FirstDrive As Boolean
  6.         DeleteIfExists("c:\iris\ini\sockets.ini")
  7.         Dim SocketsIni As New PrivateIniFile("c:\iris\ini\sockets.ini")
  8.         '***********************************************************************************************************
  9.         ' 2/27/2015 Paul E.
  10.         ' Starting using the 10.77 IP's instade of the WAN, to do this I have to seperate the server from registers
  11.         '       hence two BaseAddr (BaseAddrServer, BaseAddrRegister)
  12.         'Dim BaseAddr = PosMaint.IPNetworkNumber + ".7"
  13.         Dim BaseAddrServer = "10.77.77."
  14.         Dim BaseAddrRegister = "10.77.79."
  15.         '2/27/2015 For some reason Kitchen does not like the 10.77 so for now I am patching the address back to the
  16.         '    WAN IP.
  17.         '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
  18.         '    IP. So now we need to add the register number to 70
  19.         BaseAddrServer = PosMaint.StoreIP + "."
  20.         BaseAddrRegister = PosMaint.StoreIP + "."
  21.         '***********************************************************************************************************
  22.         tmpSection = "POSKIT" : tmpPort = "7500"
  23.         SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  24.         SocketsIni.WriteString(tmpSection, "Addr", BaseAddrServer & "70")
  25.         tmpSection = "TIMESRVR" : tmpPort = "7600"
  26.         SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  27.         SocketsIni.WriteString(tmpSection, "Addr", BaseAddrServer & "70")
  28.         tmpSection = "EXTSVC" : tmpPort = "24192"
  29.         SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  30.         SocketsIni.WriteString(tmpSection, "Addr", BaseAddrServer & "70")
  31.         SocketsIni.WriteString(tmpSection, "LogFile", "c:\iris\log\extsvc.log")
  32.         SocketsIni.WriteString(tmpSection, "SocketTimeOut", "5000")
  33.  
  34.         tmpSection = "POSPRTFRM" : tmpPort = "7501"
  35.         SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  36.         SocketsIni.WriteString(tmpSection, "Addr", "127.0.0.1")
  37.         FirstDrive = True
  38.         For xLoop As Integer = 0 To PosMaint.RegisterInformations.Count - 1
  39.             Dim RegInfo As RegInfo = PosMaint.RegisterInformations(xLoop)
  40.             tmpSection = "rcpt" + RegInfo.RegisterNumber.ToString : tmpPort = "7600"
  41.             SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  42.             SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  43.             '================== Cash Drawer ===============================
  44.             tmpSection = "CDRW" + RegInfo.RegisterNumber.ToString : tmpPort = "7601"
  45.             SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  46.             SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  47.             '================== End Cash Drawer ===========================
  48.             '================== Display ===============================
  49.             tmpSection = "disp" + RegInfo.RegisterNumber.ToString : tmpPort = "7602"
  50.             SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  51.             SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  52.             '================== End Display ===========================
  53.  
  54.             If RegInfo.HardwareType = eHardwareType.Panasonic Then
  55.                 tmpSection = "PanMSR" + RegInfo.RegisterNumber.ToString : tmpPort = "7603"
  56.                 SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  57.                 SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  58.             ElseIf RegInfo.HardwareType = eHardwareType.TCx800 Then
  59.                 tmpSection = "TCxMSR" + RegInfo.RegisterNumber.ToString : tmpPort = "7603"
  60.                 SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  61.                 SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  62.             End If
  63.  
  64.             If RegInfo.RegisterNumber = PosMaint.PrtExpoNumberRegNum Then
  65.                 tmpSection = "grill1" : tmpPort = "7608"
  66.                 SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  67.                 SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  68.             End If
  69.             If (PosMaint.OutSideDisplay1 = eOutSideDisplayType.AccuviewNG OrElse PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomDigitalDisplay OrElse PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomOCU) AndAlso
  70.                (RegInfo.DefaultConcept = eDefaultConcept.SplitScreen OrElse RegInfo.DefaultConcept = eDefaultConcept.DualLane1) Then
  71.                 tmpSection = "OCBDisp1" : tmpPort = "7614"
  72.                 SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  73.                 SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  74.                 'If PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomOCU Then
  75.                 '    SocketsIni.WriteString(tmpSection, "cmdPort", "7117")
  76.                 'End If
  77.             End If
  78.             If (PosMaint.OutSideDisplay2 = eOutSideDisplayType.AccuviewNG OrElse PosMaint.OutSideDisplay1 = eOutSideDisplayType.SicomOCU) AndAlso
  79.                (RegInfo.DefaultConcept = eDefaultConcept.DualLane2) Then
  80.                 tmpSection = "OCBDisp2" : tmpPort = "7614"
  81.                 SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  82.                 SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  83.                 'If PosMaint.OutSideDisplay2 = eOutSideDisplayType.SicomOCU Then
  84.                 '    SocketsIni.WriteString(tmpSection, "cmdPort", "7117")
  85.                 'End If
  86.             End If
  87.             If RegInfo.ScannerType <> eScannerType.None Then
  88.                 tmpSection = RegInfo.ScannerServiceObjectName : tmpPort = "7610"
  89.                 SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  90.                 SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  91.             End If
  92.             If RegInfo.ScaleType <> eScaleType.None Then
  93.                 tmpSection = RegInfo.ScaleServiceObjectName : tmpPort = "7611"
  94.                 SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  95.                 SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & (70 + RegInfo.RegisterNumber).ToString)
  96.             End If
  97.         Next
  98.  
  99.         If PosMaint.RedundantKitchen Then
  100.             tmpSection = "SECONDARYKIT1" : tmpPort = "7500"
  101.             SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  102.             SocketsIni.WriteString(tmpSection, "Addr", BaseAddrRegister & "72")
  103.         Else
  104.             SocketsIni.DeleteSection("SECONDARYKIT1")
  105.         End If
  106.  
  107.         'Try and disable SysLoger
  108.         SocketsIni.WriteString("SysLogServer", "Disable", "1")
  109.  
  110.         'Set the Cam Manager Port and Address
  111.         If PosMaint.IsDualLane Then
  112.             tmpSection = "CamManager" : tmpPort = "9659"
  113.             SocketsIni.WriteString(tmpSection, "Port", tmpPort)
  114.             SocketsIni.WriteString(tmpSection, "Addr", BaseAddrServer & "70")
  115.         End If
  116.         SocketsIni = Nothing
  117.         CopyINIToRegInfo("Sockets.ini")
  118.     End Sub
  119.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement