Moose/Instrument/NanonisTramea.pm

filter: Statementstmt 3.1% 48 / 1512 Branchbran 0.0% 0 / 224 Conditioncond 0.0% 0 / 84 MC/DCmcdc 0.0% 0 / 45 Subroutinesub 7.6% 11 / 143 Podpod 8.2% 10 / 121 totaltotal 3.2% 69 / 2129 CC 153 SCAR 50.2
CC
153
Cov
3%
tramea_sweep
930.0
sweep_prop_configure
380.0
step1_prop_configure
182.0
CRAP 151.2
« Moose/Instrument/SignalRecovery7265.pm ↑ Summary Moose/Connection/LinuxGPIB.pm »
1 package Lab::Moose::Instrument::NanonisTramea;
2 1 $Lab::Moose::Instrument::NanonisTramea::VERSION = '3.931';
3 #ABSTRACT: Nanonis Tramea
4  
5 1 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use PDL::Core;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use PDL::IO::CSV ":all";
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use List::Util qw(max);
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Lab::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use Lab::Moose::Instrument qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 validated_getter validated_setter/;
17 1 extends 'Lab::Moose::Instrument';
18 1 class_type 'Lab::Moose::Sweep';
19 1 class_type 'Lab::Moose::DataFile';
20 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22  
23  
24 0 ▶sub nt_string {
Subroutine nt_string: not called CC=1 SCAR=6.9
Pod documented
25 0 my $s = shift;
26 0 return (pack "N", length($s)) . $s;
27 }
28  
29 0 ▶sub nt_int {
Subroutine nt_int: not called CC=1 SCAR=6.9
Pod documented
30 0 my $i = shift;
31 0 return pack "N!", $i;
32 }
33  
34 0 ▶sub nt_uint16 {
Subroutine nt_uint16: not called CC=1 SCAR=6.9
Pod documented
35 0 my $i = shift;
36 0 return pack "n", $i;
37 }
38  
39 0 ▶sub nt_uint32 {
Subroutine nt_uint32: not called CC=1 SCAR=6.9
Pod documented
40 0 my $i = shift;
41 0 return pack "N", $i;
42 }
43  
44 0 ▶sub nt_float32 {
Subroutine nt_float32: not called CC=1 SCAR=6.9
Pod documented
45 0 my $f = shift;
46 0 return pack "f>", $f;
47 }
48  
49 0 ▶sub nt_float64 {
Subroutine nt_float64: not called CC=1 SCAR=6.9
Pod documented
50 0 my $f = shift;
51 0 return pack "d>", $f;
52 }
53  
54  
55 0 ▶sub nt_header {
Subroutine nt_header: not called CC=2 SCAR=17.9
Pod documented
56 0 my ($self,$command,$b_size,$response) =@_;
57 0 $command = lc($command);
58 0 my ($pad_len) = 32 - length($command);
59 0 my($template)="A".length($command);
60 0 for (1..$pad_len){
61  
62 0 $template=$template."x"
63 }
64 0 my $cmd= pack($template,$command);
65 0 my $bodysize= nt_int($b_size);
66 0 my $rsp= nt_uint16($response);
67 0 return $cmd.$bodysize.$rsp.nt_uint16(0);
68 }
69  
70  
71 sub _end_of_com
72 0 ▶{
Subroutine _end_of_com: not called CC=3 SCAR=24.8
73 0 my $self = shift;
74 0 my $response = $self->tramea_read();
75 0 ▶ if(length($response)==40){
Branch: 1 branch
BranchTrueFalseTotal
if (length $response == 40) 0 0 0
76 0 my $response_bodysize = unpack("N!",substr($response,32,4));
77 0 ▶ if($response_bodysize>0)
Branch: 1 branch
BranchTrueFalseTotal
if ($response_bodysize > 0) 0 0 0
78 {
79 0 print(substr($response,40,$response_bodysize)."\n");
80 0 die "(Proto) Error returned by nanonis software"
81 }
82 }
83 0 return $response
84 }
85  
86 0 ▶sub tramea_read {
Subroutine tramea_read: not called CC=1 SCAR=6.9
Pod undocumented
87 0 my $self = shift;
88 0 my $head = $self->binary_read(read_length=>40);
89 0 my $body_length = unpack("N!", substr $head,32,4);
90 0 my $body = $self->binary_read(read_length=>$body_length);
91 0 return $head.$body;
92 }
93  
94  
95 0 ▶sub strArrayUnpacker {
Subroutine strArrayUnpacker: not called CC=2 SCAR=17.9
Pod documented
96 0 my ($self, $elementNum, $strArray) = @_;
97 0 my $position = 0;
98 0 my %unpckStrArray;
99 0 for(0..$elementNum-1){
100 0 my $strlen = unpack("N!",substr $strArray,$position,4);
101 0 $position+=4;
102 0 my $string = substr $strArray,$position,$strlen;
103 0 $position+=$strlen;
104 0 $unpckStrArray{$_}=$string;
105 }
106 0 return %unpckStrArray;
107 }
108  
109 0 ▶sub intArrayUnpacker {
Subroutine intArrayUnpacker: not called CC=2 SCAR=17.9
Pod documented
110 0 my ($self,$elementNum,$intArray) = @_;
111 0 my $position = 0;
112 0 my @intArray;
113 0 for(0...$elementNum-1){
114 0 my $int = unpack("N!", substr $intArray,$position,4);
115 0 push @intArray, $int;
116 0 $position+=4;
117 }
118  
119 0 return @intArray;
120 }
121  
122 0 ▶sub float32ArrayUnpacker {
Subroutine float32ArrayUnpacker: not called CC=2 SCAR=17.9
Pod documented
123 0 my ($self,$elementNum,$Array) = @_;
124 0 my $position = 0;
125 0 my @floatArray;
126 0 for(0...$elementNum-1){
127 0 my $float = unpack("f>", substr $Array,$position,4);
128 0 push @floatArray, $float;
129 0 $position+=4;
130 }
131  
132 0 return @floatArray;
133 }
134  
135  
136  
137 0 ▶sub oneDSwp_AcqChsSet {
Subroutine oneDSwp_AcqChsSet: not called CC=3 SCAR=24.8
Pod undocumented
138 0 my $self = shift;
139 0 my @channels;
140 0 foreach(@_){
141 0 push @channels,$_;
142 }
143 0 my $command_name="1dswp.acqchsset";
144 0 my $bodysize= (1 + scalar(@channels))*4;
145 0 my $head= $self->nt_header($command_name,$bodysize,0);
146 #Create body
147 0 my $body= nt_int($#channels+1);
148 0 foreach(@channels){
149 0 $body= $body.nt_int($_);
150 }
151 0 $self->write(command=>$head.$body);
152 }
153  
154  
155 0 ▶sub oneDSwp_AcqChsGet {
Subroutine oneDSwp_AcqChsGet: not called CC=1 SCAR=6.9
Pod undocumented
156 0 my $self = shift;
157 0 my $command_name="1dswp.acqchsget";
158 0 my $bodysize = 0;
159 0 my $head= $self->nt_header($command_name,$bodysize,1);
160 0 $self->write(command=>$head);
161  
162 0 my $return = $self->tramea_read();
163 0 my $channelNum = unpack("N!",substr $return,40,4);
164 0 my @channels = $self->intArrayUnpacker($channelNum,(substr $return,44));
165 0 return(@channels);
166 }
167  
168 0 ▶sub oneDSwp_SwpSignalSet {
Subroutine oneDSwp_SwpSignalSet: not called CC=1 SCAR=6.9
Pod undocumented
169 0 my ($self, $channelName) = @_;
170 0 my $strlen = length($channelName);
171 0 my $command_name="1dswp.swpsignalset";
172 0 my $bodysize = $strlen+4;
173 0 $strlen=nt_int($strlen);
174 0 my $head= $self->nt_header($command_name,$bodysize,1);
175 0 $self->write(command=>$head.$strlen.$channelName);
176 }
177  
178 0 ▶sub oneDSwp_SwpSignalGet {
Subroutine oneDSwp_SwpSignalGet: not called CC=4 SCAR=30.0
Pod undocumented
179 0 my $self = shift;
180 0 my $option= "select";
181 0 ▶ if (scalar(@_)>0){
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_ > 0) 0 0 0
182 0 $option = shift;
183 }
184 0 my $command_name="1dswp.swpsignalget";
185 0 my $head= $self->nt_header($command_name,0,1);
186 0 $self->write(command=>$head);
187 0 my $response = $self->tramea_read();
188 0 my $strlen= unpack("N!",substr $response,40,4);
189  
190 0 ▶ if (($option eq "select") == 1){
Branch: 2 branches
BranchTrueFalseTotal
if (($option eq 'select') == 1) { } 0 0 0
elsif (($option eq 'info') == 1) { } 0 0 0
191 0 my $selected = substr $response,44,$strlen;
192 }
193 elsif (($option eq "info")==1){
194 0 my $elementNum = unpack("N!", substr $response,48+$strlen,4);
195 0 my $strArray= substr $response,52+$strlen;
196 0 my %channels = $self->strArrayUnpacker($elementNum,$strArray);
197 0 return %channels;
198 }
199 else{
200 0 return "Invalid Options!"
201 }
202 }
203  
204 0 ▶sub oneDSwp_LimitsSet {
Subroutine oneDSwp_LimitsSet: not called CC=1 SCAR=6.9
Pod undocumented
205 0 my $self = shift;
206 0 my ($Lower_limit,$Upper_limit,)= @_;
207 0 my $command_name= "1dswp.limitsset";
208 0 my $bodysize = 8;
209 0 my $head = $self->nt_header($command_name,$bodysize,0);
210 0 my $body=nt_float32($Lower_limit);
211 0 $body=$body.nt_float32($Upper_limit);
212 0 $self->write(command=>$head.$body)
213 }
214  
215 0 ▶sub oneDSwp_LimitsGet {
Subroutine oneDSwp_LimitsGet: not called CC=1 SCAR=6.9
Pod undocumented
216 0 my $self = shift;
217 0 my $command_name= "1dswp.limitsget";
218 0 my $bodysize = 0;
219 0 my $rbodysize = 8;
220 0 my $head= $self->nt_header($command_name,$bodysize,1);
221 0 $self->write(command=>$head);
222 0 my $return = $self->tramea_read();
223 0 $return = $self->tramea_read();
224 0 my $Lower_limit= substr $return,40,4;
225 0 $Lower_limit= unpack("f>",$Lower_limit);
226 0 my $Upper_limit= substr $return,44,4;
227 0 $Upper_limit= unpack("f>",$Upper_limit);
228 0 return($Lower_limit,$Upper_limit);
229 }
230  
231 0 ▶sub oneDSwp_PropsSet {
Subroutine oneDSwp_PropsSet: not called CC=1 SCAR=6.9
Pod undocumented
232 0 my $self = shift;
233 0 my ($Initial_Settling_time_ms,$Maximum_slew_rate,$Number_of_steps,$Period_ms,$Autosave,$Save_dialog_box,$Settling_time_ms)= @_;
234 0 my $command_name= "1dswp.propsset";
235 0 my $bodysize = 26;
236 0 my $head= $self->nt_header($command_name,$bodysize,0);
237 0 my $body=nt_float32($Initial_Settling_time_ms);
238 0 $body=$body.nt_float32($Maximum_slew_rate);
239 0 $body=$body.nt_int($Number_of_steps);
240 0 $body=$body.nt_uint16($Period_ms);
241 0 $body=$body.nt_int($Autosave);
242 0 $body=$body.nt_int($Save_dialog_box);
243 0 $body=$body.nt_float32($Settling_time_ms);
244 0 $self->write(command=>$head.$body);
245 }
246  
247 0 ▶sub oneDSwp_PropsGet {
Subroutine oneDSwp_PropsGet: not called CC=1 SCAR=6.9
Pod undocumented
248 0 my $self = shift;
249 0 my $command_name= "1dswp.propsget";
250 0 my $bodysize = 0;
251 0 my $head= $self->nt_header($command_name,$bodysize,1);
252 0 $self->write(command=>$head);
253  
254 0 my $return = $self->tramea_read();
255 0 my $Initial_Settling_time_ms= substr $return,40,4;
256 0 $Initial_Settling_time_ms= unpack("f>",$Initial_Settling_time_ms);
257 0 my $s= substr $return,44,4;
258 0 $s= unpack("f>",$s);
259 0 my $Number_of_steps= substr $return,48,4;
260 0 $Number_of_steps= unpack("N!",$Number_of_steps);
261 0 my $Period_ms= substr $return,52,2;
262 0 $Period_ms= unpack("n",$Period_ms);
263 0 my $Autosave= substr $return,54,4;
264 0 $Autosave= unpack("N",$Autosave);
265 0 my $Save_dialog_box= substr $return,58,4;
266 0 $Save_dialog_box= unpack("N",$Save_dialog_box);
267 0 my $Settling_time_ms= substr $return,62,4;
268 0 $Settling_time_ms= unpack("f>",$Settling_time_ms);
269 0 return($Initial_Settling_time_ms,$s,$Number_of_steps,$Period_ms,$Autosave,$Save_dialog_box,$Settling_time_ms);
270 }
271  
272 0 ▶sub oneDSwp_Start {
Subroutine oneDSwp_Start: not called CC=7 SCAR=40.3
Pod undocumented
273 0 my ($self,$get,$direction,$name,$reset,$timeout) = @_;
274 0 my $command_name= "1dswp.start";
275 0 my $name_len= length($name);
276 0 my $bodysize = 16 +$name_len;
277
278 0 ▶ if($get!= 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($get != 0) 0 0 0
279 0 $get = 1;
280 }
281 0 ▶ if($direction!= 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($direction != 0) 0 0 0
282 0 $direction = 1;
283 }
284 0 ▶ if($reset!= 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($reset != 0) 0 0 0
285 0 $reset = 1;
286 }
287 0 my $head= $self->nt_header($command_name,$bodysize,$get);
288 0 my $body = nt_uint32($get);
289 0 $body = $body.nt_uint32($direction);
290 0 $body = $body.nt_int($name_len);
291 0 $body = $body.$name;
292 0 $body = $body.nt_uint32($reset);
293 0 $self->write(command=>$head.$body);
294  
295 0 ▶ if($get==1){
Branch: 1 branch
BranchTrueFalseTotal
if ($get == 1) { } 0 0 0
296 0 my $return = $self->binary_read(timeout=>$timeout);
297 0 my $channelSize = unpack("N!",substr($return,40,4));
298 0 my $channelNum =unpack("N!",substr($return,44,4));
299 0 my %channels = $self->strArrayUnpacker($channelNum,substr($return,48,$channelSize));
300 0 $channels{0}=$channels{0}."*";
301 0 my $newPos = 48 +$channelSize;
302 0 my $rowNum = unpack("N!",substr($return,$newPos,4));
303 0 my $colNum = unpack("N!",substr($return,$newPos+4,4));
304 0 my $rawData = substr($return,$newPos+8,$rowNum*$colNum*4);
305 0 my %data;
306 0 my $pos = 0;
307 0 ▶ for(my $row = 0;$row<$rowNum;$row++)
Branch: 1 branch
BranchTrueFalseTotal
if ($row < $rowNum) 0 0 0
308 {
309 0 my @rowBuffer;
310 0 ▶ for(my $col = 0;$col<$colNum;$col++)
Branch: 1 branch
BranchTrueFalseTotal
if ($col < $colNum) 0 0 0
311 {
312 0 push @rowBuffer , unpack("f>",substr($rawData,$pos,4));
313 0 $pos +=4;
314 }
315 0 $data{$channels{$row}} = [@rowBuffer];
316 }
317 0 return %data;
318 }
319 else{
320 0 return 0;
321 }
322  
323 }
324  
325 0 ▶sub oneDSwp_Stop {
Subroutine oneDSwp_Stop: not called CC=1 SCAR=6.9
Pod undocumented
326 0 my $self = shift;
327 0 my $command_name= "1dswp.stop";
328 0 my $bodysize = 0;
329 0 my $head= $self->nt_header($command_name,$bodysize,0);
330 0 $self->write(command=>$head);
331 }
332  
333  
334 0 ▶sub oneDSwp_Open {
Subroutine oneDSwp_Open: not called CC=1 SCAR=6.9
Pod undocumented
335 0 my $self = shift;
336 0 my $command_name= "1dswp.open";
337 0 my $bodysize = 0;
338 0 my $head= $self->nt_header($command_name,$bodysize,0);
339 0 $self->write(command=>$head);
340 }
341  
342  
343  
344  
345  
346  
347  
348  
349  
350 0 ▶sub threeDSwp_AcqChsSet {
Subroutine threeDSwp_AcqChsSet: not called CC=2 SCAR=17.9
Pod undocumented
351 0 my $self = shift;
352 0 my $channels_ref = shift;
353 0 my @channels = @{$channels_ref};
354 0 my $Number_of_Channels= scalar @channels;
355 0 my $command_name = "3dswp.acqchsset";
356 0 my $bodysize = 4*($Number_of_Channels+1);
357 0 my $header = $self->nt_header($command_name,$bodysize,1);
358 0 my $body = nt_int($Number_of_Channels);
359 0 ▶ for(my $i = 0;$i<$Number_of_Channels;$i++)
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $Number_of_Channels) 0 0 0
360 {
361 0 $body=$body.nt_int($channels[$i]);
362 }
363 0 $self->write(command=>$header.$body);
364 0 $self->_end_of_com();
365 }
366  
367 0 ▶sub threeDSwp_AcqChsGet {
Subroutine threeDSwp_AcqChsGet: not called CC=2 SCAR=17.9
Pod undocumented
368  
369 0 my $self = shift;
370 0 my $command_name = "3dswp.acqchsget";
371 0 $self->write(command=>$self->nt_header($command_name,0,1));
372  
373 0 my $return= $self->tramea_read();
374 0 my $Number_of_Channels = unpack("N!", substr($return,40,4));
375 0 my $pos = 4*($Number_of_Channels);
376 0 my @indexes = $self->intArrayUnpacker($Number_of_Channels,substr($return,44,$pos));
377 0 $pos +=44;
378 0 my $Channel_names_size = unpack("N!",substr($return,$pos,4));
379 0 my $Channel_num = unpack("N!",substr($return,$pos+4,4));
380 0 my %names = $self->strArrayUnpacker($Channel_num,substr($return,$pos+8,$Channel_names_size));
381 0 my %combined;
382  
383 0 ▶ for(my $idx = 0; $idx<scalar(@indexes);$idx++){
Branch: 1 branch
BranchTrueFalseTotal
if ($idx < scalar @indexes) 0 0 0
384 0 $combined{$indexes[$idx]}=$names{$idx}
385 }
386 0 return(%combined);
387 }
388  
389 0 ▶sub threeDSwp_SaveOptionsSet {
Subroutine threeDSwp_SaveOptionsSet: not called CC=8 SCAR=42.8
Pod undocumented
390 0 my $self = shift;
391 0 my $Series_Name= shift;
392 0 my $Create_Date_Time =shift;
393 0 my $Comment = shift;
394 0 my @Modules_Names= ();
395 0 ▶ if(scalar(@_) >0)
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_ > 0) 0 0 0
396 {
397 0 my $Modules_Names_ref = shift;
398 0 @Modules_Names = @{$Modules_Names_ref};
399 }
400 0 my $command_name = "3dswp.saveoptionsset";
401 0 my $bodysize = 20;
402 0 my $body = nt_int(0);
403 0 ▶ if(length($Series_Name)!=0)
Branch: 1 branch
BranchTrueFalseTotal
if (length $Series_Name != 0) 0 0 0
404 {
405 0 $body=nt_int(length($Series_Name));
406 0 $body=$body.$Series_Name;
407 0 $bodysize+=length($Series_Name);
408 }
409 0 ▶ if($Create_Date_Time >0)
Branch: 2 branches
BranchTrueFalseTotal
if ($Create_Date_Time > 0) { } 0 0 0
elsif ($Create_Date_Time < 0) { } 0 0 0
410 {
411 0 $Create_Date_Time =1;
412 }
413 elsif ($Create_Date_Time<0)
414 {
415 0 $Create_Date_Time = -1;
416 }
417 0 $body= $body.nt_int($Create_Date_Time);
418 0 ▶ if(length($Comment)!=0)
Branch: 1 branch
BranchTrueFalseTotal
if (length $Comment != 0) { } 0 0 0
419 {
420 0 $body = $body.nt_int(length($Comment)).$Comment;
421 0 $bodysize+= length($Comment);
422 }
423 else
424 {
425 0 $body=$body.nt_int(0);
426 }
427 0 ▶ if (scalar(@Modules_Names) != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @Modules_Names != 0) { } 0 0 0
428 {
429 0 my $buffer_size = 0;
430 0 my $buffer_body = "";
431 0 foreach(@Modules_Names)
432 {
433 0 $buffer_body = $buffer_body.nt_int(length($_)).$_;
434 0 $buffer_size+= 4+length($_);
435 }
436 0 $body = $body.nt_int($buffer_size);
437 0 $body = $body.nt_int(scalar(@Modules_Names));
438 0 $body = $body.$buffer_body;
439 0 $bodysize += $buffer_size;
440 }
441 else
442 {
443 0 $body= $body.nt_int(0).nt_int(0);
444 }
445 0 $self->write(command=>$self->nt_header($command_name,$bodysize,1).$body);
446 0 $self->_end_of_com();
447 }
448  
449 0 ▶sub threeDSwp_SaveOptionsGet {
Subroutine threeDSwp_SaveOptionsGet: not called CC=1 SCAR=6.9
Pod undocumented
450 0 my $self = shift;
451 0 my $command_name = "3dswp.saveoptionsget";
452 0 $self->write(command=>$self->nt_header($command_name,0,1));
453  
454 0 my $return = $self->tramea_read();
455 0 my $pos = unpack("N!",substr($return,40,4));
456 0 my $Series_Name = substr($return,44,$pos);
457 0 $pos+=44;
458 0 my $DT_Folder_opt = unpack("N",substr($return,$pos,4));
459 0 $pos += 12 + unpack("N!",substr($return,$pos+4,4));
460 0 my $strLen = unpack("N!",substr($return,$pos,4));
461 0 my $Comment = substr($return,$pos+4,$strLen);
462 0 $pos+=4+$strLen;
463 0 my $MP_size = unpack("N!",substr($return,$pos,4));
464 0 my $MP_number = unpack("N!",substr($return,$pos+4,4));
465 0 my %Modules_parameters = $self->strArrayUnpacker($MP_number,substr($return,$pos+8,$MP_size));
466 0 my @Modules_param = @Modules_parameters{0...(scalar(keys %Modules_parameters)-1)};
467 0 return($Series_Name,$DT_Folder_opt,$Comment,@Modules_param);
468  
469 }
470  
471 0 ▶sub threeDSwp_Start {
Subroutine threeDSwp_Start: not called CC=1 SCAR=6.9
Pod undocumented
472 0 my $self = shift;
473 0 my $command_name= "3dswp.start";
474 0 my $bodysize = 0;
475 0 my $head= $self->nt_header($command_name,$bodysize,1);
476 0 $self->write(command=>$head);
477 0 $self->_end_of_com();
478 }
479  
480 0 ▶sub threeDSwp_Stop {
Subroutine threeDSwp_Stop: not called CC=1 SCAR=6.9
Pod undocumented
481 0 my $self = shift;
482 0 my $command_name= "3dswp.stop";
483 0 my $bodysize = 0;
484 0 my $head= $self->nt_header($command_name,$bodysize,0);
485 0 $self->write(command=>$head);
486 }
487  
488 0 ▶sub threeDSwp_Open {
Subroutine threeDSwp_Open: not called CC=1 SCAR=6.9
Pod undocumented
489 0 my $self = shift;
490 0 my $command_name= "3dswp.open";
491 0 my $bodysize = 0;
492 0 my $head= $self->nt_header($command_name,$bodysize,0);
493 0 $self->write(command=>$head);
494 }
495  
496 0 ▶sub threeDSwp_StatusGet {
Subroutine threeDSwp_StatusGet: not called CC=1 SCAR=6.9
Pod undocumented
497 0 my $self = shift;
498 0 my $command_name= "3dswp.statusget";
499 0 my $bodysize = 0;
500 0 my $head= $self->nt_header($command_name,$bodysize,1);
501 0 $self->write(command=>$head);
502 0 my $return = $self->tramea_read();
503 0 my $Status= substr $return,40,4;
504 0 $Status= unpack("N",$Status);
505 0 return($Status);
506 }
507  
508  
509 0 ▶sub threeDSwp_SwpChSignalSet {
Subroutine threeDSwp_SwpChSignalSet: not called CC=1 SCAR=6.9
Pod undocumented
510 0 my $self = shift;
511 0 my $Sweep_channel_index = shift;
512 0 my $command_name= "3dswp.swpchsignalset";
513 0 my $bodysize = 4;
514 0 my $head= $self->nt_header($command_name,$bodysize,1);
515 0 $self->write(command=>$head.nt_int($Sweep_channel_index));
516 0 $self->_end_of_com();
517 }
518  
519 0 ▶sub threeDSwp_SwpChLimitsSet {
Subroutine threeDSwp_SwpChLimitsSet: not called CC=1 SCAR=6.9
Pod undocumented
520 0 my $self = shift;
521 0 my ($Start,$Stop)= @_;
522 0 my $command_name= "3dswp.swpchlimitsset";
523 0 my $bodysize = 8;
524 0 my $head= $self->nt_header($command_name,$bodysize,1);
525 0 my $body=nt_float32($Start);
526 0 $body=$body.nt_float32($Stop);
527 0 $self->write(command=>$head.$body);
528 0 $self->_end_of_com();
529 }
530  
531 0 ▶sub threeDSwp_SwpChLimitsGet {
Subroutine threeDSwp_SwpChLimitsGet: not called CC=1 SCAR=6.9
Pod undocumented
532 0 my $self = shift;
533 0 my $command_name= "3dswp.swpchlimitsget";
534 0 my $bodysize = 0;
535 0 my $head= $self->nt_header($command_name,$bodysize,1);
536 0 $self->write(command=>$head);
537 0 my $return = $self->tramea_read();
538 0 my $Start= substr $return,40,4;
539 0 $Start= unpack("f>",$Start);
540 0 my $Stop= substr $return,44,4;
541 0 $Stop= unpack("f>",$Stop);
542 0 return($Start,$Stop);
543 }
544  
545 0 ▶sub threeDSwp_SwpChPropsSet {
Subroutine threeDSwp_SwpChPropsSet: not called CC=1 SCAR=6.9
Pod undocumented
546 0 my $self = shift;
547 0 my ($Number_of_points,$Number_of_sweeps,$Backward_sweep,$End_of_sweep_action,$End_of_sweep_arbitrary_value,$Save_all)= @_;
548 0 my $command_name= "3dswp.swpchpropsset";
549 0 my $bodysize = 24;
550 0 my $head= $self->nt_header($command_name,$bodysize,1);
551 0 my $body=nt_int($Number_of_points);
552 0 $body=$body.nt_int($Number_of_sweeps);
553 0 $body=$body.nt_int($Backward_sweep);
554 0 $body=$body.nt_int($End_of_sweep_action);
555 0 $body=$body.nt_float32($End_of_sweep_arbitrary_value);
556 0 $body=$body.nt_int($Save_all);
557 0 $self->write(command=>$head.$body);
558 0 $self->_end_of_com();
559 }
560  
561 0 ▶sub threeDSwp_SwpChPropsGet {
Subroutine threeDSwp_SwpChPropsGet: not called CC=1 SCAR=6.9
Pod undocumented
562 0 my $self = shift;
563 0 my $command_name= "3dswp.swpchpropsget";
564 0 my $bodysize = 0;
565 0 my $head= $self->nt_header($command_name,$bodysize,1);
566 0 $self->write(command=>$head);
567 0 my $return = $self->tramea_read();
568 0 my $Number_of_points= substr $return,40,4;
569 0 $Number_of_points= unpack("N!",$Number_of_points);
570 0 my $Number_of_sweeps= substr $return,44,4;
571 0 $Number_of_sweeps= unpack("N!",$Number_of_sweeps);
572 0 my $Backward_sweep= substr $return,48,4;
573 0 $Backward_sweep= unpack("N",$Backward_sweep);
574 0 my $End_of_sweep_action= substr $return,52,4;
575 0 $End_of_sweep_action= unpack("N",$End_of_sweep_action);
576 0 my $End_of_sweep_arbitrary_value= substr $return,56,4;
577 0 $End_of_sweep_arbitrary_value= unpack("f>",$End_of_sweep_arbitrary_value);
578 0 my $Save_all= substr $return,60,4;
579 0 $Save_all= unpack("N",$Save_all);
580 0 return($Number_of_points,$Number_of_sweeps,$Backward_sweep,$End_of_sweep_action,$End_of_sweep_arbitrary_value,$Save_all);
581 }
582  
583 0 ▶sub threeDSwp_SwpChTimingSet {
Subroutine threeDSwp_SwpChTimingSet: not called CC=1 SCAR=6.9
Pod undocumented
584 0 my $self = shift;
585 0 my ($Initial_settling_time_s,$Settling_time_s,$Integration_time_s,$End_settling_time_s,$Maximum_slw_rate)= @_;
586 0 my $command_name= "3dswp.swpchtimingset";
587 0 my $bodysize = 20;
588 0 my $head= $self->nt_header($command_name,$bodysize,1);
589 0 my $body=nt_float32($Initial_settling_time_s);
590 0 $body=$body.nt_float32($Settling_time_s);
591 0 $body=$body.nt_float32($Integration_time_s);
592 0 $body=$body.nt_float32($End_settling_time_s);
593 0 $body=$body.nt_float32($Maximum_slw_rate);
594 0 $self->write(command=>$head.$body);
595 0 $self->_end_of_com();
596 }
597  
598 0 ▶sub threeDSwp_SwpChTimingGet {
Subroutine threeDSwp_SwpChTimingGet: not called CC=1 SCAR=6.9
Pod undocumented
599 0 my $self = shift;
600 0 my $command_name= "3dswp.swpchtimingget";
601 0 my $bodysize = 0;
602 0 my $head= $self->nt_header($command_name,$bodysize,1);
603 0 $self->write(command=>$head);
604 0 my $return = $self->tramea_read();
605 0 my $Initial_settling_time_s= substr $return,40,4;
606 0 $Initial_settling_time_s= unpack("f>",$Initial_settling_time_s);
607 0 my $Settling_time_s= substr $return,44,4;
608 0 $Settling_time_s= unpack("f>",$Settling_time_s);
609 0 my $Integration_time_s= substr $return,48,4;
610 0 $Integration_time_s= unpack("f>",$Integration_time_s);
611 0 my $End_settling_time_s= substr $return,52,4;
612 0 $End_settling_time_s= unpack("f>",$End_settling_time_s);
613 0 my $Maximum_slw_rate= substr $return,56,4;
614 0 $Maximum_slw_rate= unpack("f>",$Maximum_slw_rate);
615 0 return($Initial_settling_time_s,$Settling_time_s,$Integration_time_s,$End_settling_time_s,$Maximum_slw_rate);
616 }
617  
618 0 ▶sub threeDSwp_SwpChModeSet {
Subroutine threeDSwp_SwpChModeSet: not called CC=1 SCAR=6.9
Pod undocumented
619 0 my $self = shift;
620 0 my $Channel_name = shift;
621 0 my $name_len = length($Channel_name);
622 0 my $bodysize = 4*($name_len+1);
623 0 my $command_name = "3dswp.swpchmodeset";
624 0 my $head= $self->nt_header($command_name,$bodysize,0);
625 0 $self->write(command=>$head.nt_int($name_len).$Channel_name);
626 }
627  
628 0 ▶sub threeDSwp_SwpChModeGet {
Subroutine threeDSwp_SwpChModeGet: not called CC=1 SCAR=6.9
Pod undocumented
629 0 my $self = shift;
630 0 my $command_name = "3dswp.swpchmodeget";
631 0 my $head = $self->nt_header($command_name,0,1);
632 0 $self->write(command=>$head);
633 0 my $return= $self->tramea_read();
634 0 return substr($return,44,unpack("N!",substr($return,40,4)));
635 }
636  
637  
638 0 ▶sub threeDSwp_StpCh1SignalSet {
Subroutine threeDSwp_StpCh1SignalSet: not called CC=1 SCAR=6.9
Pod undocumented
639 0 my $self = shift;
640 0 my $Step_channel_1_index = shift;
641 0 my $command_name= "3dswp.stpch1signalset";
642 0 my $bodysize = 4;
643 0 my $head= $self->nt_header($command_name,$bodysize,1);
644 0 $self->write(command=>$head.nt_int($Step_channel_1_index));
645 0 $self->_end_of_com();
646 }
647  
648 0 ▶sub threeDSwp_StpCh1LimitsSet {
Subroutine threeDSwp_StpCh1LimitsSet: not called CC=1 SCAR=6.9
Pod undocumented
649 0 my $self = shift;
650 0 my ($Start,$Stop)= @_;
651 0 my $command_name= "3dswp.stpch1limitsset";
652 0 my $bodysize = 8;
653 0 my $head= $self->nt_header($command_name,$bodysize,1);
654 0 my $body=nt_float32($Start);
655 0 $body=$body.nt_float32($Stop);
656 0 $self->write(command=>$head.$body);
657 0 $self->_end_of_com();
658 }
659  
660 0 ▶sub threeDSwp_StpCh1LimitsGet {
Subroutine threeDSwp_StpCh1LimitsGet: not called CC=1 SCAR=6.9
Pod undocumented
661 0 my $self = shift;
662 0 my $command_name= "3dswp.stpch1limitsget";
663 0 my $bodysize = 0;
664 0 my $head= $self->nt_header($command_name,$bodysize,1);
665 0 $self->write(command=>$head);
666 0 my $return = $self->tramea_read();
667 0 my $Start= substr $return,40,4;
668 0 $Start= unpack("f>",$Start);
669 0 my $Stop= substr $return,44,4;
670 0 $Stop= unpack("f>",$Stop);
671 0 return($Start,$Stop);
672 }
673  
674 0 ▶sub threeDSwp_StpCh1PropsSet {
Subroutine threeDSwp_StpCh1PropsSet: not called CC=1 SCAR=6.9
Pod undocumented
675 0 my $self = shift;
676 0 my ($Number_of_points,$Backward_sweep,$End_of_sweep_action,$End_of_sweep_arbitrary_value)= @_;
677 0 my $command_name= "3dswp.stpch1propsset";
678 0 my $bodysize = 16;
679 0 my $head= $self->nt_header($command_name,$bodysize,1);
680 0 my $body=nt_int($Number_of_points);
681 0 $body=$body.nt_int($Backward_sweep);
682 0 $body=$body.nt_int($End_of_sweep_action);
683 0 $body=$body.nt_float32($End_of_sweep_arbitrary_value);
684 0 $self->write(command=>$head.$body);
685 0 $self->_end_of_com();
686 }
687  
688 0 ▶sub threeDSwp_StpCh1PropsGet {
Subroutine threeDSwp_StpCh1PropsGet: not called CC=1 SCAR=6.9
Pod undocumented
689 0 my $self = shift;
690 0 my $command_name= "3dswp.stpch1propsget";
691 0 my $bodysize = 0;
692 0 my $head= $self->nt_header($command_name,$bodysize,1);
693 0 $self->write(command=>$head);
694 0 my $return = $self->tramea_read();
695 0 my $Number_of_points= substr $return,40,4;
696 0 $Number_of_points= unpack("N!",$Number_of_points);
697 0 my $Backward_sweep= substr $return,44,4;
698 0 $Backward_sweep= unpack("N",$Backward_sweep);
699 0 my $End_of_sweep_action= substr $return,48,4;
700 0 $End_of_sweep_action= unpack("N",$End_of_sweep_action);
701 0 my $End_of_sweep_arbitrary_value= substr $return,52,4;
702 0 $End_of_sweep_arbitrary_value= unpack("f>",$End_of_sweep_arbitrary_value);
703 0 return($Number_of_points,$Backward_sweep,$End_of_sweep_action,$End_of_sweep_arbitrary_value);
704 }
705  
706 0 ▶sub threeDSwp_StpCh1TimingSet {
Subroutine threeDSwp_StpCh1TimingSet: not called CC=1 SCAR=6.9
Pod undocumented
707 0 my $self = shift;
708 0 my ($Initial_settling_time_s,$End_settling_time_s,$Maximum_slw_rate)= @_;
709 0 my $command_name= "3dswp.stpch1timingset";
710 0 my $bodysize = 12;
711 0 my $head= $self->nt_header($command_name,$bodysize,0);
712 0 my $body=nt_float32($Initial_settling_time_s);
713 0 $body=$body.nt_float32($End_settling_time_s);
714 0 $body=$body.nt_float32($Maximum_slw_rate);
715 0 $self->write(command=>$head.$body);
716 0 $self->_end_of_com();
717 }
718  
719 0 ▶sub threeDSwp_StpCh1TimingGet {
Subroutine threeDSwp_StpCh1TimingGet: not called CC=1 SCAR=6.9
Pod undocumented
720 0 my $self = shift;
721 0 my $command_name= "3dswp.stpch1timingget";
722 0 my $bodysize = 0;
723 0 my $head= $self->nt_header($command_name,$bodysize,1);
724 0 $self->write(command=>$head);
725 0 my $return = $self->tramea_read();
726 0 my $Initial_settling_time_s= substr $return,40,4;
727 0 $Initial_settling_time_s= unpack("f>",$Initial_settling_time_s);
728 0 my $End_settling_time_s= substr $return,44,4;
729 0 $End_settling_time_s= unpack("f>",$End_settling_time_s);
730 0 my $Maximum_slw_rate= substr $return,48,4;
731 0 $Maximum_slw_rate= unpack("f>",$Maximum_slw_rate);
732 0 return($Initial_settling_time_s,$End_settling_time_s,$Maximum_slw_rate);
733 }
734  
735  
736 0 ▶sub threeDSwp_StpCh2SignalSet {
Subroutine threeDSwp_StpCh2SignalSet: not called CC=1 SCAR=6.9
Pod undocumented
737 0 my $self = shift;
738 0 my $Channel_name = shift;
739 0 my $name_len = length($Channel_name);
740 0 my $bodysize = 4+($name_len);
741 0 my $command_name = "3dswp.stpch2signalset";
742 0 my $head= $self->nt_header($command_name,$bodysize,1);
743 0 $self->write(command=>$head.nt_int($name_len).$Channel_name);
744 0 $self->_end_of_com();
745 }
746  
747  
748 0 ▶sub threeDSwp_StpCh2SignalGet {
Subroutine threeDSwp_StpCh2SignalGet: not called CC=1 SCAR=6.9
Pod undocumented
749 0 my $self = shift;
750 0 my $command_name = "3dswp.stpch2signalget";
751 0 my $head = $self->nt_header($command_name,0,1);
752 0 $self->write(command=>$head);
753 0 my $return= $self->tramea_read();
754 0 return substr($return,44,unpack("N!",substr($return,40,4)));
755 }
756  
757 0 ▶sub threeDSwp_StpCh2LimitsSet {
Subroutine threeDSwp_StpCh2LimitsSet: not called CC=1 SCAR=6.9
Pod undocumented
758 0 my $self = shift;
759 0 my ($Start,$Stop)= @_;
760 0 my $command_name= "3dswp.stpch2limitsset";
761 0 my $bodysize = 8;
762 0 my $head= $self->nt_header($command_name,$bodysize,1);
763 0 my $body=nt_float32($Start);
764 0 $body=$body.nt_float32($Stop);
765 0 $self->write(command=>$head.$body);
766 0 $self->_end_of_com();
767 }
768  
769 0 ▶sub threeDSwp_StpCh2LimitsGet {
Subroutine threeDSwp_StpCh2LimitsGet: not called CC=1 SCAR=6.9
Pod undocumented
770 0 my $self = shift;
771 0 my $command_name= "3dswp.stpch2limitsget";
772 0 my $bodysize = 0;
773 0 my $head= $self->nt_header($command_name,$bodysize,1);
774 0 $self->write(command=>$head);
775 0 my $return = $self->tramea_read();
776 0 my $Start= substr $return,40,4;
777 0 $Start= unpack("f>",$Start);
778 0 my $Stop= substr $return,44,4;
779 0 $Stop= unpack("f>",$Stop);
780 0 return($Start,$Stop);
781 }
782  
783 0 ▶sub threeDSwp_StpCh2PropsSet {
Subroutine threeDSwp_StpCh2PropsSet: not called CC=1 SCAR=6.9
Pod undocumented
784 0 my $self = shift;
785 0 my ($Number_of_points,$Backward_sweep,$End_of_sweep_action,$End_of_sweep_arbitrary_value)= @_;
786 0 my $command_name= "3dswp.stpch2propsset";
787 0 my $bodysize = 16;
788 0 my $head= $self->nt_header($command_name,$bodysize,1);
789 0 my $body=nt_int($Number_of_points);
790 0 $body=$body.nt_int($Backward_sweep);
791 0 $body=$body.nt_int($End_of_sweep_action);
792 0 $body=$body.nt_float32($End_of_sweep_arbitrary_value);
793 0 $self->write(command=>$head.$body);
794 0 $self->_end_of_com();
795 }
796  
797 0 ▶sub threeDSwp_StpCh2PropsGet {
Subroutine threeDSwp_StpCh2PropsGet: not called CC=1 SCAR=6.9
Pod undocumented
798 0 my $self = shift;
799 0 my $command_name= "3dswp.stpch2propsget";
800 0 my $bodysize = 0;
801 0 my $head= $self->nt_header($command_name,$bodysize,1);
802 0 $self->write(command=>$head);
803 0 my $return = $self->tramea_read();
804 0 my $Number_of_points= substr $return,40,4;
805 0 $Number_of_points= unpack("N!",$Number_of_points);
806 0 my $Backward_sweep= substr $return,44,4;
807 0 $Backward_sweep= unpack("N",$Backward_sweep);
808 0 my $End_of_sweep_action= substr $return,48,4;
809 0 $End_of_sweep_action= unpack("N",$End_of_sweep_action);
810 0 my $End_of_sweep_arbitrary_value= substr $return,52,4;
811 0 $End_of_sweep_arbitrary_value= unpack("f>",$End_of_sweep_arbitrary_value);
812 0 return($Number_of_points,$Backward_sweep,$End_of_sweep_action,$End_of_sweep_arbitrary_value);
813 }
814  
815 0 ▶sub threeDSwp_StpCh2TimingSet {
Subroutine threeDSwp_StpCh2TimingSet: not called CC=1 SCAR=6.9
Pod undocumented
816 0 my $self = shift;
817 0 my ($Initial_settling_time_s,$End_settling_time_s,$Maximum_slw_rate)= @_;
818 0 my $command_name= "3dswp.stpch2timingset";
819 0 my $bodysize = 12;
820 0 my $head= $self->nt_header($command_name,$bodysize,0);
821 0 my $body=nt_float32($Initial_settling_time_s);
822 0 $body=$body.nt_float32($End_settling_time_s);
823 0 $body=$body.nt_float32($Maximum_slw_rate);
824 0 $self->write(command=>$head.$body);
825 }
826  
827 0 ▶sub threeDSwp_StpCh2TimingGet {
Subroutine threeDSwp_StpCh2TimingGet: not called CC=1 SCAR=6.9
Pod undocumented
828 0 my $self = shift;
829 0 my $command_name= "3dswp.stpch2timingget";
830 0 my $bodysize = 0;
831 0 my $head= $self->nt_header($command_name,$bodysize,1);
832 0 $self->write(command=>$head);
833 0 my $return = $self->tramea_read();
834 0 my $Initial_settling_time_s= substr $return,40,4;
835 0 $Initial_settling_time_s= unpack("f>",$Initial_settling_time_s);
836 0 my $End_settling_time_s= substr $return,44,4;
837 0 $End_settling_time_s= unpack("f>",$End_settling_time_s);
838 0 my $Maximum_slw_rate= substr $return,48,4;
839 0 $Maximum_slw_rate= unpack("f>",$Maximum_slw_rate);
840 0 return($Initial_settling_time_s,$End_settling_time_s,$Maximum_slw_rate);
841 }
842  
843  
844 0 ▶sub threeDSwp_TimingRowLimitSet {
Subroutine threeDSwp_TimingRowLimitSet: not called CC=1 SCAR=6.9
Pod undocumented
845 #Everythinbg seems set properlly, wierd Behavior on nanonis Software side.
846 0 my $self = shift;
847 0 my ($Row_index,$Maximum_time_seconds,$Channel_index)= @_;
848 0 my $command_name= "3dswp.timingrowlimitset";
849 0 my $bodysize = 12;
850 0 my $head= $self->nt_header($command_name,$bodysize,0);
851 0 my $body=nt_int($Row_index);
852 0 $body=$body.nt_int($Maximum_time_seconds); #Gets translated to int software side..I don't know,should be f32.
853 0 $body=$body.nt_int($Channel_index);
854 0 $self->write(command=>$head.$body);
855 }
856  
857 0 ▶sub threeDSwp_TimingRowLimitGet {
Subroutine threeDSwp_TimingRowLimitGet: not called CC=1 SCAR=6.9
Pod undocumented
858 0 my $self = shift;
859 0 my $Row_index = shift;
860 0 my $command_name= "3dswp.timingrowlimitget";
861 0 my $bodysize = 4;
862 0 my $head= $self->nt_header($command_name,$bodysize,1);
863 0 $self->write(command=>$head.nt_int($Row_index));
864  
865 0 my $return = $self->tramea_read();
866 0 my $Maximum_time= unpack("f>",substr($return,40,4));
867 0 my $Channel_index = unpack("N!",substr($return,44,4));
868 0 my $Channel_names_size = unpack("N!",substr($return,48,4));
869 0 my $Channel_num= unpack("N!",substr($return,52,4));
870 0 my $strArray = substr $return,56,$Channel_names_size;
871 0 my %channels = $self->strArrayUnpacker($Channel_num,$strArray);
872  
873 0 return($Maximum_time,$Channel_index,%channels);
874 }
875  
876 0 ▶sub threeDSwp_TimingRowMethodsSet {
Subroutine threeDSwp_TimingRowMethodsSet: not called CC=1 SCAR=6.9
Pod undocumented
877 0 my $self = shift;
878 0 my ($Row_index,$Method_lower,$Method_middle,$Method_upper,$Method_alternative)= @_;
879 0 my $command_name= "3dswp.timingrowmethodsset";
880 0 my $bodysize = 20;
881 0 my $head= $self->nt_header($command_name,$bodysize,0);
882 0 my $body=nt_int($Row_index);
883 0 $body=$body.nt_int($Method_lower);
884 0 $body=$body.nt_int($Method_middle);
885 0 $body=$body.nt_int($Method_upper);
886 0 $body=$body.nt_int($Method_alternative);
887 0 $self->write(command=>$head.$body);
888 }
889  
890 0 ▶sub threeDSwp_TimingRowMethodsGet {
Subroutine threeDSwp_TimingRowMethodsGet: not called CC=1 SCAR=6.9
Pod undocumented
891 0 my $self = shift;
892 0 my ($Row_index)= @_;
893 0 my $command_name= "3dswp.timingrowmethodsget";
894 0 my $bodysize = 4;
895 0 my $head= $self->nt_header($command_name,$bodysize,1);
896 0 my $body=nt_int($Row_index);
897 0 $self->write(command=>$head.$body);
898 0 my $return = $self->tramea_read();
899 0 my $Method_lower= substr $return,40,4;
900 0 $Method_lower= unpack("N!",$Method_lower);
901 0 my $Method_middle= substr $return,44,4;
902 0 $Method_middle= unpack("N!",$Method_middle);
903 0 my $Method_upper= substr $return,48,4;
904 0 $Method_upper= unpack("N!",$Method_upper);
905 0 my $Method_alternative= substr $return,52,4;
906 0 $Method_alternative= unpack("N!",$Method_alternative);
907 0 return($Method_lower,$Method_middle,$Method_upper,$Method_alternative);
908 }
909  
910  
911 0 ▶sub threeDSwp_TimingRowValsSet {
Subroutine threeDSwp_TimingRowValsSet: not called CC=1 SCAR=6.9
Pod undocumented
912 #The documentation indicates that this function requires float32 input but actually gets f64
913 0 my $self = shift;
914 0 my ($Row_index,$MR_from,$LR_value,$MR_value,$MR_to,$UR_value,$AR_value)= @_;
915 0 my $command_name= "3dswp.timingrowvalsset";
916 0 my $bodysize = 52;
917 0 my $head= $self->nt_header($command_name,$bodysize,0);
918 0 my $body=nt_int($Row_index);
919 0 $body=$body.nt_float64($MR_from);
920 0 $body=$body.nt_float64($LR_value);
921 0 $body=$body.nt_float64($MR_value);
922 0 $body=$body.nt_float64($MR_to);
923 0 $body=$body.nt_float64($UR_value);
924 0 $body=$body.nt_float64($AR_value);
925 0 $self->write(command=>$head.$body);
926 }
927  
928 0 ▶sub threeDSwp_TimingRowValsGet {
Subroutine threeDSwp_TimingRowValsGet: not called CC=1 SCAR=6.9
Pod undocumented
929 #The documentation indicates that this function returns float32 but actually returns f64
930 0 my $self = shift;
931 0 my ($Row_index)= @_;
932 0 my $command_name= "3dswp.timingrowvalsget";
933 0 my $bodysize = 4;
934 0 my $head= $self->nt_header($command_name,$bodysize,1);
935 0 my $body=nt_int($Row_index);
936 0 $self->write(command=>$head.$body);
937 0 my $return = $self->tramea_read();
938 0 my $MR_from= unpack("d>",substr($return,40,8));
939 0 my $LR_value = unpack("d>",substr($return,48,8));
940 0 my $MR_value = unpack("d>",substr($return,56,8));
941 0 my $MR_to = unpack("d>",substr($return,64,8));
942 0 my $UR_value = unpack("d>",substr($return,72,8));
943 0 my $AR_value = unpack("d>",substr($return,80,8));
944 0 return($MR_from,$LR_value,$MR_value,$MR_to,$UR_value,$AR_value);
945  
946 }
947  
948 0 ▶sub threeDSwp_TimingEnable {
Subroutine threeDSwp_TimingEnable: not called CC=1 SCAR=6.9
Pod undocumented
949 0 my $self = shift;
950 0 my ($Enable)= @_;
951 0 my $command_name= "3dswp.timingenable";
952 0 my $bodysize = 4;
953 0 my $head= $self->nt_header($command_name,$bodysize,0);
954 0 my $body=nt_uint32($Enable);
955 0 $self->write(command=>$head.$body);
956 }
957  
958 0 ▶sub threeDSwp_TimingSend {
Subroutine threeDSwp_TimingSend: not called CC=1 SCAR=6.9
Pod undocumented
959 0 my $self = shift;
960 0 my $command_name= "3dswp.timingsend";
961 0 my $bodysize = 0;
962 0 my $head= $self->nt_header($command_name,$bodysize,0);
963 0 $self->write(command=>$head);
964 }
965  
966  
967 0 ▶sub threeDSwp_FilePathsGet {
Subroutine threeDSwp_FilePathsGet: not called CC=1 SCAR=6.9
Pod undocumented
968 # This sleep function deals with an internal issue of the tramea software
969 # If one askes for filenames too soon after sweep it tries to access
970 # files of previous sweep
971 0 sleep(1);
972 0 my $self = shift;
973 0 my $command_name = "3dswp.filepathsget";
974 0 my $head =
975 $self->write(command=>$self->nt_header($command_name,0,1));
976 0 my $response = $self->tramea_read();
977 0 my $strArraySize = unpack("N!", substr $response,40,4);
978 0 my $strNumber = unpack("N!", substr $response, 44, 4 );
979 0 my $strArray = substr $response,48,$strArraySize;
980 0 my %strings = $self->strArrayUnpacker($strNumber,$strArray);
981 0 return %strings;
982 }
983  
984  
985 0 ▶sub Signals_NamesGet {
Subroutine Signals_NamesGet: not called CC=1 SCAR=6.9
Pod undocumented
986 0 my $self =shift;
987 0 my $command_name="signals.namesget";
988 0 my $head = $self->nt_header($command_name,0,1);
989  
990 0 $self->write(command=>$head);
991  
992 0 my $response =$self->tramea_read();
993 0 my $strArraySize = unpack("N!", substr $response,40,4);
994 0 my $strNumber = unpack("N!", substr $response, 44, 4 );
995 0 my $strArray = substr $response,48,$strArraySize;
996 0 my %strings = $self->strArrayUnpacker($strNumber,$strArray);
997 0 return %strings;
998 }
999  
1000 0 ▶sub Signals_InSlotSet {
Subroutine Signals_InSlotSet: not called CC=1 SCAR=6.9
Pod undocumented
1001 0 my $self = shift;
1002 0 my ($Slot,$RT_signal_index)= @_;
1003 0 my $command_name= "signals.inslotset";
1004 0 my $bodysize = 8;
1005 0 my $head= $self->nt_header($command_name,$bodysize,0);
1006 0 my $body=nt_int($Slot);
1007 0 $body=$body.nt_int($RT_signal_index);
1008 0 $self->write(command=>$head.$body);
1009 }
1010  
1011 0 ▶sub Signals_InSlotsGet {
Subroutine Signals_InSlotsGet: not called CC=2 SCAR=17.9
Pod undocumented
1012 0 my $self = shift;
1013 0 my $command_name= "signals.inslotsget";
1014 0 my $head = $self->nt_header($command_name,0,1);
1015 0 $self->write(command=>$head);
1016  
1017 0 my $response = $self->tramea_read();
1018 0 my $namesSize= unpack("N!",substr $response,40,4);
1019 0 my $namesNumber= unpack("N!",substr $response,44,4);
1020 0 my %Strings = $self->strArrayUnpacker($namesNumber,substr($response,48,$namesSize));
1021 0 my $idxNumber = unpack("N!",substr $response,48+$namesSize,4);
1022 0 my @idxArray = $self->intArrayUnpacker($idxNumber,substr($response,52+$namesSize,4*$idxNumber));
1023 0 foreach(keys %Strings){
1024 0 $Strings{$_}= join(" RT ",$Strings{$_},$idxArray[$_]);
1025 }
1026 0 return (%Strings);
1027 }
1028  
1029 0 ▶sub Signals_CalibrGet {
Subroutine Signals_CalibrGet: not called CC=1 SCAR=6.9
Pod undocumented
1030 0 my $self = shift;
1031 0 my ($Signal_index)= @_;
1032 0 my $command_name= "signals.calibrget";
1033 0 my $bodysize = 4;
1034 0 my $head= $self->nt_header($command_name,$bodysize,1);
1035 0 my $body=nt_int($Signal_index);
1036 0 $self->write(command=>$head.$body);
1037 0 my $return = $self->tramea_read();
1038 0 my $Calibration_per_volt= substr $return,40,4;
1039 0 $Calibration_per_volt= unpack("f>",$Calibration_per_volt);
1040 0 my $Offset_in_physical_units= substr $return,44,4;
1041 0 $Offset_in_physical_units= unpack("f>",$Offset_in_physical_units);
1042 0 return($Calibration_per_volt,$Offset_in_physical_units);
1043 }
1044  
1045 0 ▶sub Signals_RangeGet {
Subroutine Signals_RangeGet: not called CC=1 SCAR=6.9
Pod undocumented
1046 0 my $self = shift;
1047 0 my ($Signal_index)= @_;
1048 0 my $command_name= "signals.rangeget";
1049 0 my $bodysize = 4;
1050 0 my $head= $self->nt_header($command_name,$bodysize,1);
1051 0 my $body=nt_int($Signal_index);
1052 0 $self->write(command=>$head.$body);
1053 0 my $return = $self->tramea_read();
1054 0 my $Maximum_limit= substr $return,40,4;
1055 0 $Maximum_limit= unpack("f>",$Maximum_limit);
1056 0 my $Minimum_limit= substr $return,44,4;
1057 0 $Minimum_limit= unpack("f>",$Minimum_limit);
1058 0 return($Maximum_limit,$Minimum_limit);
1059 }
1060  
1061 0 ▶sub Signals_ValGet {
Subroutine Signals_ValGet: not called CC=1 SCAR=6.9
Pod undocumented
1062 0 my $self = shift;
1063 0 my ($Signal_index,$Wait_for_newest_data)= @_;
1064 0 my $command_name= "signals.valget";
1065 0 my $bodysize = 8;
1066 0 my $head= $self->nt_header($command_name,$bodysize,1);
1067 0 my $body=nt_int($Signal_index);
1068 0 $body=$body.nt_uint32($Wait_for_newest_data);
1069 0 $self->write(command=>$head.$body);
1070 0 my $return = $self->tramea_read();
1071 0 my $Signal_value= substr $return,40,4;
1072 0 $Signal_value= unpack("f>",$Signal_value);
1073 0 return($Signal_value);
1074 }
1075  
1076 0 ▶sub Signals_ValsGet {
Subroutine Signals_ValsGet: not called CC=3 SCAR=24.8
Pod undocumented
1077 #this function behaves differently.
1078 #Usualy requested size is actual Byte size, here is element count.
1079  
1080 0 my $self = shift;
1081 0 my @idxArray = @_;
1082 0 my $WFND = pop @idxArray;
1083 0 my $command_name = "signals.valsget";
1084  
1085 0 ▶ if($WFND > 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($WFND > 0) { } 0 0 0
1086 0 $WFND=1;
1087 }
1088 else{
1089 0 $WFND = 0;
1090 }
1091  
1092 0 my $bodysize = 8+ 4 * scalar @idxArray;
1093 0 my $head = $self->nt_header($command_name,$bodysize,1);
1094 0 my $body = pack("N!",(scalar @idxArray));
1095 0 foreach(@idxArray){
1096 0 $body = $body.pack("N!",$_);
1097 }
1098 0 $body= $body.pack("N",$WFND);
1099  
1100 0 $self->write(command=>$head.$body);
1101  
1102 0 my $response = $self->tramea_read();
1103 0 my $valuesSize = unpack("N!", substr $response,40,4);
1104 0 my @floatArray = $self->float32ArrayUnpacker($valuesSize,substr($response,44,$valuesSize*4));
1105 0 return @floatArray;
1106 }
1107  
1108 0 ▶sub Signals_MeasNamesGet {
Subroutine Signals_MeasNamesGet: not called CC=1 SCAR=6.9
Pod undocumented
1109 0 my $self = shift;
1110 0 my $command_name= "signals.measnamesget";
1111 0 my $bodysize = 0;
1112 0 my $head= $self->nt_header($command_name,$bodysize,1);
1113 0 $self->write(command=>$head);
1114 0 my $response = $self->tramea_read();
1115 0 my $channelSize= unpack("N!",substr $response,40,4);
1116 0 my $channelNum= unpack("N!",substr $response,44,4);
1117 0 my $strArray = substr $response,48,$channelSize;
1118 0 my %channels = $self->strArrayUnpacker($channelNum,$strArray);
1119 0 return %channels;
1120 }
1121  
1122 0 ▶sub Signals_AddRTGet() {
Subroutine Signals_AddRTGet: not called CC=1 SCAR=6.9
Pod undocumented
1123
1124 0 my $self = shift;
1125 0 my $command_name="signals.addrtget";
1126 0 my $head = $self->nt_header($command_name,0,1);
1127 0 $self->write(command=>$head);
1128  
1129 0 my $response = $self->tramea_read();
1130 0 my $namesSize = unpack("N!",substr $response,40,4);
1131 0 my $namesNumber = unpack("N!",substr $response,44,4);
1132 0 my %addRtArray = $self->strArrayUnpacker($namesNumber,substr($response,48,$namesSize));
1133 0 return %addRtArray;
1134  
1135 }
1136  
1137 0 ▶sub Signals_AddRTSet {
Subroutine Signals_AddRTSet: not called CC=1 SCAR=6.9
Pod undocumented
1138 0 my $self = shift;
1139 0 my ($Additional_RT_signal_1,$Additional_RT_signal_2)= @_;
1140 0 my $command_name= "signals.addrtset";
1141 0 my $bodysize = 8;
1142 0 my $head= $self->nt_header($command_name,$bodysize,0);
1143 0 my $body=nt_int($Additional_RT_signal_1);
1144 0 $body=$body.nt_int($Additional_RT_signal_2);
1145 0 $self->write(command=>$head.$body);
1146 }
1147  
1148  
1149 0 ▶sub UserIn_CalibrSet {
Subroutine UserIn_CalibrSet: not called CC=1 SCAR=6.9
Pod undocumented
1150 0 my $self = shift;
1151 0 my ($Input_index,$Calibration_per_volt,$Offset_in_physical_units)= @_;
1152 0 my $command_name= "userin.calibrset";
1153 0 my $bodysize = 12;
1154 0 my $head= $self->nt_header($command_name,$bodysize,0);
1155 0 my $body=nt_int($Input_index);
1156 0 $body=$body.nt_float32($Calibration_per_volt);
1157 0 $body=$body.nt_float32($Offset_in_physical_units);
1158 0 $self->write(command=>$head.$body);
1159 }
1160  
1161 0 ▶sub UserOut_ModeSet {
Subroutine UserOut_ModeSet: not called CC=1 SCAR=6.9
Pod undocumented
1162 0 my $self = shift;
1163 0 my ($Output_index,$Output_mode)= @_;
1164 0 my $command_name= "userout.modeset";
1165 0 my $bodysize = 6;
1166 0 my $head= $self->nt_header($command_name,$bodysize,0);
1167 0 my $body=nt_int($Output_index);
1168 0 $body=$body.nt_uint16($Output_mode);
1169 0 $self->write(command=>$head.$body);
1170 }
1171  
1172 0 ▶sub UserOut_ModeGet {
Subroutine UserOut_ModeGet: not called CC=1 SCAR=6.9
Pod undocumented
1173 0 my $self = shift;
1174 0 my ($Output_index)= @_;
1175 0 my $command_name= "userout.modeget";
1176 0 my $bodysize = 4;
1177 0 my $head= $self->nt_header($command_name,$bodysize,1);
1178 0 my $body=nt_int($Output_index);
1179 0 $self->write(command=>$head.$body);
1180 0 my $return = $self->tramea_read();
1181 0 my $Output_mode= substr $return,40,2;
1182 0 $Output_mode= unpack("n",$Output_mode);
1183 0 return($Output_mode);
1184 }
1185  
1186 0 ▶sub UserOut_MonitorChSet {
Subroutine UserOut_MonitorChSet: not called CC=1 SCAR=6.9
Pod undocumented
1187 0 my $self = shift;
1188 0 my ($Output_index,$Monitor_channel_index)= @_;
1189 0 my $command_name= "userout.monitorchset";
1190 0 my $bodysize = 8;
1191 0 my $head= $self->nt_header($command_name,$bodysize,0);
1192 0 my $body=nt_int($Output_index);
1193 0 $body=$body.nt_int($Monitor_channel_index);
1194 0 $self->write(command=>$head.$body);
1195 }
1196  
1197  
1198 0 ▶sub UserOut_MonitorChGet {
Subroutine UserOut_MonitorChGet: not called CC=1 SCAR=6.9
Pod undocumented
1199 0 my $self = shift;
1200 0 my ($Output_index)= @_;
1201 0 my $command_name= "userout.monitorchget";
1202 0 my $bodysize = 4;
1203 0 my $head= $self->nt_header($command_name,$bodysize,1);
1204 0 my $body=nt_int($Output_index);
1205 0 $self->write(command=>$head.$body);
1206 0 my $return = $self->tramea_read();
1207 0 my $Monitor_channel_index= substr $return,40,4;
1208 0 $Monitor_channel_index= unpack("N!",$Monitor_channel_index);
1209 0 return($Monitor_channel_index);
1210 }
1211  
1212 0 ▶sub UserOut_ValSet {
Subroutine UserOut_ValSet: not called CC=1 SCAR=6.9
Pod undocumented
1213 0 my $self = shift;
1214 0 my ($Output_index,$Output_value)= @_;
1215 0 my $command_name= "userout.valset";
1216 0 my $bodysize = 8;
1217 0 my $head= $self->nt_header($command_name,$bodysize,0);
1218 0 my $body=nt_int($Output_index);
1219 0 $body=$body.nt_float32($Output_value);
1220 0 $self->write(command=>$head.$body);
1221 }
1222  
1223 0 ▶sub UserOut_CalibrSet {
Subroutine UserOut_CalibrSet: not called CC=1 SCAR=6.9
Pod undocumented
1224 0 my $self = shift;
1225 0 my ($Output_index,$Calibration_per_volt,$Offset_in_physical_units)= @_;
1226 0 my $command_name= "userout.calibrset";
1227 0 my $bodysize = 12;
1228 0 my $head= $self->nt_header($command_name,$bodysize,0);
1229 0 my $body=nt_int($Output_index);
1230 0 $body=$body.nt_float32($Calibration_per_volt);
1231 0 $body=$body.nt_float32($Offset_in_physical_units);
1232 0 $self->write(command=>$head.$body);
1233 }
1234  
1235  
1236 0 ▶sub UserOut_CalcSignalNameSet {
Subroutine UserOut_CalcSignalNameSet: not called CC=1 SCAR=6.9
Pod undocumented
1237 0 my $self = shift;
1238 0 my $output_index = shift;
1239 0 my $string = shift;
1240 0 my $command_name = "userout.calcsignalnameset";
1241 0 my $bodysize= 8 + length($string);
1242 0 my $head = $self->nt_header($command_name,$bodysize,1);
1243 0 my $body = nt_int($output_index).nt_int(length($string)).$string;
1244  
1245 0 $self->write(command=>$head.$body);
1246 }
1247  
1248 0 ▶sub UserOut_CalcSignalNameGet {
Subroutine UserOut_CalcSignalNameGet: not called CC=1 SCAR=6.9
Pod undocumented
1249  
1250 0 my $self = shift;
1251 0 my $output_index = shift;
1252 0 my $command_name = "userout.calcsignalnameget";
1253  
1254 0 $self->write(command=>$self->nt_header($command_name,4,1).nt_int($output_index));
1255  
1256 0 my $return = $self->tramea_read();
1257 0 my $strLen = unpack("N!",substr($return,40,4));
1258 0 return substr $return,44,$strLen;
1259  
1260 }
1261  
1262 0 ▶sub UserOut_CalcSignalConfigSet {
Subroutine UserOut_CalcSignalConfigSet: not called CC=1 SCAR=6.9
Pod undocumented
1263 0 my $self = shift;
1264 0 my ($Output_index,$Operation_1,$Value_1,$Operation_2,$Value_2,$Operation_3,$Value_3,$Operation_4,$Value_4)= @_;
1265 0 my $command_name= "userout.calcsignalconfigset";
1266 0 my $bodysize = 28;
1267 0 my $head= $self->nt_header($command_name,$bodysize,0);
1268 0 my $body=nt_int($Output_index);
1269 0 $body=$body.nt_uint16($Operation_1);
1270 0 $body=$body.nt_float32($Value_1);
1271 0 $body=$body.nt_uint16($Operation_2);
1272 0 $body=$body.nt_float32($Value_2);
1273 0 $body=$body.nt_uint16($Operation_3);
1274 0 $body=$body.nt_float32($Value_3);
1275 0 $body=$body.nt_uint16($Operation_4);
1276 0 $body=$body.nt_float32($Value_4);
1277 0 $self->write(command=>$head.$body);
1278 }
1279  
1280 0 ▶sub UserOut_CalcSignalConfigGet {
Subroutine UserOut_CalcSignalConfigGet: not called CC=1 SCAR=6.9
Pod undocumented
1281 0 my $self = shift;
1282 0 my ($Output_index)= @_;
1283 0 my $command_name= "userout.calcsignalconfigget";
1284 0 my $bodysize = 4;
1285 0 my $head= $self->nt_header($command_name,$bodysize,1);
1286 0 my $body=nt_int($Output_index);
1287 0 $self->write(command=>$head.$body);
1288 0 my $return = $self->tramea_read();
1289 0 my $Operation_1= substr $return,40,2;
1290 0 $Operation_1= unpack("n",$Operation_1);
1291 0 my $Value_1= substr $return,42,4;
1292 0 $Value_1= unpack("f>",$Value_1);
1293 0 my $Operation_2= substr $return,46,2;
1294 0 $Operation_2= unpack("n",$Operation_2);
1295 0 my $Value_2= substr $return,48,4;
1296 0 $Value_2= unpack("f>",$Value_2);
1297 0 my $Operation_3= substr $return,52,2;
1298 0 $Operation_3= unpack("n",$Operation_3);
1299 0 my $Value_3= substr $return,54,4;
1300 0 $Value_3= unpack("f>",$Value_3);
1301 0 my $Operation_4= substr $return,58,2;
1302 0 $Operation_4= unpack("n",$Operation_4);
1303 0 my $Value_4= substr $return,60,4;
1304 0 $Value_4= unpack("f>",$Value_4);
1305 0 return($Operation_1,$Value_1,$Operation_2,$Value_2,$Operation_3,$Value_3,$Operation_4,$Value_4);
1306 }
1307  
1308 0 ▶sub UserOut_LimitsSet {
Subroutine UserOut_LimitsSet: not called CC=1 SCAR=6.9
Pod undocumented
1309 0 my $self = shift;
1310 0 my ($Output_index,$Upper_limit,$Lower_limit)= @_;
1311 0 my $command_name= "userout.limitsset";
1312 0 my $bodysize = 12;
1313 0 my $head= $self->nt_header($command_name,$bodysize,0);
1314 0 my $body=nt_int($Output_index);
1315 0 $body=$body.nt_float32($Upper_limit);
1316 0 $body=$body.nt_float32($Lower_limit);
1317 0 $self->write(command=>$head.$body);
1318 }
1319 0 ▶sub UserOut_LimitsGet {
Subroutine UserOut_LimitsGet: not called CC=1 SCAR=6.9
Pod undocumented
1320 0 my $self = shift;
1321 0 my ($Output_index)= @_;
1322 0 my $command_name= "userout.limitsget";
1323 0 my $bodysize = 4;
1324 0 my $head= $self->nt_header($command_name,$bodysize,1);
1325 0 my $body=nt_int($Output_index);
1326 0 $self->write(command=>$head.$body);
1327 0 my $return = $self->tramea_read();
1328 0 my $Upper_limit= substr $return,40,4;
1329 0 $Upper_limit= unpack("f>",$Upper_limit);
1330 0 my $Lower_limit= substr $return,44,4;
1331 0 $Lower_limit= unpack("f>",$Lower_limit);
1332 0 return($Upper_limit,$Lower_limit);
1333 }
1334 0 ▶sub UserOut_SlewRateSet {
Subroutine UserOut_SlewRateSet: not called CC=1 SCAR=6.9
Pod undocumented
1335 0 my $self = shift;
1336 0 my ($Output_index,$Slew_Rate)= @_;
1337 0 my $command_name= "userout.slewrateset";
1338 0 my $bodysize = 12;
1339 0 my $head= $self->nt_header($command_name,$bodysize,0);
1340 0 my $body=nt_int($Output_index);
1341 0 $body=$body.nt_float64($Slew_Rate);
1342 0 $self->write(command=>$head.$body);
1343 }
1344  
1345 0 ▶sub UserOut_SlewRateGet {
Subroutine UserOut_SlewRateGet: not called CC=1 SCAR=6.9
Pod undocumented
1346 0 my $self = shift;
1347 0 my ($Output_index)= @_;
1348 0 my $command_name= "userout.slewrateget";
1349 0 my $bodysize = 4;
1350 0 my $head= $self->nt_header($command_name,$bodysize,1);
1351 0 my $body=nt_int($Output_index);
1352 0 $self->write(command=>$head.$body);
1353 0 my $return = $self->tramea_read();
1354 0 my $Slew_Rate= substr $return,40,8;
1355 0 $Slew_Rate= unpack("d>",$Slew_Rate);
1356 0 return($Slew_Rate);
1357 }
1358  
1359  
1360 0 ▶sub DigLines_PropsSet {
Subroutine DigLines_PropsSet: not called CC=1 SCAR=6.9
Pod undocumented
1361 0 my $self = shift;
1362 0 my ($Digital_line,$Port,$Direction,$Polarity)= @_;
1363 0 my $command_name= "diglines.propsset";
1364 0 my $bodysize = 16;
1365 0 my $head= $self->nt_header($command_name,$bodysize,0);
1366 0 my $body=nt_uint32($Digital_line);
1367 0 $body=$body.nt_uint32($Port);
1368 0 $body=$body.nt_uint32($Direction);
1369 0 $body=$body.nt_uint32($Polarity);
1370 0 $self->write(command=>$head.$body);
1371 }
1372  
1373 0 ▶sub DigLines_OutStatusSet {
Subroutine DigLines_OutStatusSet: not called CC=1 SCAR=6.9
Pod undocumented
1374 0 my $self = shift;
1375 0 my ($Port,$Digital_line,$Status)= @_;
1376 0 my $command_name= "diglines.outstatusset";
1377 0 my $bodysize = 12;
1378 0 my $head= $self->nt_header($command_name,$bodysize,0);
1379 0 my $body=nt_uint32($Port);
1380 0 $body=$body.nt_uint32($Digital_line);
1381 0 $body=$body.nt_uint32($Status);
1382 0 $self->write(command=>$head.$body);
1383 }
1384  
1385 0 ▶sub DigLines_TTLValGet {
Subroutine DigLines_TTLValGet: not called CC=1 SCAR=6.9
Pod undocumented
1386
1387 0 my $self = shift;
1388 0 my $port = shift;
1389 0 my $command_name = "diglines.ttlvalget";
1390 0 my $head = $self->nt_header($command_name,4,1);
1391  
1392 0 $self->write(command=>$head.nt_uint16($port));
1393  
1394 0 my $return = $self->tramea_read();
1395  
1396 0 my $intArraySize = unpack("N!",substr($return,40,4));
1397 0 my @intArray = $self->intArrayUnpacker($intArraySize,substr($return,44,$intArraySize*4));
1398 0 return @intArray;
1399 }
1400  
1401 0 ▶sub DigLines_Pulse {
Subroutine DigLines_Pulse: not called CC=2 SCAR=17.9
Pod undocumented
1402 #Changing different order of args here, we pass the lines array as last argument
1403 0 my $self = shift;
1404 0 my $port = shift;
1405 0 my $Pulse_width = shift;
1406 0 my $Pulse_pause = shift;
1407 0 my $Pulse_number = shift;
1408 0 my $Wait_param = shift;
1409 0 my @lines = @_;
1410 0 my $command_name = "diglines.pulse";
1411 0 my $head = $self->nt_header($command_name,22 + scalar(@lines),0);
1412 0 my $body = nt_uint16($port).nt_int(scalar(@lines));
1413 0 foreach(@lines){
1414 0 $body = $body.pack("c",$_);
1415 }
1416 0 $body = $body.nt_float32($Pulse_width).nt_float32($Pulse_pause);
1417 0 $body = $body.nt_int($Pulse_number).nt_uint32($Wait_param);
1418 0 $self->write(command=>$head.$body);
1419 }
1420  
1421  
1422 0 ▶sub Util_SessionPathGet {
Subroutine Util_SessionPathGet: not called CC=1 SCAR=6.9
Pod undocumented
1423 0 my $self = shift;
1424 0 my $command_name ="util.sessionpathget";
1425 0 my $head = $self->nt_header($command_name,0,1);
1426 0 $self->write(command=>$head);
1427  
1428 0 my $response = $self->tramea_read();
1429 0 return substr $response,44,unpack("N!",substr $response,40,4);
1430 }
1431  
1432 0 ▶sub Util_SessionPathSet {
Subroutine Util_SessionPathSet: not called CC=1 SCAR=6.9
Pod undocumented
1433 0 my $self = shift ;
1434 0 my $command_name ="util.sessionpathset" ;
1435 0 my $session_path = shift;
1436 0 my $save_settings = shift;
1437 0 my $bodysize = 8 + length($session_path);
1438 0 my $head = $self->nt_header($command_name,$bodysize,1) ;
1439 0 $self->write(command=>$head.nt_int(length($session_path)).$session_path.nt_uint32($save_settings));
1440 0 $self->_end_of_com();
1441 }
1442  
1443 0 ▶sub Util_SettingsLoad {
Subroutine Util_SettingsLoad: not called CC=2 SCAR=17.9
Pod undocumented
1444 #Not sure if working
1445 0 my $self = shift;
1446 0 my ($path,$Automatic_Load) = @_;
1447 0 my $command_name = "util.settingsload";
1448 0 ▶ if($Automatic_Load> 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($Automatic_Load > 0) { } 0 0 0
1449 0 $Automatic_Load = 1;
1450 }
1451 else{
1452 0 $Automatic_Load = 0;
1453 }
1454 0 my $bodysize = 8 + 4*length($path);
1455 0 my $head = $self->nt_header($command_name,$bodysize,0);
1456 0 my $body = pack("N!",length($path)).$path.pack("N",$Automatic_Load);
1457 0 $self->write( command => $head.$body);
1458 }
1459  
1460 0 ▶sub Util_SettingsSave {
Subroutine Util_SettingsSave: not called CC=2 SCAR=17.9
Pod undocumented
1461 #Not sure if working
1462 0 my $self = shift;
1463 0 my ($path,$Automatic_save) = @_;
1464 0 my $command_name = "util.settingssave";
1465  
1466 0 ▶ if($Automatic_save> 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($Automatic_save > 0) { } 0 0 0
1467 0 $Automatic_save= 1;
1468 }
1469 else{
1470 0 $Automatic_save = 0;
1471 }
1472  
1473 0 my $bodysize = 8 + 4*length($path);
1474 0 my $head = $self->nt_header($command_name,$bodysize,1);
1475 0 my $body = pack("N!",length($path)).$path.pack("N",$Automatic_save);
1476 0 $self->write( command => $head.$body);
1477 0 $self->_end_of_com();
1478 }
1479  
1480 0 ▶sub Util_LayoutLoad {
Subroutine Util_LayoutLoad: not called CC=2 SCAR=17.9
Pod undocumented
1481 #Not sure if working
1482 0 my $self = shift;
1483 0 my ($path,$Automatic_Load) = @_;
1484 0 my $command_name = "util.layoutload";
1485 0 ▶ if($Automatic_Load> 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($Automatic_Load > 0) { } 0 0 0
1486 0 $Automatic_Load= 1;
1487 }
1488 else{
1489 0 $Automatic_Load = 0;
1490 }
1491 0 my $bodysize = 8 + 4*length($path);
1492 0 my $head = $self->nt_header($command_name,$bodysize,0);
1493 0 my $body = pack("N!",length($path)).$path.pack("N",$Automatic_Load);
1494 0 $self->write( command => $head.$body);
1495 }
1496  
1497 0 ▶sub Util_LayoutSave {
Subroutine Util_LayoutSave: not called CC=2 SCAR=17.9
Pod undocumented
1498 #Not sure if working
1499 0 my $self = shift;
1500 0 my ($path,$Automatic_save) = @_;
1501 0 my $command_name = "util.layoutsave";
1502 0 ▶ if($Automatic_save> 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($Automatic_save > 0) { } 0 0 0
1503 0 $Automatic_save= 1;
1504 }
1505 else{
1506 0 $Automatic_save = 0;
1507 }
1508 0 my $bodysize = 8 + 4*length($path);
1509 0 my $head = $self->nt_header($command_name,$bodysize,1);
1510 0 my $body = pack("N!",length($path)).$path.pack("N",$Automatic_save);
1511 0 $self->write( command => $head.$body);
1512 0 $self->_end_of_com()
1513 }
1514  
1515 0 ▶sub Util_Lock {
Subroutine Util_Lock: not called CC=1 SCAR=6.9
Pod undocumented
1516 0 my $self = shift;
1517 0 my $command_name= "util.lock";
1518 0 my $bodysize = 0;
1519 0 my $head= $self->nt_header($command_name,$bodysize,0);
1520 0 $self->write(command=>$head);
1521 }
1522  
1523 0 ▶sub Util_UnLock {
Subroutine Util_UnLock: not called CC=1 SCAR=6.9
Pod undocumented
1524 0 my $self = shift;
1525 0 my $command_name= "util.unlock";
1526 0 my $bodysize = 0;
1527 0 my $head= $self->nt_header($command_name,$bodysize,0);
1528 0 $self->write(command=>$head);
1529 }
1530  
1531 0 ▶sub Util_RTFreqSet {
Subroutine Util_RTFreqSet: not called CC=1 SCAR=6.9
Pod undocumented
1532 0 my $self = shift;
1533 0 my ($RT_frequency)= @_;
1534 0 my $command_name= "util.rtfreqset";
1535 0 my $bodysize = 4;
1536 0 my $head= $self->nt_header($command_name,$bodysize,0);
1537 0 my $body=nt_float32($RT_frequency);
1538 0 $self->write(command=>$head.$body);
1539 }
1540  
1541 0 ▶sub Util_RTFreqGet {
Subroutine Util_RTFreqGet: not called CC=1 SCAR=6.9
Pod undocumented
1542 0 my $self = shift;
1543 0 my $command_name= "util.rtfreqget";
1544 0 my $bodysize = 0;
1545 0 my $head= $self->nt_header($command_name,$bodysize,1);
1546 0 $self->write(command=>$head);
1547 0 my $return = $self->tramea_read();
1548 0 my $RT_frequency= substr $return,40,4;
1549 0 $RT_frequency= unpack("f>",$RT_frequency);
1550 0 return($RT_frequency);
1551 }
1552  
1553 0 ▶sub Util_AcqPeriodSet {
Subroutine Util_AcqPeriodSet: not called CC=1 SCAR=6.9
Pod undocumented
1554 0 my $self = shift;
1555 0 my ($Acquisition_Period_s)= @_;
1556 0 my $command_name= "util.acqperiodset";
1557 0 my $bodysize = 4;
1558 0 my $head= $self->nt_header($command_name,$bodysize,0);
1559 0 my $body=nt_float32($Acquisition_Period_s);
1560 0 $self->write(command=>$head.$body);
1561 }
1562  
1563 0 ▶sub Util_AcqPeriodGet {
Subroutine Util_AcqPeriodGet: not called CC=1 SCAR=6.9
Pod undocumented
1564 0 my $self = shift;
1565 0 my $command_name= "util.acqperiodget";
1566 0 my $bodysize = 0;
1567 0 my $head= $self->nt_header($command_name,$bodysize,1);
1568 0 $self->write(command=>$head);
1569 0 my $return = $self->tramea_read();
1570 0 my $Acquisition_Period_s= substr $return,40,4;
1571 0 $Acquisition_Period_s= unpack("f>",$Acquisition_Period_s);
1572 0 return($Acquisition_Period_s);
1573 }
1574  
1575 0 ▶sub Util_RTOversamplSet {
Subroutine Util_RTOversamplSet: not called CC=1 SCAR=6.9
Pod undocumented
1576 0 my $self = shift;
1577 0 my ($RT_oversampling)= @_;
1578 0 my $command_name= "util.rtoversamplset";
1579 0 my $bodysize = 4;
1580 0 my $head= $self->nt_header($command_name,$bodysize,0);
1581 0 my $body=nt_int($RT_oversampling);
1582 0 $self->write(command=>$head.$body);
1583 }
1584  
1585 0 ▶sub Util_RTOversamplGet {
Subroutine Util_RTOversamplGet: not called CC=1 SCAR=6.9
Pod undocumented
1586 0 my $self = shift;
1587 0 my $command_name= "util.rtoversamplget";
1588 0 my $bodysize = 0;
1589 0 my $head= $self->nt_header($command_name,$bodysize,1);
1590 0 $self->write(command=>$head);
1591 0 my $return = $self->tramea_read();
1592 0 my $RT_oversampling= substr $return,40,4;
1593 0 $RT_oversampling= unpack("N!",$RT_oversampling);
1594 0 return($RT_oversampling);
1595 }
1596 #Some modules are missing
1597  
1598 0 ▶sub File_datLoad {
Subroutine File_datLoad: not called CC=6 SCAR=37.4
Pod undocumented
1599 0 my $self = shift;
1600 0 my $file_path = shift;
1601 0 my $header_only = shift;
1602 0 my $command_name = "file.datload";
1603 0 my $bodysize = 8 + length($file_path);
1604 0 my $head = $self->nt_header($command_name,$bodysize,1);
1605 # MISSING: Do not try to read column names and data if you are not asking for it
1606 0 $self->write(command=>$head.nt_int(length($file_path)).$file_path.nt_int($header_only));
1607  
1608 0 my $result_head = $self->binary_read(read_length=>40);
1609 0 my $result_size = unpack("N!",substr $result_head,32,4);
1610  
1611 0 my $result = $self->binary_read(read_length=>$result_size);
1612 0 my $Channel_names_size = unpack('N!', substr $result,0,4);
1613 0 my $Name_number = unpack('N!', substr $result,4,4);
1614 0 my $raw_names = substr $result,8,$Channel_names_size;
1615 0 my %Channel_names = $self->strArrayUnpacker($Name_number,$raw_names);
1616  
1617 0 $result = substr($result,-1*(length($result)-8-$Channel_names_size));
1618  
1619 0 my $Data_rows = unpack("N!",substr($result,0,4));
1620 0 my $Data_cols = unpack ("N!",substr($result,4,8));
1621 0 my $Data_size = 4*$Data_cols*$Data_rows;
1622 0 my @float2Darray = $self->float32ArrayUnpacker($Data_cols*$Data_rows,substr($result,8,$Data_size));
1623  
1624 0 my @channel_names;
1625 0 my $pdl = zeros($Data_rows,$Data_cols);
1626 0 ▶ for(my $index = 0;$index <=max(keys %Channel_names);$index++){
Branch: 1 branch
BranchTrueFalseTotal
if ($index <= &max(keys %Channel_names)) 0 0 0
1627 0 push @channel_names,$Channel_names{$index};
1628 }
1629 0 my $row_num = 0 ;
1630 0 my $col_num = 0 ;
1631 0 ▶ for (my $index = 0; $index< scalar(@float2Darray);$index++){
Branch: 1 branch
BranchTrueFalseTotal
if ($index < scalar @float2Darray) 0 0 0
1632 0 $pdl->slice("$row_num,$col_num") .=$float2Darray[$index];
1633 0 $col_num+=1;
1634 0 ▶ if(($index+1)%$Data_cols == 0){
Branch: 1 branch
BranchTrueFalseTotal
if (($index + 1) % $Data_cols == 0) 0 0 0
1635 0 $row_num+=1;
1636 0 $col_num = 0 ;
1637 }
1638 }
1639  
1640  
1641 # Header Stuff
1642 #Return hash (?)
1643 0 my %head;
1644  
1645 0 $result = substr($result,-1*(length($result)-8-$Data_size));
1646 0 my $Header_rows = unpack("N!", substr $result,0,4);
1647 0 my $Header_col = unpack("N!", substr $result,4,4);
1648 0 my %strings = $self->strArrayUnpacker($Header_rows*$Header_col-1,substr $result,-1*(length($result)-8));
1649 0 my $value_buffer="";
1650 0 ▶ for(my $index = 0; $index <= max(keys %strings)-1;$index+=$Header_col)
Branch: 1 branch
BranchTrueFalseTotal
if ($index <= &max(keys %strings) - 1) 0 0 0
1651 {
1652 0 ▶ for(my $idx2 = 1; $idx2<$Header_col;$idx2++){
Branch: 1 branch
BranchTrueFalseTotal
if ($idx2 < $Header_col) 0 0 0
1653 0 $value_buffer = $value_buffer.$strings{$index+$idx2};
1654 }
1655 0 $head{$strings{$index}} = $value_buffer;
1656 0 $value_buffer ="";
1657 }
1658 0 return $pdl,\@channel_names,\%head,
1659 }
1660  
1661  
1662  
1663 1 has _Session_Path => (
1664 is => 'rw',
1665 isa => 'Str',
1666 lazy => 1,
1667 reader => 'Session_Path',
1668 writer => '_Session_Path',
1669 builder =>'_build_Session_Path'
1670 );
1671  
1672 0 ▶sub _build_Session_Path {
Subroutine _build_Session_Path: not called CC=1 SCAR=6.9
1673 0 my $self = shift ;
1674 0 return $self->Util_SessionPathGet();
1675 }
1676  
1677 1 has sweep_prop_configuration => (
1678 is=>'rw',
1679 isa => 'HashRef',
1680 reader => 'sweep_prop_configuration',
1681 writer => '_sweep_prop_configuration',
1682 builder => '_build_sweep_prop_configuration',
1683 );
1684  
1685 1 has sweep_timing_configuration =>(
1686 is=>'rw',
1687 isa => 'HashRef',
1688 reader => 'sweep_timing_configuration',
1689 writer => '_sweep_timing_configuration',
1690 builder => '_build_sweep_timing_configuration',
1691 clearer =>'reset_swp_timing',
1692 lazy => 1
1693  
1694 );
1695  
1696 0 ▶sub _build_sweep_timing_configuration {
Subroutine _build_sweep_timing_configuration: not called CC=1 SCAR=6.9
1697 0 my $self = shift ;
1698 0 my %hash;
1699 0 my @values = $self->threeDSwp_SwpChTimingGet();
1700 0 $hash{initial_settling_time} = $values[0];
1701 0 $hash{settling_time} = $values[1];
1702 0 $hash{integration_time} = $values[2];
1703 0 $hash{end_settling_time} = $values[3];
1704 0 $hash{Maximum_slew_rate} = $values[4];
1705 0 return \%hash;
1706 }
1707  
1708 0 ▶sub _build_sweep_prop_configuration {
Subroutine _build_sweep_prop_configuration: not called CC=1 SCAR=6.9
1709 0 my $self = shift;
1710 0 my %hash;
1711 0 $hash{point_number}=2;
1712 0 $hash{number_of_sweeps}=1;
1713 0 $hash{backwards}=-1;
1714 0 $hash{at_end}=-1;
1715 0 $hash{at_end_val}=0;
1716 0 $hash{save_all}=-1;
1717 0 return \%hash;
1718 }
1719  
1720 1 has signals => (
1721 is=>'ro',
1722 isa => 'HashRef',
1723 reader => "signals",
1724 lazy =>1,
1725 builder => '_signals_builder',
1726 );
1727  
1728 0 ▶sub _signals_builder {
Subroutine _signals_builder: not called CC=1 SCAR=6.9
1729 0 my $self = shift;
1730 0 my %hash = $self->Signals_InSlotsGet();
1731 0 return \%hash;
1732 }
1733  
1734 1 has outputs => (
1735 is => 'rw',
1736 isa => 'HashRef',
1737 reader =>'outputs',
1738 writer => '_outputs',
1739 builder => '_outputs_builder'
1740 );
1741  
1742 0 ▶sub _outputs_builder {
Subroutine _outputs_builder: not called CC=1 SCAR=6.9
1743 0 my $self = shift;
1744 0 my %hash;
1745 0 $hash{0}="Plunger Gate (V)";
1746 0 $hash{1}="Source-Drain (V)";
1747 0 $hash{2}="Left Gate (V)";
1748 0 $hash{3}="Right Gate (V)";
1749 0 $hash{4}="Output 5 (V)";
1750 0 $hash{5}="Output 6 (V)";
1751 0 $hash{6}="Output 7 (V)";
1752 0 $hash{7}="Output 8 (V)";
1753 0 return \%hash;
1754 }
1755  
1756 1 has step1_prop_configuration => (
1757 is=>'rw',
1758 isa => 'HashRef',
1759 reader => 'step1_prop_configuration',
1760 writer => '_step1_prop_configuration',
1761 builder => '_build_step1_prop_configuration',
1762 );
1763  
1764 0 ▶sub _build_step1_prop_configuration {
Subroutine _build_step1_prop_configuration: not called CC=1 SCAR=6.9
1765 0 my $self = shift;
1766 0 my %hash;
1767 0 $hash{point_number}=0;
1768 0 $hash{backwards}=-1;
1769 0 $hash{at_end}=-1;
1770 0 $hash{at_end_val}=0;
1771 0 return \%hash;
1772 }
1773  
1774 1 has step1_timing_configuration =>(
1775 is=>'rw',
1776 isa => 'HashRef',
1777 reader => 'step1_timing_configuration',
1778 writer => '_step1_timing_configuration',
1779 builder => '_build_step1_timing_configuration',
1780 clearer =>'reset_stp1_timing',
1781 lazy => 1
1782  
1783 );
1784  
1785 0 ▶sub _build_step1_timing_configuration {
Subroutine _build_step1_timing_configuration: not called CC=1 SCAR=6.9
1786 0 my $self = shift ;
1787 0 my %hash;
1788 0 my @values = $self->threeDSwp_StpCh1TimingGet;
1789 0 $hash{initial_settling_time} = $values[0];
1790 0 $hash{end_settling_time} = $values[1];
1791 0 $hash{Maximum_slew_rate} = $values[2];
1792 0 return \%hash;
1793 }
1794  
1795  
1796 1 has step2_prop_configuration => (
1797 is=>'rw',
1798 isa => 'HashRef',
1799 reader => 'step2_prop_configuration',
1800 writer => '_step2_prop_configuration',
1801 builder => '_build_step2_prop_configuration',
1802 );
1803  
1804 0 ▶sub _build_step2_prop_configuration {
Subroutine _build_step2_prop_configuration: not called CC=1 SCAR=6.9
1805 0 my $self = shift;
1806 0 my %hash;
1807 0 $hash{point_number}=0;
1808 0 $hash{backwards}=-1;
1809 0 $hash{at_end}=-1;
1810 0 $hash{at_end_val}=0;
1811 0 return \%hash;
1812 }
1813  
1814 1 has step2_timing_configuration =>(
1815 is=>'rw',
1816 isa => 'HashRef',
1817 reader => 'step2_timing_configuration',
1818 writer => '_step2_timing_configuration',
1819 builder => '_build_step2_timing_configuration',
1820 clearer =>'reset_stp2_timing',
1821 lazy => 1
1822  
1823 );
1824  
1825 0 ▶sub _build_step2_timing_configuration {
Subroutine _build_step2_timing_configuration: not called CC=1 SCAR=6.9
1826 0 my $self = shift ;
1827 0 my %hash;
1828 0 my @values = $self->threeDSwp_StpCh2TimingGet;
1829 0 $hash{initial_settling_time} = $values[0];
1830 0 $hash{end_settling_time} = $values[1];
1831 0 $hash{Maximum_slew_rate} = $values[2];
1832 0 return \%hash;
1833 }
1834  
1835  
1836 1 has sweep_save_configuration => (
1837 is=>'rw',
1838 isa => 'HashRef',
1839 reader => 'sweep_save_configuration',
1840 writer => '_sweep_save_configuration',
1841 builder => '_build_sweep_save_configuration',
1842 );
1843  
1844 0 ▶sub _build_sweep_save_configuration {
Subroutine _build_sweep_save_configuration: not called CC=1 SCAR=6.9
1845 0 my $self = shift;
1846 0 my %hash;
1847 0 $hash{series_name}="";
1848 0 $hash{create_datetime}=-1;
1849 0 $hash{comment}="";
1850 0 return \%hash;
1851 }
1852  
1853  
1854 0 ▶sub set_Session_Path {
Subroutine set_Session_Path: not called CC=3 SCAR=24.8
Pod undocumented
1855 0 my($self,%params) = validated_hash(
1856 \@_,
1857 session_path => {isa => 'Str'},
1858 save_settings => {isa => 'Int',optional => 1}
1859 );
1860
1861 0 ▶ if($params{session_path} =~ /^([a-zA-Z]:)(([\\]?[\w _!#()-]+)*[\\])?$/)
Branch: 1 branch
BranchTrueFalseTotal
if ($params{'session_path'} =~ /^([a-zA-Z]:)(([\\]?[\w _!#()-]+)*[\\])?$/u) { } 0 0 0
1862 {
1863 0 ▶ if(exists($params{save_settings}))
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{'save_settings'}) { } 0 0 0
1864 {
1865 0 $self->Util_SessionPathSet($params{session_path},$params{save_settings});
1866 }
1867 else
1868 {
1869 0 $self->Util_SessionPathSet($params{session_path},0);
1870 }
1871 0 $self->_Session_Path($params{session_path});
1872 }
1873 else
1874 {
1875 0 die "Invalid path in set_Session_Path: Path is not Windows Directory Path";
1876 }
1877 }
1878  
1879  
1880 0 ▶sub load_data {
Subroutine load_data: not called CC=4 SCAR=30.0
Pod undocumented
1881 0 my($self,%params) = validated_hash(
1882 \@_,
1883 file_origin => {isa=>"Str"},
1884 return_pdl => {isa=>"Bool", default => 1},
1885 return_head => {isa=>"Bool", default => 0},
1886 return_colnames => {isa=>"Bool", default => 1},
1887 );
1888 0 my %to_return;
1889 0 my ($pdl,$cols_ref,$head) = $self->File_datLoad($params{file_origin},0);
1890  
1891 0 ▶ if($params{return_pdl}==1)
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"return_pdl"} == 1) 0 0 0
1892 {
1893 0 $to_return{pdl}= $pdl;
1894 }
1895 0 ▶ if ($params{return_head} == 1)
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"return_head"} == 1) 0 0 0
1896 {
1897 0 $to_return{header}=$head;
1898 }
1899 0 ▶ if ($params{return_colnames} == 1)
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"return_colnames"} == 1) 0 0 0
1900 {
1901 0 $to_return{cols}=$cols_ref;
1902 }
1903 0 return \%to_return;
1904 }
1905  
1906 # Function prototype to add sweep functionalities
1907  
1908 0 ▶sub load_pdl {
Subroutine load_pdl: not called CC=11 SCAR=48.8
Pod undocumented
1909 0 my($self,%params) = validated_hash(
1910 \@_,
1911 file_origin => {isa=> "Str"},
1912 );
1913 my $data_hash = $self->load_data(
1914 file_origin=>$params{file_origin},
1915 0 return_colnames=>1,
1916 return_head=>1);
1917  
1918 0 my $pdl = $data_hash->{pdl};
1919 0 my @colnames = @{$data_hash->{cols}};
1920 0 my %head = %{$data_hash->{header}};
1921 # Attempt to detect if it is 2D Sweep by cheking for caratteristic
1922 # string that tels the point number
1923 0 ▶ if($colnames[-1]=~ m/\[(?<idx_int>[0-9]{5})\]/)
Branch: 1 branch
BranchTrueFalseTotal
if ($colnames[-1] =~ /\[(?<idx_int>[0-9]{5})\]/u) { } 0 0 0
1924 {
1925 # print("Detected 2D SWP\n");
1926 # Extractiong point number, +0 casts to number
1927 0 my $stp1_point_number = $+{idx_int} +0;
1928 # print("Detected point number: $stp1_point_number\n");
1929 # Now Detect total Acq_Channel number
1930 0 my $acq_number = (scalar(@colnames)-1)/$stp1_point_number;
1931 # print("Detected Number of acq_number: $acq_number \n");
1932 # Now lets try and get the extremes of the stp1 channel from header
1933 0 my $stp1_start;
1934 my $stp1_stop;
1935 0 my $using_stp2 =0;
1936 0 my $stp2_level;
1937 0 foreach(keys %head)
1938 {
1939 0 ▶ if($_=~ m/(?:Step\schannel\s1:\sStart)/)
Branch: 2 branches
BranchTrueFalseTotal
if ($_ =~ /(?:Step\schannel\s1:\sStart)/u) { } 0 0 0
elsif ($_ =~ /(?:Step\schannel\s2\s[\w():\s]*\sStart)/u) { } 0 0 0
1940 {
1941 0 $stp1_start = $head{$_} +0;
1942 }
1943 elsif($_=~m/(?:Step\schannel\s2\s[\w():\s]*\sStart)/)
1944 {
1945 0 $stp1_start = $head{$_} +0;
1946 }
1947 0 ▶ if($_=~ m/(?:Step\schannel\s1:\sStop)/)
Branch: 2 branches
BranchTrueFalseTotal
if ($_ =~ /(?:Step\schannel\s1:\sStop)/u) { } 0 0 0
elsif ($_ =~ /(?:Step\schannel\s2\s[\w():\s]*\sStop)/u) { } 0 0 0
1948 {
1949 0 $stp1_stop = $head{$_} +0;
1950 }
1951 elsif($_=~m/(?:Step\schannel\s2\s[\w():\s]*\sStop)/)
1952 {
1953 0 $stp1_stop = $head{$_} +0;
1954 }
1955  
1956 0 ▶ if($_=~m/(?:Step\schannel\s2\s[\w():\s]*\sLevel)/)
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /(?:Step\schannel\s2\s[\w():\s]*\sLevel)/u) 0 0 0
1957 {
1958 0 $using_stp2 = 1;
1959 0 $stp2_level = $head{$_}+0;
1960 }
1961 }
1962 # lets format the pdl,2D
1963 0 my @dims = $pdl->dims;
1964 0 my $swp_point_number = $dims[0];
1965 0 my $stp1_values = zeroes($stp1_point_number)->xlinvals($stp1_start,$stp1_stop);
1966 0 my $formatted_pdl = zeroes($stp1_point_number,$dims[0],$acq_number+2);
1967 0 my @newDims = $formatted_pdl->dims;
1968 0 my $col_start;
1969 my $col_end;
1970 0 my $col_end2;
1971 0 ▶ for( my $index = 0; $index < $stp1_point_number ;$index++)
Branch: 1 branch
BranchTrueFalseTotal
if ($index < $stp1_point_number) 0 0 0
1972 {
1973 0 $col_start= $acq_number*$index + 1;
1974 0 $col_end= $acq_number*$index + $acq_number;
1975 0 $col_end2 = $acq_number+1;
1976 0 $stp1_values->at($index);
1977 0 $formatted_pdl->slice("($index),:,(0)")+= $stp1_values->at($index);
1978 0 $formatted_pdl->slice("($index),:,(1)")+= $pdl->slice(":,(0)");
1979 0 $formatted_pdl->slice("($index),:,2:$col_end2") += $pdl->slice(":,$col_start:$col_end");
1980 }
1981 # Now lets check if the sweep was using stpch2
1982 0 ▶ if($using_stp2)
Branch: 1 branch
BranchTrueFalseTotal
if ($using_stp2) { } 0 0 0
1983 {
1984 0 my $inflated_pdl = zeroes($stp1_point_number,$dims[0],$acq_number+3);
1985 0 ▶ for( my $index = 0; $index < $stp1_point_number ;$index++)
Branch: 1 branch
BranchTrueFalseTotal
if ($index < $stp1_point_number) 0 0 0
1986 {
1987 0 $inflated_pdl->slice("($index),:,(0)")+=$stp2_level;
1988 0 $inflated_pdl->slice("($index),:,1:-1")+= $formatted_pdl->slice("($index),:,:");
1989 }
1990 0 return $inflated_pdl;
1991 }
1992 else
1993 {
1994 0 return $formatted_pdl;
1995 }
1996 }
1997 else
1998 {
1999 0 return $pdl;
2000 }
2001 }
2002  
2003  
2004 # Multidimensional load prototype
2005  
2006 0 ▶sub load_last_measurement {
Subroutine load_last_measurement: not called CC=3 SCAR=24.8
Pod undocumented
2007 0 my($self) = validated_hash(\@_);
2008 0 my %files = $self->threeDSwp_FilePathsGet();
2009 0 my $stp2_point_number = scalar(keys %files);
2010 0 ▶ if($stp2_point_number>1)
Branch: 1 branch
BranchTrueFalseTotal
if ($stp2_point_number > 1) { } 0 0 0
2011 {
2012 0 my $pdl3d = $self->load_pdl(file_origin=>$files{0});
2013 0 my @dims = $pdl3d->dims;
2014 0 my $inflated_pdl = zeroes($stp2_point_number,$dims[0],$dims[1],$dims[2]);
2015 0 $inflated_pdl->slice("(0),:,:,:") += $pdl3d;
2016 0 ▶ for(my $idx = 1; $idx<$stp2_point_number; $idx++)
Branch: 1 branch
BranchTrueFalseTotal
if ($idx < $stp2_point_number) 0 0 0
2017 {
2018 0 $pdl3d = $self->load_pdl(file_origin=>$files{$idx});
2019 0 $inflated_pdl->slice("($idx),:,:,:") += $pdl3d;
2020 }
2021 0 return $inflated_pdl;
2022
2023 }
2024 else
2025 {
2026 0 return $self->load_pdl(file_origin=>$files{0});
2027 }
2028 }
2029  
2030 #Lab::Moose::DataFile
2031 # Probably to be deprecated
2032 0 ▶sub tramea_log_block {
Subroutine tramea_log_block: not called CC=8 SCAR=42.8
Pod undocumented
2033 0 my ($self,$datafile,$prefix, $pdl, $add_newline, $refresh_plots)= validated_list(\@_,
2034 datafile => {isa=>"Lab::Moose::Sweep | Lab::Moose::DataFile"},
2035 prefix => { isa => 'HashRef[Num]', optional => 1 },
2036 pdl => {isa =>"PDL"},
2037 add_newline => { isa => 'Bool', default => 0 },
2038 refresh_plots => { isa => 'Bool', default => 0 },
2039 );
2040
2041 # Build args
2042 0 my %args;
2043 0 ▶ if($prefix)
Branch: 1 branch
BranchTrueFalseTotal
if ($prefix) 0 0 0
2044 {
2045 0 $args{prefix}= $prefix;
2046 }
2047 0 $args{add_newline}=$add_newline;
2048 0 $args{refresh_plots}=$refresh_plots;
2049  
2050 0 my @dims = $pdl->dims;
2051  
2052 0 ▶ if (scalar @dims == 4)
Branch: 3 branches
BranchTrueFalseTotal
if (scalar @dims == 4) { } 0 0 0
elsif (scalar @dims == 3) { } 0 0 0
elsif (scalar @dims == 2) { } 0 0 0
2053 {
2054 0 ▶ for(my $iter = 0; $iter <$dims[0]; $iter++)
Branch: 1 branch
BranchTrueFalseTotal
if ($iter < $dims[0]) 0 0 0
2055 {
2056 0 ▶ for(my $iter1 = 0; $iter1 <$dims[1]; $iter1++)
Branch: 1 branch
BranchTrueFalseTotal
if ($iter1 < $dims[1]) 0 0 0
2057 {
2058 0 $datafile->log_block(block=>$pdl->slice("($iter),($iter1),:,:"),%args);
2059 }
2060 }
2061 }
2062 elsif (scalar @dims == 3)
2063 {
2064 0 ▶ for(my $iter1 = 0; $iter1 <$dims[0]; $iter1++)
Branch: 1 branch
BranchTrueFalseTotal
if ($iter1 < $dims[0]) 0 0 0
2065 {
2066 0 $datafile->log_block(block=>$pdl->slice("($iter1),:,:"),%args);
2067 }
2068 }
2069 elsif (scalar @dims == 2)
2070 {
2071 0 $datafile->log_block(block=>$pdl,%args);
2072 }
2073 else
2074 {
2075 0 croak "Number of dimension is wrong:".scalar(@dims);
2076 }
2077 }
2078 0 ▶sub parse_last_measurement {
Subroutine parse_last_measurement: not called CC=2 SCAR=17.9
Pod undocumented
2079 0 my ($self,%params) = validated_hash(\@_,
2080 folder=>{isa=>'Lab::Moose::DataFolder'});
2081 0 my %files = $self->threeDSwp_FilePathsGet();
2082 0 foreach(keys %files){
2083 0 my ($filename) = $files{$_} =~ m/([ \w-]+\.dat)/g;
2084 0 my $data_hash = $self->load_data(file_origin => $files{$_},return_head=>1,return_colnames=>1);
2085 0 my $new_datafile = datafile(filename => $filename,folder=>$params{folder},columns=>$data_hash->{cols});
2086 0 $new_datafile->log_block(block=>$data_hash->{pdl});
2087 }
2088 }
2089  
2090 0 ▶sub sweep_save_configure {
Subroutine sweep_save_configure: not called CC=7 SCAR=40.3
Pod undocumented
2091 0 my ($self, %params) = validated_hash(
2092 \@_,
2093 series_name=>{isa=>"Str",optional =>1},
2094 create_datetime =>{isa =>"Int",optional =>1},
2095 comment =>{isa=>"Str",optional =>1}
2096 );
2097 0 ▶ if(!exists($params{series_name})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"series_name"}) 0 0 0
2098 0 $params{series_name}=$self->sweep_save_configuration()->{series_name};
2099 }
2100 0 ▶ if(!exists($params{create_datetime})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"create_datetime"}) 0 0 0
2101 0 $params{create_datetime}=$self->sweep_save_configuration()->{create_datetime};
2102 }
2103 0 ▶ if(!exists($params{comment})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"comment"}) 0 0 0
2104 0 $params{comment}=$self->sweep_save_configuration()->{comment};
2105 }
2106 0 ▶ if($params{create_datetime}!=-1 && $params{create_datetime}!=0 && $params{create_datetime}!=1)
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"create_datetime"} != -1 and $params{"create_datetime"} != 0 and $params{"create_datetime"} != 1) 0 0 0
Condition0%0/6
$params{"create_datetime"} != -1 and $params{"create_datetime"} != 0 and $params{"create_datetime"} != 1
!ll&&!rl&&r
000
$params{"create_datetime"} != -1 and $params{"create_datetime"} != 0
!ll&&!rl&&r
000
MC/DC0%0/3
$params{"create_datetime"} != -1 and $params{"create_datetime"} != 0 and $params{"create_datetime"} != 1
$params{"create_datetime"} != -1 $params{"create_datetime"} != 0 $params{"create_datetime"} != 1
Truth table0%0/4
A and B and C
A= $params{"create_datetime"} != -1B= $params{"create_datetime"} != 0C= $params{"create_datetime"} != 1
ABCresult
0XX0
10X0
1100
1111
2107 {
2108 0 die "Invalid create_date value in sweep_save_configure: value must be -1,0 or 1!"
2109 }
2110  
2111 0 $self->_sweep_save_configuration(\%params);
2112 $self->threeDSwp_SaveOptionsSet($params{series_name},
2113 $params{create_datetime},
2114 $params{comment})
2115 0 }
2116  
2117 0 ▶sub sweep_timing_configure {
Subroutine sweep_timing_configure: not called CC=6 SCAR=37.4
Pod undocumented
2118 0 my ($self, %params) = validated_hash(
2119 \@_,
2120 initial_settling_time =>{isa=>"Num",optional =>1},
2121 settling_time => {isa =>"Num",optional =>1},
2122 integration_time=> {isa=>"Num",optional =>1},
2123 end_settling_time => {isa =>"Num",optional =>1},
2124 maximum_slew_rate =>{isa =>"Num",optional =>1}
2125 );
2126 # NOTE : Here some validation may be necessary, Nanonis does not returrn error if Value is invalid
2127 0 ▶ if(!exists($params{initial_settling_time})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"initial_settling_time"}) 0 0 0
2128 0 $params{initial_settling_time} = $self->sweep_timing_configuration()->{initial_settling_time};
2129 };
2130 0 ▶ if(!exists($params{settling_time})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"settling_time"}) 0 0 0
2131 0 $params{settling_time} = $self->sweep_timing_configuration()->{settling_time};
2132 };
2133 0 ▶ if(!exists($params{integration_time})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"integration_time"}) 0 0 0
2134 0 $params{integration_time} = $self->sweep_timing_configuration()->{integration_time};
2135 };
2136 0 ▶ if(!exists($params{end_settling_time})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"end_settling_time"}) 0 0 0
2137 0 $params{end_settling_time} = $self->sweep_timing_configuration()->{end_settling_time};
2138 };
2139 0 ▶ if(!exists($params{maximum_slew_rate})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"maximum_slew_rate"}) 0 0 0
2140 0 $params{maximum_slew_rate} = $self->sweep_timing_configuration()->{maximum_slew_rate};
2141 };
2142 0 $self->reset_swp_timing;
2143 $self->threeDSwp_SwpChTimingSet( $params{initial_settling_time},
2144 $params{settling_time},
2145 $params{integration_time},
2146 $params{end_settling_time},
2147 $params{maximum_slew_rate})
2148  
2149 0 }
2150  
2151 0 ▶sub step1_timing_configure {
Subroutine step1_timing_configure: not called CC=4 SCAR=30.0
Pod undocumented
2152 0 my ($self, %params) = validated_hash(
2153 \@_,
2154 initial_settling_time =>{isa=>"Num",optional =>1},
2155 end_settling_time => {isa =>"Num",optional =>1},
2156 maximum_slew_rate =>{isa =>"Num",optional =>1}
2157 );
2158 # NOTE : Here some validation may be necessary, Nanonis does not returrn error if Value is invalid
2159 0 ▶ if(!exists($params{initial_settling_time})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"initial_settling_time"}) 0 0 0
2160 0 $params{initial_settling_time} = $self->step1_timing_configuration()->{initial_settling_time};
2161 };
2162 0 ▶ if(!exists($params{end_settling_time})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"end_settling_time"}) 0 0 0
2163 0 $params{end_settling_time} = $self->step1_timing_configuration()->{end_settling_time};
2164 };
2165 0 ▶ if(!exists($params{maximum_slew_rate})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"maximum_slew_rate"}) 0 0 0
2166 0 $params{maximum_slew_rate} = $self->step1_timing_configuration()->{maximum_slew_rate};
2167 };
2168 0 $self->reset_stp1_timing;
2169 $self->threeDSwp_StpCh1TimingSet( $params{initial_settling_time},
2170 $params{end_settling_time},
2171 $params{maximum_slew_rate})
2172 0 }
2173  
2174 0 ▶sub step2_timing_configure {
Subroutine step2_timing_configure: not called CC=4 SCAR=30.0
Pod undocumented
2175 0 my ($self, %params) = validated_hash(
2176 \@_,
2177 initial_settling_time =>{isa=>"Num",optional =>1},
2178 end_settling_time => {isa =>"Num",optional =>1},
2179 maximum_slew_rate =>{isa =>"Num",optional =>1}
2180 );
2181 # NOTE : Here some validation may be necessary, Nanonis does not returrn error if Value is invalid
2182 0 ▶ if(!exists($params{initial_settling_time})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"initial_settling_time"}) 0 0 0
2183 0 $params{initial_settling_time} = $self->step2_timing_configuration()->{initial_settling_time};
2184 };
2185 0 ▶ if(!exists($params{end_settling_time})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"end_settling_time"}) 0 0 0
2186 0 $params{end_settling_time} = $self->step2_timing_configuration()->{end_settling_time};
2187 };
2188 0 ▶ if(!exists($params{maximum_slew_rate})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"maximum_slew_rate"}) 0 0 0
2189 0 $params{maximum_slew_rate} = $self->step2_timing_configuration()->{maximum_slew_rate};
2190 };
2191 0 $self->reset_stp2_timing;
2192 $self->threeDSwp_StpCh1TimingSet( $params{initial_settling_time},
2193 $params{end_settling_time},
2194 $params{maximum_slew_rate})
2195 0 }
2196  
2197  
2198  
2199  
2200 0 ▶sub sweep_prop_configure {
Subroutine sweep_prop_configure: not called CC=19 SCAR=59.4
Pod undocumented
2201 0 my $self= shift;
2202 0 my %params = validated_hash(
2203 \@_,
2204 point_number =>{isa=>"Int", optional=>1},
2205 number_of_sweeps =>{isa =>"Int", optional =>1},
2206 backwards =>{isa=>"Int", optional =>1},
2207 at_end=> {isa => "Int", optional =>1},
2208 at_end_val =>{isa =>"Num", optional =>1},
2209 save_all =>{isa=>"Num",optional =>1}
2210 );
2211  
2212 0 ▶ if(!exists($params{point_number})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"point_number"}) 0 0 0
2213 0 $params{point_number}=$self->sweep_prop_configuration()->{point_number};
2214 }
2215 0 ▶ if(!exists($params{number_of_sweeps})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"number_of_sweeps"}) 0 0 0
2216 0 $params{number_of_sweeps}=$self->sweep_prop_configuration()->{number_of_sweeps};
2217 }
2218 0 ▶ if(!exists($params{backwards})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"backwards"}) 0 0 0
2219 0 $params{backwards}=$self->sweep_prop_configuration()->{backwards};
2220 }
2221 0 ▶ if(!exists($params{at_end})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"at_end"}) 0 0 0
2222 0 $params{at_end}=$self->sweep_prop_configuration()->{at_end};
2223 }
2224 0 ▶ if(!exists($params{at_end_val})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"at_end_val"}) 0 0 0
2225 0 $params{at_end_val}=$self->sweep_prop_configuration()->{at_end_val};
2226 }
2227 0 ▶ if(!exists($params{save_all})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"save_all"}) 0 0 0
2228 0 $params{save_all}=$self->sweep_prop_configuration()->{save_all};
2229 }
2230  
2231 0 ▶ if($params{point_number}<0){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"point_number"} < 0) 0 0 0
2232 0 die "Invalid point_number value in sweep_prop_configure: value must be greater or equal to 0!";
2233 }
2234 0 ▶ if($params{number_of_sweeps}<0){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"number_of_sweeps"} < 0) 0 0 0
2235 0 die "Invalid sweep_number value in sweep_prop_configure: value must be greater or equal to 0!";
2236 }
2237 0 ▶ if($params{backwards}!=-1 && $params{backwards}!=0 && $params{backwards}!=1){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1) 0 0 0
Condition0%0/6
$params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1
!ll&&!rl&&r
000
$params{"backwards"} != -1 and $params{"backwards"} != 0
!ll&&!rl&&r
000
MC/DC0%0/3
$params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1
$params{"backwards"} != -1 $params{"backwards"} != 0 $params{"backwards"} != 1
Truth table0%0/4
A and B and C
A= $params{"backwards"} != -1B= $params{"backwards"} != 0C= $params{"backwards"} != 1
ABCresult
0XX0
10X0
1100
1111
2238 0 die "Invalid backwards value in sweep_prop_configure: value -1,0 or 1";
2239 }
2240 0 ▶ if($params{at_end}!=-1 && $params{at_end}!=0 && $params{at_end}!=1 && $params{at_end}!=2){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2) 0 0 0
Condition0%0/9
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2
!ll&&!rl&&r
000
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1
!ll&&!rl&&r
000
$params{"at_end"} != -1 and $params{"at_end"} != 0
!ll&&!rl&&r
000
MC/DC0%0/4
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2
$params{"at_end"} != -1 $params{"at_end"} != 0 $params{"at_end"} != 1 $params{"at_end"} != 2
Truth table0%0/5
A and B and C and D
A= $params{"at_end"} != -1B= $params{"at_end"} != 0C= $params{"at_end"} != 1D= $params{"at_end"} != 2
ABCDresult
0XXX0
10XX0
110X0
11100
11111
2241 0 die "Invalid backwards value in sweep_prop_configure: value -1,0,1 or 2";
2242 }
2243 0 ▶ if($params{save_all}!=-1 && $params{save_all}!=0 && $params{save_all}!=1){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"save_all"} != -1 and $params{"save_all"} != 0 and $params{"save_all"} != 1) 0 0 0
Condition0%0/6
$params{"save_all"} != -1 and $params{"save_all"} != 0 and $params{"save_all"} != 1
!ll&&!rl&&r
000
$params{"save_all"} != -1 and $params{"save_all"} != 0
!ll&&!rl&&r
000
MC/DC0%0/3
$params{"save_all"} != -1 and $params{"save_all"} != 0 and $params{"save_all"} != 1
$params{"save_all"} != -1 $params{"save_all"} != 0 $params{"save_all"} != 1
Truth table0%0/4
A and B and C
A= $params{"save_all"} != -1B= $params{"save_all"} != 0C= $params{"save_all"} != 1
ABCresult
0XX0
10X0
1100
1111
2244 0 die "Invalid backwards value in sweep_prop_configure: value -1,0 or 1";
2245 }
2246 0 $self->_sweep_prop_configuration(\%params);
2247 $self->threeDSwp_SwpChPropsSet($params{point_number},
2248 $params{number_of_sweeps},
2249 $params{backwards},
2250 $params{at_end},
2251 $params{at_end_val},
2252 0 $params{save_all});
2253 }
2254  
2255 0 ▶sub step1_prop_configure {
Subroutine step1_prop_configure: not called CC=13 SCAR=52.0
Pod undocumented
2256 0 my $self= shift;
2257 0 my %params = validated_hash(
2258 \@_,
2259 point_number =>{isa=>"Int", optional=>1},
2260 backwards =>{isa=>"Int", optional =>1},
2261 at_end=> {isa => "Int", optional =>1},
2262 at_end_val =>{isa =>"Num", optional =>1}
2263 );
2264  
2265 0 ▶ if(!exists($params{point_number})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"point_number"}) 0 0 0
2266 0 $params{point_number}=$self->step1_prop_configuration()->{point_number};
2267 }
2268 0 ▶ if(!exists($params{backwards})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"backwards"}) 0 0 0
2269 0 $params{backwards}=$self->step1_prop_configuration()->{backwards};
2270 }
2271 0 ▶ if(!exists($params{at_end})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"at_end"}) 0 0 0
2272 0 $params{at_end}=$self->step1_prop_configuration()->{at_end};
2273 }
2274 0 ▶ if(!exists($params{at_end_val})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"at_end_val"}) 0 0 0
2275 0 $params{at_end_val}=$self->step1_prop_configuration()->{at_end_val};
2276 }
2277  
2278 0 ▶ if($params{point_number}<0){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"point_number"} < 0) 0 0 0
2279 0 die "Invalid point_number value in step1_prop_configure: value must be greater or equal to 0!";
2280 }
2281 0 ▶ if($params{backwards}!=-1 && $params{backwards}!=0 && $params{backwards}!=1){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1) 0 0 0
Condition0%0/6
$params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1
!ll&&!rl&&r
000
$params{"backwards"} != -1 and $params{"backwards"} != 0
!ll&&!rl&&r
000
MC/DC0%0/3
$params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1
$params{"backwards"} != -1 $params{"backwards"} != 0 $params{"backwards"} != 1
Truth table0%0/4
A and B and C
A= $params{"backwards"} != -1B= $params{"backwards"} != 0C= $params{"backwards"} != 1
ABCresult
0XX0
10X0
1100
1111
2282 0 die "Invalid backwards value in step1_prop_configure: value -1,0 or 1";
2283 }
2284 0 ▶ if($params{at_end}!=-1 && $params{at_end}!=0 && $params{at_end}!=1 && $params{at_end}!=2){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2) 0 0 0
Condition0%0/9
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2
!ll&&!rl&&r
000
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1
!ll&&!rl&&r
000
$params{"at_end"} != -1 and $params{"at_end"} != 0
!ll&&!rl&&r
000
MC/DC0%0/4
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2
$params{"at_end"} != -1 $params{"at_end"} != 0 $params{"at_end"} != 1 $params{"at_end"} != 2
Truth table0%0/5
A and B and C and D
A= $params{"at_end"} != -1B= $params{"at_end"} != 0C= $params{"at_end"} != 1D= $params{"at_end"} != 2
ABCDresult
0XXX0
10XX0
110X0
11100
11111
2285 0 die "Invalid backwards value in step1_prop_configure: value -1,0,1 or 2";
2286 }
2287  
2288 0 $self->_step1_prop_configuration(\%params);
2289 $self->threeDSwp_StpCh1PropsSet($params{point_number},
2290 $params{backwards},
2291 $params{at_end},
2292 0 $params{at_end_val});
2293 }
2294  
2295 0 ▶sub step2_prop_configure {
Subroutine step2_prop_configure: not called CC=13 SCAR=52.0
Pod undocumented
2296 0 my $self= shift;
2297 0 my %params = validated_hash(
2298 \@_,
2299 point_number =>{isa=>"Int", optional=>1},
2300 backwards =>{isa=>"Int", optional =>1},
2301 at_end=> {isa => "Int", optional =>1},
2302 at_end_val =>{isa =>"Num", optional =>1}
2303 );
2304  
2305 0 ▶ if(!exists($params{point_number})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"point_number"}) 0 0 0
2306 0 $params{point_number}=$self->step1_prop_configuration()->{point_number};
2307 }
2308 0 ▶ if(!exists($params{backwards})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"backwards"}) 0 0 0
2309 0 $params{backwards}=$self->step1_prop_configuration()->{backwards};
2310 }
2311 0 ▶ if(!exists($params{at_end})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"at_end"}) 0 0 0
2312 0 $params{at_end}=$self->step2_prop_configuration()->{at_end};
2313 }
2314 0 ▶ if(!exists($params{at_end_val})){
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $params{"at_end_val"}) 0 0 0
2315 0 $params{at_end_val}=$self->step2_prop_configuration()->{at_end_val};
2316 }
2317  
2318 0 ▶ if($params{point_number}<0){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"point_number"} < 0) 0 0 0
2319 0 die "Invalid point_number value in step2_prop_configure: value must be greater or equal to 0!";
2320 }
2321  
2322 0 ▶ if($params{backwards}!=-1 && $params{backwards}!=0 && $params{backwards}!=1){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1) 0 0 0
Condition0%0/6
$params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1
!ll&&!rl&&r
000
$params{"backwards"} != -1 and $params{"backwards"} != 0
!ll&&!rl&&r
000
MC/DC0%0/3
$params{"backwards"} != -1 and $params{"backwards"} != 0 and $params{"backwards"} != 1
$params{"backwards"} != -1 $params{"backwards"} != 0 $params{"backwards"} != 1
Truth table0%0/4
A and B and C
A= $params{"backwards"} != -1B= $params{"backwards"} != 0C= $params{"backwards"} != 1
ABCresult
0XX0
10X0
1100
1111
2323 0 die "Invalid backwards value in step2_prop_configure: value -1,0 or 1";
2324 }
2325  
2326 0 ▶ if($params{at_end}!=-1 && $params{at_end}!=0 && $params{at_end}!=1 && $params{at_end}!=2){
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2) 0 0 0
Condition0%0/9
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2
!ll&&!rl&&r
000
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1
!ll&&!rl&&r
000
$params{"at_end"} != -1 and $params{"at_end"} != 0
!ll&&!rl&&r
000
MC/DC0%0/4
$params{"at_end"} != -1 and $params{"at_end"} != 0 and $params{"at_end"} != 1 and $params{"at_end"} != 2
$params{"at_end"} != -1 $params{"at_end"} != 0 $params{"at_end"} != 1 $params{"at_end"} != 2
Truth table0%0/5
A and B and C and D
A= $params{"at_end"} != -1B= $params{"at_end"} != 0C= $params{"at_end"} != 1D= $params{"at_end"} != 2
ABCDresult
0XXX0
10XX0
110X0
11100
11111
2327 0 die "Invalid backwards value in step2_prop_configure: value -1,0,1 or 2";
2328 }
2329  
2330 0 $self->_step2_prop_configuration(\%params);
2331 $self->threeDSwp_StpCh2PropsSet($params{point_number},
2332 $params{backwards},
2333 $params{at_end},
2334 0 $params{at_end_val});
2335 }
2336  
2337 0 ▶sub tramea_sweep {
Subroutine tramea_sweep: not called CC=30 SCAR=68.4
Pod undocumented
2338 0 my ($self, %params) = validated_hash(
2339 \@_,
2340 sweep_channel => {isa => "Int"},
2341 step1_channel => {isa => "Int", optional=>1},
2342 step2_channel_idx => {isa => "Int", optional=>1},
2343 step2_channel_name => {isa => "Str", optional=>1},
2344 aquisition_channels => {isa=>"ArrayRef[Int]"},
2345 lower_limit_sweep =>{isa=>"Num"},
2346 upper_limit_sweep =>{isa=>"Num"},
2347 lower_limit_step1 =>{isa=>"Num",optional=>1},
2348 upper_limit_step1 =>{isa=>"Num",optional=>1},
2349 lower_limit_step2 =>{isa=>"Num",optional=>1},
2350 upper_limit_step2 =>{isa=>"Num",optional=>1},
2351 point_number_sweep =>{isa=>"Int", optional=>1},
2352 point_number_step1 =>{isa=>"Int", optional=>1},
2353 point_number_step2 =>{isa=>"Int", optional=>1},
2354 series_name => {isa=> "Str", optional=>1},
2355 comment => {isa=>"Str", optional =>1},
2356 load => {isa=>"Bool", default=>1}
2357 );
2358
2359  
2360 # PARAMETER CONTROLL FOR Sweep Channel, Need to check for maximum channel?
2361  
2362 0 ▶ if(exists($params{point_number_sweep}) && $params{point_number_sweep}!= $self->sweep_prop_configuration()->{point_number}){
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{"point_number_sweep"} and $params{"point_number_sweep"} != $self->sweep_prop_configuration->{"point_number"}) 0 0 0
Condition0%0/3
exists $params{"point_number_sweep"} and $params{"point_number_sweep"} != $self->sweep_prop_configuration->{"point_number"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $params{"point_number_sweep"} and $params{"point_number_sweep"} != $self->sweep_prop_configuration->{"point_number"}
exists $params{"point_number_sweep"} $params{"point_number_sweep"} != $self->sweep_prop_configuration->{"point_number"}
Truth table0%0/3
A and B
A= exists $params{"point_number_sweep"}B= $params{"point_number_sweep"} != $self->sweep_prop_configuration->{"point_number"}
ABresult
0X0
100
111
2363 0 $self->sweep_prop_configure(point_number=>$params{point_number_sweep});
2364 }
2365
2366 0 $self->threeDSwp_SwpChSignalSet($params{sweep_channel});
2367
2368 0 $self->threeDSwp_SwpChLimitsSet($params{lower_limit_sweep},$params{upper_limit_sweep});
2369 # PARAMETER CONTROLL FOR Step channel 1
2370 0 ▶ if(exists($params{step1_channel}))
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{'step1_channel'}) { } 0 0 0
2371 {
2372 0 ▶ if($params{step1_channel}>=0)
Branch: 1 branch
BranchTrueFalseTotal
if ($params{'step1_channel'} >= 0) { } 0 0 0
2373 {
2374 0 ▶ if(exists($params{point_number_step1}) && $params{point_number_step1}!= $self->step1_prop_configuration()->{point_number})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{"point_number_step1"} and $params{"point_number_step1"} != $self->step1_prop_configuration->{"point_number"}) 0 0 0
Condition0%0/3
exists $params{"point_number_step1"} and $params{"point_number_step1"} != $self->step1_prop_configuration->{"point_number"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $params{"point_number_step1"} and $params{"point_number_step1"} != $self->step1_prop_configuration->{"point_number"}
exists $params{"point_number_step1"} $params{"point_number_step1"} != $self->step1_prop_configuration->{"point_number"}
Truth table0%0/3
A and B
A= exists $params{"point_number_step1"}B= $params{"point_number_step1"} != $self->step1_prop_configuration->{"point_number"}
ABresult
0X0
100
111
2375 {
2376 0 $self->step1_prop_configure(point_number=>$params{point_number_step1});
2377 }
2378  
2379 0 ▶ if(exists($params{lower_limit_step1}))
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{'lower_limit_step1'}) { } 0 0 0
2380 {
2381  
2382 0 ▶ if(exists($params{upper_limit_step1}))
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{'upper_limit_step1'}) { } 0 0 0
2383 {
2384 0 $self->threeDSwp_StpCh1SignalSet($params{step1_channel});
2385 $self->threeDSwp_StpCh1LimitsSet($params{lower_limit_step1},$params{upper_limit_step1})
2386 0 }
2387 else
2388 {
2389 0 die "No upper limit supplied to Step Channel 1, upper_limit_step1";
2390 }
2391  
2392 }
2393 else
2394 {
2395 0 die "No lower limit supplied to Step Channel 1, lower_limit_step1";
2396 }
2397 }
2398 else
2399 {
2400 0 die "Invalid value for step1_channel, value must be greter or equal to 0!"
2401 }
2402 }
2403 else
2404 {
2405 0 $self->threeDSwp_StpCh1SignalSet(-1);
2406 }
2407  
2408  
2409 # PARAMETER CONTROLL FOR Step channel 2
2410 0 ▶ if(exists($params{step2_channel_idx}) && exists($params{step2_channel_name}))
Branch: 2 branches
BranchTrueFalseTotal
if (exists $params{'step2_channel_idx'} and exists $params{'step2_channel_name'}) { } 0 0 0
elsif (exists $params{'step2_channel_idx'} or exists $params{'step2_channel_name'}) { } 0 0 0
Condition0%0/3
exists $params{"step2_channel_idx"} and exists $params{"step2_channel_name"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $params{"step2_channel_idx"} and exists $params{"step2_channel_name"}
exists $params{"step2_channel_idx"} exists $params{"step2_channel_name"}
Truth table0%0/3
A and B
A= exists $params{"step2_channel_idx"}B= exists $params{"step2_channel_name"}
ABresult
0X0
100
111
2411 {
2412 0 croak "Supply either step2_channel_idx or step2_channel_name";
2413 }
2414 ▶ elsif(exists($params{step2_channel_idx}) or exists($params{step2_channel_name}))
Condition0%0/3
exists $params{"step2_channel_idx"} or exists $params{"step2_channel_name"}
l!l&&r!l&&!r
000
MC/DC0%0/2
exists $params{"step2_channel_idx"} or exists $params{"step2_channel_name"}
exists $params{"step2_channel_idx"} exists $params{"step2_channel_name"}
Truth table0%0/3
A or B
A= exists $params{"step2_channel_idx"}B= exists $params{"step2_channel_name"}
ABresult
1X1
011
000
2415 {
2416 0 ▶ if (exists($params{step2_channel_idx}))
Branch: 2 branches
BranchTrueFalseTotal
if (exists $params{'step2_channel_idx'}) { } 0 0 0
elsif (exists $params{'step2_channel_name'}) { } 0 0 0
2417 {
2418 0 $params{step2_channel_name}=" ";
2419 }
2420 elsif(exists($params{step2_channel_name}))
2421 {
2422 0 $params{step2_channel_idx}=-1;
2423 }
2424 0 ▶ if($params{step2_channel_idx}>=0 or $params{step2_channel_name} ne " ")
Branch: 1 branch
BranchTrueFalseTotal
if ($params{'step2_channel_idx'} >= 0 or $params{'step2_channel_name'} ne ' ') { } 0 0 0
Condition0%0/3
$params{"step2_channel_idx"} >= 0 or $params{"step2_channel_name"} ne " "
l!l&&r!l&&!r
000
MC/DC0%0/2
$params{"step2_channel_idx"} >= 0 or $params{"step2_channel_name"} ne " "
$params{"step2_channel_idx"} >= 0 $params{"step2_channel_name"} ne " "
Truth table0%0/3
A or B
A= $params{"step2_channel_idx"} >= 0B= $params{"step2_channel_name"} ne " "
ABresult
1X1
011
000
2425 {
2426 0 ▶ if(exists($params{point_number_step2}) && $params{point_number_step2}!= $self->step2_prop_configuration()->{point_number})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{"point_number_step2"} and $params{"point_number_step2"} != $self->step2_prop_configuration->{"point_number"}) 0 0 0
Condition0%0/3
exists $params{"point_number_step2"} and $params{"point_number_step2"} != $self->step2_prop_configuration->{"point_number"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $params{"point_number_step2"} and $params{"point_number_step2"} != $self->step2_prop_configuration->{"point_number"}
exists $params{"point_number_step2"} $params{"point_number_step2"} != $self->step2_prop_configuration->{"point_number"}
Truth table0%0/3
A and B
A= exists $params{"point_number_step2"}B= $params{"point_number_step2"} != $self->step2_prop_configuration->{"point_number"}
ABresult
0X0
100
111
2427 {
2428 0 $self->step2_prop_configure(point_number=>$params{point_number_step2});
2429 }
2430  
2431 0 ▶ if(exists($params{lower_limit_step2}))
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{'lower_limit_step2'}) { } 0 0 0
2432 {
2433  
2434 0 ▶ if(exists($params{upper_limit_step2}))
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{'upper_limit_step2'}) { } 0 0 0
2435 {
2436 0 ▶ if($params{step2_channel_idx}>=0)
Branch: 2 branches
BranchTrueFalseTotal
if ($params{'step2_channel_idx'} >= 0) { } 0 0 0
elsif ($params{'step2_channel_name'} ne ' ') { } 0 0 0
2437 {
2438 0 $self->threeDSwp_StpCh2SignalSet($self->outputs->{$params{step2_channel_idx}});
2439 }
2440 elsif($params{step2_channel_name} ne " ")
2441 {
2442 0 $self->threeDSwp_StpCh2SignalSet($params{step2_channel_name});
2443 }
2444 $self->threeDSwp_StpCh2LimitsSet($params{lower_limit_step2},$params{upper_limit_step2})
2445 0 }
2446 else
2447 {
2448 0 die "No upper limit supplied to Step Channel 2, upper_limit_step2";
2449 }
2450  
2451 }
2452 else
2453 {
2454 0 die "No lower limit supplied to Step Channel 2, lower_limit_step2";
2455 }
2456 }
2457 else
2458 {
2459 0 die "Invalid value for step2_channel_idx, value must be greter or equal to 0!"
2460 }
2461 }
2462 else
2463 {
2464 0 $self->threeDSwp_StpCh2SignalSet("");
2465 }
2466  
2467 0 ▶ if(exists($params{series_name})&& $params{series_name} ne $self->sweep_save_configuration()->{series_name}){
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{"series_name"} and $params{"series_name"} ne $self->sweep_save_configuration->{"series_name"}) 0 0 0
Condition0%0/3
exists $params{"series_name"} and $params{"series_name"} ne $self->sweep_save_configuration->{"series_name"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $params{"series_name"} and $params{"series_name"} ne $self->sweep_save_configuration->{"series_name"}
exists $params{"series_name"} $params{"series_name"} ne $self->sweep_save_configuration->{"series_name"}
Truth table0%0/3
A and B
A= exists $params{"series_name"}B= $params{"series_name"} ne $self->sweep_save_configuration->{"series_name"}
ABresult
0X0
100
111
2468 0 $self->sweep_save_configure(series_name=>$params{series_name});
2469 }
2470  
2471 0 ▶ if(exists($params{comment})&& ($params{comment} ne $self->sweep_save_configuration()->{comment})){
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{"comment"} and $params{"comment"} ne $self->sweep_save_configuration->{"comment"}) 0 0 0
Condition0%0/3
exists $params{"comment"} and $params{"comment"} ne $self->sweep_save_configuration->{"comment"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $params{"comment"} and $params{"comment"} ne $self->sweep_save_configuration->{"comment"}
exists $params{"comment"} $params{"comment"} ne $self->sweep_save_configuration->{"comment"}
Truth table0%0/3
A and B
A= exists $params{"comment"}B= $params{"comment"} ne $self->sweep_save_configuration->{"comment"}
ABresult
0X0
100
111
2472 0 $self->sweep_save_configure(comment=>$params{comment});
2473 }
2474 0 $self->threeDSwp_AcqChsSet($params{aquisition_channels});
2475 # Still unclear what is happenig here :///////
2476 # Can not find it, report may be needed
2477 0 sleep(1);
2478 0 $self->threeDSwp_Start();
2479 0 ▶ while($self->threeDSwp_StatusGet()!=0 && $self->threeDSwp_StatusGet()!=2)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->threeDSwp_StatusGet != 0 and $self->threeDSwp_StatusGet != 2) 0 0 0
Condition0%0/3
$self->threeDSwp_StatusGet != 0 and $self->threeDSwp_StatusGet != 2
!ll&&!rl&&r
000
MC/DC0%0/2
$self->threeDSwp_StatusGet != 0 and $self->threeDSwp_StatusGet != 2
$self->threeDSwp_StatusGet != 0 $self->threeDSwp_StatusGet != 2
Truth table0%0/3
A and B
A= $self->threeDSwp_StatusGet != 0B= $self->threeDSwp_StatusGet != 2
ABresult
0X0
100
111
2480 {
2481 0 sleep(0.1);
2482 }
2483 0 ▶ if($params{load}==1)
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"load"} == 1) 0 0 0
2484 {
2485 0 return $self->load_last_measurement();
2486 }
2487 }
2488 1 __PACKAGE__->meta()->make_immutable();
2489  
2490 1 1;
2491  
2492 __END__
« Moose/Instrument/SignalRecovery7265.pm ↑ Summary Moose/Connection/LinuxGPIB.pm »