Inside the OpenEPT Data Analyzer Window

Every acquisition performed with the OpenEPT Energy Profiler Probe can be recorded to disk as a consumption profile. Once a measurement is finished, the data no longer has to be inspected live: it can be reopened, scrolled, zoomed, measured, and processed offline. This is exactly what the Data Analyzer window is for. It is the part of the OpenEPT GUI dedicated to offline work with already recorded data, and it is also the entry point for the two higher-level analyses that OpenEPT offers today: consumption statistics and battery parameter extraction.
This post is an architectural tour of the Data Analyzer window. It describes what the window is made of, how a recorded profile travels from a folder on disk to a set of interactive plots, and where every class that builds this part of the application is defined. The two dedicated analyses are only introduced here; each of them is covered in detail in its own post.
The complete OpenEPT GUI, including the Data Analyzer, is available as open-source software.
In This Post
- What the Data Analyzer Is - its role in the OpenEPT workflow.
- How a Profile Is Stored - the files that make up a consumption profile.
- Creating a Profile and Choosing Its Type - the Set button, the type dialog, and editing it later.
- The Window Structure - the main window, the profile windows, and the helper classes.
- From Disk to Plots - how a profile is discovered, loaded and displayed.
- Profile Types and Analyses - consumption and battery profiles, and the two analyses they unlock.
- Source Code Map - where every class lives.
What the Data Analyzer Is
During a live acquisition, the OpenEPT GUI streams voltage and current samples from the device and plots them in real time. When Save to file is enabled, the same stream is also written to a profile folder. The Data Analyzer is the counterpart of that live view: it opens one or more of those folders and lets you work with the recorded data without a device attached.
Three things make the Data Analyzer more than a simple file viewer:
- Multiple profiles at once. Each opened profile becomes its own tabbed sub-window, so measurements can be compared side by side.
- The same interactive plots used everywhere else in OpenEPT. Voltage, current and accumulated consumption are drawn with the shared plot widget, with zoom, pan, axis locking and image export.
- Analyses on top of the raw data. From a profile window you can generate per-segment consumption statistics, or, for a battery measurement, launch the battery parameter extraction.
How a Profile Is Stored
A consumption profile is a folder that contains a small, fixed set of files. The Data Analyzer recognizes a folder as a profile by the presence of the summary file OpenEPT.txt.
| File | Content |
|---|---|
vc.csv |
Voltage and current samples (the main waveform). |
cons.csv |
Accumulated consumption samples. |
ep.csv |
Energy point markers - named events placed on the time axis. |
OpenEPT.txt |
A human-readable summary: acquisition info and, since recently, the analysis type of the profile. |
batteryparams.json |
Saved battery parameter settings (present only for battery analyses). |
Each .csv file opens with a two-line header, a title and a line of dashes, followed by a single column row, and then one row per sample:
vc.csv: columnsVoltage,VolTime,Current,CurTime, written as%1.5f,%1.7f,%1.5f,%1.7fper sample, so voltage and current each carry their own per-sample timestamp (in milliseconds).cons.csv: columnsConsumption,ConTime, the accumulated consumption with its timestamp.ep.csv: rows of<name>,<key>, a marker name and the integer sample index the marker is attached to.
These rows are not buffered until the end of a measurement. During an acquisition, every incoming packet is streamed straight to disk by a dedicated writer, FileProcessing (fileprocessing.cpp), running on its own thread. It appends the voltage/current and consumption samples batch by batch (FileProcessing::appendSampleData() and appendConsumptionData()), opening, writing and closing each file on every batch, while ep.csv receives a row whenever a marker is produced. Only the summary lines are written at the boundaries of the run: Acquisiton start when acquisition begins and Acquisiton stop at the end, with the analysis-type block appended once at stop.
The summary file keeps the acquisition metadata followed by an analysis-type block, separated from it by a line of dashes:
Acquisition info
------------
EP Enabled: 1
Acquisiton start: ...
Acquisiton stop: ...
-------
Analysis Type: Battery
Battery: GeoNeng
Battery capacity [mAh]: 630The analysis-type block is what tells the Data Analyzer whether a profile is a Battery, a Consumption, or an Other profile, and for a battery it also carries the declared capacity.
Creating a Profile and Choosing Its Type
A profile is not created in the Data Analyzer; it is created in the Device window, at the moment you give a recording a name. The workflow has three parts: name the profile, declare what kind of data it holds, and, later, if needed, correct that declaration from the Data Analyzer.
Naming the profile and the type dialog
In the Device window you type a profile name next to the Set button. Pressing Set no longer just stores the name: it first opens a small profile type dialog that asks what kind of analysis this recording is for. Three options are offered:
- Battery Analysis - a battery discharge recorded with pulse/pause cycles, to be analyzed with the battery parameter extraction. Choosing it reveals two more fields: the battery name and the declared capacity in mAh.
- Consumption Analysis - a normal consumption recording, to be analyzed with the consumption statistics.
- Other (Default) - a plain recording with no dedicated analysis.
The two battery fields appear only when Battery Analysis is selected, and the dialog refuses to continue until a battery name and a valid capacity are entered. Each option carries its own icon, a battery for Battery, the OpenEPT logo for Consumption, the same icons that later identify the profile throughout the application.
Behind the button, DeviceWnd::onSetConsumptionName() reads the typed name, opens the type dialog, and on confirmation emits two signals: one carrying the profile name and one carrying the chosen type, battery name and capacity. The device container reacts to them differently, and this is the moment the profile actually takes shape on disk:
- The name signal is handled by
DeviceContainer::onDeviceWndConsumptionProfileNameChanged(), which creates the profile folder and all of its files right then, at Set time, not when the recording stops. It makes<workspace>/<device>/<profile>/and asks theFileProcessingwriter to openvc.csv,cons.csv,ep.csvandOpenEPT.txtand write each file's header immediately. If a folder with that name already exists, it is reused and flagged so that starting an acquisition warns before overwriting. - The type signal is only remembered in memory (the analysis type, battery name and declared capacity are kept as fields on the container); nothing about the type is written yet. It is flushed to disk only after the acquisition finishes, by
DeviceContainer::writeProfileAnalysisType().
So, immediately after you press Set, the folder exists and the four files are already present with their headers; what is still missing is the sample data (streamed in during the acquisition) and the analysis-type block (appended at the very end).
Where the type is saved
Once confirmed, the chosen type is written into the profile's OpenEPT.txt summary, at the very end, below the acquisition information and separated from it by a line of dashes:
Acquisition info
------------
EP Enabled: 1
Acquisiton start: ...
Acquisiton stop: ...
-------
Analysis Type: Battery
Battery: GeoNeng
Battery capacity [mAh]: 630The type is remembered when Set is pressed and appended after the acquisition finishes, so it always lands at the bottom of the summary and the file structure, acquisition info, separator, analysis-type block, stays intact. From then on, this block is what every part of the Data Analyzer reads to decide which icon to show and which analysis to offer.
Editing the type later from the Data Analyzer
The declaration made at acquisition time is not final. Every profile window in the Data Analyzer has a Profile type button (a gear) in its tool bar. Pressing it opens the same dialog, pre-filled with the current values, and lets you change the analysis type, the battery name, or the capacity after the fact, useful when a recording was mislabeled, or when a capacity needs to be corrected. Saving rewrites only the analysis-type block in OpenEPT.txt, leaving the acquisition information and its separator untouched.
For a battery profile there is one extra tie: the declared capacity is kept in sync with the capacity used by the battery parameter extraction. Editing it in the profile type dialog updates the extraction settings, and editing it in the extraction settings writes it back to the profile, so the two never drift apart.
Profile creation and type handling are implemented in:
- profiletypedialog.cpp / profiletypedialog.h, the shared type dialog
- devicewnd.cpp, the Set button flow (
onSetConsumptionName()) - devicecontainer.cpp, creating the profile folder and files at Set time (
onDeviceWndConsumptionProfileNameChanged()) and writing the type block toOpenEPT.txtat stop (writeProfileAnalysisType()) - fileprocessing.cpp, the threaded writer that opens the files, writes their headers, and streams samples (
appendSampleData(),appendConsumptionData(),appendEPData()) - dataanalyzerprofile.cpp, editing the type later (
onEditProfileType()) and the capacity sync
The Window Structure
The Data Analyzer is not a single class. It is a small family of classes that split the work between managing the set of open profiles and displaying and analyzing one profile.
The main window
The main window is the DataAnalyzer class. It is responsible for everything that concerns the collection of profiles rather than their content:
- the drop-down that lists every profile discovered on disk,
- the buttons to reload the list, open the selected profile, and delete a profile,
- the MDI area (
QMdiArea) that hosts the opened profiles as tabbed sub-windows, - opening and closing profiles, and keeping track of how many copies of the same profile are open.
Each opened profile is a DataAnalyzerProfile widget wrapped in a QMdiSubWindow. The tab of each sub-window carries an icon that reflects the profile type: a battery icon for a battery profile, the OpenEPT logo for a consumption profile, and the default icon otherwise.
The profile window
The DataAnalyzerProfile class is the heart of the Data Analyzer. One instance represents one opened profile and contains:
- a small tool bar with the profile-level actions (save all plots, generate statistics, battery analyzer, profile type),
- three stacked, dockable plots - Voltage, Current and Consumption - built with the shared
Plotwidget, - the logic that loads the profile's files, applies the energy-point markers to the plots, and keeps the X axes of the three plots synchronized,
- the launch points for the two analyses.
The helper classes
A few supporting classes complete the picture:
DataAnalyzerWorkerperforms the file parsing off the GUI thread, so that opening a large profile never freezes the interface.DataAnalyzerStatisticsWndand its workerDataAnalyzerStatisticsWorkerimplement the consumption statistics view and its computation.- The battery parameter extraction uses its own window,
BatteryParamsWnd, together with theBatteryParamsExtractionprocessing class. - All plotting is done through the shared
Plotwidget.
From Disk to Plots
Opening a profile is deliberately split between the GUI thread, which stays responsive, and a worker thread, which does the heavy reading.
- Discovery. When the Data Analyzer is shown or the reload button is pressed, it walks the workspace directory recursively and collects every folder that contains an
OpenEPT.txt. Each such folder is added to the drop-down, now with an icon that matches its analysis type. - Request. When a profile is opened, a
DataAnalyzerProfileis created, added to the MDI area as a tab, and asked to start loading. Loading is not done on the GUI thread; the profile sends a request to theDataAnalyzerWorker, which lives on a dedicatedQThread. - Parsing (in parallel). The worker reads the data files in
DataAnalyzerWorker::processVoltCurConData(). Because the voltage/current file, the consumption file and the energy-point file are independent, they are launched concurrently withQtConcurrent::runrather than one after another, and a single progress bar reports their combined progress. Each file has its own small parser,parseVCData(),parseConsumptionData()andparseEPFile(), which skip the two header lines and read the CSV rows into plaindoublevectors (forep.csv, into(name, key)pairs). Not every profile has all three files:ep.csvis read only when the summary saysEP Enabled: 1, and a missing or unreadable file is reported with a warning and treated as empty rather than aborting the load, so a recording with no markers still opens cleanly. - Display. When parsing finishes, the parsed vectors are handed back to the profile window.
DataAnalyzerProfile::processingVolCurConDone()pushes them into the three plots and keeps them in the member vectorsloadedVoltage,loadedVoltageKeys,loadedCurrentandloadedCurrentKeys;processingEPDone()stores the markers inloadedMarkersand draws them onto the curves throughapplyMarkersToPlots(). These members are exactly what the two analyses read later, so the heavy file reading happens once and every subsequent computation works on the in-memory copy. The time axis is not reconstructed or resampled, the per-sample timestamps carried in the*Timecolumns are used directly as the x-values, and each marker references its sample by the integerkeystored inep.csv.
Because the three plots share a time axis, locking their X axes keeps them aligned while zooming and panning, which makes it easy to read current, voltage and accumulated consumption at the same instant.
The same use-all-the-cores philosophy extends to the analyses that run on top of the loaded data. Before a heavy computation such as the battery parameter extraction, the Data Analyzer offers to spread the work across every available CPU core, so a long analysis finishes faster at the cost of keeping the machine busy while it runs.
Profile Types and Analyses
Every profile carries an analysis type in its summary file. The type is chosen when the profile is created and can be changed later from the profile's tool bar. It drives both the icons shown throughout the Data Analyzer and which analysis makes sense for the profile.
- A Consumption profile is meant to be analyzed with the consumption statistics, which break the recording into named segments delimited by energy-point markers and report energy, duration, and current and voltage figures for each segment. This is the subject of the next post, Consumption Analysis in the OpenEPT Data Analyzer.
- A Battery profile is meant to be analyzed with the battery parameter extraction, which turns the pulse/pause cycles recorded during a battery discharge into an equivalent-circuit model (internal resistance, RC branches, open-circuit voltage and state of charge). The mathematics behind it, and how it maps onto the code, are covered in Battery Parameter Extraction in the OpenEPT Data Analyzer.
- An Other profile keeps the raw plots without a dedicated analysis.
Source Code Map
For readers who want to follow along in the code, this is where the Data Analyzer classes are defined.
Main window and profile management
Per-profile window
File parsing worker
- dataanalyzerworker.h (implemented in
dataanalyzer.cpp)
Consumption statistics
Shared plotting widget
The classes above form the skeleton on which the two analyses are built. In the next two posts we zoom into each of them: first the consumption statistics, then the battery parameter extraction, with their backends, their front-ends, and, for the battery case, the mathematics that connects the recorded waveform to a usable battery model.



