Commit before first big baudrate sweep

This commit is contained in:
Silas Labor Zizou
2024-10-24 19:41:59 +02:00
parent cfd1bdb513
commit bafc7f12b7
11 changed files with 588 additions and 318 deletions

View File

@@ -12,6 +12,8 @@ classdef ScopeKeysight
interpolate
recordLen
IPaddress
waitUntilClick
end
methods (Access=public)
@@ -30,6 +32,7 @@ classdef ScopeKeysight
options.interpolate logical = 0;
options.recordLen double = 1000000;
options.IPaddress
options.waitUntilClick = 0;
end
%
@@ -55,6 +58,7 @@ classdef ScopeKeysight
arguments
obj
options.channel logical = obj.channel
options.waitUntilClick = obj.waitUntilClick;
end
%%%%%%%%%%%%%%%%%%%%%%%%
@@ -119,14 +123,43 @@ classdef ScopeKeysight
obj.writeNcheck(v,sprintf(':CHANnel%u:DISPlay ON',n));% display captured data trace
end
set(v,'Timeout',150);
if obj.autoScale
obj.writeNcheck(v,':AUTOscale');
for n = 1:4
range = str2double(obj.writeReceiveCheck(v,sprintf(':CHANnel%u:RANGe?',n)));
obj.writeNcheck(v,sprintf(':CHANnel%u:RANGe %.3f',n,range/1.2));
%use this to finetune autoscaling - VERY helpful
% higher value leads to higher scaling
fintunefactor = 1.4; % within [1,...,2]
obj.writeNcheck(v,sprintf(':CHANnel%u:RANGe %.3f',n,range/fintunefactor));
end
else
obj.writeNcheck(v,':SINGLE');
%obj.writeNcheck(v,':SINGLE');
end
% After Autoscale, let the user adjust the scope scaling...
% "options.waitUntilClick" was a shit name but now this is it :-)
if options.waitUntilClick
% Create a dialog box with the desired text
d = dialog('Name', 'Scale Scope then press continue', 'Position', [300, 300, 300, 180]);
% Add a text label with the instruction
uicontrol('Parent', d, ...
'Style', 'text', ...
'Position', [20, 100, 260, 40], ...
'String', 'Please adjust scope scaling now, then press continue', ...
'HorizontalAlignment', 'center');
% Add a button to close the dialog and resume execution
uicontrol('Parent', d, ...
'Style', 'pushbutton', ...
'Position', [100, 40, 100, 40], ...
'String', 'Continue', ...
'Callback', 'uiresume(gcbf); delete(gcbf)');
% Pause execution until the dialog box is closed
uiwait(d);
end
if obj.extRef