Skip to content
Commits on Source (4)
Metadata-Version: 1.1
Name: totalopenstation
Version: 0.5.0
Version: 0.5.1
Summary: Download and export survey data from your total station
Home-page: https://tops.iosa.it/
Author: Stefano Costa
......
totalopenstation (0.5.1-1) unstable; urgency=medium
* New upstream release
-- Matteo F. Vescovi <mfv@debian.org> Tue, 21 Jan 2020 23:09:00 +0100
totalopenstation (0.5.0-1) unstable; urgency=medium
[ Matteo F. Vescovi ]
......
import sys
if not('.' in sys.path): sys.path.append('.')
import math
from Tkinter import *
from tkFileDialog import *
from tkSimpleDialog import askstring
import math
# thinking in tkinter http://www.ferg.org/thinking_in_tkinter/all_programs.html
class TheGui:
def __init__(self, parent):
#------- frmIn ----------#
# http://effbot.org/tkinterbook/tkinter-widget-styling.htm
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.lblS = Label(self.frmOut, text='Occupation point[grid coords]', bg = 'red', width=450)
self.lblS.pack()
self.xs = Label(self.frmOut, text='x:', width=2)
self.xs.pack(side=LEFT)
self.xs = StringVar() # coord x of occupation point
self.entSx = Entry(self.frmOut, width=20, textvariable=self.xs)
self.xs.set('6020279.50')
self.entSx.pack(side=LEFT)
self.ys = Label(self.frmOut, text='y:', width=2)
self.ys.pack(side=LEFT)
self.ys = StringVar() # coord y of occupation point
self.entSy = Entry(self.frmOut, width=20, textvariable=self.ys)
self.entSy.pack(side=LEFT)
self.ys.set('6430432.70')
###########################################################################################
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.lblOut = Label(self.frmOut, text='Base point[grid coords]', bg = 'red', width=450)
self.lblOut.pack()
self.xa = Label(self.frmOut, text='x:', width=2)
self.xa.pack(side=LEFT)
self.xa = StringVar() # coord x of base point
self.entIn = Entry(self.frmOut, width=20, textvariable=self.xa)
self.entIn.pack(side=LEFT)
self.xa.set('6020273.90')
self.ya = Label(self.frmOut, text='y:', width=2)
self.ya.pack(side=LEFT)
self.ya = StringVar() # coord y of base point
self.entIn = Entry(self.frmOut, width=20, textvariable=self.ya)
self.entIn.pack(side=LEFT)
self.ya.set('6430341.40')
##################################################################################################
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.lblOut = Label(self.frmOut, text='Control point[grid coords]', bg = 'red', width=450)
self.lblOut.pack()
self.xb = Label(self.frmOut, text='x:', width=2)
self.xb.pack(side=LEFT)
self.xb = StringVar() # coord x of control point
self.entIn = Entry(self.frmOut, width=20, textvariable=self.xb)
self.entIn.pack(side=LEFT)
self.xb.set('6020296.10')
self.yb = Label(self.frmOut, text='y:', width=2)
self.yb.pack(side=LEFT)
self.yb = StringVar() # coord y of control point
self.entIn = Entry(self.frmOut, width=20, textvariable=self.yb)
self.entIn.pack(side=LEFT)
self.yb.set('6430482.80')
############################################################################
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.AngleSA = Label(self.frmOut, text='Base point angle[gons]:', width=20)
self.AngleSA.pack(side=LEFT)
self.AngleSA = StringVar()
self.entIn = Entry(self.frmOut, width=20, textvariable=self.AngleSA)
self.entIn.pack(side=LEFT)
self.AngleSA.set('0.0000')
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.AngleSB = Label(self.frmOut, text='Control point angle[gons]:', width=20)
self.AngleSB.pack(side=LEFT)
self.AngleSB = StringVar()
self.entIn = Entry(self.frmOut, width=20, textvariable=self.AngleSB)
self.entIn.pack(side=LEFT)
self.AngleSB.set('183.5311')
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.AngleSP = Label(self.frmOut, text='Calculated point angle[gons]', width=20)
self.AngleSP.pack(side=LEFT)
self.AngleSP = StringVar()
self.entIn = Entry(self.frmOut, width=20, textvariable=self.AngleSP)
self.entIn.pack(side=LEFT)
self.AngleSP.set('91.2643')
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.dSP = Label(self.frmOut, text='Horizontal distance[m]:', width=20)
self.dSP.pack(side=LEFT)
self.dSP = StringVar()
self.entIn = Entry(self.frmOut, width=20, text='x', textvariable=self.dSP)
self.entIn.pack(side=LEFT)
self.dSP.set('54.26')
#------- frmButtons ----------#
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.btnConvert = Button(self.frmOut,
text='Calculate', command=self.btnConvertClick)
self.btnConvert.pack()
self.frmOut = Frame(parent, bd=5)
self.frmOut.pack()
self.lblOut = Label(self.frmOut, text='Calculated point coordinates',bg = 'red', width=450)
self.lblOut.pack()
self.xp = Label(self.frmOut, text='x:', width=2)
self.xp.pack(side=LEFT)
self.xp = StringVar()
self.entIn = Entry(self.frmOut, width=20, textvariable=self.xp)
self.entIn.pack(side=LEFT)
self.yp = Label(self.frmOut, text='y:', width=2)
self.yp.pack(side=LEFT)
self.yp = StringVar()
self.entIn = Entry(self.frmOut, width=20, textvariable=self.yp)
self.entIn.pack(side=LEFT)
#------- handle commands ----------#
def btnConvertClick(self):
xs = float(self.xs.get())
ys = float(self.ys.get())
xa = float(self.xa.get())
ya = float(self.ya.get())
xb = float(self.xb.get())
yb = float(self.yb.get())
ka = float(self.AngleSA.get())
kb = float(self.AngleSB.get())
kp = float(self.AngleSP.get())
dsp = float(self.dSP.get())
pi = math.pi
dx = xa - xs
dy = ya - ys
bdx = xb - xs
bdy = yb - ys
n = dy/dx# in radians
if dy ==0:
if dy>0:
A1 = pi/2
else:
A1 = 1.5 * pi
else:
A1 = math.atan(dy/dx)
if dx < 0:
A1 = A1 + pi
elif dy < 0:
A1 = A1 + 2 * pi
dd = A1 *200/pi
if bdy ==0:
if bdy>0:
A2 = pi/2
else:
A2 = 1.5 * pi
else:
A2 = math.atan(bdy/bdx)
if bdx < 0:
A2 = A2 + pi
elif bdy < 0:
A2 = A2 + 2 * pi
ss = A2 *200/pi
y1 = (A1 * 200/pi) - ka
y2 = (A2 * 200/pi) - kb
if y2 < 0:
y2 = y2 +400
Y = (y1 + y2)/2
A3 = (Y + kp)
aa = A3 * pi/200.0
xp = xs + dsp * math.cos(aa)
yp = ys + dsp * math.sin(aa)
print xp, yp
self.xp.set(str(xp))
self.yp.set(str(yp))
root = Tk()
root.title("Obliczenia biegunowe v.0.2")
#http://infohost.nmt.edu/tcc/help/pubs/tkinter/std-attrs.html#geometry
#http://infohost.nmt.edu/tcc/help/pubs/tkinter/toplevel.html
root.geometry("450x500+10+10")
gui = TheGui(root)
root.mainloop()
Start Date: 02-02-2012
Start Time: 13:28:24
Last Modified Date: 09-03-2004
Last Modified Time: 11:21:39
Occupied Pt:1
Backsight Pt:
Backsight Azi:0.0000
Metric
cl_file_offsetstakeout=
pro_file_offsetstakeout=
Backsight Circle:0.0000
F1 Zenith Angle:0.0000
job_info_baseinfo= base_lat_rad=0.000000000000 base_long_rad=0.000000000000 base_elev_m=0.0000 base_id=
f_name=
loc_name_rtk=
loc_name_itrf=
m_base_translation_filename=
m_apply_base_translation=0
istsfseries=0
geo_on=0
auto_align=0
bGeotiffFile=0
bImpDXFDWGOpt=1
bDefCsv=0
zone27=0
zone83=0
zone3TM=0
zoneNZCS=0
zoneNTF=0
is_sp27=999
rigid_on=0
rotate_only=0
use_controlfile=0
c_and_r=0
use_slc=0
apply_gnd2grd=0
apply_grd2gnd=0
project_scale_gps=1.000000000000
project_scale_ts=1.000000000000
project_scale_gps_north=0.000000000000
project_scale_gps_east=0.000000000000
project_ptstr=
m_gps_combined_scale_factor= edit_combined=1 north=-999999.000000 east=-999999.000000 elev=-999999.000000 grid=1.000000000000000 sea_level=1.000000000000000 combined=1.000000000000000
m_ts_combined_scale_factor= edit_combined=1 north=-999999.000000 east=-999999.000000 elev=-999999.000000 grid=1.000000000000000 sea_level=1.000000000000000 combined=1.000000000000000
is_north_azi=1
orient_stk_view_gps=0
orient_stk_view_ts=100
gsf_file=\Built-in Storage\Data\geoid_PL.gsf
uGeoid_Interp_Method=1
last_sys_file=C:\SurvCEDemo\Data\DEBNICA.sys
crdsys_name=POLAND/2000/zone 18
m_szDatumName=WGS 84
m_szEllipsoidName=WGS 84
m_EllipsInt=999
m_dA=6378137.00000000
m_dF=0.003352810664747
m_dK=0.0000000000
m_dDX=0.00000000
m_dDY=0.00000000
m_dDZ=0.00000000
m_dRX=0.0000000000
m_dRY=0.0000000000
m_dRZ=0.0000000000
m_ProjInt=1
m_szProjName=Transverse_Mercator
m_dFalseEastings=6500000.00000000
m_dFalseNorthings=0.00000000
m_dCentralMeridian=18.000000000000000
m_dCentralOrNorthLatitude=0.000000000000000
m_dScaleOrRefLatitude=0.000000000000000
m_dSkewOrSouthLatitude=0.000000000000000
m_zone_width=6.0000
m_projection_scale=0.9999230000
m_latOrigin=0.000000000000000
m_lonOrigin=18.000000000000000
m_T1=0.00000000
m_T2=0.00000000
m_T3=0.00000000
m_T4=0.00000000
m_T5=0.00000000
m_T6=0.00000000
m_T7=0.00000000
m_T8=0.00000000
m_T9=0.00000000
m_T10=0.00000000
m_T11=0.00000000
m_bWGS84geoid=1
m_denmark_area=0
m_rectified_grid_angle=0.000000000000000
nz_circuit=-1
store_slope_cut=0
incl_progr_rep=1
m_convert_WGS84_to_NAD83=0
sim_lat=42.362803190000
sim_lon=-71.141943700000
sim_elv=-9.65600
orient_stake_ptstr=
orient_stake_ptstr_ts=
showPointNotes=0
uUseHighestPtIDStore=1
bVertinStakeCL=0
currentSiteUniqID=0
e-dif_Auto-recalibrated=1
cutsheet_type=0
isEnv3D=1
PT_ID:1
HSIG,0.052
VSIG,0.047
STATUS,FIXED
SATS,8
PDOP,1.949
HDOP,1.081
VDOP,1.621
DATE,09-03-2004
TIME,10:53:18
PT_ID:2
HSIG,0.049
VSIG,0.046
STATUS,FIXED
SATS,8
PDOP,1.950
HDOP,1.082
VDOP,1.623
DATE,09-03-2004
TIME,10:53:40
PT_ID:3
HSIG,0.044
VSIG,0.042
STATUS,FIXED
SATS,8
PDOP,1.952
HDOP,1.082
VDOP,1.624
DATE,09-03-2004
TIME,10:54:05
PT_ID:4
HSIG,0.044
VSIG,0.042
STATUS,FIXED
SATS,8
PDOP,1.952
HDOP,1.083
VDOP,1.625
DATE,09-03-2004
TIME,10:54:18
PT_ID:5
HSIG,0.044
VSIG,0.042
STATUS,FIXED
SATS,8
PDOP,1.953
HDOP,1.083
VDOP,1.625
DATE,09-03-2004
TIME,10:54:31
PT_ID:6
HSIG,0.046
VSIG,0.045
STATUS,FIXED
SATS,8
PDOP,1.956
HDOP,1.084
VDOP,1.628
DATE,09-03-2004
TIME,10:55:21
PT_ID:7
HSIG,0.049
VSIG,0.047
STATUS,FIXED
SATS,8
PDOP,1.957
HDOP,1.084
VDOP,1.629
DATE,09-03-2004
TIME,10:55:56
PT_ID:8
HSIG,0.058
VSIG,0.066
STATUS,FIXED
SATS,7
PDOP,2.065
HDOP,1.227
VDOP,1.661
DATE,09-03-2004
TIME,10:57:37
PT_ID:9
HSIG,0.087
VSIG,0.164
STATUS,FIXED
SATS,6
PDOP,5.073
HDOP,2.819
VDOP,4.217
DATE,09-03-2004
TIME,10:58:05
PT_ID:10
HSIG,0.054
VSIG,0.063
STATUS,FIXED
SATS,7
PDOP,2.031
HDOP,1.186
VDOP,1.649
DATE,09-03-2004
TIME,10:58:39
PT_ID:11
HSIG,0.109
VSIG,0.234
STATUS,FIXED
SATS,4
PDOP,6.974
HDOP,3.666
VDOP,5.933
DATE,09-03-2004
TIME,10:59:22
PT_ID:12
HSIG,0.110
VSIG,0.233
STATUS,FIXED
SATS,4
PDOP,6.937
HDOP,3.640
VDOP,5.905
DATE,09-03-2004
TIME,10:59:57
PT_ID:13
HSIG,0.083
VSIG,0.078
STATUS,FIXED
SATS,7
PDOP,2.256
HDOP,1.253
VDOP,1.876
DATE,09-03-2004
TIME,11:01:33
PT_ID:14
HSIG,0.122
VSIG,0.123
STATUS,FIXED
SATS,7
PDOP,6.056
HDOP,3.093
VDOP,5.206
DATE,09-03-2004
TIME,11:01:51
PT_ID:15
HSIG,0.066
VSIG,0.074
STATUS,FIXED
SATS,7
PDOP,2.444
HDOP,1.297
VDOP,2.071
DATE,09-03-2004
TIME,11:01:59
PT_ID:16
HSIG,0.066
VSIG,0.072
STATUS,FIXED
SATS,7
PDOP,2.453
HDOP,1.297
VDOP,2.082
DATE,09-03-2004
TIME,11:02:49
PT_ID:17
HSIG,0.076
VSIG,0.077
STATUS,FIXED
SATS,6
PDOP,2.454
HDOP,1.297
VDOP,2.083
DATE,09-03-2004
TIME,11:02:57
PT_ID:18
HSIG,0.068
VSIG,0.085
STATUS,FIXED
SATS,7
PDOP,2.498
HDOP,1.295
VDOP,2.136
DATE,09-03-2004
TIME,11:07:27
PT_ID:19
HSIG,0.066
VSIG,0.086
STATUS,FIXED
SATS,7
PDOP,2.500
HDOP,1.295
VDOP,2.139
DATE,09-03-2004
TIME,11:07:45
PT_ID:20
HSIG,0.085
VSIG,0.133
STATUS,FIXED
SATS,6
PDOP,4.043
HDOP,2.460
VDOP,3.209
DATE,09-03-2004
TIME,11:07:54
PT_ID:21
HSIG,0.095
VSIG,0.154
STATUS,FIXED
SATS,7
PDOP,2.506
HDOP,1.294
VDOP,2.146
DATE,09-03-2004
TIME,11:08:30
PT_ID:22
HSIG,0.063
VSIG,0.071
STATUS,FIXED
SATS,8
PDOP,2.510
HDOP,1.294
VDOP,2.150
DATE,09-03-2004
TIME,11:08:58
PT_ID:23
HSIG,0.049
VSIG,0.052
STATUS,FIXED
SATS,8
PDOP,1.947
HDOP,1.098
VDOP,1.607
DATE,09-03-2004
TIME,11:09:30
PT_ID:24
HSIG,0.059
VSIG,0.072
STATUS,FIXED
SATS,7
PDOP,2.518
HDOP,1.294
VDOP,2.160
DATE,09-03-2004
TIME,11:10:11
PT_ID:25
HSIG,0.059
VSIG,0.068
STATUS,FIXED
SATS,7
PDOP,2.521
HDOP,1.294
VDOP,2.163
DATE,09-03-2004
TIME,11:10:38
PT_ID:26
HSIG,0.054
VSIG,0.064
STATUS,FIXED
SATS,7
PDOP,2.522
HDOP,1.293
VDOP,2.166
DATE,09-03-2004
TIME,11:11:01
PT_ID:27
HSIG,0.061
VSIG,0.072
STATUS,FIXED
SATS,7
PDOP,2.525
HDOP,1.293
VDOP,2.169
DATE,09-03-2004
TIME,11:11:27
PT_ID:28
HSIG,0.115
VSIG,0.197
STATUS,FIXED
SATS,6
PDOP,4.170
HDOP,2.531
VDOP,3.314
DATE,09-03-2004
TIME,11:11:46
PT_ID:29
HSIG,0.101
VSIG,0.159
STATUS,FIXED
SATS,7
PDOP,2.529
HDOP,1.293
VDOP,2.173
DATE,09-03-2004
TIME,11:12:15
PT_ID:30
HSIG,0.059
VSIG,0.066
STATUS,FIXED
SATS,7
PDOP,2.531
HDOP,1.293
VDOP,2.175
DATE,09-03-2004
TIME,11:12:37
PT_ID:31
HSIG,0.056
VSIG,0.063
STATUS,FIXED
SATS,7
PDOP,2.532
HDOP,1.293
VDOP,2.177
DATE,09-03-2004
TIME,11:12:53
PT_ID:32
HSIG,0.060
VSIG,0.067
STATUS,FIXED
SATS,7
PDOP,2.535
HDOP,1.292
VDOP,2.181
DATE,09-03-2004
TIME,11:13:46
PT_ID:33
HSIG,0.080
VSIG,0.070
STATUS,FIXED
SATS,6
PDOP,2.783
HDOP,1.486
VDOP,2.353
DATE,09-03-2004
TIME,11:14:16
PT_ID:34
HSIG,0.066
VSIG,0.068
STATUS,FIXED
SATS,7
PDOP,2.537
HDOP,1.292
VDOP,2.184
DATE,09-03-2004
TIME,11:14:44
PT_ID:35
HSIG,0.086
VSIG,0.104
STATUS,FIXED
SATS,7
PDOP,2.538
HDOP,1.292
VDOP,2.185
DATE,09-03-2004
TIME,11:15:14
PT_ID:36
HSIG,0.063
VSIG,0.072
STATUS,FIXED
SATS,7
PDOP,2.539
HDOP,1.291
VDOP,2.186
DATE,09-03-2004
TIME,11:15:43
PT_ID:37
HSIG,0.066
VSIG,0.075
STATUS,FIXED
SATS,7
PDOP,2.540
HDOP,1.291
VDOP,2.187
DATE,09-03-2004
TIME,11:16:10
PT_ID:38
HSIG,0.087
VSIG,0.105
STATUS,FIXED
SATS,6
PDOP,4.252
HDOP,2.221
VDOP,3.626
DATE,09-03-2004
TIME,11:16:40
PT_ID:39
HSIG,0.085
VSIG,0.103
STATUS,FIXED
SATS,6
PDOP,4.232
HDOP,2.211
VDOP,3.608
DATE,09-03-2004
TIME,11:17:03
PT_ID:40
HSIG,0.092
VSIG,0.114
STATUS,FIXED
SATS,7
PDOP,2.540
HDOP,1.291
VDOP,2.188
DATE,09-03-2004
TIME,11:17:21
PT_ID:41
HSIG,0.066
VSIG,0.065
STATUS,FIXED
SATS,6
PDOP,2.849
HDOP,1.495
VDOP,2.425
DATE,09-03-2004
TIME,11:17:47
PT_ID:42
HSIG,0.646
VSIG,0.909
STATUS,FIXED
SATS,5
PDOP,5.806
HDOP,2.532
VDOP,5.224
DATE,09-03-2004
TIME,11:18:07
PT_ID:43
HSIG,0.103
VSIG,0.115
STATUS,FIXED
SATS,7
PDOP,3.624
HDOP,2.153
VDOP,2.915
DATE,09-03-2004
TIME,11:18:52
PT_ID:44
HSIG,0.061
VSIG,0.058
STATUS,FIXED
SATS,8
PDOP,2.164
HDOP,1.271
VDOP,1.752
DATE,09-03-2004
TIME,11:19:23
PT_ID:45
HSIG,0.062
VSIG,0.058
STATUS,FIXED
SATS,8
PDOP,2.169
HDOP,1.271
VDOP,1.757
DATE,09-03-2004
TIME,11:19:51
PT_ID:46
HSIG,0.061
VSIG,0.059
STATUS,FIXED
SATS,8
PDOP,2.171
HDOP,1.271
VDOP,1.760
DATE,09-03-2004
TIME,11:20:10
PT_ID:47
HSIG,0.070
VSIG,0.080
STATUS,FIXED
SATS,8
PDOP,2.182
HDOP,1.270
VDOP,1.775
DATE,09-03-2004
TIME,11:21:40
This diff is collapsed.
COMPD_CS["POLAND/2000/zone 18",PROJCS["",GEOGCS["",DATUM["WGS 84",SPHEROID["WGS 84",6378137,298.257223563],TOWGS84[0, 0, 0, 0, 0, 0, 0]],PRIMEM["Greenwich",0],UNIT["Radians",1],AXIS["Long",East],AXIS["Lat",North]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",18],PARAMETER["scale_factor",0.999923],PARAMETER["zone_width",6],PARAMETER["false_easting",6500000],PARAMETER["false_northing",0],UNIT["Meters",1],AXIS["East",East],AXIS["North",North]],VERT_CS["",VERT_DATUM["Ellipsoid",2002],UNIT["Meters",1],AXIS["Height",Up]]];
4462394.94536224010000,0.00000000000000,0.00000000000000,6445981.36148124560000,6028962.66072362100000,55.42535995019709,0.00000000000000,0.00000000000000,Y,Y,1, Uzytkownika: POLAND/2000/zone 18,GEOID=\Built-in Storage\Data\geoid_PL.gsf
Metadata-Version: 1.1
Name: totalopenstation
Version: 0.5.0
Version: 0.5.1
Summary: Download and export survey data from your total station
Home-page: https://tops.iosa.it/
Author: Stefano Costa
......
......@@ -42,26 +42,41 @@ docs/models/main.rst
docs/models/model_implemented.rst
docs/output_formats/main.rst
docs/output_formats/of_implemented.rst
locale/de/LC_MESSAGES/messages.mo
locale/de/LC_MESSAGES/messages.po
locale/el/LC_MESSAGES/messages.mo
locale/el/LC_MESSAGES/messages.po
locale/es_ES/LC_MESSAGES/messages.mo
locale/es_ES/LC_MESSAGES/messages.po
locale/fa/LC_MESSAGES/messages.mo
locale/fa/LC_MESSAGES/messages.po
locale/fr/LC_MESSAGES/messages.mo
locale/fr/LC_MESSAGES/messages.po
locale/hu/LC_MESSAGES/messages.po
locale/it/LC_MESSAGES/messages.mo
locale/it/LC_MESSAGES/messages.po
locale/nb_NO/LC_MESSAGES/messages.po
locale/nl_NL/LC_MESSAGES/messages.po
locale/pl/LC_MESSAGES/messages.mo
locale/pl/LC_MESSAGES/messages.po
locale/pt_BR/LC_MESSAGES/messages.po
locale/pt_PT/LC_MESSAGES/messages.po
locale/tr/LC_MESSAGES/messages.mo
locale/tr/LC_MESSAGES/messages.po
sample_data/leica_tcr_1205
sample_data/leica_tcr_705
sample_data/sokkia_sdr33.tops
sample_data/topcon_gts_229
sample_data/zeiss_elta_r55
sample_data/carlson_rw5/2d_calc.py
sample_data/carlson_rw5/Leica1200.rw5
sample_data/carlson_rw5/Leica1200.rw5.csv
sample_data/carlson_rw5/Trav_19leg.rw5
sample_data/carlson_rw5/carlson_project/DEBNICA.crd
sample_data/carlson_rw5/carlson_project/DEBNICA.inf
sample_data/carlson_rw5/carlson_project/DEBNICA.not
sample_data/carlson_rw5/carlson_project/DEBNICA.rw5
sample_data/carlson_rw5/carlson_project/DEBNICA.sys
sample_data/leica_gsi/leica_gsi16_gurob.gsi
sample_data/leica_gsi/leica_gsi8_ertola.gsi
sample_data/nikon_raw_v200/nikon_dtm.tops
......
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
__version__ = '0.5.1'
import logging
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# filename: upref.py
# Copyright 2015 Stefano Costa <steko@iosa.it>
# Copyright 2019 Stefano Costa <steko@iosa.it>
# Copyright 2010 Luca Bianconi <luxetluc@yahoo.it>
#
# This file is part of Total Open Station.
......@@ -27,7 +27,7 @@ import os.path
from configparser import ConfigParser, NoSectionError, NoOptionError
logger = logging.getLogger(__name__).addHandler(logging.NullHandler())
logger = logging.getLogger(__name__)
class UserPrefs(ConfigParser):
'''Manage user preferences for GUI options and last used values.
......@@ -52,20 +52,25 @@ class UserPrefs(ConfigParser):
self.upref = os.path.expanduser(USER_PREFS_PATH)
if os.path.exists(self.upref):
self.read(self.upref)
try:
with open(self.upref) as f:
self.read(f)
except FileNotFoundError:
self.initfile()
else:
try:
self.getvalue('model')
except NoSectionError:
self.initfile()
elif not os.path.exists(os.path.dirname(self.upref)):
os.mkdir(os.path.dirname(self.upref))
self.initfile()
else:
self.initfile()
def initfile(self):
self.write()
try:
self.write()
except FileNotFoundError:
os.mkdir(os.path.dirname(self.upref))
finally:
self.write()
logger.info('User preferences do not exist!')
self.add_section('topsconfig')
for k,v in list(self.OPTIONS.items()):
......