Introduction
Have you ever wished that you could have different display setups in ECMLink that each have their own included items, fonts, colors, and graph properties...and be able to switch between them with a single mouse click? You can...and in this article I'll show you how.
You'll be able to easily switch from something like this:
to something like this:
...with a single (ehhhh... double) click of the mouse.
To accomplish this, we'll be tapping into the Windows registry where all of ECMLink's settings are stored. The basic idea consists of exporting the relevant registry keys to a file, making a small modification to it, and then double-clicking the file to restore the saved settings when desired.
NOTE: This article only applies to ECMLink running on MS Windows; those of you running on a Mac are on your own. You will also need to have administrative privileges, and access to a folder that has full read/write permissions to perform the steps below. (I would suggest storing the configuration files we will be creating on the desktop, or in a folder on the desktop).
This might appear to be complicated at first, but at the end of the article I'll condense everything down and you'll see just how simple it actually is.
What I describe in this article works great for me, but YMMV. I'm using Windows 7 , and ECMLink V3 (full) version 3.22.172; other OS or ECMLink versions may be slightly different, so pay attention and look everything over before jumping straight in head-first. As always, be sure to back up all of your files and have a contingency plan in case something goes horribly wrong and you end up disfigured for life.
Setting Up ECMLink
Setting up ECMLink for this doesn't involve anything more than getting things arranged like you want. Select the items to display, get them arranged the way you want, and set the font color, size, line style, and any other attributes as desired. For more information on optimizing ECMLink's display, you may want to check out this article.
Once everything is the way you like it, right click on the graph legend and click "Set all default preferences", and exit ECMLink. That's it!
The Windows Registry
Most people cringe at the thought of modifying (or even looking at) the Windows registry, but it's really not as bad as it's been made out to be. In fact, with even a little common sense, making changes to the registry is just as safe as modifying anything else on the computer. In a nutshell, the registry is nothing more than a group of files that are used to store information about how your computer and it's software works. Rather than get into a lot of detail about it, I'll keep it short and sweet in this article. If you want to know more (a lot more) about it, this is one of many excellent pages on the subject.
Although modifying the Windows registry is very simple and straightforward, it also comes with the risk of corrupting your PC to the point of needing a complete reload of the OS if you are careless and don't pay attention to what you are doing. If you don't feel comfortable with that, then find someone who is, or find another project to occupy your time with. Don't edit the registry drunk or while driving, and DO THIS AT YOUR OWN RISK!
Ok, now that all of that is out of the way...let's get on with it!
Note: If you are familiar with the registry and know how to edit it, you can skip to the next section.
To access the registry, we use a tool called RegEdit (the actual program file is regedit.exe, and can be found in the Windows/System32 folder). To launch the editor, simply go to the Start menu and type "regedit" (without the quotes) into the search bar, and hit enter. In most cases, you'll then see the lovely Windows UAC dialog box, asking if you are sure you want to do what you are sure you want to do:
Click Yes, and something that looks like an evil twin of the file explorer should open. It will resemble the image below, unless it's been opened before and the trees are already expanded.
Those five "folders" you see are actually called "hives", or "root keys". Under each hive are keys and sub-keys, and each key contains a set of data and it's values. You navigate through the tree just like in file explorer; click the arrows to expand and collapse different branches and work your way deeper into it.
The editor allows you to do many things, such as add, delete, and change keys and data values, export entire sections, and merge external files into the registry. Those last two are important, as that is what allows us to do what we are wanting.
Where is My ECMLink Stuff?
For our purpose, we are only interested in one particular key, which is found under the HKEY_CURRENT_USER hive. To get to it, expand HKEY_CURRENT_USER, then Software > JavaSoft > Prefs > ecmtuning > ecmlink. If you see more sub-keys called "data", "device", "filenames", etc. under the ecmlink key, then you are in the right place. You should be seeing something that looks like the following. Note that I have expanded all of the sub-keys under the main ecmlink key...more on this in a minute.
If you spend a little time clicking on the various sub-keys under "ecmlink" and looking over the data in the right pane, you'll quickly start to see how and where all of those values that you assigned in ECMLink are stored. It's actually pretty straightforward... paths and file names are under the "filenames" key, information about your connection properties is under "device", etc.
Note: You could change any of the parameter values in regedit and then re-open ECMLink, and you would see the new values. We won't need to do this though and I wouldn't recommended it anyway; just change values in Link as usual and let it worry about storing them to the registry.
For the purpose of this article, we are only interested in one key, which is the "data" key. It's full path name would beMake a note of this, as we will be using it again.
Note: To be more accurate, we really only need the 'displayvalues" key and the "views" key to save and restore the display, but it's easier just to work with the whole data branch. If you need to do something more advanced, like change the display configuration while also doing something weird with the sensor definitions for example, keep this in mind.
Now that we know where the data is stored, how it's organized, and which key we need, all that is left is to save it for future use. Fortunately, regedit makes this extremely easy to do. With the "data" key highlighted, right-click on it and select "Export". You will then be presented with a standard dialog asking for a file name and where you want to save it. Pick a meaningful name and choose a location that makes sense. For this example, let's use "Display_1" for the filename, and save it to the desktop. Click "Save" and a file called "Display_1.reg" will be created that contains all of your modified ECMLink display settings. At this point you can close regedit.
Just one more little detail to address...
As it turns out, ECMLink only stores certain data if it has been changed; most default values are assumed and not explicitly stored in the registry. What this means is that if you try to merge a saved configuration back into the registry that contained default values, some of that data won't be replaced, since the defaults weren't exported to begin with, and the registry now contains changed values. To get around this, we need to completely delete the "data" key first, and then merge the saved file back into the registry. This has the net effect of resetting all the defaults along with our saved custom values. Fortunately for us, this is simply a matter of adding one line to our saved .reg file.
NOTE: You could also just manually delete the "data" key from within regedit each time before merging the exported file back in, but the following approach is much better and only has to be done once.
Open the .reg file in any plain-text editor by right-clicking on it and then selecting "Edit". At the top you should see a header line similar to Windows Registry Editor Version 5.00, followed by a bunch of registry keys. What we want to do is insert a line right after the header that deletes the entire "data" key before the other lines are merged. The line we need to add is:
Notice that this is the full path name to the "data" key inside brackets, with the addition of a hyphen (-) at the front of it. This tells regedit to first delete this key, and then merge the other lines into the registry when the .reg file is executed. The .reg file should look like this after you modify it (the inserted line is highlighted):
Save the file and close the editor, and your saved configuration file is ready to rock.
NOTE: Be careful if you use Wordpad or something other than Notepad to edit these files. Those other editors sometimes insert invisible formatting commands unless you specifically save the file as plain text.
Doing Something Useful
So we've saved our current ECMLink display settings to a file and modified it...now what? Well that depends on how creative you want to get. The simplest way to use this is to export the data key (don't forget to modify the file and add the line) for each layout that you create, using separate files for each. You can then simply double-click on whichever file you want to store them back into the registry, and then launch ECMLink as usual. If everything goes well, it will launch with the graph and legend configured exactly as it was when the configuration file was saved.
You creative types are probably seeing countless automation possibilities here. As you might expect, there is much, much more that you can do with this, including automating the export process, restoring settings each time ECMLink is launched, creating custom sensor setups, etc.
Wrapping It Up
So to condense all of this into something a little easier to follow...
To save ECMLink settings
1. Launch regedit from the start menu, and browse to the following key:
2. Right click on the "data" key, and click "Export", and save the file to a convenient location.
3. Open the saved file in notepad (right-click it and select "Edit"), and add the following line after the header line:
4. Save the file.
To restore ECMLink settings
1. Double-click the saved file, answer Yes to any UAC prompts, and the saved data will be merged back into the registry.
2. Open ECMLink as usual and your restored settings should be happenin'.
Over the next few days, I'll add some more information on how to set up batch files and maybe even create some "buttons" that will completely automate the export process described above.
Stay tuned!
EDIT: For some reason, spaces are showing up in certain places such as "\ecmtunin g\", even though it looks fine in the editor. We are working on it, but in the mean time please ignore those spaces and be careful about copying and pasting.
Have you ever wished that you could have different display setups in ECMLink that each have their own included items, fonts, colors, and graph properties...and be able to switch between them with a single mouse click? You can...and in this article I'll show you how.
You'll be able to easily switch from something like this:
You must be logged in to view this image or video.
to something like this:
You must be logged in to view this image or video.
...with a single (ehhhh... double) click of the mouse.
To accomplish this, we'll be tapping into the Windows registry where all of ECMLink's settings are stored. The basic idea consists of exporting the relevant registry keys to a file, making a small modification to it, and then double-clicking the file to restore the saved settings when desired.
NOTE: This article only applies to ECMLink running on MS Windows; those of you running on a Mac are on your own. You will also need to have administrative privileges, and access to a folder that has full read/write permissions to perform the steps below. (I would suggest storing the configuration files we will be creating on the desktop, or in a folder on the desktop).
This might appear to be complicated at first, but at the end of the article I'll condense everything down and you'll see just how simple it actually is.
What I describe in this article works great for me, but YMMV. I'm using Windows 7 , and ECMLink V3 (full) version 3.22.172; other OS or ECMLink versions may be slightly different, so pay attention and look everything over before jumping straight in head-first. As always, be sure to back up all of your files and have a contingency plan in case something goes horribly wrong and you end up disfigured for life.
Setting Up ECMLink
Setting up ECMLink for this doesn't involve anything more than getting things arranged like you want. Select the items to display, get them arranged the way you want, and set the font color, size, line style, and any other attributes as desired. For more information on optimizing ECMLink's display, you may want to check out this article.
Once everything is the way you like it, right click on the graph legend and click "Set all default preferences", and exit ECMLink. That's it!
The Windows Registry
Most people cringe at the thought of modifying (or even looking at) the Windows registry, but it's really not as bad as it's been made out to be. In fact, with even a little common sense, making changes to the registry is just as safe as modifying anything else on the computer. In a nutshell, the registry is nothing more than a group of files that are used to store information about how your computer and it's software works. Rather than get into a lot of detail about it, I'll keep it short and sweet in this article. If you want to know more (a lot more) about it, this is one of many excellent pages on the subject.
Although modifying the Windows registry is very simple and straightforward, it also comes with the risk of corrupting your PC to the point of needing a complete reload of the OS if you are careless and don't pay attention to what you are doing. If you don't feel comfortable with that, then find someone who is, or find another project to occupy your time with. Don't edit the registry drunk or while driving, and DO THIS AT YOUR OWN RISK!
Ok, now that all of that is out of the way...let's get on with it!
Note: If you are familiar with the registry and know how to edit it, you can skip to the next section.
To access the registry, we use a tool called RegEdit (the actual program file is regedit.exe, and can be found in the Windows/System32 folder). To launch the editor, simply go to the Start menu and type "regedit" (without the quotes) into the search bar, and hit enter. In most cases, you'll then see the lovely Windows UAC dialog box, asking if you are sure you want to do what you are sure you want to do:
You must be logged in to view this image or video.
Click Yes, and something that looks like an evil twin of the file explorer should open. It will resemble the image below, unless it's been opened before and the trees are already expanded.
You must be logged in to view this image or video.
Those five "folders" you see are actually called "hives", or "root keys". Under each hive are keys and sub-keys, and each key contains a set of data and it's values. You navigate through the tree just like in file explorer; click the arrows to expand and collapse different branches and work your way deeper into it.
The editor allows you to do many things, such as add, delete, and change keys and data values, export entire sections, and merge external files into the registry. Those last two are important, as that is what allows us to do what we are wanting.
Where is My ECMLink Stuff?
For our purpose, we are only interested in one particular key, which is found under the HKEY_CURRENT_USER hive. To get to it, expand HKEY_CURRENT_USER, then Software > JavaSoft > Prefs > ecmtuning > ecmlink. If you see more sub-keys called "data", "device", "filenames", etc. under the ecmlink key, then you are in the right place. You should be seeing something that looks like the following. Note that I have expanded all of the sub-keys under the main ecmlink key...more on this in a minute.
You must be logged in to view this image or video.
If you spend a little time clicking on the various sub-keys under "ecmlink" and looking over the data in the right pane, you'll quickly start to see how and where all of those values that you assigned in ECMLink are stored. It's actually pretty straightforward... paths and file names are under the "filenames" key, information about your connection properties is under "device", etc.
Note: You could change any of the parameter values in regedit and then re-open ECMLink, and you would see the new values. We won't need to do this though and I wouldn't recommended it anyway; just change values in Link as usual and let it worry about storing them to the registry.
For the purpose of this article, we are only interested in one key, which is the "data" key. It's full path name would be
Code:
[B]HKEY_CURRENT_USER\Software\JavaSoft\Prefs\ecmtuning\ecmlink\data[/B]
Note: To be more accurate, we really only need the 'displayvalues" key and the "views" key to save and restore the display, but it's easier just to work with the whole data branch. If you need to do something more advanced, like change the display configuration while also doing something weird with the sensor definitions for example, keep this in mind.
Now that we know where the data is stored, how it's organized, and which key we need, all that is left is to save it for future use. Fortunately, regedit makes this extremely easy to do. With the "data" key highlighted, right-click on it and select "Export". You will then be presented with a standard dialog asking for a file name and where you want to save it. Pick a meaningful name and choose a location that makes sense. For this example, let's use "Display_1" for the filename, and save it to the desktop. Click "Save" and a file called "Display_1.reg" will be created that contains all of your modified ECMLink display settings. At this point you can close regedit.
Just one more little detail to address...
As it turns out, ECMLink only stores certain data if it has been changed; most default values are assumed and not explicitly stored in the registry. What this means is that if you try to merge a saved configuration back into the registry that contained default values, some of that data won't be replaced, since the defaults weren't exported to begin with, and the registry now contains changed values. To get around this, we need to completely delete the "data" key first, and then merge the saved file back into the registry. This has the net effect of resetting all the defaults along with our saved custom values. Fortunately for us, this is simply a matter of adding one line to our saved .reg file.
NOTE: You could also just manually delete the "data" key from within regedit each time before merging the exported file back in, but the following approach is much better and only has to be done once.
Open the .reg file in any plain-text editor by right-clicking on it and then selecting "Edit". At the top you should see a header line similar to Windows Registry Editor Version 5.00, followed by a bunch of registry keys. What we want to do is insert a line right after the header that deletes the entire "data" key before the other lines are merged. The line we need to add is:
Code:
[-HKEY_CURRENT_USER\Software\JavaSoft\Prefs\ecmtuning\ecmlink\data]
Notice that this is the full path name to the "data" key inside brackets, with the addition of a hyphen (-) at the front of it. This tells regedit to first delete this key, and then merge the other lines into the registry when the .reg file is executed. The .reg file should look like this after you modify it (the inserted line is highlighted):
You must be logged in to view this image or video.
Save the file and close the editor, and your saved configuration file is ready to rock.
NOTE: Be careful if you use Wordpad or something other than Notepad to edit these files. Those other editors sometimes insert invisible formatting commands unless you specifically save the file as plain text.
Doing Something Useful
So we've saved our current ECMLink display settings to a file and modified it...now what? Well that depends on how creative you want to get. The simplest way to use this is to export the data key (don't forget to modify the file and add the line) for each layout that you create, using separate files for each. You can then simply double-click on whichever file you want to store them back into the registry, and then launch ECMLink as usual. If everything goes well, it will launch with the graph and legend configured exactly as it was when the configuration file was saved.
You creative types are probably seeing countless automation possibilities here. As you might expect, there is much, much more that you can do with this, including automating the export process, restoring settings each time ECMLink is launched, creating custom sensor setups, etc.
Wrapping It Up
So to condense all of this into something a little easier to follow...
To save ECMLink settings
1. Launch regedit from the start menu, and browse to the following key:
Code:
HKEY_CURRENT_USER\Software\JavaSoft\Prefs\ecmtuning\ecmlink
2. Right click on the "data" key, and click "Export", and save the file to a convenient location.
3. Open the saved file in notepad (right-click it and select "Edit"), and add the following line after the header line:
Code:
[-HKEY_CURRENT_USER\Software\JavaSoft\Prefs\ecmtuning\ecmlink\data]
4. Save the file.
To restore ECMLink settings
1. Double-click the saved file, answer Yes to any UAC prompts, and the saved data will be merged back into the registry.
2. Open ECMLink as usual and your restored settings should be happenin'.
Over the next few days, I'll add some more information on how to set up batch files and maybe even create some "buttons" that will completely automate the export process described above.
Stay tuned!
EDIT: For some reason, spaces are showing up in certain places such as "\ecmtunin g\", even though it looks fine in the editor. We are working on it, but in the mean time please ignore those spaces and be careful about copying and pasting.
Last edited by a moderator: