From 52157bc3df3a74fb938d160fc13af7bd447e942a Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 3 Jul 2024 00:25:50 +0200 Subject: [PATCH] verzija 0.1 --- RADO1.GSI | 19 ++++ RADO1.mer | 25 ++++++ RADO1.txt | 13 +++ index.php | 137 ++++++++++++++++++++++++++++ obdelava.php | 245 +++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 439 insertions(+) create mode 100644 RADO1.GSI create mode 100644 RADO1.mer create mode 100644 RADO1.txt create mode 100644 index.php create mode 100644 obdelava.php diff --git a/RADO1.GSI b/RADO1.GSI new file mode 100644 index 0000000..4cdb656 --- /dev/null +++ b/RADO1.GSI @@ -0,0 +1,19 @@ +*410010+0000000000000099 +*110002+0000000000060002 81..00+0000000434972860 82..00+0000000141002554 83..00+0000000000641291 +*110003+0000000000060001 81..00+0000000434974389 82..00+0000000141010149 83..00+0000000000640685 +*110004+0000000000061001 81..00+0000000434979563 82..00+0000000141036477 83..00+0000000000639545 +*110005+0000000000061002 81..00+0000000435008411 82..00+0000000141046307 83..00+0000000000643024 +*410009+0000000000000040 +*110006+0000000000060001 21.324+0000000005711250 22.324+0000000009219100 31..00+0000000000033513 32..10+0000000000033486 87..10+0000000000002000 58..16+0000000000000000 33..10-0000000000003356 81..00+0000000496087289 82..00+0000000156346308 83..00+0000000000392351 71....+0000000000000000 +*110007+0000000000060002 21.324+0000000004430320 22.324+0000000009110120 31..00+0000000000035154 32..10+0000000000035146 87..10+0000000000002000 58..16+0000000000000000 33..10-0000000000002718 81..00+0000000496083783 82..00+0000000156353228 83..00+0000000000392989 71....+0000000000000000 +*110008+0000000000061002 21.324+0000000014239580 22.324+0000000008827380 31..00+0000000000039435 32..10+0000000000039421 87..10+0000000000002000 58..16+0000000000000000 33..10-0000000000000940 81..00+0000000496083052 82..00+0000000156296819 83..00+0000000000394767 71....+0000000000000000 +*410010+0000000000000090 +*110017+0000000000060001 21.324+0000000027533090 22.324+0000000009218500 31..00+0000000000033519 32..10+0000000000033491 87..10+0000000000002000 58..16+0000000000000000 33..10-0000000000003353 81..00+0000000434974386 82..00+0000000141010149 83..00+0000000000640611 71....+0000000000000000 +*110018+0000000000060002 21.324+0000000026252150 22.324+0000000009203540 31..00+0000000000035137 32..10+0000000000035114 87..10+0000000000001400 58..16+0000000000000000 33..10-0000000000002666 81..00+0000000434972877 82..00+0000000141002550 83..00+0000000000641298 71....+0000000000000000 +*110011+0000000000061002 21.324+0000000000100510 22.324+0000000008827360 31..00+0000000000039435 32..10+0000000000039421 87..10+0000000000002000 58..16+0000000000000000 33..10-0000000000000940 81..00+0000000435008417 82..00+0000000141046323 83..00+0000000000643024 71....+0000000000000000 +*110013+000000000000LT1A 21.324+0000000014540200 22.324+0000000008824160 31..00+0000000000052883 32..10+0000000000052862 87..10+0000000000001470 58..16+0000000000000000 33..10-0000000000000527 81..00+0000000435037530 82..00+0000000140963253 83..00+0000000000643437 71....+0000000000000000 +*110014+000000000000LT1B 21.324+0000000011345400 22.324+0000000009142230 31..00+0000000000030516 32..10+0000000000030503 87..10+0000000000001430 58..16+0000000000000000 33..10-0000000000002339 81..00+0000000435035637 82..00+0000000140994618 83..00+0000000000641626 71....+0000000000000000 +*110015+00000000000M109G 21.324+0000000027839410 22.324+0000000009327340 31..00+0000000000032374 32..10+0000000000032315 87..10+0000000000002000 58..16+0000000000000000 33..10-0000000000003953 81..00+0000000434975773 82..00+0000000141011775 83..00+0000000000640011 71....+0000000000000000 +*110019+0000000000000201 21.324+0000000010402420 22.324+0000000009254570 31..00+0000000000008644 32..10+0000000000008633 87..10+0000000000002500 58..16+0000000000000000 33..10-0000000000002940 81..00+0000000435016095 82..00+0000000141004813 83..00+0000000000641025 71....+0000000000000000 +*110020+0000000000000202 21.324+0000000017604560 22.324+0000000010627110 31..00+0000000000000921 32..10+0000000000000884 87..10+0000000000001400 58..16+0000000000000344 33..10-0000000000001661 81..00+0000000435007780 82..00+0000000141006027 83..00+0000000000642303 71....+0000000000000000 +*110021+0000000000000203 21.324+0000000027614040 22.324+0000000009131450 31..00+0000000000007130 32..10+0000000000007127 87..10+0000000000001400 58..16+0000000000000000 33..10-0000000000001590 81..00+0000000435000635 82..00+0000000141007682 83..00+0000000000642374 71....+0000000000000000 diff --git a/RADO1.mer b/RADO1.mer new file mode 100644 index 0000000..a7c52db --- /dev/null +++ b/RADO1.mer @@ -0,0 +1,25 @@ +TPS 1100 GSI Conversion +++++++++++++++++++++++++++++++++ +Measured: +------------------- +60002 E= 434972.860 N= 141002.554 H= 641.291 +60001 E= 434974.389 N= 141010.149 H= 640.685 +61001 E= 434979.563 N= 141036.477 H= 639.545 +61002 E= 435008.411 N= 141046.307 H= 643.024 + +Setup: Free Station +============================= +60001 Hz= 57.1125 V= 92.1910 SD= 33.513 HD= 33.486 RefHt= 2.000 PrCon= 0 HtDif= -3.356 E= 496087.289 N= 156346.308 H= 392.351 PtCode= 0 +60002 Hz= 44.3032 V= 91.1012 SD= 35.154 HD= 35.146 RefHt= 2.000 PrCon= 0 HtDif= -2.718 E= 496083.783 N= 156353.228 H= 392.989 PtCode= 0 +61002 Hz= 142.3958 V= 88.2738 SD= 39.435 HD= 39.421 RefHt= 2.000 PrCon= 0 HtDif= -0.940 E= 496083.052 N= 156296.819 H= 394.767 PtCode= 0 +Measured: +------------------- +60001 Hz= 275.3309 V= 92.1850 SD= 33.519 HD= 33.491 RefHt= 2.000 PrCon= 0 HtDif= -3.353 E= 434974.386 N= 141010.149 H= 640.611 PtCode= 0 +60002 Hz= 262.5215 V= 92.0354 SD= 35.137 HD= 35.114 RefHt= 1.400 PrCon= 0 HtDif= -2.666 E= 434972.877 N= 141002.550 H= 641.298 PtCode= 0 +61002 Hz= 1.0051 V= 88.2736 SD= 39.435 HD= 39.421 RefHt= 2.000 PrCon= 0 HtDif= -0.940 E= 435008.417 N= 141046.323 H= 643.024 PtCode= 0 +LT1A Hz= 145.4020 V= 88.2416 SD= 52.883 HD= 52.862 RefHt= 1.470 PrCon= 0 HtDif= -0.527 E= 435037.530 N= 140963.253 H= 643.437 PtCode= 0 +LT1B Hz= 113.4540 V= 91.4223 SD= 30.516 HD= 30.503 RefHt= 1.430 PrCon= 0 HtDif= -2.339 E= 435035.637 N= 140994.618 H= 641.626 PtCode= 0 +M109G Hz= 278.3941 V= 93.2734 SD= 32.374 HD= 32.315 RefHt= 2.000 PrCon= 0 HtDif= -3.953 E= 434975.773 N= 141011.775 H= 640.011 PtCode= 0 +201 Hz= 104.0242 V= 92.5457 SD= 8.644 HD= 8.633 RefHt= 2.500 PrCon= 0 HtDif= -2.940 E= 435016.095 N= 141004.813 H= 641.025 PtCode= 0 +202 Hz= 176.0456 V= 106.2711 SD= 0.921 HD= 0.884 RefHt= 1.400 PrCon= 0.0344 HtDif= -1.661 E= 435007.780 N= 141006.027 H= 642.303 PtCode= 0 +203 Hz= 276.1404 V= 91.3145 SD= 7.130 HD= 7.127 RefHt= 1.400 PrCon= 0 HtDif= -1.590 E= 435000.635 N= 141007.682 H= 642.374 PtCode= 0 diff --git a/RADO1.txt b/RADO1.txt new file mode 100644 index 0000000..8d8258f --- /dev/null +++ b/RADO1.txt @@ -0,0 +1,13 @@ +60002 434972.860 141002.554 641.291 +60001 434974.389 141010.149 640.685 +61001 434979.563 141036.477 639.545 +61002 435008.411 141046.307 643.024 +60001 434974.386 141010.149 640.611 +60002 434972.877 141002.550 641.298 +61002 435008.417 141046.323 643.024 +LT1A 435037.530 140963.253 643.437 +LT1B 435035.637 140994.618 641.626 +M109G 434975.773 141011.775 640.011 +201 435016.095 141004.813 641.025 +202 435007.780 141006.027 642.303 +203 435000.635 141007.682 642.374 diff --git a/index.php b/index.php new file mode 100644 index 0000000..51dacd7 --- /dev/null +++ b/index.php @@ -0,0 +1,137 @@ + + + + + TPS1100 Convert Online + + + + + + + + + +

+ TPS1100 Convert Online +

+

+ Aplikacija za izvoz podatkov iz datotek GSI za instrumente TPS1100. +

+
+

+ GSI Datoteka +

+
+ +
+
+ +

+ Izvoz podatkov +

+ +
+ +
+ + +
+ + +
+ + + + \ No newline at end of file diff --git a/obdelava.php b/obdelava.php new file mode 100644 index 0000000..b99692b --- /dev/null +++ b/obdelava.php @@ -0,0 +1,245 @@ + + + + + TPS1100 Convert Online + + + + + + + + + + + "; + $uploadOk = 0; + } else { + //echo "Branje datoteke GSI...
"; + $uploadOk = 1; + } + } + + // // Check if file already exists + // if (file_exists($target_file)) { + // echo "Sorry, file already exists."; + // $uploadOk = 0; + // } + + // // Check file size + // if ($_FILES["fileToUpload"]["size"] > 500000) { + // echo "Sorry, your file is too large."; + // $uploadOk = 0; + // } + + // // Allow certain file formats + // if($datFileType != "gsi") { + // echo "Napaka! Nalozi datoteko GSI."; + // $uploadOk = 0; + // } + + class ObdelavaGsi + { + // Properties + public $obdelavaTocke; + public $obdelavaZap; + + // Methods + function izvoz_tocke($name) + { + $this->obdelavaTocke = $name; + $file_handle = fopen($name, "rb"); + $merjene = 0; + $stojisce = 0; + + while (!feof($file_handle)) { + $line_of_text = fgets($file_handle); + $parts = explode(' ', $line_of_text); + $word_index = substr($parts[0], 1, 2); + + if ($word_index == 41) { + $koda = ltrim(substr($parts[0], 8), "0"); + if ($koda == 99) { + $merjene = 2; + $stojisce = 0; + } elseif ($koda >= 90) { + $merjene = 1; + $stojisce = 0; + } elseif ($koda >= 80) { + $merjene = 3; + $stojisce = 0; + } elseif ($koda < 80) { + $merjene = 0; + $stojisce = 1; + } else { + $merjene = 0; + $stojisce = 0; + } + } + if ($word_index == 11 && $merjene >= 1) { + $pointid = ltrim(substr($parts[0], 8), "0"); + + foreach ($parts as $datpart) { + $data_index = substr($datpart, 0, 2); + if ($data_index == 81) { + $pointE = substr($datpart, 6) / 1000; + } + if ($data_index == 82) { + $pointN = substr($datpart, 6) / 1000; + } + if ($data_index == 83) { + $pointH = substr($datpart, 6) / 1000; + } + } + if ($merjene == 1) { + print $pointid . "\t" . number_format($pointE, 3, ".", "") . "\t" . number_format($pointN, 3, ".", "") . "\t" . number_format($pointH, 3, ".", "") . "\tMEAS
"; + } + if ($merjene == 2) { + print $pointid . "\t" . number_format($pointE, 3, ".", "") . "\t" . number_format($pointN, 3, ".", "") . "\t" . number_format($pointH, 3, ".", "") . "\tREF
"; + } + if ($merjene == 3) { + print $pointid . "\t" . number_format($pointE, 3, ".", "") . "\t" . number_format($pointN, 3, ".", "") . "\t" . number_format($pointH, 3, ".", "") . "\tORI
"; + } + + } + if ($word_index == 11 && $stojisce == 1) { + $pointid = ltrim(substr($parts[0], 8), "0"); + $pointSta = 0; + + foreach ($parts as $datpart) { + $data_index = substr($datpart, 0, 2); + if ($data_index == 25) { + $pointSta = 1; + } + if ($data_index == 84) { + $pointE = substr($datpart, 6) / 1000; + } + if ($data_index == 85) { + $pointN = substr($datpart, 6) / 1000; + } + if ($data_index == 86) { + $pointH = substr($datpart, 6) / 1000; + } + } + if ($pointSta == 1) { + print $pointid . "\t" . number_format($pointE, 3, ".", "") . "\t" . number_format($pointN, 3, ".", "") . "\t" . number_format($pointH, 3, ".", "") . "\tSTA
"; + } + $pointSta = 0; + } + } + fclose($file_handle); + print "
"; + } + function get_name() + { + return $this->obdelavaTocke; + } + } + + // Check if $uploadOk is set to 0 by an error + if ($uploadOk == 0) { + echo "Postopek je bil prekinjen."; + // if everything is ok, try to upload file + } else { + if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { + $datime = basename($_FILES["fileToUpload"]["name"]); + $datimenova = str_replace(".GSI", ".TXT", $datime); + //echo "Datoteka: " . htmlspecialchars($datime) . "
"; + //echo "Nova Datoteka: " . htmlspecialchars($datimenova) . "

"; + $datTocke = new ObdelavaGsi(); + if ($_POST['obdelava'] == "tocke") { + $datTocke->izvoz_tocke($target_file); + } + } else { + echo "Koncano"; + } + } + ?> + + + \ No newline at end of file