Week ending 19th August 2017 – Final software phase

Glossary

Conductor – person in charge of the train (UK equivalent – Guard).
Dispatcher – person in overall control of train movements over a railroad division
Division – Track between two major yards of a railroad.
Hostler – person that operates a loco within a yard and builds trains as required.

Sunday/Monday 13th/14th August

This was a difficult and frantic period where I “had” to get the car allocation software working. Having cleared all of the hang overs from the data import issue, this period was spent carefully stepping through each of the train types ensuring that car allocations were being made in an appropriate manner for each type. Finally, this was completed and the software was versioned off. There are a few, very minor, issues that I will deal with as an epilogue once the report is complete.

Tuesday 15th August

The day was spent working on the visual interface for the tablet software. I decided that the best way to display each train makeup was to recreate prototype railroad switch lists and train orders. Switch lists given to”conductors” of freight trains and/or the freight yard “hostlers” indicating the make up of each train. Train orders are used by railroad “dispatchers” to authorise trains to use the track between “division points”.

Switch List

Train Order

To do this, it is necessary to know the home railroad of each train. As the test system includes trains from three railroads, it was necessary to add a new data topic to the database – “railroad”. This comprises details of:
Railroad Name
Railroad URL “the railroad logo”
Railroad Initials.

The Smalltalk software is quickly and easily amended to create and utilise a new Riak bucket for the user comprising of list of these railroads. The JavaScript was then updated to display the headers. The mock up looks like this (created in iMac Komposer):

I do not know how to use JavaScript to create tables with merged cells (required for this) so, by using Komposer I was able to list out the HTML code and recreate this in a javaScript method – sorry, function.

<table style="text-align: left; width: 100%;" border="1" 
cellpadding="2"
cellspacing="2" frame="box" rules="none">
<tbody>
<tr>
<td colspan="3" rowspan="1"
style="vertical-align: top; text-align: center;">Sunset and North
Eastern Railroad</td>
<td colspan="1" rowspan="3" style="vertical-align: top;"><img
style="width: 166px; height: 62px;" alt=""
src="http://www.tm470routingproject.co.uk/images/snelogo.png"></td>
</tr>
<tr>
<td style="vertical-align: top;">Train: SNE1</td>
<td colspan="2" rowspan="1" style="vertical-align: top;">Date:
15th August 2017</td>
</tr>
<tr>
<td style="vertical-align: top;">Engine: SNE1441</td>
<td style="vertical-align: top;">Type: EMD f7a</td>
<td style="vertical-align: top;"> DCC ID: 1441</td>
</tr>
</tbody>
</table>

The JavaScript (with data hard coded) looks like this:

function switchListHeader(switchData) {

var swText = "";

swText = "<table style=\"text-align: left; width: 100%;\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\" frame=\"box\" rules=\"none\">";
 swText = swText + "<tbody><tr><td colspan=\"3\" rowspan=\"1\" style=\"vertical-align: top; text-align: center;\">Sunset and North Eastern Railroad</td>";
 swText = swText + "<td colspan=\"1\" rowspan=\"3\" style=\"vertical-align: top;\"><img style=\"width: 166px;\" alt=\"\" src=\"http://www.tm470routingproject.co.uk/images/snelogo.png\"></td>";
 swText = swText + "</tr><tr><td style=\"vertical-align: top;\">Train: SNE1</td><td colspan=\"2\" rowspan=\"1\" style=\"vertical-align: top;\">Date:15th August 2017</td></tr>";
 swText = swText + "<tr><td style=\"vertical-align: top;\">Engine: SNE1441</td><td style=\"vertical-align: top;\">Type: EMD f7a</td><td style=\"vertical-align: top;\"> DCC ID: 1441</td></tr>";
 swText = swText + "</tbody></table>";
 return swText;
}

(The above panel scrolls so that you can see all of the code in line). swText is the HTML to display the above switch list. Not nice but functional.  The hard coded data is highlighted. I now need use the railroad data to make a list of objects that can be fed into this function. That is my task when I get back to this on Thursday.

Thursday 17th August – Saturday 19th August

The time went in a blur. I felt as though I was on a home run. However, as is the way with software, it all came back to bite me. Firstly, I had an issue when versioning off some of the new Smalltalk code. Rather than explore what the problem was, I thought that I had solved it quickly when in fact I had thrown the version away. I have been using the Envy code repository built into VisualAge Smalltalk ever since 1994 so I ought to know what I am doing. Anyway, when I came back to it on Thursday there was absolute chaos and nothing worked as it should. I must be getting old because, instead of investigating, I started to make a few (HA!) changes before I realised that something crucial was missing. Having was ted most of the day, Found out in time and was able to recover the missing code. One of the nice things about Envy is that every single change is recorded so you can go back a step at a time, even down to individual method code. Finally, close to late evening, I got it all back and sorted. Saturday was even worse as I was having trouble with differences in structures of list of cars between various train types. I did classic mistake and started changing the code against what I was seeing rather than examining the changes over all the types. As a consequence, as I changed the second train type, I messed up the first, and so on! Spoiler alert! – This didn’t get any better on Sunday .

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s