image thumbnail

Using Model-Based Design for Vehicle Electronics Applications

by

 

29 Aug 2006 (Updated )

This ZIP-file contains the presentation and power window model that was used in the MathWorks webina

mech_interface_portSup(hPort)
function mech_interface_portSup(hPort)  

block = get(hPort,'Parent');
hParent = get_param(block,'handle');

[primList,isConnected,hJointBlk,retStatus] = pmJointInfo (hParent,'RConn1');

class_name = get(hParent,'ClassName');
popup_str = 'popup(';
switch(lower(class_name))
    case 'prismatictranslationalinterface'
        for(i=1:1:length(primList))
            if( strcmpi(primList(i).Type,'prismatic') )
                 popup_str = strcat(popup_str,primList(i).Name,'|');
            end
        end
    case 'revoluterotationalinterface'
        for(i=1:1:length(primList))
            if( strcmpi(primList(i).Type,'revolute') )
                 popup_str = strcat(popup_str,primList(i).Name,'|');
            end
        end
end

if(popup_str(end)=='|')
    popup_str(end) = ')';
else
    popup_str(end+1) = ')';
end
mask_style_str = strcat('edit,edit,',popup_str,',edit');
old_style_str = get(hParent,'MaskStyleString');

if(~strcmpi(old_style_str,mask_style_str))
    set(hParent,'MaskStyleString',mask_style_str);
    if(~strcmpi(mask_style_str,'edit,edit,popup(),edit'))
        set(hParent,'MaskVisibilityString','off,off,on,off');
    else
        set(hParent,'MaskVisibilityString','off,off,off,off');
    end
end

Contact us