Merge pull request #970 from srcejon/antennatools_surface_error

Antenna Tools: Add surface error parameter for dish gain calculation
pull/974/head
Edouard Griffiths 2021-07-24 09:58:01 +02:00 zatwierdzone przez GitHub
commit 147e3881e6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
6 zmienionych plików z 203 dodań i 139 usunięć

Wyświetl plik

@ -157,6 +157,7 @@ void AntennaToolsGUI::displaySettings()
ui->dishDepth->setValue(m_settings.m_dishDepth);
ui->dishLengthUnits->setCurrentIndex((int)m_settings.m_dishLengthUnits);
ui->dishEfficiency->setValue(m_settings.m_dishEfficiency);
ui->dishSurfaceError->setValue(m_settings.m_dishSurfaceError);
blockApplySettings(false);
calcDipoleLength();
calcDishFocalLength();
@ -372,6 +373,17 @@ double AntennaToolsGUI::dishLengthMetres(double length) const
}
}
double AntennaToolsGUI::dishMetresToLength(double m) const
{
if (m_settings.m_dishLengthUnits == AntennaToolsSettings::CM) {
return m * 100.0;
} else if (m_settings.m_dishLengthUnits == AntennaToolsSettings::M) {
return m;
} else {
return Units::metresToFeet(m);
}
}
double AntennaToolsGUI::dishDiameterMetres() const
{
return dishLengthMetres(m_settings.m_dishDiameter);
@ -382,11 +394,16 @@ double AntennaToolsGUI::dishDepthMetres() const
return dishLengthMetres(m_settings.m_dishDepth);
}
double AntennaToolsGUI::dishSurfaceErrorMetres() const
{
return dishLengthMetres(m_settings.m_dishSurfaceError);
}
void AntennaToolsGUI::calcDishFocalLength()
{
double d = dishDiameterMetres();
double focalLength = d * d / (16.0 * dishDepthMetres());
ui->dishFocalLength->setValue(focalLength);
ui->dishFocalLength->setValue(dishMetresToLength(focalLength));
double fd = focalLength / d;
ui->dishFD->setValue(fd);
}
@ -401,6 +418,9 @@ void AntennaToolsGUI::calcDishGain()
{
double t = M_PI * dishDiameterMetres() / dishLambda();
double gainDB = 10.0 * log10((m_settings.m_dishEfficiency/100.0) * (t*t));
// Adjust for surface error using Ruze's equation
t = dishSurfaceErrorMetres() / dishLambda();
gainDB = gainDB - 685.81 * t * t;
ui->dishGain->setValue(gainDB);
}
@ -458,6 +478,13 @@ void AntennaToolsGUI::on_dishEfficiency_valueChanged(int value)
calcDishGain();
}
void AntennaToolsGUI::on_dishSurfaceError_valueChanged(double value)
{
m_settings.m_dishSurfaceError= value;
applySettings();
calcDishGain();
}
double AntennaToolsGUI::getDeviceSetFrequencyMHz(int index)
{
std::vector<DeviceSet*> deviceSets = MainCore::instance()->getDeviceSets();

Wyświetl plik

@ -76,9 +76,10 @@ private:
void calcDishGain();
double dishLambda() const;
double dishLengthMetres(double length) const;
double dishMetresToLength(double m) const;
double dishDiameterMetres() const;
double dishDepthMetres() const;
double dishSurfaceErrorMetres() const;
double getDeviceSetFrequencyMHz(int index);
private slots:
@ -94,6 +95,7 @@ private slots:
void on_dishLengthUnits_currentIndexChanged(int index);
void on_dishDepth_valueChanged(double value);
void on_dishEfficiency_valueChanged(int value);
void on_dishSurfaceError_valueChanged(double value);
void onMenuDialogCalled(const QPoint &p);
void onWidgetRolled(QWidget* widget, bool rollDown);
void handleInputMessages();

Wyświetl plik

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>377</width>
<height>461</height>
<height>499</height>
</rect>
</property>
<property name="sizePolicy">
@ -43,7 +43,7 @@
<x>16</x>
<y>19</y>
<width>351</width>
<height>431</height>
<height>451</height>
</rect>
</property>
<property name="sizePolicy">
@ -219,34 +219,21 @@
<string>Dish</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="dishBeamwidthLabel">
<property name="text">
<string>Beamwidth (°)</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="dishFD">
<property name="toolTip">
<string>Focal length to diameter ratio</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="dishDiameteLabel">
<item row="0" column="0">
<widget class="QLabel" name="dishFrequencyLabel">
<property name="text">
<string>Diameter</string>
<string>Frequency</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="3">
<item row="11" column="0" colspan="3">
<widget class="QLabel" name="dishImage">
<property name="text">
<string/>
@ -259,13 +246,6 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="dishFDLabel">
<property name="text">
<string>f/D</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="dishFrequencySelect">
<property name="sizePolicy">
@ -290,7 +270,21 @@
</item>
</widget>
</item>
<item row="9" column="1">
<item row="5" column="0">
<widget class="QLabel" name="dishFocalLengthLabel">
<property name="text">
<string>Focal length</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="dishEfficiencyLabel">
<property name="text">
<string>Efficiency (%)</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QDoubleSpinBox" name="dishGain">
<property name="toolTip">
<string>Dish gain</string>
@ -303,24 +297,126 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="dishEfficiency">
<property name="toolTip">
<string>Dish efficiency in percent</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="dishDepthLabel">
<property name="text">
<string>Depth</string>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="12" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QDoubleSpinBox" name="dishFocalLength">
<property name="toolTip">
<string>Focal length</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QDoubleSpinBox" name="dishBeamwidth">
<property name="toolTip">
<string>Halfpower (-3dB) beamwidth in degrees</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="dishDepth">
<property name="toolTip">
<string>Depth of the dish</string>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="dishGainLabel">
<property name="text">
<string>Gain (dB)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="dishFrequency">
<property name="toolTip">
<string>Frequency of operation</string>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="maximum">
<double>20000.000000000000000</double>
</property>
<property name="value">
<double>2400.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="dishDiameter">
<property name="toolTip">
<string>Diameter of the dish</string>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDoubleSpinBox" name="dishFD">
<property name="toolTip">
<string>Focal length to diameter ratio</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="dishDiameteLabel">
<property name="text">
<string>Diameter</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="dishFDLabel">
<property name="text">
<string>f/D</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QComboBox" name="dishLengthUnits">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -354,109 +450,33 @@
</item>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="dishGainLabel">
<property name="text">
<string>Gain (dB)</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QDoubleSpinBox" name="dishBeamwidth">
<item row="1" column="1">
<widget class="QSpinBox" name="dishEfficiency">
<property name="toolTip">
<string>Halfpower (-3dB) beamwidth in degrees</string>
</property>
<property name="readOnly">
<bool>true</bool>
<string>Dish efficiency in percent</string>
</property>
<property name="maximum">
<double>360.000000000000000</double>
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="dishEfficiencyLabel">
<item row="2" column="0">
<widget class="QLabel" name="dishSurfaceErrorLabel">
<property name="text">
<string>Efficiency (%)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="dishDepth">
<property name="toolTip">
<string>Depth of the dish</string>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="dishFrequency">
<property name="toolTip">
<string>Frequency of operation</string>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="maximum">
<double>20000.000000000000000</double>
</property>
<property name="value">
<double>2400.000000000000000</double>
</property>
</widget>
</item>
<item row="11" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="dishFrequencyLabel">
<property name="text">
<string>Frequency</string>
<string>Surface error</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="dishDiameter">
<widget class="QDoubleSpinBox" name="dishSurfaceError">
<property name="toolTip">
<string>Diameter of the dish</string>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="dishFocalLengthLabel">
<property name="text">
<string>Focal length</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="dishFocalLength">
<property name="toolTip">
<string>Focal length</string>
<string>RMS surface error (as a length)</string>
</property>
<property name="readOnly">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
<double>360.000000000000000</double>
</property>
</widget>
</item>
@ -482,9 +502,12 @@
<tabstop>dipoleEndEffectFactor</tabstop>
<tabstop>dishFrequency</tabstop>
<tabstop>dishFrequencySelect</tabstop>
<tabstop>dishEfficiency</tabstop>
<tabstop>dishSurfaceError</tabstop>
<tabstop>dishDiameter</tabstop>
<tabstop>dishLengthUnits</tabstop>
<tabstop>dishDepth</tabstop>
<tabstop>dishFocalLength</tabstop>
<tabstop>dishFD</tabstop>
<tabstop>dishBeamwidth</tabstop>
<tabstop>dishGain</tabstop>

Wyświetl plik

@ -41,6 +41,7 @@ void AntennaToolsSettings::resetToDefaults()
m_dishDepth = 30.0;
m_dishEfficiency = 60;
m_dishLengthUnits = CM;
m_dishSurfaceError = 0.0;
m_title = "Antenna Tools";
m_rgbColor = QColor(225, 25, 99).rgb();
@ -66,6 +67,7 @@ QByteArray AntennaToolsSettings::serialize() const
s.writeDouble(8, m_dishDepth);
s.writeS32(9, m_dishEfficiency);
s.writeS32(10, (int)m_dishLengthUnits);
s.writeDouble(18, m_dishSurfaceError);
s.writeString(11, m_title);
s.writeU32(12, m_rgbColor);
@ -105,6 +107,7 @@ bool AntennaToolsSettings::deserialize(const QByteArray& data)
d.readDouble(8, &m_dishDepth, 30.0);
d.readS32(9, &m_dishEfficiency, 60);
d.readS32(10, (int*)&m_dishLengthUnits, (int)CM);
d.readDouble(18, &m_dishSurfaceError, 0.0);
d.readString(11, &m_title, "Antenna Tools");
d.readU32(12, &m_rgbColor, QColor(225, 25, 99).rgb());

Wyświetl plik

@ -41,6 +41,7 @@ struct AntennaToolsSettings
double m_dishDepth;
int m_dishEfficiency;
LengthUnits m_dishLengthUnits;
double m_dishSurfaceError;
QString m_title;
quint32 m_rgbColor;

Wyświetl plik

@ -77,11 +77,17 @@ Select how the frequency is chosen:
Specifies the efficiency of the dish in %. When entered, the calculator will calculate the gain (16), according to the entered frequency (7) and dimensions (10 & 11).
<h3>10: Diameter</h3>
This value should include losses for things like spillover, illumination loss, feed and support blockage, focus errors.
When entering the diameter of the dish, the calculator will calculate the focal length (13), f/D ratio (14), beamwidth (15) and gain (16).
<h3>10: Surface Error</h3>
<h3>11: Dish Length Units</h3>
Specifies the RMS surface error of the dish in length units (as determined by (12)).
<h3>11: Diameter</h3>
When entering the diameter of the dish, the calculator will calculate the focal length (14), f/D ratio (15), beamwidth (16) and gain (17).
<h3>12: Dish Length Units</h3>
This field selects the units lengths are entered and displayed in. This can be:
@ -89,28 +95,30 @@ This field selects the units lengths are entered and displayed in. This can be:
* m - metres.
* feet - feet.
<h3>12: Depth</h3>
<h3>13: Depth</h3>
When entering the depth of the dish, the calculator will calculate the focal length (13) and f/D ratio (14).
When entering the depth of the dish, the calculator will calculate the focal length (14) and f/D ratio (15).
<h3>13: Focal length</h3>
<h3>14: Focal length</h3>
Displays the calculated focal length.
Focal length is calculated as: f=d^2/(16*D)
<h3>14: f/D Ratio</h3>
<h3>15: f/D Ratio</h3>
Displays the calculated focal length to diameter ratio.
<h3>15: Beamwidth</h3>
<h3>16: Beamwidth</h3>
Displays the halfpower (-3dB) beamwidth.
Beamwidth is calculated as: 70*lambda/D.
<h3>16: Gain</h3>
<h3>17: Gain</h3>
Displays the calculated gain in dB.
The gain is calculated as: 10\*log10(eff/100.0\*(pi*D/lambda)^2)
The nominal gain is calculated as: g0=10\*log10(eff/100.0\*(pi*D/lambda)^2)
The gain is then adjusted for surface error with Ruze's equation: g=g0-685.81*(e/lambda)^2