Skip to content

Commit

Permalink
fix tags not saved issue when importing events.tsv
Browse files Browse the repository at this point in the history
  • Loading branch information
dungscout96 committed Mar 21, 2022
1 parent ed60cdc commit e88807f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/kotlin/FieldList.kt
Expand Up @@ -58,8 +58,11 @@ class FieldList(val tagger: CTagger): JComboBox<String>() {
}
// initialize fieldMap
fieldMap[field] = HashMap()
// initialize codeMap
fieldAndUniqueCodeMap[field]!!.forEach {
fieldMap[field]!![it] = ""
}
addItem(field)

}
fun addFieldFromDict(field:String, fieldDict: CTagger.BIDSFieldDict) {
// add field name to dropdown list
Expand Down
8 changes: 7 additions & 1 deletion src/main/kotlin/HedTagInput.kt
Expand Up @@ -227,14 +227,20 @@ class HedTagInput(private val tagger: CTagger, private val curField: String, pri
delay(100L)
try {
val fieldMap = tagger.fieldList.fieldMap
println(fieldMap.keys)
if (curField != null && fieldMap.containsKey(curField)) {
val codeMap = fieldMap[curField]
if (curCode != null && codeMap!!.containsKey(curCode) && text != defaultMessage)
println(codeMap!!.keys)
if (curCode != null && codeMap!!.containsKey(curCode) && text != defaultMessage) {
codeMap!![curCode] = getCleanHEDString()
println(codeMap!![curCode])
}
}
}
catch (e: Exception) {
// Simply ignore and not save
println(e.message)
println(e.stackTrace)
}
}
}
Expand Down

0 comments on commit e88807f

Please sign in to comment.