Figure 1: An Example csv File in the Terminal Text Editor: vi
The order that the Metrology Simulator plays back the csv files is not guaranteed. If order is important then a director file with the name: “metsimdirector.txt” should be created and placed in the directory: “/usr/share/itron”. This file should contain a list of the csv file names including the path, separated by the Line Feed (newline) character. The Metrology Simulator will then play back the csv files in the order that they appear in this file. Figure 2 contains an example of a director file.
Figure 2: An Example of a Director File in the Terminal Text Editor: vi
Using the Metrology Simulator
The script that runs the Reference Agent, “host_run.sh”, deletes all the files present in the: “/usr/share/itron/metsimfiles” directory and then copies any files present in the: “~/DistributedIntelligence/source/Agents/ThirdPartyReferenceAgent/TestCsv” directory to the: “/usr/share/itron/metsimfiles” directory. To enable the continuing use of this script and to facilitate the use of a director file the following steps are suggested:
-
ssh to the Ubuntu VM as user: “dev”
-
Create a separate directory to contain the director file using: “mkdir ~/DistributedIntelligence/source/Agents/MetrologySimulator”
-
Create a subdirectory to contain the csv files: “mkdir ~/DistributedIntelligence/source/Agents/MetrologySimulator/metsimfiles”
-
Remove the existing “TestCsv” directory using: “rm -rf ~/DistributedIntelligence/source/Agents/ThirdPartyReferenceAgent/TestCsv”
-
Create a new soft link using: “ln -s ~/DistributedIntelligence/source/Agents/MetrologySimulator/metsimfiles ~/DistributedIntelligence/source/Agents/ThirdPartyReferenceAgent/TestCsv”
-
Create (or place) the director file: “metsimdirector.txt” in the “~/DistributedIntelligence/source/Agents/MetrologySimulator” directory
-
Create a new soft link using: “sudo ln -s ~/DistributedIntelligence/source/Agents/MetrologySimulator/metsimdirector.txt /usr/share/itron/metsimdirector.txt”
-
Create (or place) the csv files in the “~/DistributedIntelligence/source/Agents/MetrologySimulator/metsimfiles” directory
-
Navigate to the “ThirdPartyReferenceAgent” directory using: “cd ~/DistributedIntelligence/source/Agents/ThirdPartyReferenceAgent”
-
Test by running the Reference Agent using: “sudo ./host_run.sh”. The results of a successful run are as per Figure 3.
Figure 3: A Terminal Window after Successfully Running the Metrology Simulator and Reference Agent
Available LIDs
Refer to the page DI available LIDs which contains a list of all the available Logical IDs (aka "LIDs”).