The PI-Adapter is used Commons Adapter Module to run Model with Adapter connected integrate with Delft-FEWS system.
The Delft-FEWS System run the workflow with model can be three parts:
- Pre Adapter: Convert Delft-FEWS export to the model input.
- Executable Adapter: Control the model executable process.
- Post Adapter: Convert model output to the Delft-FEWS import.
Three adapters through the Published Interface to synchronous communication with Delft-FEWS System.
The Commons Adapter Module's PiCommandLineExecute will receive the Delft-FEWS System pass information by standard arguments, so you can focus implements your adapter logic.
If you want see the fully integrate model example with PreAdapter, Executable Adapter and Post Adapter, please have a look at here.
The example implements code as blew:
public class ExamplePreAdapter extends PiCommandLineExecute {
// Main process
public static void main(String[] args) {
PiIOArguments arguments = PiIOArguments.instance();
new ExamplePreAdapter().execute( args, arguments );
}
@Override
protected void adapterRun( PiBasicArguments arguments,
PiDiagnosticsLogger logger,
Path basePath, Path inputPath, Path outputPath ) {
PiIOArguments modelArguments = this.asIOArguments( arguments );
// Your adapter logic
}
}When start adapter with extends PiCommandLineExecute, program will check the model folder structure is follow the Delft-FEWS standard, the standard is show as below:
- Work/: The model main work folder.
- Input/: The Delft-FEWS System exports place folder.
- Output/: The Delft-FEWS System imports place folder.
- Diagnostics/Diagnostics.xml: It's used to synchronous adaper logging message to Delft-FEWS System.
The arguments is extends from the BasicArguments:
PiBasicArguments: - Basic arguments to run the command-Line interface, Not included input and output files, if you need this, usePiIOArgumentsplease.
| Argument | Description | Default | Required |
|---|---|---|---|
| -b / --base | The current working directory. | - | true |
| -h / --help | Show how to usage. | - | false |
| -id / --idir | The input file folder, relative to the current working directory. | Input/ | false |
| -od / --odir | The output file folder, relative to the current working directory. | Output/ | false |
| -ld / --ldir | The Pi Diagnostics log folder, relative to the current working directory. | Diagnostics/ | false |
| -l / --log | The Pi Diagnostics log file name. | Diagnostics.xml | false |
| -t / --time | The T0. TimeZone is UTC. | - | false |
PiIOArguments: Standard arguments use for the included input, output files, parameter and unit to run the command-Line interface.
| Argument | Description | Default | Required |
|---|---|---|---|
| -i / --input | The input file list with comma, and order is fixed. | - | true |
| -o / --output | The output file list with comma, and order is fixed. | - | true |
| -p / --parameter | The parameter name of model output, use only when program need it. | - | false |
| -u / --unit | The unit name of model output, use only when program need it. | - | false |
| Model | URL | Provider | Type | Adapter |
|---|---|---|---|---|
| FondUS Commons adapter tools | link | FondUS | - | link |
| FondUS NetCDF adapter tools | link | FondUS | - | link |
| FondUS Rainfall adapter tools | link | FondUS | - | link |
| FondUS Stress test tools | link | FondUS | - | link |
| FondUS Workflow State | link | FondUS | - | link |
| FondUS NetCDF Feature Threshold Correct | link | FondUS | - | link |
| USGS TRGIRS landslide Model | link | NCDR | 2D | link |
| NCHC Rainfall Runoff Models | link | NCHC | 1D | link |
| NCHC LongTimeFlow Model | link | NCHC | 1D | link |
| NCHC Grid Merged Model | link | NCHC | - | link |
| NCHC RTC-2D Model | link | NCHC | 2D | link |
| NCHC Irrigation Optimize Model | link | NCHC | 1D | link |
| NTU 2D FIM Model | link | NTU | 2D | link |
| NTU QPF-RIF Model | link | NTU | 2D | link |
| NUU Dr. Wu Visual IoT Model | link | NUU | 1D | link |
| SensLink 2.0 & 3.0 Import/Export | link | AnaSystem | - | link |
| S3 Import/Export | link | Amazon | - | link |
| NCTU DPWE AI Model Import | link | NCTU | - | link |
| WRAP Flood Potential Map Search | link | WRAP | 2D | link |
| WFLOW | link | FondUS | 2D | link |
- Commons-CLI: The standard commons interface of FondUS to write command-line program.
- Commons-FEWS-XML: The tools of FondUS to communication with Delft-FEWS System parts
Published InterfaceXML. - Delft-FEWS library: You still need provide the Delft-FEWS library youself.
The PI-Adapter are developed by the FondUS Technology Co., Ltd. and are maintained by @Vipcube.
