diff --git a/plugins/feature/antennatools/antennatoolsgui.cpp b/plugins/feature/antennatools/antennatoolsgui.cpp index 1e0adab43..ad501eea5 100644 --- a/plugins/feature/antennatools/antennatoolsgui.cpp +++ b/plugins/feature/antennatools/antennatoolsgui.cpp @@ -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 deviceSets = MainCore::instance()->getDeviceSets(); diff --git a/plugins/feature/antennatools/antennatoolsgui.h b/plugins/feature/antennatools/antennatoolsgui.h index 055a7ac6a..28c9fc397 100644 --- a/plugins/feature/antennatools/antennatoolsgui.h +++ b/plugins/feature/antennatools/antennatoolsgui.h @@ -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(); diff --git a/plugins/feature/antennatools/antennatoolsgui.ui b/plugins/feature/antennatools/antennatoolsgui.ui index 136767aae..dfc972041 100644 --- a/plugins/feature/antennatools/antennatoolsgui.ui +++ b/plugins/feature/antennatools/antennatoolsgui.ui @@ -7,7 +7,7 @@ 0 0 377 - 461 + 499 @@ -43,7 +43,7 @@ 16 19 351 - 431 + 451 @@ -219,34 +219,21 @@ Dish - + Beamwidth (°) - - - - Focal length to diameter ratio - - - true - - - 1.000000000000000 - - - - - + + - Diameter + Frequency - + @@ -259,13 +246,6 @@ - - - - f/D - - - @@ -290,7 +270,21 @@ - + + + + Focal length + + + + + + + Efficiency (%) + + + + Dish gain @@ -303,24 +297,126 @@ - - - - Dish efficiency in percent - - - 100 - - - - + Depth - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Focal length + + + true + + + 1000.000000000000000 + + + + + + + Halfpower (-3dB) beamwidth in degrees + + + true + + + 360.000000000000000 + + + + + + + Depth of the dish + + + 1000.000000000000000 + + + + + + + Gain (dB) + + + + + + + Frequency of operation + + + 3 + + + 20000.000000000000000 + + + 2400.000000000000000 + + + + + + + Diameter of the dish + + + 1000.000000000000000 + + + 100.000000000000000 + + + + + + + Focal length to diameter ratio + + + true + + + 1.000000000000000 + + + + + + + Diameter + + + + + + + f/D + + + + @@ -354,109 +450,33 @@ - - - - Gain (dB) - - - - - + + - Halfpower (-3dB) beamwidth in degrees - - - true + Dish efficiency in percent - 360.000000000000000 + 100 - - + + - Efficiency (%) - - - - - - - Depth of the dish - - - 1000.000000000000000 - - - - - - - Frequency of operation - - - 3 - - - 20000.000000000000000 - - - 2400.000000000000000 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Frequency + Surface error - + - Diameter of the dish - - - 1000.000000000000000 - - - 100.000000000000000 - - - - - - - Focal length - - - - - - - Focal length + RMS surface error (as a length) - true + false - 1000.000000000000000 + 360.000000000000000 @@ -482,9 +502,12 @@ dipoleEndEffectFactor dishFrequency dishFrequencySelect + dishEfficiency + dishSurfaceError dishDiameter dishLengthUnits dishDepth + dishFocalLength dishFD dishBeamwidth dishGain diff --git a/plugins/feature/antennatools/antennatoolssettings.cpp b/plugins/feature/antennatools/antennatoolssettings.cpp index 4afadb5b6..0ebec63e3 100644 --- a/plugins/feature/antennatools/antennatoolssettings.cpp +++ b/plugins/feature/antennatools/antennatoolssettings.cpp @@ -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()); diff --git a/plugins/feature/antennatools/antennatoolssettings.h b/plugins/feature/antennatools/antennatoolssettings.h index 4df71e3c9..dcf8bd9e4 100644 --- a/plugins/feature/antennatools/antennatoolssettings.h +++ b/plugins/feature/antennatools/antennatoolssettings.h @@ -41,6 +41,7 @@ struct AntennaToolsSettings double m_dishDepth; int m_dishEfficiency; LengthUnits m_dishLengthUnits; + double m_dishSurfaceError; QString m_title; quint32 m_rgbColor; diff --git a/plugins/feature/antennatools/readme.md b/plugins/feature/antennatools/readme.md index c47ccab07..c08fe96d1 100644 --- a/plugins/feature/antennatools/readme.md +++ b/plugins/feature/antennatools/readme.md @@ -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). -

10: Diameter

+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). +

10: Surface Error

-

11: Dish Length Units

+Specifies the RMS surface error of the dish in length units (as determined by (12)). + +

11: Diameter

+ +When entering the diameter of the dish, the calculator will calculate the focal length (14), f/D ratio (15), beamwidth (16) and gain (17). + +

12: Dish Length Units

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. -

12: Depth

+

13: Depth

-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). -

13: Focal length

+

14: Focal length

Displays the calculated focal length. Focal length is calculated as: f=d^2/(16*D) -

14: f/D Ratio

+

15: f/D Ratio

Displays the calculated focal length to diameter ratio. -

15: Beamwidth

+

16: Beamwidth

Displays the halfpower (-3dB) beamwidth. Beamwidth is calculated as: 70*lambda/D. -

16: Gain

+

17: Gain

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