@@ -62,6 +62,7 @@ class SettingsWidget(QWidget):
62
62
"flow_rate" , # Коэффициент потока расплава
63
63
"pressure_advance_on" ,
64
64
"pressure_advance_rate" ,
65
+ "random_layer_start" ,
65
66
# TODO: add separate dummy setting to mark the beginning of supports settings
66
67
"supports_on" ,
67
68
"support_density" ,
@@ -127,6 +128,7 @@ def __init__(self, parent=None, settings_provider: callable = None):
127
128
"retraction_speed" : self .locale .RetractionSpeed ,
128
129
"retraction_compensation" : self .locale .RetractCompensationAmount ,
129
130
"material_shrinkage" : self .locale .MaterialShrinkage ,
131
+ "random_layer_start" : self .locale .RandomLayerStart ,
130
132
# TODO: add separate dummy setting to mark the beginning of supports settings
131
133
"supports_on" : self .locale .SupportsOn ,
132
134
"support_density" : self .locale .SupportDensity ,
@@ -888,21 +890,21 @@ def on_change():
888
890
elif name == "retraction_on" :
889
891
self .ensure_sett ("slicing.retraction_on" )
890
892
891
- retraction_on_label = QLabel (self .locale .Retraction )
892
- retraction_on_box = QCheckBox ()
893
+ rls_on_label = QLabel (self .locale .Retraction )
894
+ rls_on_box = QCheckBox ()
893
895
if self .sett ().slicing .retraction_on :
894
- retraction_on_box .setCheckState (QtCore .Qt .Checked )
895
- self .panel .addWidget (retraction_on_label , self .next_row , 1 )
896
- self .panel .addWidget (retraction_on_box , self .cur_row , 2 , 1 , self .col2_cells )
896
+ rls_on_box .setCheckState (QtCore .Qt .Checked )
897
+ self .panel .addWidget (rls_on_label , self .next_row , 1 )
898
+ self .panel .addWidget (rls_on_box , self .cur_row , 2 , 1 , self .col2_cells )
897
899
898
900
def on_change ():
899
- self .sett ().slicing .retraction_on = retraction_on_box .isChecked ()
901
+ self .sett ().slicing .retraction_on = rls_on_box .isChecked ()
900
902
901
- retraction_on_box .stateChanged .connect (on_change )
903
+ rls_on_box .stateChanged .connect (on_change )
902
904
903
905
self .__elements [name ] = {
904
- "label" : retraction_on_label ,
905
- "checkbox" : retraction_on_box ,
906
+ "label" : rls_on_label ,
907
+ "checkbox" : rls_on_box ,
906
908
}
907
909
908
910
elif name == "retraction_distance" :
@@ -1005,6 +1007,25 @@ def on_change():
1005
1007
"edit" : material_shrinkage_value ,
1006
1008
}
1007
1009
1010
+ elif name == "random_layer_start" :
1011
+ self .ensure_sett ("slicing.random_layer_start" )
1012
+
1013
+ rls_on_label = QLabel (self .locale .RandomLayerStart )
1014
+ rls_on_box = QCheckBox ()
1015
+ if self .sett ().slicing .random_layer_start :
1016
+ rls_on_box .setCheckState (QtCore .Qt .Checked )
1017
+ self .panel .addWidget (rls_on_label , self .next_row , 1 )
1018
+ self .panel .addWidget (rls_on_box , self .cur_row , 2 , 1 , self .col2_cells )
1019
+
1020
+ def on_change ():
1021
+ self .sett ().slicing .random_layer_start = rls_on_box .isChecked ()
1022
+
1023
+ rls_on_box .stateChanged .connect (on_change )
1024
+
1025
+ self .__elements [name ] = {
1026
+ "label" : rls_on_label ,
1027
+ "checkbox" : rls_on_box ,
1028
+ }
1008
1029
elif name == "flow_rate" :
1009
1030
self .ensure_sett ("slicing.flow_rate" )
1010
1031
0 commit comments