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
edd66d6b
Commit
edd66d6b
authored
15 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
check if we are is the right paragraph context for global attributes
parent
9df3a458
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tsg_io/readTsgIniLabview.m
+30
-22
30 additions, 22 deletions
tsg_io/readTsgIniLabview.m
with
30 additions
and
22 deletions
tsg_io/readTsgIniLabview.m
+
30
−
22
View file @
edd66d6b
...
...
@@ -49,30 +49,38 @@ while ~feof(fid)
context
=
match
{
1
}{
1
};
end
% Iterate from each element from object nca and additional variables
% ------------------------------------------------------------------
for
ii
=
nca_keys
% get key, use char because i is cell
% -----------------------------------
clef
=
char
(
ii
);
% construct regex with pair cle=value
% and extract value
% ------------------------------------
regex
=
strcat
(
'^\s*'
,
clef
,
'\s*=\s*(.+)$'
);
match
=
regexp
(
str
,
regex
,
'tokens'
);
% check if we are is the right paragraph context
% ----------------------------------------------
if
strcmp
(
context
,
'GLOBAL'
)
||
strcmp
(
context
,
'GENERAL'
)
||
...
strcmp
(
context
,
tsg
.
TYPE_TSG
)
||
strcmp
(
context
,
tsg
.
TYPE_TINT
)
% build tsg struct
% ----------------
if
~
isempty
(
match
)
%if isnan(str2double(match{1}{1}))
tsg
.
(
clef
)
=
match
{
1
}{
1
};
%else
% tsg.(clef) = sprintf('%f',str2double(match{1}{1}));
%end
continue
% Iterate from each element from object nca and additional variables
% ------------------------------------------------------------------
for
ii
=
nca_keys
% get key, use char because i is cell
% -----------------------------------
clef
=
char
(
ii
);
% construct regex with pair cle=value
% and extract value
% ------------------------------------
regex
=
strcat
(
'^\s*'
,
clef
,
'\s*=\s*(.+)$'
);
match
=
regexp
(
str
,
regex
,
'tokens'
);
% build tsg struct
% ----------------
if
~
isempty
(
match
)
%if isnan(str2double(match{1}{1}))
tsg
.
(
clef
)
=
match
{
1
}{
1
};
%else
% tsg.(clef) = sprintf('%f',str2double(match{1}{1}));
%end
continue
end
end
end
% check if we are is the right paragraph context
...
...
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