Mergemaster#140
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request extends the Python UC2 client by adding a fan controller module and improves serial link robustness (baudrate handling, reconnect behavior, and a lightweight connection health check). It also removes an accidental Jupyter checkpoint file from documentation.
Changes:
- Add
Fanmodule and expose it viaUC2Client.fan. - Improve serial connection handling: honor caller-provided baudrate, refine
is_connectedsemantics, addreconnect(port=..., baudrate=...), and add aping()helper. - Remove
DOCUMENTATION/.ipynb_checkpoints/...notebook checkpoint from version control.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| uc2rest/UC2Client.py | Imports/initializes new Fan controller on client creation. |
| uc2rest/mserial.py | Serial connection robustness improvements (baudrate propagation, connection state tracking, reconnect + ping). |
| uc2rest/fan.py | New fan controller wrapper (get/set fan state, temperature readout, callback integration). |
| DOCUMENTATION/.ipynb_checkpoints/DOC_UC2Client-PinConfigurator-checkpoint.ipynb | Removes an auto-generated Jupyter checkpoint file from the repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+135
to
140
| # initialize fan controller | ||
| self.fan = Fan(self) | ||
|
|
||
| # initialize laser | ||
| self.state = State(self) | ||
|
|
Comment on lines
109
to
+114
| try: # try to close an eventually open serial connection | ||
| if str(type(self.ser)) != "<class 'uc2rest.mserial.MockSerial'>": | ||
| self.serialdevice.close() | ||
| except: pass | ||
|
|
||
|
|
||
| # Honour the baudrate passed in — previously tryToConnect used |
Comment on lines
318
to
322
| mReadline = self._read(self.serialdevice) | ||
| if mReadline == False : | ||
| nFailedCommands += 1 | ||
| if nFailedCommands > nFailedCommandsMax: | ||
| raise Exception("Failed to read the line in serial: "+str(mReadline)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.