Merge remote-tracking branch 'origin/main'
This commit is contained in:
2
.idea/Masterprojekt-Campusnetz.iml
generated
2
.idea/Masterprojekt-Campusnetz.iml
generated
@@ -4,7 +4,7 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.14" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.14 (Masterprojekt)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
2482
.idea/dataSources/c385b2f5-c801-4154-bc11-62182a8396b3.xml
generated
2482
.idea/dataSources/c385b2f5-c801-4154-bc11-62182a8396b3.xml
generated
File diff suppressed because it is too large
Load Diff
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,5 +3,5 @@
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.14" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.14" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.14 (Masterprojekt)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
BIN
Campusnetz.db
BIN
Campusnetz.db
Binary file not shown.
118
Campusnetz.ipynb
118
Campusnetz.ipynb
@@ -6,8 +6,8 @@
|
||||
"metadata": {
|
||||
"collapsed": true,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T12:25:40.573167Z",
|
||||
"start_time": "2025-12-09T12:25:40.219840Z"
|
||||
"end_time": "2025-12-10T17:56:08.191585Z",
|
||||
"start_time": "2025-12-10T17:56:07.832678Z"
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
@@ -24,12 +24,13 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T12:25:40.603148Z",
|
||||
"start_time": "2025-12-09T12:25:40.579387Z"
|
||||
"end_time": "2025-12-10T17:56:08.274538Z",
|
||||
"start_time": "2025-12-10T17:56:08.235850Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"importlib.reload(Datenbank)\n",
|
||||
"importlib.reload(Import)\n",
|
||||
"# Anlegen der Datenbank, wenn nicht vorhanden\n",
|
||||
"pfad_datenbank = r\"Campusnetz.db\"\n",
|
||||
@@ -46,14 +47,14 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T12:25:40.629729Z",
|
||||
"start_time": "2025-12-09T12:25:40.608515Z"
|
||||
"end_time": "2025-12-10T17:56:08.297943Z",
|
||||
"start_time": "2025-12-10T17:56:08.279765Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Import der Koordinatendatei(en) vom Tachymeter\n",
|
||||
"pfad_datei = r\"Daten\\campsnetz_final_koordinaten.csv\"\n",
|
||||
"pfad_datei = r\"Daten\\campsnetz_koordinaten_bereinigt.csv\"\n",
|
||||
"imp.import_koordinaten_lh_tachymeter(pfad_datei)"
|
||||
],
|
||||
"id": "d3bce3991a8962dc",
|
||||
@@ -71,8 +72,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T12:25:40.645668Z",
|
||||
"start_time": "2025-12-09T12:25:40.635523Z"
|
||||
"end_time": "2025-12-10T17:56:08.314677Z",
|
||||
"start_time": "2025-12-10T17:56:08.304360Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -121,13 +122,10 @@
|
||||
"[ 99.8946]]), '10002': Matrix([\n",
|
||||
"[ 875.9684],\n",
|
||||
"[1998.5174],\n",
|
||||
"[ 99.5867]]), '100016': Matrix([\n",
|
||||
"[ 99.5867]]), '10016': Matrix([\n",
|
||||
"[ 928.2783],\n",
|
||||
"[1944.0082],\n",
|
||||
"[ 100.0459]]), '10011': Matrix([\n",
|
||||
"[ 908.4308],\n",
|
||||
"[1996.1277],\n",
|
||||
"[ 99.7822]]), '10011a': Matrix([\n",
|
||||
"[844.9567],\n",
|
||||
"[1891.157],\n",
|
||||
"[ 99.8117]]), '10026': Matrix([\n",
|
||||
@@ -208,13 +206,7 @@
|
||||
"[ 100.0148]]), '10050': Matrix([\n",
|
||||
"[1010.0246],\n",
|
||||
"[1726.2445],\n",
|
||||
"[ 100.1493]]), '10049': Matrix([\n",
|
||||
"[ 984.7667],\n",
|
||||
"[1714.5709],\n",
|
||||
"[ 100.0101]]), '100': Matrix([\n",
|
||||
"[ 957.3912],\n",
|
||||
"[1716.2864],\n",
|
||||
"[ 99.7777]]), '10013': Matrix([\n",
|
||||
"[ 100.1493]]), '10013': Matrix([\n",
|
||||
"[900.9076],\n",
|
||||
"[1902.873],\n",
|
||||
"[ 99.7911]]), '10028': Matrix([\n",
|
||||
@@ -247,7 +239,7 @@
|
||||
"[ 99.737]]), '10045': Matrix([\n",
|
||||
"[867.2324],\n",
|
||||
"[1705.063],\n",
|
||||
"[ 99.7214]]), '10049a': Matrix([\n",
|
||||
"[ 99.7214]]), '10049': Matrix([\n",
|
||||
"[ 985.2561],\n",
|
||||
"[1715.2109],\n",
|
||||
"[ 99.9965]]), '10048': Matrix([\n",
|
||||
@@ -283,8 +275,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T12:25:40.666696Z",
|
||||
"start_time": "2025-12-09T12:25:40.654193Z"
|
||||
"end_time": "2025-12-10T17:56:08.325087Z",
|
||||
"start_time": "2025-12-10T17:56:08.319929Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -309,8 +301,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T12:25:40.711147Z",
|
||||
"start_time": "2025-12-09T12:25:40.686969Z"
|
||||
"end_time": "2025-12-10T17:56:08.355544Z",
|
||||
"start_time": "2025-12-10T17:56:08.333320Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -370,8 +362,8 @@
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T12:38:18.913365Z",
|
||||
"start_time": "2025-12-09T12:38:17.077549Z"
|
||||
"end_time": "2025-12-10T17:56:10.662819Z",
|
||||
"start_time": "2025-12-10T17:56:08.361074Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -538,13 +530,13 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 10
|
||||
"execution_count": 7
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T13:21:57.869927Z",
|
||||
"start_time": "2025-12-09T13:21:57.831927Z"
|
||||
"end_time": "2025-12-10T17:56:10.844846Z",
|
||||
"start_time": "2025-12-10T17:56:10.809175Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -561,13 +553,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'100': Matrix([\n",
|
||||
"[3794775.24129598],\n",
|
||||
"[547003.784566026],\n",
|
||||
"[5080016.88582709]]), '100016': Matrix([\n",
|
||||
"[3794804.40667566],\n",
|
||||
"[546789.942078133],\n",
|
||||
"[5080079.63649543]]), '10003': Matrix([\n",
|
||||
"{'10003': Matrix([\n",
|
||||
"[3794820.51175889],\n",
|
||||
"[546738.121545569],\n",
|
||||
"[5080085.66027136]]), '10004': Matrix([\n",
|
||||
@@ -592,9 +578,6 @@
|
||||
"[3794744.05628981],\n",
|
||||
"[546780.742811981],\n",
|
||||
"[ 5080141.1636738]]), '10011': Matrix([\n",
|
||||
"[3794820.53929209],\n",
|
||||
"[546738.130781189],\n",
|
||||
"[ 5080085.6893844]]), '10011a': Matrix([\n",
|
||||
"[3794863.58049222],\n",
|
||||
"[546820.559672293],\n",
|
||||
"[5080009.68904121]]), '10012': Matrix([\n",
|
||||
@@ -609,7 +592,10 @@
|
||||
"[5080061.83762516]]), '10015': Matrix([\n",
|
||||
"[3794815.71134214],\n",
|
||||
"[ 546792.41022388],\n",
|
||||
"[5080067.67633712]]), '10017': Matrix([\n",
|
||||
"[5080067.67633712]]), '10016': Matrix([\n",
|
||||
"[3794804.40667566],\n",
|
||||
"[546789.942078133],\n",
|
||||
"[5080079.63649543]]), '10017': Matrix([\n",
|
||||
"[ 3794800.4139096],\n",
|
||||
"[546829.880936662],\n",
|
||||
"[5080066.46875977]]), '10018': Matrix([\n",
|
||||
@@ -700,9 +686,6 @@
|
||||
"[3794775.20666754],\n",
|
||||
"[ 547003.76019026],\n",
|
||||
"[5080016.84921095]]), '10049': Matrix([\n",
|
||||
"[ 3794755.2599089],\n",
|
||||
"[547011.179377653],\n",
|
||||
"[5080033.23331374]]), '10049a': Matrix([\n",
|
||||
"[3794754.91370463],\n",
|
||||
"[ 547010.69453884],\n",
|
||||
"[5080033.75043702]]), '10050': Matrix([\n",
|
||||
@@ -739,13 +722,13 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": 20
|
||||
"execution_count": 8
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-09T13:25:19.224013Z",
|
||||
"start_time": "2025-12-09T13:25:19.204366Z"
|
||||
"end_time": "2025-12-10T17:56:10.872837Z",
|
||||
"start_time": "2025-12-10T17:56:10.853910Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
@@ -757,7 +740,46 @@
|
||||
],
|
||||
"id": "f6993d81c8a145dd",
|
||||
"outputs": [],
|
||||
"execution_count": 24
|
||||
"execution_count": 9
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-12-10T17:56:10.904556Z",
|
||||
"start_time": "2025-12-10T17:56:10.882418Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Importieren der tachymetrischen Beobachtungen\n",
|
||||
"importlib.reload(Datenbank)\n",
|
||||
"db_zugriff = Datenbank.Datenbankzugriff(pfad_datenbank)\n",
|
||||
"\n",
|
||||
"db_zugriff.get_instrument(\"Tachymeter\")\n",
|
||||
"db_zugriff.set_instrument(\"Tachymeter\", \"Trimble S9\")\n",
|
||||
"db_zugriff.get_instrument(\"Tachymeter\")"
|
||||
],
|
||||
"id": "e376b4534297016c",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Das Instrument Trimble S9 wurde erfolgreich hinzugefügt.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"[(1, 'Tachymeter', 'Trimble S9')]"
|
||||
]
|
||||
},
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"execution_count": 10
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
0
Daten/Campusnetz.db
Normal file
0
Daten/Campusnetz.db
Normal file
1814
Daten/campsnetz_beobachtungen_bereinigt.csv
Normal file
1814
Daten/campsnetz_beobachtungen_bereinigt.csv
Normal file
File diff suppressed because it is too large
Load Diff
59
Daten/campsnetz_koordinaten_bereinigt.csv
Normal file
59
Daten/campsnetz_koordinaten_bereinigt.csv
Normal file
@@ -0,0 +1,59 @@
|
||||
10009;1000;2000;100
|
||||
10006;1000;2032,6863;99,5825
|
||||
10010;1011,8143;1973,3252;99,9259
|
||||
10018;1008,5759;1942,762;100,2553
|
||||
10008;979,7022;1991,401;99,732
|
||||
10005;966,5154;2014,6496;99,72
|
||||
10003;908,4312;1996,1248;99,7403
|
||||
10004;954,1536;2021,6822;99,4916
|
||||
10007;921,7481;1973,6201;99,9176
|
||||
10001;833,9439;1978,3737;99,8946
|
||||
10002;875,9684;1998,5174;99,5867
|
||||
10016;928,2783;1944,0082;100,0459
|
||||
10011;844,9567;1891,157;99,8117
|
||||
10026;1020,0059;1913,8703;100,3059
|
||||
10027;1016,9451;1866,2914;100,3251
|
||||
10043;1031,2077;1822,4739;100,3035
|
||||
10044;1025,976;1782,4835;100,5461
|
||||
10021;992,7607;1904,8854;100,3533
|
||||
10020;984,6187;1903,3601;100,3423
|
||||
10024;997,4831;1881,7862;100,3032
|
||||
10025;996,3241;1866,844;100,4102
|
||||
10022;990,0679;1896,536;100,2194
|
||||
10023;987,3223;1889,8762;100,343
|
||||
10019;962,6387;1902,3565;99,9772
|
||||
10033;964,0191;1860,8023;99,8551
|
||||
10017;931,6761;1900,9945;99,9572
|
||||
10052;1037,875;1757,2999;100,2737
|
||||
10042;1017,3489;1803,0742;100,3441
|
||||
10053;1033,3758;1723,4258;100,2774
|
||||
10037;966,2253;1774,2051;99,9957
|
||||
10040;990,8832;1780,9678;100,1677
|
||||
10041;993,2769;1812,031;100,4749
|
||||
10038;958,1899;1804,7135;100,0741
|
||||
10051;1008,9811;1750,1838;100,288
|
||||
10036;948,6403;1763,5807;100,0063
|
||||
10035;910,1265;1768,0099;100,0781
|
||||
10039;960,3884;1820,0543;100,0983
|
||||
10059;1049,2587;1662,5451;100,0148
|
||||
10050;1010,0246;1726,2445;100,1493
|
||||
10013;900,9076;1902,873;99,7911
|
||||
10028;853,9608;1815,7417;99,7793
|
||||
10012;895,3032;1924,1523;99,8758
|
||||
10014;913,9706;1918,7731;99,8872
|
||||
10031;937,1557;1855,2805;99,8479
|
||||
10015;912,5157;1937,6471;99,9834
|
||||
10032;954,6732;1845,9356;99,724
|
||||
10030;908,4749;1828,8008;99,5581
|
||||
10029;909,3343;1814,8767;99,5486
|
||||
10034;860,2357;1758,9282;99,737
|
||||
10045;867,2324;1705,063;99,7214
|
||||
10049;985,2561;1715,2109;99,9965
|
||||
10048;957,3889;1716,2949;99,7212
|
||||
10047;929,5334;1712,6429;99,6076
|
||||
10046;910,663;1716,0969;99,5459
|
||||
10057;969,6876;1655,597;99,7039
|
||||
10055;922,4731;1647,7452;99,4658
|
||||
10054;860,4481;1636,6722;99,7093
|
||||
10058;1013,2592;1646,6356;99,8513
|
||||
10056;939,9763;1636,4179;99,4027
|
||||
|
1515
Daten/campusnetz_beobachtungen_25_11 - Kopie.csv
Normal file
1515
Daten/campusnetz_beobachtungen_25_11 - Kopie.csv
Normal file
File diff suppressed because it is too large
Load Diff
1524
Daten/campusnetz_beobachtungen_25_11.csv
Normal file
1524
Daten/campusnetz_beobachtungen_25_11.csv
Normal file
File diff suppressed because it is too large
Load Diff
48
Datenbank.py
48
Datenbank.py
@@ -24,6 +24,26 @@ class Datenbank_anlegen:
|
||||
CONSTRAINT pk_Netzpunkte PRIMARY KEY (punktnummer)
|
||||
);
|
||||
""");
|
||||
cursor.executescript("""CREATE TABLE Beobachtungen(
|
||||
beobachtungenID INTEGER,
|
||||
beobachtungsgruppeID INTEGER,
|
||||
punktnummer_sp TEXT(10),
|
||||
punktnummer_zp TEXT(10),
|
||||
instrumenteID INTEGER,
|
||||
tachymeter_richtung NUMERIC(8, 6),
|
||||
tachymeter_zenitwinkel NUMERIC(8, 6),
|
||||
tachymeter_distanz NUMERIC(8, 4),
|
||||
dateiname TEXT(200),
|
||||
CONSTRAINT pk_Beobachtunen PRIMARY KEY (beobachtungenID)
|
||||
);
|
||||
""");
|
||||
cursor.executescript("""CREATE TABLE Instrumente(
|
||||
instrumenteID INTEGER,
|
||||
typ TEXT(200),
|
||||
name TEXT(200),
|
||||
CONSTRAINT pk_Instrumente PRIMARY KEY (instrumenteID)
|
||||
);
|
||||
""")
|
||||
con.commit()
|
||||
cursor.close()
|
||||
con.close()
|
||||
@@ -76,3 +96,31 @@ class Datenbankzugriff:
|
||||
con.commit()
|
||||
cursor.close()
|
||||
con.close()
|
||||
|
||||
def set_instrument(self, typ, name):
|
||||
con = sqlite3.connect(self.pfad_datenbank)
|
||||
cursor = con.cursor()
|
||||
liste_instrumente = cursor.execute("SELECT * FROM Instrumente WHERE typ = ? AND name =?", (typ, name)).fetchall()
|
||||
if liste_instrumente == []:
|
||||
cursor.execute(
|
||||
"INSERT INTO Instrumente (typ, name) VALUES (?, ?)", (typ, name)
|
||||
)
|
||||
print(f"Das Instrument {name} wurde erfolgreich hinzugefügt.")
|
||||
else:
|
||||
id_instrument = cursor.execute(
|
||||
"SELECT instrumenteID FROM Instrumente WHERE typ = ? AND name =?", (typ, name))
|
||||
print(f"Das Instrument {name} ist bereits in der Datenbank vorhanden.\nEs hat die ID {id_instrument.fetchone()[0]}")
|
||||
con.commit()
|
||||
cursor.close()
|
||||
con.close()
|
||||
|
||||
def get_instrument(self, typ):
|
||||
con = sqlite3.connect(self.pfad_datenbank)
|
||||
cursor = con.cursor()
|
||||
liste_instrumente = cursor.execute("SELECT * FROM Instrumente WHERE typ = ?", (typ,)).fetchall()
|
||||
liste_typen = cursor.execute("SELECT DISTINCT typ FROM Instrumente").fetchall()
|
||||
cursor.close()
|
||||
con.close()
|
||||
if liste_instrumente == []:
|
||||
liste_instrumente = f"Kein Instrument vom Typ {typ} gefunden. Folgende Typen stehen aktuell zur Auswahl: {liste_typen}"
|
||||
return liste_instrumente
|
||||
0
Vorbereitungen_Fabian/Campusnetz.db
Normal file
0
Vorbereitungen_Fabian/Campusnetz.db
Normal file
157
Vorbereitungen_Fabian/Import_Tachymeter.py
Normal file
157
Vorbereitungen_Fabian/Import_Tachymeter.py
Normal file
@@ -0,0 +1,157 @@
|
||||
from pathlib import Path
|
||||
import sqlite3
|
||||
from decimal import Decimal, getcontext
|
||||
|
||||
# ToDo: instrumentenID von Anwender übergeben lassen!
|
||||
def string_to_decimal(zahl):
|
||||
zahl = zahl.replace(',', '.')
|
||||
return Decimal(zahl)
|
||||
|
||||
pfad_script = Path(__file__).resolve().parent
|
||||
dateiname = "campsnetz_beobachtungen_bereinigt.csv"
|
||||
pfad_datei = pfad_script.parent / "Daten" / dateiname
|
||||
|
||||
|
||||
# Prüfen, ob Bereits Daten aus der Datei in der Datenbank vorhanden sind
|
||||
pfad_datenbank = pfad_script.parent / "Campusnetz.db"
|
||||
|
||||
instrumentenID = 1
|
||||
|
||||
con = sqlite3.connect(pfad_datenbank)
|
||||
cursor = con.cursor()
|
||||
liste_dateinamen_in_db = [r[0] for r in cursor.execute(
|
||||
"SELECT DISTINCT dateiname FROM Beobachtungen"
|
||||
).fetchall()]
|
||||
liste_beobachtungsgruppeID = [r[0] for r in cursor.execute("""SELECT DISTINCT beobachtungsgruppeID FROM Beobachtungen""").fetchall()]
|
||||
liste_instrumentenid = [r[0] for r in cursor.execute("SELECT instrumenteID FROM Instrumente").fetchall()]
|
||||
|
||||
con.close()
|
||||
cursor.close
|
||||
|
||||
Import_fortsetzen = True
|
||||
|
||||
if dateiname in liste_dateinamen_in_db:
|
||||
Import_fortsetzen = False
|
||||
|
||||
if Import_fortsetzen:
|
||||
nummer_zielpunkt = 0
|
||||
try:
|
||||
nummer_beobachtungsgruppeID = max(liste_beobachtungsgruppeID)
|
||||
except:
|
||||
nummer_beobachtungsgruppeID = 0
|
||||
|
||||
with (open(pfad_datei, "r", encoding="utf-8") as f):
|
||||
liste_fehlerhafte_zeile = []
|
||||
liste_beobachtungen_vorbereitung = []
|
||||
|
||||
for i, zeile in enumerate(f):
|
||||
if i < 3:
|
||||
continue
|
||||
zeile = zeile.strip().split(";")
|
||||
if zeile[1] == "" and zeile[2] == "" and zeile[3] == "":
|
||||
nummer_beobachtungsgruppeID += 1
|
||||
#print("Standpunkt: ",nummer_beobachtungsgruppeID ,zeile[0])
|
||||
standpunkt = zeile[0]
|
||||
|
||||
if nummer_zielpunkt % 6 != 0:
|
||||
liste_fehlerhafte_zeile.append(i)
|
||||
|
||||
nummer_zielpunkt = 0
|
||||
liste_zielpunkte_hs = []
|
||||
liste_zielpunkte_vs2 = []
|
||||
liste_zielpunkte_vs3 = []
|
||||
else:
|
||||
nummer_zielpunkt += 1
|
||||
if zeile[0] not in liste_zielpunkte_hs:
|
||||
liste_zielpunkte_hs.append(zeile[0])
|
||||
if zeile[0] in liste_zielpunkte_vs3:
|
||||
#print(f"{nummer_zielpunkt} VS3 HS1 {zeile}")
|
||||
liste_beobachtungen_vorbereitung.append([nummer_beobachtungsgruppeID,"VS3", "HS1", standpunkt, zeile[0], zeile[1], zeile[2], zeile[3]])
|
||||
elif zeile[0] in liste_zielpunkte_vs2:
|
||||
#print(f"{nummer_zielpunkt} VS2 HS1 {zeile}")
|
||||
liste_beobachtungen_vorbereitung.append([nummer_beobachtungsgruppeID,"VS2", "HS1", standpunkt, zeile[0], zeile[1], zeile[2], zeile[3]])
|
||||
else:
|
||||
#print(f"{nummer_zielpunkt} VS1 HS1 {zeile}")
|
||||
liste_beobachtungen_vorbereitung.append(
|
||||
[nummer_beobachtungsgruppeID,"VS1", "HS1", standpunkt, zeile[0], zeile[1], zeile[2],
|
||||
zeile[3]])
|
||||
|
||||
else:
|
||||
liste_zielpunkte_hs.remove(zeile[0])
|
||||
if zeile[0] in liste_zielpunkte_vs3:
|
||||
#print(f"{nummer_zielpunkt} VS3 HS2 {zeile}")
|
||||
liste_beobachtungen_vorbereitung.append(
|
||||
[nummer_beobachtungsgruppeID,"VS3", "HS2", standpunkt, zeile[0], zeile[1], zeile[2],
|
||||
zeile[3]])
|
||||
|
||||
elif zeile[0] in liste_zielpunkte_vs2:
|
||||
if zeile[0] not in liste_zielpunkte_vs3:
|
||||
liste_zielpunkte_vs3.append(zeile[0])
|
||||
#print(f"{nummer_zielpunkt} VS2 HS2 {zeile}")
|
||||
liste_beobachtungen_vorbereitung.append(
|
||||
[nummer_beobachtungsgruppeID,"VS2", "HS2", standpunkt, zeile[0], zeile[1], zeile[2],
|
||||
zeile[3]])
|
||||
else:
|
||||
if zeile[0] not in liste_zielpunkte_vs2:
|
||||
liste_zielpunkte_vs2.append(zeile[0])
|
||||
#print(f"{nummer_zielpunkt} VS1 HS2 {zeile}")
|
||||
liste_beobachtungen_vorbereitung.append(
|
||||
[nummer_beobachtungsgruppeID,"VS1", "HS2", standpunkt, zeile[0], zeile[1], zeile[2],
|
||||
zeile[3]])
|
||||
|
||||
if liste_fehlerhafte_zeile == []:
|
||||
#print(f"Einlesen der Datei {pfad_datei} erfolgreich beendet.")
|
||||
pass
|
||||
else:
|
||||
print(f"Das Einlesen der Datei {pfad_datei} wurde abgebrochen.\nBitte bearbeiten Sie die Zeilen rund um: {", ".join(map(str, liste_fehlerhafte_zeile))} in der csv-Datei und wiederholen Sie den Import.")
|
||||
Import_fortsetzen = False
|
||||
|
||||
else:
|
||||
print(f"Der Import wurde abgebrochen, weil die Beobachtungen aus der Datei {pfad_datei} bereits in der Datenbank vorhanden sind.")
|
||||
|
||||
if Import_fortsetzen:
|
||||
liste_beobachtungen_import = []
|
||||
|
||||
while len(liste_beobachtungen_vorbereitung) > 0:
|
||||
liste_aktueller_zielpunkt = liste_beobachtungen_vorbereitung[0]
|
||||
aktueller_zielpunkt = liste_aktueller_zielpunkt[4]
|
||||
#print(liste_beobachtungen_vorbereitung[0])
|
||||
|
||||
for index in range(1, len(liste_beobachtungen_vorbereitung)):
|
||||
liste = liste_beobachtungen_vorbereitung[index]
|
||||
|
||||
if liste[4] == aktueller_zielpunkt:
|
||||
#print(liste)
|
||||
richtung1 = string_to_decimal(liste_aktueller_zielpunkt[5])
|
||||
richtung2 = string_to_decimal(liste[5]) - Decimal(200)
|
||||
zenitwinkel_vollsatz = (string_to_decimal(liste_aktueller_zielpunkt[6]) - string_to_decimal(liste[6]) + 400) / 2
|
||||
distanz_vollsatz = (string_to_decimal(liste_aktueller_zielpunkt[7]) + string_to_decimal(liste[7])) / 2
|
||||
if richtung2 < 0:
|
||||
richtung2 += Decimal(400)
|
||||
elif richtung2 > 400:
|
||||
richtung2 -= Decimal(400)
|
||||
richtung_vollsatz = (richtung1 + richtung2) / 2
|
||||
|
||||
#print(richtung_vollsatz)
|
||||
#print(zenitwinkel_vollsatz)
|
||||
#print(distanz_vollsatz)
|
||||
liste_beobachtungen_import.append([liste[0], liste[3], liste[4], richtung_vollsatz, zenitwinkel_vollsatz, distanz_vollsatz])
|
||||
|
||||
del liste_beobachtungen_vorbereitung[index]
|
||||
del liste_beobachtungen_vorbereitung[0]
|
||||
break
|
||||
|
||||
if instrumentenID not in liste_instrumentenid:
|
||||
Import_fortsetzen = False
|
||||
print("Der Import wurde abgebrochen. Bitte eine gültige InstrumentenID eingeben. Bei Bedarf ist das Instrument neu anzulegen.")
|
||||
|
||||
if Import_fortsetzen:
|
||||
con = sqlite3.connect(pfad_datenbank)
|
||||
cursor = con.cursor()
|
||||
for beobachtung_import in liste_beobachtungen_import:
|
||||
cursor.execute("INSERT INTO Beobachtungen (punktnummer_sp, punktnummer_zp, instrumenteID, beobachtungsgruppeID, tachymeter_richtung, tachymeter_zenitwinkel, tachymeter_distanz, dateiname) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
(beobachtung_import[1], beobachtung_import[2], instrumentenID, beobachtung_import[0], float(beobachtung_import[3]), float(beobachtung_import[4]), float(beobachtung_import[5]), dateiname))
|
||||
con.commit()
|
||||
cursor.close()
|
||||
con.close()
|
||||
print(f"Der Import der Datei {pfad_datei} wurde erfolgreich abgeschlossen.")
|
||||
@@ -1,9 +1,6 @@
|
||||
import sympy as sp
|
||||
i = 5
|
||||
|
||||
dX, dY, dZ, m, q0, q1, q2, q3 = sp.symbols('dX dY dZ m q0 q1 q2 q3')
|
||||
|
||||
f = sp.Matrix([dX + m * q0 + 1])
|
||||
|
||||
J = f.jacobian([dX, dY, q0])
|
||||
|
||||
print(J)
|
||||
if i % 6 != 0:
|
||||
print("nein")
|
||||
else:
|
||||
print("ja")
|
||||
Reference in New Issue
Block a user