kolinger / rd-usb

Web GUI for RuiDeng/Riden USB testers (UM34C, UM24C, UM25C, TC66C)
GNU General Public License v3.0
231 stars 30 forks source link

UM25C compatibility #3

Closed GreyTeardrop closed 5 years ago

GreyTeardrop commented 5 years ago

Hi!

I own RDTech's UM25C and would like to let you know that rd-usb works with it just fine with one modification:

Index: utils/rdusb.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- utils/rdusb.py  (date 1546341528000)
+++ utils/rdusb.py  (date 1546426210000)
@@ -42,8 +42,8 @@
         result = OrderedDict()

         result["timestamp"] = arrow.now().timestamp
-        result["voltage"] = int("0x" + data[4] + data[5] + data[6] + data[7], 0) / 100
-        result["current"] = int("0x" + data[8] + data[9] + data[10] + data[11], 0) / 1000
+        result["voltage"] = int("0x" + data[4] + data[5] + data[6] + data[7], 0) / 1000
+        result["current"] = int("0x" + data[8] + data[9] + data[10] + data[11], 0) / 10000
         result["power"] = int("0x" + data[12] + data[13] + data[14] + data[15] + data[16] +
                               data[17] + data[18] + data[19], 0) / 1000
         result["temperature"] = int("0x" + data[20] + data[21] + data[22] + data[23], 0)

basically, as UM25C has resolution of 0.001V and 0.0001A so voltage and current encoding are changed to make room for that resolution.

kolinger commented 5 years ago

Done. Now you can select version and UM25C will have extra modifier for voltage/current. Thank you.