opalkelly-opensource / design-resources

A collection of Opal Kelly provided design resources
Other
15 stars 9 forks source link

Python API non-pip modules installs #2

Open AEW2015 opened 8 months ago

AEW2015 commented 8 months ago

Can we get better instructions on how to install these and what files are needed. I don't think I installed dxshot correctly.

https://github.com/opalkelly-opensource/design-resources/blob/c8b2456cfb3cc899db6d7c08bfcd0a6aaa030276/ExampleProjects/DisplayPort/XEM8320/python_app/imports.py#L54-L67

I had to replace the Region of Interest frame capture with random noise to get the example to work.

#frame = self._cam.grab(region=utils.define_capture_region_offset(X_OFFSET, Y_OFFSET, global_vars.sys_vars.get_matrix_size(), global_vars.sys_vars.get_matrix_size()))
frame = np.random.randint(255,size=(512,512,3),dtype=np.uint8)
AEW2015 commented 8 months ago

Solution to get ROI screen capture working for dxshot api.

  1. upgrade to python 3.11.7
  2. pip install dxcam (not included in requirements.txt)
  3. Copy over https://raw.githubusercontent.com/AI-M-BOT/DXcam/main/dxcam/__init__.py and rename dxshot.py
  4. download https://github.com/AI-M-BOT/DXcam/releases/download/1.2/dxshot.cp311-win_amd64.pyd
  5. Run!

FrontPanel API : use https://docs.opalkelly.com/fpsdk/frontpanel-api/programming-languages/ at section 4. Python API FrontPanelToAxiLiteBridge: Copy over FrontPanelToAxiLiteBridge.py to working directory

AEW2015 commented 8 months ago

Looks like step 2 and 3 were not needed at all. The proper upgrade to Python 3.11 seems to be the correct solution to get the dxshot pyd file working with the example Python API.