Skip to content

Conversation

@ogeesan
Copy link
Contributor

@ogeesan ogeesan commented Nov 24, 2025

In #42 it was noted that:

In a run with the multi-setup, the GUI listed the COM port it claims it couldn't detect

This PR should make it clearer what is happening by referring to the current machine's settings file as "(use existing file)".

An explanation

A LiquidCalibration.json has two COM properties: the one inside of its metadata and also the Config folder that the file lives within. During startup, BpodLib.BpodObject.setup.updatePathAndSettings.m will:

  1. Load the LiquidCalibration.json that lives in the appropriate Config folder
  2. Check the file's COM to see if it matches the current machine's COM port.
  3. If mismatch, display all Config sources and ask a user to pick one (or ignore).

For this reason, the current COM port will always be in the list of available Config sources. This UI handles the situation where a user replaces one state machine with another and the user copies across those config files. This allows the COM metadata to be overwritten without requiring a recalibration. It's sort of a niche use-case -- at some point we could build an interface to allow users to move configuration files around.

To produce the GUI you can use this snippet:

BpodSystem = BpodTest.MockBpodObject('yourCOM');  % this require Tests/ to be on the Path
BpodSystem.Path.LocalDir = fullfile(fileparts(BpodLib.path.getPath('root')), 'Bpod Local');
BpodSystem.CalibrationTables.LiquidCal = BpodLib.calibration.liquid.io.load('BpodSystem', BpodSystem, 'type', 'statemachine');
BpodLib.calibration.liquid.ui.VerifyCOMGUI(BpodSystem)
image

@sanworks sanworks merged commit 84c2da8 into sanworks:develop Nov 24, 2025
2 checks passed
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