diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index c79b8c3..43dfd38 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: "3.10" + python-version: "3.12" - name: Install pypa/build run: python -m pip install build --user - name: Build a binary wheel and a source tarball diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99a738a..267831a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v1 diff --git a/picoscope/picobase.py b/picoscope/picobase.py index 1c5ae11..b419aa8 100644 --- a/picoscope/picobase.py +++ b/picoscope/picobase.py @@ -537,6 +537,17 @@ def getTriggerTimeOffset(self, segmentIndex=0): """ return self._lowLevelGetTriggerTimeOffset(segmentIndex) + def getTriggerInfo(self, segmentIndex=0): + """ + Get the trigger info structure + + Parameter + ------- + segmentIndex + index of the memory segment + """ + return self._lowLevelGetTriggerInfo(segmentIndex) + def flashLed(self, times=5, start=False, stop=False): """ Flash the front panel LEDs. diff --git a/picoscope/ps6000a.py b/picoscope/ps6000a.py index a235044..e444881 100644 --- a/picoscope/ps6000a.py +++ b/picoscope/ps6000a.py @@ -111,6 +111,18 @@ def updateFirmwareProgress(function): return callback(function) +from ctypes import Structure +class PICO_TRIGGER_INFO(Structure): + _pack_ = 1 + _fields_ = [("status", c_uint32), + ("segmentIndex", c_uint64), + ("triggerIndex", c_uint64), + ("triggerTime", c_double), + ("timeUnits", c_uint32), + ("missedTriggers", c_uint64), + ("timeStampCounter", c_uint64)] + + class PS6000a(_PicoscopeBase): """The following are low-level functions for the ps6000A. @@ -852,9 +864,12 @@ def _lowLevelGetNoOfCaptures(self): def _lowLevelGetNoOfProcessedCaptures(self): raise NotImplementedError() - def _lowLevelGetTriggerInfo(self): - raise NotImplementedError() - + def _lowLevelGetTriggerInfo(self,segmentIndex): + triggerInfo = PICO_TRIGGER_INFO() + m = self.lib.ps6000aGetTriggerInfo(c_int16(self.handle), byref(triggerInfo), c_uint64(segmentIndex), 1) + self.checkResult(m) + return triggerInfo + def _lowLevelMemorySegmentsBySamples(self): raise NotImplementedError() diff --git a/setup.py b/setup.py index 27bcaba..9b477be 100644 --- a/setup.py +++ b/setup.py @@ -24,10 +24,14 @@ 'Topic :: System :: Hardware', 'Topic :: Scientific/Engineering', 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ], - + python_requires=">=3.9", # What does your project relate to? keywords='picoscope peripherals hardware oscilloscope ATE', install_requires=['numpy'],