Removed warnings
This commit is contained in:
parent
c00d00cac2
commit
6d445631f0
@ -479,19 +479,19 @@ AmplitudeModel::AmplitudeModel(AmplitudeCalDialog *c) :
|
||||
{
|
||||
}
|
||||
|
||||
int AmplitudeModel::rowCount(const QModelIndex &parent) const
|
||||
int AmplitudeModel::rowCount(const QModelIndex &) const
|
||||
{
|
||||
return c->getPoints().size();
|
||||
}
|
||||
|
||||
int AmplitudeModel::columnCount(const QModelIndex &parent) const
|
||||
int AmplitudeModel::columnCount(const QModelIndex &) const
|
||||
{
|
||||
return ColIndexLast;
|
||||
}
|
||||
|
||||
QVariant AmplitudeModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if(role == Qt::DisplayRole && index.row() < c->getPoints().size()) {
|
||||
if(role == Qt::DisplayRole && static_cast<unsigned int>(index.row()) < c->getPoints().size()) {
|
||||
auto p = c->getPoints()[index.row()];
|
||||
switch(index.column()) {
|
||||
case ColIndexFreq:
|
||||
@ -519,7 +519,7 @@ QVariant AmplitudeModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
bool AmplitudeModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
bool AmplitudeModel::setData(const QModelIndex &index, const QVariant &value, int)
|
||||
{
|
||||
if((unsigned int) index.row() >= c->getPoints().size()) {
|
||||
return false;
|
||||
|
@ -20,7 +20,7 @@ static const std::vector<double> E96 = {
|
||||
|
||||
double ESeries::ToESeries(double value, ESeries::Series s, ESeries::Type t)
|
||||
{
|
||||
if(s == Series::Ideal) {
|
||||
if(s == Series::Ideal || value <= 0) {
|
||||
// nothing to do
|
||||
return value;
|
||||
}
|
||||
@ -45,7 +45,7 @@ double ESeries::ToESeries(double value, ESeries::Series s, ESeries::Type t)
|
||||
if(index < series.size()) {
|
||||
higher = series[index];
|
||||
}
|
||||
double approximation;
|
||||
double approximation = 0;
|
||||
switch(t) {
|
||||
case Type::Lower: approximation = lower; break;
|
||||
case Type::Higher: approximation = higher; break;
|
||||
|
@ -111,7 +111,7 @@ void ImpedanceMatchDialog::calculateMatch()
|
||||
// convert X and B to inductor and capacitor
|
||||
bool twoCs = false;
|
||||
bool twoLs = false;
|
||||
double L, C, C2, L2;
|
||||
double L = 0, C = 0, C2 = 0, L2 = 0;
|
||||
if(X >= 0) {
|
||||
L = X/(2*M_PI*freq);
|
||||
if(B > 0) {
|
||||
|
@ -110,8 +110,8 @@ void TraceEditDialog::on_buttonBox_accepted()
|
||||
auto t = ui->touchstoneImport->getTouchstone();
|
||||
trace.fillFromTouchstone(t, ui->CParameter->currentIndex(), ui->touchstoneImport->getFilename());
|
||||
} else {
|
||||
Trace::LivedataType type;
|
||||
Trace::LiveParameter param;
|
||||
Trace::LivedataType type = Trace::LivedataType::Overwrite;
|
||||
Trace::LiveParameter param = Trace::LiveParameter::S11;
|
||||
switch(ui->CLiveType->currentIndex()) {
|
||||
case 0: type = Trace::LivedataType::Overwrite; break;
|
||||
case 1: type = Trace::LivedataType::MaxHold; break;
|
||||
|
@ -80,14 +80,14 @@ void TraceExportDialog::on_buttonBox_accepted()
|
||||
}
|
||||
t.AddDatapoint(tData);
|
||||
}
|
||||
Touchstone::Unit unit;
|
||||
Touchstone::Unit unit = Touchstone::Unit::GHz;
|
||||
switch(ui->cUnit->currentIndex()) {
|
||||
case 0: unit = Touchstone::Unit::Hz; break;
|
||||
case 1: unit = Touchstone::Unit::kHz; break;
|
||||
case 2: unit = Touchstone::Unit::MHz; break;
|
||||
case 3: unit = Touchstone::Unit::GHz; break;
|
||||
}
|
||||
Touchstone::Format format;
|
||||
Touchstone::Format format = Touchstone::Format::RealImaginary;
|
||||
switch(ui->cFormat->currentIndex()) {
|
||||
case 0: format = Touchstone::Format::DBAngle; break;
|
||||
case 1: format = Touchstone::Format::MagnitudeAngle; break;
|
||||
|
@ -268,7 +268,7 @@ TraceMarker *TraceMarkerModel::markerFromIndex(const QModelIndex &index) const
|
||||
}
|
||||
}
|
||||
|
||||
QSize MarkerTraceDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
QSize MarkerTraceDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const
|
||||
{
|
||||
return QSize(0, rowHeight);
|
||||
}
|
||||
@ -307,12 +307,12 @@ void MarkerTraceDelegate::setModelData(QWidget *editor, QAbstractItemModel *mode
|
||||
markerModel->setData(index, c->itemData(c->currentIndex()));
|
||||
}
|
||||
|
||||
QSize MarkerSettingsDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
QSize MarkerSettingsDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const
|
||||
{
|
||||
return QSize(0, rowHeight);
|
||||
}
|
||||
|
||||
QWidget *MarkerSettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
QWidget *MarkerSettingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const
|
||||
{
|
||||
auto marker = static_cast<const TraceMarkerModel*>(index.model())->markerFromIndex(index);
|
||||
marker->editingFrequeny = true;
|
||||
@ -331,17 +331,16 @@ QWidget *MarkerSettingsDelegate::createEditor(QWidget *parent, const QStyleOptio
|
||||
void MarkerSettingsDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||
{
|
||||
auto markerModel = (TraceMarkerModel*) model;
|
||||
auto marker = markerModel->markerFromIndex(index);
|
||||
auto si = (SIUnitEdit*) editor;
|
||||
markerModel->setData(index, si->value());
|
||||
}
|
||||
|
||||
QSize MarkerTypeDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
QSize MarkerTypeDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const
|
||||
{
|
||||
return QSize(0, rowHeight);
|
||||
}
|
||||
|
||||
QWidget *MarkerTypeDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
QWidget *MarkerTypeDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const
|
||||
{
|
||||
auto marker = static_cast<const TraceMarkerModel*>(index.model())->markerFromIndex(index);
|
||||
auto editor = marker->getTypeEditor(const_cast<MarkerTypeDelegate*>(this));
|
||||
@ -350,7 +349,7 @@ QWidget *MarkerTypeDelegate::createEditor(QWidget *parent, const QStyleOptionVie
|
||||
return editor;
|
||||
}
|
||||
|
||||
void MarkerTypeDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||
void MarkerTypeDelegate::setModelData(QWidget *editor, QAbstractItemModel *, const QModelIndex &index) const
|
||||
{
|
||||
auto marker = static_cast<const TraceMarkerModel*>(index.model())->markerFromIndex(index);
|
||||
marker->updateTypeFromEditor(editor);
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "traceplot.h"
|
||||
#include <QPen>
|
||||
#include <QPainterPath>
|
||||
|
||||
class TraceSmithChart : public TracePlot
|
||||
{
|
||||
|
@ -449,7 +449,8 @@ void TraceXYPlot::updateXAxis()
|
||||
auto trace = t.first;
|
||||
if(enabled && trace->isVisible()) {
|
||||
// this trace is currently displayed
|
||||
double trace_min, trace_max;
|
||||
double trace_min = std::numeric_limits<double>::max();
|
||||
double trace_max = std::numeric_limits<double>::lowest();
|
||||
switch(XAxis.type) {
|
||||
case XAxisType::Frequency:
|
||||
trace_min = trace->minFreq();
|
||||
|
@ -14,4 +14,5 @@ int main(int argc, char *argv[]) {
|
||||
vna.resize(1280, 800);
|
||||
vna.show();
|
||||
a.exec();
|
||||
return 0;
|
||||
}
|
||||
|
@ -152,7 +152,8 @@ static Protocol::Datapoint DecodeDatapoint(uint8_t *buf) {
|
||||
}
|
||||
static int16_t EncodeDatapoint(Protocol::Datapoint d, uint8_t *buf,
|
||||
uint16_t bufSize) {
|
||||
// Special case, bypassing the encoder for speed optimizations.
|
||||
(void) bufSize;
|
||||
// Special case, bypassing the encoder for speed optimizations.
|
||||
// The datapoint is only ever encoded on the device and the
|
||||
// Protocol::Datapoint struct is setup without any padding between
|
||||
// the variables. In this case it is allowed to simply copy its
|
||||
|
Loading…
Reference in New Issue
Block a user