-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from hephy-dd/devel-0.9.x
0.9.0
- Loading branch information
Showing
76 changed files
with
161 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ nav: | |
markdown_extensions: | ||
- smarty | ||
extra: | ||
version: 0.3.1 | ||
version: 0.9.0 | ||
theme: | ||
name: readthedocs | ||
locale: en |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.9.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
from typing import Dict, Optional | ||
|
||
from PyQt5 import QtCore, QtWidgets | ||
|
||
|
||
class BadStripSelectDialog(QtWidgets.QDialog): | ||
|
||
def __init__(self, parent: Optional[QtWidgets.QWidget]) -> None: | ||
super().__init__(parent) | ||
|
||
self.setObjectName("BadStripSelectDialog") | ||
self.setWindowTitle("Select Bad Strips") | ||
|
||
self.statistics = None | ||
|
||
self.remeasureCountSpinBox = QtWidgets.QSpinBox(self) | ||
self.remeasureCountSpinBox.setRange(1, 99) | ||
self.remeasureCountSpinBox.valueChanged.connect(self.updatePreview) | ||
|
||
self.previewTreeWidget = QtWidgets.QTreeWidget(self) | ||
self.previewTreeWidget.setHeaderLabels(["Strip", "Count"]) | ||
self.previewTreeWidget.setRootIsDecorated(False) | ||
|
||
self.buttonBox = QtWidgets.QDialogButtonBox(self) | ||
self.buttonBox.addButton(QtWidgets.QDialogButtonBox.Ok) | ||
self.buttonBox.addButton(QtWidgets.QDialogButtonBox.Cancel) | ||
self.buttonBox.accepted.connect(self.accept) | ||
self.buttonBox.rejected.connect(self.reject) | ||
|
||
layout = QtWidgets.QVBoxLayout(self) | ||
layout.addWidget(QtWidgets.QLabel("Minimal Re-Measure Count")) | ||
layout.addWidget(self.remeasureCountSpinBox) | ||
layout.addWidget(QtWidgets.QLabel("Preview")) | ||
layout.addWidget(self.previewTreeWidget) | ||
layout.addWidget(self.buttonBox) | ||
|
||
def readSettings(self) -> None: | ||
settings = QtCore.QSettings() | ||
settings.beginGroup(self.objectName()) | ||
geometry = settings.value("geometry", QtCore.QByteArray(), QtCore.QByteArray) | ||
remeasureCount = settings.value("remeasureCount", 1, int) | ||
settings.endGroup() | ||
self.restoreGeometry(geometry) | ||
self.setRemeasureCount(remeasureCount) | ||
|
||
def writeSettings(self) -> None: | ||
settings = QtCore.QSettings() | ||
settings.beginGroup(self.objectName()) | ||
settings.setValue("geometry", self.saveGeometry()) | ||
settings.setValue("remeasureCount", self.remeasureCount()) | ||
settings.endGroup() | ||
|
||
def setRemeasureCount(self, count: int) -> None: | ||
self.remeasureCountSpinBox.setValue(count) | ||
|
||
def remeasureCount(self) -> int: | ||
return self.remeasureCountSpinBox.value() | ||
|
||
def setStatistics(self, statistics) -> None: | ||
self.statistics = statistics | ||
self.updatePreview() | ||
|
||
def selectedStrips(self) -> str: | ||
threshold = self.remeasureCount() | ||
strips = self.filterStrips(threshold).keys() | ||
return ", ".join([format(strip) for strip in strips]) | ||
|
||
def updatePreview(self) -> None: | ||
threshold = self.remeasureCount() | ||
self.previewTreeWidget.clear() | ||
root = self.previewTreeWidget.invisibleRootItem() | ||
for strip, count in self.filterStrips(threshold).items(): | ||
item = QtWidgets.QTreeWidgetItem([str(strip), str(count)]) | ||
root.addChild(item) | ||
|
||
def filterStrips(self, threshold: int) -> Dict[str, int]: | ||
strips: Dict[str, int] = {} | ||
if self.statistics is not None: | ||
for strip, counter in self.statistics.remeasure_counter.items(): | ||
values = counter.values() | ||
max_value = max(values or [0]) | ||
if max_value >= threshold: | ||
strips[strip] = max_value | ||
return strips |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.