Skip to content
Snippets Groups Projects
Commit 98571c73 authored by Schmidt, Christoph's avatar Schmidt, Christoph
Browse files

UI now runs again - Added new files

parent 779a8dd7
Branches main
No related tags found
No related merge requests found
Showing
with 484 additions and 0 deletions
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/CaptDeviceControl" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/src/CaptDeviceControl/adcaptdevicecontrol" />
<excludeFolder url="file://$MODULE_DIR$/src/CaptDeviceControl/old" />
</content>
<orderEntry type="jdk" jdkName="Python 3.11 (.venv312_al) (3)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="renderExternalDocumentation" value="true" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.11 (.venv312_al) (3)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (.venv312_al) (3)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/captdevicecontrol.iml" filepath="$PROJECT_DIR$/.idea/captdevicecontrol.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PySciProjectComponent">
<option name="PY_SCI_VIEW" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
# How to use this class
```
app = QApplication()
setup_logging()
vaut_config = VAutomatorConfig.load_config("./configs/init_config.yaml")
ad2_model = AD2CaptDeviceModel(vaut_config.ad2_device_config)
ad2_controller = AD2CaptDeviceController(ad2_model)
ad2_window = ControlWindow(ad2_model, ad2_controller)
#ad2_controller.connect_device()
#ad2_controller.start_capture()
ad2_window.show()
sys.exit(app.exec())
```
\ No newline at end of file
# - Configuration file stored 2023-11-09 09:34:42.752230 -
CaptDeviceConfig: #!!python/object:controller.CaptDeviceConfig
sample_rate: 50000 # sample_rate: None
total_samples: 200000 # total_samples: None
sample_time: 45 # sample_time: None
ad2_raw_out_file: "{output_directory}/measurement/ad2_raw/ad2_out_{wafer_nr}_{date}.csv" # ad2_raw_out_file: None
import logging
import sys
import os
sys.path.append('../src/')
from PySide6.QtWidgets import QApplication
from rich.logging import RichHandler
import src.CaptDeviceControl as CaptDevice
if __name__ == "__main__":
def setup_logging():
for log_name, log_obj in logging.Logger.manager.loggerDict.items():
if log_name != '<module name>':
log_obj.disabled = True
# Format the Rich logger
FORMAT = "%(message)s"
logging.basicConfig(
level="DEBUG", format=FORMAT, datefmt="[%X]", handlers=[
RichHandler(rich_tracebacks=True)
]
)
app = QApplication()
setup_logging()
conf = CaptDevice.Config()
conf.load("config.yaml")
model = CaptDevice.Model(conf)
controller = CaptDevice.Controller(model)
window = CaptDevice.View(model, controller)
window.show()
sys.exit(app.exec())
\ No newline at end of file
## MATLAB ##
# Windows default autosave extension
*.asv
# OSX / *nix default autosave extension
*.m~
# Compiled MEX binaries (all platforms)
*.mex*
# Packaged app and toolbox files
*.mlappinstall
*.mltbx
# Generated helpsearch folders
helpsearch*/
# Simulink code generation folders
slprj/
sccprj/
# Matlab code generation folders
codegen/
# Simulink autosave extension
*.autosave
# Simulink cache files
*.slxc
# Octave session info
octave-workspace
## PYTHON ##
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
Sacher_Lasertechnik/
measurements/
flexsensorpy/measurements/
.venv-waffel-untersucher/
\ No newline at end of file
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv_Chris_PC" />
</content>
<orderEntry type="jdk" jdkName="Python 3.10 (adcaptdevicecontrol)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
<serverData>
<paths name="root@rp-f02113.local:22 password">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="root@rp-f02113.local:22 password (2)">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="root@rp-f02113.local:22 password (3)">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="root@rp-f02113.local:22 password (4)">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="3">
<item index="0" class="java.lang.String" itemvalue="scipy" />
<item index="1" class="java.lang.String" itemvalue="pyMKL" />
<item index="2" class="java.lang.String" itemvalue="opt_einsum" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N803" />
<option value="N802" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="dict.is_set" />
<option value="libs.LaserLib" />
<option value="Laser.LaserControl.controller.LaserSLLIB.laserSacher" />
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (adcaptdevicecontrol)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/adcaptdevicecontrol.iml" filepath="$PROJECT_DIR$/.idea/adcaptdevicecontrol.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
# ADCaptDeviceControl
## Getting started
This is the module which allows to control an Analog Discovery device from Digilent. It is based on the [Analog Discovery SDK](https://reference.digilentinc.com/reference/software/waveforms/waveforms-3/reference-manual) and the [Waveforms SDK](https://reference.digilentinc.com/reference/software/waveforms/waveforms-3/reference-manual).
The module is made to stream and capture the data.
### Prerequisites
The Analog Discovery only works with the correct SDK installed.
The SDK can be found [here](https://reference.digilentinc.com/reference/software/waveforms/waveforms-3/start).
The SDK is only available for Windows, Mac and Linux. The module is only tested on Windows.
## Using the module
### Logging setup
This step is not mandatory, however helps you to see what is happening in the background.
Jus implement the following code in your main file and run the function
```python
import logging
from rich.logging import RichHandler
def setup_logging(window: ConsoleWindow = None):
for log_name, log_obj in logging.Logger.manager.loggerDict.items():
if log_name != '<module name>':
log_obj.disabled = True
# Format the Rich logger
FORMAT = "%(message)s"
if window is not None:
logging.basicConfig(
level="DEBUG", format=FORMAT, datefmt="[%X]", handlers=[
RichHandler(rich_tracebacks=True), window.handler
]
)
else:
logging.basicConfig(
level="DEBUG", format=FORMAT, datefmt="[%X]", handlers=[
RichHandler(rich_tracebacks=True)
]
)
# Setup the logging formatter.
setup_logging()
```
THis makes sure to have proper logging formatting.
### Connecting the model, controller and view
The module can be run with
````python
# This path is not included in this module. It is only included in flexsensorpy
# See the git repo under ./flexsensorpy/configs/init_config.yaml
vaut_config = VAutomatorConfig.load_config("../../configs/init_config.yaml")
# Init the AD model, controller and view
ad2_model = AD2CaptDeviceModel(vaut_config.ad2_device_config)
ad2_controller = AD2CaptDeviceController(ad2_model)
ad2_window = ControlWindow(ad2_model, ad2_controller)
ad2_window.show()
sys.exit(app.exec())
````
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment