Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ee70974ec6
Binary file not shown.
10
src/main.py
10
src/main.py
|
|
@ -10,14 +10,16 @@ import traceback
|
||||||
import weakref
|
import weakref
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from ui.diagnostics import Diagnostics
|
|
||||||
from lib.helpers.single_process import SingleProcess
|
|
||||||
from ui.logs_management.info import Logs_Management
|
|
||||||
|
|
||||||
if platform.system().lower() == "windows":
|
if platform.system().lower() == "windows":
|
||||||
sys.path.append(f"{os.getcwd()}\src\components")
|
sys.path.append(f"{os.getcwd()}\src\components")
|
||||||
else:
|
else:
|
||||||
sys.path.append(f"{os.getcwd()}/src/components")
|
sys.path.append(f"{os.getcwd()}/src/components")
|
||||||
|
sys.path.append(f"{os.getcwd()}")
|
||||||
|
|
||||||
|
from ui.diagnostics import Diagnostics
|
||||||
|
from lib.helpers.single_process import SingleProcess
|
||||||
|
from ui.logs_management.info import Logs_Management
|
||||||
|
|
||||||
|
|
||||||
app = None
|
app = None
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/CLProtocol_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
BIN
src/test/hikrobot_sc/bin/CLProtocol_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/CLSerCOM.dll
Normal file
BIN
src/test/hikrobot_sc/bin/CLSerCOM.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/GCBase_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
BIN
src/test/hikrobot_sc/bin/GCBase_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/GenApi_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
BIN
src/test/hikrobot_sc/bin/GenApi_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/Log_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
BIN
src/test/hikrobot_sc/bin/Log_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/MathParser_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
BIN
src/test/hikrobot_sc/bin/MathParser_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/MvVSControlSDK.Net.dll
Normal file
BIN
src/test/hikrobot_sc/bin/MvVSControlSDK.Net.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/MvVisionSensorControl.dll
Normal file
BIN
src/test/hikrobot_sc/bin/MvVisionSensorControl.dll
Normal file
Binary file not shown.
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/XmlParser_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
BIN
src/test/hikrobot_sc/bin/XmlParser_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/libmmd.dll
Normal file
BIN
src/test/hikrobot_sc/bin/libmmd.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/log4cpp_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
BIN
src/test/hikrobot_sc/bin/log4cpp_MD_VC120_v3_0_MVS_v3_1_0.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/msvcp120.dll
Normal file
BIN
src/test/hikrobot_sc/bin/msvcp120.dll
Normal file
Binary file not shown.
BIN
src/test/hikrobot_sc/bin/msvcr120.dll
Normal file
BIN
src/test/hikrobot_sc/bin/msvcr120.dll
Normal file
Binary file not shown.
81
src/test/hikrobot_sc/test_hikrobot_sc.py
Normal file
81
src/test/hikrobot_sc/test_hikrobot_sc.py
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
import ctypes
|
||||||
|
import os
|
||||||
|
|
||||||
|
# Load the MvVisionSensorControl library
|
||||||
|
mv_lib = ctypes.windll.LoadLibrary("bin/MvVisionSensorControl.dll")
|
||||||
|
|
||||||
|
MV_MAX_DEVICE_NUM=256
|
||||||
|
# Define the necessary structures and constants from MvVisionSensorDefine.h
|
||||||
|
class MV_VS_DEVICE_INFO(ctypes.Structure):
|
||||||
|
_fields_ = [
|
||||||
|
("nMajorVer", ctypes.c_ushort), # GigE protocol Major Version
|
||||||
|
("nMinorVer", ctypes.c_ushort), # GigE protocol Minor Version
|
||||||
|
("nMacAddrHigh", ctypes.c_uint), # High MAC Address
|
||||||
|
("nMacAddrLow", ctypes.c_uint), # Low MAC Address
|
||||||
|
("nIpCfgOption", ctypes.c_uint), # Supported IP Configuration Options
|
||||||
|
("nIpCfgCurrent", ctypes.c_uint), # IP Configuration
|
||||||
|
("nCurrentIp", ctypes.c_uint), # Current IP
|
||||||
|
("nCurrentSubNetMask", ctypes.c_uint), # Current Subnet Mask
|
||||||
|
("nDefultGateWay", ctypes.c_uint), # Current Gateway
|
||||||
|
("chManufacturerName", ctypes.c_char * 32), # Manufacturer Name
|
||||||
|
("chModelName", ctypes.c_char * 32), # Model Name
|
||||||
|
("chDeviceVersion", ctypes.c_char * 32), # Device Version
|
||||||
|
("chManufacturerSpecificInfo", ctypes.c_char * 48), # Manufacturer Specific Info
|
||||||
|
("chSerialNumber", ctypes.c_char * 16), # Serial Number
|
||||||
|
("chUserDefinedName", ctypes.c_char * 16), # User Defined Name
|
||||||
|
("nNetExport", ctypes.c_uint), # IP address of connected network port
|
||||||
|
("nReserved", ctypes.c_uint * 8), # Reserved
|
||||||
|
]
|
||||||
|
|
||||||
|
MV_MAX_DEVICE_NUM = 256 # Maximum number of supported devices
|
||||||
|
|
||||||
|
|
||||||
|
class MV_VS_DEVICE_INFO_LIST(ctypes.Structure):
|
||||||
|
_fields_ = [
|
||||||
|
("nDeviceNum", ctypes.c_uint), # Online Device Number
|
||||||
|
("pDeviceInfo", ctypes.POINTER(MV_VS_DEVICE_INFO) * MV_MAX_DEVICE_NUM), # Device info array
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# Define MV_VS_OK from MvVSErrorDefine.h (assuming it's 0)
|
||||||
|
MV_VS_OK = 0
|
||||||
|
|
||||||
|
# Define function signatures
|
||||||
|
mv_lib.MV_VS_EnumDevices.argtypes = [ctypes.POINTER(MV_VS_DEVICE_INFO_LIST)]
|
||||||
|
mv_lib.MV_VS_EnumDevices.restype = ctypes.c_int
|
||||||
|
|
||||||
|
def print_device_info(device_info_list):
|
||||||
|
num_devices=device_info_list.nDeviceNum
|
||||||
|
for i in range(num_devices):
|
||||||
|
device_info = device_info_list.pDeviceInfo[i].contents
|
||||||
|
nIp1 = ((device_info.nCurrentIp & 0xff000000) >> 24)
|
||||||
|
nIp2 = ((device_info.nCurrentIp & 0x00ff0000) >> 16)
|
||||||
|
nIp3 = ((device_info.nCurrentIp & 0x0000ff00) >> 8)
|
||||||
|
nIp4 = (device_info.nCurrentIp & 0x000000ff)
|
||||||
|
print(f"[{i}]Gige: {device_info.chUserDefinedName.decode()}"
|
||||||
|
f"({nIp1}.{nIp2}.{nIp3}.{nIp4})")
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print("SC2016 TEST")
|
||||||
|
|
||||||
|
device_info_list = MV_VS_DEVICE_INFO_LIST()
|
||||||
|
|
||||||
|
nRet = mv_lib.MV_VS_EnumDevices(ctypes.byref(device_info_list))
|
||||||
|
|
||||||
|
if nRet != MV_VS_OK:
|
||||||
|
print(f"Enum devices failed! nRet [{nRet:#x}]")
|
||||||
|
return -2
|
||||||
|
else:
|
||||||
|
print("Enum devices OK")
|
||||||
|
|
||||||
|
if device_info_list.nDeviceNum > 0:
|
||||||
|
print_device_info(device_info_list)
|
||||||
|
else:
|
||||||
|
print("Find No Devices!")
|
||||||
|
return -2
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Loading…
Reference in New Issue
Block a user