Skip to content

Commit

Permalink
renamed package, added context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
arnobaer committed Oct 10, 2023
1 parent 429424c commit 34705c1
Show file tree
Hide file tree
Showing 122 changed files with 148 additions and 62 deletions.
14 changes: 7 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ recursive-include tests *.py
include docs/_config.yml
recursive-include docs *.md *.png

recursive-include comet_pqc/assets/config/chuck *.yaml
recursive-include comet_pqc/assets/config/sample *.yaml
recursive-include comet_pqc/assets/config/sequence *.yaml
recursive-include pqc/assets/config/chuck *.yaml
recursive-include pqc/assets/config/sample *.yaml
recursive-include pqc/assets/config/sequence *.yaml

recursive-include comet_pqc/assets/icons *.svg *.ico
recursive-include pqc/assets/icons *.svg *.ico

include comet_pqc/assets/schema/chuck.yaml
include comet_pqc/assets/schema/sample.yaml
include comet_pqc/assets/schema/sequence.yaml
include pqc/assets/schema/chuck.yaml
include pqc/assets/schema/sample.yaml
include pqc/assets/schema/sequence.yaml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PQC

PQC sensor measurements
Process Quality Control for CMS tracker

## Overview

Expand Down Expand Up @@ -43,4 +43,4 @@ See for pre-built Windows binaries in the releases section.

## License

comet-pqc is licensed under the [GNU General Public License Version 3](https://github.com/hephy-dd/comet-pqc/tree/master/LICENSE).
comet-pqc is licensed under the [GNU General Public License Version 3](https://github.com/hephy-dd/comet-pqc/tree/main/LICENSE).
10 changes: 9 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.46.0] - 2023-10-10
### Added
- Context menu for sequence tree items.

### Changed
- Renamed package `comet_pqc` to `pqc`.

## [0.45.0] - 2023-09-20
### Added
- Enhanced recontact strategy (#190).
Expand Down Expand Up @@ -384,7 +391,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Filter selection for type `moving`.
- Default HV source route terminal `rear` (#17).

[Unreleased]: https://github.com/hephy-dd/comet-pqc/compare/0.45.0...HEAD
[Unreleased]: https://github.com/hephy-dd/comet-pqc/compare/0.46.0...HEAD
[0.46.0]: https://github.com/hephy-dd/comet-pqc/compare/0.45.0...0.46.0
[0.45.0]: https://github.com/hephy-dd/comet-pqc/compare/0.44.0...0.45.0
[0.44.0]: https://github.com/hephy-dd/comet-pqc/compare/0.43.2...0.44.0
[0.43.2]: https://github.com/hephy-dd/comet-pqc/compare/0.43.1...0.43.2
Expand Down
1 change: 0 additions & 1 deletion comet_pqc/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ aux_links:
"PQC on GitHub":
- "//github.com/hephy-dd/comet-pqc"

footer_content: "Copyright &copy; 2019-2023 <a href=\"https://hephy.at\">HEPHY</a>. PQC is licensed under the <a href=\"https://github.com/hephy-dd/comet-pqc/tree/master/LICENSE\">GNU General Public License Version 3</a>."
footer_content: "Copyright &copy; 2019-2023 <a href=\"https://hephy.at\">HEPHY</a>. PQC is licensed under the <a href=\"https://github.com/hephy-dd/comet-pqc/tree/main/LICENSE\">GNU General Public License Version 3</a>."
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ nav_order: 10
# Changelog
{: .no_toc }

## 0.46.0

### Added
- Context menu for sequence tree.

## 0.45.0

### Added
Expand Down
6 changes: 3 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enabled: true
contacts: []
```
See [assets/config/sequence/default.yaml](https://github.com/hephy-dd/comet-pqc/blob/master/comet_pqc/assets/config/sequence/default.yaml) for reference.
See [assets/config/sequence/default.yaml](https://github.com/hephy-dd/comet-pqc/blob/main/pqc/assets/config/sequence/default.yaml) for reference.
Custom sequence configuration files can be imported using `File` &rarr;
`Sequence` &rarr; `Import...`.
Expand Down Expand Up @@ -143,7 +143,7 @@ enabled: true
contacts: []
```

See [assets/config/sample/default_hme_n.yaml](https://github.com/hephy-dd/comet-pqc/blob/master/comet_pqc/assets/config/sample/default_hmw_n.yaml) for reference.
See [assets/config/sample/default_hme_n.yaml](https://github.com/hephy-dd/comet-pqc/blob/main/pqc/assets/config/sample/default_hmw_n.yaml) for reference.

### Contacts

Expand Down Expand Up @@ -203,5 +203,5 @@ positions:
```

See
[assets/config/chuck/default.yaml](https://github.com/hephy-dd/comet-pqc/blob/master/comet_pqc/assets/config/chuck/default.yaml)
[assets/config/chuck/default.yaml](https://github.com/hephy-dd/comet-pqc/blob/main/pqc/assets/config/chuck/default.yaml)
for reference.
1 change: 1 addition & 0 deletions pqc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.46.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion comet_pqc/core/utils.py → pqc/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def make_path(*args) -> str:
"""Construct an absolute path relative to package path.
>>> make_path("assets", "sample.txt")
'/usr/local/lib/python/comet_pqc/assets/sample.txt'
'/usr/local/lib/python/pqc/assets/sample.txt'
"""
return os.path.join(PACKAGE_PATH, *args)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from PyQt5 import QtCore
from waitress.server import TcpWSGIServer

from comet_pqc import __version__
from pqc import __version__

__all__ = ["WebAPIWorker"]

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from PyQt5 import QtCore, QtWidgets

from comet_pqc.core.position import Position
from pqc.core.position import Position
from ..components import PositionWidget
from .panel import BasicPanel

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from PyQt5 import QtWidgets

from comet_pqc.utils import join_channels, split_channels
from pqc.utils import join_channels, split_channels

from .panel import Panel

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PyQt5 import QtWidgets

from comet_pqc.utils import format_metric, format_switch
from pqc.utils import format_metric, format_switch
from ..components import Metric
from .panel import Panel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import comet

from comet_pqc.settings import settings
from pqc.settings import settings
from ..components import PlotWidget
from ..components import Metric, stitch_pixmaps

Expand Down
4 changes: 2 additions & 2 deletions comet_pqc/view/panels/sample.py → pqc/view/panels/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from PyQt5 import QtCore, QtGui, QtWidgets

from comet_pqc.core import config
from comet_pqc.utils import make_path
from pqc.core import config
from pqc.utils import make_path
from ..sequence import SampleTreeItem
from ..sequencemanager import SequenceManagerDialog

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from PyQt5 import QtWidgets

from comet_pqc.settings import settings
from pqc.settings import settings

__all__ = ["OptionsWidget"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from comet import ResourceMixin
from comet.utils import escape_string, unescape_string

from comet_pqc.settings import settings
from pqc.settings import settings

__all__ = ["ResourcesWidget"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from PyQt5 import QtCore, QtWidgets

from comet_pqc.settings import settings
from comet_pqc.utils import from_table_unit, to_table_unit
from pqc.settings import settings
from pqc.utils import from_table_unit, to_table_unit

__all__ = ["TableWidget"]

Expand Down
File renamed without changes.
73 changes: 73 additions & 0 deletions comet_pqc/view/sequence.py → pqc/view/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,67 @@ def __init__(self, parent: Optional[QtWidgets.QWidget] = None) -> None:
self.setHeaderLabels(["Name", "Pos", "State"])
self.header().setMinimumSectionSize(32)

self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.showContextMenu)

def showContextMenu(self, position) -> None:
item = self.itemAt(position)
if item:
contextMenu = QtWidgets.QMenu(self)

# Enable Default

def recursiveEnableDefault(item):
for child in item.children():
if hasattr(child, "isEnabledDefault"):
child.setEnabled(child.isEnabledDefault())
recursiveEnableDefault(child)

def enableDefault():
recursiveEnableDefault(item)

if item.childCount():
action = contextMenu.addAction("Enable Default")
action.triggered.connect(enableDefault)

# Enable Failed

def recursiveEnableFailed(item):
for child in item.children():
enabled = child.state() in [
child.StoppedState,
child.ComplianceState,
child.TimeoutState,
child.ErrorState,
child.AnalysisErrorState,
]
child.setEnabled(enabled)
recursiveEnableFailed(child)

def enableFailed():
recursiveEnableFailed(item)

if item.childCount():
action = contextMenu.addAction("Enable Only Failed")
action.triggered.connect(enableFailed)

# Disable All

def recursiveDisableItem(item):
for child in item.children():
child.setEnabled(False)
recursiveDisableItem(child)

def disableAll():
recursiveDisableItem(item)

if item.childCount():
contextMenu.addSeparator()
action = contextMenu.addAction("Disable All")
action.triggered.connect(disableAll)

contextMenu.exec(self.viewport().mapToGlobal(position))

def addSampleItem(self, item) -> None:
self.addTopLevelItem(item)

Expand Down Expand Up @@ -180,6 +241,8 @@ class SequenceTreeItem(QtWidgets.QTreeWidgetItem):
def __init__(self) -> None:
super().__init__()
self.setCheckable(True)
self.setEnabled(False)
self.setEnabledDefault(False)

def children(self):
items = []
Expand Down Expand Up @@ -231,6 +294,12 @@ def isEnabled(self) -> bool:
def setEnabled(self, enabled: bool) -> None:
self.setChecked(0, enabled)

def isEnabledDefault(self) -> bool:
return self._is_enabled_default

def setEnabledDefault(self, state: bool) -> None:
self._is_enabled_default = state

def state(self) -> str:
return self.data(2, 0x2000)

Expand Down Expand Up @@ -279,6 +348,7 @@ def __init__(self) -> None:
self._sampleComment: str = ""
self.update_name()
self.setEnabled(False)
self.setEnabledDefault(False)
self.sequence = None

# Properties
Expand Down Expand Up @@ -416,6 +486,8 @@ def __init__(self, sample, contact):
self.id = contact.id
self.setName(contact.name)
self.setEnabled(contact.enabled)
self.setEnabledDefault(contact.enabled)
self._is_enabled_default = contact.enabled
self.contact_id = contact.contact_id
self.setDescription(contact.description)
self.reset_position()
Expand Down Expand Up @@ -459,6 +531,7 @@ def __init__(self, contact, measurement):
self.setName(measurement.name)
self.type = measurement.type
self.setEnabled(measurement.enabled)
self.setEnabledDefault(measurement.enabled)
self.parameters = copy.deepcopy(measurement.parameters)
self.default_parameters = copy.deepcopy(measurement.default_parameters)
self.setTags(measurement.tags)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions comet_pqc/workers/table.py → pqc/workers/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import comet

from comet_pqc.utils import from_table_unit, to_table_unit
from comet_pqc.core.timer import Timer
from pqc.utils import from_table_unit, to_table_unit
from pqc.core.timer import Timer

from ..core.request import Request
from ..core.position import Position
Expand Down
2 changes: 1 addition & 1 deletion pyinstaller/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import serial
import gpib_ctypes

from comet_pqc.__main__ import main
from pqc.__main__ import main

if __name__ == "__main__":
main()
20 changes: 10 additions & 10 deletions pyinstaller/windows_app.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import os
from pyinstaller_versionfile import create_versionfile

import comet_pqc
import pqc

# Application configurations
app_root = os.path.abspath(os.path.dirname(comet_pqc.__file__))
app_version = comet_pqc.__version__
app_root = os.path.abspath(os.path.dirname(pqc.__file__))
app_version = pqc.__version__
app_filename = f"pqc-{app_version}.exe"
app_icon = os.path.join(app_root, "assets", "icons", "pqc.ico")
app_title = "PQC"
Expand All @@ -16,16 +16,16 @@ app_copyright = "Copyright © 2019-2023 HEPHY"
app_organization = "HEPHY"

# Entry point for the application
launcher_code = "from comet_pqc.__main__ import main; main()"
launcher_code = "from pqc.__main__ import main; main()"

# Data files to be included in the output executable
datas = [
(os.path.join(app_root, "assets", "icons", "*.svg"), "comet_pqc/assets/icons"),
(os.path.join(app_root, "assets", "icons", "*.ico"), "comet_pqc/assets/icons"),
(os.path.join(app_root, "assets", "config", "chuck", "*.yaml"), "comet_pqc/assets/config/chuck"),
(os.path.join(app_root, "assets", "config", "sequence", "*.yaml"), "comet_pqc/assets/config/sequence"),
(os.path.join(app_root, "assets", "config", "sample", "*.yaml"), "comet_pqc/assets/config/sample"),
(os.path.join(app_root, "assets", "schema", "*.yaml"), "comet_pqc/assets/schema"),
(os.path.join(app_root, "assets", "icons", "*.svg"), "pqc/assets/icons"),
(os.path.join(app_root, "assets", "icons", "*.ico"), "pqc/assets/icons"),
(os.path.join(app_root, "assets", "config", "chuck", "*.yaml"), "pqc/assets/config/chuck"),
(os.path.join(app_root, "assets", "config", "sequence", "*.yaml"), "pqc/assets/config/sequence"),
(os.path.join(app_root, "assets", "config", "sample", "*.yaml"), "pqc/assets/config/sample"),
(os.path.join(app_root, "assets", "schema", "*.yaml"), "pqc/assets/schema"),
]

# Console will be displayed when the application is run
Expand Down
Loading

0 comments on commit 34705c1

Please sign in to comment.