Elvas Tower: Back to basics - Approach control for one diverging route - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Back to basics - Approach control for one diverging route Rate Topic: -----

#1 User is offline   Coolhand101 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 998
  • Joined: 13-June 15
  • Gender:Male
  • Simulator:MSTS
  • Country:

Posted 25 March 2022 - 01:11 PM

Looks like I need some help with this and have to go back to basics for approach control to be set only for a diverging route.

1. If the signal is set for the main route = No approach control
2. If the signal is set for a diverging route = approach control is used.

The signal in question is a 4 colour light aspect with one route indicator and is one shape and one script. This is the default signal script. Can this script be used for approach control as above? For clarity, Approach_CONTROL_Position will only be used! Thanks for any assistance!

SCRIPT BRCL-4A-RIR

// BR Colour Light 4 Aspect Right RI

	extern float	block_state ();
	extern float	route_set ();
	extern float	next_sig_lr ();
	extern float	def_draw_state ();
	extern float	state;
	extern float	draw_state;
	extern float	enabled;
	float			next_state;

// If required, show the 'stop' indication.
	if (!enabled ||								// Not enabled/cleared to show natural state?
		block_state() !=# BLOCK_CLEAR)				// Block ahead not clear?
	{
		state = SIGASP_STOP;
	}
// Signal head is enabled and the block ahead is clear - update based on state of
// next signal head.
	else
	{
		next_state = next_sig_lr (SIGFN_NORMAL);

		if (next_state ==# SIGASP_STOP ||
			next_state ==# SIGASP_STOP_AND_PROCEED ||
			next_state ==# SIGASP_RESTRICTING)
		{
			state = SIGASP_APPROACH_1;
		}
		else if (next_state ==# SIGASP_APPROACH_1)
		{
			state = SIGASP_APPROACH_2;
		}
		else //if (next_state ==# SIGASP_APPROACH_2 ||
			//	next_state ==# SIGASP_CLEAR_2)
		{
			state = SIGASP_CLEAR_2;
		}
	}

// Get draw state
	draw_state = def_draw_state (state);

	if (state ==# SIGASP_APPROACH_1 &&
		route_set())
	{
		draw_state = 4;		// (Draw state index from signal config)
	}
	else if (state ==# SIGASP_APPROACH_2 &&
		route_set())
	{
		draw_state = 5;		// (Draw state index from signal config)
	}
	else if (state ==# SIGASP_CLEAR_2 &&
		route_set())
	{
		draw_state = 6;		// (Draw state index from signal config)
	}


#2 User is offline   Coolhand101 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 998
  • Joined: 13-June 15
  • Gender:Male
  • Simulator:MSTS
  • Country:

Posted 25 March 2022 - 04:41 PM

Well maybe I didn't need to go that far back.
My modified script seems to give me the above requirement. Can someone just double check to make sure nothing else in this signal script has changed by this amendment? :-

snip...................
            state = SIGASP_CLEAR_2;
	    }
            if (route_set())
            {
             if (!Approach_CONTROL_Position(150)) 
             {
             state = SIGASP_STOP;
            }
        }
   }

 // Get draw state
        draw_state = def_draw_state (state);
Snip....................


Also I have just use this script in activity that was causing a serious deadlock and sometimes caused OR to come to a complete grinding stop. So it appears this new script works. Just need a few confirmations on the above amendment is indeed correct?


Thanks

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users