;
; MPF LANDER startup file for SPICE's Inspekt utility program.
; by Boris Semenov, NAIF/JPL, March 27, 1998.
;
;##################################################################
;
;  Load data and ancillary files.
;
load leapseconds LEAPSECONDS_FILE?;
load ek COMMAND_DICT_EK_FILE?;
load ek SEQUENCE_EK_FILE?;
;
set format tabular;
set page width 132;
;
;  Setups for command, status and dictionary tables. 
;
set default time format YYYY MON DD HR:MN:SC.###;
;
set column mpf_cmd.entry_id width 14;
set column mpf_cmd.command width 20;
set column mpf_cmd.parameter_name width 14;
set column mpf_cmd.parameter_index width 8;
set column mpf_cmd.value_flag width 8;
set column mpf_cmd.chr_value width 16;
set column mpf_cmd.dp_value width 8;
set column mpf_cmd.int_value width 8;
set column mpf_cmd.long_value width 22;
;
set column mpf_status.entry_id width 14;
set column mpf_status.subsystem width 20;
set column mpf_status.parameter_name width 14;
set column mpf_status.parameter_index width 8;
set column mpf_status.value_flag width 8;
set column mpf_status.chr_value width 16;
set column mpf_status.dp_value width 8;
set column mpf_status.int_value width 8;
set column mpf_status.long_value width 22;
;
set column mpf_note.entry_id width 14;
set column mpf_note.attribute_name width 14;
set column mpf_note.attribute_index width 8;
set column mpf_note.chr_value width 42;
set column mpf_note.long_value width 42;
;
;  Setups for command dictionary table.
;
set column mpf_commands.command width 20;
set column mpf_commands.parameter_name width 14;
set column mpf_commands.parameter_index width 8;
set column mpf_commands.parameter_type width 16;
set column mpf_commands.parameter_range width 20;
set column mpf_commands.description width 40;
;
;##################################################################
;
;  SET_WIDTH            sets given column width.
;
define set_width set column column_name? width width_?;
;
;##################################################################
;
;  cmd_table            contains name of the PEF data table.
;  DICTIONARY_TABLE     contains name of the command dictionary table.
;
define cmd_table mpf_cmd;
define act_table mpf_act;
define gev_table mpf_gev;
define status_table mpf_status;
define note_table mpf_note;
define dictionary_table mpf_commands;
;
;##################################################################
;
;  SHOW_COMMANDS_OVER_TIME   finds all commands in PEF table 
;                       within provided time borders and displays 
;                       them ordered by time.
;
define show_commands_over_time select entry_id, time, command from cmd_table where parameter_index eq 0 and time between START_TIME? and END_TIME? order by time;
define scot show_commands_over_time;
;
;##################################################################
;
;  SHOW_COMMANDS_FOR_SUBSYSTEM   find all command in PEF table for
;                       some subsystem defined in dictionary table
;                       and displays these commands in timely ordered. 
;
define show_commands_for_subsystem select a.entry_id, a.time, a.command from cmd_table a, dictionary_table b where a.parameter_index eq 0 and b.parameter_index eq 0 and a.command eq b.command and b.subsystem like SUBSYSTEM? order by a.time;
define scfs show_commands_for_subsystem;
;
;##################################################################
;
;  SHOW_COMMANDS         finds all appearences of the particuar 
;                       command in PEF table and displays them time 
;                       ordered
;
define show_commands select entry_id, time, command from cmd_table where parameter_index eq 0 and command like COMMAND_NAME? order by time;
define sc show_commands;
;
;##################################################################
;
;  SHOW_COMMANDS_WITH_DESC  finds all appearences of the particuar 
;                       command in PEF table and displays them time 
;                       ordered. Also provides command descriptions
;                       for each of them.
;
define show_commands_with_desc select a.entry_id, a.time, a.command, b.description from cmd_table a, dictionary_table b where a.parameter_index eq 0 and b.parameter_index eq 0 and a.command eq b.command and a.command like COMMAND_NAME? order by time;
define scwd show_commands_with_desc;
;
;##################################################################
;
;  SHOW_PARAMETER_VALUES displays index ordered values of all
;                       parameters for particular command record from 
;                       PEF table.
;
define show_parameter_values select time, command, parameter_name, chr_value from cmd_table where entry_id like ENTRY_ID? order by parameter_index;
define spv show_parameter_values;
;
;##################################################################
;
;  SHOW_PARAMETER_LONG_VALUES  displays index ordered short and long 
;                       values of all parameters for particular 
;                       command record from PEF table.
;
define show_parameter_long_values select time, command, parameter_name, chr_value, long_value from cmd_table where entry_id like ENTRY_ID? order by parameter_index;
define splv show_all_parameter_values;
;
;##################################################################
;
;  SHOW_PARAMETERS_WITH_DESC  displays index ordered values 
;                       of all parameters for particular command 
;                       record from PEF table. The parameter 
;                       descriptions from dictionary table displayed
;                       along with PEF data.
;
define show_parameters_with_desc select a.command, a.parameter_name, a.chr_value, b.description from cmd_table a, dictionary_table b where a.entry_id like ENTRY_ID? and a.command eq b.command and a.parameter_name eq b.parameter_name order by a.parameter_index;
define spwd show_parameters_with_desc;
;
;##################################################################
;
;  COMMAND_DESCRIPTION  displays command description from dictionary
;                       table.
;
define command_description select command, description from dictionary_table where command like COMMAND? and parameter_index eq 0;
define cd command_description;
;
;##################################################################
;
;  PARAMETERS_DESCRIPTION  displays parameter descriptions for
;                       particular command from dictionary table.
;
define parameters_description select command, parameter_name, description from dictionary_table where command like COMMAND? order by parameter_index; 
define pd parameters_description;
;
;##################################################################
;
;  SHOW_STATUS          displays status of the particular subsystem 
;                       through all time interval covered by PEF 
;                       based data tables.
;
define show_status select time, subsystem, parameter_name, chr_value from status_table where subsystem like SUBSYSTEM? order by subsystem, parameter_name, time;
define ss show_status;
;
;##################################################################
;
;  SHOW_STATUS_AT_TIME  displays status of the particular subsystem 
;                       through before given time.
;
define show_status_at_time select time, subsystem, parameter_name, chr_value from status_table where subsystem like SUBSYSTEM? and time le TIME? order by subsystem, parameter_name, time;
define ssat show_status_at_time;
;
;##################################################################
;
;  SHOW_NOTES           displays notes from the PEF file.
;
define show_notes select time, chr_value from note_table where attribute_name eq 'NOTE_TEXT' order by time;
define sn show_notes;
;
;##################################################################
;
;  SHOW_NOTES_OVER_TIME displays notes from the PEF file 
;                       within provided time borders and displays 
;                       them ordered by time.
;
define show_notes_over_time select time, chr_value from note_table where attribute_name eq 'NOTE_TEXT' and time between START_TIME? and END_TIME? order by time;
define snot show_notes_over_time;
;
;##################################################################
;
;  SHOW_ACTIVITIES      finds all appearences of the particuar 
;                       activity in PEF table and displays them time 
;                       ordered
;
define show_activities select entry_id, time, activity from act_table where attribute_index eq 0 and activity like ACTIVITY_NAME? order by time;
define sa show_activities;
;
;##################################################################
;
;  SHOW_ACTIVITIES_OVER_TIME   finds all activities in PEF table 
;                       within provided time borders and displays 
;                       them ordered by time.
;
define show_activities_over_time select entry_id, time, activity from act_table where attribute_index eq 0 and activity like ACTIVITY_NAME? and time between START_TIME? and END_TIME? order by time;
define saot show_activities_over_time;
;
;##################################################################
;
;  SHOW_ACTIVITY_ATTRIBUTE_VALUES displays index ordered values of all
;                       attributes for particular activity record from 
;                       PEF table.
;
define show_activity_attribute_values select time, activity, attribute_name, chr_value from act_table where entry_id like ENTRY_ID? order by attribute_index;
define saav show_activity_attribute_values;
;
;##################################################################
;
;  SHOW_GR_EVENTS      finds all appearences of the particuar 
;                       grount event in PEF table and displays them 
;                       time  ordered
;
define show_gr_events select entry_id, time, ground_event, attribute_name, chr_value from gev_table where ( attribute_name eq 'TYPE' or attribute_name eq 'ANT' or attribute_name eq 'ORBIT_NO' ) and ground_event like GROUND_EVENT_NAME? order by time, entry_id, attribute_index;
define sge show_gr_events;
;
;##################################################################
;
;  SHOW_GR_EVENTS_OVER_TIME   finds all ground events in PEF table 
;                       within provided time borders and displays 
;                       them ordered by time.
;
define show_gr_events_over_time select entry_id, time, ground_event, attribute_name, chr_value from gev_table where ( attribute_name eq 'TYPE' or attribute_name eq 'ANT' or attribute_name eq 'ORBIT_NO' ) and ground_event like GROUND_EVENT_NAME? and time between START_TIME? and END_TIME? order by time, entry_id, attribute_index;
define sgeot show_gr_events_over_time;
;
;##################################################################
;
;  SHOW_GR_EVENT_ATTRIBUTE_VALUES displays index ordered values of all
;                       attributes for particular gr_event record from 
;                       PEF table.
;
define show_gr_event_attribute_values select time, ground_event, attribute_name, chr_value from gev_table where entry_id like ENTRY_ID? order by attribute_index;
define sgeav show_gr_event_attribute_values;
;
;  Setups for activity and ground event data tables. 
;
set column mpf_act.entry_id width 14;
set column mpf_act.activity width 20;
set column mpf_act.attribute_name width 14;
set column mpf_act.attribute_index width 8;
set column mpf_act.value_flag width 8;
set column mpf_act.chr_value width 16;
set column mpf_act.dp_value width 8;
set column mpf_act.int_value width 8;
set column mpf_act.long_value width 22;
;
set column mpf_gev.entry_id width 14;
set column mpf_gev.ground_event width 20;
set column mpf_gev.attribute_name width 14;
set column mpf_gev.attribute_index width 8;
set column mpf_gev.value_flag width 8;
set column mpf_gev.chr_value width 16;
set column mpf_gev.dp_value width 8;
set column mpf_gev.int_value width 8;
set column mpf_gev.long_value width 22;
;
         
         
    

