Elvas Tower: CallOn - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

CallOn

#11 User is offline   ebnertra000 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,234
  • Joined: 27-February 17
  • Gender:Male
  • Location:East-Central Minnesota
  • Simulator:OR/TSRE
  • Country:

Posted 18 October 2021 - 04:07 PM

Mick,

The signal type in question will need to have STOP_AND_PROCEED listed as an aspect in the sigcfg file if the scripts reference it

#12 User is offline   Matej Pacha 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 571
  • Joined: 08-December 10
  • Gender:Male
  • Location:Slovakia
  • Country:

Posted 06 December 2022 - 02:24 AM

Hi,
Let me use this thread to open my question:
I'm playing a little bit with the TT concept. My TT is designed for a Czech route Breclav - Praha, which works with activities well. There are some TTs out already, but I'm trying to make my own.
The situation I'm struggling with is:
A train stops at a station, detaches its locomotive from one end and the 2nd locomotive is supposed to pickup the train from another end and leave.
I believe the issue is with the signaling. The 2nd locomotive stops at the signal, not going further to pickup the train.
So I tried to use the callon command and edit the signal script. Apparently, the TrainHasCallOn() part of the script works, because I can see the change of the signal light. If I comment that part out, the signal doesn't change.
However, in the dispatcher window, I see the light has changed, but the signal state remains at STOP.
https://github.com/matejpacha/or_timetables/blob/main/Trat225/Misc/ttControl.jpg?raw=true
I can change the signal manually and the signal state changes, followed by the 2nd locomotive starts to move.
https://raw.githubusercontent.com/matejpacha/or_timetables/main/Trat225/Misc/manualControl.jpg
Now, how can I modify the script (which is probably the problem) to make it working without a manual interaction?
SCRIPT NAV7A

	extern float	this_sig_lr ();
	extern float	sig_feature ();
	extern float	state;
	extern float	draw_state;

	extern float block_state();
	extern float route_set();
	extern float def_draw_state();
	extern float sig_feature();
	extern float enabled;
	extern float TrainHasCallOn();

	float			this_nor;
	float			this_rep;
	float			this_dis;
	this_nor = this_sig_lr (SIGFN_NORMAL);
	this_rep = this_sig_lr (SIGFN_REPEATER);
	this_dis = this_sig_lr (SIGFN_DISTANCE);

	state = this_nor;
	
	if ((block_state () == #BLOCK_OCCUPIED) && TrainHasCallOn())
	{
		state = #SIGASP_CLEAR_2;
		draw_state = 3;
	}
	else if ( this_nor ==# 0 )
	{
		if ( this_rep ==# -1 )
		draw_state = 0;
		else draw_state = 1;
	}
	else if ( this_nor ==# 1 )
	{
		if ( !sig_feature (SIGFEAT_USER4) )
		{
			if ( this_rep ==# -1 )
			draw_state = 2;
			else draw_state = 3;
		}
		else
		{
			if ( this_rep ==# -1 )
			draw_state = 4;
			else draw_state = 5;
		}
	}
	else if ( this_nor ==# 2 )
	{
		draw_state = 15;
	}
	else if ( this_nor ==# 3 )
	{
		if ( this_dis !=# -1 )
		draw_state = 6;
		else draw_state = 7;
	}
	else if ( this_nor ==# 4 )
	{
		if ( this_dis !=# -1 )
		draw_state = 8;
		else draw_state = 9;
	}
	else if ( this_nor ==# 5 )
	{
		if ( this_dis !=# -1 )
		draw_state = 10;
		else draw_state = 11;
	}
	else if ( this_nor ==# 6 )
	{
		if ( this_dis !=# -1 )
		draw_state = 12;
		else draw_state = 13;
	}
	else if ( this_nor ==# 7 )
	{
		if ( this_dis ==# -1 )
		draw_state = 14;
		else draw_state = 15;
	}
	else
	{
		state = 8;
		draw_state = 15;
	}




#13 User is offline   Matej Pacha 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 571
  • Joined: 08-December 10
  • Gender:Male
  • Location:Slovakia
  • Country:

Posted 18 December 2022 - 04:03 AM

Problem solved - as you can see, more than one signal is defined for each physical signal. Therefore, the callon script must be added to more signal scripts.

  • 2 Pages +
  • 1
  • 2
  • 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