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

Map tgts to interfaces in Replay when loading config #910

Merged
3 commits merged into from
Mar 19, 2019

Conversation

ghost
Copy link

@ghost ghost commented Oct 26, 2018

closes #909

@ghost ghost self-requested a review October 26, 2018 21:06
@ghost
Copy link
Author

ghost commented Oct 26, 2018

@ryanatball While this fixed the problem please ensure I'm doing things in the correct order / file as the system starts.

# Map any targets without interfaces to the dummy replay interface.
# Targets will only have an interface already mapped if the replay_routers
# flag was passed to the server.
def map_targets_to_interfaces
Copy link

Choose a reason for hiding this comment

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

This method should be named differently to show it is only replay mode. Also, an attempt needs to be made to remap targets to interfaces using Interface#target_names. Only after that fails should the target get mapped to @replay_interface.

Overall really nice clean fix for this though.

Copy link
Author

Choose a reason for hiding this comment

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

@ryanatball I tried to address this but never saw any existing interfaces being mapped. Not sure if this is what you wanted.

if @interfaces
@interfaces.all.each do |name, interface|
interface.target_names.each do |target|
System.targets[target] = interface
Copy link

Choose a reason for hiding this comment

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

This is overwriting the target with an interface. It should set the target's interface.

@codecov-io
Copy link

Codecov Report

Merging #910 into master will increase coverage by 0.11%.
The diff coverage is 23.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #910      +/-   ##
==========================================
+ Coverage   74.29%   74.41%   +0.11%     
==========================================
  Files         244      244              
  Lines       18954    19218     +264     
==========================================
+ Hits        14082    14301     +219     
- Misses       4872     4917      +45
Impacted Files Coverage Δ
lib/cosmos/tools/cmd_tlm_server/routers.rb 96.82% <100%> (+0.1%) ⬆️
lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server.rb 92.3% <9.09%> (-2.23%) ⬇️
lib/cosmos/tools/tlm_viewer/widgets/widget.rb 21.38% <0%> (-1.14%) ⬇️
lib/cosmos/interfaces/interface.rb 97.66% <0%> (-0.48%) ⬇️
lib/cosmos/config/config_parser.rb 92.21% <0%> (-0.35%) ⬇️
lib/cosmos/top_level.rb 84.32% <0%> (-0.31%) ⬇️
lib/cosmos/interfaces/protocols/fixed_protocol.rb 100% <0%> (ø) ⬆️
...ib/cosmos/tools/cmd_tlm_server/background_tasks.rb 100% <0%> (ø) ⬆️
lib/cosmos/script/scripting.rb 98.9% <0%> (+0.09%) ⬆️

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 1bc7a9a...3c4b71e. Read the comment docs.

@ghost ghost merged commit 21be3e3 into master Mar 19, 2019
@ghost ghost deleted the fix_replay_preidentified branch March 19, 2019 19:52
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.

Replay doesn't work with TlmGrapher when loading saved_config
2 participants