25
25
import javafx .scene .layout .HBox ;
26
26
import javafx .util .StringConverter ;
27
27
import org .cirdles .squid .constants .Squid3Constants ;
28
- import org .cirdles .squid .gui .dialogs .SquidMessageDialog ;
29
28
import org .cirdles .squid .exceptions .SquidException ;
29
+ import org .cirdles .squid .gui .dialogs .SquidMessageDialog ;
30
30
import org .cirdles .squid .parameters .parameterModels .ParametersModel ;
31
31
import org .cirdles .squid .projects .SquidProject ;
32
+ import org .cirdles .squid .tasks .Task ;
32
33
import org .cirdles .squid .tasks .TaskInterface ;
33
34
import org .cirdles .squid .tasks .taskDesign .TaskDesign ;
34
35
import org .cirdles .squid .utilities .squidPrefixTree .SquidPrefixTree ;
@@ -82,6 +83,10 @@ public class ProjectManagerController implements Initializable {
82
83
@ FXML
83
84
private ToggleGroup toggleGroupSBM ;
84
85
@ FXML
86
+ private Label invalidSBMCounts ;
87
+ @ FXML
88
+ private Label invalidSBMCountsDescription ;
89
+ @ FXML
85
90
private RadioButton linearRegressionRatioCalcRadioButton ;
86
91
@ FXML
87
92
private RadioButton spotAverageRatioCalcRadioButton ;
@@ -131,7 +136,15 @@ public void initialize(URL url, ResourceBundle rb) {
131
136
132
137
if (task != null ) {
133
138
// roundingSquid3.setSelected(task.isRoundingForSquid3());
134
- try {setUpParametersModelsComboBoxes ();}catch (SquidException squidException ){ SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow ); }
139
+ try {
140
+ setUpParametersModelsComboBoxes ();
141
+ } catch (SquidException squidException ) {
142
+ SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
143
+ }
144
+
145
+ invalidSBMCounts .setText ("" + ((Task )task ).getCountOfShrimpFractionsWithInvalidSBMcounts ());
146
+ invalidSBMCounts .setVisible (((Task )task ).getCountOfShrimpFractionsWithInvalidSBMcounts () > 0 );
147
+ invalidSBMCountsDescription .setVisible (((Task )task ).getCountOfShrimpFractionsWithInvalidSBMcounts () > 0 );
135
148
if (squidProject .isUseSBM ()) {
136
149
yesSBMRadioButton .setSelected (true );
137
150
} else {
@@ -161,7 +174,7 @@ public void initialize(URL url, ResourceBundle rb) {
161
174
titleLabel .setStyle (STYLE_MANAGER_TITLE );
162
175
}
163
176
164
- private void setUpParametersModelsComboBoxes () throws SquidException {
177
+ private void setUpParametersModelsComboBoxes () throws SquidException {
165
178
166
179
// PhysicalConstantsModels
167
180
physConstModelComboBox .setConverter (new ParameterModelStringConverter ());
@@ -174,9 +187,11 @@ private void setUpParametersModelsComboBoxes() throws SquidException{
174
187
SquidProject .setProjectChanged (true );
175
188
task .setChanged (true );
176
189
if (task .getReferenceMaterialSpots ().size () > 0 ) {
177
- try { task .setupSquidSessionSpecsAndReduceAndReport (false );} catch (SquidException squidException ){
178
- SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
179
- }
190
+ try {
191
+ task .setupSquidSessionSpecsAndReduceAndReport (false );
192
+ } catch (SquidException squidException ) {
193
+ SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
194
+ }
180
195
}
181
196
});
182
197
@@ -192,8 +207,9 @@ private void setUpParametersModelsComboBoxes() throws SquidException{
192
207
SquidProject .setProjectChanged (true );
193
208
task .setChanged (true );
194
209
if (task .getReferenceMaterialSpots ().size () > 0 ) {
195
- try {
196
- task .setupSquidSessionSpecsAndReduceAndReport (false );} catch (SquidException squidException ){
210
+ try {
211
+ task .setupSquidSessionSpecsAndReduceAndReport (false );
212
+ } catch (SquidException squidException ) {
197
213
SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
198
214
}
199
215
}
@@ -309,8 +325,13 @@ private void yesSBMRadioButtonAction(ActionEvent event) {
309
325
SquidProject .setProjectChanged (true );
310
326
task .setUseSBM (true );
311
327
task .setChanged (true );
312
- try {task .setupSquidSessionSpecsAndReduceAndReport (true );} catch (SquidException squidException ){
313
- SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
328
+ try {
329
+ task .setupSquidSessionSpecsAndReduceAndReport (true );
330
+ } catch (SquidException squidException ) {
331
+ boolean chooseNoSBM = SquidMessageDialog .showChoiceDialog (squidException .getMessage (), primaryStageWindow );
332
+ if (chooseNoSBM ){
333
+ noSBMRadioButton .setSelected (true );
334
+ }
314
335
}
315
336
}
316
337
@@ -320,7 +341,9 @@ private void noSBMRadioButtonActions(ActionEvent event) {
320
341
SquidProject .setProjectChanged (true );
321
342
task .setUseSBM (false );
322
343
task .setChanged (true );
323
- try {task .setupSquidSessionSpecsAndReduceAndReport (true );} catch (SquidException squidException ){
344
+ try {
345
+ task .setupSquidSessionSpecsAndReduceAndReport (true );
346
+ } catch (SquidException squidException ) {
324
347
SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
325
348
}
326
349
}
@@ -331,9 +354,11 @@ private void linearRegressionRatioCalcRadioButtonAction(ActionEvent event) {
331
354
SquidProject .setProjectChanged (true );
332
355
task .setUserLinFits (true );
333
356
task .setChanged (true );
334
- try { task .setupSquidSessionSpecsAndReduceAndReport (true );} catch (SquidException squidException ){
335
- SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
336
- }
357
+ try {
358
+ task .setupSquidSessionSpecsAndReduceAndReport (true );
359
+ } catch (SquidException squidException ) {
360
+ SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
361
+ }
337
362
}
338
363
339
364
@ FXML
@@ -342,7 +367,9 @@ private void spotAverageRatioCalcRadioButtonAction(ActionEvent event) {
342
367
SquidProject .setProjectChanged (true );
343
368
task .setUserLinFits (false );
344
369
task .setChanged (true );
345
- try {task .setupSquidSessionSpecsAndReduceAndReport (true );} catch (SquidException squidException ){
370
+ try {
371
+ task .setupSquidSessionSpecsAndReduceAndReport (true );
372
+ } catch (SquidException squidException ) {
346
373
SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
347
374
}
348
375
}
@@ -373,7 +400,9 @@ private void autoExcludeSpotsCheckBoxAction(ActionEvent event) {
373
400
// this will cause weighted mean expressions to be changed with boolean flag
374
401
squidProject .setSquidAllowsAutoExclusionOfSpots (autoExcludeSpotsCheckBox .isSelected ());
375
402
SquidProject .setProjectChanged (true );
376
- try {task .updateRefMatCalibConstWMeanExpressions (autoExcludeSpotsCheckBox .isSelected ());} catch (SquidException squidException ){
403
+ try {
404
+ task .updateRefMatCalibConstWMeanExpressions (autoExcludeSpotsCheckBox .isSelected ());
405
+ } catch (SquidException squidException ) {
377
406
SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
378
407
}
379
408
}
@@ -409,9 +438,11 @@ private void parametersSetDefaultsOnAction(ActionEvent actionEvent) {
409
438
410
439
@ FXML
411
440
private void refreshModelsAction (ActionEvent event ) {
412
- try { task .refreshParametersFromModels (squidProject .isTypeGeochron (), true , false );} catch (SquidException squidException ){
413
- SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
414
- }
441
+ try {
442
+ task .refreshParametersFromModels (squidProject .isTypeGeochron (), true , false );
443
+ } catch (SquidException squidException ) {
444
+ SquidMessageDialog .showWarningDialog (squidException .getMessage (), primaryStageWindow );
445
+ }
415
446
}
416
447
417
448
static class ParameterModelStringConverter extends StringConverter <ParametersModel > {
0 commit comments