Skip to content

Commit 7767de1

Browse files
authored
first implementation of reporting of process (#986)
* first implementation of reporting of process * added json reporting * fixed bug in stream * update pom * update doc * fix bug * update * update * update
1 parent bd3e118 commit 7767de1

File tree

22 files changed

+301
-9
lines changed

22 files changed

+301
-9
lines changed

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
<groupId>com.google.code.gson</groupId>
104104
<artifactId>gson</artifactId>
105105
<version>2.10.1</version>
106-
<scope>test</scope>
107106
</dependency>
108107
</dependencies>
109108
<build>

pomJava21.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
<groupId>com.google.code.gson</groupId>
104104
<artifactId>gson</artifactId>
105105
<version>2.10.1</version>
106-
<scope>test</scope>
107106
</dependency>
108107
</dependencies>
109108
<build>

pomJava8.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
<groupId>com.google.code.gson</groupId>
104104
<artifactId>gson</artifactId>
105105
<version>2.10.1</version>
106-
<scope>test</scope>
107106
</dependency>
108107
</dependencies>
109108
<build>

src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentBaseClass.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,10 @@ public boolean equals(Object obj) {
286286
&& Arrays.deepEquals(report, other.report)
287287
&& Objects.equals(specification, other.specification);
288288
}
289+
290+
/** {@inheritDoc} */
291+
@Override
292+
public String toJson() {
293+
return null;
294+
}
289295
}

src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,13 @@ public default SystemInterface getFluid() {
213213
/** {@inheritDoc} */
214214
@Override
215215
public int hashCode();
216+
217+
/**
218+
* <p>
219+
* toJson.
220+
* </p>
221+
*
222+
* @return a String
223+
*/
224+
public String toJson();
216225
}

src/main/java/neqsim/processSimulation/processEquipment/TwoPortEquipment.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,10 @@ public void setOutletStream(StreamInterface stream) {
106106
public void setOutletTemperature(double temperature) {
107107
this.outStream.setTemperature(temperature, "unit");
108108
}
109+
110+
/** {@inheritDoc} */
111+
@Override
112+
public String toJson() {
113+
return null;
114+
}
109115
}

src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
import javax.swing.JTable;
1313
import org.apache.logging.log4j.LogManager;
1414
import org.apache.logging.log4j.Logger;
15+
import com.google.gson.GsonBuilder;
1516
import neqsim.processSimulation.mechanicalDesign.compressor.CompressorMechanicalDesign;
1617
import neqsim.processSimulation.processEquipment.TwoPortEquipment;
1718
import neqsim.processSimulation.processEquipment.stream.StreamInterface;
19+
import neqsim.processSimulation.util.monitor.CompressorResponse;
1820
import neqsim.thermo.ThermodynamicConstantsInterface;
1921
import neqsim.thermo.system.SystemInterface;
2022
import neqsim.thermodynamicOperations.ThermodynamicOperations;
@@ -1422,4 +1424,9 @@ public void setCompressionRatio(double compRatio) {
14221424
public double getCompressionRatio() {
14231425
return compressionRatio;
14241426
}
1427+
1428+
@Override
1429+
public String toJson() {
1430+
return new GsonBuilder().create().toJson(new CompressorResponse(this));
1431+
}
14251432
}

src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/Cooler.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package neqsim.processSimulation.processEquipment.heatExchanger;
22

33
import java.util.UUID;
4-
4+
import com.google.gson.GsonBuilder;
55
import neqsim.processSimulation.processEquipment.stream.StreamInterface;
6+
import neqsim.processSimulation.util.monitor.HeaterResponse;
67

78
/**
89
* <p>
@@ -76,4 +77,10 @@ public double getEntropyProduction(String unit) {
7677

7778
return entrop;
7879
}
80+
81+
/** {@inheritDoc} */
82+
@Override
83+
public String toJson() {
84+
return new GsonBuilder().create().toJson(new HeaterResponse(this));
85+
}
7986
}

src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/Heater.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
package neqsim.processSimulation.processEquipment.heatExchanger;
88

99
import java.util.UUID;
10+
import com.google.gson.GsonBuilder;
1011
import neqsim.processSimulation.processEquipment.TwoPortEquipment;
1112
import neqsim.processSimulation.processEquipment.stream.Stream;
1213
import neqsim.processSimulation.processEquipment.stream.StreamInterface;
14+
import neqsim.processSimulation.util.monitor.HeaterResponse;
1315
import neqsim.thermo.system.SystemInterface;
1416
import neqsim.thermodynamicOperations.ThermodynamicOperations;
1517

@@ -369,4 +371,10 @@ public double getExergyChange(String unit, double surroundingTemperature) {
369371
return outStream.getThermoSystem().getExergy(surroundingTemperature, unit)
370372
- inStream.getThermoSystem().getExergy(surroundingTemperature, unit);
371373
}
374+
375+
/** {@inheritDoc} */
376+
@Override
377+
public String toJson() {
378+
return new GsonBuilder().create().toJson(new HeaterResponse(this));
379+
}
372380
}

src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.util.UUID;
1212
import org.apache.logging.log4j.LogManager;
1313
import org.apache.logging.log4j.Logger;
14+
import com.google.gson.GsonBuilder;
1415
import neqsim.processSimulation.mechanicalDesign.separator.SeparatorMechanicalDesign;
1516
import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
1617
import neqsim.processSimulation.processEquipment.mixer.Mixer;
@@ -21,6 +22,7 @@
2122
import neqsim.processSimulation.processEquipment.separator.sectionType.ValveSection;
2223
import neqsim.processSimulation.processEquipment.stream.Stream;
2324
import neqsim.processSimulation.processEquipment.stream.StreamInterface;
25+
import neqsim.processSimulation.util.monitor.SeparatorResponse;
2426
import neqsim.thermo.system.SystemInterface;
2527
import neqsim.thermodynamicOperations.ThermodynamicOperations;
2628

@@ -871,6 +873,12 @@ public boolean equals(Object obj) {
871873
&& Objects.equals(waterSystem, other.waterSystem);
872874
}
873875

876+
/** {@inheritDoc} */
877+
@Override
878+
public String toJson() {
879+
return new GsonBuilder().create().toJson(new SeparatorResponse(this));
880+
}
881+
874882
/*
875883
* private class SeparatorReport extends Object{ public Double gasLoadFactor; SeparatorReport(){
876884
* gasLoadFactor = getGasLoadFactor(); } }

0 commit comments

Comments
 (0)