Skip to content

Mocksim merge#18

Open
campagnola wants to merge 65 commits into
mainfrom
mocksim-merge
Open

Mocksim merge#18
campagnola wants to merge 65 commits into
mainfrom
mocksim-merge

Conversation

@campagnola
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread parallax/mock_sim.py
from .threadrun import runInGuiThread


class CameraTransform(coorx.CompositeTransform):
Copy link
Copy Markdown
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)

Comment thread parallax/model.py
def set_last_object_point(self, obj_point):
self.obj_point_last = obj_point

def get_image_point(self):
Copy link
Copy Markdown
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)

Comment thread parallax/model.py
assert len(calibrations) > 0
return calibrations

def get_calibration(self, stage):
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread parallax/stage.py
MockStage.close_stages()


class NewScaleStage:
Copy link
Copy Markdown
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

Comment thread parallax/stage.py
z += zo

speed = speed or self.speed
move_cmd = MoveFuture(self, pos=np.array([x, y, z]), speed=speed, accel=self.accel)
Copy link
Copy Markdown
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

Comment thread parallax/threadrun.py
from PyQt5 import QtCore, QtWidgets


def runInThread(thread, func, *args, **kwds):
Copy link
Copy Markdown
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)

Comment thread parallax/threadrun.py
return ThreadCallFuture(thread, func, *args, **kwds)()


def runInGuiThread(func, *args, **kwds):
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread parallax/config.py Outdated
"calibration_path": "./calibrations",
"console_history_file": "./console_history",
"calibration_path": "./",
"console_history_file": "./",
Copy link
Copy Markdown
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

Comment thread parallax/config.py
},
"calibration_path": "./calibrations",
"console_history_file": "./console_history",
"calibration_path": "./",
Copy link
Copy Markdown
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?

Comment thread parallax/control_panel.py

self.settings_button = QPushButton()
self.settings_button.setIcon(QIcon('../img/gear.png'))
self.settings_button.setIcon(QIcon('./img/gear.png'))
Copy link
Copy Markdown
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
Copy Markdown
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