Search The Inn

Saturday, February 3, 2024

Importing/Exporting Roster Entries with JMRI

There has recently been a bit of discussion on the various decoder groups.io forums concerning the ability or non-ability of JMRI to import or export roster entries or complete rosters. This is a discussion of what can be done and what cannot be done. We will also briefly talk about the EsuProgrammer and what it can do and can not do.

JMRI File Menu

The File menu contains several different import/export roster operations. See fig 1.


Fig.1 Roster import/export operations

The export operation for a single roster entry will generate an XML file with the default name of the roster ID field followed by .xml. It will allow you to change the name if you wish. The import operation expects to see a previously exported entry or one you have created. You had better be an expert with xml and know the file's required layout before you attempt this. It will be a lot of work (masochist principle applies).

The Export Complete Roster operation will generate a zip file of all the individual roster files. You can see this by generating the export file and examining it with a utility such as 7zip. 

This is the backup file the author puts into the cloud for safe keeping in the event of a catastrophic computer failure. He also keeps a copy on a local thumb drive. Just don't forget to update those backup files in the event of a change to the roster.

JMRI Roster Entries

Individual roster entries also have import/export operations in their File menu. These open to a selection of operations that can be performed on various files including CSV files. See fig 2.

Fig.2 Roster entry export choices

In the event you wish to create a CSV file of a particular type, the key to doing it correctly is to examine an exported file. This will show you the format JMRI is expecting to see on import. Remember also that different decoders export different formats so, just be sure the exported, modified values can be used by the decoder you are importing into.

The last export method by JMRI is accomplished by utilizing a script file that comes with JMRI. It exports a CSV file of the complete roster that allows you to import the roster into a database or spreadsheet. A complete discussion of this process is discussed here. Remember, this process is for external analysis.

ESU

The ESU LokProgrammer has the ability to generate a text file of all CVs for any LokSound decoder. It is even possible to generate a CV file if you don't have the programmer itself. The LokProgrammer software is a free download (as are the sound files) which is all you need to generate the CV file for a particular sound file. There is a complete discussion of the process here.

Could you create one of these files from scratch? Yes, you could but why would you want to do so (if the masochist principle applies, the author will step aside)? To repeat, the software and files are free to download. 

Anytime the human element is introduced in even a mildly complicated process the chances of a less than optimal outcome increase exponentially.


If you have an idea for a blog post here, let me know. If I can comment on it, I will or I'll see if someone else can and post it.

No comments:

Post a Comment