see on update notes

This commit is contained in:
KenanZhu111 committed 2024-11-05 20:05:36 +08:00
1 parent 93f218a113
commit 80e29d68c7
10 files changed
+322 -65

No files matched your search

+8
View File
@@ -32,6 +32,14 @@ Support method of orientation
* As of October 5, 2024, Matlab project will no longer be considered.[ADIN 2024/10/5] * As of October 5, 2024, Matlab project will no longer be considered.[ADIN 2024/10/5]
## Project Update ## Project Update
Update: 2024/11/03:
1. KNZ_GeoTrackLab: Fix some bug, Optimize UI logic。
2. KNZ_GeoTrackLab: New added function of save and change
file for View.
3. KNZ_GeoTrackLab: Sat track projection plot changed as
Mecator projection and relize the display
by dynamic, sat prn selection, selection of
sample rate/inteval of plot.
Update: 2024/11/03: Update: 2024/11/03:
1. KNZ_GeoTrackLab: Fix some bug, Modify some UI logic. 1. KNZ_GeoTrackLab: Fix some bug, Modify some UI logic.
+6
View File
@@ -32,6 +32,12 @@
* 自 2024 年 10 月 5 日起,Matlab 项目将不再考虑。[ADIN 2024/10/5] * 自 2024 年 10 月 5 日起,Matlab 项目将不再考虑。[ADIN 2024/10/5]
## 项目更新 ## 项目更新
更新:2024/11/05:
1. KNZ_GeoTrackLab: 修复一些bug, 优化UI逻辑。
2. KNZ_GeoTrackLab: 为View文本编辑器增添保存修改功能。
3. KNZ_GeoTrackLab: 卫星轨迹投影图更改为墨卡托投影,
并实现动画显示,卫星号选择,绘
制采样频率选择。
更新: 2024/10/31: 更新: 2024/10/31:
1. KNZ_GeoTrackLab: 修复一些bug, 优化UI逻辑。 1. KNZ_GeoTrackLab: 修复一些bug, 优化UI逻辑。
+4
View File
@@ -67,6 +67,10 @@ class Configinit:
self.config.set('Options_Draw', 'N_Line', '0.80') self.config.set('Options_Draw', 'N_Line', '0.80')
self.config.set('Options_Draw', 'U_Line', '0.80') self.config.set('Options_Draw', 'U_Line', '0.80')
self.config.set('Options_Draw', 'Sat_Amount_Color', '#0080FF') self.config.set('Options_Draw', 'Sat_Amount_Color', '#0080FF')
self.config.set('Options_Draw', 'Enable of track', '0')
self.config.set('Options_Draw', 'Track of prn', '01')
self.config.set('Options_Draw', 'Track sample rate','10')
### Config for input path ### Config for input path
self.config.add_section('Input_Obs_Path') self.config.add_section('Input_Obs_Path')
self.config.set('Input_Obs_Path', '0', '') self.config.set('Input_Obs_Path', '0', '')
+87 -28
View File
@@ -84,7 +84,8 @@ class CALLBACK:
position_y = int((hwnd.winfo_screenheight() - win_y) / 2) position_y = int((hwnd.winfo_screenheight() - win_y) / 2)
hwnd.geometry(f'{win_x}x{win_y}+{position_x}+{position_y}') hwnd.geometry(f'{win_x}x{win_y}+{position_x}+{position_y}')
def Calcuconfirm(self, cionbox, ctrobox, canglebox, systemv): def Calcuconfirm(self, cionbox, ctrobox, canglebox, systemv,
trackprn, trackint):
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
# > # >
# Method: Calcuconfirm # Method: Calcuconfirm
@@ -101,6 +102,9 @@ class CALLBACK:
self.cfg_get.set('Options_Calc', 'Trop_model', self.trocormode.get(ctrobox.get())) self.cfg_get.set('Options_Calc', 'Trop_model', self.trocormode.get(ctrobox.get()))
self.cfg_get.set('Options_Calc', 'Elev_angle', canglebox.get()) self.cfg_get.set('Options_Calc', 'Elev_angle', canglebox.get())
self.cfg_get.set('Options_Calc', 'Sat_system', str(systemv.get())) self.cfg_get.set('Options_Calc', 'Sat_system', str(systemv.get()))
self.cfg_get.set('Options_Draw', 'Track of prn', trackprn.get())
self.cfg_get.set('Options_Draw', 'Track sample rate', trackint.get())
self.cfg.save_config() self.cfg.save_config()
def Colorchoose(self, hwndparent, i, colorlab, mode): def Colorchoose(self, hwndparent, i, colorlab, mode):
@@ -306,6 +310,7 @@ class CALLBACK:
# Brief : Execute RINEX file into .ksln. # Brief : Execute RINEX file into .ksln.
# Author: @KenanZhu All Right Reserved. # Author: @KenanZhu All Right Reserved.
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
exten = "ksln"
statemsg = "" statemsg = ""
state3 = ["","",""] state3 = ["","",""]
if not ObsSelectBoxVar.get(): if not ObsSelectBoxVar.get():
@@ -327,9 +332,12 @@ class CALLBACK:
if AskOrNotCheckVar.get(): if AskOrNotCheckVar.get():
directory = DirectorySelectBoxVar.get() directory = DirectorySelectBoxVar.get()
directory = self.Dir_or_name_get(directory, 1) directory = self.Dir_or_name_get(directory, 1)
syssign = self.system.get(int(self.cfg_get['Options_Calc']['sat_system'])) syssign = self.system.get(int(self.cfg_get['Options_Calc']['sat_system']))
resname = syssign + '-' + self.Dir_or_name_get(obspath,0) + 'ksln' if int(self.cfg_get['Options_Draw']['Enable of track'])==1:
exten="ssln"
resname = syssign + '-' + self.Dir_or_name_get(obspath,0) + exten
respath = (directory + resname) respath = (directory + resname)
ExecuteState.config(text='Processing...... file : %s' %resname) ExecuteState.config(text='Processing...... file : %s' %resname)
@@ -343,7 +351,8 @@ class CALLBACK:
int(self.cfg_get['Options_Calc']['Sat_system']), int(self.cfg_get['Options_Calc']['Sat_system']),
int(self.cfg_get['Options_Calc']['Elev_angle']), int(self.cfg_get['Options_Calc']['Elev_angle']),
int(self.cfg_get['Options_Calc']['Iono_Model']), int(self.cfg_get['Options_Calc']['Iono_Model']),
int(self.cfg_get['Options_Calc']['Trop_Model']) int(self.cfg_get['Options_Calc']['Trop_Model']),
int(self.cfg_get['Options_Draw']['Enable of track'])
): ):
case 0.0: case 0.0:
ExecuteState.config(text='Generated successfully ! file : %s' %resname) ExecuteState.config(text='Generated successfully ! file : %s' %resname)
@@ -385,6 +394,7 @@ class CALLBACK:
path = filedialog.askopenfilename(title='Open as Pos Solution', path = filedialog.askopenfilename(title='Open as Pos Solution',
filetypes=[('Solution File(*.ksln)', '*.ksln'), filetypes=[('Solution File(*.ksln)', '*.ksln'),
('All Files', '*.*')]) ('All Files', '*.*')])
if not path: return
with open(path,'r')as f: with open(path,'r')as f:
while 1: while 1:
line = f.readline() line = f.readline()
@@ -524,56 +534,105 @@ class CALLBACK:
# Brief : # Brief :
# Author: @KenanZhu All Right Reserved. # Author: @KenanZhu All Right Reserved.
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
if self.cfg_get['Options_Draw']['Enable of track']=='0':
plotstate.config(text="Track plot is not avaliable now, Please enable it.")
return
satprn = int(self.cfg_get['Options_Draw']['Track of prn'])
anirat = int(self.cfg_get['Options_Draw']['Track sample rate'])
system = self.system.get(int(self.cfg_get['Options_Calc']['sat_system']))
path = filedialog.askopenfilename(title='Open as Sat Solution', path = filedialog.askopenfilename(title='Open as Sat Solution',
filetypes=[('Solution File(*.ksln)', '*.ksln'), filetypes=[('Solution File(*.ssln)', '*.ssln'),
('All Files', '*.*')]) ('All Files', '*.*')])
if not path: return
sattrack.clear() sattrack.clear()
sattrack.coastlines(resolution='110m')
sattrack.gridlines()
with open(path,'r') as f: with open(path,'r') as f:
while 1: while 1:
line = f.readline() line = f.readline()
if line.find('APPROX POSITION BLH')>=0: if line.find('APPROX POSITION BLH')>=0:
apb = math.degrees( float(line[22:35]) ) apb = math.degrees( float(line[22:35]) )
apl = math.degrees( float(line[35:48]) ) apl = math.degrees( float(line[35:48]) )
plotstate.config(text="Plotting...")
sattrack.scatter(
apl,
apb,
color='r',
s=35,
transform=ccrs.PlateCarree()
)
sattrack.text(
apl,
apb,
blank*4+marker,
color='k',
fontsize=10,
fontweight='bold',
transform=ccrs.PlateCarree()
)
canvas2.draw()
elif line.find('GENERATE SOURCE')>=0: elif line.find('GENERATE SOURCE')>=0:
marker = line[22:26] marker = line[22:26]
elif line.find('INTERVAL')>=0: elif line.find('INTERVAL')>=0:
ive = float(line[22:27]) ive = float(line[22:27])
elif line.find('<END OF HEADER')>=0: elif line.find('<END OF HEADER')>=0:
break break
epoch = 0 epoch = 0
while 1: while 1:
line =f.readline() line =f.readline()
if line[0:1]=='>': if line[0:1]==blank:
epoch = int(line[1:6])
plotstate.config(text="Reading...%5d/%5d Mode: Sat track plot"
%(int(line[1:6]), int(86400/ive)))
elif line[0:1]==blank:
pass pass
elif line[0:1]==self.system.get(int(self.cfg_get['Options_Calc']['sat_system'])
) and line.find('END')==-1 and line.find('Rec')==-1: elif line[0:1]==system and line.find('END')==-1 and line.find('Rec')==-1:
if epoch % 10==0: epoch = int(line[41:46])
plotstate.config(text="Reading...%5d/%5d Mode: Sat track plot"
% (int(line[41:46]), int(86400 / ive)))
if int(line[1:3])==satprn and epoch%anirat==0:
b = math.degrees( float(line[ 4:13]) ) b = math.degrees( float(line[ 4:13]) )
l = math.degrees( float(line[14:23]) ) l = math.degrees( float(line[14:23]) )
sattrack.scatter(l,b,color='b',s=2, sattrack.scatter(
transform=ccrs.PlateCarree()) l,
b,
color='b',
s=2,
transform=ccrs.PlateCarree()
)
canvas2.draw()
text = sattrack.text(
l,
b,
4*blank+system+'%02d'%satprn,
color='k',
fontsize=10,
fontweight='bold',
transform=ccrs.PlateCarree()
)
point = sattrack.scatter(
l,
b,
color='b',
s=10,
transform=ccrs.PlateCarree()
)
canvas2.draw()
text.remove()
point.remove()
else: else:
pass pass
elif line.find('END')>=0: elif line.find('END')>=0:
plotstate.config(text="Plotting...") plotstate.config(text="Done ! Track plot form: sys=%s sat=%2d interval=%2d"
%(system, satprn, anirat))
sattrack.scatter(apl, apb, color='#ff8000', s=35,
transform=ccrs.PlateCarree())
sattrack.text(apl, apb, blank * 4 + marker, color='#ff8000',
fontsize=12, fontweight='bold'
, transform=ccrs.PlateCarree())
plotstate.config(text="Reading...")
sattrack.coastlines(resolution='110m')
sattrack.gridlines()
canvas2.draw()
plotstate.config(text="Done !")
def _Plot2polar(self, sattrack, plotstate, canvas2): def _Plot2polar(self, sattrack, plotstate, canvas2):
T = threading.Thread( T = threading.Thread(
+1 -1
View File
@@ -389,7 +389,7 @@ class MAINGUI:
plt.rc('font', family='Segoe UI') plt.rc('font', family='Segoe UI')
fig = plt.figure() fig = plt.figure()
self.sattrack = fig.add_subplot( self.sattrack = fig.add_subplot(
projection=ccrs.PlateCarree() projection=ccrs.Mercator()
) )
self.sattrack.coastlines(resolution='110m') self.sattrack.coastlines(resolution='110m')
self.sattrack.gridlines() self.sattrack.gridlines()
+82 -15
View File
@@ -42,6 +42,13 @@ class OPTGUI:
self.canglebox = None self.canglebox = None
self.angleentry = None self.angleentry = None
self.enable = tk.IntVar()
self.trackprn = tk.StringVar()
self.trackint = tk.StringVar()
self.enable.set(int(self.cfg_get['Options_Draw']['Enable of track']))
self.trackprn.set(self.cfg_get['Options_Draw']['Track of prn'])
self.trackint.set(self.cfg_get['Options_Draw']['Track sample rate'])
self.ulinewidth = None self.ulinewidth = None
self.nlinewidth = None self.nlinewidth = None
self.elinewidth = None self.elinewidth = None
@@ -59,9 +66,9 @@ class OPTGUI:
self.opthwnd = tk.Toplevel(self.hwndparent) self.opthwnd = tk.Toplevel(self.hwndparent)
self.opthwnd.title("Options") self.opthwnd.title("Options")
self.opthwnd.resizable(0,0) self.opthwnd.resizable(0,0)
self.func.Move_center(self.opthwnd,320,250) self.func.Move_center(self.opthwnd,320,280)
self.opthwnd.minsize(320,250) self.opthwnd.minsize(320,280)
self.opthwnd.maxsize(320,250) self.opthwnd.maxsize(320,280)
### Set icon ### Set icon
icon_ico = (b'AAABAAEAICAAAAAAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAADjsAAA47AAAAAA' icon_ico = (b'AAABAAEAICAAAAAAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAADjsAAA47AAAAAA'
b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
@@ -184,6 +191,9 @@ class OPTGUI:
# Elev option frame # Elev option frame
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
self.HANGOPT() self.HANGOPT()
# Sat track opt frame
# -------------------------------------------------------------------------------
self.TRACK()
# Syst option frame # Syst option frame
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
self.SYSOPT() self.SYSOPT()
@@ -252,6 +262,55 @@ class OPTGUI:
self.canglebox.current(int(pos)) self.canglebox.current(int(pos))
self.canglebox.pack(side=tk.RIGHT,anchor='e') self.canglebox.pack(side=tk.RIGHT,anchor='e')
def TRACK(self):
# -------------------------------------------------------------------------------
# >
# Method: TRACK
# Brief : Plot satellite track by dynamic
# Author: @KenanZhu All Right Reserved.
# -------------------------------------------------------------------------------
SattrackFrm = ttk.LabelFrame(self.CalcuFrame, text='Satellite Track', labelanchor='nw')
SattrackFrm.pack(side=tk.TOP, expand=tk.YES, padx='0px', pady='2px', fill=tk.BOTH)
Sattrack = ttk.Frame(SattrackFrm)
Sattrack.pack(side=tk.TOP, expand=tk.YES, padx='0px', pady='0px',fill=tk.X)
SatenableBut = ttk.Checkbutton(
Sattrack,
text='Enable : (s)PRN / Plot Interval',
variable=self.enable,
onvalue=1,
offvalue=0,
command=lambda :self.func.AskOrNotCheck(
self.enable,
RateEntry,
SattprnEntry
)
)
SatenableBut.pack(side=tk.LEFT, anchor='w')
# Interval of track plot
# -------------------------------------------------------------------------------
RateEntry = ttk.Entry(
Sattrack,
width=8,
state=tk.DISABLED,
textvariable=self.trackint,
)
RateEntry.pack(side=tk.RIGHT, anchor='e')
# SPRN of satellite ploted
# -------------------------------------------------------------------------------
SattprnEntry = ttk.Entry(
Sattrack,
width=8,
state=tk.DISABLED,
textvariable=self.trackprn
)
SattprnEntry.pack(side=tk.RIGHT, anchor='e')
if self.enable.get():
RateEntry.config(state=tk.NORMAL)
SattprnEntry.config(state=tk.NORMAL)
def SYSOPT(self): def SYSOPT(self):
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
# > # >
@@ -296,7 +355,7 @@ class OPTGUI:
LineoptFrame.pack(side=tk.RIGHT, expand=tk.YES, padx='1px', pady='1px', fill=tk.Y) LineoptFrame.pack(side=tk.RIGHT, expand=tk.YES, padx='1px', pady='1px', fill=tk.Y)
EFrame = tk.Frame(LineoptFrame) EFrame = tk.Frame(LineoptFrame)
EFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px') EFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='2px')
elinewopt = tk.Label( elinewopt = tk.Label(
EFrame, EFrame,
text='Eline:', text='Eline:',
@@ -315,7 +374,7 @@ class OPTGUI:
self.elinewidth.pack(side=tk.LEFT, expand=tk.YES, padx='1px', pady='0px') self.elinewidth.pack(side=tk.LEFT, expand=tk.YES, padx='1px', pady='0px')
NFrame = tk.Frame(LineoptFrame) NFrame = tk.Frame(LineoptFrame)
NFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px') NFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='2px')
nlinewopt = tk.Label( nlinewopt = tk.Label(
NFrame, NFrame,
text='Nline:', text='Nline:',
@@ -334,7 +393,7 @@ class OPTGUI:
self.nlinewidth.pack(side=tk.LEFT, expand=tk.YES, padx='1px', pady='0px') self.nlinewidth.pack(side=tk.LEFT, expand=tk.YES, padx='1px', pady='0px')
UFrame = tk.Frame(LineoptFrame) UFrame = tk.Frame(LineoptFrame)
UFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px') UFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='2px')
ulinewopt = tk.Label( ulinewopt = tk.Label(
UFrame, UFrame,
text='Uline:', text='Uline:',
@@ -353,7 +412,7 @@ class OPTGUI:
self.ulinewidth.pack(side=tk.LEFT, expand=tk.YES, padx='1px', pady='0px') self.ulinewidth.pack(side=tk.LEFT, expand=tk.YES, padx='1px', pady='0px')
LineCon = tk.Frame(LineoptFrame) LineCon = tk.Frame(LineoptFrame)
LineCon.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px') LineCon.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='2px')
linewre = ttk.Button( linewre = ttk.Button(
LineCon, LineCon,
text='Undo', text='Undo',
@@ -375,11 +434,11 @@ class OPTGUI:
# Author: @KenanZhu All Right Reserved. # Author: @KenanZhu All Right Reserved.
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
# Satnum plot options# # Satnum plot options#
SatvisFrame = ttk.LabelFrame(self.PlotFrame, text='Satn configs', labelanchor='nw') SatvisFrame = ttk.LabelFrame(self.PlotFrame, text='SatN configs', labelanchor='nw')
SatvisFrame.pack(side=tk.BOTTOM, expand=tk.YES, padx='1px', pady='1px', fill=tk.BOTH) SatvisFrame.pack(side=tk.BOTTOM, expand=tk.YES, padx='1px', pady='1px', fill=tk.BOTH)
SatnFrame = tk.Frame(SatvisFrame) SatnFrame = tk.Frame(SatvisFrame)
SatnFrame.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px') SatnFrame.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='2px')
satncollab = tk.Label( satncollab = tk.Label(
SatnFrame, SatnFrame,
width=5, width=5,
@@ -409,7 +468,7 @@ class OPTGUI:
LinecolorFrame.pack(side=tk.LEFT, expand=tk.YES, padx='1px', pady='1px', fill=tk.Y) LinecolorFrame.pack(side=tk.LEFT, expand=tk.YES, padx='1px', pady='1px', fill=tk.Y)
EFrame = tk.Frame(LinecolorFrame) EFrame = tk.Frame(LinecolorFrame)
EFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px') EFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='2px')
ecollab = tk.Label( ecollab = tk.Label(
EFrame, EFrame,
width=5, width=5,
@@ -425,7 +484,7 @@ class OPTGUI:
ecolopt.pack(side=tk.RIGHT, expand=tk.YES, padx='5px', pady='0px') ecolopt.pack(side=tk.RIGHT, expand=tk.YES, padx='5px', pady='0px')
NFrame = tk.Frame(LinecolorFrame) NFrame = tk.Frame(LinecolorFrame)
NFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px') NFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='2px')
ncollab = tk.Label( ncollab = tk.Label(
NFrame, NFrame,
width=5, width=5,
@@ -443,7 +502,7 @@ class OPTGUI:
UFrame = tk.Frame(LinecolorFrame) UFrame = tk.Frame(LinecolorFrame)
UFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px') UFrame.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='2px')
ucollab = tk.Label( ucollab = tk.Label(
UFrame, UFrame,
width=5, width=5,
@@ -460,7 +519,7 @@ class OPTGUI:
ucolopt.pack(side=tk.RIGHT, expand=tk.YES, padx='5px', pady='0px') ucolopt.pack(side=tk.RIGHT, expand=tk.YES, padx='5px', pady='0px')
ColorCon = tk.Frame(LinecolorFrame) ColorCon = tk.Frame(LinecolorFrame)
ColorCon.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px') ColorCon.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='2px')
colorcon = ttk.Button( colorcon = ttk.Button(
ColorCon, ColorCon,
text='Undo', text='Undo',
@@ -496,7 +555,10 @@ class OPTGUI:
text='Confirm', text='Confirm',
width=10, width=10,
command=lambda :[ command=lambda :[
self.func.Colorchoose(self.opthwnd, 0, None, 2), self.func.Colorchoose(
self.opthwnd,
0, None, 2
),
self.func.Linewchoose( self.func.Linewchoose(
self.elinewidth, self.elinewidth,
self.nlinewidth, self.nlinewidth,
@@ -507,8 +569,13 @@ class OPTGUI:
self.cionbox, self.cionbox,
self.ctrobox, self.ctrobox,
self.canglebox, self.canglebox,
self.systemv self.systemv,
self.trackprn,
self.trackint
), ),
self.cfg_get.set('Options_Draw',
'Enable of track',
'%d' % self.enable.get()),
self.opthwnd.destroy() self.opthwnd.destroy()
] ]
) )
+55 -14
View File
@@ -23,10 +23,12 @@ class VIEWGUI:
def __init__(self, hwndparent, func): def __init__(self, hwndparent, func):
# init # init
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
self.text = None
self.func = func self.func = func
self.hwndparent = hwndparent self.hwndparent = hwndparent
self.view = None self.view = None
self.f_path=""
self.initGUI() self.initGUI()
@@ -224,8 +226,13 @@ class VIEWGUI:
### File > Oprn File ### File > Oprn File
filemenu.add_command( filemenu.add_command(
label="Open File", label="Open File",
command=lambda: self.View_windowshow(text, self.view), command=self.View_windowshow,
accelerator='Ctrl+F' accelerator='Ctrl+O'
)
filemenu.add_command(
label="Save File",
command=self.Save_file,
accelerator='Ctrl+S'
) )
### File > Exit ### File > Exit
filemenu.add_command( filemenu.add_command(
@@ -242,7 +249,7 @@ class VIEWGUI:
xbar = tk.Scrollbar(self.view, orient=tk.HORIZONTAL) xbar = tk.Scrollbar(self.view, orient=tk.HORIZONTAL)
xbar.pack(side=tk.BOTTOM, fill=tk.X) xbar.pack(side=tk.BOTTOM, fill=tk.X)
text = tk.Text( self.text = tk.Text(
self.view, self.view,
xscrollcommand=xbar.set, xscrollcommand=xbar.set,
yscrollcommand=ybar.set, yscrollcommand=ybar.set,
@@ -251,23 +258,57 @@ class VIEWGUI:
autoseparators=False, autoseparators=False,
wrap='none' wrap='none'
) )
text.pack(side=tk.TOP, fill=tk.BOTH) self.text.pack(side=tk.TOP, fill=tk.BOTH)
ybar.config(command=text.yview) ybar.config(command=self.text.yview)
xbar.config(command=text.xview) xbar.config(command=self.text.xview)
def View_windowshow(self, text, view): def View_windowshow(self):
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
# > # >
# Method: # Method:
# Brief : # Brief :
# Author: @KenanZhu All Right Reserved. # Author: @KenanZhu All Right Reserved.
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
f_path = filedialog.askopenfilename(parent=view) self.f_path = filedialog.askopenfilename(parent=self.view)
if not f_path: if not self.f_path:
return 0 return 0
self.view.title('Viewing: %s' % f_path) self.view.title('Viewing: %s' % self.f_path)
text.delete('1.0', 'end') self.text.delete('1.0', 'end')
with open(f_path, 'r') as f: with open(self.f_path,'r',encoding='utf-8') as f:
fcon = f.read() fcon = f.read()
text.insert('insert', fcon) self.text.insert('insert', fcon)
text.config() self.text.config()
def Save_file(self):
filecontent = self.text.get('1.0', 'end')
if self.f_path:
with open(self.f_path,'w',encoding='utf-8') as f:
f.write(filecontent)
else:
if not filecontent=='\n':
fpath = filedialog.asksaveasfilename(
defaultextension='.txt',
parent=self.view,
title='Save As:',
filetypes=[
('Text File(*.txt)', '*.txt'),
('Solution File(*.ksln)', '*.ksln'),
('Solution File(*.ssln)', '*.ssln'),
('RINEX NAV File(*.*nav.*.hnav.*.gnav.*.qnav.*.*n.*.*g.*.*h.*.*q.*.*p)',
'*.*nav;*.hnav;*.gnav;*.qnav;*.*n;*.*g;*.*h;*.*q;*.*p'),
('RINEX OBS File(*.o*.*.*obs.*.*d)', '*.*o;*.*obs;*.*d'),
('All Files', '*.*')])
try:
with open(fpath,'w',encoding='utf-8') as f:
f.write(filecontent)
except FileNotFoundError:
self.view.title('Fail to save: %s' % fpath)
return
self.view.title('Viewing : %s' % fpath)
else:
return
+3 -2
View File
@@ -377,7 +377,7 @@ extern void read_n_b(FILE*, pnav_body);
extern void read_o_h(FILE*, pobs_head); extern void read_o_h(FILE*, pobs_head);
extern void read_o_eb(FILE*, pobs_head, pobs_epoch, pobs_body); extern void read_o_eb(FILE*, pobs_head, pobs_epoch, pobs_body);
//Contain in solutionout.cpp //Contain in solutionout.cpp
extern FILE* headerout(pobs_head obs_h, char obs_path[MAXPATH], char nav_path[MAXPATH], char res_path[MAXPATH]); extern FILE* headerout(pobs_head obs_h, int mode, char obs_path[MAXPATH], char nav_path[MAXPATH], char res_path[MAXPATH]);
extern void solution(FILE* res_file, pobs_head obs_h, double X, double Y, double Z); extern void solution(FILE* res_file, pobs_head obs_h, double X, double Y, double Z);
extern void outdata(blh blh, FILE* res_file, int sPRN, int GNSS); extern void outdata(blh blh, FILE* res_file, int sPRN, int GNSS);
//Entry function //Entry function
@@ -388,5 +388,6 @@ extern "C" _declspec(dllexport) double brdm2pos(
int GNSS, int GNSS,
int Hangle, int Hangle,
int ionopt, int ionopt,
int tropopt); int tropopt,
int genmode);
+72 -3
View File
@@ -294,7 +294,7 @@ int sat_pos_cal(pobs_head obs_h, pobs_epoch obs_e, pobs_body obs_b,
obs.Per2[k] = obs_b->obs_glo[j][code2type(C2, obs_h->obstypenum_glo, obs_h->obscode_glo)]; obs.Per2[k] = obs_b->obs_glo[j][code2type(C2, obs_h->obstypenum_glo, obs_h->obscode_glo)];
obs.freq1 = FREQ1_GLO; obs.freq2 = FREQ2_GLO; obs.freq1 = FREQ1_GLO; obs.freq2 = FREQ2_GLO;
break;} break;}
outdata(in_blh, solu, sPRN, GNSS); k++; outdata(in_blh, solu, sPRN, GNSS); k++;
}; };
} }
@@ -332,6 +332,64 @@ int sat_pos_cal(pobs_head obs_h, pobs_epoch obs_e, pobs_body obs_b,
free(in_lsq.B); free(in_lsq.P); free(in_lsq.L); free(in_lsq.B); free(in_lsq.P); free(in_lsq.L);
return 1; return 1;
} }
/**/
int sat_cal(pnav_body nav_b, pobs_head obs_h, FILE* solu,int satnum, int GNSS) {
int ii, i, sPRN=0;
double Min, min, Weeksec=0, Beginsec, STOP;
pos_ts pos = { 0 };
blh in_blh = { 0 };
Beginsec = time2gpst(
obs_h->f_y,
obs_h->f_m,
obs_h->f_d,
obs_h->f_h,
obs_h->f_min,
obs_h->f_sec
);
for (i = 0; i < satnum; i++) {
switch (GNSS){
case GPS:if (nav_b[i].sPRN_GPS == -1) { continue; }
Weeksec =
fabs(sPRN - nav_b[i].sPRN_GPS) > 0 ? Beginsec : Weeksec;
sPRN = nav_b[i].sPRN_GPS;
STOP = 3600.0;
break;
case BDS:if (nav_b[i].sPRN_BDS == -1) { continue; }
Weeksec =
fabs(sPRN - nav_b[i].sPRN_BDS) > 0 ? Beginsec : Weeksec;
sPRN = nav_b[i].sPRN_BDS;
STOP = 1800.0;
break;
case GAL:if (nav_b[i].sPRN_GAL == -1) { continue; }
Weeksec =
fabs(sPRN - nav_b[i].sPRN_GAL) > 0 ? Beginsec : Weeksec;
sPRN = nav_b[i].sPRN_GAL;
STOP = 300.0;
break;
case GLO:if (nav_b[i].sPRN_GLO == -1) { continue; }
Weeksec =
fabs(sPRN - nav_b[i].sPRN_GLO) > 0 ? Beginsec : Weeksec;
sPRN = nav_b[i].sPRN_GLO;
STOP = 900.0;
break;
}
for (Weeksec; fabs(Weeksec-nav_b[i].TOE)<=3600.0; Weeksec += 30.0) {
if (Weeksec - Beginsec == 86400.0) {
break;
}
pos = sat_pos(sPRN, i, Weeksec, GNSS, nav_b, obs_h, pos);
in_blh = xyz2blh(in_blh, pos.X, pos.Y, pos.Z);
outdata(in_blh, solu, sPRN, GNSS);
fprintf(solu, ">>%05d", (int)(Weeksec-Beginsec)/30+1);
}
}return 0;
}
/** /**
* The entrance of function. * The entrance of function.
* *
@@ -339,6 +397,10 @@ int sat_pos_cal(pobs_head obs_h, pobs_epoch obs_e, pobs_body obs_b,
* \param obs_path: The RINEX observation file's path * \param obs_path: The RINEX observation file's path
* \param res_path: The satellite position solution output path * \param res_path: The satellite position solution output path
* \param GNSS: GNSS code * \param GNSS: GNSS code
* \param Hangle :
* \param ionopt :
* \param troopt :
* \param genmode:
* \return * \return
* -1 ,Can not open the nav file * -1 ,Can not open the nav file
* -2 ,Can not open the obs file * -2 ,Can not open the obs file
@@ -356,7 +418,8 @@ double brdm2pos(
int GNSS, int GNSS,
int Hangle, int Hangle,
int ionopt, int ionopt,
int tropopt int tropopt,
int genmode
) )
{ {
int satnum, epochnum, result = 0; int satnum, epochnum, result = 0;
@@ -413,7 +476,13 @@ double brdm2pos(
obs_h->apL = apblh.L; obs_h->apL = apblh.L;
obs_h->apH = apblh.H; obs_h->apH = apblh.H;
FILE* solu = headerout(obs_h, obs_path, nav_path, res_path); FILE* solu = headerout(obs_h, genmode, obs_path, nav_path, res_path);
if (genmode == 1) {
sat_cal(nav_b, obs_h, solu, satnum, GNSS);
fprintf(solu, "\nEND");
fclose(solu);
return 0;
}
//Begin to calculate //Begin to calculate
for (int i = 0; i < epochnum; i++) { for (int i = 0; i < epochnum; i++) {
+4 -2
View File
@@ -158,7 +158,7 @@ stations designmat(pobs_head obs_h, acct_obs obs,
return sta; return sta;
} }
/*Output the header data of satllite position solution*/ /*Output the header data of satllite position solution*/
FILE* headerout(pobs_head obs_h, FILE* headerout(pobs_head obs_h, int mode,
char obs_path[MAXPATH], char nav_path[MAXPATH], char res_path[MAXPATH]) char obs_path[MAXPATH], char nav_path[MAXPATH], char res_path[MAXPATH])
{ {
time_t gen_time; time_t gen_time;
@@ -169,7 +169,9 @@ FILE* headerout(pobs_head obs_h,
FILE* result_file = fopen(res_path, "a+"); FILE* result_file = fopen(res_path, "a+");
fprintf(result_file, ">GENERATE PROGRAM : KNZ_GeoTrackLab ver%s\n", KNZ_GTL_VER); fprintf(result_file, ">GENERATE PROGRAM : KNZ_GeoTrackLab ver%s\n", KNZ_GTL_VER);
fprintf(result_file, " GENERATE SOURCE : %.10s\n", obs_h->marker); fprintf(result_file, " GENERATE SOURCE : %.10s\n", obs_h->marker);
fprintf(result_file, " GENERATE TYPE : Satellite Position\n");
if (mode != 1); fprintf(result_file, " GENERATE TYPE : Position Resolve\n");
if (mode == 0); fprintf(result_file, " GENERATE TYPE : Satellite Position\n");
fprintf(result_file, " GENERATE TIME : %s", ctime(&gen_time)); fprintf(result_file, " GENERATE TIME : %s", ctime(&gen_time));
fprintf(result_file, " OBS FILE PATH : %s\n", obs_path); fprintf(result_file, " OBS FILE PATH : %s\n", obs_path);
fprintf(result_file, " NAV FILE PATH : %s\n", nav_path); fprintf(result_file, " NAV FILE PATH : %s\n", nav_path);