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

Comments

Projects
None yet
4 participants
@jmthomas
Member

jmthomas commented Feb 27, 2017

No description provided.

@jmthomas jmthomas changed the title from tolerance scripting calls should suport array telemetry items to tolerance scripting calls should support array telemetry items Feb 27, 2017

@jmthomas

This comment has been minimized.

Show comment
Hide comment
@jmthomas

jmthomas Feb 27, 2017

Member

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)
Member

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

This comment has been minimized.

Show comment
Hide comment
@donaldatball

donaldatball Jun 1, 2017

Collaborator

@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?

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@donaldatball

donaldatball Jun 1, 2017

Collaborator

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]

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@jasonatball

jasonatball Jun 1, 2017

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@donaldatball

donaldatball Jun 8, 2017

Collaborator

Closed with 508e3cb

Collaborator

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