Skip to content

Commit

Permalink
Merge pull request #3 from Domeml94/1.0.0
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
Domeml94 authored Aug 14, 2023
2 parents 877129e + ff5009b commit 6c55edf
Show file tree
Hide file tree
Showing 196 changed files with 7,736 additions and 3,035 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ buildNumber.properties
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
.classpath
/bin/
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,17 @@ This project is setup as Maven project. All dependencies are setup by the provid
**Documentation**

This tool is part of a publication currently undergoing submission process.


___


Adding Active Materials to Database - The following parameters need to be known for proper calculation:
- Mechanism of electrochemical reaction (number of transfered electrons | number of transfered protons at defined pH value)
- Solubility
- Redox potential
- Diffusion coefficient
- Reaction rate constant + charge transfer coefficient
- Capacity fade rate / capacity retention
- In case of organic solvents: Density, dyn./kin. viscosity as well as electrochemical stability window of selected solvent



Expand Down
18 changes: 0 additions & 18 deletions demo/README.txt

This file was deleted.

Binary file modified demo/ReFlowLab-1.0.0-SNAPSHOT-shaded.jar
Binary file not shown.
Binary file removed demo/dominikemmel.zip
Binary file not shown.
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.dominikemmel.reflowlab</groupId>
<artifactId>ReFlowLab</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.0</version>
<packaging>jar</packaging>

<properties>
Expand Down Expand Up @@ -130,6 +130,13 @@
<version>2.2</version>
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.scilab.forge/jlatexmath -->
<dependency>
<groupId>org.scilab.forge</groupId>
<artifactId>jlatexmath</artifactId>
<version>1.0.7</version>
</dependency>

</dependencies>

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/de/dominikemmel/reflowlab/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ private static void initialise(String table) throws SQLException {
+ "Abbreviation VARCHAR(255),"
+ "Name VARCHAR(255),"
+ "StructuralFormula VARCHAR(255),"
+ "Category VARCHAR(255),"
+ "M FLOAT,"
+ "n INT,"
+ "RefIDn INT,"
Expand Down Expand Up @@ -273,6 +274,11 @@ private static void initialise(String table) throws SQLException {
+ "degRate FLOAT,"
+ "RefIDdegRate INT,"
+ "f FLOAT,"
+ "fEloVol FLOAT,"
+ "fConc FLOAT,"
+ "note VARCHAR(1000),"
+ "fSymCellCycl INT,"
+ "theoMaxCap FLOAT,"
+ "RefIDf INT,"
+ "editDate TIMESTAMP,"
+ "primary key(ID));";
Expand Down
86 changes: 84 additions & 2 deletions src/main/java/de/dominikemmel/reflowlab/MainApp.java
Original file line number Diff line number Diff line change
@@ -1,43 +1,125 @@
package de.dominikemmel.reflowlab;

import java.awt.Color;
import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.PrintStream;

import de.dominikemmel.reflowlab.controller.maincontrol.ConsoleOverviewController;
import de.dominikemmel.reflowlab.controller.maincontrol.ReaderThread;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.WindowEvent;



public class MainApp extends Application {

private final PipedInputStream pipeIn = new PipedInputStream();
private final PipedInputStream pipeIn2 = new PipedInputStream();
Thread errorThrower;
private Thread reader;
private Thread reader2;
boolean quit;
private TextArea txtArea;

@Override
public void start(Stage primaryStage) throws IOException {

Updates.updateDB();

Parent root = FXMLLoader.load(getClass().getResource("/de/dominikemmel/reflowlab/controller/maincontrol/fxml/main.fxml"));

Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("/de/dominikemmel/reflowlab/style/reflowlabStyle1.css").toExternalForm());
primaryStage.initStyle(StageStyle.DECORATED);

primaryStage.setScene(scene);
primaryStage.show();
primaryStage.setTitle("ReFlowLab");
// primaryStage.getIcons().add(new Image("/.../.png"));

primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/de/dominikemmel/reflowlab/img/logo_simple/1x/logo_simple1x.png")));
// MainController.dbTest();

// Database.createConnection("activeMaterial");
// Database.createConnection("solvent");
// Database.createConnection("electrolyte");
// Database.createConnection("costAnalysis");
// Database.createConnection("reference");


txtArea = ConsoleOverviewController.staticTxtArea;

//Thread execution for reading output stream
executeReaderThreads();

//Thread closing on stag close event
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent e) {

closeThread();
Platform.exit();
System.exit(0);
}
});


}

//method to handle thread closing on stage closing
synchronized void closeThread() {
System.out.println("Message: Stage is closed.");
this.quit = true;
notifyAll();
try { this.reader.join(1000L); this.pipeIn.close(); } catch (Exception e) {
}try { this.reader2.join(1000L); this.pipeIn2.close(); } catch (Exception e) {
}System.exit(0);
}

/**
* @param args the command line arguments
*/

public static void main(String[] args) throws Exception {

launch(args);
}

public void executeReaderThreads() {
try {
PipedOutputStream pout = new PipedOutputStream(this.pipeIn);
System.setOut(new PrintStream(pout, true));
}
catch (IOException io) {

}
catch (SecurityException se) {

}

try {
PipedOutputStream pout2 = new PipedOutputStream(this.pipeIn2);
System.setErr(new PrintStream(pout2, true));
}
catch (IOException io) {

}
catch (SecurityException se) {

}

ReaderThread obj = new ReaderThread(pipeIn, pipeIn2, errorThrower, reader, reader2, quit, txtArea);


}
}
14 changes: 14 additions & 0 deletions src/main/java/de/dominikemmel/reflowlab/Updates.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package de.dominikemmel.reflowlab;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class Updates {

public static void updateDB() {


}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.image.Image;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
Expand Down Expand Up @@ -49,6 +50,7 @@ public class ActiveMaterialsController implements javafx.fxml.Initializable {
@FXML private TableColumn<ObjActiveMaterial, Double> PH;
@FXML private TableColumn<ObjActiveMaterial, Double> E;
@FXML private TableColumn<ObjActiveMaterial, String> EDITDATE;
@FXML private TableColumn<ObjActiveMaterial, String> Category;

@FXML private TableColumn<ObjActiveMaterial, Integer> RefIDn;
@FXML private TableColumn<ObjActiveMaterial, Integer> RefIDNumberH;
Expand All @@ -68,6 +70,7 @@ public class ActiveMaterialsController implements javafx.fxml.Initializable {
@FXML private TextFlow SaltC_TextFlow;
@FXML private TextFlow PH_TextFlow;
@FXML private TextFlow E_TextFlow;
@FXML private TextFlow Category_TextFlow;
@FXML private TextFlow EDITDATE_TextFlow;

@FXML private Button addActiveMaterial;
Expand All @@ -86,6 +89,8 @@ public void reloadDataActiveMaterials() {

try {
tblActiveMaterial.refresh();

Database.createConnection("activeMaterial");

ResultSet res = Database.selectData("activeMaterial");

Expand All @@ -107,6 +112,7 @@ public void reloadDataActiveMaterials() {
objActiveMaterial.SaltC.set(res.getDouble("SaltC"));
objActiveMaterial.PH.set(res.getDouble("PH"));
objActiveMaterial.E.set(res.getDouble("E"));
objActiveMaterial.Category.set(res.getString("Category"));
objActiveMaterial.RefIDn.set(res.getInt("RefIDn"));
objActiveMaterial.RefIDNumberH.set(res.getInt("RefIDNumberH"));
objActiveMaterial.RefIDCAM.set(res.getInt("RefIDCAM"));
Expand Down Expand Up @@ -134,6 +140,7 @@ public void reloadDataActiveMaterials() {
SaltC.setCellValueFactory(new PropertyValueFactory<ObjActiveMaterial, Double>("SaltC"));
PH.setCellValueFactory(new PropertyValueFactory<ObjActiveMaterial, Double>("PH"));
E.setCellValueFactory(new PropertyValueFactory<ObjActiveMaterial, Double>("E"));
Category.setCellValueFactory(new PropertyValueFactory<ObjActiveMaterial, String>("Category"));
EDITDATE.setCellValueFactory(new PropertyValueFactory<ObjActiveMaterial, String>("EDITDATE"));
RefIDn.setCellValueFactory(new PropertyValueFactory<ObjActiveMaterial, Integer>("RefIDn"));
RefIDNumberH.setCellValueFactory(new PropertyValueFactory<ObjActiveMaterial, Integer>("RefIDNumberH"));
Expand Down Expand Up @@ -200,10 +207,8 @@ private void addColumnNames() {
M1.setStyle("-fx-font-style: italic");
Text M2 = new Text(" / g mol");
M2.setStyle("-fx-font-weight: bold");
Text M3 = new Text("-1");
Text M3 = new Text("⁻¹");
M3.setStyle("-fx-font-weight: bold");
M3.setTranslateY(M1.getFont().getSize() * -0.3);
M3.setFont(Font.font(M2.getFont().getStyle(),M2.getFont().getSize()*0.75));

M_TextFlow.getChildren().addAll(M1,M2,M3);

Expand Down Expand Up @@ -239,10 +244,8 @@ private void addColumnNames() {
C_AM2.setFont(Font.font(C_AM1.getFont().getStyle(),C_AM1.getFont().getSize()*0.75));
Text C_AM3 = new Text(" / $ kg");
C_AM3.setStyle("-fx-font-weight: bold");
Text C_AM4 = new Text("-1");
Text C_AM4 = new Text("⁻¹");
C_AM4.setStyle("-fx-font-weight: bold");
C_AM4.setTranslateY(C_AM1.getFont().getSize() * -0.3);
C_AM4.setFont(Font.font(C_AM1.getFont().getStyle(),C_AM1.getFont().getSize()*0.75));

CAM_TextFlow.getChildren().addAll(C_AM1,C_AM2,C_AM3,C_AM4);

Expand All @@ -268,10 +271,8 @@ private void addColumnNames() {
SaltC2.setFont(Font.font(SaltC1.getFont().getStyle(),SaltC1.getFont().getSize()*0.75));
Text SaltC3 = new Text(" / mol L");
SaltC3.setStyle("-fx-font-weight: bold");
Text SaltC4 = new Text("-1");
Text SaltC4 = new Text("⁻¹");
SaltC4.setStyle("-fx-font-weight: bold");
SaltC4.setTranslateY(SaltC1.getFont().getSize() * -0.3);
SaltC4.setFont(Font.font(SaltC1.getFont().getStyle(),SaltC1.getFont().getSize()*0.75));

SaltC_TextFlow.getChildren().addAll(SaltC1,SaltC2,SaltC3,SaltC4);

Expand All @@ -285,11 +286,17 @@ private void addColumnNames() {
Text E1 = new Text("E");
E1.setStyle("-fx-font-weight: bold");
E1.setStyle("-fx-font-style: italic");
Text E2 = new Text(" vs NHE / V");
Text E2 = new Text(" vs NHE / V");
E2.setStyle("-fx-font-weight: bold");

E_TextFlow.getChildren().addAll(E1,E2);

//Category:
Text Category1 = new Text("Category");
Category1.setStyle("-fx-font-weight: bold");

Category_TextFlow.getChildren().addAll(Category1);

//EDITDATE:
Text EDITDATE1 = new Text("Date");
EDITDATE1.setStyle("-fx-font-weight: bold");
Expand All @@ -311,6 +318,7 @@ public void addActiveMaterial(ActionEvent event) {
stage.show();

stage.setTitle("ReFlowLab - Add Active materials");
stage.getIcons().add(new Image(getClass().getResourceAsStream("/de/dominikemmel/reflowlab/img/logo_simple/1x/logo_simple1x.png")));

stage.getScene().getStylesheets().add(getClass().getResource("/de/dominikemmel/reflowlab/style/reflowlabStyle1.css").toExternalForm());

Expand Down Expand Up @@ -364,6 +372,7 @@ public void editActiveMaterial(ActionEvent event) throws ClassNotFoundException,
stage.show();

stage.setTitle("ReFlowLab - Edit Active materials");
stage.getIcons().add(new Image(getClass().getResourceAsStream("/de/dominikemmel/reflowlab/img/logo_simple/1x/logo_simple1x.png")));

stage.getScene().getStylesheets().add(getClass().getResource("/de/dominikemmel/reflowlab/style/reflowlabStyle1.css").toExternalForm());

Expand Down
Loading

0 comments on commit 6c55edf

Please sign in to comment.