Skip to content

Commit

Permalink
Add descriptive tooltipstring to parameter name on gui
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliuf committed Aug 10, 2019
1 parent 9f1998b commit 5cdcf1f
Show file tree
Hide file tree
Showing 3 changed files with 726 additions and 9 deletions.
15 changes: 8 additions & 7 deletions Src/Main/DoEditValue.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

function DoEditValue(handles,parent_handle,Attributes,AttrhNumber,dims)

% Create Editbox for ajusting attributes at the frame given by parent_handle
% Create Editbox for adjusting attributes at the frame given by parent_handle
% special mark
% '$value' ----popupmenu
% '^value' ----checkbox
Expand Down Expand Up @@ -32,7 +32,8 @@ function DoEditValue(handles,parent_handle,Attributes,AttrhNumber,dims)
for i=1:Hpair
if ind<=length(Attributes)
Attrh.([Attributes(ind).Name 'Text'])=uicontrol(parent_handle,'Style', 'text', 'String', Attributes(ind).Name,'FontWeight','bold','Units','normalized',...
'Position', [(j-1)*(TextW+SpaceW+EditW) (i-1)*(TextH+SpaceH) TextW TextH]);
'Position', [(j-1)*(TextW+SpaceW+EditW) (i-1)*(TextH+SpaceH) TextW TextH],...
'TooltipString', DoTellMeInfo(Attributes(ind).Name));
eval(['handles.Attrh' num2str(AttrhNumber) '.' Attributes(ind).Name 'Text=Attrh.' Attributes(ind).Name 'Text;']);
if ~isempty(Attributes(ind).Value)
switch Attributes(ind).Value(1)
Expand All @@ -41,30 +42,30 @@ function DoEditValue(handles,parent_handle,Attributes,AttrhNumber,dims)
Attrh.(Attributes(ind).Name)=uicontrol(parent_handle,'Style', 'popupmenu', 'String', AttributeOpt,'BackgroundColor',[1 1 1],...
'Value',str2double(Attributes(ind).Value(2)),'Units','normalized',...
'Position', [(j-1)*(TextW+SpaceW+EditW)+TextW (i-1)*(TextH+SpaceH) EditW EditH],...
'TooltipString',[Attributes(ind).Name ' : ' Attributes(ind).Value(3:end)]);
'TooltipString',['Default: ' Attributes(ind).Value(2:end)]);
eval(['handles.Attrh' num2str(AttrhNumber) '.' Attributes(ind).Name '=Attrh.' Attributes(ind).Name ';']);
case '^'
Attrh.(Attributes(ind).Name)=uicontrol(parent_handle,'Style', 'checkbox', 'String',[],'BackgroundColor',[1 1 1],...
'Value',str2double(Attributes(ind).Value(2)),'Units','normalized',...
'Position', [(j-1)*(TextW+SpaceW+EditW)+TextW (i-1)*(TextH+SpaceH) EditW EditH],...
'TooltipString',[Attributes(ind).Name ' : ' Attributes(ind).Value]);
'TooltipString',['Default: ' Attributes(ind).Value(2:end)]);
eval(['handles.Attrh' num2str(AttrhNumber) '.' Attributes(ind).Name '=Attrh.' Attributes(ind).Name ';']);
case '@'
eval(['AttributeOpt=' Attributes(ind).Value(2:end) ';']);
Attrh.(Attributes(ind).Name)=uicontrol(parent_handle,'Style', 'text', 'String',AttributeOpt,'Units','normalized',...
'Position', [(j-1)*(TextW+SpaceW+EditW)+TextW (i-1)*(TextH+SpaceH) EditW EditH],...
'TooltipString',[Attributes(ind).Name ' : ' AttributeOpt]);
'TooltipString',['Default: ' AttributeOpt]);
eval(['handles.Attrh' num2str(AttrhNumber) '.' Attributes(ind).Name '=Attrh.' Attributes(ind).Name ';']);
otherwise
Attrh.(Attributes(ind).Name)=uicontrol(parent_handle,'Style', 'edit', 'String', Attributes(ind).Value,'Units','normalized','BackgroundColor',[1 1 1],...
'Position', [(j-1)*(TextW+SpaceW+EditW)+TextW (i-1)*(TextH+SpaceH) EditW EditH],...
'TooltipString',[Attributes(ind).Name ' : ' Attributes(ind).Value]);
'TooltipString',['Default: ' Attributes(ind).Value]);
eval(['handles.Attrh' num2str(AttrhNumber) '.' Attributes(ind).Name '=Attrh.' Attributes(ind).Name ';']);
end
else
Attrh.(Attributes(ind).Name)=uicontrol(parent_handle,'Style', 'edit', 'String', Attributes(ind).Value,'Units','normalized','BackgroundColor',[1 1 1],...
'Position', [(j-1)*(TextW+SpaceW+EditW)+TextW (i-1)*(TextH+SpaceH) EditW EditH],...
'TooltipString',[Attributes(ind).Name ' : ' Attributes(ind).Value]);
'TooltipString',['Default: ' Attributes(ind).Value]);
eval(['handles.Attrh' num2str(AttrhNumber) '.' Attributes(ind).Name '=Attrh.' Attributes(ind).Name ';']);
end
end
Expand Down
22 changes: 20 additions & 2 deletions Src/Main/DoGradChk.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


ExecFlag = 1;
GradTolerance = abs(VCtl.MaxGrad * 0.01);
SRTolerance = abs(VCtl.MaxSlewRate * 0.01);
GradTolerance = abs(VCtl.MaxGrad * 0.005);
SRTolerance = abs(VCtl.MaxSlewRate * 0.005);
% check Gz
Flags = VSeq.flagsLine(2,:);
t = VSeq.tsLine(Flags~=0);
Expand All @@ -18,11 +18,17 @@
SlewRate = dG./dt;

if ~isempty(find((abs(SlewRate)-VCtl.MaxSlewRate)>SRTolerance, 1))

disp(['GzSS Max SlewRate ' num2str(max(abs(SlewRate)))]);

errordlg('GzSS exceeds maximum allowed gradient slew rate!');
ExecFlag = 0;
end

if ~isempty(find((abs(VSeq.GzAmpLine)-VCtl.MaxGrad)>GradTolerance, 1))

disp(['GzSS Max Gradient ' num2str(max(abs(VSeq.GzAmpLine)))]);

errordlg('GzSS exceeds maximum allowed gradient amplitude!');
ExecFlag = 0;
end
Expand All @@ -36,11 +42,17 @@
SlewRate = dG./dt;

if ~isempty(find((abs(SlewRate)-VCtl.MaxSlewRate)>SRTolerance, 1))

disp(['GyP Max SlewRate ' num2str(max(abs(SlewRate)))]);

errordlg('GyP exceeds maximum allowed gradient slew rate!');
ExecFlag = 0;
end

if ~isempty(find((abs(VSeq.GyAmpLine)-VCtl.MaxGrad)>GradTolerance, 1))

disp(['GyP Max Gradient ' num2str(max(abs(VSeq.GyAmpLine)))]);

errordlg('GyP exceeds maximum allowed gradient amplitude!');
ExecFlag = 0;
end
Expand All @@ -54,12 +66,18 @@
SlewRate = dG./dt;

if ~isempty(find((abs(SlewRate)-VCtl.MaxSlewRate)>SRTolerance, 1))

disp(['GxR Max SlewRate ' num2str(max(abs(SlewRate)))]);

errordlg('GxR exceeds maximum allowed gradient slew rate!');
ExecFlag = 0;

end

if ~isempty(find((abs(VSeq.GxAmpLine)-VCtl.MaxGrad)>GradTolerance, 1))

disp(['GxR Max Gradient ' num2str(max(abs(VSeq.GxAmpLine)))]);

errordlg('GxR exceeds maximum allowed gradient amplitude!');
ExecFlag = 0;
end
Expand Down
Loading

0 comments on commit 5cdcf1f

Please sign in to comment.