Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Command Sequence Repeating Write_Conversion #1064
Describe the bug
What you would expect: Next time you open up the saved sequence in Command Sequence, you see the value of 1 in your saved sequence. When you execute the command sequence, it will send the value as 2 (because 2x1 = 2).
What is actually happening: When you open up the saved sequence in Command Sequence, you see that the actual value is 2 (because it already did the conversion 2x1 = 2). So when you execute the command sequence, it does the conversion again and sends the value as 4 (because 2x2 = 4).
Additional problem: If you accidentally save the command sequence again with the incorrect VALUE3 = 2, then next time you open up the saved command sequence, VALUE3 will now be 4 (because 2x2 = 4) and if you execute the command sequence, it will send VALUE3 as 8 (because 2x4 = 8). So this means that this problem stacks if you accidentally re-save the command sequence.
**NOTE: It only seems to do this premature conversion when you open a saved command sequence, but COSMOS does not do this premature conversion when you use Command Sender (so this problem only affects the Command Sequence tool).
Environment (please complete the following information):
Hi Jason, yes you are correct and it is happening when CmdSequence loads the saved sequence. When you first open CmdSequence, it will do the conversion on the values/parameters with WRITE_CONVERSION and then do the conversion again when you execute the Command Sequence. It's incredibly problematic because I cannot run the Command Sequence without first fixing the converted values, which means that I cannot automate running Command Sequence. If you have any further questions for me, please feel free to post a comment as I will eagerly await a fix for this problem and I would appreciate notice about the fix as it comes out. Thanks.
Please note that this problem also occurs if you try to create a new command sequence and load in a command, it will also prematurely do the conversion. So it DOES NOT ONLY AFFECT SAVED COMMAND SEQUENCES, it affects any command that is loaded into the CmdSequence tool.
It's weird that it only occurs in the CmdSequence tool, but not in the CmdSender tool.
@WalterWhite1958 I have pushed a PR which is linked above. Please try it out and see if it fixes your issue. To apply this individual fix to your COSMOS installation simply copy the changed files into your local lib directory with the same paths. So you'll have <COSMOS Root Config>/lib/cosmos/tools/cmd_sequence/cmd_sequence.rb plus the other two.
@jasonatball Thank you for the updates, however there is still a problem. The fix that you gave me did eliminate the erroneous premature conversion whenever you load an EXISTING saved command sequence. However, the problem remains for creating a NEW command sequence. Whenever you try to add a new command that contains a WRITE_CONVERSION, it will still prematurely do the conversion.
Here's an example:
These new lines are:
In INST TESTCOMMAND, the default for CHECKTHIS2, is supposed to be 2, not 4 as displayed in the CmdSequence tool. So obviously, the default value for any newly added commands into the CmdSequence tool is still prematurely being converted. This was not noticed before in some of your Demo parameters because the default is typically 0 (therefore 0 * 2 = 0 and you don't notice any premature conversion).
Please note that CmdSender still loads new commands correctly (there is no premature conversion). I am only pointing to this out because I want to make sure that any fix for CmdSequence does not adversely affect the CmdSender tool.