Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TSG QC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
US191
TSG QC
Commits
548e3a6f
Commit
548e3a6f
authored
16 years ago
by
Yves Gouriou
Browse files
Options
Downloads
Patches
Plain Diff
Crée une fonction indépendante pour le calcul de la
vitesse du navire
parent
c6ede6e1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tsg_util/shipVelocity.m
+27
-0
27 additions, 0 deletions
tsg_util/shipVelocity.m
tsg_util/updateTsgStruct.m
+21
-20
21 additions, 20 deletions
tsg_util/updateTsgStruct.m
with
48 additions
and
20 deletions
tsg_util/shipVelocity.m
0 → 100644
+
27
−
0
View file @
548e3a6f
function
shipVelocity
(
hMainFig
)
%
% Compute the ship velocity
%
% Get the data from the application GUI
% -------------------------------------
tsg
=
getappdata
(
hMainFig
,
'tsg_data'
);
% Compute ship velocity from positions if sog not available
% ---------------------------------------------------------
if
isempty
(
tsg
.
SPDC
)
range
=
m_lldist
(
tsg
.
LONX
,
tsg
.
LATX
);
ind
=
size
(
tsg
.
DAYD
);
tsg
.
SPDC
=
zeros
(
size
(
ind
));
for
i
=
1
:
length
(
tsg
.
DAYD
)
-
1
tsg
.
SPDC
(
i
)
=
range
(
i
)
/
((
tsg
.
DAYD
(
i
+
1
)
-
tsg
.
DAYD
(
i
))
*
24
*
1.854
);
end
tsg
.
SPDC
=
[
tsg
.
SPDC
'
;
0
];
end
% Save tsg structure
% ------------------
setappdata
(
hMainFig
,
'tsg_data'
,
tsg
);
end
This diff is collapsed.
Click to expand it.
tsg_util/updateTsgStruct.m
+
21
−
20
View file @
548e3a6f
...
...
@@ -9,6 +9,13 @@ function updateTsgStruct(hMainFig)
%
% $Id$
% Compute ship velocity from positions if sog not available
% Must be done first as we use getappdata and setappdata within
% the function
% ---------------------------------------------------------
shipVelocity
(
hMainFig
);
% Get the data from the application GUI
% -------------------------------------
tsg
=
getappdata
(
hMainFig
,
'tsg_data'
);
...
...
@@ -16,6 +23,10 @@ tsg = getappdata( hMainFig, 'tsg_data');
nPARA
=
2
;
PARA
=
[
'SSPS'
;
'SSJT'
];
% Get NO_CONTROL and INTERPOLATED_VALUE codes
% -------------------------------------------
NO_CONTROL
=
get
(
tsg
.
qc
.
hash
,
'NO_CONTROL'
,
'code'
);
% get min and max values for position and set to globals attributes
% -----------------------------------------------------------------
tsg
.
SOUTH_LATX
=
min
(
tsg
.
LATX
);
...
...
@@ -30,28 +41,17 @@ tsg.DATE_START = [date(1:8) date(10:15)];
date
=
datestr
(
max
(
tsg
.
DAYD
),
30
);
tsg
.
DATE_END
=
[
date
(
1
:
8
)
date
(
10
:
15
)];
% Compute ship velocity from positions if sog not available
% ---------------------------------------------------------
if
isempty
(
tsg
.
SPDC
)
range
=
m_lldist
(
tsg
.
LONX
,
tsg
.
LATX
);
ind
=
size
(
tsg
.
DAYD
);
tsg
.
SPDC
=
zeros
(
size
(
ind
));
for
i
=
1
:
length
(
tsg
.
DAYD
)
-
1
tsg
.
SPDC
(
i
)
=
range
(
i
)
/
((
tsg
.
DAYD
(
i
+
1
)
-
tsg
.
DAYD
(
i
))
*
24
*
1.854
);
end
tsg
.
SPDC
=
[
tsg
.
SPDC
'
;
0
];
end
% Varaibles must exists
% Variables must exists
% ---------------------
for
i
=
1
:
nPARA
para1
=
PARA
(
i
,:);
if
isempty
(
tsg
.
(
para1
)
)
msgbox
([
'You must initialise the tsg.'
PARA
(
i
,:)
' variable'
],
...
'function
''
updateTsgStruct
''
'
,
...
.
'warn'
,
'modal'
);
if
~
isempty
(
tsg
.
(
para1
)
)
&&
isempty
(
tsg
.
([
para1
'_QC'
])
)
% If QC variables are emptied, fill them with NO_CONTROL code value
% -----------------------------------------------------------------
tsg
.
([
para1
'_QC'
])
=
castByteQC
(
NO_CONTROL
,
tsg
.
DAYD
);
end
end
...
...
@@ -84,7 +84,8 @@ if isempty(tsg.SSTP_LINCOEF)
tsg
.
SSTP_LINCOEF
(
2
)
=
0
;
end
% Save tsg structure
% Save tsg structure
% ------------------
setappdata
(
hMainFig
,
'tsg_data'
,
tsg
);
\ No newline at end of file
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment