int main() { int output = 0; //Fancy Startupscreen - pretend to be loading something system("clear"); printf("SchedulePlanMaster 2000 is starting up..."); fflush(stdout); sleep(1); system("clear"); mainMenu(); checkSchedule(); printSchedule(); mostNightshift(); output = chooseOutputType(); saveFile(output); system( "read -n 1 -s -p \"Press any Key...\"" ); printf("\n\n"); return 0; }
void CTimedSignalQueue::timerEvent(QTimerEvent* event) { if ( event->timerId() == m_oTimer.timerId() ) { checkSchedule(); } else { QObject::timerEvent( event ); } }
bool TMonitoring::startLoop() { // for debug getMessage(0, "*****@*****.**", "testtest"); QSqlQuery query; query.exec("SELECT id, account, password, startMonitor, endMonitor, status FROM accounts ORDER BY startMonitor DESC;"); //================обрабатываем каждый ящик =========================// while (query.next()) { QString id = query.value(0).toString(); QString username = query.value(1).toString(); QString password = query.value(2).toString(); QDateTime startTime = query.value(3).toDateTime(); QDateTime endTime = query.value(4).toDateTime(); bool isActive = query.value(5).toBool(); currentAccountId = id; if (isActive == false) continue; // проверка расписания unsigned long sleepValue = checkSchedule(startTime, endTime); if (sleepValue == NO_START_MONITORING) continue; else { qDebug() << "Sleeping staus.Monitoring is in waiting mode............................" ; sleep(sleepValue); qDebug() << "Monitoring is started............................" ; startMonitoring(id, username, password); qDebug() << "Monitoring is ended..............................." ; continue; } } return true; }
int algo() { int i, j; int RWmP[MAX_TASK_NUM]; fscanf(fin, "%d%d%d%d", &true_task_num, &task_num, &processor_num, &lcm_period); period=(int *)malloc(sizeof(int)*task_num); execute=(int *)malloc(sizeof(int)*task_num); w=(float *)malloc(sizeof(float)*task_num); for(i=0; i<task_num; i++) fscanf(fin, "%d", &period[i]); for(i=0; i<task_num; i++) fscanf(fin, "%d", &execute[i]); for(i=0; i<task_num; i++) { w[i]=((float)execute[i])/((float)period[i]); RWmP[i]=0; } calc_bound(); initialize(); calc_alpha(); calc_UF(); for(i=0; i<processor_num; i++) for(j=0; j<lcm_period; j++) alloc[i][j]=-1; for(i=0; i<row_num; i++) Bfair(RWmP, i); /* for(i=0; i<processor_num; i++) { for(j=0; j<lcm_period; j++) { fprintf(fout, "%d ", alloc[i][j]); } fprintf(fout, "\n"); }*/ if(checkSchedule()==-1) { printf("!!!Schedule error.\n"); } else printf("successfully scheduling.\n"); countPreemption(); countMigration(); countEvent(); fprintf(flog, "preemption:\n"); for(i=0; i<true_task_num; i++) { double ppj=((double)preemption[i])/((double)(lcm_period/period[i])); fprintf(flog, "%lf ", ppj); } fprintf(flog, "\n"); fprintf(flog, "migration:\n"); for(i=0; i<true_task_num; i++) { double mpj=((double)migration[i])/((double)(lcm_period/period[i])); fprintf(flog, "%lf ", mpj); } fprintf(flog, "\n"); fprintf(flog, "event:\n"); for(i=0; i<true_task_num; i++) { double epj=((double)event[i])/((double)(lcm_period/period[i])); fprintf(flog, "%lf ", epj); } fprintf(flog, "\n"); remains(); return 0; }
bool Finder::loadFileList() { emit signalProgress(100, "Wczytywanie harmonogramu ..."); QXlsx::Document schedule(m_schedulePath); if(!checkSchedule(schedule)) { removeCopiedFiles(); emit finished(false, "Harmonogram niepoprawnie sformatowany."); return false; } // find last row of schedule int lastRow = 0; if(!rowCount(schedule,lastRow)) return false; if( m_searchCriterion == "Others") { if(!m_copartnerSet.isEmpty()) emit showCopartnerDialog(); else { removeCopiedFiles(); emit finished(false, "Nie znaleziono kooperantów w harmonogramie."); return false; } if(m_searchCriterion == "Others") { removeCopiedFiles(); emit finished(false, "Anulowano wyszukiwanie."); return false; } } QMap<QString,QColor> colorsMap; QColor color; colorsMap["nocolor"] = color; color.setRgbF(1,0.8,0,1); colorsMap["orange"] = color; color.setRgbF(1,0.752941,0,1); colorsMap["orange2"] = color; color.setRgbF(1,0.8,0.6,1); colorsMap["orange3"] = color; color.setRgbF(1,1,0,1); colorsMap["yellow"] = color; color.setRgbF(1,1,0.4,1); colorsMap["yellow2"] = color; if(m_isWhite) { for (int row=7; row<=lastRow; ++row) { bool abort = m_abort; if (abort) { emit finished(false); return false; } if (QXlsx::Cell *cell=schedule.cellAt(row, 3)) findCells(schedule,cell,row,colorsMap); emit signalProgress(int((double(row)/double(lastRow)*100))+1, "Tworzenie listy plików ..."); } } else { for (int row=7; row<=lastRow; ++row) { bool abort = m_abort; if (abort) { emit finished(false); return false; } QXlsx::Cell *cell=schedule.cellAt(row, 3); if (schedule.cellAt(row, 2)->format().patternBackgroundColor().toRgb() != colorsMap["nocolor"]) findCells(schedule,cell,row,colorsMap); emit signalProgress(int((double(row)/double(lastRow)*100))+1, "Tworzenie listy plików ..."); } } qDebug() << "Wielkość listy: " << m_fileList.size(); return true; }