Skip to content

Commit

Permalink
Checkpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
epasveer committed Nov 22, 2024
1 parent b7b02e8 commit affe181
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 26 deletions.
45 changes: 35 additions & 10 deletions src/SeerArrayVisualizerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@
SeerArrayVisualizerWidget::SeerArrayVisualizerWidget (QWidget* parent) : QWidget(parent) {

// Init variables.
_aVariableId = Seer::createID(); // Create two id's for queries.
_aVariableId = Seer::createID(); // Create id's for A queries.
_aMemoryId = Seer::createID();
_aOffsetId = Seer::createID();
_aStrideId = Seer::createID();

_bVariableId = Seer::createID(); // Create two id's for queries.
_bVariableId = Seer::createID(); // Create id's for B queries.
_bMemoryId = Seer::createID();
_bOffsetId = Seer::createID();
_bStrideId = Seer::createID();

_aSeries = 0;
_bSeries = 0;
Expand Down Expand Up @@ -73,14 +77,16 @@ SeerArrayVisualizerWidget::SeerArrayVisualizerWidget (QWidget* parent) : QWidget
QObject::connect(aRefreshToolButton, &QToolButton::clicked, this, &SeerArrayVisualizerWidget::handleaRefreshButton);
QObject::connect(bRefreshToolButton, &QToolButton::clicked, this, &SeerArrayVisualizerWidget::handlebRefreshButton);
QObject::connect(helpToolButton, &QToolButton::clicked, this, &SeerArrayVisualizerWidget::handleHelpButton);
QObject::connect(aArrayLengthLineEdit, &QLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handleaRefreshButton);
QObject::connect(bArrayLengthLineEdit, &QLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handlebRefreshButton);
QObject::connect(aArrayOffsetLineEdit, &QLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handleaRefreshButton);
QObject::connect(bArrayOffsetLineEdit, &QLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handlebRefreshButton);
QObject::connect(aArrayStrideLineEdit, &QLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handleaRefreshButton);
QObject::connect(bArrayStrideLineEdit, &QLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handlebRefreshButton);
QObject::connect(aVariableNameLineEdit, &QLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handleaVariableNameLineEdit);
QObject::connect(bVariableNameLineEdit, &QLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handlebVariableNameLineEdit);
QObject::connect(aVariableNameLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handleaVariableNameLineEdit);
QObject::connect(aVariableNameLineEdit, &SeerHistoryLineEdit::editingFinished, this, &SeerArrayVisualizerWidget::handleaVariableNameLineEdit);
QObject::connect(bVariableNameLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handlebVariableNameLineEdit);
QObject::connect(bVariableNameLineEdit, &SeerHistoryLineEdit::editingFinished, this, &SeerArrayVisualizerWidget::handlebVariableNameLineEdit);
QObject::connect(aArrayLengthLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handleaRefreshButton);
QObject::connect(bArrayLengthLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handlebRefreshButton);
QObject::connect(aArrayOffsetLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handleaRefreshButton);
QObject::connect(bArrayOffsetLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handlebRefreshButton);
QObject::connect(aArrayStrideLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handleaRefreshButton);
QObject::connect(bArrayStrideLineEdit, &SeerHistoryLineEdit::returnPressed, this, &SeerArrayVisualizerWidget::handlebRefreshButton);
QObject::connect(aArrayDisplayFormatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerArrayVisualizerWidget::handleaArrayDisplayFormatComboBox);
QObject::connect(bArrayDisplayFormatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerArrayVisualizerWidget::handlebArrayDisplayFormatComboBox);
QObject::connect(aAxisComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerArrayVisualizerWidget::handleaAxisComboBox);
Expand Down Expand Up @@ -554,6 +560,25 @@ void SeerArrayVisualizerWidget::handlebVariableNameLineEdit () {
setBVariableName (bVariableNameLineEdit->text());
}

void SeerArrayVisualizerWidget::handleaElementLengthLineEdit () {
}

void SeerArrayVisualizerWidget::handlebElementLengthLineEdit () {
}

void SeerArrayVisualizerWidget::handleaElementOffsetLineEdit () {
}

void SeerArrayVisualizerWidget::handlebElementOffsetLineEdit () {
}

void SeerArrayVisualizerWidget::handleaElementStrideLineEdit () {
}

void SeerArrayVisualizerWidget::handlebElementStrideLineEdit () {
}


void SeerArrayVisualizerWidget::handleaArrayDisplayFormatComboBox (int index) {

//qDebug() << index;
Expand Down
10 changes: 10 additions & 0 deletions src/SeerArrayVisualizerWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ class SeerArrayVisualizerWidget : public QWidget, protected Ui::SeerArrayVisuali
void handleHelpButton ();
void handleaVariableNameLineEdit ();
void handlebVariableNameLineEdit ();
void handleaElementLengthLineEdit ();
void handlebElementLengthLineEdit ();
void handleaElementOffsetLineEdit ();
void handlebElementOffsetLineEdit ();
void handleaElementStrideLineEdit ();
void handlebElementStrideLineEdit ();
void handleaArrayDisplayFormatComboBox (int index);
void handlebArrayDisplayFormatComboBox (int index);
void handleaAxisComboBox (int index);
Expand Down Expand Up @@ -62,5 +68,9 @@ class SeerArrayVisualizerWidget : public QWidget, protected Ui::SeerArrayVisuali
int _bVariableId;
int _aMemoryId;
int _bMemoryId;
int _aOffsetId;
int _bOffsetId;
int _aStrideId;
int _bStrideId;
};

26 changes: 13 additions & 13 deletions src/SeerArrayVisualizerWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="5">
<widget class="QHistoryLineEdit" name="aArrayStrideLineEdit">
<widget class="SeerHistoryLineEdit" name="aArrayStrideLineEdit">
<property name="toolTip">
<string>Element stride between values. (default=1)</string>
</property>
Expand Down Expand Up @@ -80,7 +80,7 @@
</widget>
</item>
<item row="1" column="5">
<widget class="QHistoryLineEdit" name="bArrayStrideLineEdit">
<widget class="SeerHistoryLineEdit" name="bArrayStrideLineEdit">
<property name="toolTip">
<string>Element stride between values. (default=1)</string>
</property>
Expand All @@ -96,7 +96,7 @@
</widget>
</item>
<item row="1" column="3">
<widget class="QHistoryLineEdit" name="bArrayLengthLineEdit">
<widget class="SeerHistoryLineEdit" name="bArrayLengthLineEdit">
<property name="toolTip">
<string>Total number of elements in array.</string>
</property>
Expand All @@ -112,7 +112,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QHistoryLineEdit" name="bVariableNameLineEdit">
<widget class="SeerHistoryLineEdit" name="bVariableNameLineEdit">
<property name="toolTip">
<string>Variable name or expression.</string>
</property>
Expand All @@ -139,7 +139,7 @@
</widget>
</item>
<item row="0" column="4">
<widget class="QHistoryLineEdit" name="aArrayOffsetLineEdit">
<widget class="SeerHistoryLineEdit" name="aArrayOffsetLineEdit">
<property name="toolTip">
<string>Element offset into array. (default=0)</string>
</property>
Expand All @@ -158,7 +158,7 @@
</widget>
</item>
<item row="0" column="3">
<widget class="QHistoryLineEdit" name="aArrayLengthLineEdit">
<widget class="SeerHistoryLineEdit" name="aArrayLengthLineEdit">
<property name="toolTip">
<string>Total number of elements in array.</string>
</property>
Expand Down Expand Up @@ -221,7 +221,7 @@
</widget>
</item>
<item row="0" column="2">
<widget class="QHistoryLineEdit" name="aVariableAddressLineEdit">
<widget class="QLineEdit" name="aVariableAddressLineEdit">
<property name="toolTip">
<string>Variable address.</string>
</property>
Expand All @@ -237,7 +237,7 @@
</widget>
</item>
<item row="1" column="4">
<widget class="QHistoryLineEdit" name="bArrayOffsetLineEdit">
<widget class="SeerHistoryLineEdit" name="bArrayOffsetLineEdit">
<property name="toolTip">
<string>Element offset into array. (default=0)</string>
</property>
Expand All @@ -256,7 +256,7 @@
</widget>
</item>
<item row="1" column="2">
<widget class="QHistoryLineEdit" name="bVariableAddressLineEdit">
<widget class="QLineEdit" name="bVariableAddressLineEdit">
<property name="toolTip">
<string>Variable address.</string>
</property>
Expand Down Expand Up @@ -286,7 +286,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QHistoryLineEdit" name="aVariableNameLineEdit">
<widget class="SeerHistoryLineEdit" name="aVariableNameLineEdit">
<property name="toolTip">
<string>Variable name or expression.</string>
</property>
Expand Down Expand Up @@ -377,7 +377,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QHistoryLineEdit" name="titleLineEdit">
<widget class="SeerHistoryLineEdit" name="titleLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -514,9 +514,9 @@
<header location="global">QZoomChartView.h</header>
</customwidget>
<customwidget>
<class>QHistoryLineEdit</class>
<class>SeerHistoryLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">QHistoryLineEdit.h</header>
<header location="global">SeerHistoryLineEdit.h</header>
</customwidget>
</customwidgets>
<tabstops>
Expand Down
9 changes: 6 additions & 3 deletions tests/helloarray/helloarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ int main (void) {
float phaseIncrement = two_pi/table_size;
float currentPhase = 0.0;

float* sine_array = (float*)malloc(table_size*sizeof(float));
float* sin_array = (float*)malloc(table_size*sizeof(float));
float* cos_array = (float*)malloc(table_size*sizeof(float));

for (int i = 0; i < 512; i ++){

sine_array[i] = sin(currentPhase);
sin_array[i] = sin(currentPhase);
cos_array[i] = cos(currentPhase);

currentPhase += phaseIncrement;
}
Expand All @@ -79,7 +81,8 @@ int main (void) {
free(array);
free(int_array);
free(float_array);
free(sine_array);
free(sin_array);
free(cos_array);
free(x);

return 0;
Expand Down

0 comments on commit affe181

Please sign in to comment.