Skip to content

JackChao1111/PI-Adapter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PI-Adapter

License

The PI-Adapter is used Commons Adapter Module to run Model with Adapter connected integrate with Delft-FEWS system.

How to work with PI-Adapter integrate to Delft-FEWS

Flow charts

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.

Commons Adapter Module

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
    }
}

The Model Folder Structure:

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 Standard Arguments:

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, use PiIOArguments please.
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

Which Models implements with PI-Adapter now

Model URL Provider Type Adapter
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
SensLink 2.0 & 3.0 Import/Export link AnaSystem - link
NCTU DPWE AI Model Import link NCTU - link
WRAP Flood Search with GDAL link WRAP 2D link

Dependencies

  • 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 Interface XML.
  • Delft-FEWS library: You still need provide the Delft-FEWS library youself.

Authors and Contributors

The PI-Adapter are developed by the FondUS Technology Co., Ltd. and are maintained by @Vipcube.

About

The Model Adapter connected to Delft-FEWS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%