コード例 #1
0
    def _init_dmcam(self):
        dmcam.init(None)
        dmcam.log_cfg(dmcam.LOG_LEVEL_INFO, dmcam.LOG_LEVEL_DEBUG,
                      dmcam.LOG_LEVEL_NONE)

        log.info("Scanning dmcam device ..")
        while True:
            devs = dmcam.dev_list()
            if devs is None:
                log.info("No device found")
                print(u"没有找到TCM-E2设备,请插入设备后点任意键继续")
                input("")
                # win32api.MessageBox(0, u"没有找到TCM-E2设备,请插入设备后点击【确定】继续", u"警告", win32con.MB_OK)
                # time.sleep(1)
            else:
                log.info("Found {} devices".format(len(devs)))
                break
コード例 #2
0
ファイル: sample_gui_pygame.py プロジェクト: lyp365859350/SDK
        print("   %d frame discarded" % int(errarg))
    # if return false, the capture process will be stopped
    return True


# init the lib with default log file
dmcam.init(None)
# init with specified log file
# dmcam.init("test.log")
# set debug level
dmcam.log_cfg(dmcam.LOG_LEVEL_INFO, dmcam.LOG_LEVEL_DEBUG,
              dmcam.LOG_LEVEL_NONE)

# list device (maximum 10 devices to store)
print(" Scanning dmcam device ..")
devs = dmcam.dev_list()
if devs is None:
    print(" No device found")
    sys.exit(1)

print("found %d device" % len(devs))

for i in range(len(devs)):
    print("DMCAM#%d [%03d:%03d:%03d]: VENDOR=%s, PROD=%s, SERIAL=%s" %
          (i, devs[i].if_info.info.usb.usb_port_num,
           devs[i].if_info.info.usb.usb_bus_num,
           devs[i].if_info.info.usb.usb_dev_addr, devs[i].vendor,
           devs[i].product, devs[i].serial))

print(" Open dmcam device ..")
# open the first device