Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
beniroquai committed Sep 25, 2022
2 parents 7fb0433 + 065993f commit de2a0fa
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 618 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/imswitch-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ on:
workflow_dispatch:
push:
tags:
- '*'

- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
GITHUB_TOKEN: ${{ github.token }}

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -27,13 +29,36 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .
python3 -m pip install pyinstaller
python3 -m pip install pyinstaller==5.4.1
shell: bash
- name: Build bundle
run: |
pyinstaller imswitch.spec
cd dist
cd ImSwitch
dir
- name: Upload updated .exe
uses: actions/upload-artifact@v2
with:
name: imswitch-updated-exeonly
path: dist/ImSwitch/ImSwitch.exe
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: imswitch-${{ matrix.os }}
path: dist
path: dist
- name: Gets latest created release info
id: latest_release_info
uses: jossef/[email protected]

- name: upload windows-exe-update artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
asset_path: dist/ImSwitch/ImSwitch.exe
asset_name: ImSwitch.exe
asset_content_type: application/exe


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ that it is possible to integrate current state-of-the-art solutions into one uni

### Option A: Standalone bundles for Windows

Windows users can download ImSwitch in standalone format from the [releases page on GitHub](https://github.com/kasasxav/ImSwitch/releases). Further information is available there. An existing Python installation is *not* required.
Windows users can download ImSwitch in standalone format from the [releases page on GitHub](https://github.com/openUC2/ImSwitch/releases). Further information is available there. An existing Python installation is *not* required.

### Option B: Install using pip

Expand Down
2 changes: 1 addition & 1 deletion imswitch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.2.1'
__version__ = '1.2.2'


# Copyright (C) 2020-2021 ImSwitch developers
Expand Down
10 changes: 9 additions & 1 deletion imswitch/imcommon/controller/CheckUpdatesController.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import requests
from luddite import get_version_pypi
from packaging import version
import subprocess


import imswitch
from imswitch.imcommon.framework import Signal, Thread
Expand Down Expand Up @@ -55,9 +57,11 @@ def run(self):
if 'IMSWITCH_IS_BUNDLE' in os.environ and os.environ['IMSWITCH_IS_BUNDLE'] == '1':
# Installed from bundle - check GitHub
releaseResponse = requests.get(
'https://api.github.com/repos/kasasxav/ImSwitch/releases/latest'
'https://api.github.com/repos/openUC2/ImSwitch/releases/latest'
)
latestVersion = releaseResponse.json()['tag_name'].lstrip('v')
latestVersionDate = releaseResponse.json()['published_at'].split('T')[0]

if version.parse(latestVersion) > version.parse(currentVersion):
self.sigNewVersionPyInstaller.emit(latestVersion)
else:
Expand All @@ -72,6 +76,10 @@ def run(self):
except Exception:
self.__logger.warning(traceback.format_exc())
self.sigFailed.emit()

def getCurrentCommitDate(self):
return str(subprocess.check_output(['git', 'log', '-n', '1', '--pretty=tformat:%h-%ad', '--date=short']).strip()).split("-")[-3:]



# Copyright (C) 2020-2021 ImSwitch developers
Expand Down
4 changes: 2 additions & 2 deletions imswitch/imcommon/view/AboutDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def __init__(self, parent=None, *args, **kwargs):
self.label = QtWidgets.QLabel(
f'<strong>ImSwitch {imswitch.__version__}</strong>'
f'<br /><br />Code available at: '
f'<a href="https://github.com/kasasxav/ImSwitch" style="color: orange">'
f'https://github.com/kasasxav/ImSwitch'
f'<a href="https://github.com/openUC2/ImSwitch" style="color: orange">'
f'https://github.com/openUC2/ImSwitch'
f'</a>'
f'<br />Licensed under the GNU General Public License v3.0.'
)
Expand Down
2 changes: 1 addition & 1 deletion imswitch/imcommon/view/CheckUpdatesDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def showPyInstallerUpdate(self, newVersion):
)
self.linkLabel.setText(
'The new version may be downloaded from '
'<a href="https://github.com/kasasxav/ImSwitch/releases" style="color: orange">'
'<a href="https://github.com/openUC2/ImSwitch/releases" style="color: orange">'
'the GitHub releases page'
'</a>'
'.'
Expand Down
4 changes: 1 addition & 3 deletions imswitch/imcontrol/controller/MasterController.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from imswitch.imcommon.model import VFileItem
from imswitch.imcontrol.model import (
DetectorsManager, LasersManager, MultiManager, NidaqManager, PositionersManager,
DetectorsManager, LasersManager, MultiManager, PositionersManager,
RecordingManager, RS232sManager, ScanManager, SLMManager, SIMManager, LEDMatrixsManager, MCTManager, ISMManager, UC2ConfigManager
)

Expand All @@ -17,11 +17,9 @@ def __init__(self, setupInfo, commChannel, moduleCommChannel):
self.__moduleCommChannel = moduleCommChannel

# Init managers
self.nidaqManager = NidaqManager(self.__setupInfo)
self.rs232sManager = RS232sManager(self.__setupInfo.rs232devices)

lowLevelManagers = {
'nidaqManager': self.nidaqManager,
'rs232sManager': self.rs232sManager
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ def setDetLogLine(self, key, val, *args):
def runSlowScan(self):
""" Run a scan of the slow method (STED). """
self.__detLog[f"scan_start"] = datetime.now().strftime('%Ss%fus')
if self.scanInitiationMode == ScanInitiationMode.ScanWidget:
# Run scan in nidaqManager
self._master.nidaqManager.runScan(self.signalDic, self.scanInfoDict)
elif self.scanInitiationMode == ScanInitiationMode.RecordingWidget:
if self.scanInitiationMode == ScanInitiationMode.RecordingWidget:
# Run recording from RecWidget
self.triggerRecordingWidgetScan()

Expand Down
7 changes: 2 additions & 5 deletions imswitch/imcontrol/controller/controllers/ScanController.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@ def __init__(self, *args, **kwargs):
self.updateScanStageAttrs()
self.updateScanTTLAttrs()

# Connect NidaqManager signals
self._master.nidaqManager.sigScanBuilt.connect(
lambda _, deviceList: self.emitScanSignal(self._commChannel.sigScanBuilt, deviceList)
)
'''
self._master.nidaqManager.sigScanStarted.connect(
lambda: self.emitScanSignal(self._commChannel.sigScanStarted)
)
self._master.nidaqManager.sigScanDone.connect(self.scanDone)
self._master.nidaqManager.sigScanBuildFailed.connect(self.scanFailed)

'''
# Connect CommunicationChannel signals
self._commChannel.sigRunScan.connect(self.runScanExternal)
self._commChannel.sigAbortScan.connect(self.abortScan)
Expand Down
20 changes: 0 additions & 20 deletions imswitch/imcontrol/model/SetupInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,23 +270,6 @@ class EtSTEDInfo:
""" Name of the widefield laser to use. """


@dataclass(frozen=True)
class NidaqInfo:
timerCounterChannel: Optional[Union[str, int]] = None
""" Output for Counter for timing purposes. If an integer is specified, it
will be translated to "Dev1/ctr{timerCounterChannel}". """

startTrigger: bool = False
""" Boolean for start triggering for sync. """

def getTimerCounterChannel(self):
""" :meta private: """
if isinstance(self.timerCounterChannel, int):
return f'Dev1/ctr{self.timerCounterChannel}' # for backwards compatibility
else:
return self.timerCounterChannel



@dataclass(frozen=True)
class PyroServerInfo:
Expand Down Expand Up @@ -352,9 +335,6 @@ class SetupInfo:
etSTED: Optional[EtSTEDInfo] = field(default_factory=lambda: None)
""" EtSTED settings. Required to be defined to use etSTED functionality. """

nidaq: NidaqInfo = field(default_factory=NidaqInfo)
""" NI-DAQ settings. """

pyroServerInfo: PyroServerInfo = field(default_factory=PyroServerInfo)

_catchAll: CatchAll = None
Expand Down
Loading

0 comments on commit de2a0fa

Please sign in to comment.