Changeset 243

Show
Ignore:
Timestamp:
08/28/08 22:21:45 (5 years ago)
Author:
telle
Message:

some bugfixes in property assignment

Location:
branches/telle/RWTHMindstormsNXT
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/telle/RWTHMindstormsNXT/@NXTmotor/set.m

    r218 r243  
    5757            case 'Port' 
    5858                if isscalar(val) && isnumeric(val) && val >= 0 && val <= 2 
    59                     obj.port = val; 
     59                    obj.data('port', val); 
    6060                elseif ischar(val) 
    6161                    val = lower(val); 
     
    6666                            obj.data('port', 1); 
    6767                        case 'c' 
    68                             obj.closure('port', 2); 
     68                            obj.data('port', 2); 
    6969                        otherwise 
    7070                            error('MotorSettingError:InvalidPort',... 
  • branches/telle/RWTHMindstormsNXT/@NXTmotorsettings/private/applyProperties.m

    r222 r243  
    1212    end 
    1313 
    14     if ischar(val) 
     14    if ischar(val) && (strcmp(prop,'Port') == 0) 
    1515        val = {val}; 
    1616    end 
    1717     
    1818    switch prop 
     19        case 'Port' 
     20            setProperty(data.motors, 'Port', val); 
    1921        case 'Power' 
    2022            setProperty(data.motors, 'Power', val); 
     
    5557        'Number of elements must be 1 or the number of motors.'); 
    5658end 
     59 
    5760if iscell(val) 
    5861    for k = 1:length(motors)