edit test cache

This commit is contained in:
updsv7
2026-04-16 19:04:02 +09:00
parent c661373369
commit db6a971473
18 changed files with 371 additions and 150 deletions

View File

@@ -4,191 +4,184 @@
' ============================================================
Sub Test_PrintAllCaches()
' Refresh all caches first
Call RefreshM1Cache
Call RefreshM1KukanDCache
Call RefreshM2Cache
Call RefreshZ1Cache
Call RefreshO1Cache
' Get or create Test_Cache sheet
Dim wb As Workbook
Set wb = ThisWorkbook
Dim ws As Worksheet
On Error Resume Next
Set ws = wb.Worksheets("Test_Cache")
On Error GoTo 0
Set ws = ThisWorkbook.Worksheets("Test_Cache")
If ws Is Nothing Then
Set ws = wb.Worksheets.Add
Set ws = ThisWorkbook.Worksheets.Add
ws.Name = "Test_Cache"
End If
On Error GoTo 0
ws.Cells.Clear
ws.Cells.ClearContents
Dim row As Long
row = 1
Dim r As Long
r = 1
ws.Cells(r, 1).Value = "M1 Cache"
r = r + 1
Call PrintM1CacheToSheet(ws, r)
' Print M1 Cache
ws.Cells(row, 1).Value = "=== M1 Cache ==="
row = row + 1
Call PrintM1CacheToSheet(ws, row)
r = r + 1
ws.Cells(r, 1).Value = "M1_KukanD Cache"
r = r + 1
Call PrintM1KukanDCacheToSheet(ws, r)
' Print M1_KukanD Cache
row = row + 1
ws.Cells(row, 1).Value = "=== M1_KukanD Cache ==="
row = row + 1
Call PrintM1KukanDCacheToSheet(ws, row)
r = r + 1
ws.Cells(r, 1).Value = "M2 Cache"
r = r + 1
Call PrintM2CacheToSheet(ws, r)
' Print M2 Cache
row = row + 1
ws.Cells(row, 1).Value = "=== M2 Cache ==="
row = row + 1
Call PrintM2CacheToSheet(ws, row)
r = r + 1
ws.Cells(r, 1).Value = "Z1 Cache"
r = r + 1
Call PrintZ1CacheToSheet(ws, r)
' Print Z1 Cache
row = row + 1
ws.Cells(row, 1).Value = "=== Z1 Cache ==="
row = row + 1
Call PrintZ1CacheToSheet(ws, row)
' Print O1 Cache
row = row + 1
ws.Cells(row, 1).Value = "=== O1 Cache ==="
row = row + 1
Call PrintO1CacheToSheet(ws, row)
r = r + 1
ws.Cells(r, 1).Value = "O1 Cache"
r = r + 1
Call PrintO1CacheToSheet(ws, r)
ws.Columns.AutoFit
End Sub
Private Sub PrintM1CacheToSheet(ws As Worksheet, ByRef row As Long)
Private Sub PrintM1CacheToSheet(ws As Worksheet, ByRef r As Long)
If m1Cache Is Nothing Then
ws.Cells(row, 1).Value = "m1Cache is Nothing"
row = row + 1
ws.Cells(r, 1).Value = "Nothing"
r = r + 1
Exit Sub
End If
ws.Cells(row, 1).Value = "Count: " & m1Cache.Count
row = row + 1
ws.Cells(r, 1).Value = "Count: " & m1Cache.Count
r = r + 1
Dim key As Variant
For Each key In m1Cache.Keys
Dim vals As Variant
vals = m1Cache(key)
ws.Cells(row, 1).Value = key
ws.Cells(row, 2).Value = vals(1) & ": " & vals(2)
ws.Cells(row, 3).Value = vals(3)
ws.Cells(row, 4).Value = vals(4)
ws.Cells(row, 5).Value = vals(5)
row = row + 1
Next key
Dim k As Variant
For Each k In m1Cache.Keys
Dim v As Variant
v = m1Cache(k)
ws.Cells(r, 1).Value = k
ws.Cells(r, 2).Value = v(1)
ws.Cells(r, 3).Value = v(2)
ws.Cells(r, 4).Value = v(3)
r = r + 1
Next k
End Sub
Private Sub PrintM1KukanDCacheToSheet(ws As Worksheet, ByRef row As Long)
Private Sub PrintM1KukanDCacheToSheet(ws As Worksheet, ByRef r As Long)
If m1KukanDCache Is Nothing Then
ws.Cells(row, 1).Value = "m1KukanDCache is Nothing"
row = row + 1
ws.Cells(r, 1).Value = "Nothing"
r = r + 1
Exit Sub
End If
ws.Cells(row, 1).Value = "Count: " & m1KukanDCache.Count
row = row + 1
ws.Cells(r, 1).Value = "Count: " & m1KukanDCache.Count
r = r + 1
Dim dKey As Variant
For Each dKey In m1KukanDCache.Keys
ws.Cells(row, 1).Value = "D: " & dKey
row = row + 1
Dim innerDict As Object
Set innerDict = m1KukanDCache(dKey)
Dim fKey As Variant
For Each fKey In innerDict.Keys
ws.Cells(row, 2).Value = "F: " & fKey
row = row + 1
Dim d As Variant
For Each d In m1KukanDCache.Keys
ws.Cells(r, 1).Value = d
r = r + 1
Dim inner As Object
Set inner = m1KukanDCache(d)
Dim f As Variant
For Each f In inner.Keys
ws.Cells(r, 2).Value = f
r = r + 1
Dim arr As Object
Set arr = innerDict(fKey)
Dim gKey As Variant
For Each gKey In arr.Keys
ws.Cells(row, 3).Value = "G: " & gKey
row = row + 1
Next gKey
Next fKey
Next dKey
Set arr = inner(f)
Dim g As Variant
For Each g In arr.Keys
ws.Cells(r, 3).Value = g
r = r + 1
Next g
Next f
Next d
End Sub
Private Sub PrintM2CacheToSheet(ws As Worksheet, ByRef row As Long)
Private Sub PrintM2CacheToSheet(ws As Worksheet, ByRef r As Long)
If m2Cache Is Nothing Then
ws.Cells(row, 1).Value = "m2Cache is Nothing"
row = row + 1
ws.Cells(r, 1).Value = "Nothing"
r = r + 1
Exit Sub
End If
ws.Cells(row, 1).Value = "Count: " & m2Cache.Count
row = row + 1
ws.Cells(r, 1).Value = "Count: " & m2Cache.Count
r = r + 1
Dim kukanKey As Variant
For Each kukanKey In m2Cache.Keys
ws.Cells(row, 1).Value = "KukanCode: " & kukanKey
row = row + 1
Dim innerDict As Object
Set innerDict = m2Cache(kukanKey)
Dim kanshuKey As Variant
For Each kanshuKey In innerDict.Keys
ws.Cells(row, 2).Value = "Kanshu: " & kanshuKey
row = row + 1
Dim innermostDict As Object
Set innermostDict = innerDict(kanshuKey)
Dim codeKey As Variant
For Each codeKey In innermostDict.Keys
ws.Cells(row, 3).Value = "Code: " & codeKey
ws.Cells(row, 4).Value = innermostDict(codeKey)
row = row + 1
Next codeKey
Next kanshuKey
Next kukanKey
Dim k As Variant
For Each k In m2Cache.Keys
ws.Cells(r, 1).Value = k
r = r + 1
Dim inner As Object
Set inner = m2Cache(k)
Dim kanshu As Variant
For Each kanshu In inner.Keys
ws.Cells(r, 2).Value = kanshu
r = r + 1
Dim innermost As Object
Set innermost = inner(kanshu)
Dim c As Variant
For Each c In innermost.Keys
ws.Cells(r, 3).Value = c
ws.Cells(r, 4).Value = innermost(c)
r = r + 1
Next c
Next kanshu
Next k
End Sub
Private Sub PrintZ1CacheToSheet(ws As Worksheet, ByRef row As Long)
Private Sub PrintZ1CacheToSheet(ws As Worksheet, ByRef r As Long)
If z1Cache Is Nothing Then
ws.Cells(row, 1).Value = "z1Cache is Nothing"
row = row + 1
ws.Cells(r, 1).Value = "Nothing"
r = r + 1
Exit Sub
End If
ws.Cells(row, 1).Value = "Count: " & z1Cache.Count
row = row + 1
ws.Cells(r, 1).Value = "Count: " & z1Cache.Count
r = r + 1
Dim key As Variant
For Each key In z1Cache.Keys
Dim vals As Variant
vals = z1Cache(key)
ws.Cells(row, 1).Value = key
ws.Cells(row, 2).Value = vals(0)
row = row + 1
Next key
Dim k As Variant
For Each k In z1Cache.Keys
Dim v As Variant
v = z1Cache(k)
ws.Cells(r, 1).Value = k
ws.Cells(r, 2).Value = v(0)
r = r + 1
Next k
End Sub
Private Sub PrintO1CacheToSheet(ws As Worksheet, ByRef row As Long)
Private Sub PrintO1CacheToSheet(ws As Worksheet, ByRef r As Long)
If o1Cache Is Nothing Then
ws.Cells(row, 1).Value = "o1Cache is Nothing"
row = row + 1
ws.Cells(r, 1).Value = "Nothing"
r = r + 1
Exit Sub
End If
ws.Cells(row, 1).Value = "Count: " & o1Cache.Count
row = row + 1
ws.Cells(r, 1).Value = "Count: " & o1Cache.Count
r = r + 1
Dim key As Variant
For Each key In o1Cache.Keys
Dim vals As Variant
vals = o1Cache(key)
ws.Cells(row, 1).Value = key
ws.Cells(row, 2).Value = vals(0)
ws.Cells(row, 3).Value = vals(1)
row = row + 1
Next key
Dim c As Variant
For Each c In o1Cache.Keys
ws.Cells(r, 1).Value = c
r = r + 1
Dim inner As Object
Set inner = o1Cache(c)
Dim e As Variant
For Each e In inner.Keys
ws.Cells(r, 2).Value = e
r = r + 1
Dim arr As Object
Set arr = inner(e)
Dim f As Variant
For Each f In arr.Keys
ws.Cells(r, 3).Value = f
r = r + 1
Next f
Next e
Next c
End Sub