summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test-cli/.idea/workspace.xml4
-rw-r--r--test-cli/test/helpers/qrreader.py5
-rw-r--r--test-cli/test_main.py27
3 files changed, 20 insertions, 16 deletions
diff --git a/test-cli/.idea/workspace.xml b/test-cli/.idea/workspace.xml
index 1136484..611fce4 100644
--- a/test-cli/.idea/workspace.xml
+++ b/test-cli/.idea/workspace.xml
@@ -3,8 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="4991a6e0-1b9d-4824-9b6e-5ac031eb4816" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/flashers/flasheeprom.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/flashers/flasheeprom.py" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/test/flashers/flashmemory.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/flashers/flashmemory.py" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/test/helpers/qrreader.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/helpers/qrreader.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test_main.py" beforeDir="false" afterPath="$PROJECT_DIR$/test_main.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@@ -26,7 +25,6 @@
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
- <option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
diff --git a/test-cli/test/helpers/qrreader.py b/test-cli/test/helpers/qrreader.py
index 1d3768b..0954a70 100644
--- a/test-cli/test/helpers/qrreader.py
+++ b/test-cli/test/helpers/qrreader.py
@@ -9,7 +9,8 @@ selector = selectors.DefaultSelector()
qrdevice_list = [
"Honeywell Imaging & Mobility 1900",
- "Manufacturer Barcode Reader"
+ "Manufacturer Barcode Reader",
+ "SM SM-2D PRODUCT HID KBW"
]
@@ -117,4 +118,4 @@ class QRReader:
#qr = QRReader()
#if qr.openQR():
# print(qr.readQRasync(2))
-#qr.closeQR() \ No newline at end of file
+#qr.closeQR()
diff --git a/test-cli/test_main.py b/test-cli/test_main.py
index 5abbe85..dacc05a 100644
--- a/test-cli/test_main.py
+++ b/test-cli/test_main.py
@@ -25,6 +25,7 @@ from test.helpers.iseelogger import ISEE_Logger
import logging
from test.flashers.flasheeprom import flash_eeprom
from test.flashers.flashmemory import flash_memory
+from test.helpers.qrreader import QRReader
# global variables
psdbObj = TestSrv_Database()
@@ -146,12 +147,12 @@ def main():
alltasksok = False;
# flash eeprom
- resulteeprom = 0
- if "eeprompath" in varlist and len(varlist["eeprompath"]) > 0:
- mac0 = psdbObj.get_board_macaddr(globalVar.g_uuid)
- resulteeprom, eepromdata = flash_eeprom(varlist["eeprompath"], globalVar.g_uuid, mac0)
- psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHEEPROM",
- "TASK_OK" if resulteeprom == 0 else "TASK_FAIL", eepromdata)
+ # resulteeprom = 0
+ # if "eeprompath" in varlist and len(varlist["eeprompath"]) > 0:
+ # mac0 = psdbObj.get_board_macaddr(globalVar.g_uuid)
+ # resulteeprom, eepromdata = flash_eeprom(varlist["eeprompath"], globalVar.g_uuid, mac0)
+ # psdbObj.create_task_result(globalVar.taskid_ctl, "FLASHEEPROM",
+ # "TASK_OK" if resulteeprom == 0 else "TASK_FAIL", eepromdata)
# flash non-volatile memory
# resultmemory = 0
@@ -162,8 +163,8 @@ def main():
# update status with the result
# if resulteeprom == 0 and resultmemory == 0:
- if resulteeprom == 0:
- alltasksok = True;
+ if True:
+ alltasksok = True
psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_OK")
else:
psdbObj.update_taskctl_status(globalVar.taskid_ctl, "TASK_BOARD_FAIL")
@@ -171,9 +172,13 @@ def main():
if alltasksok:
# get barcode using the scanner
loggerObj.getlogger().info("Waiting for barcode scanner")
- # TODO -----
- factorycode = "XXXXX-XXXXX"
- psdbObj.set_factorycode(globalVar.g_uuid, factorycode)
+ qr = QRReader()
+ if qr.openQR():
+ # program remains here until gets a succesful code from the scanner
+ if qr.readQR():
+ factorycode = qr.getQRNumber()
+ psdbObj.set_factorycode(globalVar.g_uuid, factorycode)
+ qr.closeQR()
loggerObj.getlogger().info("Python program finished")