straditize.widgets.colnames module¶
Widget for handling column names
Disclaimer
Copyright (C) 2018-2019 Philipp S. Sommer
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Classes
|
Manage the column names of the reader |
|
Reimplemented NavigationToolbar2 just to add an _init_toolbar method |
-
class
straditize.widgets.colnames.ColumnNamesManager(straditizer_widgets, item=None, *args, **kwargs)[source]¶ Bases:
straditize.widgets.StraditizerControlBase,psyplot_gui.common.DockMixin,PyQt5.QtWidgets.QSplitterManage the column names of the reader
- Parameters
straditizer_widgets (StraditizerWidgets) – The main widget for the straditizer GUI
item (QTreeWidgetItem) – The parent item in the
StraditizerWidgets.tree. If given, thesetup_children()is called with this item
Attributes
str(object=’’) -> str
str(object=’’) -> str
A QPushButton to find column names in the visible part of the
A QPushButton to load the highres image
A QPushButton to recognize text in the
colpicA checkable QPushButton to initialize a
selectorto select theThe QPushButton in the
straditize.widgets.StraditizerWidgetsA QCheckBox to find the column names (see
btn_find) for allA QCheckBox to set the
straditize.colnames.ColNamesReader.mirrorA QCheckBox to set the
straditize.colnames.ColNamesReader.flipA QCheckBox to ignore the part within the
A QTableWidget to display the column names
The
PIL.Image.Imageof the column name (see alsoThe
matplotlib.axes.Axesto display thecolpic_imThe canvas to display the
colpic_imThe extents of the
colpicin theim_rotatedThe matplotlib image of the
colpicThe currently selected column
The original height of the
main_canvasThe original width of the
main_canvasThe matplotlib image of the
The
matplotlib.axes.Axesto display theim_rotatedThe canvas to display the
im_rotatedThe rectangle to highlight a column (see
highlight_selected_col())True if the widget is refreshing
The
matplotlib.widgets.RectangleSelectorto select theA QLineEdit to set the
straditize.colnames.ColNamesReader.rotateMethods
Adjust the limits of the
main_axto fill the entire figureadjust_lims_after_resize(event)Adjust the limits of the
main_axafter resize of the figureStop the colpic selection in the
im_rotatedchange_ignore_data_part(checked)colname_changed(row, column)Update the column name in the
colnames_readerCreate the
selectorto enablecolpicselectionenable_or_disable_btn_find(*args, **kwargs)find_colnames([warn, full_image, all_cols])Find the column names automatically
flip(checked)TFlip the image
Highlight the column selected in the
colnames_tablesLoad a high resolution image
mirror(checked)Mirror the image
Plot the
colpicin thecolpic_axRecognize the text in the
colpicrefresh()Refresh from the straditizer
Remove the
im_rotatedand thecolpic_imRemove and disconnect the
selectorRemove and replot the
im_rotatedReset the dialog
rotate(val)Rotate the image
Set the x- and y-center before rotating or flipping
setup_children(item)Setup the children for this control
Check if a widget should be enabled
to_dock(main[, title, position])Enable or disable the colpic selection
Close the dialog when the
btn_select_namesbutton is clickedupdate_image(*args, **kwargs)Update the
colpicwith the extents of theselector-
NAVIGATION_LABEL= 'Use left-click of your mouse to move the image below and right-click to zoom in and out.'¶
-
SELECT_LABEL= 'Left-click and hold on the image to select the column name'¶
-
adjust_lims_after_resize(event)[source]¶ Adjust the limits of the
main_axafter resize of the figure
-
btn_find= None¶ A QPushButton to find column names in the visible part of the
im_rotated
-
btn_load_image= None¶ A QPushButton to load the highres image
-
btn_select_names= None¶ The QPushButton in the
straditize.widgets.StraditizerWidgetsto toggle the column names dialog
-
cancel_colpic_selection()[source]¶ Stop the colpic selection in the
im_rotated
-
cb_find_all_cols= None¶ A QCheckBox to find the column names (see
btn_find) for all columns and not just the one selected in thecolnames_table
-
cb_fliph= None¶ A QCheckBox to set the
straditize.colnames.ColNamesReader.mirror
-
cb_flipv= None¶ A QCheckBox to set the
straditize.colnames.ColNamesReader.flip
-
cb_ignore_data_part= None¶ A QCheckBox to ignore the part within the
straditize.colnames.ColNamesReader.data_ylim
-
colname_changed(row, column)[source]¶ Update the column name in the
colnames_readerThis method is called when a cell in the
colnames_tablehas been changed and updates the corresponding name in thecolnames_reader- Parameters
row (int) – The row of the cell in the
colnames_tablethat changedcolumn (int) – The column of the cell in the
colnames_tablethat changed
-
property
colnames_reader¶ The
straditize.straditizer.Straditizer.colnames_readerof the current straditizer
-
colnames_table= None¶ A QTableWidget to display the column names
-
colpic= None¶ The
PIL.Image.Imageof the column name (see alsostraditize.colnames.ColNamesReader.colpics)
-
colpic_ax= None¶ The
matplotlib.axes.Axesto display thecolpic_im
-
colpic_extents= None¶ The extents of the
colpicin theim_rotated
-
property
current_col¶ The currently selected column
-
fig_h= None¶ The original height of the
main_canvas
-
fig_w= None¶ The original width of the
main_canvas
-
find_colnames(warn=True, full_image=False, all_cols=None)[source]¶ Find the column names automatically
-
im_rotated= None¶ The matplotlib image of the
straditize.colnames.ColNamesReader.rotated_image
-
main_ax= None¶ The
matplotlib.axes.Axesto display theim_rotated
-
main_canvas= None¶ The canvas to display the
im_rotated
-
rect= None¶ The rectangle to highlight a column (see
highlight_selected_col())
-
property
refreshing¶ True if the widget is refreshing
-
remove_images()[source]¶ Remove the
im_rotatedand thecolpic_im
-
replot_figure()[source]¶ Remove and replot the
im_rotated
-
selector= None¶ The
matplotlib.widgets.RectangleSelectorto select thecolpic
-
setup_children(item)[source]¶ Setup the children for this control
This method is called to setup the children in the
StraditizerWidgets.tree. By default, it just creates a child QTreeWidgetItem and sets this control as it’s widget- Parameters
item (QTreeWidgetItem) – The top level item in the
StraditizerWidgets.tree
-
should_be_enabled(w)[source]¶ Check if a widget should be enabled
This function checks if a given widget w from the
widgets2disableattribute should be enabled or not- Parameters
w (QWidget) – The widget to check
- Returns
True, if the widget should be enabled
- Return type
-
toggle_dialog()[source]¶ Close the dialog when the
btn_select_namesbutton is clicked
-
txt_rotate= None¶ A QLineEdit to set the
straditize.colnames.ColNamesReader.rotate
Bases:
matplotlib.backend_bases.NavigationToolbar2Reimplemented NavigationToolbar2 just to add an _init_toolbar method
Methods
set_cursor(cursor)Set the current cursor to one of the
Cursorsenums values.Set the current cursor to one of the
Cursorsenums values.If required by the backend, this method should trigger an update in the backend event loop after the cursor is set, as this method may be called e.g. before a long-running task during which the GUI is not updated.