Skip to content

Commit

Permalink
BICAS: Use new abbrev. "BFMID"
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikPGJ committed Jul 24, 2024
1 parent 6ca2649 commit 6336395
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions mission/solar_orbiter/bicas/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ BFM
BICAS Functionality Mode. One of the basic modes of BICAS operations:
Print version, print identifiction, print version, print help, or process
datasets. Exactly one of these must apply every time BICAS is run.
BFMID
String constant which uniquely represents a particular BFM.
BIAS specification
Document RPW-SYS-MEB-BIA-SPC-00001-IRF, "RPW Instrument -- BIAS
Specification".
Expand Down
16 changes: 8 additions & 8 deletions mission/solar_orbiter/bicas/src/+bicas/interpret_CLI_args.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
% ============
% CliData
% Struct with fields:
% .bfm : String constant
% .bfmid : String constant
% .swmArg : String constant
% .icdLogFile : Empty if argument not given.
% .matlabLogFile : Empty if argument not given.
Expand Down Expand Up @@ -122,22 +122,22 @@

% Convert presence of BFM flag (mutually exclusive) into the correct constant.
% {i, 1} = false/true
% {i, 2} = BFM string constant
LogicalBfmTable = {
% {i, 2} = BFMID
LogicalBfmidTable = {
~isempty(CovcMap('VERSION_OPTION_ID')), 'VERSION_BFM'; ...
~isempty(CovcMap('IDENTIFICATION_OPTION_ID')), 'IDENTIFICATION_BFM'; ...
~isempty(CovcMap('SWD_OPTION_ID')), 'SWD_BFM'; ...
~isempty(CovcMap('HELP_OPTION_ID')), 'HELP_BFM'; ...
~isempty(CovcMap('SWM_OPTION_ID')), 'SWM_BFM'};
assert(...
sum([LogicalBfmTable{:,1}]) == 1, ...
sum([LogicalBfmidTable{:,1}]) == 1, ...
'BICAS:interpret_CLI_syntax:CLISyntax', ...
'Illegal combination of arguments.')
CliData.bfm = LogicalBfmTable{[LogicalBfmTable{:, 1}], 2};
CliData.bfmid = LogicalBfmidTable{[LogicalBfmidTable{:, 1}], 2};

SipCovpArray = CovcMap('SIP_OPTION_ID');

switch CliData.bfm
switch CliData.bfmid

case {'VERSION_BFM', 'IDENTIFICATION_BFM', 'SWD_BFM', 'HELP_BFM'}

Expand Down Expand Up @@ -170,7 +170,7 @@
CliData.SipMap = convert_SIP_COPVs_to_Map(SipCovpArray);

otherwise
error('BICAS:Assertion', 'Illegal CliData.bfm value.')
error('BICAS:Assertion', 'Illegal CliData.bfmid value.')
end


Expand All @@ -193,7 +193,7 @@


irf.assert.struct(CliData, ...
{'bfm', 'swmArg', 'icdLogFile', 'matlabLogFile', ...
{'bfmid', 'swmArg', 'icdLogFile', 'matlabLogFile', ...
'configFile', 'SipMap', ...
'ModifiedSettingsMap'}, {})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function test0(testCase)
% the order of key-vapue pairs in containers.Map.
%
function test(testCase, ...
cliArgCa, bfm, swmArg, configFile, ...
cliArgCa, bfmid, swmArg, configFile, ...
icdLogFile, matlabLogFile, ...
ModifiedSettingsMap, SipMap)

Expand All @@ -150,7 +150,7 @@ function test(testCase, ...
assert(numel(SipMap) == 2)

ExpCliData = struct(...
'bfm', bfm, ...
'bfmid', bfmid, ...
'swmArg', swmArg, ...
'configFile', configFile, ...
'icdLogFile', icdLogFile, ...
Expand Down
4 changes: 2 additions & 2 deletions mission/solar_orbiter/bicas/src/+bicas/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ function main_without_error_handling(cliArgumentsCa, L)



switch(CliData.bfm)
switch(CliData.bfmid)
case 'VERSION_BFM'
print_version(Swml, Bso)

Expand Down Expand Up @@ -562,7 +562,7 @@ function main_without_error_handling(cliArgumentsCa, L)

otherwise
error('BICAS:Assertion', ...
'Illegal value bfm="%s"', bfm)
'Illegal value bfmid="%s"', bfmid)
end % if ... else ... / switch


Expand Down

0 comments on commit 6336395

Please sign in to comment.