Code covered by the BSD License  

Highlights from
SAE Paper Demo: Model-Based Design of Hybrid Electric Vehicles

image thumbnail

SAE Paper Demo: Model-Based Design of Hybrid Electric Vehicles

by

 

07 Nov 2010 (Updated )

Demo files to accompany the paper by the same name

timerFcn(obj,event,hcarGUI,order,dir)
function timerFcn(obj,event,hcarGUI,order,dir)

global index END
arrows = getappdata(hcarGUI,'arrows');

if(~isempty(order))
    parallelArrows = order{index};
    parallelArrowsDir = dir{index};
else
    parallelArrows = [];
    parallelArrowsDir = [];
end

if(isempty(END))
    END = false(length(parallelArrows),1);
    if(index==1)
        arrows = hideSquares(arrows);
    end
end
    
for(j=1:1:length(parallelArrows))
    if(not(END(j)))
        switch(parallelArrows(j))
            case 1
                arrows.arr_gen_bat = setArrowDir(arrows.arr_gen_bat,parallelArrowsDir(j));
                [arrows.arr_gen_bat,END(j)] = highlightNext(arrows.arr_gen_bat);
            case 2
                arrows.arr_bat_mot = setArrowDir(arrows.arr_bat_mot,parallelArrowsDir(j));
                [arrows.arr_bat_mot,END(j)] = highlightNext(arrows.arr_bat_mot);
            case 3
                arrows.arr_mot_ring = setArrowDir(arrows.arr_mot_ring,parallelArrowsDir(j));
                [arrows.arr_mot_ring,END(j)] = highlightNext(arrows.arr_mot_ring);
            case 4
                arrows.arr_sun_gen = setArrowDir(arrows.arr_sun_gen,parallelArrowsDir(j));
                [arrows.arr_sun_gen,END(j)] = highlightNext(arrows.arr_sun_gen);
            case 5
                arrows.arr_eng_pla = setArrowDir(arrows.arr_eng_pla,parallelArrowsDir(j));
                [arrows.arr_eng_pla,END(j)] = highlightNext(arrows.arr_eng_pla);
           case 6
                arrows.arr_ring_diff = setArrowDir(arrows.arr_ring_diff,parallelArrowsDir(j));
                [arrows.arr_ring_diff,END(j)] = highlightNext(arrows.arr_ring_diff);
            case 7
                arrows.arr_diff_ltir = setArrowDir(arrows.arr_diff_ltir,parallelArrowsDir(j));
                [arrows.arr_diff_ltir,END(j)] = highlightNext(arrows.arr_diff_ltir);
            case 8
                arrows.arr_diff_rtir = setArrowDir(arrows.arr_diff_rtir,parallelArrowsDir(j));
                [arrows.arr_diff_rtir,END(j)] = highlightNext(arrows.arr_diff_rtir);
            case 9
                arrows.arr_gen_mot = setArrowDir(arrows.arr_gen_mot,parallelArrowsDir(j));
                [arrows.arr_gen_mot,END(j)] = highlightNext(arrows.arr_gen_mot);
            otherwise

        end
    end
end
    
if(~any(not(END)))
    if(index==length(order))
        index=1;
        END = [];
    else
        index=index+1;
        END = [];
    end
end
    
setappdata(hcarGUI,'arrows',arrows);
%end function

Contact us