Cancel
Showing results for 
Search instead for 
Did you mean: 

Bangsow example - Loading and unloading trains

http://www.bangsow.de/detail_en.php?id=631

 

Hi everybody...

 

I'm working in a model similar with this Bangsow example.

I have one doubt, where these two methods are inserted?

 

2 REPLIES

Re: Bangsow example - Loading and unloading trains

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Hello Gabriela,

 

Method_loading is the observer method of the variable start_loading and Method_unloading is the observer method of start_unloading (tools - Edit Observers...). The change of the values of the variables is triggered in the sensorControl of the track.

 

You can find the description of this example in my new book starting from page 345.

 

Best Regards,

 

Steffen

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Bangsow example - Loading and unloading trains

Steffen, 

please help me in another case, it's attached here.

 

 I have two problems: the first is in transporter called "trem", my attribute "collisionControl" doesn't work correctly. I intend that "trem" coupling in others transporters called "prancha".

 

is
    i:integer;
    fzg:object;
do    
  
    if self.~.backwards then
        
        fzg:=self.~;
        for i:=1 to self.~.num_pranchas loop
        -- is there a transporter
            if not isVoid(fzg.rearMU) then
                fzg.rearMU.hitchFront;
                fzg:=fzg.rearMU;
            else
                exitloop;
            end;                    
        next;        
                    
        wait(self.~.hookTime);    
        self.~.backwards:=false;
        self.~.stopped:=false;
    end;    
end;

 

The second error is in method of track

 

(SensorID : integer; Bug : boolean)
is
do
    -- let pass the tractor
    if not @.istrem then
        -- in a train only the tractor can stop
        @.gettrem.stopped:=true;
        if sensorID= 1 then
            waituntil load.occupied prio 1;
            load.cont.move(@);
        elseif sensorID =2 then
            waituntil unload.empty prio 1;
            @.cont.move(unload);
        end;
        @.gettrem.stopped:=false;
    end;
end;