Skip to content

Commit 1cc12ff

Browse files
committed
new gui setting for flow calibration multiplier
1 parent 3ae9dde commit 1cc12ff

5 files changed

Lines changed: 36 additions & 14 deletions

File tree

de1plus/bluetooth.tcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,9 @@ proc de1_ble_handler { event data } {
15681568
} elseif {$mmr_id == "803838"} {
15691569
msg "MMRead: espresso_warmup_timeout: '[ifexists arr2(Data0)]'"
15701570
set ::settings(espresso_warmup_timeout) [ifexists arr2(Data0)]
1571+
} elseif {$mmr_id == "80383C"} {
1572+
msg "MMRead: flow estimate multiplier: '[ifexists arr2(Data0)]' = [round_to_two_digits [expr {[ifexists arr2(Data0)] / 1000.0}]]"
1573+
set ::settings(calibration_flow_multiplier) [round_to_two_digits [expr {[ifexists arr2(Data0)] / 1000.0}]]
15711574
} elseif {$mmr_id == "803810"} {
15721575
msg "MMRead: phase_1_flow_rate: '[ifexists arr2(Data0)]'"
15731576
set ::settings(phase_1_flow_rate) [ifexists arr2(Data0)]

de1plus/de1_comms.tcl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,11 +1103,21 @@ proc get_fan_threshold {} {
11031103
mmr_read "get_fan_threshold" "803808" "00"
11041104
}
11051105

1106+
proc get_calibration_flow_multiplier {} {
1107+
msg "Reading calibraton flow multiplier"
1108+
mmr_read "get_calibration_flow_multiplier" "80383C" "00"
1109+
}
1110+
11061111
proc set_fan_temperature_threshold {temp} {
11071112
msg "Setting fan temperature to '$temp'"
11081113
mmr_write "set_fan_temperature_threshold" "803808" "04" [zero_pad [int_to_hex $temp] 2]
11091114
}
11101115

1116+
proc set_calibration_flow_multiplier {m} {
1117+
msg "Setting calibration flow multiplier to '$m'"
1118+
mmr_write "set_calibration_flow_multiplier" "80383C" "04" [zero_pad [long_to_little_endian_hex [expr {int(1000 * $m)}] ] 2]
1119+
}
1120+
11111121
proc get_tank_temperature_threshold {} {
11121122
msg "Reading desired water tank temperature"
11131123
mmr_read "get_tank_temperature_threshold" "80380C" "00"

de1plus/gui.tcl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,6 +2436,8 @@ proc calibration_gui_init {} {
24362436
after 5000 de1_read_calibration "pressure" "factory"
24372437
after 6000 de1_read_calibration "flow" "factory"
24382438

2439+
after 7000 get_calibration_flow_multiplier
2440+
24392441
}
24402442
}
24412443

@@ -3047,9 +3049,9 @@ namespace eval ::gui::notify {
30473049

30483050
record_complete {
30493051

3050-
set what [translate {Enjoy!}]
3051-
borg toast $what
3052-
say $what $::settings(sound_button_in)
3052+
#set what [translate {Enjoy!}]
3053+
#borg toast $what
3054+
#say $what $::settings(sound_button_in)
30533055
}
30543056

30553057
saw_stop {

de1plus/machine.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ array set ::settings {
235235
active_settings_tab settings_2a
236236
espresso_temperature_steps_enabled 0
237237
chart_total_shot_weight 1
238+
calibration_flow_multiplier 1
238239
phase_1_flow_rate 20
239240
phase_2_flow_rate 40
240241
ghc_mode 0

de1plus/skins/default/de1_skin_settings.tcl

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,10 +1160,11 @@ add_de1_text "settings_1 settings_2 settings_2a settings_2b settings_2c settings
11601160
unset -nocomplain ::profiles_hide_mode
11611161
fill_profiles_listbox
11621162
}
1163-
if {[array_item_difference ::settings ::settings_backup "steam_temperature steam_flow water_refill_point fan_threshold"] == 1} {
1163+
if {[array_item_difference ::settings ::settings_backup "steam_temperature calibration_flow_multiplier steam_flow water_refill_point fan_threshold"] == 1} {
11641164
# resend the calibration settings if they were changed
11651165
de1_send_steam_hotwater_settings
11661166
de1_send_waterlevel_settings
1167+
set_calibration_flow_multiplier $::settings(calibration_flow_multiplier)
11671168
set_fan_temperature_threshold $::settings(fan_threshold)
11681169
de1_enable_water_level_notifications
11691170
}
@@ -1188,7 +1189,10 @@ add_de1_text "settings_1 settings_2 settings_2a settings_2b settings_2c settings
11881189
# cancel button
11891190
add_de1_button "settings_1 settings_2 settings_2a settings_2b settings_2c settings_2czoom settings_2c2 settings_3 settings_4" {if {[ifexists ::profiles_hide_mode] == 1} { unset -nocomplain ::profiles_hide_mode; fill_profiles_listbox }; array unset ::settings {\*}; array set ::settings [array get ::settings_backup]; update_de1_explanation_chart; fill_skin_listbox; profile_has_changed_set_colors; say [translate {Cancel}] $::settings(sound_button_in); set_next_page off off; page_show off; fill_advanced_profile_steps_listbox;restore_espresso_chart; save_settings_to_de1; fill_profiles_listbox ; fill_extensions_listbox} 1505 1430 2015 1600
11901191

1191-
set enable_flow_calibration 0
1192+
set enable_flow_calibration 1
1193+
if {[ifexists ::settings(firmware_version_number)] >= 1238} {
1194+
set enable_flow_calibration 1
1195+
}
11921196

11931197
set calibration_labels_row 350
11941198
set calibration_row_spacing 120
@@ -1277,7 +1281,7 @@ add_de1_text "calibrate calibrate2" 1280 290 -text [translate "Calibrate"] -font
12771281
add_de1_variable "calibrate" 500 [expr {(1 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_plus_or_minus_number $::de1(calibration_temperature)]}
12781282
add_de1_variable "calibrate" 500 [expr {(2 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_plus_or_minus_number $::de1(calibration_pressure)]}
12791283
if {$enable_flow_calibration == 1} {
1280-
add_de1_variable "calibrate" 500 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_plus_or_minus_number $::de1(calibration_flow)]}
1284+
#add_de1_variable "calibrate" 500 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_plus_or_minus_number $::de1(calibration_flow)]}
12811285
}
12821286
add_de1_variable "calibrate" 500 [expr {(4 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_steam_heater_calibration $::settings(steam_temperature)]}
12831287
add_de1_variable "calibrate" 500 [expr {(5 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_steam_flow_calibration $::settings(steam_flow)]}
@@ -1287,7 +1291,7 @@ add_de1_text "calibrate calibrate2" 1280 290 -text [translate "Calibrate"] -font
12871291
add_de1_variable "calibrate" 760 [expr {(1 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_plus_or_minus_number $::de1(factory_calibration_temperature)]}
12881292
add_de1_variable "calibrate" 760 [expr {(2 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_plus_or_minus_number $::de1(factory_calibration_pressure)]}
12891293
if {$enable_flow_calibration == 1} {
1290-
add_de1_variable "calibrate" 760 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_plus_or_minus_number $::de1(factory_calibration_flow)]}
1294+
#add_de1_variable "calibrate" 760 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_plus_or_minus_number $::de1(factory_calibration_flow)]}
12911295
}
12921296
add_de1_variable "calibrate" 760 [expr {(4 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_steam_heater_calibration $::settings(steam_temperature)]}
12931297
add_de1_variable "calibrate" 760 [expr {(5 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_steam_flow_calibration $::settings(steam_flow)]}
@@ -1316,7 +1320,8 @@ add_de1_text "calibrate calibrate2" 1280 290 -text [translate "Calibrate"] -font
13161320
add_de1_variable "calibrate" 1750 [expr {(1 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_temperature_setting $::settings(espresso_temperature)]}
13171321
add_de1_variable "calibrate" 1750 [expr {(2 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_pressure_measurement $::settings(espresso_pressure)]}
13181322
if {$enable_flow_calibration == 1} {
1319-
add_de1_variable "calibrate" 1750 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_flow_measurement $::settings(flow_profile_hold)]}
1323+
# add_de1_variable "calibrate" 1750 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {[return_flow_measurement $::settings(flow_profile_hold)]}
1324+
add_de1_variable "calibrate" 1750 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row}] -text "" -font Helv_10 -fill "#7f879a" -anchor "ne" -textvariable {x $::settings(calibration_flow_multiplier)}
13201325
}
13211326

13221327
#add_de1_variable "calibrate" 1750 750 -text "" -font Helv_15 -fill "#7f879a" -anchor "ne" -textvariable {[return_temperature_measurement $::settings(steam_temperature)]}
@@ -1344,11 +1349,13 @@ add_de1_text "calibrate calibrate2" 1280 290 -text [translate "Calibrate"] -font
13441349

13451350
if {$enable_flow_calibration == 1} {
13461351

1347-
add_de1_widget "calibrate" entry 1880 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row - [rescale_y_skin 32]}] {
1348-
set ::globals(widget_calibrate_flow) $widget
1349-
bind $widget <Return> { say [translate {save}] $::settings(sound_button_in); $::globals(widget_calibrate_flow) configure -state disabled; de1_send_calibration "flow" $::settings(flow_profile_hold) $::globals(calibration_espresso_flow); de1_read_calibration "flow"; hide_android_keyboard }
1350-
bind $widget <Leave> hide_android_keyboard
1351-
} -width 10 -state normal -font Helv_15_bold -borderwidth 1 -bg #fbfaff -foreground #4e85f4 -textvariable ::globals(calibration_espresso_flow) -relief flat -highlightthickness 1 -highlightcolor #000000
1352+
# add_de1_widget "calibrate" entry 1880 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row - [rescale_y_skin 32]}] {
1353+
# set ::globals(widget_calibrate_flow) $widget
1354+
# bind $widget <Return> { say [translate {save}] $::settings(sound_button_in); $::globals(widget_calibrate_flow) configure -state disabled; de1_send_calibration "flow" $::settings(flow_profile_hold) $::globals(calibration_espresso_flow); de1_read_calibration "flow"; hide_android_keyboard }
1355+
# bind $widget <Leave> hide_android_keyboard
1356+
# } -width 10 -state normal -font Helv_15_bold -borderwidth 1 -bg #fbfaff -foreground #4e85f4 -textvariable ::globals(calibration_espresso_flow) -relief flat -highlightthickness 1 -highlightcolor #000000
1357+
1358+
add_de1_widget "calibrate" scale 1880 [expr {(3 * $calibration_row_spacing) + $calibration_labels_row - [rescale_y_skin 16]}] {} -to 2 -from 0.5 -background #e4d1c1 -showvalue 0 -borderwidth 1 -bigincrement .1 -resolution .01 -length [rescale_x_skin 400] -width [rescale_y_skin 90] -variable ::settings(calibration_flow_multiplier) -font Helv_15_bold -sliderlength [rescale_x_skin 100] -relief flat -command {} -foreground #FFFFFF -troughcolor $slider_trough_color -borderwidth 0 -highlightthickness 0 -orient horizontal
13521359
}
13531360

13541361
#add_de1_widget "calibrate" scale 1880 875 {} -to 100 -from 60 -background #e4d1c1 -showvalue 0 -borderwidth 1 -bigincrement 1 -resolution 1 -length [rescale_x_skin 400] -width [rescale_y_skin 100] -variable ::settings(shot_weight_percentage_stop) -font Helv_15_bold -sliderlength [rescale_x_skin 100] -relief flat -command {} -foreground #FFFFFF -troughcolor $slider_trough_color -borderwidth 0 -highlightthickness 0 -orient horizontal
@@ -1421,4 +1428,3 @@ proc setting_profile_type_to_text { } {
14211428
}
14221429

14231430
#show_settings calibrate
1424-
#set ::settings(force_fw_update) 1; set ::de1(in_fw_update_mode) 1; page_to_show_when_off firmware_update_1

0 commit comments

Comments
 (0)