Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jean-Luc Shaw
LogGen_windows
Commits
3f96f345
Commit
3f96f345
authored
May 09, 2018
by
Jean-Luc Shaw
Browse files
Working with gps off is now a working option.
parent
f199093a
Changes
2
Hide whitespace changes
Inline
Side-by-side
LogGen.pl
View file @
3f96f345
...
...
@@ -24,7 +24,7 @@ print "\n" ;
(
$gps
,
$gpson
,
$gpsport
,
$gpsbaud
)
=
sub_getgps
()
;
# ASK FOR or READ CRUISE INFO
(
$ops
,
$sts
,
$numops
,
$numsts
,
$headerstring
)
=
sub_cruiseinfo
(
$name
,
$folder
,
$gpson
,
$gpsport
,
$gpsbaud
)
;
(
$ops
,
$sts
,
$numops
,
$numsts
,
$headerstring
,
$stslat
,
$stslon
)
=
sub_cruiseinfo
(
$name
,
$folder
,
$gpson
,
$gpsport
,
$gpsbaud
)
;
# SET PRINTING FORMAT
$frmt
=
"
%6s;%10.5f;%10.5f;%20s;%s
\n
"
;
...
...
@@ -40,9 +40,6 @@ print ">> ---\n\n" ;
# INITIAL VALUES
$pre
=
"
>
"
;
$cus
=
"
none
"
;
$culon
=
"
NaN
"
;
$culat
=
"
NaN
"
;
# DEFAULT START HEADER
print
"
=============================================================================================
\n
"
;
...
...
@@ -69,8 +66,8 @@ while (<STDIN>) {
if
(
$ew
=~
/W/i
)
{
$lon
*=-
1
;
}
}
else
{
# if no gps is used be we are on station, these coordinates a written
$lon
=
$culon
;
$lat
=
$culat
;
$lon
=
%stslon
{
$cus
}
;
$lat
=
%stslat
{
$cus
}
;
}
# THIS IS THE EXIT COMMAND
...
...
@@ -80,8 +77,12 @@ while (<STDIN>) {
elsif
(
$line
[
0
]
=~
/st/
)
{
if
(
$cus
=~
/none/
)
{
# case : we are currently off station
$cus
=
$line
[
1
]
;
$pre
=
"
>>
"
;
$cus
=
$line
[
1
]
;
$pre
=
"
>>
"
;
if
(
not
$gpson
)
{
$lon
=
%stslon
{
$cus
}
;
$lat
=
%stslat
{
$cus
}
;
}
print
"
$pre
\t\t
NOW RECORDING STATION
\t
$line
[1],
\t\t\t
TIME :
$mmddHHMM
\n
"
;
print
"
$pre
\t\t\t\t\t\t\t\t\t\t
LON :
$lon
\n
"
;
print
"
$pre
\t\t\t\t\t\t\t\t\t\t
LAT :
$lat
\n
$pre
"
;
...
...
@@ -97,6 +98,10 @@ while (<STDIN>) {
printf
OUT
$frmt
,
$line
[
0
],
$lat
,
$lon
,
$isotime
,
$cus
;
print
"
$pre
\t\t\t
END OF STATION
\t
$cus
,
\t\t\t
TIME :
$mmddHHMM
\n
>
\n
>
\n
"
;
$cus
=
$line
[
1
]
;
if
(
not
$gpson
)
{
$lon
=
%stslon
{
$cus
}
;
$lat
=
%stslat
{
$cus
}
;
}
print
"
$pre
\t\t
NOW RECORDING STATION
\t
$line
[1],
\t\t\t
TIME :
$mmddHHMM
\n
"
;
print
"
$pre
\t\t\t\t\t\t\t\t\t\t
LON :
$lon
\n
"
;
print
"
$pre
\t\t\t\t\t\t\t\t\t\t
LAT :
$lat
\n
$pre
"
;
...
...
sub_cruiseinfo.pl
View file @
3f96f345
...
...
@@ -32,8 +32,6 @@ sub sub_cruiseinfo {
while
(
<
STDIN
>
)
{
chop
(
$_
)
;
push
(
@sts
,
$_
)
;
push
(
@stslon
,"
NaN
")
;
push
(
@stslat
,"
NaN
")
;
print
"
>> :
"
;
$numsts
++
;
}
...
...
@@ -44,8 +42,10 @@ sub sub_cruiseinfo {
for
(
$ii
=
0
;
$ii
<
$numsts
;
$ii
++
)
{
print
"
>> Enter lon;lat of station
$sts
[
$ii
] (pm180) :
"
;
chop
(
$line
=
<
STDIN
>
)
;
(
$stslon
[
$ii
],
$stslat
[
$ii
])
=
split
(
/;/
,
$line
)
;
(
$stslon
{
$sts
[
$ii
]
}
,
$stslat
{
$sts
[
$ii
]
}
)
=
split
(
/;/
,
$line
)
;
}
$stslon
{"
none
"}
=
"
NaN
"
;
$stslat
{"
none
"}
=
"
NaN
"
;
}
print
"
\n\n\n
"
;
...
...
@@ -58,7 +58,7 @@ sub sub_cruiseinfo {
print
OUT
"
\
#
$numops
\n
"
;
for
(
$ii
=
0
;
$ii
<
$numops
;
$ii
++
)
{
print
OUT
"
\
#
$ops
[
$ii
]
\n
"
;
}
print
OUT
"
\
#
$numsts
\n
"
;
for
(
$ii
=
0
;
$ii
<
$numsts
;
$ii
++
)
{
print
OUT
"
\
#
$sts
[
$ii
];
$stslat
[
ii];
$stslon
[
ii]
\n
"
;
}
for
(
$ii
=
0
;
$ii
<
$numsts
;
$ii
++
)
{
print
OUT
"
\
#
$sts
[
$ii
];
$stslat
{
$sts
[
$
ii
]
}
;
$stslon
{
$sts
[
$
ii
]
}
\n
"
;
}
print
OUT
"
\
# 0
\n
"
;
$cul
=
0
;
@coltitles
=
("
\
#type
","
longitude
","
latitude
","
yyyy-mm-ddTHH:MM:SSZ
","
value
")
;
...
...
@@ -69,7 +69,7 @@ sub sub_cruiseinfo {
}
# RETURN NEEDED VALUES
return
(
\
@ops
,
\
@sts
,
$numops
,
$numsts
,
$headerstring
)
;
return
(
\
@ops
,
\
@sts
,
$numops
,
$numsts
,
$headerstring
,
\
%stslat
,
\
%stslon
)
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment