|
23 | 23 |
|
24 | 24 | import java.beans.PropertyChangeEvent;
|
25 | 25 | import java.beans.PropertyChangeListener;
|
| 26 | +import java.io.IOException; |
| 27 | +import java.nio.file.Files; |
| 28 | +import java.nio.file.Paths; |
| 29 | +import java.util.logging.LogManager; |
26 | 30 |
|
27 | 31 | import org.applied_geodesy.adjustment.EstimationStateType;
|
28 | 32 | import org.applied_geodesy.adjustment.network.NetworkAdjustment;
|
@@ -93,4 +97,40 @@ private void destroyNetworkAdjustment(NetworkAdjustment adjustment) {
|
93 | 97 | adjustment = null;
|
94 | 98 | }
|
95 | 99 | }
|
| 100 | + |
| 101 | + public static void main(String[] args) { |
| 102 | + try { |
| 103 | + System.setProperty("com.github.fommil.netlib.BLAS", "com.github.fommil.netlib.F2jBLAS"); |
| 104 | + System.setProperty("com.github.fommil.netlib.LAPACK", "com.github.fommil.netlib.F2jLAPACK"); |
| 105 | + System.setProperty("com.github.fommil.netlib.ARPACK", "com.github.fommil.netlib.F2jARPACK"); |
| 106 | + |
| 107 | + System.setProperty("hsqldb.reconfig_logging", "false"); |
| 108 | + |
| 109 | + LogManager.getLogManager().reset(); |
| 110 | + } |
| 111 | + catch (Exception e) { |
| 112 | + e.printStackTrace(); |
| 113 | + } |
| 114 | + |
| 115 | + int status = -1; |
| 116 | + |
| 117 | + if (args.length == 0) |
| 118 | + throw new IllegalArgumentException("Error, no database specified!"); |
| 119 | + |
| 120 | + String dataBaseName = args[0]; |
| 121 | + boolean displayState = args.length > 1 && args[1].equalsIgnoreCase("TRUE") ? Boolean.TRUE : Boolean.FALSE; |
| 122 | + try { |
| 123 | + if (!Files.isRegularFile(Paths.get(dataBaseName + ".script")) || |
| 124 | + !Files.isRegularFile(Paths.get(dataBaseName + ".properties")) || |
| 125 | + !Files.isRegularFile(Paths.get(dataBaseName + ".data"))) |
| 126 | + throw new IOException("Error, related database files (e.g. script, properties or data) not found! " + dataBaseName); |
| 127 | + |
| 128 | + OpenAdjustmentCMD openAdjustment = new OpenAdjustmentCMD(dataBaseName, displayState); |
| 129 | + status = openAdjustment.process(); |
| 130 | + } |
| 131 | + catch (Exception e) { |
| 132 | + e.printStackTrace(); |
| 133 | + } |
| 134 | + System.exit(status); |
| 135 | + } |
96 | 136 | }
|
0 commit comments