Skip to content

Commit

Permalink
- Implemented MTBF and MTTR calculations
Browse files Browse the repository at this point in the history
- Changed data purge to an hourly schedule
- Added two example work schedules
- Updated Hibernate to version 5.6.14.Final
- Updated PostgreSQL to 42.5.1
  • Loading branch information
point85 committed Dec 23, 2022
1 parent 731b260 commit ae39bb1
Show file tree
Hide file tree
Showing 26 changed files with 130 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The Java Persistence 2.2 API (JPA) as implemented by the Hibernate ORM framework
Hibernate and JPA abstract-away database specific aspects of inserting, updating, reading and deleting records in the tables. The API is designed to work with any relational database supported by Hibernate.

## What's New
Version 3.9.0 added persistency for a shift break. An older schema must be migrated to this version 5 (see the User Guide for details). A break is considered operator working time, and has an associated OEE time loss. Please see the Release Notes.txt file for release history.
Version 3.9.1 added Mean Time Between Failure (MTBF) and Mean Time To Repair (MTTR) calculations for equipment. Please see the Release Notes.txt file for release history.

## Getting Started
The desktop applications are packaged in the oee-<version>.zip file in the latest Git release link at https://github.com/point85/OEE-Designer/releases. Download the oee-<version>.zip file and expand the archive into a folder of your choice. Next, download the Point85 OEE Getting Started Guide and follow instructions in that document. Additional information may be found in the Point85 OEE User Guide.
Expand Down
7 changes: 7 additions & 0 deletions Release Notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,12 @@ Note that version 3.2.0 has the following schema changes:
- Updated ActiveMQ to 5.17.2
- Updated Kafka to 3.3.1
- Miscellaneous stability improvements

(39) 3.9.1, December 24, 2022:
- Implemented MTBF and MTTR calculations
- Changed data purge to an hourly schedule
- Added two example work schedules
- Updated Hibernate to version 5.6.14.Final
- Updated PostgreSQL to 42.5.1

Please send comments and suggestions to [email protected].
6 changes: 3 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<project name="oee-apps" default="build-distro" basedir="." >

<!-- distribution archive -->
<property name="app_version" value="3.9.0"/>
<property name="domain.jar" value="oee-domain-3.9.0.jar"/>
<property name="collector.jar" value="oee-collector-3.9.0.jar"/>
<property name="app_version" value="3.9.1"/>
<property name="domain.jar" value="oee-domain-3.9.1.jar"/>
<property name="collector.jar" value="oee-collector-3.9.1.jar"/>

<!-- folders -->
<property name="fxbuild.dir" value="fxbuild"/>
Expand Down
9 changes: 5 additions & 4 deletions config/logging/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<Configuration status="warn" name="Point85_Configuration" packages="">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
Expand Down Expand Up @@ -29,22 +30,22 @@
</Logger>

<!-- basic log level for all Hibernate messages
<Logger name="org.hibernate" level="info">
<Logger name="org.hibernate" level="warn">
</Logger>
-->

<!-- Hibernate runtime SQL statements and parameters
<Logger name="org.hibernate.SQL" level="info">
<Logger name="org.hibernate.SQL" level="warn">
</Logger>
-->

<!-- Hibernate JDBC bind parameter runtime arguments
<Logger name="org.hibernate.type" level="info">
<Logger name="org.hibernate.type" level="warn">
</Logger>
-->

<!-- Hikari database connection pool
<Logger name="com.zaxxer" level="info">
<Logger name="com.zaxxer" level="warn">
</Logger>
-->

Expand Down
Binary file modified docs/Point85 OEE Getting Started Guide.pdf
Binary file not shown.
Binary file modified docs/Point85 OEE Getting Started Guide.tmdx
Binary file not shown.
Binary file modified docs/Point85 OEE User Guide.pdf
Binary file not shown.
Binary file modified docs/Point85 OEE User Guide.tmdx
Binary file not shown.
Binary file modified docs/domain_docs.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

<groupId>org.point85</groupId>
<artifactId>oee-apps</artifactId>
<version>3.9.0</version>
<version>3.9.1</version>
<packaging>jar</packaging>

<name>Point85 OEE JavaFX Applications</name>
<url>https://github.com/point85</url>

<properties>
<domain.version>3.9.0</domain.version>
<domain.version>3.9.1</domain.version>
<maven.compiler.release>11</maven.compiler.release>
<javafx.version>17.0.2</javafx.version>
<javafx.maven.plugin.version>0.0.8</javafx.maven.plugin.version>
Expand Down Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-hikaricp</artifactId>
<version>5.3.20.Final</version>
<version>5.6.14.Final</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
Expand Down Expand Up @@ -149,7 +149,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.0</version>
<version>42.5.1</version>
</dependency>

<!-- HSQLDB DATABASE -->
Expand Down
2 changes: 1 addition & 1 deletion run-collector-app.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rem Launch the Collector application (args: JDBC connection string, user name, password and optional collector name)
start "" "%JAVA_HOME%\bin\javaw.exe" -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication COLLECTOR jdbc:hsqldb:hsql://localhost/OEE SA
start "" "%JAVA_HOME%\bin\javaw.exe" -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication COLLECTOR jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-collector-app.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Launch the Collector application (args: JDBC connection string, user name, password and optional collector name)
java -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication COLLECTOR jdbc:hsqldb:hsql://localhost/OEE SA
java -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication COLLECTOR jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-designer-app-debug.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rem Launch the Designer application (args: JDBC connection string, user name, password and optional collector name)
java.exe -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p %JAVAFX_HOME%\lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication DESIGNER jdbc:hsqldb:hsql://localhost/OEE SA
java.exe -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p %JAVAFX_HOME%\lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication DESIGNER jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-designer-app.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rem Launch the Designer application (args: JDBC connection string, user name, password and optional collector name)
start "" "%JAVA_HOME%\bin\javaw.exe" -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication DESIGNER jdbc:hsqldb:hsql://localhost/OEE SA
start "" "%JAVA_HOME%\bin\javaw.exe" -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication DESIGNER jdbc:hsqldb:hsql://localhost/OEE SA

2 changes: 1 addition & 1 deletion run-designer-app.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Launch the Designer application (args: JDBC connection string, user name, password and optional collector name)
java -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication DESIGNER jdbc:hsqldb:hsql://localhost/OEE SA
java -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication DESIGNER jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-monitor-app.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rem Launch the Monitor application (args: JDBC connection string, user name, password and optional collector name)
start "" "%JAVA_HOME%\bin\javaw.exe" -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication MONITOR jdbc:hsqldb:hsql://localhost/OEE SA
start "" "%JAVA_HOME%\bin\javaw.exe" -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication MONITOR jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-monitor-app.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Launch the Monitor application (args: JDBC connection string, user name, password and optional collector name)
java -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication MONITOR jdbc:hsqldb:hsql://localhost/OEE SA
java -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication MONITOR jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-operator-app.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rem Launch the Operator application (args: JDBC connection string, user name, password and optional collector name)
start "" "%JAVA_HOME%\bin\javaw.exe" -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml -jar oee-apps-3.9.0.jar OPERATOR jdbc:hsqldb:hsql://localhost/OEE SA
start "" "%JAVA_HOME%\bin\javaw.exe" -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml -jar oee-apps-3.9.1.jar OPERATOR jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-operator-app.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Launch the Operator application (args: JDBC connection string, user name, password and optional collector name)
java -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml -jar oee-apps-3.9.0.jar OPERATOR jdbc:hsqldb:hsql://localhost/OEE SA
java -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml -jar oee-apps-3.9.1.jar OPERATOR jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-tester-app.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rem Launch the Tester application (args: JDBC connection string, user name, password and optional collector name)
start "" "%JAVA_HOME%\bin\javaw.exe" -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication TESTER jdbc:hsqldb:hsql://localhost/OEE SA
start "" "%JAVA_HOME%\bin\javaw.exe" -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p "%JAVAFX_HOME%\lib" --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication TESTER jdbc:hsqldb:hsql://localhost/OEE SA
2 changes: 1 addition & 1 deletion run-tester-app.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Launch the Tester application (args: JDBC connection string, user name, password and optional collector name)
java -cp ./oee-apps-3.9.0.jar;lib/*;lib/ext/* -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication TESTER jdbc:hsqldb:hsql://localhost/OEE SA
java -cp ./oee-apps-3.9.1.jar;lib/*;lib/ext/* -p $JAVAFX_HOME/lib --add-modules javafx.controls,javafx.fxml,javafx.web -Dlog4j2.configurationFile=config/logging/log4j2.xml org.point85.app.OeeApplication TESTER jdbc:hsqldb:hsql://localhost/OEE SA
37 changes: 36 additions & 1 deletion src/main/java/org/point85/app/dashboard/DashboardController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,40 @@ private OffsetDateTime getEndTime() throws Exception {
return DomainUtils.fromLocalDateTime(ldtEnd);
}

private String buildMeanDisplayString(TimeLoss loss) {
String displayString = loss.toString();

// MTBF in hours
Duration mtbf = equipmentLoss.calculateMTBF();
String mtbfFormatted = null;

if (mtbf.compareTo(Duration.ZERO) > 0) {
double totalSeconds = mtbf.getSeconds();
mtbfFormatted = String.format("%.1f", (totalSeconds / 3600.0d));
}

if (mtbfFormatted != null) {
displayString += "\n" + DesignerLocalizer.instance().getLangString("mtbf.mean") + mtbfFormatted + " "
+ DesignerLocalizer.instance().getLangString("hr.mean");
}

// MTTR in minutes
Duration mttr = equipmentLoss.calculateMTTR();
String mttrFormatted = null;

if (mttr.compareTo(Duration.ZERO) > 0) {
double totalSeconds = mttr.getSeconds();
mttrFormatted = String.format("%.1f", (totalSeconds / 60.0d));
}

if (mttrFormatted != null) {
displayString += "\n" + DesignerLocalizer.instance().getLangString("mttr.mean") + mttrFormatted + " "
+ DesignerLocalizer.instance().getLangString("min.mean");
}

return displayString;
}

@FXML
public void onRefresh() {
try {
Expand Down Expand Up @@ -1522,7 +1556,8 @@ public int compare(OeeEvent record1, OeeEvent record2) {
// loss category
TimeLoss loss = reason.getLossCategory();
if (loss != null) {
tiAvailability.setDescription(loss.toString());
String display = this.buildMeanDisplayString(loss);
tiAvailability.setDescription(display);
tiAvailability.setDescriptionColor(Color.web(loss.getColor()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ private void createWorkSchedules() throws Exception {
scheduleList.add(create21TeamFixed());
scheduleList.add(createTwoTeam());
scheduleList.add(createPanama());
scheduleList.add(createPitman());
scheduleList.add(createMountainView());
}

private WorkSchedule createPanama() throws Exception {
Expand Down Expand Up @@ -705,4 +707,55 @@ private WorkSchedule createSeattleFire() throws Exception {

return schedule;
}

private WorkSchedule createPitman() throws Exception {
// Pitman police schedule
WorkSchedule schedule = new WorkSchedule("Pitman", "Police schedule. Two 12 hour shifts with four teams.");

// day shift, start at 07:00 for 12 hours
Shift dayShift = schedule.createShift("Day", "Day shift", LocalTime.of(7, 0, 0), Duration.ofHours(12));

// night shift, start at 19:00 for 12 hours
Shift nightShift = schedule.createShift("Night", "Night shift", LocalTime.of(19, 0, 0), Duration.ofHours(12));

// rotation [2 on 3 off][2 on 2 off][3 on 2 off]
Rotation dayRotation = schedule.createRotation("Day", "Day rotation");
dayRotation.addSegment(dayShift, 2, 3);
dayRotation.addSegment(dayShift, 2, 2);
dayRotation.addSegment(dayShift, 3, 2);

// night rotation [2 on 3 off][2 on 2 off][3 on 2 off]
Rotation nightRotation = schedule.createRotation("Night", "Night rotation");
nightRotation.addSegment(nightShift, 2, 3);
nightRotation.addSegment(nightShift, 2, 2);
nightRotation.addSegment(nightShift, 3, 2);

// 4 teams, 2 day, 2 night
schedule.createTeam("Team 1", "Squad 1", dayRotation, LocalDate.of(2022, 12, 7));
schedule.createTeam("Team 2", "Squad 1", dayRotation, LocalDate.of(2022, 11, 30));
schedule.createTeam("Team 3", "Squad 2", nightRotation, LocalDate.of(2022, 12, 7));
schedule.createTeam("Team 4", "Squad 2", nightRotation, LocalDate.of(2022, 11, 30));

return schedule;
}

private WorkSchedule createMountainView() throws Exception {
// Mountain View, CA fire schedule
WorkSchedule schedule = new WorkSchedule("Mountain View Fire",
"Fire department schedule. One 24 hour shift with three teams.");

// start at 08:00 for 24 hours
Shift shift = schedule.createShift("24 Hour", "24 hour shift", LocalTime.of(8, 0, 0), Duration.ofHours(24));

// rotation [2 on 4 off]
Rotation rotation = schedule.createRotation("ABC", "Shift rotation");
rotation.addSegment(shift, 2, 4);

// 4 teams, 2 day, 2 night
schedule.createTeam("A", "Green team", rotation, LocalDate.of(2022, 11, 1));
schedule.createTeam("B", "Blue team", rotation, LocalDate.of(2022, 11, 3));
schedule.createTeam("C", "Red team", rotation, LocalDate.of(2022, 11, 5));

return schedule;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ private void resetEditor() {
this.tfScheduleName.clear();
this.tfScheduleName.requestFocus();
this.taScheduleDescription.clear();
this.editedScheduleItems.clear();

// reset each sub-editor
onNewShift();
Expand All @@ -1012,6 +1013,7 @@ private void resetEditor() {
// clear the tables
this.shiftList.clear();
this.shiftNames.clear();
this.breakList.clear();
this.tvShifts.refresh();

this.teamList.clear();
Expand Down Expand Up @@ -1086,6 +1088,8 @@ private void onRefreshSchedule() {
if (getSelectedSchedule() == null) {
return;
}

removeEditedSchedule(selectedScheduleItem);

if (getSelectedSchedule().getKey() != null) {
// read from database
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fxml/TemplateScheduleDialog.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.point85.app.schedule.TemplateScheduleDialogController">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="850.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.point85.app.schedule.TemplateScheduleDialogController">
<children>
<HBox alignment="CENTER" layoutX="100.0" layoutY="737.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="50.0" spacing="25.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<children>
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/i18n/DesignerLang.properties
Original file line number Diff line number Diff line change
Expand Up @@ -551,3 +551,8 @@ breaks = Breaks
break.start = Start (HH:MM)
enter.break.start = Enter the break starting time.
enter.break.duration = Enter the break duration.
#means
hr.mean = hr
min.mean = min
mtbf.mean = MTBF:
mttr.mean = MTTR:

0 comments on commit ae39bb1

Please sign in to comment.