From 0991e4a41f93370e4b0abed079263cbf6d99ecd2 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Mon, 25 May 2015 16:40:23 +0200 Subject: [PATCH] Configtool: add some formatting to collected help texts. Tooltips don't size their box after line lengths, but have their own idea on how wide to make it. Accordingly one should display text with newlines only for paragraph delimiters. This also required adjustments to all the board and printer description comments. No functional change there. This should solve issue #148. --- config/board.3drag.h | 5 ++-- config/board.gen3.h | 5 ++-- config/board.gen6.h | 5 ++-- config/board.gen7-v1.1-v1.3.h | 5 ++-- config/board.gen7-v1.4.h | 5 ++-- config/board.ramps-v1.2.h | 5 ++-- config/board.ramps-v1.3.h | 5 ++-- config/board.rumba.h | 5 ++-- config/board.sanguinololu-v1.1.h | 5 ++-- config/board.sanguinololu-v1.2.h | 5 ++-- config/board.sanguish.h | 5 ++-- config/board.teensy++-v2.0.h | 5 ++-- config/board.teensy-v2.0.h | 5 ++-- config/printer.mendel.h | 43 +++++++++++++++++--------------- config/printer.wolfstrap.h | 43 +++++++++++++++++--------------- configtool/boardpanel.py | 8 ++++++ configtool/printerpanel.py | 8 ++++++ 17 files changed, 101 insertions(+), 66 deletions(-) diff --git a/config/board.3drag.h b/config/board.3drag.h index d4430b6..e045b85 100644 --- a/config/board.3drag.h +++ b/config/board.3drag.h @@ -196,8 +196,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.gen3.h b/config/board.gen3.h index 28c99af..35b7dff 100644 --- a/config/board.gen3.h +++ b/config/board.gen3.h @@ -187,8 +187,9 @@ DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.gen6.h b/config/board.gen6.h index c55b838..2744ad0 100644 --- a/config/board.gen6.h +++ b/config/board.gen6.h @@ -191,8 +191,9 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO5, THERMISTOR_EXTRUDER) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.gen7-v1.1-v1.3.h b/config/board.gen7-v1.1-v1.3.h index c913664..1ada02b 100644 --- a/config/board.gen7-v1.1-v1.3.h +++ b/config/board.gen7-v1.1-v1.3.h @@ -200,8 +200,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.gen7-v1.4.h b/config/board.gen7-v1.4.h index e633a2a..1aeaa89 100644 --- a/config/board.gen7-v1.4.h +++ b/config/board.gen7-v1.4.h @@ -201,8 +201,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.ramps-v1.2.h b/config/board.ramps-v1.2.h index 5d79834..e05eb94 100644 --- a/config/board.ramps-v1.2.h +++ b/config/board.ramps-v1.2.h @@ -197,8 +197,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO1, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.ramps-v1.3.h b/config/board.ramps-v1.3.h index 09c1096..770070d 100644 --- a/config/board.ramps-v1.3.h +++ b/config/board.ramps-v1.3.h @@ -200,8 +200,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.rumba.h b/config/board.rumba.h index dcdf3af..0f305f2 100644 --- a/config/board.rumba.h +++ b/config/board.rumba.h @@ -200,8 +200,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO11, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.sanguinololu-v1.1.h b/config/board.sanguinololu-v1.1.h index d93d3f4..f5b95bc 100644 --- a/config/board.sanguinololu-v1.1.h +++ b/config/board.sanguinololu-v1.1.h @@ -198,8 +198,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.sanguinololu-v1.2.h b/config/board.sanguinololu-v1.2.h index f91b882..ac9981a 100644 --- a/config/board.sanguinololu-v1.2.h +++ b/config/board.sanguinololu-v1.2.h @@ -198,8 +198,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.sanguish.h b/config/board.sanguish.h index dc24056..91da2a4 100644 --- a/config/board.sanguish.h +++ b/config/board.sanguish.h @@ -198,8 +198,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.teensy++-v2.0.h b/config/board.teensy++-v2.0.h index cf07991..7f4e903 100644 --- a/config/board.teensy++-v2.0.h +++ b/config/board.teensy++-v2.0.h @@ -196,8 +196,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/board.teensy-v2.0.h b/config/board.teensy-v2.0.h index 405926b..aeb1336 100644 --- a/config/board.teensy-v2.0.h +++ b/config/board.teensy-v2.0.h @@ -196,8 +196,9 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED) device has the index 0 (zero). Set 'pwm' to ... - 1 for using PWM on a PWM-able pin and on/off on other pins. - 0 for using on/off on a PWM-able pin, too. + 1 for using PWM on a PWM-able pin and on/off on other pins. + 0 for using on/off on a PWM-able pin, too. + Using PWM usually gives smoother temperature control but can conflict with slow switches, like solid state relays. PWM frequency can be influenced globally with FAST_PWM, see below. diff --git a/config/printer.mendel.h b/config/printer.mendel.h index 87a26c1..a651d3f 100644 --- a/config/printer.mendel.h +++ b/config/printer.mendel.h @@ -10,13 +10,15 @@ Valid values (see dda_kinematics.h): - KINEMATICS_STRAIGHT Motors move axis directions directly. This is the - traditional type, found in many printers, including - Mendel, Prusa i3, Mendel90, Ormerod, Mantis. + KINEMATICS_STRAIGHT + Motors move axis directions directly. This is the + traditional type, found in many printers, including + Mendel, Prusa i3, Mendel90, Ormerod, Mantis. - KINEMATICS_COREXY A bot using CoreXY kinematics. Typical for CoreXY are - long and crossing toothed belts and a print head moving - on the X-Y-plane. + KINEMATICS_COREXY + A bot using CoreXY kinematics. Typical for CoreXY + are long and crossing toothed belts and a print head + moving on the X-Y-plane. */ #define KINEMATICS KINEMATICS_STRAIGHT @@ -26,7 +28,7 @@ All numbers are integers, so no decimal point, please :-) - Valid range: 20 to 4'0960'000 (0.02 to 40960 steps/mm) + Valid range: 20 to 4'0960'000 (0.02 to 40960 steps/mm) */ #define STEPS_PER_M_X 40000 #define STEPS_PER_M_Y 40000 @@ -65,9 +67,9 @@ endstops, more for optical ones. You can set it to zero, in which case SEARCH_FEEDRATE_{XYZ} is used, but expect very slow homing movements. - Units: micrometers - Sane values: 0 to 20000 (0 to 20 mm) - Valid range: 0 to 1000000 + Units: micrometers + Sane values: 0 to 20000 (0 to 20 mm) + Valid range: 0 to 1000000 */ #define ENDSTOP_CLEARANCE_X 1000 #define ENDSTOP_CLEARANCE_Y 1000 @@ -109,8 +111,8 @@ How fast to accelerate when using ACCELERATION_RAMPING. Start with 10 for milling (high precision) or 1000 for printing. - Units: mm/s^2 - Useful range: 1 to 10'000 + Units: mm/s^2 + Useful range: 1 to 10'000 */ #define ACCELERATION 1000 @@ -139,9 +141,9 @@ G-code are small and your printer runs through entire curves full speed, there's no point in raising the values. - Units: mm/min - Sane values: 0 to 400 - Valid range: 0 to 65535 + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ #define MAX_JERK_X 200 #define MAX_JERK_Y 200 @@ -168,7 +170,7 @@ temperature is considered to be achieved. Also, BANG_BANG tries to stay within half of this hysteresis. - Unit: degree Celsius + Unit: degree Celsius */ #define TEMP_HYSTERESIS 10 @@ -177,7 +179,7 @@ +- TEMP_HYSTERESIS) for this long before target is achieved (and a M116 succeeds). - Unit: seconds + Unit: seconds */ #define TEMP_RESIDENCY_TIME 60 @@ -190,7 +192,7 @@ quicker but rougher. If you need to use this, set the PID parameter to zero (M132 S0) to make the PID loop insensitive to noise. - Valid range: 0.001 to 1.0 + Valid range: 0.001 to 1.0 */ #define TEMP_EWMA 1.0 @@ -292,8 +294,9 @@ false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. - Valid range: 1...255. Use 4 or less for reliable endstops, 8 or even more - for flaky ones. + Use 4 or less for reliable endstops, 8 or even more for flaky ones. + + Valid range: 1...255. */ #define ENDSTOP_STEPS 4 diff --git a/config/printer.wolfstrap.h b/config/printer.wolfstrap.h index 3e4c2d3..5605585 100644 --- a/config/printer.wolfstrap.h +++ b/config/printer.wolfstrap.h @@ -10,13 +10,15 @@ Valid values (see dda_kinematics.h): - KINEMATICS_STRAIGHT Motors move axis directions directly. This is the - traditional type, found in many printers, including - Mendel, Prusa i3, Mendel90, Ormerod, Mantis. + KINEMATICS_STRAIGHT + Motors move axis directions directly. This is the + traditional type, found in many printers, including + Mendel, Prusa i3, Mendel90, Ormerod, Mantis. - KINEMATICS_COREXY A bot using CoreXY kinematics. Typical for CoreXY are - long and crossing toothed belts and a print head moving - on the X-Y-plane. + KINEMATICS_COREXY + A bot using CoreXY kinematics. Typical for CoreXY + are long and crossing toothed belts and a print head + moving on the X-Y-plane. */ #define KINEMATICS KINEMATICS_STRAIGHT @@ -26,7 +28,7 @@ All numbers are integers, so no decimal point, please :-) - Valid range: 20 to 4'0960'000 (0.02 to 40960 steps/mm) + Valid range: 20 to 4'0960'000 (0.02 to 40960 steps/mm) */ #define STEPS_PER_M_X 1280000 #define STEPS_PER_M_Y 1280000 @@ -65,9 +67,9 @@ endstops, more for optical ones. You can set it to zero, in which case SEARCH_FEEDRATE_{XYZ} is used, but expect very slow homing movements. - Units: micrometers - Sane values: 0 to 20000 (0 to 20 mm) - Valid range: 0 to 1000000 + Units: micrometers + Sane values: 0 to 20000 (0 to 20 mm) + Valid range: 0 to 1000000 */ #define ENDSTOP_CLEARANCE_X 1000 #define ENDSTOP_CLEARANCE_Y 1000 @@ -109,8 +111,8 @@ How fast to accelerate when using ACCELERATION_RAMPING. Start with 10 for milling (high precision) or 1000 for printing. - Units: mm/s^2 - Useful range: 1 to 10'000 + Units: mm/s^2 + Useful range: 1 to 10'000 */ #define ACCELERATION 100 @@ -139,9 +141,9 @@ G-code are small and your printer runs through entire curves full speed, there's no point in raising the values. - Units: mm/min - Sane values: 0 to 400 - Valid range: 0 to 65535 + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ #define MAX_JERK_X 20 #define MAX_JERK_Y 20 @@ -168,7 +170,7 @@ temperature is considered to be achieved. Also, BANG_BANG tries to stay within half of this hysteresis. - Unit: degree Celsius + Unit: degree Celsius */ #define TEMP_HYSTERESIS 10 @@ -177,7 +179,7 @@ +- TEMP_HYSTERESIS) for this long before target is achieved (and a M116 succeeds). - Unit: seconds + Unit: seconds */ #define TEMP_RESIDENCY_TIME 60 @@ -190,7 +192,7 @@ quicker but rougher. If you need to use this, set the PID parameter to zero (M132 S0) to make the PID loop insensitive to noise. - Valid range: 0.001 to 1.0 + Valid range: 0.001 to 1.0 */ #define TEMP_EWMA 1.0 @@ -292,8 +294,9 @@ false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. - Valid range: 1...255. Use 4 or less for reliable endstops, 8 or even more - for flaky ones. + Use 4 or less for reliable endstops, 8 or even more for flaky ones. + + Valid range: 1...255. */ #define ENDSTOP_STEPS 4 diff --git a/configtool/boardpanel.py b/configtool/boardpanel.py index bf5fe03..81bf179 100644 --- a/configtool/boardpanel.py +++ b/configtool/boardpanel.py @@ -237,6 +237,14 @@ class BoardPanel(wx.Panel): if gatheringHelpText: if reHelpTextEnd.match(ln): gatheringHelpText = False + helpTextString = helpTextString.strip() + # Keep paragraphs with double-newline. + helpTextString = helpTextString.replace("\n\n ", "\n\n") + # Keep indented lines, typically a list. + helpTextString = helpTextString.replace("\n\n ", "\n\n ") + helpTextString = helpTextString.replace("\n ", "\n\n ") + # Remove all other newlines and indents. + helpTextString = helpTextString.replace("\n ", " ") hk = helpKey.split() for k in hk: self.helpText[k] = helpTextString diff --git a/configtool/printerpanel.py b/configtool/printerpanel.py index fb13730..ac3ebc0 100644 --- a/configtool/printerpanel.py +++ b/configtool/printerpanel.py @@ -191,6 +191,14 @@ class PrinterPanel(wx.Panel): if gatheringHelpText: if reHelpTextEnd.match(ln): gatheringHelpText = False + helpTextString = helpTextString.strip() + # Keep paragraphs with double-newline. + helpTextString = helpTextString.replace("\n\n ", "\n\n") + # Keep indented lines, typically a list. + helpTextString = helpTextString.replace("\n\n ", "\n\n ") + helpTextString = helpTextString.replace("\n ", "\n\n ") + # Remove all other newlines and indents. + helpTextString = helpTextString.replace("\n ", " ") hk = helpKey.split() for k in hk: self.helpText[k] = helpTextString