Skip to content

Commit

Permalink
Add fixes from @tech2077 to fix faulty conversion from bool to long i…
Browse files Browse the repository at this point in the history
…nt. Potentially fixes #624,#623, #622, #589, #581, #580, #579, #578, #577, #566, #560, and #545.
  • Loading branch information
FormerLurker committed Nov 17, 2020
1 parent 5a0482b commit 88aa71f
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 144 deletions.
1 change: 0 additions & 1 deletion octoprint_octolapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3652,7 +3652,6 @@ def get_assets(self):
user="FormerLurker",
repo="Octolapse",
pip="https://github.com/FormerLurker/Octolapse/archive/{target_version}.zip",

stable_branch=dict(branch="master", commitish=["master"], name="Stable"),
release_compare='custom',
prerelease_branches=[
Expand Down
62 changes: 31 additions & 31 deletions octoprint_octolapse/data/lib/c/extruder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ PyObject* extruder::to_py_tuple() const
retraction_length, // 8
deretraction_length, // 9
// Bool (represented as an integer)
is_extruding_start, // 10
is_extruding, // 11
is_primed, // 12
is_retracting_start, // 13
is_retracting, // 14
is_retracted, // 15
is_partially_retracted, // 16
is_deretracting_start, // 17
is_deretracting, // 18
is_deretracted // 19
(long int)(is_extruding_start ? 1 : 0), // 10
(long int)(is_extruding ? 1 : 0), // 11
(long int)(is_primed ? 1 : 0), // 12
(long int)(is_retracting_start ? 1 : 0), // 13
(long int)(is_retracting ? 1 : 0), // 14
(long int)(is_retracted ? 1 : 0), // 15
(long int)(is_partially_retracted ? 1 : 0), // 16
(long int)(is_deretracting_start ? 1 : 0), // 17
(long int)(is_deretracting ? 1 : 0), // 18
(long int)(is_deretracted ? 1 : 0) // 19
);
if (py_extruder == NULL)
{
Expand Down Expand Up @@ -97,27 +97,27 @@ PyObject* extruder::to_py_dict() const
retraction_length,
"deretraction_length",
deretraction_length,
// Bool (represented as an integer)
"is_extruding_start",
is_extruding_start,
"is_extruding",
is_extruding,
"is_primed",
is_primed,
"is_retracting_start",
is_retracting_start,
"is_retracting",
is_retracting,
"is_retracted",
is_retracted,
"is_partially_retracted",
is_partially_retracted,
"is_deretracting_start",
is_deretracting_start,
"is_deretracting",
is_deretracting,
"is_deretracted",
is_deretracted
// Bool (represented as an integer)
"is_extruding_start",
(long int)(is_extruding_start ? 1 : 0),
"is_extruding",
(long int)(is_extruding ? 1 : 0),
"is_primed",
(long int)(is_primed ? 1 : 0),
"is_retracting_start",
(long int)(is_retracting_start ? 1 : 0),
"is_retracting",
(long int)(is_retracting ? 1 : 0),
"is_retracted",
(long int)(is_retracted ? 1 : 0),
"is_partially_retracted",
(long int)(is_partially_retracted ? 1 : 0),
"is_deretracting_start",
(long int)(is_deretracting_start ? 1 : 0),
"is_deretracting",
(long int)(is_deretracting ? 1 : 0),
"is_deretracted",
(long int)(is_deretracted ? 1 : 0)
);
if (p_extruder == NULL)
{
Expand Down
220 changes: 110 additions & 110 deletions octoprint_octolapse/data/lib/c/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,41 +447,41 @@ PyObject* position::to_py_tuple()
height_increment_change_count, // 20 !!!!!!
current_tool, // 21
num_extruders, // 22
// Bool (represented as an integer)
x_homed, // 23
y_homed, // 24
z_homed, // 25
is_relative, // 26
is_extruder_relative, // 27
is_metric, // 28
is_printer_primed, // 29
has_definite_position, // 30
is_layer_change, // 31
is_height_change, // 32
is_height_increment_change, // 33
is_xy_travel, // 34
is_xyz_travel, // 35
is_zhop, // 36
has_xy_position_changed, // 37
has_position_changed, // 38
has_received_home_command, // 39
is_in_position, // 40
in_path_position, // 41
is_in_bounds, // 42
// Null bool, represented as integers
x_null, // 43
y_null, // 44
z_null, // 45
f_null, // 46
is_relative_null, // 47
is_extruder_relative_null, // 48
last_extrusion_height_null, // 49
is_metric_null, // 50
true, // 51 - Firmware retraction length null
true, // 52 - Firmware unretraction additional length null
true, // 53 - Firmware retraction feedrate null
true, // 54 - Firmware unretraction feedrate null
true, // 55 - Firmware ZLift Null
// Bool (represented as an integer)
(long int)(x_homed ? 1 : 0), // 23
(long int)(y_homed ? 1 : 0), // 24
(long int)(z_homed ? 1 : 0), // 25
(long int)(is_relative ? 1 : 0), // 26
(long int)(is_extruder_relative ? 1 : 0), // 27
(long int)(is_metric ? 1 : 0), // 28
(long int)(is_printer_primed ? 1 : 0), // 29
(long int)(has_definite_position ? 1 : 0), // 30
(long int)(is_layer_change ? 1 : 0), // 31
(long int)(is_height_change ? 1 : 0), // 32
(long int)(is_height_increment_change ? 1 : 0), // 33
(long int)(is_xy_travel ? 1 : 0), // 34
(long int)(is_xyz_travel ? 1 : 0), // 35
(long int)(is_zhop ? 1 : 0), // 36
(long int)(has_xy_position_changed ? 1 : 0), // 37
(long int)(has_position_changed ? 1 : 0), // 38
(long int)(has_received_home_command ? 1 : 0), // 39
(long int)(is_in_position ? 1 : 0), // 40
(long int)(in_path_position ? 1 : 0), // 41
(long int)(is_in_bounds ? 1 : 0), // 42
// Null bool, represented as integers
(long int)(x_null ? 1 : 0), // 43
(long int)(y_null ? 1 : 0), // 44
(long int)(z_null ? 1 : 0), // 45
(long int)(f_null ? 1 : 0), // 46
(long int)(is_relative_null ? 1 : 0), // 47
(long int)(is_extruder_relative_null ? 1 : 0), // 48
(long int)(last_extrusion_height_null ? 1 : 0), // 49
(long int)(is_metric_null ? 1 : 0), // 50
(long int)(true ? 1 : 0), // 51 - Firmware retraction length null
(long int)(true ? 1 : 0), // 52 - Firmware unretraction additional length null
(long int)(true ? 1 : 0), // 53 - Firmware retraction feedrate null
(long int)(true ? 1 : 0), // 54 - Firmware unretraction feedrate null
(long int)(true ? 1 : 0), // 55 - Firmware ZLift Null
// file statistics
file_line_number, // 56
gcode_number, // 57
Expand Down Expand Up @@ -576,81 +576,81 @@ PyObject* position::to_py_dict()
current_tool,
"num_extruders",
num_extruders,
// Bools
"x_null",
x_null,
"y_null",
y_null,
"z_null",
z_null,
"f_null",
f_null,
"x_homed",
x_homed,
"y_homed",
y_homed,
"z_homed",
z_homed,
"is_relative",
is_relative,
"is_relative_null",
is_relative_null,
"is_extruder_relative",
is_extruder_relative,
"is_extruder_relative_null",
is_extruder_relative_null,
"is_metric",
is_metric,
"is_metric_null",
is_metric_null,
"is_printer_primed",
is_printer_primed,
"last_extrusion_height_null",
last_extrusion_height_null,
"firmware_retraction_length_null",
false,
"firmware_unretraction_additional_length_null",
false,
"firmware_retraction_feedrate_null",
false,
"firmware_unretraction_feedrate_null",
false,
"firmware_z_lift_null",
false,
"has_position_error",
false,
"has_definite_position",
has_definite_position,
"is_layer_change",
is_layer_change,
"is_height_change",
is_height_change,
"is_height_increment_change",
is_height_increment_change,
"is_xy_travel",
is_xy_travel,
"is_xyz_travel",
is_xyz_travel,
"is_zhop",
is_zhop,
"has_xy_position_changed",
has_xy_position_changed,
"has_position_changed",
has_position_changed,
"has_received_home_command",
has_received_home_command,
"is_in_position",
is_in_position,
"in_path_position",
in_path_position,
"file_line_number",
file_line_number,
"file_position",
file_position,
"gcode_number",
gcode_number,
"is_in_bounds",
is_in_bounds
// Bools
"x_null",
(long int)(x_null ? 1 : 0),
"y_null",
(long int)(y_null ? 1 : 0),
"z_null",
(long int)(z_null ? 1 : 0),
"f_null",
(long int)(f_null ? 1 : 0),
"x_homed",
(long int)(x_homed ? 1 : 0),
"y_homed",
(long int)(y_homed ? 1 : 0),
"z_homed",
(long int)(z_homed ? 1 : 0),
"is_relative",
(long int)(is_relative ? 1 : 0),
"is_relative_null",
(long int)(is_relative_null ? 1 : 0),
"is_extruder_relative",
(long int)(is_extruder_relative ? 1 : 0),
"is_extruder_relative_null",
(long int)(is_extruder_relative_null ? 1 : 0),
"is_metric",
(long int)(is_metric ? 1 : 0),
"is_metric_null",
(long int)(is_metric_null ? 1 : 0),
"is_printer_primed",
(long int)(is_printer_primed ? 1 : 0),
"last_extrusion_height_null",
(long int)(last_extrusion_height_null ? 1 : 0),
"firmware_retraction_length_null",
(long int)(false ? 1 : 0),
"firmware_unretraction_additional_length_null",
(long int)(false ? 1 : 0),
"firmware_retraction_feedrate_null",
(long int)(false ? 1 : 0),
"firmware_unretraction_feedrate_null",
(long int)(false ? 1 : 0),
"firmware_z_lift_null",
(long int)(false ? 1 : 0),
"has_position_error",
(long int)(false ? 1 : 0),
"has_definite_position",
(long int)(has_definite_position ? 1 : 0),
"is_layer_change",
(long int)(is_layer_change ? 1 : 0),
"is_height_change",
(long int)(is_height_change ? 1 : 0),
"is_height_increment_change",
(long int)(is_height_increment_change ? 1 : 0),
"is_xy_travel",
(long int)(is_xy_travel ? 1 : 0),
"is_xyz_travel",
(long int)(is_xyz_travel ? 1 : 0),
"is_zhop",
(long int)(is_zhop ? 1 : 0),
"has_xy_position_changed",
(long int)(has_xy_position_changed ? 1 : 0),
"has_position_changed",
(long int)(has_position_changed ? 1 : 0),
"has_received_home_command",
(long int)(has_received_home_command ? 1 : 0),
"is_in_position",
(long int)(is_in_position ? 1 : 0),
"in_path_position",
(long int)(in_path_position ? 1 : 0),
"file_line_number",
file_line_number,
"file_position",
file_position,
"gcode_number",
gcode_number,
"is_in_bounds",
(long int)(is_in_bounds ? 1 : 0)
);
if (p_position == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion octoprint_octolapse/templates/octolapse_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
If there's anyone I've forgotten here, please let me know!<br />
<b>Billie Ruben</b> - Famed and beloved influencer, contributor, mod of /r/3DPrinting, the 3DPrinters discord server, and all around good person.<br /><br/>
I'd like to add a special thank you to <b>Andy</b> and <b>Maggie</b> for encouragement, testing, support, and tolerance.<br />

<b>Tech2077</b> - Thank you for digging through the c++ code and tracking down a bug that has been driving me mad for several months. I'm not sure if I'd have ever found it without you!<br/>
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion octoprint_octolapse_setuptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class NumberedVersion(version.LooseVersion):
# This is the current plugin version, not including any versioneer info,
# which could be earlier or later
CurrentVersion = "0.4.0"
CurrentVersion = "0.4.1"
# This is the CurrentVersion last time the settings were migrated.
CurrentSettingsVersion = "0.4.0"
'''
Expand Down

0 comments on commit 88aa71f

Please sign in to comment.