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

Telemetry Viewer has fatal exception when called with JSON-RPC method display #577

Closed
fr33zer opened this issue Sep 26, 2017 · 2 comments
Closed
Assignees
Labels
bug
Milestone

Comments

@fr33zer
Copy link

@fr33zer fr33zer commented Sep 26, 2017

While testing, found that the move method is not defined for Cosmos::Screen:

2017/09/26 14:17:38.335  FATAL: Fatal Exception! Exiting...
2017/09/26 14:17:38.348  FATAL: NoMethodError : undefined method `move' for #<Cosmos::Screen:0x00000002fd9600>
Did you mean?  mode
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/tools/tlm_viewer/screen.rb:353:in `method_missing'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/tools/tlm_viewer/screen.rb:353:in `process'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/tools/tlm_viewer/screen.rb:233:in `initialize'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb:489:in `new'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb:489:in `block in display'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/qtbindings-4.8.6.3/lib/Qt4.rb:96:in `block in execute_in_main_thread'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/qtbindings-4.8.6.3/lib/Qt4.rb:49:in `callback_timeout'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/qtbindings-4.8.6.3/lib/Qt/qtruby4.rb:479:in `qt_metacall'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/qtbindings-4.8.6.3/lib/Qt/qtruby4.rb:479:in `method_missing'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/qtbindings-4.8.6.3/lib/Qt/qtruby4.rb:479:in `exec'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/gui/qt_tool.rb:292:in `block in run'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/top_level.rb:692:in `set_working_dir'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/gui/qt_tool.rb:273:in `run'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb:580:in `block in run'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/top_level.rb:512:in `catch_fatal_exception'
/opt/ruby-2.3.3/lib/ruby/gems/2.3.0/gems/cosmos-3.8.3/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb:530:in `run'
...

Here is a python script to demonstrate this exception:

import socket
import struct
import json

def request(message):
	port = 7778
	address = '127.0.0.1'
	with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
		s.connect((address, port))
		print('Sending:\n', message)
		size = len(message)
		packedSize = struct.pack('>I', size)
		s.send(packedSize)
		s.send(message.encode())
		data = s.recv(1024)
		print('Received:\n', repr(data))

request('{\"jsonrpc\": \"2.0\", \"method\": \"display\", \"params\": [\"COSMOS LIMITS_CHANGE\", \"1\", \"1\"], \"id\": 1}')
@jasonatball
Copy link
Collaborator

@jasonatball jasonatball commented Oct 31, 2017

@ryanatball I'm assigning this to you because I had issues running the Python API when trying to test this. Can you verify it still works?

@ryanatball
Copy link
Member

@ryanatball ryanatball commented Nov 8, 2017

This is happening because you are passing the move position as strings. "1", "1". It should handle that without crashing, but the workaround is to pass them as integers.

@ryanatball ryanatball added the bug label Nov 8, 2017
@ryanatball ryanatball closed this in ec1a827 Nov 8, 2017
ryanatball added a commit that referenced this issue Nov 8, 2017
closes #577. Make display handle strings for x_pos and y_pos
@ryanmelt ryanmelt added this to the v4.1.0 milestone Nov 20, 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.