Closed redrn closed 10 months ago
Specific CLI subcommand interface:
stepcvt choices add-chooser [--type TYPE] TEXT VARNAME (TEXT:VARNAME[:COND])+
{single, multi, boolean}
default is a SingleChoosertext
and varname
of the ChooserTEXT:VARNAME[:COND]
text:varname:condition
are fields of ChoiceValue separated by :
, condition
is optionalstepcvt choices add-effect --partid PARTID --type TYPE --value VALUE --cond COND
{select, relative-count, absolute-count}
count_delta
for relative-count
choice effect. Not required for select
choice effect since that type only relies on conditionstepcvt choices edit VARNAME [--choice-value TEXT] (TEXT:VARNAME[:COND])+
varname
of the Chooser to editvalue
of the ChoiceValue in the specified Chooser to replace
--choice-value
is not set, replace the entire ChoiceValue array in the specified ChooserTEXT:VARNAME[:COND]
stepcvt choices remove VARNAME [--choice-value TEXT] [--cond]
varname
of the chooser to removetext
of a ChoiceValue to remove the ChoiceValue instead of the chooser--cond
to indicate removing the condition of the ChoiceValue.stepcvt choices apply (VARNAME=VALUE(,EXTRA_VALUES)*)+
varname=value(,extra_values)*
varname
specifies the name of the chooservalue(,extra_values)
is the value the user provided for the given chooser. This could be a comma separated list.stepcvt -j file.json choices add-chooser --choice-type single "Printer Options" "options" "HEPA filter":"Filter" "Build area lights":"Lights":"version=='V6'"
Add a SingleChooser with potential values of 'Filter' and 'Lights' that requires 'version == V6'.
stepcvt -j file.json choices add-effect --partid SB_V6_TH_Front --type relative-count --value 2 --cond version=='V6'
Add a relative count choice effect for the part SB_V6_TH_Front
, dependent on choice variable version=='V6'
.
stepcvt -j file.json choices edit "options" --choice-value "Lights" "Build area lights":"Lights":"version=='V4'"
Change the 'Lights' choice value in the 'options' chooser to have a different version requirement.
stepcvt -j file.json choices remove "options" --choice-value "Lights" --cond
Remove the precondition requirement for the 'Lights' option.
stepcvt -j file.json choices apply Version=V6 Options=Lights,Filter
Apply user choices of version 'V6' and 'Lights' and 'Filter' options enabled
TODO: add support for ChoiceEffect classes
Roy, could you add examples for each of the command line options above. That may help clarify what the command is supposed to do, and how to use it.
Roy, could you add examples for each of the command line options above. That may help clarify what the command is supposed to do, and how to use it.
Updated the documentation to include examples, pulled from comments in the code.
TODO: change apply subcommand to prompt the user for selecting choices and then either 1) export all based on user chocices 2) apply choices calculation and strip all choices information for the new json config
Edit: Finished and merged in cli in commit d6b434d
All intended functionalities are completed and tested. We can work on simplifying the interface later. Closing as of now
Implement CLI subparser for choices module, functionalities include but not limited to: