verzija 0.1

This commit is contained in:
Boris Bilc 2024-07-03 00:25:50 +02:00
parent 37feb806ef
commit 52157bc3df
5 changed files with 439 additions and 0 deletions

19
RADO1.GSI Normal file
View File

@ -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

25
RADO1.mer Normal file
View File

@ -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

13
RADO1.txt Normal file
View File

@ -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

137
index.php Normal file
View File

@ -0,0 +1,137 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>TPS1100 Convert Online</title>
<meta content="text/html" charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
pre {
overflow-x: auto;
max-width: 60vw;
}
pre code {
word-wrap: normal;
white-space: pre;
}
body {
background-color: rgba(22, 22, 22, 100.0);
color: #e0e0e0;
padding: 20px;
}
h1 {
color: deepskyblue;
font-size: 1.8em;
}
h2 {
color: #FFDB23;
font-size: 1.4em;
}
h3 {
color: #FFDB23;
font-size: 1.25em;
}
hr {
color: darkorange;
border-color: darkorange;
}
input {
margin: 2px;
}
table {
color: #E0E0E0 !important;
}
.table-on {
color: #d1f200 !important;
}
.table-off {
color: #e00000 !important;
}
.table-conn {
color: #d1f200 !important;
}
.table-disconn {
color: #c9c9c9 !important;
}
.indicator {
border: 1px solid #383737;
border-radius: 8px;
margin-left: 8px;
margin-right: 8px;
margin-bottom: -4px;
height: 16px;
width: 16px;
background-color: #4f4f4f;
display: inline-block;
}
.indicatorOn {
background-color: #d1f200;
box-shadow: 0px 0px 8px 0px #edff7b, inset 1px 10px 1px #d1f200, inset 0px -1px 10px 1px #95ac00;
}
.indicatorOff {
background-color: red;
box-shadow: 0px 0px 8px 0px #ff3131, inset 1px 10px 1px #e63a3a, inset 0px -1px 10px 1px #a80808;
}
.indicatorDisconn {
background-color: #c9c9c9;
box-shadow: 0px 0px 8px 0px #e0e0e0, inset 1px 10px 1px #c9c9c9, inset 0px -1px 10px 1px #9b9b9b;
}
</style>
</head>
<html>
<body>
<h1>
TPS1100 Convert Online
</h1>
<p>
Aplikacija za izvoz podatkov iz datotek GSI za instrumente TPS1100.
</p>
<form action="obdelava.php" method="post" enctype="multipart/form-data">
<h2>
GSI Datoteka
</h2>
<hr>
</hr>
<input type="file" name="fileToUpload" id="fileToUpload" label=" Izberi GSI datoteko..." itemtype="" /><br>
<hr>
</hr>
<h3>
Izvoz podatkov
</h3>
<input type="radio" name="obdelava" id="tocke" value="tocke" />
<label for="tocke">[ PtId E N H Tip ] - Seznam Točk + Klasifikacija <b>(Kode)</b></label><br>
<input type="radio" name="obdelava" id="merjeno" value="merjeno" />
<label for="merjeno">[ PtId E N H ] - Seznam Merjenih Točk <b>(Kode)</b></label><br>
<input type="radio" name="obdelava" id="zapisnik" value="zapisnik" />
<label for="zapisnik">[ PtId E N H ] - Seznam Točk (Brez Kodiranja)</label>
<hr>
</hr>
<input type="submit" value="Izvoz Podatkov" name="submit">
</form>
<?php
$data = "";
?>
</body>
</html>

245
obdelava.php Normal file
View File

@ -0,0 +1,245 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>TPS1100 Convert Online</title>
<meta content="text/html" charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
pre {
overflow-x: auto;
max-width: 60vw;
}
pre code {
word-wrap: normal;
white-space: pre;
}
body {
background-color: rgba(0, 0, 0, 100.0);
color: #e0e0e0;
padding: 10px;
font-family: 'Courier New', Courier, monospace;
font-size: 12pt;
}
h3 {
color: #FFDB23;
font-size: 1.3em;
}
table {
color: #E0E0E0 !important;
}
.table-on {
color: #d1f200 !important;
}
.table-off {
color: #e00000 !important;
}
.table-conn {
color: #d1f200 !important;
}
.table-disconn {
color: #c9c9c9 !important;
}
.indicator {
border: 1px solid #383737;
border-radius: 8px;
margin-left: 8px;
margin-right: 8px;
margin-bottom: -4px;
height: 16px;
width: 16px;
background-color: #4f4f4f;
display: inline-block;
}
.indicatorOn {
background-color: #d1f200;
box-shadow: 0px 0px 8px 0px #edff7b, inset 1px 10px 1px #d1f200, inset 0px -1px 10px 1px #95ac00;
}
.indicatorOff {
background-color: red;
box-shadow: 0px 0px 8px 0px #ff3131, inset 1px 10px 1px #e63a3a, inset 0px -1px 10px 1px #a80808;
}
.indicatorDisconn {
background-color: #c9c9c9;
box-shadow: 0px 0px 8px 0px #e0e0e0, inset 1px 10px 1px #c9c9c9, inset 0px -1px 10px 1px #9b9b9b;
}
</style>
</head>
<html>
<body>
<?php
use Vtiful\Kernel\Format;
// Obdelava GSI datoteke
$target_dir = "upload/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$target_dirarc = "archive/";
$target_filearc = $target_dirarc . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$datFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image
if (isset($_POST["submit"])) {
if ($datFileType != "gsi") {
echo "Napaka! Izberi datoteko GSI...<br>";
$uploadOk = 0;
} else {
//echo "Branje datoteke GSI...<br>";
$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<BR>";
}
if ($merjene == 2) {
print $pointid . "\t" . number_format($pointE, 3, ".", "") . "\t" . number_format($pointN, 3, ".", "") . "\t" . number_format($pointH, 3, ".", "") . "\tREF<BR>";
}
if ($merjene == 3) {
print $pointid . "\t" . number_format($pointE, 3, ".", "") . "\t" . number_format($pointN, 3, ".", "") . "\t" . number_format($pointH, 3, ".", "") . "\tORI<BR>";
}
}
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<BR>";
}
$pointSta = 0;
}
}
fclose($file_handle);
print "<br>";
}
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) . "<br>";
//echo "Nova Datoteka: " . htmlspecialchars($datimenova) . "<br><br>";
$datTocke = new ObdelavaGsi();
if ($_POST['obdelava'] == "tocke") {
$datTocke->izvoz_tocke($target_file);
}
} else {
echo "Koncano";
}
}
?>
</body>
</html>