Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tolerance scripting calls should support array telemetry items #401

Closed
jmthomas opened this issue Feb 27, 2017 · 5 comments
Closed

tolerance scripting calls should support array telemetry items #401

jmthomas opened this issue Feb 27, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@jmthomas
Copy link
Member

@jmthomas jmthomas commented Feb 27, 2017

No description provided.

@jmthomas jmthomas changed the title tolerance scripting calls should suport array telemetry items tolerance scripting calls should support array telemetry items Feb 27, 2017
@jmthomas
Copy link
Member Author

@jmthomas jmthomas commented Feb 27, 2017

Here's what Ryan Pacini came up with as a workaround:

def wait_check_tolerance_array(itm,arr,tol,timeout)
  arr.each.with_index do |val, i|
    wait_check_expression("tlm('#{itm}')[#{i}].to_f.between?(#{val-tol},#{val+tol})", timeout)
    puts tlm(itm)[i]
  end
end #wait_check_tolerance_array

# Example usage
cmd("MYTARGET MYFLOAT32_1D with VALUE [-1.234567,5.123,-5.123]")
wait_check_tolerance_array("MYTARGET MYFLOAT32_1D VALUE",[-1.234567,5.123,-5.123],0.001,10)
@donaldatball donaldatball self-assigned this Jun 1, 2017
@donaldatball
Copy link
Collaborator

@donaldatball donaldatball commented Jun 1, 2017

@jmthomas @ryanatball Can I get an opinion from you guys about this ticket?

Would you rather see:
CHECK: INST HEALTH_STATUS ARY[0] was within range (blah) with val blah
CHECK: INST HEALTH_STATUS ARY[1] was within range (blah) with val blah
...
CHECK: INST HEALTH_STATUS ARY[N] was within range (blah) with val blah

or
CHECK: INST HEALTH_STATUS ARY was within range [(blah), (blah), ... (blah)] with val [blah, blah,... blah]

First eats up multiple lines for a single check, but is more readable (IMO). Second is a single line, but that line will be harder to read. Neither will be particularly great for large arrays, but I think #1 is the better option. Thoughts?

@donaldatball
Copy link
Collaborator

@donaldatball donaldatball commented Jun 1, 2017

ALSO, FWIW, if you do a regular check with an array, it looks like this:

2017/06/01 15:50:40.779 (array_tolerance.rb:7): CHECK: INST HEALTH_STATUS ARY == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] success with value == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

@jasonatball
Copy link
Collaborator

@jasonatball jasonatball commented Jun 1, 2017

Currently with a check like so:
wait_check_tolerance("INST ADCS BIASX", 0, 0.1, 1)

you get this output:
CHECK: INST ADCS BIASX was within range -0.1 to 0.1 with value == 9.999999747378752e-06 after waiting 0.004001 seconds

That's already pretty long so I think you have to go with option #1.

@donaldatball
Copy link
Collaborator

@donaldatball donaldatball commented Jun 8, 2017

Closed with 508e3cb

@ryanatball ryanatball modified the milestone: v4.0.0 Aug 4, 2017
@ryanatball ryanatball added the feature label Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.