Changing channel colors at Saleae Logic
Saleae Logic is a simple but handy logic analyzer, which enables you to debug your MCU-based circuits by capturing actual voltage levels present on certain wires of your circuit. Like that:
Availability of cheap clones made this tool (along with based on the same chip unbelievably popular among hobbyists.
Sometimes these clones are bit glitchy, but they are indeed a good start if you are not familiar with the logic analyzers. Original software works with them likewise good. The serious only problem you may encounter is... colors of wires. Original device and the software has channels colored black, brown, red, orange, etc. Clone uses the same sequence, but starting with brown. Black is used for ground in clone, which does make sence. Surely, to avoid mistakes you may want to make the two sets match.
The problem is the channel colors in the app are fixed.You can edit labels but not colors - at least in version 1.1.15 for Linux. As the result possible solutions left are:
- do not use channel one and attach the cable pins starting from channel 1, which is brown;
- find another cable with the sequence starting from black;
- simply use exising black wire for the channel 0 (possibly detaching it from the cable to make the wiring less crazy);
- use another software where colors are configurable (Linux users may take a look at PulseView, which is a part of Sigrok project - the shame is it fails to remember the setup at all after restart).
But the solution is much more simple! Logic software stores all the setup, even parameters not configurable via the program is in file setting.xml located under Settings folder. Looks for the mCaptureChannelSettings element, then simply copy elements mR, mG, mB from any i+1 section to i section. One that left is for channel 7, gray colored wire. You may fill it with values 160, 160, 160. Save the file and you are good to go.
They switched to an electron based app in Logic2, so there's no more `settings.xml`. However, it's still really easy to change the colour code.
ОтветитьУдалитьAll the JS code is bundled in into a file called `app.asar`. On a Mac, it's found inside the app bundle (e.g. `/Applications/Logic2.app/Contents/Resources/app.asar`). It defines a variable called `t.channelColors`, which is the 8 channel colours, in order.
To match my harness (ch1-8 on brown, red, orange, yellow, green, blue, purple, grey, with ground on white and black), I rearranged it from:
```
t.channelColors=["#d4d4d4","#C79579","#FF6D7F","#FFB45B","#F7E740","#59E56D","#53A9FD","#AF92FB"]
```
To:
```
t.channelColors=["#C79579","#FF6D7F","#FFB45B","#F7E740","#59E56D","#53A9FD","#AF92FB","#d4d4d4"]
```
This can be done in a single command with:
```
perl -pi -e 's/t\.channelColors=\["#d4d4d4","#C79579","#FF6D7F","#FFB45B","#F7E740","#59E56D","#53A9FD","#AF92FB"]/t.channelColors=["#C79579","#FF6D7F","#FFB45B","#F7E740","#59E56D","#53A9FD","#AF92FB","#d4d4d4"]/g' /Applications/Logic2.app/Contents/Resources/app.asar
```