-
Notifications
You must be signed in to change notification settings - Fork 0
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
Actively transform the scene when the view is dragged #4
Conversation
…tive transformations on the scene, instead of transformations on the view, created several graphic item classes.
- Hide frame when zoomed out. - Add automatic max-mag to speed up the view when there are many stars. - Added automatic item scaling when zooming out - Automatically update the stars when scaling, - prevent negative scaling, - limit scaling to a max size.
… and added corresponding properties. Removes update argument from StarPlot.set_attitude/set_time/set_catalog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 5 changed files in this pull request and generated no suggestions.
# self.setPos(-star["yang"], -star["zang"]) | ||
self.setPos(star["row"], -star["col"]) | ||
|
||
def setPos(self, x, y): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if everything basically gets plugged in as (row, -col) - would there be value in flipping the function signature and adding a docstring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setPos
is not written by me. It is the Qt function, and I don't want to start overriding all setPos
functions for all possible items, and we do want to keep the appearance, so I do not see a way other than having minus signs all over.
There might be some kind of hack, but I prefer to keep it explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean setPos
for all other QGraphicsItem
s. This one is overridden but it is an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okey Doke.
""" | ||
Utility class to keep together all graphics item for a star catalog. | ||
|
||
Note that the position of the catalog is ALLWAYS (0,0) and the item positions need to be set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in docstring.
rect = QtC.QRectF(-s, -s, s * 2, s * 2) | ||
super().__init__(rect, parent) | ||
self.setPen(QtG.QPen(QtG.QColor("green"), w)) | ||
# self.setPos(-star["yang"], -star["zang"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably go through and remove commented out code in next PR.
@@ -506,6 +506,7 @@ def proseco_args(self): | |||
"detector": self.values["instrument"], | |||
"sim_offset": 0, # docs say this is optional, but it does not seem to be | |||
"focus_offset": 0, # docs say this is optional, but it does not seem to be | |||
"dyn_bgd_n_faint": 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should not be needed now that we've changed the proseco default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Note: this PR requires sot/agasc/pull/193.
Changed the way graphic items are handled:
This change makes the code much easier to read. It also fixes a few issues:
Interface impacts
Testing
Note: this PR requires sot/agasc/pull/193.
Unit tests
Functional tests
I have the following JSON file
and I ran
you can also run