diff --git a/QtPMbrowser/DlgSelectParameters.cpp b/QtPMbrowser/DlgSelectParameters.cpp
index 41ff036..4887cea 100644
--- a/QtPMbrowser/DlgSelectParameters.cpp
+++ b/QtPMbrowser/DlgSelectParameters.cpp
@@ -31,6 +31,10 @@ DlgSelectParameters::DlgSelectParameters(QWidget *parent)
setScrollArea(ui->scrollAreaSer, v_ser, hkLib::parametersSeries);
setScrollArea(ui->scrollAreaSwp, v_swp, hkLib::parametersSweep);
setScrollArea(ui->scrollAreaTr, v_tr, hkLib::parametersTrace);
+ setScrollArea(ui->scrollAreaAmp, v_amp, hkLib::parametersAmpplifierState);
+ setScrollArea(ui->scrollAreaStim, v_stim_stim, hkLib::parametersStimulation);
+ setScrollArea(ui->scrollAreaStimChannel, v_stim_ch, hkLib::parametersChannel);
+ setScrollArea(ui->scrollAreaStimSegment, v_stim_seg, hkLib::parametersStimSegment);
}
DlgSelectParameters::~DlgSelectParameters()
@@ -51,4 +55,8 @@ void DlgSelectParameters::storeParams()
readSelections(v_ser, hkLib::parametersSeries);
readSelections(v_swp, hkLib::parametersSweep);
readSelections(v_tr, hkLib::parametersTrace);
+ readSelections(v_amp, hkLib::parametersAmpplifierState);
+ readSelections(v_stim_stim, hkLib::parametersStimulation);
+ readSelections(v_stim_ch, hkLib::parametersChannel);
+ readSelections(v_stim_seg, hkLib::parametersStimSegment);
}
diff --git a/QtPMbrowser/DlgSelectParameters.h b/QtPMbrowser/DlgSelectParameters.h
index 86596a9..aa6ac3f 100644
--- a/QtPMbrowser/DlgSelectParameters.h
+++ b/QtPMbrowser/DlgSelectParameters.h
@@ -99,7 +99,11 @@ class DlgSelectParameters : public QDialog
v_grp{ hkLib::parametersGroup.size() },
v_ser{ hkLib::parametersSeries.size() },
v_swp{ hkLib::parametersSweep.size() },
- v_tr{ hkLib::parametersTrace.size() };
+ v_tr{ hkLib::parametersTrace.size() },
+ v_amp{ hkLib::parametersAmpplifierState.size() },
+ v_stim_stim{ hkLib::parametersStimulation.size() },
+ v_stim_ch{ hkLib::parametersChannel.size() },
+ v_stim_seg{ hkLib::parametersStimSegment.size() };
Ui::DlgSelectParameters *ui;
};
diff --git a/QtPMbrowser/DlgSelectParameters.ui b/QtPMbrowser/DlgSelectParameters.ui
index ff887cd..dae4769 100644
--- a/QtPMbrowser/DlgSelectParameters.ui
+++ b/QtPMbrowser/DlgSelectParameters.ui
@@ -13,390 +13,760 @@
Select Parameters
-
- -
-
-
- 1
+
+
-
+
+
+ Qt::Orientation::Horizontal
-
-
-
-
- parameter name
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 40
- 0
-
-
-
-
- 40
- 16777215
-
-
-
- print
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- <html><head/><body><p><span style=" font-weight:700;">Series</span></p></body></html>
-
-
-
- -
-
-
-
- 40
- 0
-
-
-
-
- 40
- 16777215
-
-
-
- export
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- true
-
-
-
-
- 0
- 0
- 259
- 502
-
-
-
-
-
-
+
+ QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok
+
+
- -
+
-
<html><head/><body><p><span style=" font-weight:600;">export:</span> export parameter to wave-note and table, <span style=" font-weight:600;">print:</span> print parameter to text area</p></body></html>
- -
-
+
-
+
- Qt::Horizontal
+ Qt::Orientation::Horizontal
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+ 40
+ 20
+
-
+
- -
-
-
- 1
+
-
+
+
+ 0
-
-
-
-
- <html><head/><body><p><span style=" font-weight:700;">Trace</span></p></body></html>
-
-
-
- -
-
-
- parameter name
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 40
- 0
-
-
-
- print
-
-
- Qt::AlignCenter
-
+
+
+ Pulse
+
+
+
-
+
+
-
+
+
+ 1
+
+
-
+
+
+ parameter name
+
+
+ Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 254
+ 200
+
+
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+
+ 40
+ 16777215
+
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 254
+ 200
+
+
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+
+ 40
+ 16777215
+
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Group</span></p></body></html>
+
+
+
+ -
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ parameter name
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Root</span></p></body></html>
+
+
+
+
+
+ -
+
+
+ 1
+
+
-
+
+
+
+ 40
+ 0
+
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Sweep</span></p></body></html>
+
+
+
+ -
+
+
+ parameter name
+
+
+ Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 254
+ 452
+
+
+
+
+
+
+
+ -
+
+
+ 1
+
+
-
+
+
+ parameter name
+
+
+ Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+
+ 40
+ 16777215
+
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Series</span></p></body></html>
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+
+ 40
+ 16777215
+
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 253
+ 452
+
+
+
+
+
+
+
+ -
+
+
+ 1
+
+
-
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Trace</span></p></body></html>
+
+
+
+ -
+
+
+ parameter name
+
+
+ Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 253
+ 452
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Amplifier
+
+
+
+
+ 0
+ 0
+ 1061
+ 511
+
+
+
+ -
+
+
+ 1
+
+
-
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 523
+ 461
+
+
+
+
+
+ -
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ parameter name
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Amplifier parameters</span></p></body></html>
+
+
+
+
+
+ -
+
+
+ Qt::Orientation::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
-
- -
-
-
-
- 40
- 0
-
-
-
- export
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- true
-
-
-
-
- 0
- 0
- 259
- 502
-
+
+
+
+ Stimulus
+
+
+
+
+ 0
+ 0
+ 1061
+ 521
+
+
+
+
+ QLayout::SizeConstraint::SetDefaultConstraint
-
+
-
+
+
+ 1
+
+
-
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Stim. Segment</span></p></body></html>
+
+
+
+ -
+
+
+ parameter name
+
+
+ Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 345
+ 471
+
+
+
+
+
+
+
+ -
+
+
+ 1
+
+
-
+
+
+
+ 40
+ 0
+
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Stim. Channel</span></p></body></html>
+
+
+
+ -
+
+
+ parameter name
+
+
+ Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 345
+ 471
+
+
+
+
+
+
+
+ -
+
+
+ 1
+
+
-
+
+
+ parameter name
+
+
+ Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+
+ 40
+ 16777215
+
+
+
+ print
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:700;">Stimulus</span></p></body></html>
+
+
+
+ -
+
+
+
+ 40
+ 0
+
+
+
+
+ 40
+ 16777215
+
+
+
+ export
+
+
+ Qt::AlignmentFlag::AlignCenter
+
+
+
+ -
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 345
+ 471
+
+
+
+
+
+
+
+
-
-
-
- -
-
-
- 1
-
-
-
-
-
- parameter name
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
- -
-
-
- true
-
-
-
-
- 0
- 0
- 260
- 225
-
-
-
-
-
- -
-
-
-
- 40
- 0
-
-
-
-
- 40
- 16777215
-
-
-
- print
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- true
-
-
-
-
- 0
- 0
- 260
- 225
-
-
-
-
-
- -
-
-
-
- 40
- 0
-
-
-
-
- 40
- 16777215
-
-
-
- export
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- <html><head/><body><p><span style=" font-weight:700;">Group</span></p></body></html>
-
-
-
- -
-
-
- export
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- print
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- parameter name
-
-
-
- -
-
-
- <html><head/><body><p><span style=" font-weight:700;">Root</span></p></body></html>
-
-
-
-
-
- -
-
-
- 1
-
-
-
-
-
-
- 40
- 0
-
-
-
- export
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 40
- 0
-
-
-
- print
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- <html><head/><body><p><span style=" font-weight:700;">Sweep</span></p></body></html>
-
-
-
- -
-
-
- parameter name
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
- -
-
-
- true
-
-
-
-
- 0
- 0
- 260
- 502
-
-
-
-
-
-
+
+
diff --git a/QtPMbrowser/pmbrowserwindow.cpp b/QtPMbrowser/pmbrowserwindow.cpp
index 332c47d..a6355e1 100644
--- a/QtPMbrowser/pmbrowserwindow.cpp
+++ b/QtPMbrowser/pmbrowserwindow.cpp
@@ -915,16 +915,18 @@ void PMbrowserWindow::prepareTreeContextMenu(const QPoint& pos)
auto actPrintAllP = menu.addAction("print all parameters");
auto actSetAsTime0 = menu.addAction("set as time reference");
QAction* actAmpstate = nullptr, * actDrawStim = nullptr,
- * actUseStimAsX{}, * actDrawSeriesStim = nullptr;
+ * actUseStimAsX{}, * actDrawSeriesStim = nullptr, * actStimulusProtocol{nullptr};
const auto node = item->data(0, Qt::UserRole).value();
if (node->getLevel() == hkTreeNode::LevelSeries) {
menu.addSeparator();
actAmpstate = menu.addAction("amplifier state");
actDrawSeriesStim = menu.addAction("draw stimuli");
+ actStimulusProtocol = menu.addAction("print stimulus / pgf protocol");
}
if (node->getLevel() == hkTreeNode::LevelSweep) {
menu.addSeparator();
actDrawStim = menu.addAction("show stimulus");
+ actStimulusProtocol = menu.addAction("print stimulus / pgf protocol");
actUseStimAsX = menu.addAction("use stim. as x trace");
}
auto response = menu.exec(ui->treePulse->mapToGlobal(pos));
@@ -952,6 +954,12 @@ void PMbrowserWindow::prepareTreeContextMenu(const QPoint& pos)
else if (actDrawStim != nullptr && actDrawStim == response) {
drawStimulus(node);
}
+ else if(actStimulusProtocol != nullptr && response == actStimulusProtocol){
+ if(node->getLevel() == hkTreeNode::LevelSweep) {
+ printStimProtocol(node); } else if(node->getLevel() == hkTreeNode::LevelSeries){
+ printStimProtocol(&node->Children.at(0));
+ }
+ }
else if (actUseStimAsX && actUseStimAsX == response) {
if (ui->renderArea->noData() || ui->renderArea->YtraceHasX()) {
QMessageBox::information(this, "Notice", "First, select a data-trace!");
@@ -1070,8 +1078,8 @@ void PMbrowserWindow::printAmplifierState(const hkTreeNode* series)
// use local amp state record
amprecord.Data = series->Data.subspan(SeOldAmpState, AmplifierStateSize);
std::string s;
- formatParamList(amprecord, parametersAmpplifierState, s);
- ui->textEdit->append(QString("Amplifier State:\n%1\n").arg(QString(s.c_str())));
+ formatParamListPrint(amprecord, parametersAmpplifierState, s);
+ ui->textEdit->append(QString("Amplifier State:\n%1\n").arg(QString::fromUtf8(s)));
}
else {
const auto& amproot = datfile->GetAmpTree().GetRootNode();
@@ -1080,13 +1088,40 @@ void PMbrowserWindow::printAmplifierState(const hkTreeNode* series)
auto ampstatecount = ampre.extractInt32(AmStateCount);
amprecord.Data = ampre.Data.subspan(AmAmplifierState, AmplifierStateSize);
std::string s;
- formatParamList(amprecord, parametersAmpplifierState, s);
- ui->textEdit->append(QString("Amplifier State (Amp #%1):\n%2\n").arg(ampstatecount).arg(QString(s.c_str())));
+ formatParamListPrint(amprecord, parametersAmpplifierState, s);
+ ui->textEdit->append(QString("Amplifier State (Amp #%1):\n%2\n").arg(ampstatecount).arg(QString::fromUtf8(s)));
}
}
}
+void PMbrowserWindow::printStimProtocol(const hkLib::hkTreeNode* sweep)
+{
+ try{
+ assert(sweep->getLevel() == hkTreeNode::LevelSweep);
+ int stim_index = sweep->extractInt32(SwStimCount) - 1;
+ int sweep_index = sweep->extractInt32(SwSweepCount) - 1;
+ const auto& stim_node = datfile->GetPgfTree().GetRootNode().Children.at(stim_index);
+ std::stringstream s;
+ s << "Stimulation record #" << (stim_index + 1) << " (sweep #" << (sweep_index+1) << "):\n";
+ formatParamListPrint(stim_node, parametersStimulation, s);
+ const auto Nch = stim_node.Children.size();
+ for (std::size_t i = 0; i < Nch; ++i) {
+ s << "\nChannel record #" << (i + 1) << '\n';
+ const auto& ch_node = stim_node.Children.at(i);
+ formatParamListPrint(ch_node, parametersChannel, s);
+ const auto& Nsegments = ch_node.Children.size();
+ for (std::size_t j = 0; j < Nsegments; ++j) {
+ s << "\nCh#" << (i + 1) << ", Segment record #" << (j + 1) << '\n';
+ formatParamListPrint(ch_node.Children.at(j), parametersStimSegment, s);
+ }
+ }
+ ui->textEdit->append(QString::fromUtf8(s.str()));
+ } catch(const std::exception& e){
+ QMessageBox::warning(this,"Error","Error while printing list:\n" + QString::fromUtf8(e.what()));
+ }
+}
+
void PMbrowserWindow::create_stim_trace(const hkTreeNode* sweep, DisplayTrace& dt) const
{
assert(sweep->getLevel() == hkTreeNode::LevelSweep);
@@ -1240,6 +1275,26 @@ void PMbrowserWindow::saveSettings()
settings.setValue(p.name, p.toInt());
}
settings.endGroup();
+ settings.beginGroup("params_ampstate");
+ for (const auto& p : parametersAmpplifierState) {
+ settings.setValue(p.name, p.toInt());
+ }
+ settings.endGroup();
+ settings.beginGroup("params_stimulation");
+ for (const auto& p : parametersStimulation) {
+ settings.setValue(p.name, p.toInt());
+ }
+ settings.endGroup();
+ settings.beginGroup("params_channel");
+ for (const auto& p : parametersChannel) {
+ settings.setValue(p.name, p.toInt());
+ }
+ settings.endGroup();
+ settings.beginGroup("params_stimsegment");
+ for (const auto& p : parametersStimSegment) {
+ settings.setValue(p.name, p.toInt());
+ }
+ settings.endGroup();
}
@@ -1280,6 +1335,26 @@ void PMbrowserWindow::loadSettings()
p.fromInt(settings.value(p.name, p.toInt()).toInt());
}
settings.endGroup();
+ settings.beginGroup("params_ampstate");
+ for (auto& p : parametersAmpplifierState) {
+ p.fromInt(settings.value(p.name, p.toInt()).toInt());
+ }
+ settings.endGroup();
+ settings.beginGroup("params_stimulation");
+ for (auto& p : parametersStimulation) {
+ p.fromInt(settings.value(p.name, p.toInt()).toInt());
+ }
+ settings.endGroup();
+ settings.beginGroup("params_channel");
+ for (auto& p : parametersChannel) {
+ p.fromInt(settings.value(p.name, p.toInt()).toInt());
+ }
+ settings.endGroup();
+ settings.beginGroup("params_stimsegment");
+ for (auto& p : parametersStimSegment) {
+ p.fromInt(settings.value(p.name, p.toInt()).toInt());
+ }
+ settings.endGroup();
settings.beginGroup("Preferences");
int t = settings.value("selectionButton", 0).toInt();
diff --git a/QtPMbrowser/pmbrowserwindow.h b/QtPMbrowser/pmbrowserwindow.h
index 6ac6b92..90021c0 100644
--- a/QtPMbrowser/pmbrowserwindow.h
+++ b/QtPMbrowser/pmbrowserwindow.h
@@ -88,6 +88,7 @@ public slots:
void printAllParameters(const QTreeWidgetItem* item);
void printAllParameters(const hkLib::hkTreeNode* node);
void printAmplifierState(const hkLib::hkTreeNode* series);
+ void printStimProtocol(const hkLib::hkTreeNode* sweep);
void drawStimulus(const hkLib::hkTreeNode* sweep);
void useStimAsX(const hkLib::hkTreeNode* sweep);
void drawStimuliSeries(const hkLib::hkTreeNode* sweep);
diff --git a/cmdline_tools/stimtree_explorer.cpp b/cmdline_tools/stimtree_explorer.cpp
index 1f0e014..ed839d2 100644
--- a/cmdline_tools/stimtree_explorer.cpp
+++ b/cmdline_tools/stimtree_explorer.cpp
@@ -27,12 +27,7 @@
using namespace hkLib;
void do_exploring(const hkTreeNode& root, int index, int ch) {
- //std::array params{};
- //char paramNames[10][32]{};
- for (size_t i = 0; i < 10; ++i) {
- std::cout << "p" << (i + 1) << " " << root.extractLongReal(i * 8 + 48)
- << ", p-name: " << root.getString(128 + i * 32) << "\n";
- }
+ formatParamListExportIBW(root,parametersStimRoot,std::cout);
std::cout << "\nNum stim entries : " << root.Children.size() << '\n';
const auto& stim_node = root.Children.at(index);
StimulationRecord stim{ stim_node };
@@ -40,12 +35,14 @@ void do_exploring(const hkTreeNode& root, int index, int ch) {
<< "\nstartSegment: " << stim.DataStartSegment
<< ", start time: " << stim.DataStartTime << '\n'
<< "num ch: " << stim.Channels.size() << ", actual DAC channels: " << stim.ActualDacChannels << '\n';
+ formatParamListExportIBW(stim_node,parametersStimulation,std::cout);
const auto& ch_node = stim.Channels.at(ch);
std::cout << "ch# (from 0):" << ch //<< "\ndac ch: " << ch_node.DacChannel
<< " mode: " << ch_node.DacMode << '\n' << "Linked: " << ch_node.LinkedChannel
//<< "adc ch: " << ch_node.extractValue(chAdcChannel)
//<< " mode: " << static_cast(ch_node.getChar(chAdcMode)) << '\n'
<< "\n#segments: " << ch_node.Segments.size() << "\nexploring:\n";
+ formatParamListExportIBW(stim_node.Children.at(ch),parametersChannel,std::cout);
int count{};
for (const auto& segment : ch_node.Segments) {
std::cout << "\nsegment " << ++count << "\n";
@@ -105,4 +102,4 @@ int main(int argc, char** argv) {
}
}
return EXIT_SUCCESS;
-}
\ No newline at end of file
+}
diff --git a/hekatoolslib/PMparameters.cpp b/hekatoolslib/PMparameters.cpp
index 4c2131b..9ce76ca 100644
--- a/hekatoolslib/PMparameters.cpp
+++ b/hekatoolslib/PMparameters.cpp
@@ -23,14 +23,15 @@
#include
#include
#include
+#include
+#include "helpers.h"
#include "hkTree.h"
#include "PMparameters.h"
#include "time_handling.h"
-#include "DatFile.h"
namespace hkLib {
- const std::array RecordingModeNames = {
+ const std::array RecordingModeNames = {
"Inside-Out",
"On-Cell",
"Outside-Out",
@@ -40,7 +41,7 @@ namespace hkLib {
""
};
- const std::array AmpModeNames = {
+ const std::array AmpModeNames = {
"TestMode",
"VCMode",
"CCMode",
@@ -48,6 +49,34 @@ namespace hkLib {
};
+ constexpr std::array ExtTriggerTypeNames {
+ "TrigNone"sv,
+ "TrigSeries"sv,
+ "TrigSweep"sv,
+ "TrigSweepNoLea"sv
+ };
+
+ constexpr std::array AmplModeTypeNames{
+ "AnyAmplMode"sv,
+ "VCAmplMode"sv,
+ "CCAmplMode"sv,
+ "IDensityMode"sv
+ };
+ constexpr std::array AdcTypeNames {
+ "Off"sv,
+ "Analog"sv,
+ "Digitals"sv,
+ "Digital"sv,
+ "AdcVirtual"sv
+ };
+
+ std::array SegStoreTypeNames {
+ "SegNoStore"sv,
+ "SegStore"sv,
+ "SegStoreStart"sv,
+ "SegStoreEnd"sv
+ };
+
std::array parametersTrace{ {
{false,false,"TrMark","",PMparameter::Int32,0},
{false,false,"TrLabel","",PMparameter::String32,4},
@@ -184,10 +213,10 @@ namespace hkLib {
std::array parametersStimSegment{ {
{true, true, "seMark", "", PMparameter::Int32, 0},
- { true, true, "seClass", "", PMparameter::Byte ,4},
- { true, true, "seStoreKind", "", PMparameter::Byte, 5},
- { true,true,"seVoltageIncMode","",PMparameter::Byte,6},
- { true,true,"seDurationIncMode","",PMparameter::Byte,7},
+ { true, true, "seClass", "", PMparameter::StimSegmentClass ,4},
+ { true, true, "seStoreKind", "", PMparameter::SegStoreType, 5},
+ { true,true,"seVoltageIncMode","",PMparameter::StimIncrementMode,6},
+ { true,true,"seDurationIncMode","",PMparameter::StimIncrementMode,7},
{ true,true,"seVoltage","V",PMparameter::LongReal ,8},
{ true,true,"seVoltageSource","",PMparameter::Int32,16},
{ true,true,"seDeltaVFactor", "",PMparameter::LongReal, 20},
@@ -199,6 +228,119 @@ namespace hkLib {
{ true,true,"seScanRate","", PMparameter::LongReal, 72}
} };
+ std::array parametersChannel{ {
+ {true,true,"chMark","",PMparameter::Int32,0},
+ {true,true,"chLinkedChannel","",PMparameter::Int32, 4},
+ {true,true,"chCompressionFactor","",PMparameter::Int32, 8},
+ {true,true,"chYUnit","",PMparameter::String8, 12},
+ {true,true,"chAdcChannel","",PMparameter::Int16, 20},
+ {true,true,"chAdcMode","",PMparameter::AdcTypeName, 22},
+ {true,true,"chDoWrite","",PMparameter::Boolean, 23},
+ {true,true,"stLeakStore","",PMparameter::Byte, 24},
+ {true,true,"chAmplMode","",PMparameter::AmplModeType,25},
+ {true,true,"chOwnSegTime","",PMparameter::Boolean,26},
+ {true,true,"chSetLastSegVmemb","",PMparameter::Boolean,27},
+ {true,true,"chDacChannel","",PMparameter::Int16,28},
+ {true,true,"chDacMode","",PMparameter::AdcTypeName,30},
+ {true,true,"chHasLockInSquare","",PMparameter::Byte,31},
+ {true,true,"chRelevantXSegment","",PMparameter::Int32,32},
+ {true,true,"chRelevantYSegment","",PMparameter::Int32,36},
+ {true,true,"chDacUnit","",PMparameter::String8,40},
+ {true,true,"chHolding","",PMparameter::LongReal,48},
+ {true,true,"chLeakHolding","",PMparameter::LongReal,56},
+ {true,true,"chLeakSize","",PMparameter::LongReal,64},
+ {true,true,"chLeakHoldMode","",PMparameter::Byte,72},
+ {true,true,"chLeakAlternate","",PMparameter::Boolean,73},
+ {true,true,"chAltLeakAveraging","",PMparameter::Boolean,74},
+ {true,true,"chLeakPulseOn","",PMparameter::Boolean,75},
+ {true,true,"chStimToDacID","",PMparameter::Set16,76},
+ {true,true,"chCompressionMode","",PMparameter::Set16,78},
+ {true,true,"chCompressionSkip","",PMparameter::Int32,80},
+ {true,true,"chDacBit","",PMparameter::Int16,84},
+ {true,true,"chHasLockInSine","",PMparameter::Boolean,86},
+ {true,true,"chBreakMode","",PMparameter::Byte,87},
+ {true,true,"chZeroSeg","",PMparameter::Int32,88},
+ {true,true,"chStimSweep","",PMparameter::Int32,92},
+ {true,true,"chSine_Freq","Hz",PMparameter::InvLongReal,96},
+ {true,true,"chSine_Amplitude","V",PMparameter::LongReal,104},
+ {true,true,"chLockIn_VReversal","V",PMparameter::LongReal,112},
+ {true,true,"chChirp_StartFreq","Hz",PMparameter::LongReal,120},
+ {true,true,"chChirp_EndFreq","Hz",PMparameter::LongReal,128},
+ {true,true,"chChirp_MinPoints","",PMparameter::LongReal,136},
+ {true,true,"chSquare_NegAmpl","",PMparameter::LongReal,144},
+ {true,true,"chSquare_DurFactor","",PMparameter::LongReal,152},
+ {true,true,"chLockIn_Skip","",PMparameter::Int32,160},
+ {true,true,"chPhoto_MaxCycles","",PMparameter::Int32,164},
+ {true,true,"chPhoto_SegmentNo","",PMparameter::Int32,168},
+ {true,true,"chLockIn_AvgCycles","",PMparameter::Int32,172},
+ {true,true,"chImaging_RoiNo","",PMparameter::Int32,176},
+ {true,true,"chChirp_Skip","",PMparameter::Int32,180},
+ {true,true,"chChirp_Amplitude","",PMparameter::LongReal,184},
+ {true,true,"chPhoto_Adapt","",PMparameter::Byte,192},
+ {true,true,"chSine_Kind","",PMparameter::Byte,193},
+ {true,true,"chChirp_PreChirp","",PMparameter::Byte,194},
+ {true,true,"chSine_Source","",PMparameter::Byte,195},
+ {true,true,"chSquare_NegSource","",PMparameter::Byte,196},
+ {true,true,"chSquare_PosSource","",PMparameter::Byte,197},
+ {true,true,"chChirp_Kind","",PMparameter::Byte,198},
+ {true,true,"chChirp_Source","",PMparameter::Byte,199},
+ {true,true,"chDacOffset","",PMparameter::LongReal,200},
+ {true,true,"chAdcOffset","",PMparameter::LongReal,208},
+ {true,true,"chTraceMathFormat","",PMparameter::Byte,216},
+ {true,true,"chHasChirp","",PMparameter::Boolean,217},
+ {true,true,"chSquare_Kind","",PMparameter::Byte,218},
+ {true,true,"chSquare_BaseIncr","",PMparameter::LongReal,224},
+ {true,true,"chSquare_Cycle","",PMparameter::LongReal,232},
+ {true,true,"chSquare_PosAmpl","",PMparameter::LongReal,240},
+ {true,true,"chCompressionOffset","",PMparameter::Int32,248},
+ {true,true,"chPhotoMode","",PMparameter::Int32,252},
+ {true,true,"chBreakLevel","",PMparameter::LongReal,256},
+ {true,true,"chTraceMath","",PMparameter::String128,264}
+ } };
+
+ std::array parametersStimulation{ {
+ {true,true,"stMark","",PMparameter::Int32,0},
+ {true,true,"stEntryName","",PMparameter::String32,4},
+ {true,true,"stFileName","",PMparameter::String32,36},
+ {true,true,"stAnalName","",PMparameter::String32,68},
+ {true,true,"stDataStartSegment","",PMparameter::Int32,100},
+ {true,true,"stDataStartTime","s",PMparameter::LongReal,104},
+ {true,true,"stSampleInterval","s",PMparameter::LongReal,112},
+ {true,true,"stSweepInterval","s",PMparameter::LongReal,120},
+ {true,true,"stLeakDelay","s",PMparameter::LongReal,128},
+ {true,true,"stFilterFactor","",PMparameter::LongReal,136},
+ {true,true,"stNumberSweeps","",PMparameter::Int32,144},
+ {true,true,"stNumberLeaks","",PMparameter::Int32,148},
+ {true,true,"stNumberAverages","",PMparameter::Int32,152},
+ {true,true,"stActualAdcChannels","",PMparameter::Int32,156},
+ {true,true,"stActualDacChannels","",PMparameter::Int32,160},
+ {true,true,"stExtTrigger","",PMparameter::ExtTriggerTypeName,164},
+ {true,true,"stNoStartWait","",PMparameter::Boolean,165},
+ {true,true,"stUseScanRates","",PMparameter::Boolean,166},
+ {true,true,"stNoContAq","",PMparameter::Boolean,167},
+ {true,true,"stHasLockIn","",PMparameter::Boolean,168},
+ {true,true,"stOldStartMacKind","",PMparameter::Char,169},
+ {true,true,"stOldEndMacKind","",PMparameter::Boolean,170},
+ {true,true,"stAutoRange","",PMparameter::Byte,171},
+ {true,true,"stBreakNext","",PMparameter::Boolean,172},
+ {true,true,"stIsExpanded","",PMparameter::Boolean,173},
+ {true,true,"stLeakCompMode","",PMparameter::Boolean,174},
+ {true,true,"stHasChirp","",PMparameter::Boolean,175},
+ {true,true,"stOldStartMacro","",PMparameter::String32,176},
+ {true,true,"stOldEndMacro","",PMparameter::String32,208},
+ {true,true,"sIsGapFree","",PMparameter::Boolean,240},
+ {true,true,"sHandledExternally","",PMparameter::Boolean,241}
+ } };
+
+ std::array parametersStimRoot{ {
+ {true,true,"roVersion","",PMparameter::Int32,0},
+ {true,true,"roMark","",PMparameter::Int32,4},
+ {true,true,"roVersionName","",PMparameter::String32,8},
+ {true,true,"roMaxSamples","",PMparameter::Int32,40},
+ {true,true,"roParams","",PMparameter::LongReal10,48},
+ {true,true,"roParamText","",PMparameter::StringArray10x32,128}
+ } };
+
constexpr char list_seperator{ ';' };
void PMparameter::formatValueOnly(const hkTreeNode& node, std::ostream& ss) const
@@ -207,6 +349,7 @@ namespace hkLib {
try {
switch (data_type) {
case Byte:
+ case Char:
{
auto c = node.extractValueOpt(offset);
if (c) {
@@ -325,9 +468,19 @@ namespace hkLib {
case String80:
ss << iso_8859_1_to_utf8(node.getString<80>(offset));
break;
+ case String128:
+ ss << iso_8859_1_to_utf8(node.getString<128>(offset));
+ break;
case String400:
ss << iso_8859_1_to_utf8(node.getString<400>(offset));
break;
+ case StringArray10x32:
+ ss << '(';
+ for(int i=0;i<10;++i){
+ ss << '"' << iso_8859_1_to_utf8(node.getString<32>(offset+i*32)) << '"' << list_seperator;
+ }
+ ss << ')';
+ break;
case Boolean:
ss << std::boolalpha << bool(node.getChar(offset));
break;
@@ -383,6 +536,20 @@ namespace hkLib {
}
ss << ")";
break;
+ case LongReal10:
+ ss << "(";
+ for (std::size_t i = 0; i < 10; ++i) {
+ auto v = node.extractValueOpt(offset + 8 * i);
+ if (v) {
+ ss << *v << list_seperator;
+ }
+ else {
+ ss << "n/a";
+ break;
+ }
+ }
+ ss << ")";
+ break;
case LongReal16:
ss << "(";
for (std::size_t i = 0; i < 16; ++i) {
@@ -408,6 +575,27 @@ namespace hkLib {
case AmpModeName:
ss << AmpModeNames.at(static_cast(node.getChar(offset)));
break;
+ case StimIncrementMode:
+ ss << IncrementModeNames.at(static_cast(node.getChar(offset)));
+ break;
+ case ExtTriggerTypeName:
+ ss << ExtTriggerTypeNames.at(static_cast(node.getChar(offset)));
+ break;
+ case AmplModeType:
+ ss << AmplModeTypeNames.at(static_cast(node.getChar(offset)));
+ break;
+ case AdcTypeName:
+ ss << AdcTypeNames.at(static_cast(node.getChar(offset)));
+ break;
+ case SegStoreType:
+ ss << SegStoreTypeNames.at(static_cast(node.getChar(offset)));
+ break;
+ case StimSegmentClass:
+ {
+ auto index = static_cast(node.getChar(offset));
+ ss << SegmentClassNames.at(index);
+ }
+ break;
case UserParamDesc8: {
formatUserParamDesc<8>(node, offset, ss);
}
diff --git a/hekatoolslib/PMparameters.h b/hekatoolslib/PMparameters.h
index 8847fc7..9bdee99 100644
--- a/hekatoolslib/PMparameters.h
+++ b/hekatoolslib/PMparameters.h
@@ -25,13 +25,17 @@
#include
#include
#include
+#include
#include "hkTree.h"
+using namespace std::string_view_literals;
+
namespace hkLib {
struct PMparameter {
enum data_types {
- Byte,
+ Byte,
+ Char,
Int16,
UInt16,
Set16, // for bitfields
@@ -44,8 +48,10 @@ namespace hkLib {
String8, // String of length 8
String16,
String32,
+ String128,
String80,
String400,
+ StringArray10x32, // arry of 10 strings, each 32 bytes long
Boolean,
Set16_Bit5, // check if bit 5 is set
InvLongReal, // invert double found in file, useful if e.g. conductance is given but we want resistance
@@ -53,13 +59,21 @@ namespace hkLib {
LongReal4, // array of 4 doubles
LongReal8, // array of 8 double
LongReal16, // 16 double
+ LongReal10,
RecordingMode,
+ StimIncrementMode,
+ StimSegmentClass,
RelativeTime,
AmpModeName,
+ ExtTriggerTypeName,
+ AmplModeType,
+ AdcTypeName,
+ SegStoreType,
UserParamDesc4, // 4x UserParamDesc
UserParamDesc2,
UserParamDesc8
};
+
bool exportIBW, print;
const char* const name;
const char* const unit;
@@ -108,10 +122,13 @@ namespace hkLib {
extern std::arrayparametersAmpplifierState;
- extern const std::arrayRecordingModeNames;
- extern const std::array AmpModeNames;
+ extern const std::arrayRecordingModeNames;
+ extern const std::array AmpModeNames;
extern std::array parametersStimSegment;
+ extern std::array parametersChannel;
+ extern std::array parametersStimulation;
+ extern std::array parametersStimRoot;
///
/// Format parameters stored in node n using
@@ -132,15 +149,21 @@ namespace hkLib {
}
template void formatParamListPrint(const hkTreeNode& n,
- const std::array& ar, std::string& str)
+ const std::array& ar, std::ostream& ss)
{
- std::stringstream ss;
for (const PMparameter& p : ar) {
if (p.print) {
p.format(n, ss);
ss << "\n";
}
}
+ }
+
+ template void formatParamListPrint(const hkTreeNode& n,
+ const std::array& ar, std::string& str)
+ {
+ std::stringstream ss;
+ formatParamListPrint(n, ar, ss);
str = ss.str();
}
diff --git a/hekatoolslib/hkTree.h b/hekatoolslib/hkTree.h
index 4556d0a..5479551 100644
--- a/hekatoolslib/hkTree.h
+++ b/hekatoolslib/hkTree.h
@@ -274,10 +274,13 @@ namespace hkLib {
}
enum TreeLevel {
LevelRoot = 0,
- LevelGroup = 1,
+ LevelGroup = 1, // for pul tree
LevelSeries = 2,
LevelSweep = 3,
- LevelTrace = 4
+ LevelTrace = 4,
+ StimulationLevel = 1, // for stim / pgf tree
+ ChannelLevel = 2,
+ StimSegmentLevel = 3
};
int32_t extractInt32(std::size_t offset) const { return extractValue(offset); };
uint16_t extractUInt16(std::size_t offset) const { return extractValue(offset); };