Skip to content

Commit

Permalink
Remove debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Oct 21, 2023
1 parent 71c495a commit 47f737a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions openc3/lib/openc3/script/api_shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ def wait(*args, type: :CONVERTED, quiet: false, scope: $openc3_scope, token: $op
start_time = Time.now.sys
openc3_script_sleep()
time_diff = Time.now.sys - start_time
Logger.info("WAIT: Indefinite for actual time of #{round(time_diff, 3)} seconds") unless quiet
Logger.info("WAIT: Indefinite for actual time of #{time_diff} seconds") unless quiet

# wait(5) # absolute wait time
when 1
if args[0].kind_of? Numeric
start_time = Time.now.sys
openc3_script_sleep(args[0])
time_diff = Time.now.sys - start_time
Logger.info("WAIT: #{args[0]} seconds with actual time of #{round(time_diff, 3)} seconds") unless quiet
Logger.info("WAIT: #{args[0]} seconds with actual time of #{time_diff} seconds") unless quiet
else
raise "Non-numeric wait time specified"
end
Expand Down Expand Up @@ -245,7 +245,7 @@ def wait_tolerance(*args, type: :CONVERTED, quiet: false, scope: $openc3_scope,
value.size.times do |i|
range = (expected_value[i] - tolerance[i]..expected_value[i] + tolerance[i])
wait_str = "WAIT: #{_upcase(target_name, packet_name, item_name)}[#{i}]"
range_str = "range #{range.first} to #{range.last} with value == #{value[i]} after waiting #{round(time, 3)} seconds"
range_str = "range #{range.first} to #{range.last} with value == #{value[i]} after waiting #{time} seconds"
if range.include?(value[i])
message << "#{wait_str} was within #{range_str}\n"
else
Expand All @@ -263,7 +263,7 @@ def wait_tolerance(*args, type: :CONVERTED, quiet: false, scope: $openc3_scope,
time = Time.now.sys - start_time
range = (expected_value - tolerance)..(expected_value + tolerance)
wait_str = "WAIT: #{_upcase(target_name, packet_name, item_name)}"
range_str = "range #{range.first} to #{range.last} with value == #{value} after waiting #{round(time, 3)} seconds"
range_str = "range #{range.first} to #{range.last} with value == #{value} after waiting #{time} seconds"
if success
Logger.info "#{wait_str} was within #{range_str}" unless quiet
else
Expand Down Expand Up @@ -753,7 +753,6 @@ def _openc3_script_wait_implementation(target_name, packet_name, item_name, valu
end
else
begin
puts "value:#{value} eval:#{exp_to_eval}"
if eval(exp_to_eval)
return true, value
end
Expand Down

0 comments on commit 47f737a

Please sign in to comment.