Getting started
Build the app from source, look at it in demo mode without any instrument, and find your way around the window.
Here to add an instrument of your own? The guide is Add an instrument.
What you need
- Rust
- stable, tested with 1.94.1.
- macOS
- where the app is used and tested with the instruments.
- Linux
pkg-configandlibudev-dev(Debian names), and a C compiler such asbuild-essential, sincehidapicompiles C code. The build and the tests were tried in therust:1.94.1container (aarch64); starting the app on a Linux desktop and the instruments were not tried.- Windows
- not supported.
sudo apt-get install pkg-config libudev-dev
What was tried on which platform, and what was only read in the code: Platforms.
Clone, build and run
git clone https://gitlab.com/commanderk33n/bench-control-platform.git
cd bench-control-platform
cargo run
A normal start loads your settings.toml, saves it when a setting changes, and starts a worker thread for each of the four instruments. The binary is bench-control-platform.
The app switches real power supplies, and it comes without any warranty. An output is switched only by a click on a supply's output switch and by "All outputs off"; a memory recall sets voltage and current only.
Demo mode
Demo mode shows the UI without instruments. It fills the app with fixed sample data and neither reads nor writes settings.toml. It runs without the instrument workers, so nothing in it, Connect and Scan included, reaches a device, and no file dialog opens.
BCP_DEMO=1 cargo run
BCP_DEMO=mixed cargo run
| Variable | Values | Effect |
|---|---|---|
BCP_DEMO | 1, connected, mixed | demo mode; mixed shows a disconnected, a failed and a missing instrument |
BCP_TAB | rigol, hanmatek, fnirsi, fnb58, logs | page to start on |
BCP_WINDOW | <width>x<height>, e.g. 1200x740 | window size in points |
BCP_CAPTURE | path of a .png file | save the window once, then quit |
BCP_STATE | comma-separated demo states, listed below | states of the demo data |
The values of BCP_STATE: scope-off, scope-failed, no-channel, no-waveform, wave-error, wide, drawer, tab-export, tab-device, fit, armed, supply-wide, supply-off, supply-trip, supply-pending, supply-armed, supply-power, meter-off, meter-idle, meter-wide, meter-cleared, meter-armed.
BCP_TAB,BCP_WINDOW,BCP_CAPTUREandBCP_STATEonly work together withBCP_DEMO; without it they end the start with exit code 2.- Other names that start with
BCP_are not read. A mistyped name is ignored without a message, so a mistypedBCP_DEMOstarts a normal run. - The variables of the project's old name (
HCP_DEMO,HCP_UI,HCP_TAB,HCP_WINDOW,HCP_CAPTURE,HCP_STATE) end the start with exit code 2 and a line that names the new variable;HCP_UIhas none, its option is gone.
A capture saves the window 1.5 s after the start and quits. It cannot create its folder, so make it first:
mkdir -p target/captures
BCP_DEMO=1 BCP_TAB=fnirsi BCP_WINDOW=1440x900 BCP_CAPTURE=target/captures/fnirsi.png cargo run
The pixel size follows the scale of the display the window opens on: BCP_WINDOW=1440x900 gives a 1440 x 900 PNG at scale 1 and 2880 x 1800 at scale 2.
Settings file
The app stores its settings in settings.toml under the configuration folder of the system.
- Tried
macOS:
~/Library/Application Support/benchControlPlatform/settings.toml - Not tried
Linux:
$XDG_CONFIG_HOME/benchControlPlatform/settings.toml, by default~/.config/benchControlPlatform/settings.toml
Stored are the selected tab, the Rigol connection defaults, the Hanmatek and IPS3608 serial defaults, the measurement slots, the waveform polling rate and the last export folder.
Every start outside demo mode that finds no settings.toml in the new folder copies the one from the folder of the old name, homeControlPlatform, if there is one, and leaves the old file as it is. So removing the new file brings the old values back on the next start: to reset to the defaults, move the old file away too.
The window
The app has fixed pages with nothing to drag or resize. The window cannot be made smaller than 1200 x 740, at any zoom (Cmd and + or -).
- Tab bar
- The connection, state and key values of all four instruments, on every page. It offers Connect for an instrument that is not connected, and has "All outputs off" for the supplies, and the button to the Logs page.
- Oscilloscope
- A toolbar (run control, timebase, trigger, view, live, capture, export, SCPI), the plot, four channel tiles, and an inspector with measurements, cursors, acquisition and the tabs Screen, Export and Device. The SCPI console opens as a drawer under the plot. Shortcuts when no text field has focus: Space Run/Stop, S Single, F Force trigger, R refresh waveform, 1-4 channel visibility, Esc disarm cursor.
- Supplies
- The HM310T and the IPS3608 share one page layout: a header with the connection, Refresh and Connect or Disconnect; readouts of voltage, current and power with the output switch and the Set and Limit rows; six memory tiles; a trend; and a column with Protection, Connection and Device. A stepped value stays amber and nothing is sent until you apply it or press Enter.
- Meter
- The FNB58 page: a header with the connection, the REC chip, Record or Stop recording and Connect or Disconnect; readouts of voltage, current and power with D+, D- and the temperature; a trend of three strips; and a column with Session totals, Recording and Device.
- Status bar
- The latest log entry.
- Logs
- A page of its own with the log, with Clear and Copy All.
The full manual
Every detail of each page, the settings file and the hardware tests is in the repository, in docs/manual/:
docs/manual/README.md: every page, demo mode, settings, hardware testsdocs/manual/oscilloscope.md: Rigol DHO924Sdocs/manual/supplies.md: Hanmatek HM310T and FNIRSI IPS3608docs/manual/meter.md: FNIRSI FNB58
The hardware tests are ignored by default and need the instrument; they are described in the manual. The transport, timing and limits of each example instrument: The four example instruments.