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

Mocksim merge #18

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open

Mocksim merge #18

wants to merge 65 commits into from

Conversation

campagnola
Copy link
Collaborator

Introduces a simulation of stage+camera for testing

- added main splitter
- adjusted layout margins, default window size
- support for more cameras (simplified code)
calibrations now know from/to coordinate system names
fix mock stage orientation bug
carry system names through calibration transforms, check when moving to target
self.suggested_corr_points.emit(result)


def template_match(img, template, method):
Copy link
Member

Choose a reason for hiding this comment

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

might want to move this template matching code somewhere else

from .threadrun import runInGuiThread


class CameraTransform(coorx.CompositeTransform):
Copy link
Member

Choose a reason for hiding this comment

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

feels like a duplicate of same class name in calibration.py, think about this (chris)

def set_last_object_point(self, obj_point):
self.obj_point_last = obj_point

def get_image_point(self):
Copy link
Member

Choose a reason for hiding this comment

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

this is a 4D "image points" (2 points)

assert len(calibrations) > 0
return calibrations

def get_calibration(self, stage):
Copy link
Member

Choose a reason for hiding this comment

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

this gets the most recent calibration associated with a stage

Copy link
Member

Choose a reason for hiding this comment

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

used for "move to selected" button

MockStage.close_stages()


class NewScaleStage:
Copy link
Member

Choose a reason for hiding this comment

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

we should have base classes for both Stage and Camera

z += zo

speed = speed or self.speed
move_cmd = MoveFuture(self, pos=np.array([x, y, z]), speed=speed, accel=self.accel)
Copy link
Member

Choose a reason for hiding this comment

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

might be worth using this for the real stage? tbd

from PyQt5 import QtCore, QtWidgets


def runInThread(thread, func, *args, **kwds):
Copy link
Member

Choose a reason for hiding this comment

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

not used in parallax (only in a script)

return ThreadCallFuture(thread, func, *args, **kwds)()


def runInGuiThread(func, *args, **kwds):
Copy link
Member

Choose a reason for hiding this comment

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

used in mock_sim.py

Copy link
Member

Choose a reason for hiding this comment

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

but only in the test script

"calibration_path": "./calibrations",
"console_history_file": "./console_history",
"calibration_path": "./",
"console_history_file": "./",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

console_history is a file; this should be left as-is

@@ -10,8 +10,8 @@
"show_axes": True,
"auto_select_corr_points": True,
},
"calibration_path": "./calibrations",
"console_history_file": "./console_history",
"calibration_path": "./",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you prefer calibrations here, or was tere another reason to make this change?

@@ -69,11 +69,11 @@ def __init__(self, model):
self.dropdown.activated.connect(self.handle_stage_selection)

self.settings_button = QPushButton()
self.settings_button.setIcon(QIcon('../img/gear.png'))
self.settings_button.setIcon(QIcon('./img/gear.png'))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

More robust:

os.path.join(os.path.dirname(parallax.__file__), 'img', 'gear.png'))

@campagnola
Copy link
Collaborator Author

Aside from minor comments, your changes look good to me.

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.

2 participants