[enums] extract enums to separate file
This commit is contained in:
parent
e43d60c416
commit
b388c7c68c
@ -1,22 +1,16 @@
|
|||||||
import os
|
import os
|
||||||
import nixview.constants as cnst
|
|
||||||
from PyQt5.QtCore import QAbstractItemModel, QModelIndex, Qt, QSize
|
from PyQt5.QtCore import QAbstractItemModel, QModelIndex, Qt, QSize
|
||||||
from PyQt5.QtGui import QIcon
|
from PyQt5.QtGui import QIcon
|
||||||
from PyQt5.QtWidgets import QTreeView, QTreeWidgetItem, QAbstractItemView, QHeaderView
|
from PyQt5.QtWidgets import QTreeView, QTreeWidgetItem, QAbstractItemView, QHeaderView
|
||||||
from enum import Enum
|
|
||||||
|
|
||||||
|
import nixview.constants as cnst
|
||||||
from nixview.util.file_handler import NodeType
|
from nixview.util.file_handler import NodeType
|
||||||
from nixview.util.descriptors import ItemDescriptor
|
from nixview.util.descriptors import ItemDescriptor
|
||||||
|
from nixview.util.enums import TreeType
|
||||||
|
|
||||||
column_names = ['Name', 'Type', 'Value', 'Description', 'ID',]
|
column_names = ['Name', 'Type', 'Value', 'Description', 'ID',]
|
||||||
|
|
||||||
|
|
||||||
class TreeType(Enum):
|
|
||||||
Full = "full view"
|
|
||||||
Metadata = "metadata view"
|
|
||||||
Data = "data view"
|
|
||||||
|
|
||||||
|
|
||||||
class NixTreeItem(QTreeWidgetItem):
|
class NixTreeItem(QTreeWidgetItem):
|
||||||
def __init__(self, node_descriptor, file_handler, parent=None):
|
def __init__(self, node_descriptor, file_handler, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
import nixio as nix
|
import nixio as nix
|
||||||
from enum import Enum
|
|
||||||
|
|
||||||
class PlotterTypes(Enum):
|
|
||||||
ImagePlotter = "image"
|
|
||||||
LinePlotter = "line"
|
|
||||||
CategoryPlotter = "category"
|
|
||||||
EventPlotter = "event"
|
|
||||||
|
|
||||||
|
|
||||||
def guess_best_xdim(array):
|
def guess_best_xdim(array):
|
||||||
|
30
nixview/util/enums.py
Normal file
30
nixview/util/enums.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
|
class NodeType(Enum):
|
||||||
|
Root = "root"
|
||||||
|
Section = "Section"
|
||||||
|
Block = "Block"
|
||||||
|
DataArray = "Data Array"
|
||||||
|
DataFrame = "Data Frame"
|
||||||
|
Property = "Property"
|
||||||
|
Dimension = "Dimension"
|
||||||
|
Source = "Source"
|
||||||
|
Tag = "Tag"
|
||||||
|
MultiTag = "Multi Tag"
|
||||||
|
Group = "Group"
|
||||||
|
Feature="Feature"
|
||||||
|
|
||||||
|
|
||||||
|
class TreeType(Enum):
|
||||||
|
Full = "full view"
|
||||||
|
Metadata = "metadata view"
|
||||||
|
Data = "data view"
|
||||||
|
|
||||||
|
|
||||||
|
class PlotterTypes(Enum):
|
||||||
|
ImagePlotter = "image"
|
||||||
|
LinePlotter = "line"
|
||||||
|
CategoryPlotter = "category"
|
||||||
|
EventPlotter = "event"
|
||||||
|
|
@ -1,23 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
import nixio as nix
|
import nixio as nix
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from enum import Enum
|
|
||||||
|
|
||||||
from nixview.util.descriptors import FileDescriptor, ItemDescriptor
|
from nixview.util.descriptors import FileDescriptor, ItemDescriptor
|
||||||
|
from nixview.util.enums import NodeType
|
||||||
class NodeType(Enum):
|
|
||||||
Root = "root"
|
|
||||||
Section = "Section"
|
|
||||||
Block = "Block"
|
|
||||||
DataArray = "Data Array"
|
|
||||||
DataFrame = "Data Frame"
|
|
||||||
Property = "Property"
|
|
||||||
Dimension = "Dimension"
|
|
||||||
Source = "Source"
|
|
||||||
Tag = "Tag"
|
|
||||||
MultiTag = "Multi Tag"
|
|
||||||
Group = "Group"
|
|
||||||
Feature="Feature"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user