VERSION 5.00 Object = "{25C953A7-5464-11D1-A714-00AA0044064C}#1.0#0"; "MSCEFILE.DLL" Begin VB.Form TraceLogView Appearance = 0 'Flat BackColor = &H00CCFFFF& Caption = "TraceLogView" ClientHeight = 4020 ClientLeft = 60 ClientTop = 840 ClientWidth = 3600 ForeColor = &H80000008& ScaleHeight = 4020 ScaleWidth = 3600 ShowOK = -1 'True Begin FILECTLCtl.File G23file Left = 0 Top = 2760 _cx = 1000 _cy = 1000 End Begin FILECTLCtl.File L1file Left = 0 Top = 960 _cx = 1000 _cy = 1000 End Begin VBCE.Timer L1timer Left = 0 Top = 360 _cx = 847 _cy = 847 Enabled = -1 'True Interval = 250 End Begin VBCE.Timer G23Timer Left = 0 Top = 2160 _cx = 847 _cy = 847 Enabled = -1 'True Interval = 250 End Begin VBCE.CheckBox L1skip Height = 255 Left = 825 TabIndex = 11 Top = -15 Width = 1290 _cx = 2275 _cy = 450 BackColor = 13434879 Caption = "skip to keep up" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 Value = 0 End Begin VBCE.CheckBox G23skip Height = 255 Left = 825 TabIndex = 10 Top = 3750 Width = 1290 _cx = 2275 _cy = 450 BackColor = 13434879 Caption = "skip to keep up" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 Value = 0 End Begin VBCE.CheckBox G23enable Height = 255 Left = 0 TabIndex = 9 Top = 3750 Width = 255 _cx = 450 _cy = 450 BackColor = 13434879 Caption = "Check1" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 Value = 1 End Begin VBCE.CheckBox L1enable Height = 255 Left = 0 TabIndex = 8 Top = -15 Width = 255 _cx = 450 _cy = 450 BackColor = 13434879 Caption = "Check1" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 Value = 1 End Begin VBCE.Label L1label Height = 255 Left = 315 TabIndex = 7 Top = 0 Width = 495 _cx = 873 _cy = 450 AutoSize = 0 'False BackColor = -2147483643 BackStyle = 0 BorderStyle = 0 Caption = "L1" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 UseMnemonic = -1 'True WordWrap = 0 'False End Begin VBCE.Label G23label Height = 255 Left = 300 TabIndex = 6 Top = 3750 Width = 495 _cx = 873 _cy = 450 AutoSize = 0 'False BackColor = 13434879 BackStyle = 0 BorderStyle = 0 Caption = "G23" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 9.75 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 UseMnemonic = -1 'True WordWrap = 0 'False End Begin VBCE.CheckBox G23tval Height = 255 Left = 2160 TabIndex = 5 Top = 3750 Width = 690 _cx = 1217 _cy = 450 BackColor = 13434879 Caption = "Timer" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 Value = 0 End Begin VBCE.CheckBox G23pause Height = 255 Left = 2880 TabIndex = 4 Top = 3750 Width = 735 _cx = 1296 _cy = 450 BackColor = 13434879 Caption = "Pause" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 Value = 0 End Begin VBCE.TextBox G23text Height = 1695 Left = 0 TabIndex = 3 Top = 2040 Width = 3600 _cx = 6350 _cy = 2990 BackColor = -2147483643 BorderStyle = 1 Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Text = "" Alignment = 0 HideSelection = -1 'True Locked = -1 'True MaxLength = 0 MultiLine = -1 'True PasswordChar = "" ScrollBars = 3 End Begin VBCE.CheckBox L1tval Height = 255 Left = 2160 TabIndex = 2 Top = -15 Width = 690 _cx = 1217 _cy = 450 BackColor = 13434879 Caption = "Timer" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 Value = 0 End Begin VBCE.CheckBox L1pause Height = 255 Left = 2880 TabIndex = 1 Top = -15 Width = 735 _cx = 1296 _cy = 450 BackColor = 13434879 Caption = "Pause" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Alignment = 0 Value = 0 End Begin VBCE.TextBox L1text Height = 1710 Left = 0 TabIndex = 0 Top = 255 Width = 3600 _cx = 6350 _cy = 3016 BackColor = -2147483643 BorderStyle = 1 Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Text = "" Alignment = 0 HideSelection = -1 'True Locked = -1 'True MaxLength = 0 MultiLine = -1 'True PasswordChar = "" ScrollBars = 3 End End Attribute VB_Name = "TraceLogView" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim L1array() As String Private Sub Form_Load() Me.Show L1file.Open "\Temp\L1.txt", fsModeBinary, fsAccessRead, fsLockShared, 4096 G23file.Open "\Temp\G23.txt", fsModeBinary, fsAccessRead, fsLockShared, 4096 End Sub Private Sub ReadL1() Dim x As Long Dim startmark, endmark As Integer Dim y, z, n As Integer Dim play, tekst As String x = L1file.LOF - L1file.Seek If x > 0 Then If L1skip.Value = 0 Then If x / 1024 < 1024 Then L1skip.Caption = "lag: " + Trim(CStr(Int(x / 1024))) + "k" Else L1skip.Caption = "lag:" + Trim(CStr(Int(x / (100 * 1024)) / 10)) + "M" End If End If If L1enable.Value = 0 Or L1pause.Value = 1 Then Exit Sub End If If x > 1024 Then x = 1024 If L1skip.Value = 1 Then L1file.Seek = L1file.LOF - 1024 tekst = "-- TLV SKIP --" + Chr(13) + Chr(10) End If End If L1buffer = L1buffer + L1file.Input(x) Do startmark = InStr(1, L1buffer, Chr(2) + Chr(&H12), vbTextCompare) If startmark = 0 Then Exit Do End If If Len(L1buffer) > endmark + 1 Then endmark = InStr(startmark + 2, L1buffer, Chr(&HA) + Chr(&HD) + Chr(2), vbTextCompare) If endmark = 0 Then Exit Do End If Else Exit Do End If play = Mid(L1buffer, startmark + 2, endmark - startmark - 2) If Len(L1buffer) > endmark + 2 Then L1buffer = Mid(L1buffer, endmark + 2) Else L1buffer = "" End If If Len(play) > 7 Then If Mid(play, 1, 6) <> " " Then z = InStr(7, play, " ") If z > 0 Then If L1tval.Value = 0 Then play = Mid(play, 1, 6) + Chr(9) + Mid(play, z + 1) Else play = Mid(play, 7, z - 8) + Chr(9) + Mid(play, 1, 6) + Chr(9) + Mid(play, z + 1) End If End If Else If L1tval.Value = 1 Then play = play + Chr(9) End If play = Chr(9) + Mid(play, 7) End If End If tekst = tekst + play + Chr(13) + Chr(10) Loop If Len(L1text.Text) > 28 * 1024 Then L1text.Text = Mid(L1text.Text, 4096) End If L1text.SelStart = Len(L1text.Text) L1text.SelText = tekst End If End Sub Private Sub ReadG23() Dim x As Long Dim startmark, endmark As Integer Dim anomalyptr As Integer, anomaly As String Dim t, y, z, n As Integer Dim play, tekst As String Dim tmp As String x = G23file.LOF - G23file.Seek If x > 0 Then If G23skip.Value = 0 Then If x / 1024 < 1024 Then G23skip.Caption = "lag: " + Trim(CStr(Int(x / 1024))) + "k" Else G23skip.Caption = "lag:" + Trim(CStr(Int(x / (100 * 1024)) / 10)) + "M" End If End If If G23enable.Value = 0 Or G23pause.Value = 1 Then Exit Sub End If If x > 1024 Then x = 1024 If G23skip.Value = 1 Then G23file.Seek = G23file.LOF - 1024 tekst = "-- TLV SKIP --" + Chr(13) + Chr(10) End If End If G23buffer = G23buffer + G23file.Input(x) Do startmark = InStr(1, G23buffer, Chr(2) + Chr(&H13), vbTextCompare) If startmark = 0 Then Exit Do End If If Len(G23buffer) > endmark + 1 Then endmark = InStr(startmark + 2, G23buffer, Chr(0) + Chr(2), vbTextCompare) If endmark = 0 Then Exit Do End If Else Exit Do End If play = Mid(G23buffer, startmark + 2, endmark - startmark - 2) If Len(G23buffer) > endmark + 2 Then G23buffer = Mid(G23buffer, endmark + 2) Else G23buffer = "" End If anomaly = "" anomalyptr = InStr(1, play, Chr(0) + Chr(&HC8) + Chr(&HFF) + Chr(&HFF), vbTextCompare) If anomalyptr > 0 Then n = anomalyptr + 4 play = Replace(play, String(4, Chr(0)), "") Do If n > Len(play) Then Exit Do End If y = Asc(Mid(play, n, 1)) Select Case y Case &H2C, &H3C, &HF6, &H9, &H2E, &H7C, &H8F anomaly = anomaly + Right("0" + Trim(Hex(y)), 2) + " " Case Else Exit Do End Select n = n + 1 Loop play = Mid(play, 1, anomalyptr - 1) + Mid(play, n) End If z = InStr(play, "%") If z > 0 And Len(play) >= z + 2 Then tmp = Mid(play, 1, z - 1) + "{" + Right("000" + Trim(Hex((Asc(Mid(play, z + 1, 1)) * 256) + Asc(Mid(play, z + 2, 1)))), 4) + "} " 'if we have more If Len(play) > z + 3 Then 'check if the last byte is 0x00 or 0x0f t = Asc(Mid(play, Len(play), 1)) If t = 0 Or t = &HF Then 'if it is, it's a binary string For n = z + 3 To Len(play) - 1 tmp = tmp + Right("00" + Trim(Hex(Asc(Mid(play, n, 1)))), 2) + " " Next Else 'otherwise it's a text string tmp = tmp + Mid(play, z + 3) End If End If play = tmp End If play = Replace(play, Chr(0), "") If Len(play) > 18 Then If G23tval.Value = 1 Then tekst = tekst + Mid(play, 2, 8) + Chr(9) End If tekst = tekst + Mid(play, 10, 4) + Chr(9) tekst = tekst + Mid(play, 18) tekst = tekst + Chr(13) + Chr(10) End If If anomaly <> "" Then If G23tval.Value = 1 Then tekst = tekst + Chr(9) End If tekst = tekst + "Bytes:" + Chr(9) + anomaly + Chr(13) + Chr(10) anomaly = "" End If Loop If Len(G23text.Text) > 29 * 1024 Then G23text.Text = Mid(G23text.Text, 4096) End If G23text.SelStart = Len(G23text.Text) G23text.SelText = tekst End If End Sub Private Sub Form_OKClick() App.End End Sub Private Sub FixTextBoxes() If L1enable.Value = 0 Then L1label.ForeColor = &H80000011 L1tval.Enabled = False L1skip.Enabled = False L1pause.Enabled = False L1text.Visible = False Else L1label.ForeColor = &H80000008 L1tval.Enabled = True L1skip.Enabled = True L1pause.Enabled = True L1text.Visible = True End If If G23enable.Value = 0 Then G23label.ForeColor = &H80000011 G23tval.Enabled = False G23skip.Enabled = False G23pause.Enabled = False G23text.Visible = False Else G23label.ForeColor = &H80000008 G23tval.Enabled = True G23skip.Enabled = True G23pause.Enabled = True G23text.Visible = True End If If L1enable.Value = 1 And G23enable.Value = 1 Then L1text.Top = 255 L1text.Height = 1710 G23text.Top = 2040 G23text.Height = 1695 End If If L1enable.Value = 1 And G23enable.Value = 0 Then L1text.Top = 255 L1text.Height = 3350 End If If L1enable.Value = 0 And G23enable.Value = 1 Then G23text.Top = 355 G23text.Height = 3350 End If End Sub Private Sub G23enable_Click() FixTextBoxes End Sub Private Sub G23lag_Click() G23file.Seek = G23file.LOF End Sub Private Sub L1skip_Click() If L1skip.Value = 1 Then L1skip.Caption = "skip to keep up" End If End Sub Private Sub G23skip_Click() If G23skip.Value = 1 Then G23skip.Caption = "skip to keep up" End If End Sub Private Sub L1enable_Click() FixTextBoxes End Sub Private Sub L1timer_Timer() L1timer.Enabled = False ReadL1 L1timer.Enabled = True End Sub Private Sub G23timer_Timer() G23Timer.Enabled = False ReadG23 G23Timer.Enabled = True End Sub