Skip to content

Commit

Permalink
Merge pull request #771 from bowring/joinfix
Browse files Browse the repository at this point in the history
Joinfix
  • Loading branch information
bowring authored Apr 24, 2024
2 parents b809835 + b168b5d commit c1a5a53
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 34 deletions.
2 changes: 1 addition & 1 deletion common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply plugin: 'maven-publish'


String mavenGroupId = 'org.cirdles'
String mavenVersion = '2.0.6'
String mavenVersion = '2.0.7'

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
*/
public class ProjectManagerController implements Initializable {

public Label parametersModelLabel;
@FXML
private TextField originalPrawnFileName;
@FXML
Expand Down Expand Up @@ -230,6 +231,8 @@ private void setUpParametersModelsComboBoxes() throws SquidException {
} else {
specifyDefaultCommonPbLabel.setVisible(false);
commonPbModelComboBox.setVisible(false);
parametersModelLabel.setVisible(false);
useCommonPbModelForUnknownsCheckBox.setVisible(false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ public class TaskEditorController implements Initializable {
private static final Label instructions = new Label(" Choose numerator and denominator");
private static final Button addBtn = new Button("Add ratio");
private static final HBox addBtnHBox = new HBox(addBtn);
private static final Button closeBtn = new Button("Close");
private static final HBox closeBtnHBox = new HBox(closeBtn);
private static final Label numLabel = new Label("");
private static final Label divLabel = new Label("/");
private static final Label denLabel = new Label("");
private static final HBox infoLabelHBox = new HBox(numLabel, divLabel, denLabel);
private static final VBox addInfo = new VBox(infoLabelHBox, addBtnHBox);
private static final VBox addInfo = new VBox(infoLabelHBox, addBtnHBox, closeBtnHBox);
private static final VBox menuVBox = new VBox(instructions, numDemHBox, addInfo);
private static final Map<String, Tooltip> tooltipsMap = new HashMap<>();
private static final ToggleGroup numTG = new ToggleGroup();
Expand All @@ -93,6 +95,7 @@ public class TaskEditorController implements Initializable {
private static Map<String, ExpressionTreeInterface> namedExpressionsMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
private static boolean amGeochronMode;
private final List<StackPane> undoMassesList = new ArrayList<>();
public Text pinkMassesWarningText;
EventHandler<MouseEvent> mouseEnteredExpressionEventHandler = new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
Expand Down Expand Up @@ -317,7 +320,21 @@ public void initialize(URL url, ResourceBundle rb) {
updateAddButton();
});

// updateAddButton();
closeBtnHBox.setAlignment(Pos.CENTER);
closeBtn.setStyle(
"-fx-padding: 5 22 5 22;\n"
+ " -fx-border-color: #e2e2e2;"
+ " -fx-border-width: 2;"
+ " -fx-background-radius: 0;"
+ " -fx-background-color: #FB6D42;"
+ " -fx-font-family: SansSerif;"
+ " -fx-font-size: 11pt;"
+ " -fx-text-fill: whitesmoke;"
+ " -fx-background-insets: 0 0 0 0, 0, 1, 2;");

closeBtn.setOnMouseClicked((event) -> {
ADD_RATIOS_STAGE.hide();
});

numLabel.setStyle("-fx-font-family: SansSerif bold;-fx-font-size: 18");
divLabel.setStyle("-fx-font-family: SansSerif bold;-fx-font-size: 18");
Expand Down Expand Up @@ -378,6 +395,10 @@ public void changed(ObservableValue<? extends Toggle> ob, Toggle o, Toggle n) {
}
amGeochronMode = taskEditor.getTaskType().compareTo(TaskTypeEnum.GEOCHRON) == 0;

if (taskEditor.getTaskType().equals(TaskTypeEnum.GENERAL)) {
pinkMassesWarningText.setText("");
}

updateAddButton();

initTaskDesign();
Expand Down Expand Up @@ -822,6 +843,7 @@ private ContextMenu createChooseMassesContextMenu() {

@FXML
private void updateCurrentTaskWithThisTaskAction() throws SquidException {
ADD_RATIOS_STAGE.hide();
if (squidProject.getTask().getTaskType().equals(taskEditor.getTaskType())) {
// check the mass count
boolean valid = (squidProject.getTask().getSquidSpeciesModelList().size()
Expand Down Expand Up @@ -864,6 +886,7 @@ private void updateCurrentTaskWithThisTaskAction() throws SquidException {

@FXML
private void saveThisTaskAsXMLFileAction() {
ADD_RATIOS_STAGE.hide();
try {
TaskInterface task = new Task();
task.updateTaskFromTaskDesign(taskEditor, true);
Expand All @@ -877,6 +900,7 @@ private void saveThisTaskAsXMLFileAction() {

@FXML
private void viewCurrentTaskAction() {
ADD_RATIOS_STAGE.hide();
MenuItem menuItemTaskManager = ((MenuBar) SquidUI.primaryStage.getScene()
.getRoot().getChildrenUnmodifiable().get(0)).getMenus().get(2).getItems().get(0);
menuItemTaskManager.fire();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@
</padding>
</HBox>

<Label alignment="CENTER_RIGHT" prefHeight="24.0" prefWidth="195.0" style="-fx-font-size: 14;"
text="Parameter Models:" GridPane.rowIndex="5"/>
<Label fx:id="parametersModelLabel" alignment="CENTER_RIGHT" prefHeight="24.0" prefWidth="195.0"
style="-fx-font-size: 14;" text="Parameter Models:" GridPane.rowIndex="5"/>
<HBox prefHeight="100.0" prefWidth="200.0" spacing="10.0" GridPane.columnIndex="1"
GridPane.rowIndex="6">
<children>
Expand Down Expand Up @@ -232,4 +232,4 @@
<padding>
<Insets bottom="15.0" left="20.0" right="20.0" top="1.0"/>
</padding>
</GridPane>
</GridPane>
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<Menu fx:id="openRecentOPFileMenu" mnemonicParsing="false" text="From Recent OP File"/>
</items>
</Menu>
<Menu mnemonicParsing="false" text="New Squid3 RATIO Project ">
<Menu mnemonicParsing="false" text="New Squid3 GENERAL (Ratio) Project ">
<items>
<MenuItem fx:id="newSquidRatioProjectMenuItem" mnemonicParsing="false"
onAction="#newSquidRatioProjectAction" text="From a single Prawn XML file"/>
Expand Down
19 changes: 9 additions & 10 deletions squidApp/src/main/resources/org/cirdles/squid/gui/TaskEditor.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.shape.Ellipse?>
<?import javafx.scene.text.*?>
<GridPane xmlns:fx="http://javafx.com/fxml/1" fx:id="taskManagerGridPane" hgap="15.0" minHeight="660.0"
minWidth="1250.0"
<GridPane xmlns:fx="http://javafx.com/fxml/1" fx:id="taskManagerGridPane" hgap="15.0" minHeight="660.0" minWidth="1250.0"
prefHeight="660.0" prefWidth="1250.0" styleClass="backgroundCalamari" stylesheets="@css/projectManager.css"
vgap="10.0" xmlns="http://javafx.com/javafx/17"
fx:controller="org.cirdles.squid.gui.TaskEditorController">
Expand Down Expand Up @@ -229,9 +228,9 @@
<Label style="-fx-text-fill: #3c77c9; -fx-font-weight: bold;" text="Mass Labels:" GridPane.rowIndex="6"/>
<HBox alignment="CENTER_LEFT" prefHeight="50.0" GridPane.columnIndex="1" GridPane.rowIndex="6">
<children>
<Button fx:id="chooseMassesButton" minWidth="86.0" mnemonicParsing="false"
prefHeight="27.0" prefWidth="86.0"
style="-fx-padding: 0 0 0 0; -fx-font-size: 10; -fx-font-weight: bold;" text="Add Masses"/>
<Button fx:id="chooseMassesButton" minWidth="86.0" mnemonicParsing="false" prefHeight="27.0"
prefWidth="86.0" style="-fx-padding: 0 0 0 0; -fx-font-size: 10; -fx-font-weight: bold;"
text="Add Masses"/>
<ScrollPane prefHeight="50.0" prefWidth="1035.0" HBox.hgrow="ALWAYS">
<content>
<TextFlow fx:id="defaultMassesListTextFlow" minHeight="30.0" minWidth="997.0"
Expand All @@ -243,9 +242,9 @@
<Label style="-fx-text-fill: #3c77c9; -fx-font-weight: bold;" text="Ratios:" GridPane.rowIndex="8"/>
<HBox alignment="CENTER_LEFT" prefHeight="90.0" GridPane.columnIndex="1" GridPane.rowIndex="8">
<children>
<Button fx:id="chooseRatiosButton" minWidth="86.0" mnemonicParsing="false"
prefHeight="27.0" prefWidth="86.0"
style="-fx-padding: 0 0 0 0; -fx-font-size: 10; -fx-font-weight: bold;" text="Add / Restore"/>
<Button fx:id="chooseRatiosButton" minWidth="86.0" mnemonicParsing="false" prefHeight="27.0"
prefWidth="86.0" style="-fx-padding: 0 0 0 0; -fx-font-size: 10; -fx-font-weight: bold;"
text="Add / Restore"/>
<ScrollPane HBox.hgrow="ALWAYS">
<content>
<TextFlow fx:id="defaultRatiosListTextFlow" minHeight="35.0" minWidth="997.0"
Expand All @@ -268,7 +267,7 @@
</Text>
<Spinner fx:id="backgroundIndexSpinner" maxHeight="25.0" minHeight="25.0" prefHeight="25.0"
prefWidth="54.0" style="-fx-scale-y: 0.9; -fx-background-color: AQUAMARINE;"/>
<Text strokeType="OUTSIDE" strokeWidth="0.0" style="-fx-fill: red;"
<Text fx:id="pinkMassesWarningText" strokeType="OUTSIDE" strokeWidth="0.0" style="-fx-fill: red;"
text="Note: Pink masses and ratios are required. Hint: To remove mass or ratio, click its oval in the displayed list."
textAlignment="RIGHT" wrappingWidth="578.55224609375">
<font>
Expand Down Expand Up @@ -304,4 +303,4 @@
<padding>
<Insets bottom="15.0" left="20.0" right="20.0" top="1.0"/>
</padding>
</GridPane>
</GridPane>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.web.WebView?>
<SplitPane xmlns:fx="http://javafx.com/fxml/1" fx:id="mainPane" dividerPositions="0.25" maxHeight="-Infinity" maxWidth="-Infinity"
<SplitPane xmlns:fx="http://javafx.com/fxml/1" fx:id="mainPane" dividerPositions="0.25" maxHeight="-Infinity"
maxWidth="-Infinity"
minHeight="660.0" minWidth="1250.0" prefHeight="660.0" prefWidth="1250.0"
styleClass="backgroundCalamari" stylesheets="@../css/projectManager.css"
xmlns="http://javafx.com/javafx/17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public String getIsotopeCorrectionPrefixString() {

public enum TaskTypeEnum {
GEOCHRON("GEOCHRON", "Geochron", new ArrayList<>(Arrays.asList("204", "206", "207", "208")), new ArrayList<>(Arrays.asList("204/206", "207/206", "208/206"))),
GENERAL("GENERAL", "Ratio", new ArrayList<>(Arrays.asList()), new ArrayList<>(Arrays.asList()));
GENERAL("GENERAL", "General (Ratio)", new ArrayList<>(Arrays.asList()), new ArrayList<>(Arrays.asList()));

private final String name;
private final String projectName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,15 @@ public enum RunParameterNames implements Serializable {
@XmlEnumValue("raster_time_sec")
raster_time_sec("raster_time_sec"),
@XmlEnumValue("raster_after_burn_time_sec")
raster_after_burn_time_sec("raster_after_burn_time_sec");
raster_after_burn_time_sec("raster_after_burn_time_sec"),

@XmlEnumValue("pressure_names")
pressure_names("pressure_names"),

@XmlEnumValue("pressures")
pressures("pressures");



private final String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public void createNewTask() throws SquidException {
this.task = new Task(
"New Task", prawnFile, prawnFileHandler.getNewReportsEngine());

this.task.setTaskType(projectType);
this.task.setDelimiterForUnknownNames(delimiterForUnknownNames);
this.task.setFilterForConcRefMatSpotNames(filterForConcRefMatSpotNames);
this.task.setFilterForRefMatSpotNames(filterForRefMatSpotNames);
Expand Down
18 changes: 9 additions & 9 deletions squidCore/src/main/java/org/cirdles/squid/tasks/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -650,19 +650,19 @@ private void generateSpotMetaDataFields() {
@Override
public void generateBuiltInExpressions() {

SortedSet<Expression> generateReferenceMaterialValues = updateReferenceMaterialValuesFromModel((ReferenceMaterialModel) referenceMaterialModel);
taskExpressionsOrdered.addAll(generateReferenceMaterialValues);

SortedSet<Expression> generateConcReferenceMaterialValues = updateConcReferenceMaterialValuesFromModel((ReferenceMaterialModel) concentrationReferenceMaterialModel);
taskExpressionsOrdered.addAll(generateConcReferenceMaterialValues);

SortedSet<Expression> generateCommonLeadParameterValues = updateCommonLeadParameterValuesFromModel(commonPbModel);
taskExpressionsOrdered.addAll(generateCommonLeadParameterValues);

SortedSet<Expression> generatePhysicalConstantsValues = updatePhysicalConstantsParameterValuesFromModel((PhysicalConstantsModel) physicalConstantsModel);
taskExpressionsOrdered.addAll(generatePhysicalConstantsValues);

if (taskType.equals(GEOCHRON)) {
SortedSet<Expression> generateReferenceMaterialValues = updateReferenceMaterialValuesFromModel((ReferenceMaterialModel) referenceMaterialModel);
taskExpressionsOrdered.addAll(generateReferenceMaterialValues);

SortedSet<Expression> generateConcReferenceMaterialValues = updateConcReferenceMaterialValuesFromModel((ReferenceMaterialModel) concentrationReferenceMaterialModel);
taskExpressionsOrdered.addAll(generateConcReferenceMaterialValues);

SortedSet<Expression> generateCommonLeadParameterValues = updateCommonLeadParameterValuesFromModel(commonPbModel);
taskExpressionsOrdered.addAll(generateCommonLeadParameterValues);

SortedSet<Expression> generatePlaceholderExpressions = generatePlaceholderExpressions(parentNuclide, isDirectAltPD());
taskExpressionsOrdered.addAll(generatePlaceholderExpressions);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ public class BuiltInExpressionsDataDictionary {
// ********************** REQUIRED **************************************
public static final String DEFAULT_BACKGROUND_MASS_LABEL = "BKG";

// public static final List<String> REQUIRED_NOMINAL_MASSES
// = new ArrayList<>(Arrays.asList("204", "206", "207", "208"));
// public static final List<String> REQUIRED_RATIO_NAMES
// = new ArrayList<>(Arrays.asList("204/206", "207/206", "208/206"));

// ********************** SPECIAL CONSTANTS ******************************
// holding spot until models are implemented
public static final String REF_238U235U_RM_MODEL_NAME = "r238_235s";
Expand Down

0 comments on commit c1a5a53

Please sign in to comment.