Commit bcefe0ae authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.24.5

-- Display function call name in ProcStreamOptionsGUI based on number of usages for the associated function. That is if number usages is 1 then display only the function name. If there are multiple usages then display the whole function call name; i.e., <function name>: <usage name>
parent 9d409956
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -459,11 +459,25 @@ classdef ProcStreamClass < handle
                
        
        % ----------------------------------------------------------------------------------
        function maxnamelen = GetMaxCallNameLength(obj)
        function [maxnamelen, numUsages] = GetMaxCallNameLength(obj)
            maxnamelen = 0;
            numUsages = zeros(length(obj.fcalls),1);
            for iFcall = 1:length(obj.fcalls)
                if length(obj.fcalls(iFcall).GetUsageName()) > maxnamelen
                    maxnamelen = length(obj.fcalls(iFcall).nameUI)+1;
                % Look up number of usages for function associated with current function call. If it equals 1 
                % then set length to just thew length of the function name and exclude the usage portion. 
                % If there are multiple usages then include the whole function call name length; 
                % that is, <function name>: <usage name>
                numUsages(iFcall) = obj.reg.GetNumUsages(obj.fcalls(iFcall).GetName());
                if numUsages(iFcall) > 1
                    lenName = length(obj.fcalls(iFcall).GetUsageName());
                else
                    lenName = length(obj.fcalls(iFcall).GetName());
                end
                
                % If current usage name string length is greater than maxnamelen then set maxnamelen 
                % to current usage name string length 
                if lenName > maxnamelen
                    maxnamelen = lenName+1;
                end                
            end
        end
+6 −0
Original line number Diff line number Diff line
@@ -367,6 +367,12 @@ classdef FuncRegClass < matlab.mixin.Copyable
        end
        
        
        % ----------------------------------------------------------------------------------
        function n = GetNumUsages(obj, funcname)
            n = length(obj.GetUsageNames(funcname));
        end
        
        
        % ----------------------------------------------------------------------------------
        function usagestr = GetUsageStrDecorated(obj, funcname, usageparam)
            usagestr = '';
+6 −0
Original line number Diff line number Diff line
@@ -476,6 +476,12 @@ classdef FuncRegEntryClass < matlab.mixin.Copyable
        end
        
        
        % ----------------------------------------------------------------------------------
        function n = GetNumUsages(obj)
            n = length(obj.GetUsageNames(obj));
        end
        
        
        % ----------------------------------------------------------------------------------
        function fcallstr = GetFuncCallsEncoded(obj, fcall)
            fcallstr = '';
+19 −0
Original line number Diff line number Diff line
@@ -310,6 +310,25 @@ classdef RegistriesClass < handle
        
        
        
        % ----------------------------------------------------------------------------------
        function n = GetNumUsages(obj, funcname)
            n = [];
            if isempty(obj)
                return;
            end
            if nargin<2
                return;
            end
            for ii = 1:length(obj.funcReg)
                n = obj.funcReg(ii).GetNumUsages(funcname);
                if n>0
                    break;
                end
            end
        end
       
        
        
        % ----------------------------------------------------------------------------------
        function Import(obj, funcpath)
            [~, fname, ext] = fileparts(funcpath);            
+11 −3
Original line number Diff line number Diff line
@@ -264,9 +264,12 @@ p = get(hObject, 'position');
fs = 1.5; 

% Position/dimensions in the X direction
[Xsf, numUsages] = ps.GetMaxCallNameLength();
Xsp              = ps.GetMaxParamNameLength();

a     = 2;
Xsf   = ps.GetMaxCallNameLength()*fs;
Xsp   = ps.GetMaxParamNameLength()*fs;
Xsf   = Xsf * fs;
Xsp   = Xsp * fs;
Xse   = 20;
Xsb   = 10;
Xp1   = Xsf + a;
@@ -306,8 +309,13 @@ for k = 1:nFcalls
                                    'enable','off');
    % Draw function call
    p(end+1,:) = [a, Ypfk, Xsf, Ys];
    if numUsages(k)>1
        fcallname = fcalls(k).GetUsageName();
    else
        fcallname = fcalls(k).GetName();
    end
    h(end+1,:) = uicontrol(hObject, 'style','text', 'units','characters', 'horizontalalignment','left', ...
                                    'units','characters', 'position',p(end,:), 'string',fcalls(k).GetUsageName(), ...
                                    'units','characters', 'position',p(end,:), 'string',fcallname, ...
                                    'BackgroundColor',bgc, 'ForegroundColor',fgc, ...
                                    'tooltipstring',fcalls(k).GetHelp());
    
Loading