# auto-generated by grc.converter

id: satellites_space_packet_time_stamp_adder
label: Space Packet Time Stamp Adder
category: '[Satellites]/CCSDS'

parameters:
-   id: manual_automatic
    label: Manual or Automatic Time
    dtype: enum
    default: drop_down
    options: ['0', '1']
    option_labels: [Manual, Automatic]
-   id: time_format
    label: Time Format
    dtype: enum
    default: drop_down
    options: ['0', '1', '2', '3', '4']
    option_labels: [CUC, CDS, CCS, ASCII A, ASCII B]
-   id: id_time
    label: Time Format ID
    dtype: raw
-   id: pfield
    label: PField Presence
    dtype: enum
    default: drop_down
    options: ['1', '0']
    option_labels: ['Yes', 'No']
    hide: ${ ('all' if time_format > '2' else 'none') }
-   id: pfield_extension
    label: PField Extension
    dtype: enum
    default: drop_down
    options: ['1', '0']
    option_labels: ['Yes', 'No']
    hide: ${ ('none' if time_format == '0' and pfield == '1' else 'all') }
-   id: time_code_identification_cuc
    label: Time Code Identification
    dtype: enum
    default: drop_down
    options: ['1', '2']
    option_labels: [1958 January 1 epoch, Agency Defined epoch]
    hide: ${ ('none' if time_format == '0' else 'all') }
-   id: epoch_year_cuc
    label: Epoch Year
    dtype: raw
    default: '1'
    hide: ${ ('none' if time_format == '0' and time_code_identification_cuc == '2'
        else 'all') }
-   id: epoch_month_cuc
    label: Epoch Month
    dtype: raw
    default: '1'
    hide: ${ ('none' if time_format == '0' and time_code_identification_cuc == '2'
        else 'all') }
-   id: epoch_day_cuc
    label: Epoch Day
    dtype: raw
    default: '1'
    hide: ${ ('none' if time_format == '0' and time_code_identification_cuc == '2'
        else 'all') }
-   id: pfield_extension_extended
    label: PField Extension extended
    dtype: enum
    default: drop_down
    options: ['1', '0']
    option_labels: ['Yes', 'No']
    hide: ${ ('none' if time_format == '0' and pfield == '1' and pfield_extension
        == '1' else 'all') }
-   id: rsvd_cuc
    label: Reserved for Mission Definition
    dtype: raw
    default: '0'
    hide: ${ ('none' if time_format == '0' and pfield == '1' and pfield_extension
        == '1' else 'all') }
-   id: time_code_identification_cds
    label: Time Code Identification
    dtype: raw
    default: '4'
    hide: all
-   id: epoch_identification_cds
    label: Epoch Identification
    dtype: enum
    default: drop_down
    options: ['0', '1']
    option_labels: [1958 January 1 Epoch, Agency Defined Epoch]
    hide: ${ ('none' if time_format == '1' else 'all') }
-   id: epoch_year_cds
    label: Epoch Year
    dtype: raw
    default: '1'
    hide: ${ ('none' if time_format == '1' and epoch_identification_cds == '1' else
        'all') }
-   id: epoch_month_cds
    label: Epoch Month
    dtype: raw
    default: '1'
    hide: ${ ('none' if time_format == '1' and epoch_identification_cds == '1' else
        'all') }
-   id: epoch_day_cds
    label: Epoch Day
    dtype: raw
    default: '1'
    hide: ${ ('none' if time_format == '1' and epoch_identification_cds == '1' else
        'all') }
-   id: time_code_identification_ccs
    label: Time Code Identification
    dtype: raw
    default: '5'
    hide: all
-   id: year
    label: Year
    dtype: raw
    default: '0'
    hide: ${ ('none' if manual_automatic == '0' else 'all') }
-   id: month
    label: Month
    dtype: raw
    default: '0'
    hide: ${ ('none' if manual_automatic == '0' else 'all') }
-   id: day
    label: Day
    dtype: raw
    default: '0'
    hide: ${ ('none' if manual_automatic == '0' else 'all') }
-   id: hour
    label: Hour
    dtype: raw
    default: '0'
    hide: ${ ('none' if manual_automatic == '0' else 'all') }
-   id: minute
    label: Minute
    dtype: raw
    default: '0'
    hide: ${ ('none' if manual_automatic == '0' else 'all') }
-   id: second
    label: Second
    dtype: raw
    default: '0'
    hide: ${ ('none' if manual_automatic == '0' else 'all') }
-   id: microsecond
    label: Microsecond
    dtype: raw
    default: '0'
    hide: ${ ('none' if manual_automatic == '0' else 'all') }
-   id: picosecond
    label: Picosecond
    dtype: raw
    default: '0'
    hide: ${ ('none' if manual_automatic == '0' and time_format == '1' and length_of_submillisecond_cds()
        == '2' else 'all') }

inputs:
-   domain: message
    id: in

outputs:
-   domain: message
    id: out

templates:
    imports: import satellites.ccsds
    make: satellites.ccsds.space_packet_time_stamp_adder(${manual_automatic}, ${time_format},
        ${pfield}, ${pfield_extension}, ${time_code_identification_cuc}, ${epoch_year_cuc},
        ${epoch_month_cuc}, ${epoch_day_cuc}, ${pfield_extension_extended},  ${rsvd_cuc},
        ${time_code_identification_cds}, ${epoch_identification_cds}, ${epoch_year_cds},
        ${epoch_month_cds}, ${epoch_day_cds}, ${time_code_identification_ccs}, ${year},
        ${month}, ${day}, ${hour}, ${minute}, ${second}, ${microsecond}, ${picosecond},
        ${id_time})

file_format: 1
