Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
dbutils::gui::DAQConfigEditorDisplay Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/DatabaseUtils/cxx/include/GUI/DAQConfigEditorDisplay.h"

Inheritance diagram for dbutils::gui::DAQConfigEditorDisplay:
dbutils::gui::BasicEditorDisplay

Public Slots

void loadThresholdsAndMasks ()
 
void addInitialRow ()
 
void reloadCurrentDataset ()
 
void loadNewDataset ()
 
void saveChanges ()
 
void saveChangesWithNewName ()
 
void showHelpDialog ()
 
virtual void reactToDataChange ()
 
virtual void reactToDataSave ()
 

Public Member Functions

 DAQConfigEditorDisplay (QWidget *parent=0)
 
bool hasChanges () const
 

Protected Member Functions

bool _doReloadCurrentDataset (const dbutils::daqconfig::IDSpec &idSpec)
 
bool _doLoadNewDataset (const dbutils::daqconfig::IDSpec &idSpec)
 
bool _doSaveChanges (const dbutils::daqconfig::IDSpec &oldIdSpec, const dbutils::daqconfig::IDSpec &newIdSpec, const dbutils::daqconfig::GlobalNameSpec &newNameSpec)
 
virtual void closeEvent (QCloseEvent *event)
 
bool _confirmSave ()
 
bool _getUserResponseToGlobalCopyFailure (const novadaq::Status &status)
 
void _addHelpMenu (std::string customText="")
 

Protected Attributes

QAction * _saveAction
 
QAction * _saveAsAction
 
SettingsDisplay_settingsDisplay
 
boost::shared_ptr< dbutils::daqconfig::GlobalNameSpec_globalNameSpecPtr
 
int64_t _currentGlobalConfigId
 

Private Attributes

CustomTabWidget_tabWidget
 

Detailed Description

Class for displaying the tabs that make up the graphical configuration editor.

Author
Kurt Biery
Version
Revision
1.12.14.1
Date
2019/09/27 00:07:04

Definition at line 21 of file DAQConfigEditorDisplay.h.

Constructor & Destructor Documentation

dbutils::gui::DAQConfigEditorDisplay::DAQConfigEditorDisplay ( QWidget *  parent = 0)

Definition at line 31 of file DAQConfigEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_addHelpMenu(), dbutils::gui::BasicEditorDisplay::_currentGlobalConfigId, dbutils::gui::BasicEditorDisplay::_globalNameSpecPtr, dbutils::gui::BasicEditorDisplay::_settingsDisplay, _tabWidget, addInitialRow(), dbutils::gui::CustomTabWidget::addTab(), om::cerr, g4zmq::connect(), allTimeWatchdog::endl, novadaq::EnvVarCache::getEnvVar(), novadaq::EnvVarCache::getInstance(), dbutils::gui::CustomTabWidget::isTopLevel(), dbutils::gui::BasicEditorDisplay::loadNewDataset(), loadThresholdsAndMasks(), dbutils::gui::BasicEditorDisplay::reactToDataChange(), dbutils::gui::BasicEditorDisplay::reactToDataSave(), string, and make_root_from_grid_output::tr.

32 {
33  std::string detectorString =
34  novadaq::EnvVarCache::getInstance().getEnvVar("NOVADAQ_ENVIRONMENT");
35  if (detectorString.length() == 0) {
36  detectorString = "NOVADAQ_ENVIRONMENT_EnvVar_NeedsToBeSet";
37  }
38 
39  // Menu option to call the scripts that
40  // loads the threshold and masks generated in pedestal runner
41  QMenu* actionMenu = menuBar()->addMenu(tr("&Action"));
42  QAction* genScriptAction =
43  actionMenu->addAction(tr("&Load Thresholds and Masks"));
44  QObject::connect(genScriptAction, SIGNAL(triggered()),
45  this, SLOT(loadThresholdsAndMasks()));
46  QAction* addInitialRowAction =
47  actionMenu->addAction(tr("&Add Initial Row To Displayed Table"));
48  QObject::connect(addInitialRowAction, SIGNAL(triggered()),
49  this, SLOT(addInitialRow()));
50 
51  _addHelpMenu();
52 
53 
54 
56  reset(new GlobalNameSpec("InitialGlobalConfig", "DCS",
57  detectorString));
59  if (! NamedConfigUtils::getGlobalConfigId((*_globalNameSpecPtr),
61  std::cerr << "Error fetching globalConfigId." << std::endl;
62  }
63 // IDSpec idSpec(_currentGlobalConfigId, IDSpec::GLOBAL,
64 // (_globalNameSpecPtr->isSlowControlsConfiguration() ?
65 // IDSpec::SLOWCONTROLS : IDSpec::DAQ));
66 
67  std::vector<std::string> tableDefinitions;
68  _tabWidget = new CustomTabWidget(this);
69  _tabWidget->isTopLevel(true);
70  QObject::connect(_tabWidget, SIGNAL(aChangeWasMade()),
71  this, SLOT(reactToDataChange()));
72  QObject::connect(_tabWidget, SIGNAL(dataWasSaved()),
73  this, SLOT(reactToDataSave()));
74 
75  // DCM Connections
76  tableDefinitions.clear();
77  tableDefinitions +=
78  "NovaDatabase/tables/DAQConfig/DCMApplicationConnectParameters.xml";
79 
80  TabbedSetOfTreeEditors* editorSet =
81  new TabbedSetOfTreeEditors("DCMApplication", "connections",
82  tableDefinitions,this);
83  //editorSet->loadData(idSpec);
84  _tabWidget->addTab(editorSet, "DCM Connection");
85 
86  // DDT Connect
87  tableDefinitions.clear();
88  tableDefinitions +=
89  "NovaDatabase/tables/DAQConfig/DDTManagerConnectParameters.xml";
90 
91  editorSet =
92  new TabbedSetOfTreeEditors("DDTManager", "connections",
93  tableDefinitions, this);
94  //editorSet->loadData(idSpec);
95  _tabWidget->addTab(editorSet, "DDT Manager");
96 
97 
98  // DCM Hardware
99  tableDefinitions.clear();
100  tableDefinitions +=
101  "NovaDatabase/tables/DAQConfig/FEBEnableMasks.xml",
102  "NovaDatabase/tables/DAQConfig/PixelEnableMasks.xml",
103  "NovaDatabase/tables/DAQConfig/PixelThresholds.xml",
104  "NovaDatabase/tables/DAQConfig/DCMFPGAFirmwareLocations.xml",
105  "NovaDatabase/tables/DAQConfig/FEBFPGAFirmwareLocations.xml",
106  "NovaDatabase/tables/DAQConfig/DCMApplicationParameters.xml",
107  "NovaDatabase/tables/DAQConfig/TimingSystemSettings.xml",
108  "NovaDatabase/tables/DAQConfig/DCMDataDevParameters.xml",
109  "NovaDatabase/tables/DAQConfig/DCMFPGAParameters.xml",
110  "NovaDatabase/tables/DAQConfig/ASICRegisterSettings.xml",
111  "NovaDatabase/tables/DAQConfig/DSODataRegulatorSettings.xml",
112  "NovaDatabase/tables/DAQConfig/FEBPulserParameters.xml",
113  "NovaDatabase/tables/DAQConfig/PixelOffsets.xml",
114  "NovaDatabase/tables/DAQConfig/DCMSystemParameters.xml";
115 
116  editorSet =
117  new TabbedSetOfTreeEditors("DCMApplication", "hardware",
118  tableDefinitions,this);
119  //editorSet->loadData(idSpec);
120  _tabWidget->addTab(editorSet, "DCM Hardware");
121 
122  // DCM Run
123  tableDefinitions.clear();
124  tableDefinitions +=
125  "NovaDatabase/tables/DAQConfig/DCMApplicationRunParameters.xml",
126  "NovaDatabase/tables/DAQConfig/DCMDataDevRunParameters.xml",
127  "NovaDatabase/tables/DAQConfig/DCMSystemRunParameters.xml";
128 
129  editorSet =
130  new TabbedSetOfTreeEditors("DCMApplication", "run",
131  tableDefinitions,this);
132  //editorSet->loadData(idSpec);
133  _tabWidget->addTab(editorSet, "DCM Run");
134 
135  // DaqMonitor Run
136  tableDefinitions.clear();
137  tableDefinitions +=
138  "NovaDatabase/tables/DAQConfig/DaqMonitorRunParameters.xml";
139 
140  editorSet =
141  new TabbedSetOfTreeEditors("DaqMonitor", "run",
142  tableDefinitions,this);
143  //editorSet->loadData(idSpec);
144  _tabWidget->addTab(editorSet, "DaqMonitor Run");
145 
146  // BNEVB Run
147  tableDefinitions.clear();
148  tableDefinitions +=
149  "NovaDatabase/tables/DAQConfig/BNEVBRunParameters.xml";
150 
151  editorSet =
152  new TabbedSetOfTreeEditors("BufferNodeEVB", "run",
153  tableDefinitions, this);
154  //editorSet->loadData(idSpec);
155  _tabWidget->addTab(editorSet, "BNEVB Run");
156 
157  // GT Run
158  tableDefinitions.clear();
159  tableDefinitions +=
160  "NovaDatabase/tables/DAQConfig/CalibrationTriggers.xml",
161  "NovaDatabase/tables/DAQConfig/SpillTriggers.xml",
162  "NovaDatabase/tables/DAQConfig/DataDrivenTriggers.xml",
163  "NovaDatabase/tables/DAQConfig/DAQStatusTriggers.xml",
164  "NovaDatabase/tables/DAQConfig/ExternalTriggers.xml",
165  "NovaDatabase/tables/DAQConfig/ManualTriggers.xml",
166  "NovaDatabase/tables/DAQConfig/SNEWSTriggers.xml",
167  "NovaDatabase/tables/DAQConfig/SuperNovaTrigger.xml",
168  "NovaDatabase/tables/DAQConfig/SuperNovaFilter.xml",
169  "NovaDatabase/tables/DAQConfig/GlobalThrottle.xml",
170  "NovaDatabase/tables/DAQConfig/DDTThrottle.xml",
171  "NovaDatabase/tables/DAQConfig/SNEWSPipe.xml",
172  "NovaDatabase/tables/DAQConfig/GTQueue.xml",
173  "NovaDatabase/tables/DAQConfig/GTGeneral.xml",
174  "NovaDatabase/tables/DAQConfig/TriggerOffsets.xml";
175 
176  TabbedSetOfTableEditors* editorSet2 =
177  new TabbedSetOfTableEditors("GlobalTrigger", "run",
178  tableDefinitions,this);
179  //editorSet2->loadData(idSpec);
180  _tabWidget->addTab(editorSet2, "Global Trigger Run");
181 
182  // DL Run
183  tableDefinitions.clear();
184  tableDefinitions +=
185  "NovaDatabase/tables/DAQConfig/DataLoggerStreams.xml",
186  "NovaDatabase/tables/DAQConfig/DataLoggerSystemParameters.xml";
187 
188  editorSet2 =
189  new TabbedSetOfTableEditors("DataLogger", "run",
190  tableDefinitions,this);
191  //editorSet2->loadData(idSpec);
192  _tabWidget->addTab(editorSet2, "Data Logger Run");
193 
194 
195  _settingsDisplay = new SettingsDisplay();
196  this->show();
197  loadNewDataset();
198 // _settingsDisplay->updateNamedConfiguration(*_globalNameSpecPtr);
199 
200  QVBoxLayout* thisDisplayLayout = new QVBoxLayout;
201  thisDisplayLayout->addWidget(_tabWidget);
202  thisDisplayLayout->addWidget(_settingsDisplay);
203  QWidget* tmpWidget = new QWidget();
204  tmpWidget->setContentsMargins(0,5,0,0);
205  tmpWidget->setLayout(thisDisplayLayout);
206 
207  setCentralWidget(tmpWidget);
208 
209 }
static EnvVarCache & getInstance()
Definition: EnvVarCache.cpp:12
OStream cerr
Definition: OStream.cxx:7
void isTopLevel(bool setting=true)
void _addHelpMenu(std::string customText="")
def connect(endpoint="tcp://127.0.0.1:5555")
Definition: g4zmq.py:15
boost::shared_ptr< dbutils::daqconfig::GlobalNameSpec > _globalNameSpecPtr
std::string getEnvVar(std::string name)
Definition: EnvVarCache.cpp:33
int addTab(QWidget *page, const QString &label)
enum BeamMode string

Member Function Documentation

void dbutils::gui::BasicEditorDisplay::_addHelpMenu ( std::string  customText = "")
protectedinherited

Definition at line 512 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_customHelpText, g4zmq::connect(), dbutils::gui::BasicEditorDisplay::showHelpDialog(), and make_root_from_grid_output::tr.

Referenced by DAQConfigEditorDisplay(), and dbutils::gui::DCSConfigEditorDisplay::DCSConfigEditorDisplay().

513 {
514  _customHelpText = customText;
515 
516  QMenu* helpMenu = menuBar()->addMenu(tr("&Help"));
517  QAction* helpAction =
518  helpMenu->addAction(tr("&Help"));
519  QObject::connect(helpAction, SIGNAL(triggered()),
520  this, SLOT(showHelpDialog()));
521 }
def connect(endpoint="tcp://127.0.0.1:5555")
Definition: g4zmq.py:15
bool dbutils::gui::BasicEditorDisplay::_confirmSave ( )
protectedinherited

Definition at line 416 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_getUserResponseToGlobalCopyFailure(), novadaq::EnvVarCache::getEnvVar(), novadaq::EnvVarCache::getInstance(), dbutils::gui::BasicEditorDisplay::hasChanges(), runNovaSAM::retCode, and string.

Referenced by dbutils::gui::BasicEditorDisplay::saveChanges(), dbutils::gui::BasicEditorDisplay::saveChangesWithNewName(), and dbutils::gui::BasicEditorDisplay::~BasicEditorDisplay().

417 {
418  if (! hasChanges()) {return false;}
419 
420  std::string dbString =
422  QMessageBox confirmBox(this);
423 
424  std::string msgText = "You are about to update the \"";
425  msgText.append(dbString);
426  msgText.append("\" database.");
427  confirmBox.setText(msgText.c_str());
428 
429  msgText = "Are you sure that you want to save your changes to the \"";
430  msgText.append(dbString);
431  msgText.append("\" database?");
432  confirmBox.setInformativeText(msgText.c_str());
433 
434  confirmBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
435  confirmBox.setDefaultButton(QMessageBox::No);
436  int retCode = confirmBox.exec();
437 
438  return (retCode == QMessageBox::Yes);
439 }
static EnvVarCache & getInstance()
Definition: EnvVarCache.cpp:12
virtual bool hasChanges() const =0
std::string getEnvVar(std::string name)
Definition: EnvVarCache.cpp:33
enum BeamMode string
bool dbutils::gui::DAQConfigEditorDisplay::_doLoadNewDataset ( const dbutils::daqconfig::IDSpec idSpec)
protectedvirtual

Implements dbutils::gui::BasicEditorDisplay.

Definition at line 223 of file DAQConfigEditorDisplay.cpp.

References _doSaveChanges(), _tabWidget, and dbutils::gui::CustomTabWidget::loadData().

Referenced by _doReloadCurrentDataset().

224 {
225  return _tabWidget->loadData(idSpec);
226 }
bool loadData(const dbutils::daqconfig::IDSpec &idSpec)
bool dbutils::gui::DAQConfigEditorDisplay::_doReloadCurrentDataset ( const dbutils::daqconfig::IDSpec idSpec)
protectedvirtual

Implements dbutils::gui::BasicEditorDisplay.

Definition at line 217 of file DAQConfigEditorDisplay.cpp.

References _doLoadNewDataset(), _tabWidget, and dbutils::gui::CustomTabWidget::loadData().

Referenced by hasChanges().

218 {
219  return _tabWidget->loadData(idSpec);
220 }
bool loadData(const dbutils::daqconfig::IDSpec &idSpec)
bool dbutils::gui::DAQConfigEditorDisplay::_doSaveChanges ( const dbutils::daqconfig::IDSpec oldIdSpec,
const dbutils::daqconfig::IDSpec newIdSpec,
const dbutils::daqconfig::GlobalNameSpec newNameSpec 
)
protectedvirtual

Implements dbutils::gui::BasicEditorDisplay.

Definition at line 229 of file DAQConfigEditorDisplay.cpp.

References _tabWidget, and dbutils::gui::CustomTabWidget::saveChanges().

Referenced by _doLoadNewDataset().

232 {
233  return _tabWidget->saveChanges(oldIdSpec, newIdSpec, newNameSpec);
234 }
bool saveChanges(const dbutils::daqconfig::IDSpec &oldGlobalIdSpec, const dbutils::daqconfig::IDSpec &newGlobalIdSpec, const dbutils::daqconfig::GlobalNameSpec &newGlobalNameSpec)
bool dbutils::gui::BasicEditorDisplay::_getUserResponseToGlobalCopyFailure ( const novadaq::Status status)
protectedinherited

Definition at line 442 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_currentGlobalConfigId, om::cerr, novadaq::Status::code, allTimeWatchdog::endl, novadaq::Status::message, runNovaSAM::retCode, and string.

Referenced by dbutils::gui::BasicEditorDisplay::_confirmSave(), dbutils::gui::BasicEditorDisplay::saveChanges(), dbutils::gui::BasicEditorDisplay::saveChangesWithNewName(), and dbutils::gui::BasicEditorDisplay::~BasicEditorDisplay().

443 {
444  if (statusObj.code ==
445  NamedConfigUtils::COPY_FOUND_UPDATE_IN_PROGRESS) {
446  std::string msgText = "A problem was found when saving changes to ";
447  msgText.append("the database.<br/><br/>");
448  msgText.append("The creation of a configuration with the same ");
449  msgText.append("name and DCM operating mode is currently in ");
450  msgText.append("progress. (Attempting to copy global ");
451  msgText.append("configuration with ID ");
452  msgText.append(boost::lexical_cast<std::string>
454  msgText.append(".)");
455  msgText.append("<ul><li>Detailed message: \"");
456  msgText.append(statusObj.message);
457  msgText.append("\"</li></ul>");
458  msgText.append("Please try again in a few minutes, or if ");
459  msgText.append("this problem persists, use the ");
460  msgText.append("<a href=\"https://cdcvs.fnal.gov/redmine/projects/novadaq-config-mgmt/wiki/How_To_recover_from_a_failed_pedestal_upload_-_December_2011\">MarkConfigChangesDone</a> utility to fix the issue.");
461  msgText.append("<br/><br/>Another alternative is to save ");
462  msgText.append("this configuration dataset with a different ");
463  msgText.append("name (use File-&gt;Save As).");
464  QMessageBox::warning(this, "Save Warning", msgText.c_str());
465 
466  return false;
467  }
468  else if (statusObj.code ==
469  NamedConfigUtils::COPY_FOUND_INTERMEDIATE_UPDATE) {
470  QMessageBox messageBox(this);
471  messageBox.setIcon(QMessageBox::Warning);
472  messageBox.setWindowTitle("Save Warning");
473 
474  std::string msgText = "A problem was found when saving changes to ";
475  msgText.append("the database.<br/><br/>");
476  msgText.append("Intermediate changes will be obscured by ");
477  msgText.append("this change. (Attempting to copy global ");
478  msgText.append("configuration with ID ");
479  msgText.append(boost::lexical_cast<std::string>
481  msgText.append(".)");
482  msgText.append("<ul><li>Detailed message: \"");
483  msgText.append(statusObj.message);
484  msgText.append("\"</li></ul>");
485  messageBox.setText(msgText.c_str());
486 
487  msgText = "Do you want to save anyway? (<b>Please Note</b> that ";
488  msgText.append("if you say Yes, the dataset that you are ");
489  msgText.append("currently saving will take precedence over the ");
490  msgText.append("existing one with the same name and DCM operating ");
491  msgText.append("mode <b>and</b> differences will <b>not</b> be ");
492  msgText.append("automatically brought forward.)");
493  messageBox.setInformativeText(msgText.c_str());
494 
495  messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
496  messageBox.setDefaultButton(QMessageBox::No);
497  int retCode = messageBox.exec();
498 
499  return (retCode == QMessageBox::Yes);
500  }
501  else if (statusObj.code != NamedConfigUtils::COPY_SUCCEEDED) {
502  std::cerr << "Unable to create a copy of the named "
503  << "global configuration with ID = "
504  << _currentGlobalConfigId << ": " << statusObj.message
505  << std::endl;
506  return false;
507  }
508 
509  return true;
510 }
OStream cerr
Definition: OStream.cxx:7
enum BeamMode string
void dbutils::gui::DAQConfigEditorDisplay::addInitialRow ( )
slot
void dbutils::gui::BasicEditorDisplay::closeEvent ( QCloseEvent *  event)
protectedvirtualinherited

Definition at line 395 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::hasChanges(), runNovaSAM::retCode, and string.

Referenced by dbutils::gui::BasicEditorDisplay::~BasicEditorDisplay().

396 {
397  if (! hasChanges()) {event->accept(); return;}
398 
399  QMessageBox confirmBox(this);
400 
401  std::string msgText = "There are changes that haven't been saved yet.";
402  confirmBox.setText(msgText.c_str());
403 
404  msgText = "Are you sure that you want to exit without saving ";
405  msgText.append("your changes to the database?");
406  confirmBox.setInformativeText(msgText.c_str());
407 
408  confirmBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
409  confirmBox.setDefaultButton(QMessageBox::No);
410  int retCode = confirmBox.exec();
411 
412  if (retCode == QMessageBox::Yes) {event->accept(); return;}
413  else {event->ignore(); return;}
414 }
virtual bool hasChanges() const =0
enum BeamMode string
bool dbutils::gui::DAQConfigEditorDisplay::hasChanges ( ) const
virtual
void dbutils::gui::BasicEditorDisplay::loadNewDataset ( )
slotinherited

Definition at line 90 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_currentGlobalConfigId, dbutils::gui::BasicEditorDisplay::_doLoadNewDataset(), dbutils::gui::BasicEditorDisplay::_globalNameSpecPtr, dbutils::gui::BasicEditorDisplay::_settingsDisplay, om::cerr, allTimeWatchdog::endl, dbutils::gui::BasicEditorDisplay::hasChanges(), runNovaSAM::retCode, string, and dbutils::gui::SettingsDisplay::updateNamedConfiguration().

Referenced by dbutils::gui::BasicEditorDisplay::BasicEditorDisplay(), DAQConfigEditorDisplay(), and dbutils::gui::BasicEditorDisplay::~BasicEditorDisplay().

91 {
92  if (hasChanges()) {
93  QMessageBox confirmBox(this);
94  std::string msgText = "There are changes that haven't been saved yet.";
95  confirmBox.setText(msgText.c_str());
96 
97  msgText = "Are you sure that you want to load a new dataset without ";
98  msgText.append("saving the existing changes to the database?");
99  confirmBox.setInformativeText(msgText.c_str());
100 
101  confirmBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
102  confirmBox.setDefaultButton(QMessageBox::No);
103  int retCode = confirmBox.exec();
104 
105  if (retCode == QMessageBox::No) {return;}
106  }
107 
108  ConfigSelectionDialog selectDialog((_globalNameSpecPtr->
109  isSlowControlsConfiguration() ?
110  IDSpec::SLOWCONTROLS : IDSpec::DAQ),
111  _globalNameSpecPtr->getDetectorName(), this);
112  int retCode = selectDialog.exec();
113  if (retCode == QDialog::Rejected) {
114  return;
115  }
116 
117  boost::shared_ptr<dbutils::daqconfig::GlobalNameSpec> nameSpecPtr;
118  if (selectDialog.getSelectedTime()==NamedConfigUtils::LATEST_TIME_STRING) {
119  nameSpecPtr.
120  reset(new GlobalNameSpec(selectDialog.getSelectedConfigName(),
121  selectDialog.getSelectedDCMOpMode(),
122  _globalNameSpecPtr->getDetectorName()));
123  }
124  else {
125  nameSpecPtr.
126  reset(new GlobalNameSpec(selectDialog.getSelectedConfigName(),
127  selectDialog.getSelectedDCMOpMode(),
128  _globalNameSpecPtr->getDetectorName(),
129  selectDialog.getSelectedTime()));
130  }
131  nameSpecPtr->isSlowControlsConfiguration(_globalNameSpecPtr->
132  isSlowControlsConfiguration());
133  int64_t globalConfigId = -1;
134  if (! NamedConfigUtils::getGlobalConfigId((*nameSpecPtr),
135  globalConfigId)) {
136  std::cerr << "Error fetching globalConfigId." << std::endl;
137  return;
138  }
139  IDSpec idSpec(globalConfigId, IDSpec::GLOBAL,
140  (_globalNameSpecPtr->isSlowControlsConfiguration() ?
141  IDSpec::SLOWCONTROLS : IDSpec::DAQ));
142 
143  if (_doLoadNewDataset(idSpec)) {
144  _globalNameSpecPtr = nameSpecPtr;
145  _currentGlobalConfigId = globalConfigId;
146  if (_settingsDisplay != 0) {
148  }
149  }
150  else {
151  std::string msgText = "The loading of the new dataset failed. ";
152  msgText.append("Depending on when the failure occurred, you may have an inconsistent set of data displayed in this editor. Please retry the loading of the new dataset until success is achieved before editing the data in the display.");
153  QMessageBox::critical(this, "Data Loading Error",
154  msgText.c_str());
155  return;
156  }
157 }
OStream cerr
Definition: OStream.cxx:7
void updateNamedConfiguration(const dbutils::daqconfig::GlobalNameSpec &nameSpec)
boost::shared_ptr< dbutils::daqconfig::GlobalNameSpec > _globalNameSpecPtr
virtual bool _doLoadNewDataset(const dbutils::daqconfig::IDSpec &idSpec)=0
virtual bool hasChanges() const =0
enum BeamMode string
void dbutils::gui::DAQConfigEditorDisplay::loadThresholdsAndMasks ( )
slot

Definition at line 241 of file DAQConfigEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_globalNameSpecPtr, confusionMatrixTree::count, mkDefs::detName, fclose(), in, make_syst_table_plots::line, path, elec2geo::pos, dbutils::gui::BasicEditorDisplay::reloadCurrentDataset(), runNovaSAM::retCode, string, system(), and make_root_from_grid_output::tr.

Referenced by DAQConfigEditorDisplay().

242  {
243  ///////////////////////////////////
244  // Prompt for location of the csv
245  std::string detName=_globalNameSpecPtr->getDetectorName();
246  std::string detDir;
247  std::string pedDir ="";
248  // novadaq::EnvVarCache::getInstance().getEnvVar("NOVADAQ_PEDESTAL_DIR");
249  if(pedDir == "")
250  {
251  std::string stdConfigFile = "/nova/config/" + detName + "/pedestals/PedestalConfiguration_Standard_" + detName+ ".xml";
252  std::ifstream in(stdConfigFile.c_str());
254  if(in.is_open()) {
255  while(getline(in, line)) {
256  size_t pos = line.find("<dataDir>");
257  if(pos != std::string::npos && pos < line.size()) {
258  pedDir = line.substr(pos + 9, line.find("</dataDir>") - pos - 9);
259  break;
260  }
261  }
262  }
263  }
264 
265  if(pedDir != "")
266  detDir = pedDir + "/PedestalData/PedScans";
267  else
268  detDir = "/";
269 
270  QFileDialog peddialog(this);
271  peddialog.setViewMode(QFileDialog::Detail);
272  QString folderName = peddialog.getExistingDirectory(this, tr("Select Pedestal Directory."),
273  detDir.c_str(),
274  QFileDialog::ShowDirsOnly|QFileDialog::DontUseNativeDialog);
275  if(folderName==""){return;}
276 
277  /////////////////////////////////
278  // DB load confirmation box
279  QMessageBox confirmBox(this);
280  int count;
281  std::ostringstream pixels;
282  std::ostringstream febs;
283  std::ostringstream dcms;
284 
285  boost::filesystem::path p(folderName.toUtf8().constData());
286  boost::filesystem::path uniquestamp = p.filename();
287 
288  std::string threshFileName = folderName.toUtf8().constData();
289  threshFileName.append("/thresholds_");
290  threshFileName.append(uniquestamp.string());
291  threshFileName.append(".csv");
292  std::string pixelFileName = folderName.toUtf8().constData();
293  pixelFileName.append("/pixelmask_");
294  pixelFileName.append(uniquestamp.string());
295  pixelFileName.append(".csv");
296  std::string febFileName = folderName.toUtf8().constData();
297  febFileName.append("/febmask_");
298  febFileName.append(uniquestamp.string());
299  febFileName.append(".csv");
300 
301 
302  std::ifstream threshFile(threshFileName.c_str());
303  count=std::count(std::istreambuf_iterator<char>(threshFile),
304  std::istreambuf_iterator<char>(), '\n');
305  pixels << count;
306 
307  std::ifstream pixelFile(pixelFileName.c_str());
308  count=std::count(std::istreambuf_iterator<char>(pixelFile),
309  std::istreambuf_iterator<char>(), '\n');
310  febs << count;
311 
312  std::ifstream febFile(febFileName.c_str());
313  count=std::count(std::istreambuf_iterator<char>(febFile),
314  std::istreambuf_iterator<char>(), '\n');
315  dcms << count;
316 
317  std::string msgText = "You are about to load threholds and masks from ";
318  msgText.append(folderName.toUtf8().constData());
319  msgText.append("\n\n Found results from ");
320  msgText.append(pixels.str());
321  msgText.append(" pixels, ");
322  msgText.append(febs.str());
323  msgText.append(" febs and ");
324  msgText.append(dcms.str());
325  msgText.append(" dcms.");
326  confirmBox.setText(msgText.c_str());
327 
328  msgText = "Are you sure that you want to load these values? ";
329  confirmBox.setInformativeText(msgText.c_str());
330  confirmBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
331  confirmBox.setDefaultButton(QMessageBox::No);
332  int retCode = confirmBox.exec();
333  if (retCode != QMessageBox::Yes) {return;}
334 
335  //////////
336  // Ask if user want to overide all setting in the config or simply append
337  // apply proper defualts if they want to override
338  QMessageBox loadBox(this);
339  msgText = "Do you want to override ALL existing exceptions underneath the defaults or append the results?";
340  loadBox.setText(msgText.c_str());
341  loadBox.addButton(tr("Override"),QMessageBox::AcceptRole);
342  loadBox.addButton(tr("Append"),QMessageBox::NoRole);
343  loadBox.addButton(QMessageBox::Cancel);
344  loadBox.setDefaultButton(QMessageBox::Cancel);
345  retCode = loadBox.exec();
346  std::string configName = _globalNameSpecPtr->getConfigName();
347  std::string systemCommand = "LoadEnableMasksAndThresholds NovaDatabase/tables/DAQConfig ";
348  if (retCode == QMessageBox::Cancel){return;}
349  else if (retCode == QMessageBox::AcceptRole) {
350  std::string tmpstring;
351  tmpstring = folderName.toUtf8().constData();
352  tmpstring.append("/febXXXXXX");
353  char *febTmpName = new char[tmpstring.length() + 1];
354  strcpy(febTmpName, tmpstring.c_str()); // Get temp name
355 
356  tmpstring = folderName.toUtf8().constData();
357  tmpstring.append("/pixelXXXXXX");
358  char *pixelTmpName = new char[tmpstring.length() + 1]; // Get temp name
359  strcpy(pixelTmpName, tmpstring.c_str()); // Get temp name
360 
361  tmpstring =folderName.toUtf8().constData();
362  tmpstring.append("/thresholdXXXXXX");
363  char *threshTmpName = new char[tmpstring.length() + 1]; // Get temp name
364  strcpy(threshTmpName, tmpstring.c_str()); // Get temp name
365 
366  mkstemp(febTmpName);
367  mkstemp(pixelTmpName);
368  mkstemp(threshTmpName);
369  FILE * febFileTmp = fopen (febTmpName, "w");
370  FILE * pixelFileTmp = fopen (pixelTmpName, "w");
371  FILE * threshFileTmp = fopen (threshTmpName, "w");
372 
373  std::string systemCommandtmp = "";
374 
375  //defaults
376  fputs ("1,default,0,0,1,2,3,4\n", febFileTmp);
377  fputs ("1,default,-1,0,0,1,2,3,4\n",pixelFileTmp);
378  fputs ("1,default,-1,-1,200,0,1,2,3,4\n",threshFileTmp);
379  fclose(febFileTmp);
380  fclose(pixelFileTmp);
381  fclose(threshFileTmp);
382  systemCommandtmp.append(systemCommand);
383  systemCommandtmp.append(febTmpName);
384  systemCommandtmp.append(" ");
385  systemCommandtmp.append(pixelTmpName);
386  systemCommandtmp.append(" ");
387  systemCommandtmp.append(threshTmpName);
388  systemCommandtmp.append(" ");
389  systemCommandtmp.append(configName);
390  system(systemCommandtmp.c_str());
391 
392  remove(febTmpName);
393  remove(pixelTmpName);
394  remove(threshTmpName);
395  }
396 
397  /////////////////////////////////
398  // Prompt user with status ans load into the database
399  //#Output the database environment
400  //echo
401  //echo 'Loading into' $NOVADBNAME 'on' $NOVADBHOST 'at port' $NOVADBPORT '....'
402 
403  //#Load the Thesholds and Masks
404 
405  systemCommand.append(febFileName);
406  systemCommand.append(" ");
407  systemCommand.append(pixelFileName);
408  systemCommand.append(" ");
409  systemCommand.append(threshFileName);
410  systemCommand.append(" ");
411  systemCommand.append(configName);
412  system(systemCommand.c_str());
413 
414  ///////////////////////////////
415  //Refresh the editor
417 
418 } // end of loadThresholdsAndMasks
system("rm -rf microbeam.root")
const char * p
Definition: xmltok.h:285
fclose(fg1)
boost::shared_ptr< dbutils::daqconfig::GlobalNameSpec > _globalNameSpecPtr
const std::string path
Definition: plot_BEN.C:43
ifstream in
Definition: comparison.C:7
detName
Definition: mkDefs.py:106
enum BeamMode string
void dbutils::gui::BasicEditorDisplay::reactToDataChange ( )
virtualslotinherited
void dbutils::gui::BasicEditorDisplay::reactToDataSave ( )
virtualslotinherited
void dbutils::gui::BasicEditorDisplay::reloadCurrentDataset ( )
slotinherited

Definition at line 47 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_currentGlobalConfigId, dbutils::gui::BasicEditorDisplay::_doReloadCurrentDataset(), dbutils::gui::BasicEditorDisplay::_globalNameSpecPtr, om::cerr, allTimeWatchdog::endl, dbutils::gui::BasicEditorDisplay::hasChanges(), runNovaSAM::retCode, and string.

Referenced by dbutils::gui::BasicEditorDisplay::BasicEditorDisplay(), dbutils::gui::DCSConfigEditorDisplay::loadHVAndTemps(), loadThresholdsAndMasks(), and dbutils::gui::BasicEditorDisplay::~BasicEditorDisplay().

48 {
49  if (hasChanges()) {
50  QMessageBox confirmBox(this);
51  std::string msgText = "There are changes that haven't been saved yet.";
52  confirmBox.setText(msgText.c_str());
53 
54  msgText = "Are you sure that you want to reload this dataset without ";
55  msgText.append("saving the existing changes to the database?");
56  confirmBox.setInformativeText(msgText.c_str());
57 
58  confirmBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
59  confirmBox.setDefaultButton(QMessageBox::No);
60  int retCode = confirmBox.exec();
61 
62  if (retCode == QMessageBox::No) {return;}
63  }
64 
65  int64_t globalConfigId = _currentGlobalConfigId;
66  if (! _globalNameSpecPtr->hasTimestamp()) {
67  if (! NamedConfigUtils::getGlobalConfigId((*_globalNameSpecPtr),
68  globalConfigId)) {
69  std::cerr << "Error fetching globalConfigId." << std::endl;
70  return;
71  }
72  }
73 
74  IDSpec idSpec(globalConfigId, IDSpec::GLOBAL,
75  (_globalNameSpecPtr->isSlowControlsConfiguration() ?
76  IDSpec::SLOWCONTROLS : IDSpec::DAQ));
77 
78  if (_doReloadCurrentDataset(idSpec)) {
79  //_globalNameSpecPtr = nameSpecPtr;
80  _currentGlobalConfigId = globalConfigId;
81  //if (_settingsDisplay != 0) {
82  // _settingsDisplay->updateNamedConfiguration(*_globalNameSpecPtr);
83  //}
84  }
85 }
virtual bool _doReloadCurrentDataset(const dbutils::daqconfig::IDSpec &idSpec)=0
OStream cerr
Definition: OStream.cxx:7
boost::shared_ptr< dbutils::daqconfig::GlobalNameSpec > _globalNameSpecPtr
virtual bool hasChanges() const =0
enum BeamMode string
void dbutils::gui::BasicEditorDisplay::saveChanges ( )
slotinherited

Definition at line 159 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_confirmSave(), dbutils::gui::BasicEditorDisplay::_currentGlobalConfigId, dbutils::gui::BasicEditorDisplay::_doSaveChanges(), dbutils::gui::BasicEditorDisplay::_getUserResponseToGlobalCopyFailure(), dbutils::gui::BasicEditorDisplay::_globalNameSpecPtr, dbutils::gui::BasicEditorDisplay::_settingsDisplay, novadaq::Status::code, novadaq::Status::message, dbutils::SimpleParameterSet::put(), fabricate::status, string, and dbutils::gui::SettingsDisplay::updateNamedConfiguration().

Referenced by dbutils::gui::BasicEditorDisplay::BasicEditorDisplay(), and dbutils::gui::BasicEditorDisplay::~BasicEditorDisplay().

160 {
161  if (! _confirmSave()) {return;}
162 
163  IDSpec oldGlobalIdSpec(_currentGlobalConfigId, IDSpec::GLOBAL,
164  (_globalNameSpecPtr->isSlowControlsConfiguration() ?
165  IDSpec::SLOWCONTROLS : IDSpec::DAQ));
166 
168  paramSet.put(NamedConfigUtils::DESCRIPTION_COLUMN_NAME,
169  "New values from the Configuration Editor GUI.");
170  int64_t globalConfigId;
171  novadaq::Status resultStatus =
172  NamedConfigUtils::copyGlobalConfig(oldGlobalIdSpec, true, paramSet,
173  "", false, globalConfigId);
174  if (resultStatus.code != NamedConfigUtils::COPY_SUCCEEDED) {
175  bool userChoice = _getUserResponseToGlobalCopyFailure(resultStatus);
176  if (! userChoice) {return;}
177 
178  resultStatus =
179  NamedConfigUtils::copyGlobalConfig(oldGlobalIdSpec, true, paramSet,
180  "", true, globalConfigId);
181  if (resultStatus.code != NamedConfigUtils::COPY_SUCCEEDED) {
182  std::string msgText = "Unable to create a copy of the named ";
183  msgText.append("global configuration with ID = ");
184  msgText.append(boost::lexical_cast<std::string>
186  msgText.append(": ");
187  msgText.append(resultStatus.message);
188  QMessageBox::critical(this, "Save Error", msgText.c_str());
189  return;
190  }
191  }
192 
193  // 12-Dec-2011, KAB - this copying of the GlobalNameSpec is simply
194  // to get rid of any timestamp that may be present in the existing
195  // _globalNameSpecPtr (since the act of saving will create a new latest)
196  boost::shared_ptr<dbutils::daqconfig::GlobalNameSpec>
197  nameSpecPtr(new GlobalNameSpec(_globalNameSpecPtr->getConfigName(),
198  _globalNameSpecPtr->getDCMOpMode(),
199  _globalNameSpecPtr->getDetectorName()));
200  nameSpecPtr->
201  isSlowControlsConfiguration(_globalNameSpecPtr->
202  isSlowControlsConfiguration());
203  IDSpec globalIdSpec(globalConfigId, IDSpec::GLOBAL,
204  (_globalNameSpecPtr->isSlowControlsConfiguration() ?
205  IDSpec::SLOWCONTROLS : IDSpec::DAQ));
206  if (_doSaveChanges(oldGlobalIdSpec, globalIdSpec, (*nameSpecPtr))) {
207  if (NamedConfigUtils::markConfigDone(globalIdSpec, true)) {
208  _globalNameSpecPtr = nameSpecPtr;
209  _currentGlobalConfigId = globalConfigId;
210  if (_settingsDisplay != 0) {
212  }
213  }
214  }
215  else {
216  bool status = NamedConfigUtils::markConfigDone(globalIdSpec, false);
217 
218  std::string msgText = "An error occurred when saving changes to ";
219  msgText.append("the database.<br/><br/>");
220 
221  if (status) {
222  msgText.append("However, the new configuration was ");
223  msgText.append("successfully marked as Done (changes have ");
224  msgText.append("finished). Please try saving again in a few ");
225  msgText.append("minutes, but realize that you may need to ");
226  msgText.append("over-write the incomplete save that just ");
227  msgText.append("failed (the GUI will guide you through that).");
228  }
229  else {
230  msgText.append("In addition, the new configuration was not ");
231  msgText.append("successfully marked as Done (so it still ");
232  msgText.append("appears that there is a change in progress ");
233  msgText.append("in the DB table). If so, you'll need ");
234  msgText.append("to use the ");
235  msgText.append("<a href=\"https://cdcvs.fnal.gov/redmine/projects/novadaq-config-mgmt/wiki/How_To_recover_from_a_failed_pedestal_upload_-_December_2011\">MarkConfigChangesDone</a> utility to mark the change as Done.");
236  msgText.append("In any case, please try saving again in a few ");
237  msgText.append("minutes - the GUI will guide you through any ");
238  msgText.append("extra steps that you need to take.");
239  }
240 
241  QMessageBox::critical(this, "Save Error", msgText.c_str());
242  }
243 }
bool _getUserResponseToGlobalCopyFailure(const novadaq::Status &status)
int status
Definition: fabricate.py:1613
void put(const std::string &key, const std::string &value)
int32_t code
Definition: Status.h:22
void updateNamedConfiguration(const dbutils::daqconfig::GlobalNameSpec &nameSpec)
virtual bool _doSaveChanges(const dbutils::daqconfig::IDSpec &oldIdSpec, const dbutils::daqconfig::IDSpec &newIdSpec, const dbutils::daqconfig::GlobalNameSpec &newNameSpec)=0
boost::shared_ptr< dbutils::daqconfig::GlobalNameSpec > _globalNameSpecPtr
std::string message
Definition: Status.h:24
enum BeamMode string
void dbutils::gui::BasicEditorDisplay::saveChangesWithNewName ( )
slotinherited

Definition at line 245 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_confirmSave(), dbutils::gui::BasicEditorDisplay::_currentGlobalConfigId, dbutils::gui::BasicEditorDisplay::_doSaveChanges(), dbutils::gui::BasicEditorDisplay::_getUserResponseToGlobalCopyFailure(), dbutils::gui::BasicEditorDisplay::_globalNameSpecPtr, dbutils::gui::BasicEditorDisplay::_settingsDisplay, novadaq::Status::code, novadaq::Status::message, lem_server::msg, art::Normal, dbutils::SimpleParameterSet::put(), fabricate::status, string, make_root_from_grid_output::tr, and dbutils::gui::SettingsDisplay::updateNamedConfiguration().

Referenced by dbutils::gui::BasicEditorDisplay::BasicEditorDisplay(), and dbutils::gui::BasicEditorDisplay::~BasicEditorDisplay().

246 {
247  if (! _confirmSave()) {return;}
248 
250  NamedConfigUtils::
251  getAvailableGlobalConfigs((_globalNameSpecPtr->
252  isSlowControlsConfiguration() ?
253  IDSpec::SLOWCONTROLS : IDSpec::DAQ),
254  _globalNameSpecPtr->getDetectorName(),
255  globalNameMap);
256 
257  bool status;
258  std::string msg = "Please enter the new configuration name.";
259  if (globalNameMap.size() > 0) {
260  msg.append("<br/><br/>Recent choices for the name and the DCM ");
261  msg.append("operating mode include the following:<ul>");
262  NamedConfigUtils::GlobalNameSpecMap::const_iterator iter;
263  NamedConfigUtils::GlobalNameSpecMap::const_iterator iterEnd =
264  globalNameMap.end();
265  for (iter = globalNameMap.begin(); iter != iterEnd; ++iter) {
266  msg.append("<li>");
267  msg.append((*iter).first.getConfigName());
268  msg.append(" ");
269  msg.append((*iter).first.getDCMOpMode());
270  msg.append("</li>");
271  }
272  msg.append("</ul>");
273  }
274  QString newConfigName =
275  QInputDialog::getText(this, tr("Configuration Name"), msg.c_str(),
277  _globalNameSpecPtr->getConfigName().c_str(),
278  &status);
279  if (! status) {return;}
280 
281  msg = "Please enter the new DCM operating mode.";
282  if (globalNameMap.size() > 0) {
283  msg.append("<br/><br/>Recent choices for the name and the DCM ");
284  msg.append("operating mode include the following:<ul>");
285  NamedConfigUtils::GlobalNameSpecMap::const_iterator iter;
286  NamedConfigUtils::GlobalNameSpecMap::const_iterator iterEnd =
287  globalNameMap.end();
288  for (iter = globalNameMap.begin(); iter != iterEnd; ++iter) {
289  msg.append("<li>");
290  msg.append((*iter).first.getConfigName());
291  msg.append(" ");
292  msg.append((*iter).first.getDCMOpMode());
293  msg.append("</li>");
294  }
295  msg.append("</ul>");
296  }
297  QString newDCMOpMode =
298  QInputDialog::getText(this, tr("DCM Operating Mode"), msg.c_str(),
300  _globalNameSpecPtr->getDCMOpMode().c_str(),
301  &status);
302  if (! status) {return;}
303 
304  IDSpec oldGlobalIdSpec(_currentGlobalConfigId, IDSpec::GLOBAL,
305  (_globalNameSpecPtr->isSlowControlsConfiguration() ?
306  IDSpec::SLOWCONTROLS : IDSpec::DAQ));
307 
309  paramSet.put(NamedConfigUtils::NAME_COLUMN_NAME,
310  newConfigName.toStdString());
311  paramSet.put(NamedConfigUtils::DCMOPMODE_COLUMN_NAME,
312  newDCMOpMode.toStdString());
313  paramSet.put(NamedConfigUtils::DESCRIPTION_COLUMN_NAME,
314  "New named configuration from the Configuration Editor GUI.");
315  int64_t globalConfigId;
316  novadaq::Status resultStatus =
317  NamedConfigUtils::copyGlobalConfig(oldGlobalIdSpec, true, paramSet,
318  "", false, globalConfigId);
319  if (resultStatus.code != NamedConfigUtils::COPY_SUCCEEDED) {
320  bool userChoice = _getUserResponseToGlobalCopyFailure(resultStatus);
321  if (! userChoice) {return;}
322 
323  resultStatus =
324  NamedConfigUtils::copyGlobalConfig(oldGlobalIdSpec, true, paramSet,
325  "", true, globalConfigId);
326  if (resultStatus.code != NamedConfigUtils::COPY_SUCCEEDED) {
327  std::string msgText = "Unable to create a copy of the named ";
328  msgText.append("global configuration with ID = ");
329  msgText.append(boost::lexical_cast<std::string>
331  msgText.append(": ");
332  msgText.append(resultStatus.message);
333  QMessageBox::critical(this, "Save Error", msgText.c_str());
334  return;
335  }
336  }
337 
338  boost::shared_ptr<dbutils::daqconfig::GlobalNameSpec>
339  nameSpecPtr(new GlobalNameSpec(newConfigName.toStdString(),
340  newDCMOpMode.toStdString(),
341  _globalNameSpecPtr->getDetectorName()));
342  nameSpecPtr->
343  isSlowControlsConfiguration(_globalNameSpecPtr->
344  isSlowControlsConfiguration());
345  IDSpec globalIdSpec(globalConfigId, IDSpec::GLOBAL,
346  (_globalNameSpecPtr->isSlowControlsConfiguration() ?
347  IDSpec::SLOWCONTROLS : IDSpec::DAQ));
348  if (_doSaveChanges(oldGlobalIdSpec, globalIdSpec, (*nameSpecPtr))) {
349  if (NamedConfigUtils::markConfigDone(globalIdSpec, true)) {
350  _globalNameSpecPtr = nameSpecPtr;
351  _currentGlobalConfigId = globalConfigId;
352  if (_settingsDisplay != 0) {
354  }
355  }
356  }
357  else {
358  NamedConfigUtils::markConfigDone(globalIdSpec, false);
359  }
360 }
bool _getUserResponseToGlobalCopyFailure(const novadaq::Status &status)
int status
Definition: fabricate.py:1613
void put(const std::string &key, const std::string &value)
int32_t code
Definition: Status.h:22
void updateNamedConfiguration(const dbutils::daqconfig::GlobalNameSpec &nameSpec)
std::map< GlobalNameSpec, std::vector< GlobalNameSpec > > GlobalNameSpecMap
virtual bool _doSaveChanges(const dbutils::daqconfig::IDSpec &oldIdSpec, const dbutils::daqconfig::IDSpec &newIdSpec, const dbutils::daqconfig::GlobalNameSpec &newNameSpec)=0
boost::shared_ptr< dbutils::daqconfig::GlobalNameSpec > _globalNameSpecPtr
std::string message
Definition: Status.h:24
enum BeamMode string
void dbutils::gui::BasicEditorDisplay::showHelpDialog ( )
slotinherited

Definition at line 362 of file BasicEditorDisplay.cpp.

References dbutils::gui::BasicEditorDisplay::_customHelpText, and string.

Referenced by dbutils::gui::BasicEditorDisplay::_addHelpMenu(), and dbutils::gui::BasicEditorDisplay::~BasicEditorDisplay().

363 {
364  std::string msgText = "Helpful hints:";
365  msgText.append("<ul>");
366  msgText.append("<li>To edit a value, double-click on it [left mouse button]. (A single mouse click simply selects the value, it doesn't enable editing.)</li>");
367  msgText.append("<li>Once you have edited a value, you should single-click on a different cell in the table to ensure that the editor captures your change. (Pressing the Tab or Enter key after you enter your change will also work.)</li>");
368  msgText.append("<li>For \"mask\" values, a bitmap editor is provided. To open the bitmap editor, right-mouse-click on the value that you want to edit, and select the \"Open bitmap editor\" option from the popup menu.</li>");
369  msgText.append("</ul>");
370  msgText.append(_customHelpText);
371  QMessageBox::information(this, "Configuration editor help",
372  msgText.c_str());
373 }
enum BeamMode string

Member Data Documentation

int64_t dbutils::gui::BasicEditorDisplay::_currentGlobalConfigId
protectedinherited
boost::shared_ptr<dbutils::daqconfig::GlobalNameSpec> dbutils::gui::BasicEditorDisplay::_globalNameSpecPtr
protectedinherited
QAction* dbutils::gui::BasicEditorDisplay::_saveAction
protectedinherited
QAction* dbutils::gui::BasicEditorDisplay::_saveAsAction
protectedinherited
SettingsDisplay* dbutils::gui::BasicEditorDisplay::_settingsDisplay
protectedinherited
CustomTabWidget* dbutils::gui::DAQConfigEditorDisplay::_tabWidget
private

The documentation for this class was generated from the following files: