ATLAS Offline Software
Loading...
Searching...
No Matches
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 1225 of file VP1ExecutionScheduler.cxx.

1226{
1227 for (IVP1ChannelWidget*cw : mainwindow->tabManager()->soonVisibleChannels())
1228 if (!scheduler->hasAllActiveSystemsRefreshed(cw))
1229 return false;
1230 return true;
1231}
VP1ExecutionScheduler * scheduler

◆ allVisibleRefreshed()

bool VP1ExecutionScheduler::Imp::allVisibleRefreshed ( ) const

Definition at line 1216 of file VP1ExecutionScheduler.cxx.

1217{
1218 for (IVP1ChannelWidget*cw : mainwindow->tabManager()->visibleChannels())
1219 if (!scheduler->hasAllActiveSystemsRefreshed(cw))
1220 return false;
1221 return true;
1222}

◆ initCruise()

void VP1ExecutionScheduler::Imp::initCruise ( )

Definition at line 1280 of file VP1ExecutionScheduler.cxx.

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

◆ performPostRefreshCruiseActions()

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

Definition at line 1234 of file VP1ExecutionScheduler.cxx.

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

◆ updateProgressBar()

void VP1ExecutionScheduler::Imp::updateProgressBar ( )

Definition at line 549 of file VP1ExecutionScheduler.cxx.

550{
551 double remaining = prioritiser->estimateRemainingCalcTime();
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 {
560 pb->hide();
561 pb->reset();
562 pbtimer->stop();
563 }
564}

◆ warnIfWidgetsAlive()

void VP1ExecutionScheduler::Imp::warnIfWidgetsAlive ( )
static

Definition at line 1155 of file VP1ExecutionScheduler.cxx.

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

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: