id: satellites_telemetry_submit
label: Telemetry Submit
category: '[Satellites]/Data sinks'

parameters:
-   id: server
    label: Server
    dtype: enum
    default: '"SatNOGS"'
    options: ['"SatNOGS"', '"FUNcube"', '"PWSat"', '"BME"', '"HIT"', '"SIDS"']
    option_labels: [SatNOGS DB, AMSAT-UK Data Warehouse, PW-Sat2 Ground Station, BME Ground Station, Harbin Institute of Technology, Custom SIDS server]
-   id: url
    label: URL
    dtype: string
    hide: ${ 'all' if server != '"SIDS"' else 'none' }
-   id: norad
    label: NORAD ID
    dtype: int
    default: 0
    hide: ${ 'all' if server not in ['"SatNOGS"', '"BME"', '"SIDS"'] else 'none' }
-   id: port
    label: TCP server port
    dtype: int
    default: 0
    hide: ${ 'none' if server == '"HIT"' else 'all' }
-   id: options
    label: Command line options
    dtype: string
    default: '""'
    hide: part

inputs:
-   domain: message
    id: in

templates:
    imports: |-
        import satellites.components.datasinks
        import satellites.utils.config
    make: satellites.components.datasinks.telemetry_submit(${server}, norad=${norad}, port='${port}', url = ${url}, config=satellites.utils.config.open_config(), options=${options})

documentation: |-
    Sends telemetry frames to an online telemetry data base server

    This block uses the gr-satellites config file at ~/.gr_satellites/config.ini to set up the server configuration

    Input:
        PDUs with telemetry frames

    Parameters:
        Server: selects the server to submit telemetry to
        URL: url of the custom SIDS server (for Custom SIDS server)
        NORAD ID: NORAD ID of the satellite (for SatNOGS and BME)
        TCP server port: TCP port where the proxy is listening (for HIT)
        Command line options: options to pass down to the block, following the syntax of the gr_satellites command line tool

file_format: 1
