28 #ifndef QTDATAMANAGER_H_
29 #define QTDATAMANAGER_H_
48 #include <display/QtViewer/QtDataManager.ui.h>
49 #include <display/QtViewer/QtDataMgrMsSelect.ui.h>
50 #include <display/QtViewer/VOParam.ui.h>
51 #if ! defined(WITHOUT_DBUS)
52 #include <casaqt/QtDBus/dVO.h>
56 #include <QListWidget>
59 #if defined(__APPLE__)
61 #define TUPLE std::tuple
64 #define TUPLE std::tr1::tuple
69 template <
class T>
class ImageInterface;
74 class QtDisplayPanelGui;
83 class param :
public QGroupBox,
public Ui::VOParam {
86 param( QListWidget *l, QListWidgetItem *i, QWidget *parent=0 ) : QGroupBox(parent),
list(l),
item(i) { setupUi(
this); }
202 #if ! defined(WITHOUT_DBUS)
208 void removeVOParam( );
232 fprintf( stderr,
"HERE<3>:::: " );
256 dir_->setFilter( QDir::AllDirs | QDir::Files);
257 dir_->setSorting(QDir::Name);
264 tab_state( QLineEdit *le, QTreeWidget *t, std::set<int> s, QFrame *info_frame=0,
270 dir_->setFilter( QDir::AllDirs | QDir::Files);
271 dir_->setSorting(QDir::Name);
306 std::shared_ptr<QDir>
dir( ) {
367 #if ! defined(WITHOUT_DBUS)
371 bool updateVOstatus( );
372 QPushButton *new_vo_dismiss_button( QTableWidgetItem*, QString, QString );
373 bool collect_vo_parameters(
double &ra,
double &dec,
double &ra_size,
double &dec_size, QVariantMap ¶ms );
374 void vo_flag_missing_param( QLineEdit *widget );
376 typedef TUPLE<bool,QString,QString,QString,viewer::dvo::param*> vo_param_t;
377 std::vector<vo_param_t> voparameters;
378 edu::nrao::casa::dVO dvo;
379 std::set<QWidget*> dvo_missing_parameters;
381 std::map<QString,int> vo_label2col;
382 std::vector<QString> vo_urls;
383 std::vector<QString> vo_labels;
384 std::vector<QString> vo_labels_tip;
386 QColor vo_default_bg;
387 struct dvo_working_item {
390 bool operator<(
const dvo_working_item &other )
const {
return id < other.id; }
391 operator int( )
const {
return id; }
392 dvo_working_item(
int i ) : id(i), count(0) { }
393 dvo_working_item( QDBusPendingReply<int> i ) : id(i), count(0) { }
396 void increment( )
const { ((dvo_working_item*)
this)->count += 1; }
398 std::set<dvo_working_item> dvo_working_set;
399 QPushButton *vo_current_action;
401 void vo_clear_status_delayed(
int seconds );
402 void vo_action_with_timeout(
int id,
int seconds, QString msg );
403 bool vo_action_with_timeout_active( )
const {
return vo_action_timeout->isActive( ); }
404 void vo_action_with_timeout_reset( ) {
405 if ( vo_action_with_timeout_active( ) ) vo_action_timeout->start( );
407 void vo_action_with_timeout_complete( );
411 void vo_service_select(
const QString &service ) { vo_selected_service = service; }
412 void vo_selection_changed( );
414 void vo_clear_table( ) {
416 vo_table->setRowCount( 0 );
418 vo_label2col.clear( );
421 vo_labels_tip.clear( );
423 void vo_launch_query( );
424 void vo_fetch_data( );
425 void vo_clear_param( );
426 void vo_query_begin(
int,
const QString&,
const QtStringMap& );
427 void vo_query_complete(
int,
const QString&,
const QtStringMap& );
428 void vo_query_description(
int,
const QString&,
const QtStringMap& );
429 void vo_query_row(
int,
const QString&,
const QtStringMap& );
430 void vo_error(
int,
const QString&,
const QString& );
431 void vo_dismiss_row( );
432 void vo_fetch_complete(
int, QString );
433 void vo_fetch_progress(
int,QString,
double,
double,
double,
double);
435 void vo_clear_status( );
436 void vo_disable_actions( );
437 void vo_enable_actions( );
438 void vo_action_timed_out( );
441 void error(
const QString &msg ) {
442 vo_status->setStyleSheet(
"color: red");
443 vo_status->setText( msg );
445 void status(
const QString &msg ) {
446 vo_status->setStyleSheet(
"color: black");
447 vo_status->setText( msg );
449 void warning(
const QString &msg ) {
450 vo_status->setStyleSheet(
"color: orange");
451 vo_status->setText( msg );
454 void vo_init_columns( ) {
455 vo_table->setColumnCount( 2 );
456 vo_table->setColumnWidth(0,30);
457 QTableWidgetItem *
first =
new QTableWidgetItem(
"" );
458 vo_table->setHorizontalHeaderItem(0,first);
459 QTableWidgetItem *
second =
new QTableWidgetItem(
"1" );
460 vo_table->setHorizontalHeaderItem(1,second);
463 QDoubleValidator *ra_val;
464 QDoubleValidator *dec_val;
465 QDoubleValidator *ra_size_val;
466 QDoubleValidator *dec_size_val;
468 QTimer *vo_action_timeout;
469 int vo_action_timeout_id;
470 QString vo_action_timeout_msg;
471 bool vo_actions_are_enabled;
473 std::map<QString,QString> vo_service_name_to_url;
474 QString vo_selected_service;
475 std::vector<int> vo_selected_rows;
QString canonical_path(const QString &)
void expandItem(QTreeWidgetItem *item)
notify_func_t error_func_
validation_msg(const QString &s, output_format_t f, valid_t v, const QString &m)
void update_region_list(tab_state &ts)
infofield_list_t * info_fields_
Ui::QtDataMgrMsSelect * ms_selection
Contains common enums, constants, and methods for DS9 files.
QLineEdit * outFileLine()
region_map_t region_to_treeitem
QHash< QString, int > uiDataType_
void region_ds9_csys_disable(bool)
QLineEdit * output_name_line_
QtDataManager(QtDisplayPanelGui *panel=0, const char *name=0, QWidget *parent=0)
void region_tab_notify(const std::string &value, tab_state &)
void region_output_target_changed(bool)
treeitem_map_t treeitem_to_region
infofield_list_t load_ifields
void region_tab_error(const std::string &value, tab_state &)
void buildDirTree(std::string newdir="")
void updateDirectory(const std::string &)
void img_output_target_changed(const QString &s="")
QtDisplayPanelGui * panel_
bool export_to_casa(casacore::ImageInterface< float > *img, casacore::String outFile)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void changeItemSelection()
QString last_image_extension_tweak_string
avoid setting the export type more than once
QHash< int, QString > dataType_
void region_selection_change(viewer::Region *rgn, bool selected)
void handle_region_update(viewer::Region *, std::string)
void fill_image_info(const std::string &)
void load_regions_clicked()
void notify(QtDataManager *mgr, const std::string &s)
display_data_map_t display_datas
void(QtDataManager::* notify_func_t)(const std::string &, tab_state &)
validation_msg operator=(const validation_msg &o)
validation_msg(const validation_msg &o)
void leaveopenButtonClicked(bool checked)
All regions are specified in "linear coordinates", not "pixel coordinates".
void showlelButtonClicked(bool checked)
validation_msg output_validation(const QString &, const QString &, validation_msg::output_format_t) const
const std::set< int > & filter() const
void region_item_state_change(QTreeWidgetItem *, int)
tab_state(QLineEdit *le, QTreeWidget *t, std::set< int > s, QFrame *info_frame=0, infofield_list_t *info_fields=0, notify_func_t f=0, QTreeWidget *d=0, QLineEdit *on=0, notify_func_t oerr=0)
std::string path(const std::string &name)
void createButtonClicked()
tab_state(const tab_state &o)
std::map< QString, QtDisplayData * > display_data_map_t
casacore::Casarc & rc
connection to rc file
QHash< QString, int > uiDisplayType_
viewer::SlicerGen * slice_gen
void enterEvent(QEvent *event)
QStringList analyseFITSImage(QString path)
void restoreToOld_()
Restore viewer state to existing panel.
The main display window for the Qt version of the viewer.
void notifyErr(QtDataManager *mgr, const std::string &s)
bool operator<(const HeaderItemInfo &left, const HeaderItemInfo &right)
This class provides a priori image information derived from the image itself.
std::map< QTreeWidgetItem *, viewer::Region * > treeitem_map_t
std::shared_ptr< QDir > dir()
std::map< viewer::Region *, QTreeWidgetItem * > region_map_t
void update_regrid_options()
QVector< int > exportTypes_
void region_output_target_changed(const QString &s="")
param(QListWidget *l, QListWidgetItem *i, QWidget *parent=0)
void changeTabContext(int)
QHash< QString, int > displayType_
void tableReadErrorSignal(casacore::String msg)
void clickItem(QTreeWidgetItem *item)
const Double second
Time interval [T]:
void load_tab_notify(const std::string &value, tab_state &)
std::string guimethod_to_iamethod(const QString &)
QString last_region_extension_tweak_string
void image_tab_notify(const std::string &value, tab_state &)
std::string dirStr() const
void showEvent(QShowEvent *event)
notify_func_t notify_func_
void image_tab_error(const std::string &value, tab_state &)
std::set< int > filtered_types_
void showTab(std::string)
void restoreToNew_()
Create new display panel, restore viewer state to it.
std::shared_ptr< QDir > dir_
void showDDCreateError_(casacore::String)
void enable_disable_regrid(bool)
infofield_list_t * infoFields()
viewer::ImageProperties image_properties
output_format_t output_format
String: the storage and methods of handling collections of characters.
void enable_disable_slice(const QString &)
bool isQualImg(const QString &extexpr)
bool export_to_fits(casacore::ImageInterface< float > *img, std::string outFile)
void showDisplayButtons(int, const QString &name=QString((const char *) 0))
void hideDisplayButtons()
void mousePressEvent(QMouseEvent *event)
entry of flexible VO parameters...
void restoreTo_(QtDisplayPanel *dp)
Restore viewer state to given panel.
void update_slice_options(int ddtp, const QString &name)
void update_dd_list(tab_state &ts)
void showSliceButtonClicked(bool checked)
void updateDisplayDatas(QtDisplayData *qdd=0, bool autoRegister=true)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
std::map< int, tab_state > tab_info_map_t
void getSpectralCoordFlags(const casacore::ImageInterface< float > *img, bool &preferVelocity, bool &opticalVelocity, bool &preferWavelength, bool &preferAirWavelength)
std::list< std::pair< QGroupBox *, QLineEdit * > > infofield_list_t
void img_output_target_changed(bool)
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.