Skip to content

Commit

Permalink
Support firmware version 5.2
Browse files Browse the repository at this point in the history
Bump version to 5.2
  • Loading branch information
hvxl committed Dec 28, 2021
1 parent 8cd4a94 commit 9caed8f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
15 changes: 8 additions & 7 deletions otmonitor.vfs/gui.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ namespace eval gui {

proc gui::savedialogs {} {}

proc gui::loaddialogs {} {
proc gui::loaddialogs {args} {
global cfg
# Only do this once per run
proc loaddialogs args {}

if {[tk windowingsystem] ne "x11" || [catch {package require fsdialog}]} {
return
}
if {[catch {package require fsdialog}]} return
set prefs {}
set hist {}
foreach n [array names cfg fsdialog,*] {
Expand All @@ -69,6 +67,12 @@ proc gui::loaddialogs {} {
}
}

if {[tk windowingsystem] eq "x11"} {
trace add execution tk_getOpenFile enter gui::loaddialogs
trace add execution tk_getSaveFile enter gui::loaddialogs
trace add execution tk_chooseDirectory enter gui::loaddialogs
}

proc gui::passthrough {cmd subcmd args} {return [namespace which $subcmd]}

proc gui::img {fn {disabled 0}} {
Expand Down Expand Up @@ -572,7 +576,6 @@ proc gui::tvselect {} {
}

proc gui::selfile {str} {
loaddialogs
set types {
{"Text Files" .txt}
{"All Files" *}
Expand Down Expand Up @@ -600,7 +603,6 @@ proc gui::datalayout {} {

proc gui::cfgselectdir {} {
global cfg
loaddialogs
set dir [tk_chooseDirectory -initialdir $cfg(logfile,directory) \
-parent .cfg -title "Select the directory for log files"]
if {$dir ne ""} {
Expand Down Expand Up @@ -1964,7 +1966,6 @@ proc gui::showsettings {} {

proc gui::hexfile {} {
global cfg
loaddialogs
set dir [file dirname [append cfg(firmware,hexfile) ""]]
set name [file tail $cfg(firmware,hexfile)]
set types {
Expand Down
6 changes: 3 additions & 3 deletions otmonitor.vfs/otmonitor.inf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Language "0409"
CodePage "04b0"
FileDescription "Opentherm Monitor 5.1"
FileVersion "5.1"
FileDescription "Opentherm Monitor 5.2"
FileVersion "5.2"
ProductName "Opentherm Monitor"
ProductVersion "5.1.0.0"
ProductVersion "5.2.0.0"
OriginalFilename "otmonitor.exe"
InternalName "otmonitor"
CompanyName "Tclcode"
Expand Down
21 changes: 20 additions & 1 deletion otmonitor.vfs/otmonitor.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Opentherm monitor utility.
# For more information, see http://otgw.tclcode.com/otmonitor.html

set version 5.1
set version 5.2
set reportflags 0
set appendlog 0
set setpt 20.00
Expand Down Expand Up @@ -451,6 +451,12 @@ proc process {line} {
} elseif {[string match {*WDT reset!*} $line]} {
output "[ts]\t$line"
alert watchdogtimer
} elseif {[scan $line {CS: %f} ctrlsetpt] == 1} {
output "[ts]\t$line"
after cancel commandexpired
if {$ctrlsetpt != 0.0} {
after 62915 commandexpired
}
} else {
# Filter out non-printable characters
output "[ts]\t[regsub -all {[\0-\x1f]} $line {}]"
Expand Down Expand Up @@ -1541,6 +1547,19 @@ proc sync {{force 0}} {
}
}

proc commandexpired {} {
global cfg
if {$cfg(clock,auto)} {
# Some party has issued a CS command. But since OTmonitor periodically
# updates the clock, that command would never expire if the other
# application crashes. For that reason, the command is specifically
# cancelled here after a little over a minute.
sercmd CS=0
# Repeat if not acknowledged
after 2000 commandexpired
}
}

proc signal {args} {
global signalproc
foreach n $signalproc {
Expand Down
2 changes: 1 addition & 1 deletion otmonitor.vfs/upgrade.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ proc upgrade::eeprom {version} {
4.0a9 4.0a9.1 4.0a10 4.0a11 4.0a11.1 4.0a11.2 4.0a12
}
if {$version == 0 || \
$version ni $supported && ![package vsatisfies $version 4.0b0-5.2]} {
$version ni $supported && ![package vsatisfies $version 4.0b0-5.3]} {
return {}
}
set rc {
Expand Down

0 comments on commit 9caed8f

Please sign in to comment.