Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Fix issues with V6 Encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliu2016 committed Jan 26, 2020
1 parent 8cc059e commit 39502a0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/main/kotlin/ca/warp7/desktop/qrscanner/ScannerScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class ScannerScreen {

fun updateTitle() {
val path = savePath
stage.title = if (path == null) "WARP7 Scouting Scan Tool" else "WARP7 Scouting Scan Tool | $path"
val prefix = if (path == null) "" else "$path | "
stage.title = prefix + "WARP7 Scouting Scan Tool 2020.2.0"
}

fun updateCameras() {
Expand Down Expand Up @@ -191,7 +192,7 @@ class ScannerScreen {
it.value.sortWith(comparator)
val size = it.value.size
val sizeStr = if (size == 1) "1 total match" else "$size total matches"
"${it.key}: $sizeStr. Last: ${it.value.last()}"
"${it.key}: $sizeStr. Last: M${it.value.last()}"
}
alert("Scout Stats", s)
}
Expand All @@ -210,17 +211,13 @@ class ScannerScreen {

val order = map.keys.sortedWith(comparator)
val w = StringBuilder()
val v = Board.values().toMutableList()

v.remove(Board.RX)
v.remove(Board.BX)

val missing = mutableListOf<Board>()

order.forEach { key ->
missing.clear()
val md = map[key]!!
v.forEach { board -> if (!md.contains(board)) missing.add(board) }
Board.values().forEach { board -> if (!md.contains(board)) missing.add(board) }
if (missing.isNotEmpty()) {
w.append("Match ").append(key).append(": Missing ")
for (i in 0 until missing.size - 1) w.append(missing[i]).append(", ")
Expand Down Expand Up @@ -265,7 +262,9 @@ class ScannerScreen {
text = "Match"
isSortable = false
prefWidth = 45.0
setCellValueFactory { SimpleStringProperty(it.value.match.split("_").last()) }
setCellValueFactory {
SimpleStringProperty("M" + it.value.match.split("_").last())
}
setCellFactory { MatchCell() }
})
columns.add(tableColumn<Entry, String> {
Expand Down Expand Up @@ -398,7 +397,7 @@ class ScannerScreen {
}

init {
stage.title = "WARP7 Scouting Scan Tool"
updateTitle()
stage.scene = scene
stage.icons.add(Image(ScannerScreen::class.java.getResourceAsStream("/icon.png")))
scene.onKeyPressed = EventHandler {
Expand Down

0 comments on commit 39502a0

Please sign in to comment.