lukos / simsig_importer

.Net Desktop Application for converting Excel simplified timetables into Simsig timetables
GNU General Public License v3.0
3 stars 1 forks source link

Use / allow UIDs for activities #69

Open JDeeth opened 1 year ago

JDeeth commented 1 year ago

Would it be possible to specify trains by UID as well as via TRN (train reporting number / ID / headcode)?

The difference is the XML field is named AssociatedUID vs AssociatedTrain:

<Activity>
  <Activity>0</Activity>
  <AssociatedTrain>0Z02</AssociatedTrain>
</Activity>
<Activity>
  <Activity>0</Activity>
  <AssociatedUID>0Z03-UID</AssociatedUID>
</Activity>

Perhaps the user could explicitly indicate a UID by prefixing with a $, as done here in the SimSig UI:

image

e.g.

image

Alternatively and more immediately... could just replace AssociatedTrain with AssociatedUID and make it mandatory to specify UIDs for activities... which could just be the TRN if it's unique anyway. However this would be a breaking change.

The workaround is to consistently use UIDs in the spreadsheet, extract the XML from the exported .wtt/.zip, find and replace AssociatedTrain with AssociatedUID and put back into the .zip/.wtt.

(On a side note - sorry for the flood of tickets - I'd be forking and fixing and submitting hopefully useful pull requests but my knowledge of Visual Studio / C# is insufficient to fix what's probably a trivial mismatched library error when I get to file IO, so I cannot test my changes!)