Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
SPC
SCDDS
SCDDS-core
Commits
a4954bc8
Commit
a4954bc8
authored
4 years ago
by
Cristian Galperti
Browse files
Options
Downloads
Patches
Plain Diff
ADC loader task class adapted for new node 07
parent
28372176
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/classes/SCDclass_taskmdsloadprevADC.m
+16
-13
16 additions, 13 deletions
code/classes/SCDclass_taskmdsloadprevADC.m
with
16 additions
and
13 deletions
code/classes/SCDclass_taskmdsloadprevADC.m
+
16
−
13
View file @
a4954bc8
...
@@ -51,7 +51,7 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
...
@@ -51,7 +51,7 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
fprintf
(
'\n'
);
fprintf
(
'\n'
);
warning
(
'SCDclass_taskmdsloadprevADC:init'
,
'Error initializing ADC bus for node %d.'
,
obj
.
node
);
warning
(
'SCDclass_taskmdsloadprevADC:init'
,
'Error initializing ADC bus for node %d.'
,
obj
.
node
);
end
end
end
end
function
[
obj
,
value
]
=
getdata
(
obj
,
shot
)
function
[
obj
,
value
]
=
getdata
(
obj
,
shot
)
%obj=obj.actualizegetcmd('mdsvalue(''%s'')', shot);
%obj=obj.actualizegetcmd('mdsvalue(''%s'')', shot);
...
@@ -227,21 +227,23 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
...
@@ -227,21 +227,23 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
function
[
obj
,
value
]
=
getdataNode07
(
obj
,
shot
,
samppck
)
function
[
obj
,
value
]
=
getdataNode07
(
obj
,
shot
,
samppck
)
nch
=
96
;
nch
=
96
;
if
shot
>
701
00
%
TODO, wrong shotno here
if
shot
>
=
701
45
%
first shot with new MARTe2 based node 07
mdsnodename
=
'node07'
;
oldway
=
false
;
else
else
mdsnodename
=
'crpprt07'
;
oldway
=
true
;
end
end
mdsopen
(
'rtc'
,
shot
);
mdsopen
(
'rtc'
,
shot
);
%T=timeseries;
if
oldway
timebase
=
mdsvalue
([
'dim_of(\top.'
mdsnodename
'.board1.adc_01)'
]);
timebase
=
mdsvalue
([
'dim_of(\top.crpprt07.board1.adc_01)'
]);
d_time
=
double
(
mdsvalueraw
([
'\top.'
mdsnodename
'.params:d_time'
]))
*
1.0e-6
;
d_time
=
double
(
mdsvalueraw
([
'\top.crpprt07.params:d_time'
]))
*
1.0e-6
;
else
timebase
=
mdsvalue
([
'dim_of(\top.node07.adc.adc_001)'
]);
d_time
=
double
(
mdsvalueraw
([
'\top.node07.params:d_time'
]))
*
1.0e-6
;
end
timebase
=
timebase
(
1
:
samppck
:
end
);
% TODO: is this safe against lost cycles ?
timebase
=
timebase
(
1
:
samppck
:
end
);
% TODO: is this safe against lost cycles ?
%timebase = round(timebase.*1/d_time)*d_time-d_time/2;
%timebase = round(timebase.*1/d_time)*d_time-d_time/2;
timebase
=
round
(
timebase
.*
1
/
d_time
)
*
d_time
-
d_time
/
100
;
timebase
=
round
(
timebase
.*
1
/
d_time
)
*
d_time
-
d_time
/
100
;
%timebase = timebase + d_time; % this fits perfectly sim/rt data on 68072
%timebase = timebase + d_time; % this fits perfectly sim/rt data on 68072
%T.Time=timebase;
%T.Data=zeros(numel(timebase),nch);
value
=
tscollection
(
timebase
);
value
=
tscollection
(
timebase
);
if
obj
.
verbose
==
1
if
obj
.
verbose
==
1
fprintf
(
'Getting data for bus:
''
%s
''
(%s, shot %d) 0%% '
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
fprintf
(
'Getting data for bus:
''
%s
''
(%s, shot %d) 0%% '
,
obj
.
modelbus
,
obj
.
classname
,
shot
);
...
@@ -249,10 +251,11 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
...
@@ -249,10 +251,11 @@ classdef SCDclass_taskmdsloadprevADC < SCDclass_task
for
ii
=
1
:
nch
for
ii
=
1
:
nch
T
=
timeseries
;
T
=
timeseries
;
T
.
Time
=
timebase
;
T
.
Time
=
timebase
;
channelstr
=
sprintf
([
'\\top.'
mdsnodename
'.board1.adc_%02d.raw'
],
ii
);
if
oldway
%T.Data(:,ii)=int16(mdsvalue(channelstr));
channelstr
=
sprintf
([
'\\top.crpprt07.board1.adc_%02d.raw'
],
ii
);
%T.Data(:,ii)=int16(mdsvalueraw(channelstr));
else
channelstr
=
sprintf
([
'\\top.node07.adc.adc_%03d.raw'
],
ii
);
end
data
=
mdsvalueraw
(
channelstr
);
data
=
mdsvalueraw
(
channelstr
);
if
isnumeric
(
data
)
if
isnumeric
(
data
)
datamatrix
=
reshape
(
int16
(
data
),[
samppck
,
numel
(
timebase
)])
'
;
datamatrix
=
reshape
(
int16
(
data
),[
samppck
,
numel
(
timebase
)])
'
;
...
...
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