Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
873d7d32da
@ -2,7 +2,7 @@ set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
|
|||||||
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
|
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
|
||||||
echo sLinkFile = "%USERPROFILE%\Desktop\AVVIO PROGRAMMA COLLAUDO.lnk" >> %SCRIPT%
|
echo sLinkFile = "%USERPROFILE%\Desktop\AVVIO PROGRAMMA COLLAUDO.lnk" >> %SCRIPT%
|
||||||
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
|
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
|
||||||
echo oLink.TargetPath = "%userprofile%\PycharmProjects\st-ten-1\runme.sh" >> %SCRIPT%
|
echo oLink.TargetPath = "%userprofile%\PycharmProjects\st-ten-1\runme.bat" >> %SCRIPT%
|
||||||
echo oLink.IconLocation = "%userprofile%\PycharmProjects\st-ten-1\src\ui\imgs\neo.ico"
|
echo oLink.IconLocation = "%userprofile%\PycharmProjects\st-ten-1\src\ui\imgs\neo.ico"
|
||||||
echo oLink.Save >> %SCRIPT%
|
echo oLink.Save >> %SCRIPT%
|
||||||
cscript /nologo %SCRIPT%
|
cscript /nologo %SCRIPT%
|
||||||
|
|||||||
4
runme.bat
Normal file
4
runme.bat
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
echo on
|
||||||
|
SET mypath=%~dp0
|
||||||
|
cd %mypath%
|
||||||
|
.\venv\Scripts\activate.bat && python -O "./src/main.py" --no-edgetpu --no-tflite
|
||||||
@ -1,7 +1,7 @@
|
|||||||
from ctypes import (CFUNCTYPE, POINTER, byref, c_char, c_int32, c_uint8,
|
from ctypes import (CFUNCTYPE, POINTER, byref, c_char, c_int32, c_uint8,
|
||||||
c_void_p, cast, create_string_buffer, pointer)
|
c_void_p, cast, create_string_buffer, pointer)
|
||||||
|
|
||||||
|
from src.components.Automation.BDaq import *
|
||||||
buffer = {}
|
buffer = {}
|
||||||
|
|
||||||
out_data =[0b00000101,0b00000101]
|
out_data =[0b00000101,0b00000101]
|
||||||
@ -25,7 +25,7 @@ def InstantDoCtrl_WriteBit(useless, byte, bit, val):
|
|||||||
b = int(int.from_bytes(val, "big") != 0) << bit
|
b = int(int.from_bytes(val, "big") != 0) << bit
|
||||||
buffer[byte] &= 0b11111111 & ~(1 << bit)
|
buffer[byte] &= 0b11111111 & ~(1 << bit)
|
||||||
buffer[byte] |= b
|
buffer[byte] |= b
|
||||||
return 0
|
return ErrorCode.Success
|
||||||
|
|
||||||
|
|
||||||
@CFUNCTYPE(c_void_p)
|
@CFUNCTYPE(c_void_p)
|
||||||
|
|||||||
@ -12,14 +12,14 @@ is_win = platform.system() == "Windows"
|
|||||||
|
|
||||||
if "--sim-io" not in sys.argv:
|
if "--sim-io" not in sys.argv:
|
||||||
if is_win:
|
if is_win:
|
||||||
from Automation.BDaq import *
|
from components.Automation.BDaq import *
|
||||||
from Automation.BDaq.InstantDoCtrl import InstantDoCtrl
|
from components.Automation.BDaq.InstantDoCtrl import InstantDoCtrl
|
||||||
from Automation.BDaq.InstantDiCtrl import InstantDiCtrl
|
from components.Automation.BDaq.InstantDiCtrl import InstantDiCtrl
|
||||||
else:
|
else:
|
||||||
libbiodaq = ctypes.CDLL("/opt/advantech/libs/libbiodaq.so")
|
libbiodaq = ctypes.CDLL("/opt/advantech/libs/libbiodaq.so")
|
||||||
else:
|
else:
|
||||||
is_win=False
|
is_win=False
|
||||||
import src.components.dummies.libbiodaq as libbiodaq
|
import components.dummies.libbiodaq as libbiodaq
|
||||||
|
|
||||||
|
|
||||||
class USB_586x(Component):
|
class USB_586x(Component):
|
||||||
@ -36,7 +36,7 @@ class USB_586x(Component):
|
|||||||
def __init__(self, config=None, name=None, period=1, lazy=True, paused=False, threaded=True):
|
def __init__(self, config=None, name=None, period=1, lazy=True, paused=False, threaded=True):
|
||||||
super().__init__(config=config, name=name, period=period, lazy=lazy, paused=paused, threaded=threaded)
|
super().__init__(config=config, name=name, period=period, lazy=lazy, paused=paused, threaded=threaded)
|
||||||
self.mutex = QMutex()
|
self.mutex = QMutex()
|
||||||
|
self.simulate="--sim-io" in sys.argv
|
||||||
# DEVICE INFORMATION
|
# DEVICE INFORMATION
|
||||||
self.id=config["digital_io"]["id"]
|
self.id=config["digital_io"]["id"]
|
||||||
if "5860" in self.id:
|
if "5860" in self.id:
|
||||||
@ -193,7 +193,7 @@ class USB_586x(Component):
|
|||||||
max_retry = 3
|
max_retry = 3
|
||||||
while not ok and retry <max_retry:
|
while not ok and retry <max_retry:
|
||||||
ret = self.set_bit(byte, bit, val)
|
ret = self.set_bit(byte, bit, val)
|
||||||
if ret != ErrorCode.Success:
|
if ret != ErrorCode.Success and not self.simulate:
|
||||||
self.log.error(f"SET BIT ERROR")
|
self.log.error(f"SET BIT ERROR")
|
||||||
self.open_device()
|
self.open_device()
|
||||||
retry+=1
|
retry+=1
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import argparse
|
|||||||
import faulthandler
|
import faulthandler
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
# import pdb
|
# import pdb
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
@ -11,6 +12,9 @@ import weakref
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
sys.path.append(f"{os.getcwd()}\src\components")
|
||||||
|
|
||||||
from components.usb_586x import USB_586x
|
from components.usb_586x import USB_586x
|
||||||
|
|
||||||
app = None
|
app = None
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import weakref
|
|||||||
from PyQt5.QtWidgets import QMessageBox
|
from PyQt5.QtWidgets import QMessageBox
|
||||||
|
|
||||||
from ui.test_test import Test_Test
|
from ui.test_test import Test_Test
|
||||||
from src.components.Automation.BDaq import ErrorCode
|
from components.Automation.BDaq import ErrorCode
|
||||||
|
|
||||||
class Test_Leak(Test_Test):
|
class Test_Leak(Test_Test):
|
||||||
def __init__(self, components=None, recipe=None, step=None, pieces=None, run_once=False, reset_on_start=True, enable_override=True):
|
def __init__(self, components=None, recipe=None, step=None, pieces=None, run_once=False, reset_on_start=True, enable_override=True):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user