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

Tlm screen api #652

Merged
19 commits merged into from
Nov 16, 2017
Merged

Tlm screen api #652

19 commits merged into from
Nov 16, 2017

Conversation

ghost
Copy link

@ghost ghost commented Nov 14, 2017

Create Api to get screen list and a specific screen definition

@ghost ghost requested review from donaldatball and a user November 14, 2017 21:07
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was awesome in the demo you gave. Have you thought about how this will work with DART?

@@ -42,4 +42,4 @@ BACKGROUND_TASK example_background_task.rb
STOPPED
BACKGROUND_TASK limits_groups.rb 5 # Initial delay to allow interfaces to connect

COLLECT_METADATA
#COLLECT_METADATA
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this got commented out?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every time I start CmdTlmServer it pops up and annoys me. I could be convinced to put it back as the default with a good argument.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only mention because #655 found a bug in the basic install because we we NOT using it. As long as it's part of the AHK test I'm ok leaving it out.

@@ -545,6 +485,91 @@ def self.load_configuration(name = nil)
return self.instance.load_configuration(name)
end

def reset_variables(filename = nil)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comment block on the method

config_file = DEFAULT_CONFIG_FILE,
production = false,
disconnect = false,
mode = :CMD_TLM_SERVER)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the comment block. I see create_message_log went away which apparently was never documented. Didn't we have some other ticket to remove that?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update comment blocks throughout. I'm not especially hard over on new simply methods but there are a bunch where you refactored things and now parameters don't match the method signature. I know, documentation ...


# Set Threads to kill CTS if they throw an exception
Thread.abort_on_exception = true

# Don't start the DRb service or the telemetry monitoring thread
# if we started the server in disconnect mode
@json_drb = nil
start(production) unless @disconnect
unless @disconnect
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still feels like this giant block of code should be a separate method to me. Not sure why you inlined it.

if @reload_callback
@reload_callback.call(false)
else
System.reset
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is System.reset only called if there is NOT a reload_callback? How are these two states used? Please document.

Qt.execute_in_main_thread(true) do
handle_string_output()
@output_sleeper.cancel
Qt::CoreApplication.processEvents()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did this ever work outside of a execute_in_main_thread?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it was only ever called from GUI context before these changes

@server_gui = server_gui
@interfaces_table = {}
@name = name
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Save the name! Much better than passing it around. 👍

@speed_select.connect(SIGNAL('currentIndexChanged(int)')) do
CmdTlmServer.replay_backend.set_playback_delay(@speed_select.itemData(@speed_select.currentIndex).value)
end
@speed_layout = Qt::FormLayout.new()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment applies throughout: do all these need to be instance variables? This one (for example) is only used here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In older versions of qtbindings they did need to be instance variables to prevent getting garbage collected. In newer versions it isn't necessary but doesn't hurt anything.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for my eyes!


# Set the replay delay
#
# @param delay [Float] delay between packets in seconds 0.0 to 1.0, nil = No Delay, -1.0 = REALTIME
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to document somewhere on the GUI that nil means No Delay and -1 means REALTIME. What's the difference between 0 delay and nil (No Delay)? Could nil be realtime and 0 be no delay? -1 for a value just isn't that intuitive.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the GUI it is a combobox, so doesn't really need to be documented there. It just needs to be documented with the new API methods. I agree the values aren't very intuitive and we could make realtime = nil and no delay = 0. It would just change the code a bit. I'll look into it.

@replay_flag = Qt::Label.new("Replay Mode")
@replay_flag.setStyleSheet("background:green;color:white;padding:5px;font-weight:bold;")
@top_layout.addWidget(@replay_flag)
@replay_flag.hide
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the way this Replay Mode notification in the GUI was done. 🥇

@ghost ghost mentioned this pull request Nov 15, 2017
@codecov-io
Copy link

codecov-io commented Nov 16, 2017

Codecov Report

Merging #652 into master will decrease coverage by 2%.
The diff coverage is 50.57%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #652      +/-   ##
=========================================
- Coverage   81.11%   79.1%   -2.01%     
=========================================
  Files         150     153       +3     
  Lines       13658   14298     +640     
=========================================
+ Hits        11079   11311     +232     
- Misses       2579    2987     +408
Impacted Files Coverage Δ
lib/cosmos/interfaces/protocols/fixed_protocol.rb 100% <ø> (ø) ⬆️
lib/cosmos/gui/qt.rb 35.29% <0%> (-0.08%) ⬇️
lib/cosmos/packets/structure.rb 81.53% <100%> (ø) ⬆️
lib/cosmos/packets/structure_item.rb 77.33% <19.04%> (-6.88%) ⬇️
lib/cosmos/tools/cmd_tlm_server/replay_backend.rb 22.16% <22.16%> (ø)
lib/cosmos/tools/tlm_viewer/tlm_viewer_config.rb 18.27% <36.36%> (ø)
lib/cosmos/tools/cmd_tlm_server/api.rb 95.09% <48.93%> (-4.69%) ⬇️
lib/cosmos/script/tools.rb 93.18% <50%> (-4.32%) ⬇️
lib/cosmos/script/cmd_tlm_server.rb 86.13% <50%> (-2.29%) ⬇️
lib/cosmos/script/replay.rb 56% <56%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30bd935...99a130f. Read the comment docs.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage decreased (-2.04%) to 79.082% when pulling 2f4bbd5 on tlm_screen_api into 30bd935 on master.

@coveralls
Copy link

coveralls commented Nov 16, 2017

Coverage Status

Coverage decreased (-2.04%) to 79.082% when pulling 99a130f on tlm_screen_api into 30bd935 on master.

@ghost ghost merged commit 96d74e9 into master Nov 16, 2017
@ghost ghost deleted the tlm_screen_api branch November 16, 2017 20:54
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants