copperpen, on 03 March 2014 - 01:27 PM, said:
I am not sure my crash has the same cause. GetTrainInfo seems to be failing in this instance, possibly because OR cannot place train 23 and so fails on the total train count. The activity will run without the F4 window but without that, speed limits are invisible and signal aspects are not that easy to see.
I can assure you that the problem with train 23 has nothing to do with this, train 23 simply never becomes a real 'train'. There is also no such thing as a 'total train count'. The crash in F4 occurs when it attempts to sort the information on distance - an invalid distance value in one of the items in this list would cause this to crash.
dennisat, on 03 March 2014 - 02:19 PM, said:
The method is "splitSection" in "signals.cs". I added a test (float.isNaN) to the existing tests for very small numbers. The lists being scanned to calculate the distance of the train from a track object must be ultimately derived from TDB data. I haven't dug any further yet.
If you throw an exception when an invalid value is found [ using
throw new InvalidDataException("...") ], the program will crash but it will generate a call dump, which will tell where the method was called. This will indicate if the invalid position comes from a signal or a cross-over, as the method is called in the processing of both these items.
When it is known where the method was called when an invalid number occurs, trace statements can be added at that location which dump the ident of the item being processed to the log-file. The last item before the crash is the one which is probably causing the problems.
Regards,
Rob Roeterdink