ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
VP1ExecutionScheduler::Imp Class Reference
Collaboration diagram for VP1ExecutionScheduler::Imp:

Classes

class  GlobalEventFilter
 

Public Member Functions

void updateProgressBar ()
 
bool allVisibleRefreshed () const
 
bool allSoonVisibleRefreshed () const
 
void initCruise ()
 
void performPostRefreshCruiseActions (IVP1ChannelWidget *cw)
 

Static Public Member Functions

static void warnIfWidgetsAlive ()
 

Public Attributes

GlobalEventFilterglobalEventFilter
 
VP1ExecutionSchedulerscheduler
 
VP1Prioritiserprioritiser
 
VP1MainWindowmainwindow
 
long int eventsProcessed
 
bool batchMode
 
bool batchModeAllEvents
 
int batchModeNEvents
 
bool batchModeRandomConfig
 
VP1BatchUtilitiesbatchUtilities
 
VP1AvailEventsavailEvents
 
QTimer * refreshtimer
 
IVP1Systemcurrentsystemrefreshing
 
bool allSystemsRefreshed
 
bool goingtonextevent
 
QProgressBar * pb
 
double calctimethisevent
 
double currentrefreshsystemestimate
 
QTimer * pbtimer
 
bool eraseJustAfterRefresh
 
IVP1ChannelWidgetpostponedUncreateAndDeleteCW
 
CruiseMode cruisemode
 
QTimer * cruisetimer
 
bool cruisetab_waitingtoproceed
 
QString nextRequestedEvent
 
bool skipEvent
 

Detailed Description

Definition at line 129 of file VP1ExecutionScheduler.cxx.

Member Function Documentation

◆ allSoonVisibleRefreshed()

bool VP1ExecutionScheduler::Imp::allSoonVisibleRefreshed ( ) const

Definition at line 1223 of file VP1ExecutionScheduler.cxx.

1224 {
1227  return false;
1228  return true;
1229 }

◆ allVisibleRefreshed()

bool VP1ExecutionScheduler::Imp::allVisibleRefreshed ( ) const

Definition at line 1214 of file VP1ExecutionScheduler.cxx.

1215 {
1218  return false;
1219  return true;
1220 }

◆ initCruise()

void VP1ExecutionScheduler::Imp::initCruise ( )

Definition at line 1278 of file VP1ExecutionScheduler.cxx.

1279 {
1280  //No matter what we stop the timer when changing mode or starting a new event.
1281  if (cruisetimer->isActive())
1282  cruisetimer->stop();
1284 
1285  //FIXME: DO STUFF HERE
1286 
1287  switch (cruisemode) {
1288  case NONE:
1289  VP1Msg::messageVerbose("initCruise NONE");
1290  break;
1291  case TAB:
1292  if (allVisibleRefreshed())
1293  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1294  VP1Msg::messageVerbose("initCruise TAB");
1295  break;
1296  case EVENT:
1297  //Start cruise countdown if all visible refreshed:
1298  if (allVisibleRefreshed())
1299  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1300  VP1Msg::messageVerbose("initCruise EVENT");
1301  break;
1302  case BOTH:
1303  VP1Msg::messageVerbose("initCruise BOTH");
1304  break;
1305  default:
1306  assert(0&&"UNKNOWN CRUISE MODE");
1307  break;
1308  }
1309 }

◆ performPostRefreshCruiseActions()

void VP1ExecutionScheduler::Imp::performPostRefreshCruiseActions ( IVP1ChannelWidget cw)

Definition at line 1232 of file VP1ExecutionScheduler.cxx.

1232  {
1233 
1234  //Abort if not in cruise mode, or if the system just refreshed did
1235  //not make cw fully refreshed:
1237  return;
1238 
1239  if (cruisemode==EVENT) {
1240  //Abort if this refresh did not make all visible channels refreshed:
1242  return;
1243  //Start the countdown for the next event:
1244  assert(!cruisetimer->isActive());
1245  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1246  return;
1247  } else if (cruisemode==TAB) {
1249  //We are waiting for channels in the next tab to refresh before
1250  //we can move on, so we should check if this channel refresh
1251  //made all soonvisible channels refreshed. If so: move on.
1252  if (allSoonVisibleRefreshed()) {
1255  //If now all visible are refreshed, we start the timer again.
1256  if (allVisibleRefreshed())
1257  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1258  }
1259  } else {
1260  //Same as in the EVENT case: Check if it is time to start the countdown:
1261  //Abort if this refresh did not make all visible channels refreshed:
1263  return;
1264  //Start the countdown for the next event:
1265  assert(!cruisetimer->isActive());
1266  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1267  return;
1268  }
1269 
1270  return;
1271  } else {
1272  assert(cruisemode==BOTH);
1273  assert(0&&"not implemented");
1274  }
1275 }

◆ updateProgressBar()

void VP1ExecutionScheduler::Imp::updateProgressBar ( )

Definition at line 549 of file VP1ExecutionScheduler.cxx.

550 {
552  if (remaining>0.0) {
553  pb->setMaximum(static_cast<int>((calctimethisevent+remaining)*10.0));
554  pb->setValue(static_cast<int>((calctimethisevent)*10.0));
555  pb->show();
556  if (!pbtimer->isActive())
557  pbtimer->start(40);//25 "frames"/second. If it is good enough for TV, it is good enough for us.
558  } else {
559  calctimethisevent=0.0;
560  pb->hide();
561  pb->reset();
562  pbtimer->stop();
563  }
564 }

◆ warnIfWidgetsAlive()

void VP1ExecutionScheduler::Imp::warnIfWidgetsAlive ( )
static

Definition at line 1153 of file VP1ExecutionScheduler.cxx.

1154 {
1155  QSet<QWidget*> w_ignore;
1156 #if QTCORE_VERSION >= 0x050E00
1157  QList<QWidget*> widgets = QApplication::allWidgets();
1158  QSet<QWidget*> wl (widgets.begin(), widgets.end());
1159 #else
1160  QSet<QWidget*> wl = QApplication::allWidgets().toSet();
1161 #endif
1162  w_ignore<<qApp->desktop();
1163  for (QObject*o : qApp->children()) {
1164  if (o->isWidgetType())
1165  w_ignore << static_cast<QWidget*>(o);
1166  }
1167  for (QWidget * w : wl) {
1168  if (w->objectName().startsWith("internal clipboard"))
1169  w_ignore << w;
1170  if (w->objectName()=="empty_widget")
1171  w_ignore << w;
1172  }
1173  wl.subtract(w_ignore);
1174  if (!wl.empty()) {
1175  std::cout<<std::endl;
1176  std::cout<<"VP1 WARNING: "<<wl.count()<< " widget"<<(wl.count()>1?"s":"")<<" left at end of job:"<<std::endl;
1177  int i(0);
1178  for (QWidget*w : wl) {
1179  std::cout<<++i<<") Address="<<w<<", ObjectName="<<w->objectName().toStdString()<<", ClassName="<<w->metaObject()->className()<<std::endl;
1180  }
1181  std::cout<<std::endl;
1182  }
1183 }

Member Data Documentation

◆ allSystemsRefreshed

bool VP1ExecutionScheduler::Imp::allSystemsRefreshed

Definition at line 150 of file VP1ExecutionScheduler.cxx.

◆ availEvents

VP1AvailEvents* VP1ExecutionScheduler::Imp::availEvents

Definition at line 146 of file VP1ExecutionScheduler.cxx.

◆ batchMode

bool VP1ExecutionScheduler::Imp::batchMode

Definition at line 140 of file VP1ExecutionScheduler.cxx.

◆ batchModeAllEvents

bool VP1ExecutionScheduler::Imp::batchModeAllEvents

Definition at line 141 of file VP1ExecutionScheduler.cxx.

◆ batchModeNEvents

int VP1ExecutionScheduler::Imp::batchModeNEvents

Definition at line 142 of file VP1ExecutionScheduler.cxx.

◆ batchModeRandomConfig

bool VP1ExecutionScheduler::Imp::batchModeRandomConfig

Definition at line 143 of file VP1ExecutionScheduler.cxx.

◆ batchUtilities

VP1BatchUtilities* VP1ExecutionScheduler::Imp::batchUtilities

Definition at line 144 of file VP1ExecutionScheduler.cxx.

◆ calctimethisevent

double VP1ExecutionScheduler::Imp::calctimethisevent

Definition at line 155 of file VP1ExecutionScheduler.cxx.

◆ cruisemode

CruiseMode VP1ExecutionScheduler::Imp::cruisemode

Definition at line 164 of file VP1ExecutionScheduler.cxx.

◆ cruisetab_waitingtoproceed

bool VP1ExecutionScheduler::Imp::cruisetab_waitingtoproceed

Definition at line 170 of file VP1ExecutionScheduler.cxx.

◆ cruisetimer

QTimer* VP1ExecutionScheduler::Imp::cruisetimer

Definition at line 165 of file VP1ExecutionScheduler.cxx.

◆ currentrefreshsystemestimate

double VP1ExecutionScheduler::Imp::currentrefreshsystemestimate

Definition at line 156 of file VP1ExecutionScheduler.cxx.

◆ currentsystemrefreshing

IVP1System* VP1ExecutionScheduler::Imp::currentsystemrefreshing

Definition at line 149 of file VP1ExecutionScheduler.cxx.

◆ eraseJustAfterRefresh

bool VP1ExecutionScheduler::Imp::eraseJustAfterRefresh

Definition at line 161 of file VP1ExecutionScheduler.cxx.

◆ eventsProcessed

long int VP1ExecutionScheduler::Imp::eventsProcessed

Definition at line 138 of file VP1ExecutionScheduler.cxx.

◆ globalEventFilter

GlobalEventFilter* VP1ExecutionScheduler::Imp::globalEventFilter

Definition at line 132 of file VP1ExecutionScheduler.cxx.

◆ goingtonextevent

bool VP1ExecutionScheduler::Imp::goingtonextevent

Definition at line 151 of file VP1ExecutionScheduler.cxx.

◆ mainwindow

VP1MainWindow* VP1ExecutionScheduler::Imp::mainwindow

Definition at line 136 of file VP1ExecutionScheduler.cxx.

◆ nextRequestedEvent

QString VP1ExecutionScheduler::Imp::nextRequestedEvent

Definition at line 174 of file VP1ExecutionScheduler.cxx.

◆ pb

QProgressBar* VP1ExecutionScheduler::Imp::pb

Definition at line 154 of file VP1ExecutionScheduler.cxx.

◆ pbtimer

QTimer* VP1ExecutionScheduler::Imp::pbtimer

Definition at line 158 of file VP1ExecutionScheduler.cxx.

◆ postponedUncreateAndDeleteCW

IVP1ChannelWidget* VP1ExecutionScheduler::Imp::postponedUncreateAndDeleteCW

Definition at line 162 of file VP1ExecutionScheduler.cxx.

◆ prioritiser

VP1Prioritiser* VP1ExecutionScheduler::Imp::prioritiser

Definition at line 135 of file VP1ExecutionScheduler.cxx.

◆ refreshtimer

QTimer* VP1ExecutionScheduler::Imp::refreshtimer

Definition at line 148 of file VP1ExecutionScheduler.cxx.

◆ scheduler

VP1ExecutionScheduler* VP1ExecutionScheduler::Imp::scheduler

Definition at line 134 of file VP1ExecutionScheduler.cxx.

◆ skipEvent

bool VP1ExecutionScheduler::Imp::skipEvent

Definition at line 176 of file VP1ExecutionScheduler.cxx.


The documentation for this class was generated from the following file:
VP1ExecutionScheduler::NONE
@ NONE
Definition: VP1ExecutionScheduler.h:49
VP1TabManager::showNextTab
void showNextTab()
Definition: VP1TabManager.cxx:1108
VP1ExecutionScheduler::Imp::mainwindow
VP1MainWindow * mainwindow
Definition: VP1ExecutionScheduler.cxx:136
VP1TabManager::isVisible
bool isVisible(IVP1ChannelWidget *) const
Definition: VP1TabManager.cxx:1479
VP1ExecutionScheduler::Imp::calctimethisevent
double calctimethisevent
Definition: VP1ExecutionScheduler.cxx:155
VP1ExecutionScheduler::Imp::scheduler
VP1ExecutionScheduler * scheduler
Definition: VP1ExecutionScheduler.cxx:134
VP1MainWindow::tabManager
VP1TabManager * tabManager() const
Definition: VP1MainWindow.h:146
VP1ExecutionScheduler::EVENT
@ EVENT
Definition: VP1ExecutionScheduler.h:51
VP1TabManager::soonVisibleChannels
const QSet< IVP1ChannelWidget * > & soonVisibleChannels() const
Definition: VP1TabManager.cxx:1472
VP1ExecutionScheduler::Imp::pbtimer
QTimer * pbtimer
Definition: VP1ExecutionScheduler.cxx:158
VP1ExecutionScheduler::Imp::cruisemode
CruiseMode cruisemode
Definition: VP1ExecutionScheduler.cxx:164
VP1ExecutionScheduler::Imp::allVisibleRefreshed
bool allVisibleRefreshed() const
Definition: VP1ExecutionScheduler.cxx:1214
VP1TabManager::visibleChannels
const QSet< IVP1ChannelWidget * > & visibleChannels() const
Definition: VP1TabManager.cxx:1467
lumiFormat.i
int i
Definition: lumiFormat.py:92
VP1ExecutionScheduler::Imp::prioritiser
VP1Prioritiser * prioritiser
Definition: VP1ExecutionScheduler.cxx:135
VP1ExecutionScheduler::TAB
@ TAB
Definition: VP1ExecutionScheduler.h:50
VP1ExecutionScheduler::Imp::cruisetimer
QTimer * cruisetimer
Definition: VP1ExecutionScheduler.cxx:165
VP1ExecutionScheduler::Imp::pb
QProgressBar * pb
Definition: VP1ExecutionScheduler.cxx:154
IVP1ChannelWidget
Definition: IVP1ChannelWidget.h:34
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
VP1ExecutionScheduler::hasAllActiveSystemsRefreshed
bool hasAllActiveSystemsRefreshed(IVP1ChannelWidget *) const
Definition: VP1ExecutionScheduler.cxx:1186
VP1Prioritiser::estimateRemainingCalcTime
double estimateRemainingCalcTime() const
Definition: VP1Prioritiser.cxx:230
VP1ExecutionScheduler::Imp::allSoonVisibleRefreshed
bool allSoonVisibleRefreshed() const
Definition: VP1ExecutionScheduler.cxx:1223
VP1ExecutionScheduler::BOTH
@ BOTH
Definition: VP1ExecutionScheduler.h:52
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
python.web.remaining
remaining
Definition: web.py:132
VP1ExecutionScheduler::Imp::cruisetab_waitingtoproceed
bool cruisetab_waitingtoproceed
Definition: VP1ExecutionScheduler.cxx:170