forked from paul-griffith/kindling
-
Notifications
You must be signed in to change notification settings - Fork 16
Implement 8.3 S&F Cache VIewer #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Joshlha
wants to merge
8
commits into
main
Choose a base branch
from
sf-83
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
99821db
8.3 cache viewer with hex dump support
Joshlha bb1c65f
Bump Ignition dependencies to 8.3-rc1.
Joshlha 630fb4a
Organization and finish toDetail() impl
Joshlha f2f9781
Move files
Joshlha 097073b
Merge branch 'main' into sf-83
Joshlha 0462a76
Spotless
Joshlha e8c94d4
Dump unzipped binary if all else fails
Joshlha b919154
Address (most) fixes
Joshlha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/kotlin/io/github/inductiveautomation/kindling/cache/CacheViewer.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package io.github.inductiveautomation.kindling.cache | ||
|
|
||
| import com.formdev.flatlaf.extras.FlatSVGIcon | ||
| import io.github.inductiveautomation.kindling.core.Tool | ||
| import io.github.inductiveautomation.kindling.core.ToolOpeningException | ||
| import io.github.inductiveautomation.kindling.core.ToolPanel | ||
| import io.github.inductiveautomation.kindling.utils.FileFilter | ||
| import java.nio.file.Path | ||
| import kotlin.io.path.extension | ||
|
|
||
| data object CacheViewer : Tool { | ||
| override val serialKey = "sf-cache" | ||
| override val title = "Store & Forward Cache" | ||
| override val description = "S&F Cache (.zip, 8.1: .data, .script, 8.3: .idb)" | ||
| override val icon = FlatSVGIcon("icons/bx-data.svg") | ||
| internal val extensions = arrayOf("data", "script", "zip", "idb") | ||
| override val filter = FileFilter(description, *extensions) | ||
|
|
||
| override fun open(path: Path): ToolPanel = when (path.extension) { | ||
| "data", | ||
| "script", | ||
| -> { | ||
| io.github.inductiveautomation.kindling.cache.hsql.CacheView(path) | ||
| } | ||
| "idb" -> { | ||
| io.github.inductiveautomation.kindling.cache.sqlite.CacheView.fromIdb(path) | ||
| } | ||
| "zip" -> { | ||
| try { | ||
| io.github.inductiveautomation.kindling.cache.hsql.CacheView(path) | ||
| } catch (_: Exception) { | ||
| io.github.inductiveautomation.kindling.cache.sqlite.CacheView.fromZip(path) | ||
| } | ||
| } | ||
| else -> throw ToolOpeningException("Invalid file extension; ${path.extension}") | ||
| } | ||
| } | ||
2 changes: 1 addition & 1 deletion
2
...automation/kindling/cache/CacheColumns.kt → ...ation/kindling/cache/hsql/CacheColumns.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...veautomation/kindling/cache/CacheEntry.kt → ...omation/kindling/cache/hsql/CacheEntry.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eautomation/kindling/cache/SchemaModel.kt → ...mation/kindling/cache/hsql/SchemaModel.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../kindling/cache/model/AlarmJournalData.kt → ...ling/cache/hsql/model/AlarmJournalData.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...utomation/kindling/cache/model/Dataset.kt → ...tion/kindling/cache/hsql/model/Dataset.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...on/kindling/cache/model/ScriptedSFData.kt → ...ndling/cache/hsql/model/ScriptedSFData.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.