在建立衛星地面站時,其中一項很重要的工作就是進行衛星鍊路預算。手動計算十分麻煩,使用Python編寫了一個可視化的計算工具。
一、 概述
衛星通信是指以人造地球衛星為中繼站轉發或反射無線電波,在兩個或多個衛星地面站之間進行的通信。進行衛星通信時,合理規劃設計衛星傳輸鍊路,是衛星使用者確定系統穩定運作的重要依據。對于建立衛星地面站,其中一項重要工作就是對衛星鍊路進行預算,以便确定天線尺寸及功放大小。同樣對于現有地面站,由于業務需要,如需再上行一路或幾路載波,這時也需要計算一下現有功放容量夠不夠,用不用修改天線口徑或功放發射功率。此時一般情況下使用者會同衛星公司聯系,請其提供鍊路預算表,以便擷取相應資料,其實很多情況下使用者隻需同衛星公司要幾個參數,自己計算即可準确知道結果。
為友善使用者快速進行鍊路計算并進行鍊路餘量分析,編寫了衛星通信系統鍊路計算軟體。該軟體将鍊路計算中繁瑣的公式進行整合,使用者通過簡單的參數輸入即可得到鍊路計算結果,根據計算結果合理配備地面站裝置,既能滿足通信要求又能節約成本,大大簡化了工作流程,提高了工作效率。
二、 設計原理
圖1 衛星通信系統鍊路計算流程圖
衛星通信系統鍊路計算流程如圖1所示。采用正推法進行衛星通信系統鍊路計算,在給定地面站天線口徑、功放發射功率等參數和相應地面站接收參數及衛星轉發器參數的基礎上,分别對上行鍊路和下行鍊路進行計算,最後計算總的鍊路餘量并在此基礎上調整地面站裝置。上行鍊路計算包括上行地面站發射天線增益、上行地面站EIRP、上行鍊路空間自由損耗、上行飽和通量密度(PFD)、上行載溫比(C/T)U、上行載噪比(C/N)U等。下行鍊路計算包括下行地面站接收天線增益、下行地面站G/T值、下行鍊路空間自由損耗、下行載溫比(C/T)D、下行載噪比(C/N)D等。總的鍊路計算包括整個鍊路的總載噪比(C/N)Total、總信噪譜密度(C/N0)Total、鍊路餘量等。
三、 軟體設計
衛星通信系統鍊路計算軟體采用Python 3.6語言設計完成,軟體的主窗體由wxFormBuilder工具設計生成。該軟體操作簡單、支援目前主流的Windows作業系統安裝使用。軟體的主要功能:衛星通信系統上行鍊路計算、下行鍊路計算、總的鍊路及餘量計算、參數清空等,軟體開發流程如圖2所示。
圖2 衛星通信系統鍊路計算軟體開發流程圖
下面對開發流程進行較為詳細的介紹:
Step1:搭建應用程式主窗體,使用wxFormBuilder工具設計生成應用程式架構,建立SatelliteLink()類,添加靜态文本以及可編輯文本框、添加按鈕并生成相應的事件函數,将源代碼儲存到檔案basewin.py中;
Step2:建立主函數執行檔案main_win.py,建立MainWindow()類,從basewin.py檔案中繼承主窗體的SatelliteLink()類,按照主窗體按鈕對應的事件,分别編寫上行鍊路計算函數Uplink_Calculate()、下行鍊路計算函數Downlink_Calculate()、總的鍊路計算函數Totallink_Calculate()、參數清空函數Zero_Everything();
Step3:編寫主函數子產品,聲明Application對象并啟動主事件循環;
圖3 衛星通信系統鍊路計算軟體界面
衛星通信系統鍊路計算軟體界面如圖3所示。使用說明如下:軟體分為三個計算子產品,左側為上行鍊路計算子產品,中間為下行鍊路計算子產品,右側為總的鍊路計算子產品。沒有加亮标注的靜态文本框對應的白色可編輯文本框為待輸入參數,黃色高亮靜态文本框對應的灰色可編輯文本框為待求解參數,輸入參數後,點選下方的按鈕即可得到計算結果。另外,軟體右下方有參數清空按鈕,可以清除文本框中的參數。
四、 源代碼
主函數:
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 09:43:22 2018
@author: Heat
"""
import wx
import basewin
import math
class MainWindow(basewin.SatelliteLink):
# 首先,從源檔案中将主窗體繼承下來.
# 初始化
def __init__(self, parent):
# 記得設定 父類中 wx.Frame.__init__ ( self, parent=0)
super().__init__(self)
# 上行鍊路預算 (計算結果保留小數點後四位)
def Uplink_Calculate(self, event):
# 擷取上行載波頻率 --GHz
self.uplink_frequency = self.text_uplink1.GetValue()
# 擷取上行發射天線口徑 --m
self.uplink_antenna_diameter = self.text_uplink2.GetValue()
# 擷取上行天線發射效率 --上行6G,效率為0.65
self.uplink_antenna_eff = self.text_uplink3.GetValue()
# 擷取上行天線功放發射功率; 1W即,0dBW = 30dBm;2W即,2dBW = 33dBm;
self.uplink_sspa = self.text_uplink5.GetValue()
# 擷取上行星地距離 --m
self.uplink_range = self.text_uplink7.GetValue()
# 擷取信号帶寬 --MHz
self.uplink_bandwidth = self.text_uplink10.GetValue()
# 擷取上行衛星品質因數 G/T --dB/K
self.uplink_gt = self.text_uplink11.GetValue()
# 計算上行天線發射增益 --dBi
self.uplink_antenna_transmit_gain = float('%.4f'%(10 * math.log(
eval(self.uplink_antenna_eff), 10) + 20 * math.log(
(math.pi*eval(self.uplink_antenna_diameter)*
eval(self.uplink_frequency)*1e9)/3e8, 10)))
self.text_uplink4.SetValue(str(self.uplink_antenna_transmit_gain))
# 計算上行 EIRP --dBW
self.uplink_EIRP = float('%.4f'%(self.uplink_antenna_transmit_gain +
10*math.log10(eval(self.uplink_sspa))))
self.text_uplink6.SetValue(str(self.uplink_EIRP))
# 計算上行鍊路空間自由損耗
self.uplink_path_loss = float('%.4f'%(20*math.log10(eval(
self.uplink_frequency)*1e9) + 20*math.log10(eval(
self.uplink_range)*1e3) + 20*math.log10(4*math.pi/3e8)))
self.text_uplink8.SetValue(str(self.uplink_path_loss))
# 計算上行 PFD --dBW/m^2
self.uplink_PFD = float('%.4f'%(self.uplink_EIRP - self.uplink_path_loss
+ 10*math.log10(
4*math.pi/((3e8/(eval(self.uplink_frequency)*1e9))**2))))
self.text_uplink9.SetValue(str(self.uplink_PFD))
# 計算上行載噪比 --dB (K為玻爾茲曼常數, K=-228.6dB/K•Hz)
self.uplink_CN = float('%.4f'%(self.uplink_EIRP - self.uplink_path_loss
+ eval(self.uplink_gt) + 228.6 - 10*math.log10(eval(
self.uplink_bandwidth)*1e6)))
self.text_uplink12.SetValue(str(self.uplink_CN))
# 下行鍊路預算 (計算結果保留小數點後四位)
def Downlink_Calculate(self, event):
# 擷取下行載波頻率 --GHz
self.downlink_frequency = self.text_downlink1.GetValue()
# 擷取下行接收天線口徑 --m
self.downlink_antenna_diameter = self.text_downlink2.GetValue()
# 擷取下行天線接收效率 --下行4G,效率為0.75
self.downlink_antenna_eff = self.text_downlink3.GetValue()
# 擷取下行系統噪聲溫度 --K
self.downlink_noise_temperature = self.text_downlink4.GetValue()
# 擷取下行衛星 EIRP --dBW
self.satellite_EIRP = self.text_downlink7.GetValue()
# 計算下行接收天線接收增益 --dBi
self.downlink_antenna_receive_gain = float('%.4f'%(10 * math.log(
eval(self.downlink_antenna_eff), 10) + 20 * math.log(
(math.pi*eval(self.downlink_antenna_diameter)*
eval(self.downlink_frequency)*1e9)/3e8, 10)))
self.text_downlink5.SetValue(str(self.downlink_antenna_receive_gain))
# 計算下行接收天線品質因數 G/T --dB/K
self.downlink_antenna_gt = self.downlink_antenna_receive_gain - float(
'%.4f'%(10*math.log10(eval(self.downlink_noise_temperature))))
self.text_downlink6.SetValue(str(self.downlink_antenna_gt))
# 計算下行鍊路空間自由損耗
self.downlink_path_loss = float('%.4f'%(20*math.log10(eval(
self.downlink_frequency)*1e9) + 20*math.log10(eval(
self.uplink_range)*1e3) + 20*math.log10(4*math.pi/3e8)))
self.text_downlink8.SetValue(str(self.downlink_path_loss))
# 計算下行載噪比 --dB
self.downlink_CN = float('%.4f'%(eval(self.satellite_EIRP) -
self.downlink_path_loss + self.downlink_antenna_gt + 228.6 -
10*math.log10(eval(self.uplink_bandwidth)*1e6)))
self.text_downlink9.SetValue(str(self.downlink_CN))
# 計算總的鍊路預算 (計算結果保留小數點後四位)
def Totallink_Calculate(self, event):
# 擷取上行鍊路載幹比 --dB
self.uplink_CI = self.text_totallink1.GetValue()
# 擷取衛星互調幹擾 --dB
self.satellite_CI = self.text_totallink3.GetValue()
# 擷取下行鍊路載幹比 -- dB
self.downlink_CI = self.text_totallink5.GetValue()
# 擷取門限信噪譜密度
self.threshold_CN0 = self.text_totallink8.GetValue()
# 計算上行載噪比 --dB
self.text_totallink2.SetValue(str(self.uplink_CN))
# 計算下行載噪比 --dB
self.text_totallink4.SetValue(str(self.downlink_CN))
# 計算總的載噪比 --dB
self.total_CN = float('%.4f'%(10*math.log10(1/(
1/(10**(self.uplink_CN/10)) +
1/(10**(self.downlink_CN/10)) +
1/(10**(eval(self.uplink_CI)/10)) +
1/(10**(eval(self.satellite_CI)/10)) +
1/(10**(eval(self.downlink_CI)/10))
))))
self.text_totallink6.SetValue(str(self.total_CN))
# 計算總的信噪譜密度 --dBHz
self.total_CN0 = float('%.4f'%(self.total_CN +
10*math.log10(eval(self.uplink_bandwidth)*1e6)))
self.text_totallink7.SetValue(str(self.total_CN0))
# 計算鍊路餘量 --dB
self.link_margin = float('%.4f'%(self.total_CN0 -
eval(self.threshold_CN0)))
self.text_totallink9.SetValue(str(self.link_margin))
# 參數清空
def Zero_Everything(self, event):
# 上行鍊路--參數清空
self.text_uplink1.Clear()
self.text_uplink2.Clear()
self.text_uplink3.Clear()
self.text_uplink4.Clear()
self.text_uplink5.Clear()
self.text_uplink6.Clear()
self.text_uplink7.Clear()
self.text_uplink8.Clear()
self.text_uplink9.Clear()
self.text_uplink10.Clear()
self.text_uplink11.Clear()
self.text_uplink12.Clear()
# 下行鍊路 --參數清空
self.text_downlink1.Clear()
self.text_downlink2.Clear()
self.text_downlink3.Clear()
self.text_downlink4.Clear()
self.text_downlink5.Clear()
self.text_downlink6.Clear()
self.text_downlink7.Clear()
self.text_downlink8.Clear()
self.text_downlink9.Clear()
# 總的鍊路 --參數清空
self.text_totallink1.Clear()
self.text_totallink2.Clear()
self.text_totallink3.Clear()
self.text_totallink4.Clear()
self.text_totallink5.Clear()
self.text_totallink6.Clear()
self.text_totallink7.Clear()
self.text_totallink8.Clear()
self.text_totallink9.Clear()
# 執行主函數
if __name__ == '__main__':
app = wx.App()
main_win = MainWindow(None)
main_win.Show()
app.MainLoop()
界面:
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Jun 17 2015)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################################
import wx
import wx.xrc
###########################################################################
## Class SatelliteLink
###########################################################################
class SatelliteLink ( wx.Frame ):
def __init__( self, parent ):
wx.Frame.__init__ ( self, parent=None, id = wx.ID_ANY, title = u"衛星通信系統鍊路計算軟體 V1.0", pos = wx.DefaultPosition, size = wx.Size( 1486,700 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
self.SetFont( wx.Font( 22, 70, 90, 90, False, "華文隸書" ) )
self.SetBackgroundColour( wx.Colour( 226, 228, 227 ) )
bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
fgSizer3.SetFlexibleDirection( wx.BOTH )
fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
self.m_staticText27 = wx.StaticText( self, wx.ID_ANY, u"Uplink", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText27.Wrap( -1 )
self.m_staticText27.SetFont( wx.Font( 16, 72, 93, 92, False, "Times New Roman" ) )
self.m_staticText27.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) )
fgSizer3.Add( self.m_staticText27, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
self.m_staticText28 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText28.Wrap( -1 )
fgSizer3.Add( self.m_staticText28, 0, wx.ALL, 5 )
self.m_staticText29 = wx.StaticText( self, wx.ID_ANY, u"Uplink frequency (GHz)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText29.Wrap( -1 )
self.m_staticText29.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.m_staticText29, 0, wx.ALL, 5 )
self.text_uplink1 = wx.TextCtrl( self, wx.ID_ANY, u"6", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink1.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.text_uplink1, 0, wx.ALL, 5 )
self.m_staticText30 = wx.StaticText( self, wx.ID_ANY, u"Uplink antenna diameter (m)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText30.Wrap( -1 )
self.m_staticText30.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.m_staticText30, 0, wx.ALL, 5 )
self.text_uplink2 = wx.TextCtrl( self, wx.ID_ANY, u"3", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink2.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.text_uplink2, 0, wx.ALL, 5 )
self.m_staticText31 = wx.StaticText( self, wx.ID_ANY, u"Uplink antenna aperture efficiency (e.g. 0.65)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText31.Wrap( -1 )
self.m_staticText31.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.m_staticText31, 0, wx.ALL, 5 )
self.text_uplink3 = wx.TextCtrl( self, wx.ID_ANY, u"0.65", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink3.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.text_uplink3, 0, wx.ALL, 5 )
self.m_staticText32 = wx.StaticText( self, wx.ID_ANY, u"Uplink antenna transmit gain (dBi)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText32.Wrap( -1 )
self.m_staticText32.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText32.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer3.Add( self.m_staticText32, 0, wx.ALL, 5 )
self.text_uplink4 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink4.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_uplink4.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer3.Add( self.text_uplink4, 0, wx.ALL, 5 )
self.m_staticText33 = wx.StaticText( self, wx.ID_ANY, u"Uplink antenna, power at the feed (W) ", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText33.Wrap( -1 )
self.m_staticText33.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.m_staticText33, 0, wx.ALL, 5 )
self.text_uplink5 = wx.TextCtrl( self, wx.ID_ANY, u"2", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink5.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.text_uplink5, 0, wx.ALL, 5 )
self.m_staticText34 = wx.StaticText( self, wx.ID_ANY, u"Uplink EIRP (dBW)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText34.Wrap( -1 )
self.m_staticText34.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText34.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer3.Add( self.m_staticText34, 0, wx.ALL, 5 )
self.text_uplink6 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink6.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_uplink6.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer3.Add( self.text_uplink6, 0, wx.ALL, 5 )
self.m_staticText35 = wx.StaticText( self, wx.ID_ANY, u"Range (35778 - 41679) (km)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText35.Wrap( -1 )
self.m_staticText35.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.m_staticText35, 0, wx.ALL, 5 )
self.text_uplink7 = wx.TextCtrl( self, wx.ID_ANY, u"36000", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink7.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.text_uplink7, 0, wx.ALL, 5 )
self.m_staticText36 = wx.StaticText( self, wx.ID_ANY, u"Uplink path loss (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText36.Wrap( -1 )
self.m_staticText36.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText36.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer3.Add( self.m_staticText36, 0, wx.ALL, 5 )
self.text_uplink8 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink8.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_uplink8.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer3.Add( self.text_uplink8, 0, wx.ALL, 5 )
self.m_staticText37 = wx.StaticText( self, wx.ID_ANY, u"Uplink PFD at satellite (dBW/m^2)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText37.Wrap( -1 )
self.m_staticText37.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText37.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer3.Add( self.m_staticText37, 0, wx.ALL, 5 )
self.text_uplink9 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink9.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_uplink9.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer3.Add( self.text_uplink9, 0, wx.ALL, 5 )
self.m_staticText38 = wx.StaticText( self, wx.ID_ANY, u"Bandwidth (MHz)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText38.Wrap( -1 )
self.m_staticText38.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.m_staticText38, 0, wx.ALL, 5 )
self.text_uplink10 = wx.TextCtrl( self, wx.ID_ANY, u"10", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink10.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.text_uplink10, 0, wx.ALL, 5 )
self.m_staticText39 = wx.StaticText( self, wx.ID_ANY, u"Satellite uplink G/T (dB/K)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText39.Wrap( -1 )
self.m_staticText39.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.m_staticText39, 0, wx.ALL, 5 )
self.text_uplink11 = wx.TextCtrl( self, wx.ID_ANY, u"3", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink11.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer3.Add( self.text_uplink11, 0, wx.ALL, 5 )
self.m_staticText40 = wx.StaticText( self, wx.ID_ANY, u"Uplink C/N (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText40.Wrap( -1 )
self.m_staticText40.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText40.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer3.Add( self.m_staticText40, 0, wx.ALL, 5 )
self.text_uplink12 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_uplink12.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_uplink12.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer3.Add( self.text_uplink12, 0, wx.ALL, 5 )
self.button_uplink = wx.Button( self, wx.ID_ANY, u"Click to calculate the results", wx.DefaultPosition, wx.DefaultSize, 0 )
self.button_uplink.SetFont( wx.Font( 15, 72, 93, 92, False, "Times New Roman" ) )
self.button_uplink.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INACTIVECAPTION ) )
fgSizer3.Add( self.button_uplink, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
bSizer6.Add( fgSizer3, 0, wx.TOP|wx.RIGHT, 20 )
fgSizer4 = wx.FlexGridSizer( 0, 2, 0, 0 )
fgSizer4.SetFlexibleDirection( wx.BOTH )
fgSizer4.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
self.m_staticText41 = wx.StaticText( self, wx.ID_ANY, u"Downlink", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText41.Wrap( -1 )
self.m_staticText41.SetFont( wx.Font( 16, 72, 93, 92, False, "Times New Roman" ) )
self.m_staticText41.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) )
fgSizer4.Add( self.m_staticText41, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
self.m_staticText42 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText42.Wrap( -1 )
fgSizer4.Add( self.m_staticText42, 0, wx.ALL, 5 )
self.m_staticText43 = wx.StaticText( self, wx.ID_ANY, u"Downlink frequency (GHz)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText43.Wrap( -1 )
self.m_staticText43.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.m_staticText43, 0, wx.ALL, 5 )
self.text_downlink1 = wx.TextCtrl( self, wx.ID_ANY, u"4", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink1.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.text_downlink1, 0, wx.ALL, 5 )
self.m_staticText44 = wx.StaticText( self, wx.ID_ANY, u"Downlink receive antenna diameter (m)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText44.Wrap( -1 )
self.m_staticText44.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.m_staticText44, 0, wx.ALL, 5 )
self.text_downlink2 = wx.TextCtrl( self, wx.ID_ANY, u"3", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink2.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.text_downlink2, 0, wx.ALL, 5 )
self.m_staticText45 = wx.StaticText( self, wx.ID_ANY, u"Downlink receive antenna aperture efficiency (e.g. 0.65)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText45.Wrap( -1 )
self.m_staticText45.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.m_staticText45, 0, wx.ALL, 5 )
self.text_downlink3 = wx.TextCtrl( self, wx.ID_ANY, u"0.75", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink3.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.text_downlink3, 0, wx.ALL, 5 )
self.m_staticText46 = wx.StaticText( self, wx.ID_ANY, u"Downlink system noise temperature(antenna+LNA) (K)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText46.Wrap( -1 )
self.m_staticText46.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.m_staticText46, 0, wx.ALL, 5 )
self.text_downlink4 = wx.TextCtrl( self, wx.ID_ANY, u"30", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink4.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.text_downlink4, 0, wx.ALL, 5 )
self.m_staticText47 = wx.StaticText( self, wx.ID_ANY, u"Downlink receive antenna gain (dBi)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText47.Wrap( -1 )
self.m_staticText47.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText47.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer4.Add( self.m_staticText47, 0, wx.ALL, 5 )
self.text_downlink5 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink5.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_downlink5.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_ACTIVEBORDER ) )
fgSizer4.Add( self.text_downlink5, 0, wx.ALL, 5 )
self.m_staticText48 = wx.StaticText( self, wx.ID_ANY, u"Downlink receive antenna G/T (dB/K)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText48.Wrap( -1 )
self.m_staticText48.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText48.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer4.Add( self.m_staticText48, 0, wx.ALL, 5 )
self.text_downlink6 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink6.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_downlink6.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_ACTIVEBORDER ) )
fgSizer4.Add( self.text_downlink6, 0, wx.ALL, 5 )
self.m_staticText49 = wx.StaticText( self, wx.ID_ANY, u"Downlink satellite EIRP (dBW)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText49.Wrap( -1 )
self.m_staticText49.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.m_staticText49, 0, wx.ALL, 5 )
self.text_downlink7 = wx.TextCtrl( self, wx.ID_ANY, u"30", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink7.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer4.Add( self.text_downlink7, 0, wx.ALL, 5 )
self.m_staticText50 = wx.StaticText( self, wx.ID_ANY, u"Downlink path loss (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText50.Wrap( -1 )
self.m_staticText50.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText50.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer4.Add( self.m_staticText50, 0, wx.ALL, 5 )
self.text_downlink8 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink8.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_downlink8.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer4.Add( self.text_downlink8, 0, wx.ALL, 5 )
self.m_staticText51 = wx.StaticText( self, wx.ID_ANY, u"Downlink C/N (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText51.Wrap( -1 )
self.m_staticText51.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText51.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer4.Add( self.m_staticText51, 0, wx.ALL, 5 )
self.text_downlink9 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_downlink9.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_downlink9.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer4.Add( self.text_downlink9, 0, wx.ALL, 5 )
self.button_downlink = wx.Button( self, wx.ID_ANY, u"Click to calculate the results", wx.DefaultPosition, wx.DefaultSize, 0 )
self.button_downlink.SetFont( wx.Font( 15, 72, 93, 92, False, "Times New Roman" ) )
self.button_downlink.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INACTIVECAPTION ) )
fgSizer4.Add( self.button_downlink, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 5 )
bSizer6.Add( fgSizer4, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND|wx.TOP|wx.RIGHT, 20 )
fgSizer5 = wx.FlexGridSizer( 0, 2, 0, 0 )
fgSizer5.SetFlexibleDirection( wx.BOTH )
fgSizer5.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
self.m_staticText26 = wx.StaticText( self, wx.ID_ANY, u"Total link", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText26.Wrap( -1 )
self.m_staticText26.SetFont( wx.Font( 16, 72, 93, 92, False, "Times New Roman" ) )
self.m_staticText26.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) )
fgSizer5.Add( self.m_staticText26, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
self.m_staticText271 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText271.Wrap( -1 )
fgSizer5.Add( self.m_staticText271, 0, wx.ALL, 5 )
self.m_staticText281 = wx.StaticText( self, wx.ID_ANY, u"Uplink C/interference (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText281.Wrap( -1 )
self.m_staticText281.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer5.Add( self.m_staticText281, 0, wx.ALL, 5 )
self.text_totallink1 = wx.TextCtrl( self, wx.ID_ANY, u"28.0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink1.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer5.Add( self.text_totallink1, 0, wx.ALL, 5 )
self.m_staticText291 = wx.StaticText( self, wx.ID_ANY, u"Uplink C/N (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText291.Wrap( -1 )
self.m_staticText291.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText291.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer5.Add( self.m_staticText291, 0, wx.ALL, 5 )
self.text_totallink2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink2.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_totallink2.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_ACTIVEBORDER ) )
fgSizer5.Add( self.text_totallink2, 0, wx.ALL, 5 )
self.m_staticText301 = wx.StaticText( self, wx.ID_ANY, u"Satellite C/intermod (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText301.Wrap( -1 )
self.m_staticText301.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer5.Add( self.m_staticText301, 0, wx.ALL, 5 )
self.text_totallink3 = wx.TextCtrl( self, wx.ID_ANY, u"21.0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink3.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer5.Add( self.text_totallink3, 0, wx.ALL, 5 )
self.m_staticText311 = wx.StaticText( self, wx.ID_ANY, u"Downlink C/N (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText311.Wrap( -1 )
self.m_staticText311.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText311.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer5.Add( self.m_staticText311, 0, wx.ALL, 5 )
self.text_totallink4 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink4.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_totallink4.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer5.Add( self.text_totallink4, 0, wx.ALL, 5 )
self.m_staticText321 = wx.StaticText( self, wx.ID_ANY, u"Downlink C/interference (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText321.Wrap( -1 )
self.m_staticText321.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
fgSizer5.Add( self.m_staticText321, 0, wx.ALL, 5 )
self.text_totallink5 = wx.TextCtrl( self, wx.ID_ANY, u"28.0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink5.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
fgSizer5.Add( self.text_totallink5, 0, wx.ALL, 5 )
self.m_staticText331 = wx.StaticText( self, wx.ID_ANY, u"Total link C/N (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText331.Wrap( -1 )
self.m_staticText331.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText331.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer5.Add( self.m_staticText331, 0, wx.ALL, 5 )
self.text_totallink6 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink6.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_totallink6.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_APPWORKSPACE ) )
fgSizer5.Add( self.text_totallink6, 0, wx.ALL, 5 )
self.m_staticText381 = wx.StaticText( self, wx.ID_ANY, u"Total link C/N0 (dBHz)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText381.Wrap( -1 )
self.m_staticText381.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText381.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer5.Add( self.m_staticText381, 0, wx.ALL, 5 )
self.text_totallink7 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink7.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_totallink7.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_ACTIVEBORDER ) )
fgSizer5.Add( self.text_totallink7, 0, wx.ALL, 5 )
self.m_staticText341 = wx.StaticText( self, wx.ID_ANY, u"Threshold C/N0 (dBHz)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText341.Wrap( -1 )
self.m_staticText341.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText341.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
fgSizer5.Add( self.m_staticText341, 0, wx.ALL, 5 )
self.text_totallink8 = wx.TextCtrl( self, wx.ID_ANY, u"48.0", wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink8.SetFont( wx.Font( 12, 72, 90, 90, False, "Times New Roman" ) )
self.text_totallink8.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) )
fgSizer5.Add( self.text_totallink8, 0, wx.ALL, 5 )
self.m_staticText351 = wx.StaticText( self, wx.ID_ANY, u"Link Margin (dB)", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText351.Wrap( -1 )
self.m_staticText351.SetFont( wx.Font( 14, 72, 90, 90, False, "Times New Roman" ) )
self.m_staticText351.SetBackgroundColour( wx.Colour( 255, 255, 0 ) )
fgSizer5.Add( self.m_staticText351, 0, wx.ALL, 5 )
self.text_totallink9 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.text_totallink9.SetFont( wx.Font( 12, 72, 90, 92, False, "Times New Roman" ) )
self.text_totallink9.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_ACTIVEBORDER ) )
fgSizer5.Add( self.text_totallink9, 0, wx.ALL, 5 )
self.button_totallink = wx.Button( self, wx.ID_ANY, u"Click to calculate the results", wx.DefaultPosition, wx.DefaultSize, 0 )
self.button_totallink.SetFont( wx.Font( 15, 72, 93, 92, False, "Times New Roman" ) )
self.button_totallink.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INACTIVECAPTION ) )
fgSizer5.Add( self.button_totallink, 0, wx.ALL, 5 )
self.m_staticText371 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText371.Wrap( -1 )
fgSizer5.Add( self.m_staticText371, 0, wx.ALL, 5 )
self.button_zero = wx.Button( self, wx.ID_ANY, u"Click to zero everything", wx.DefaultPosition, wx.DefaultSize, 0 )
self.button_zero.SetFont( wx.Font( 15, 72, 93, 92, False, "Times New Roman" ) )
self.button_zero.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INACTIVECAPTION ) )
fgSizer5.Add( self.button_zero, 0, wx.ALL, 5 )
bSizer6.Add( fgSizer5, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND|wx.LEFT|wx.TOP, 20 )
self.SetSizer( bSizer6 )
self.Layout()
self.Centre( wx.BOTH )
# Connect Events
self.button_uplink.Bind( wx.EVT_BUTTON, self.Uplink_Calculate )
self.button_downlink.Bind( wx.EVT_BUTTON, self.Downlink_Calculate )
self.button_totallink.Bind( wx.EVT_BUTTON, self.Totallink_Calculate )
self.button_zero.Bind( wx.EVT_BUTTON, self.Zero_Everything )
def __del__( self ):
pass
# Virtual event handlers, overide them in your derived class
def Uplink_Calculate( self, event ):
event.Skip()
def Downlink_Calculate( self, event ):
event.Skip()
def Totallink_Calculate( self, event ):
event.Skip()
def Zero_Everything( self, event ):
event.Skip()
備注:
exe可執行檔案打包可使用 pyinstaller 工具。打包方法參見博文:https://blog.csdn.net/weixin_40407893/article/details/102596353