Elvas Tower: Time qualifier /closeup - Elvas Tower

Jump to content

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

Time qualifier /closeup Rate Topic: -----

#1 User is offline   Buttercup 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 426
  • Joined: 24-July 08
  • Gender:Male
  • Country:

Posted 30 December 2020 - 11:58 AM

/closeup qualifier not working with $triggers dispose command in Monogame version 84. It works OK with $forms dispose command. I also checked Monogame 81 and it is not working there either.

#2 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 30 December 2020 - 01:14 PM

Eric,
does it work in the Unstable release?

#3 User is offline   Buttercup 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 426
  • Joined: 24-July 08
  • Gender:Male
  • Country:

Posted 30 December 2020 - 02:32 PM

/closeup does not work with $triggers in the x1.3.1-275-ga389bc7c2 release. I have not used this combination before so I am not sure when or if it did in previous versions. According to the manual it should work with $forms, $static, and $triggers.

#4 User is offline   Buttercup 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 426
  • Joined: 24-July 08
  • Gender:Male
  • Country:

Posted 01 January 2021 - 11:38 AM

I found this in the code of C#ProcessTimetable starting on line 3736 and ending on line 3796. There is an "if" for .TerminationFormed. Should there be a corresponding "if" for .TerminationTriggered?

switch (typeOfDispose)
{
case DisposeType.Forms:
case DisposeType.Triggers:
FormedTrain = String.Copy(trainCommands.CommandValues[0]);
FormType = formType;
FormTrain = true;

if (trainCommands.CommandQualifiers != null && formType == TTTrain.FormCommand.TerminationFormed)
{
foreach (TTTrainCommands.TTTrainComQualifiers formedTrainQualifiers in trainCommands.CommandQualifiers)
{
if (String.Compare(formedTrainQualifiers.QualifierName, "runround") == 0)
{
RunRound = true;
RunRoundPath = String.Copy(formedTrainQualifiers.QualifierValues[0]);
RunRoundTime = -1;
}

if (String.Compare(formedTrainQualifiers.QualifierName, "rrtime") == 0)
{
TimeSpan RRSpan;
TimeSpan.TryParse(formedTrainQualifiers.QualifierValues[0], out RRSpan);
RunRoundTime = Convert.ToInt32(RRSpan.TotalSeconds);
}

if (String.Compare(formedTrainQualifiers.QualifierName, "setstop") == 0)
{
SetStop = true;
}

if (String.Compare(formedTrainQualifiers.QualifierName, "atstation") == 0)
{
FormsAtStation = true;
}

if (String.Compare(formedTrainQualifiers.QualifierName, "closeup") == 0)
{
Closeup = true;
}

if (String.Compare(formedTrainQualifiers.QualifierName, "speed") == 0)
{
try
{
DisposeSpeed = Convert.ToSingle(formedTrainQualifiers.QualifierValues[0]);
}
catch
{
Trace.TraceInformation("Train : {0} : invalid value for runround speed : {1} \n", trainName, formedTrainQualifiers.QualifierValues[0]);
}
}
}
}

// reset speed if runround is not set
if (!RunRound && DisposeSpeed != null)
{
DisposeSpeed = null;
}
break;
// end of Forms and Triggers

#5 User is offline   Buttercup 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 426
  • Joined: 24-July 08
  • Gender:Male
  • Country:

Posted 02 January 2021 - 08:41 AM

Unfortunately I am not a programmer and can not try this fix to the timetable code listed in message #4. Looking through the source code I think this change may get the /closeup qualifier and apparently other qualifiers to work with the $triggers command.

Replace line: if (trainCommands.CommandQualifiers != null && formType == TTTrain.FormCommand.TerminationFormed)


with this: if (trainCommands.CommandQualifiers != null && formType == TTTrain.FormCommand.TerminationFormed || trainCommands.CommandQualifiers != null && formType == TTTrain.FormCommand.TerminationTriggered)


I would be happy to test it if someone could make the change.

#6 User is offline   Buttercup 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 426
  • Joined: 24-July 08
  • Gender:Male
  • Country:

Posted 07 January 2021 - 01:16 PM

Should I report this as a bug? I sent a message to Rob and he said my fix is correct but that he can not make the code change because his version is out of date.

#7 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 08 January 2021 - 01:24 AM

Yes, a bug report would be very helpful!

If you can handle Visual Studio, you could make and test that change yourself, and possibly even file a pull request to include your change in the main branch. Otherwise, one of us could make the change on your behalf...

#8 User is offline   Buttercup 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 426
  • Joined: 24-July 08
  • Gender:Male
  • Country:

Posted 08 January 2021 - 03:27 AM

I'll make a bug report. I can only view the code as I don't know how to make changes to it.

#9 User is offline   mbm_OR 

  • Fireman
  • Group: Status: Active Member
  • Posts: 236
  • Joined: 03-July 15
  • Gender:Male
  • Location:Spain
  • Simulator:Open Rails
  • Country:

Posted 18 January 2021 - 02:04 PM

 Buttercup, on 08 January 2021 - 03:27 AM, said:

I'll make a bug report. I can only view the code as I don't know how to make changes to it.

Hi Eric,

The Unstable release U2021.01.18-1921 includes your changes.
Please, could you test it?.

Regards,
Mauricio

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