Skip to content

Commit

Permalink
more changes for ProofAndSetValue stuff -.-
Browse files Browse the repository at this point in the history
  • Loading branch information
jp112sdl committed Apr 28, 2021
1 parent 630d7c5 commit 0593814
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/addon/www/config/easymodes/HB-DIS-EP-42BW_dev_master.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ proc getMinMaxValueDescr {param} {

# Limit float to 2 decimal places
if {[llength [split $min "."]] == 2} {
set min [format {%1.2f} $min]
set max [format {%1.2f} $max]
set min [format {%1.1f} $min]
set max [format {%1.1f} $max]
}
return "($min - $max)"
}
Expand All @@ -61,7 +61,7 @@ proc getTextField {prn param val} {
set elemId 'separate_DEVICE\_$prn'
# Limit float to 2 decimal places
if {[llength [split $val "."]] == 2} {
set val [format {%1.2f} $val]
set val [format {%1.1f} $val]
}

set s "<input id=$elemId type=\"text\" size=\"5\" value=$val name=$param onblur=\"ProofAndSetValue(this.id, this.id, '$minValue', '$maxValue', 1)\">"
Expand Down
6 changes: 3 additions & 3 deletions src/addon/www/config/easymodes/HB-DIS-EP-75BW_dev_master.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ proc getMinMaxValueDescr {param} {

# Limit float to 2 decimal places
if {[llength [split $min "."]] == 2} {
set min [format {%1.2f} $min]
set max [format {%1.2f} $max]
set min [format {%1.1f} $min]
set max [format {%1.1f} $max]
}
return "($min - $max)"
}
Expand All @@ -61,7 +61,7 @@ proc getTextField {prn param val} {
set elemId 'separate_DEVICE\_$prn'
# Limit float to 2 decimal places
if {[llength [split $val "."]] == 2} {
set val [format {%1.2f} $val]
set val [format {%1.1f} $val]
}

set s "<input id=$elemId type=\"text\" size=\"5\" value=$val name=$param onblur=\"ProofAndSetValue(this.id, this.id, '$minValue', '$maxValue', 1)\">"
Expand Down
17 changes: 15 additions & 2 deletions src/addon/www/config/easymodes/HB-UNI-Sen-CURRENT_ch_master.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,27 @@ proc getMinValue {ps_descr param} {
upvar ps_descr descr
array_clear param_descr
array set param_descr $descr($param)
return $param_descr(MIN)

set min $param_descr(MIN)

if {($param == "COND_TX_THRESHOLD_HI") || ($param == "COND_TX_THRESHOLD_LO") } {
set min [format {%.2f} $min]
}

return $min
}

proc getMaxValue {ps_descr param} {
upvar ps_descr descr
array_clear param_descr
array set param_descr $descr($param)
return $param_descr(MAX)
set max $param_descr(MAX)

if {($param == "COND_TX_THRESHOLD_HI") || ($param == "COND_TX_THRESHOLD_LO") } {
set max [format {%.2f} $max]
}

return $max
}

proc getMinMaxValueDescr {ps_descr param} {
Expand Down
10 changes: 8 additions & 2 deletions src/addon/www/config/easymodes/HB-UNI-Sen-CURRENT_dev_master.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ proc getTextField {prn param val} {
upvar psDescr descr
array_clear param_descr
array set param_descr $descr($param)
set minValue [format {%1.1f} $param_descr(MIN)]
set maxValue [format {%1.1f} $param_descr(MAX)]

if {[llength [split $param_descr(MIN) "."]] == 2} {
set minValue [format {%1.1f} $param_descr(MIN)]
set maxValue [format {%1.1f} $param_descr(MAX)]
} else {
set minValue $param_descr(MIN)
set maxValue $param_descr(MAX)
}

set elemId 'separate_DEVICE\_$prn'
# Limit float to 1 decimal places
Expand Down
16 changes: 14 additions & 2 deletions src/addon/www/config/easymodes/HB-UNI-Sen-PC-WM_ch_master.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,26 @@ proc getMinValue {ps_descr param} {
upvar ps_descr descr
array_clear param_descr
array set param_descr $descr($param)
return $param_descr(MIN)
set min $param_descr(MIN)

if {($param == "HB_METER_CONSTANT_WATER") || ($param == "HB_COUNT_INITIAL_VALUE") } {
set min [format {%.3f} $min]
}

return $min
}

proc getMaxValue {ps_descr param} {
upvar ps_descr descr
array_clear param_descr
array set param_descr $descr($param)
return $param_descr(MAX)
set max $param_descr(MAX)

if {($param == "HB_METER_CONSTANT_WATER") || ($param == "HB_COUNT_INITIAL_VALUE") } {
set max [format {%.3f} $max]
}

return $max
}

proc getMinMaxValueDescr {ps_descr param} {
Expand Down

0 comments on commit 0593814

Please sign in to comment.