BOOL uninstall(PINSTALLDATA pid, HWND hprgs) { BOOL rc = FALSE; ULONG csteps; ULONG i = 0; // inizializza file log startProcessing(pid, hprgs); // calcola numero passi da eseguire if (!(csteps = instuninstcsteps(pid, hprgs))) goto end; // se programma preferenze aperto lo chiude if (!instcloseprefapp(pid, &i, hprgs, csteps)) goto end; // modifica os2.ini if (!instdelprfitems(pid, &i, hprgs, csteps)) goto end; // cancella albero bitmap if ((pid->fl & INSSEL_REMBMPS) && !instdeltree(pid, &i, hprgs, csteps)) goto end; // cancella file, smartwin.dll e styler20.dll if (!instdelfiles(pid, &i, hprgs, csteps)) goto end; // distrugge oggetti if (!instdelobjs(pid, &i, hprgs, csteps)) goto end; // distrugge directory installazione e altri eventuali file (chiedendo // conferma) if (!instdelinstpath(pid, &i, hprgs, csteps)) goto end; rc = TRUE; end: // scrive file log, mostra messaggio termine e riabilita controlli endProcessing(pid, hprgs, rc); return rc; }
bool UIWizardNewVDPageBasic3::validatePage() { /* Initial result: */ bool fResult = true; /* Make sure such file doesn't exists already: */ QString strMediumPath(mediumPath()); fResult = !QFileInfo(strMediumPath).exists(); if (!fResult) msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this); if (fResult) { /* Lock finish button: */ startProcessing(); /* Try to create virtual hard drive file: */ fResult = qobject_cast<UIWizardNewVD*>(wizard())->createVirtualDisk(); /* Unlock finish button: */ endProcessing(); } /* Return result: */ return fResult; }
void ArtworkUploader::allFinished(bool anyError) { LOG_INFO << "anyError =" << anyError; setIsError(anyError); endProcessing(); m_Percent = 100; updateProgress(); }
bool UIWizardNewVMPageBasic3::validatePage() { /* Initial result: */ bool fResult = true; /* Ensure unused virtual-disk is deleted: */ if (m_pDiskSkip->isChecked() || m_pDiskCreate->isChecked() || (!m_virtualDisk.isNull() && m_strVirtualDiskId != m_virtualDisk.GetId())) ensureNewVirtualDiskDeleted(); if (m_pDiskSkip->isChecked()) { /* Ask user about disk-less machine: */ fResult = msgCenter().confirmHardDisklessMachine(this); } else if (m_pDiskCreate->isChecked()) { /* Show the New Virtual Hard Drive wizard: */ fResult = getWithNewVirtualDiskWizard(); } if (fResult) { /* Lock finish button: */ startProcessing(); /* Try to create VM: */ fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM(); /* Unlock finish button: */ endProcessing(); } /* Return result: */ return fResult; }
BOOL install(PINSTALLDATA pid, HWND hprgs) { BOOL rc = FALSE; ULONG csteps; ULONG i = 0; // inizializza file log startProcessing(pid, hprgs); // calcola numero passi da eseguire if (!(csteps = instinstcsteps(pid))) goto end; // se programma preferenze aperto lo chiude if (!instcloseprefapp(pid, &i, hprgs, csteps)) goto end; // modifica os2.ini if (!instaddprfitems(pid, &i, hprgs, csteps)) goto end; // cancella file obsoleti if (!instdelobsolete(pid, &i, hprgs, csteps)) goto end; // copia file e smartwin.dll if (!instcopyfiles(pid, &i, hprgs, csteps)) goto end; // copia albero bitmap if (!instcopytree(pid, &i, hprgs, csteps)) goto end; // crea oggetti if (!instcreatobjs(pid, &i, hprgs, csteps)) goto end; // if needed update the ini file updateIni(); rc = TRUE; end: // scrive file log, mostra messaggio termine e riabilita controlli endProcessing(pid, hprgs, rc); return rc; }
bool UIFirstRunWzdPage3::validatePage() { startProcessing(); bool fResult = insertDevice(); endProcessing(); return fResult; }
void ArtworkUploader::allFinished(bool status) { Q_UNUSED(status); endProcessing(); m_Percent = 100; updateProgress(); }
bool UICloneVMWizardPage3::validatePage() { /* Start performing long-time operation: */ startProcessing(); /* Try to create the clone: */ QString strName = field("cloneName").toString(); bool fReinitMACs = field("reinitMACs").toBool(); bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(strName, cloneMode(), fReinitMACs); /* Finish performing long-time operation: */ endProcessing(); /* Return operation result: */ return fResult; }
bool UICloneVMWizardPage1::validatePage() { if (isFinalPage()) { /* Start performing long-time operation: */ startProcessing(); /* Try to create the clone: */ bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(cloneName(), KCloneMode_MachineState, isReinitMACsChecked()); /* Finish performing long-time operation: */ endProcessing(); /* Return operation result: */ return fResult; }else return true; }
BOOL refresh(PINSTALLDATA pid, HWND hprgs) { BOOL rc = FALSE; ULONG csteps; ULONG i = 0; // inizializza file log startProcessing(pid, hprgs); // calcola numero passi da eseguire csteps = instrfrshcsteps(pid); // crea oggetti if (!instcreatobjs(pid, &i, hprgs, csteps)) goto end; rc = TRUE; end: // scrive file log, mostra messaggio termine e riabilita controlli endProcessing(pid, hprgs, rc); return rc; }
bool UIWizardExportAppPageExpert::validatePage() { /* Initial result: */ bool fResult = true; /* Lock finish button: */ startProcessing(); /* Try to export appliance: */ fResult = qobject_cast<UIWizardExportApp*>(wizard())->exportAppliance(); /* Unlock finish button: */ endProcessing(); /* Return result: */ return fResult; }
bool UIWizardFirstRunPageBasic::validatePage() { /* Initial result: */ bool fResult = true; /* Lock finish button: */ startProcessing(); /* Try to insert chosen medium: */ if (fResult) fResult = qobject_cast<UIWizardFirstRun*>(wizard())->insertMedium(); /* Unlock finish button: */ endProcessing(); /* Return result: */ return fResult; }
bool UIWizardImportAppPageBasic2::validatePage() { /* Initial result: */ bool fResult = true; /* Lock finish button: */ startProcessing(); /* Try to import appliance: */ if (fResult) fResult = qobject_cast<UIWizardImportApp*>(wizard())->importAppliance(); /* Unlock finish button: */ endProcessing(); /* Return result: */ return fResult; }
bool UICloneVMWizardPage2::validatePage() { if (isFinalPage()) { /* Start performing long-time operation: */ startProcessing(); /* Try to create the clone: */ QString strName = field("cloneName").toString(); bool fReinitMACs = field("reinitMACs").toBool(); bool fResult = static_cast<UICloneVMWizard*>(wizard())->createClone(strName, KCloneMode_MachineState, fReinitMACs, m_pLinkedCloneRadio->isChecked()); /* Finish performing long-time operation: */ endProcessing(); /* Return operation result: */ return fResult; } else return true; }
bool UIWizardNewVMPageExpert::validatePage() { /* Initial result: */ bool fResult = true; /* Lock finish button: */ startProcessing(); /* Try to create machine folder: */ if (fResult) fResult = createMachineFolder(); /* Try to assign boot virtual-disk: */ if (fResult) { /* Ensure there is no virtual-disk created yet: */ Assert(m_virtualDisk.isNull()); if (fResult) { if (m_pDiskCreate->isChecked()) { /* Show the New Virtual Hard Drive wizard if necessary: */ fResult = getWithNewVirtualDiskWizard(); } } } /* Try to create VM: */ if (fResult) fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM(); /* Unlock finish button: */ endProcessing(); /* Return result: */ return fResult; }
bool UIWizardCloneVDPageExpert::validatePage() { /* Initial result: */ bool fResult = true; /* Lock finish button: */ startProcessing(); /* Make sure such virtual-disk doesn't exists: */ QString strMediumPath(mediumPath()); fResult = !QFileInfo(strMediumPath).exists(); if (!fResult) msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this); /* Try to copy virtual-disk: */ if (fResult) fResult = qobject_cast<UIWizardCloneVD*>(wizard())->copyVirtualDisk(); /* Unlock finish button: */ endProcessing(); /* Return result: */ return fResult; }
bool UIWizardCloneVMPageBasic2::validatePage() { /* This page could be final: */ if (isFinalPage()) { /* Initial result: */ bool fResult = true; /* Lock finish button: */ startProcessing(); /* Trying to clone VM: */ if (fResult) fResult = qobject_cast<UIWizardCloneVM*>(wizard())->cloneVM(); /* Unlock finish button: */ endProcessing(); /* Return result: */ return fResult; } else return true; }
void *MaekawaProcess(void* iqueue) { printf("MaekawaProcess Thread created\n"); long messageCounter = 0; long timeCounter = 0; //getting time for CS grant long utime, seconds, useconds; queue<struct timeval> timequeue; //struct timeval start1; wqueue<Packet*>*m_queue=(wqueue<Packet*>*)iqueue; MaekawaAlgorithm *mnode = MaekawaAlgorithm::getInstance(); sleep(5); long s=1; long e =0; // Remove 1 item at a time and process it. Blocks if no items are // available to process. for (int i = 0;; i++) { printf("MaekawaProcessing Thread , loop %d - waiting for item...\n", i); Packet* item = m_queue->remove(); //printf("thread loop %d - got one item\n", i); //uncomment for unreliable //if(!randDecision()){ // printf("===>Missed a packet from Node %d(Origin: %d) and packet type is %d\n",item->sender,item->ORIGIN,item->TYPE); // continue; //} printf("Received: messageType - %d, SEQ number - %ld\n",item->TYPE, item->SEQ); switch (item->TYPE) { case MAKE_REQUEST: printf(" ## MAKE_REQUEST received from Node %d and packet type is %d\n",item->ORIGIN,item->TYPE); struct timeval start; gettimeofday(&start, NULL); timequeue.push(start); s = start.tv_sec; printf("start time: %l\n",s); mnode->receiveMakeRequest(*item); break; case REQUEST: printf(" ## REQUEST received from Node %d and packet type is %d\n",item->ORIGIN,item->TYPE); mnode->receiveRequest(*item); if(item->ORIGIN != mnode->processID) messageCounter++; break; case INQUIRE: printf(" ## INQUIRE received from Node %d and packet type is %d\n",item->ORIGIN,item->TYPE); mnode->receiveInquire(*item); if(item->ORIGIN != mnode->processID) messageCounter++; break; case FAILED: printf(" ## FAILED received from Node %d and packet type is %d\n",item->ORIGIN,item->TYPE); mnode->receiveFailed(*item); if(item->ORIGIN != mnode->processID) messageCounter++; break; case RELEASE: printf(" ## RELEASE received from Node %d and packet type is %d\n",item->ORIGIN,item->TYPE); mnode->receiveRelease(*item); if(item->ORIGIN != mnode->processID) messageCounter++; break; case RELINQUISH: printf(" ## RELINQUISH received from Node %d and packet type is %d\n",item->ORIGIN,item->TYPE); mnode->receiveRelinquish(*item); if(item->ORIGIN != mnode->processID) messageCounter++; break; case LOCKED: printf(" ## LOCKED received from Node %d and packet type is %d\n",item->ORIGIN,item->TYPE); mnode->flagforCS = false; struct timeval end; gettimeofday(&end, NULL); e = end.tv_sec; struct timeval start1; start1 = timequeue.front(); seconds = end.tv_sec - start1.tv_sec; useconds = end.tv_usec - start1.tv_usec; utime = ((seconds) * 1000000 + useconds) + 0.5; printf("end time:%l, totaltime: %l",e,utime); mnode->receiveLocked(*item); if(mnode->flagforCS){//node entered CS on this Locked //struct timeval end; //gettimeofday(&end, NULL); //struct timeval start = timequeue.front(); timequeue.pop(); //seconds = end.tv_sec - start.tv_sec; //useconds = end.tv_usec - start.tv_usec; //utime = ((seconds) * 1000000 + useconds) + 0.5; timeCounter += utime; } if(item->ORIGIN != mnode->processID) messageCounter++; break; case END_PROCESS: printf("END_PROCESS recieved from Node %d and packet type is %d\n",item->ORIGIN,item->TYPE); delete item; endProcessing(mnode->processID,messageCounter,timeCounter); break; default: break; } delete item; } return NULL; }
void *TorumProcess(void* mqueue) { printf("TorumProcess Thread created\n"); long messageCounter = 0; long timeCounter = 0; wqueue<Packet*>*m_queue=(wqueue<Packet*>*)mqueue; //getting time for CS grant long utime, seconds, useconds; queue<struct timeval> timequeue; Torum *node = Torum::getInstance(); sleep(5); node->displayStatus(); // Remove 1 item at a time and process it. Blocks if no items are // available to process. for (int i = 0;; i++) { printf("\nTorumProcessing Thread , loop %d - waiting for message...\n", i); Packet* item = m_queue->remove(); //printf("thread loop %d - got one item\n", i); //printf("Received: messageType - %d, SEQ number - %ld\n",item->TYPE, item->SEQ); //uncomment for unreliable //if(!randDecision()){ // printf("===>Missed a packet from Node %d(Origin: %d) and packet type is %d\n",item->sender,item->ORIGIN,item->TYPE); // delete item; // continue; //} if (item->TYPE == SEND_TOKEN){ printf("##SEND_TOKEN recieved from Node %d(Origin: %d) and packet type is %d\n",item->sender,item->ORIGIN,item->TYPE); node->flagforCS = false; struct timeval end; gettimeofday(&end, NULL); struct timeval start = timequeue.front(); seconds = end.tv_sec - start.tv_sec; useconds = end.tv_usec - start.tv_usec; utime = ((seconds) * 1000000 + useconds) + 0.5; node->receiveToken(*item); if(node->flagforCS){//node entered CS using this Token //struct timeval end; //gettimeofday(&end, NULL); //struct timeval start = timequeue.front(); timequeue.pop(); //seconds = end.tv_sec - start.tv_sec; //useconds = end.tv_usec - start.tv_usec; //utime = ((seconds) * 1000000 + useconds) + 0.5; timeCounter += utime; } if(item->sender != node->ID) messageCounter++; }else if (item->TYPE == MAKE_REQUEST){ printf("##MAKE_REQUEST recieved from Controller %d and packet type is %d\n",item->ORIGIN,item->TYPE); struct timeval start; gettimeofday(&start, NULL); timequeue.push(start); node->requestCS(); }else if (item->TYPE == HAVE_TOKEN){ if(item->sender != node->ID) messageCounter++; printf("##HAVE_TOKEN recieved from Node %d(Origin: %d) and packet type is %d\n",item->sender,item->ORIGIN,item->TYPE); node->receiveHaveTkn(*item); }else if (item->TYPE == RELEASE){ if(item->sender != node->ID) messageCounter++; printf("##RELEASE recieved from Node %d(Origin: %d) and packet type is %d\n",item->sender,item->ORIGIN,item->TYPE); node->receiveRelease(*item); }else if (item->TYPE == REQUEST){ if(item->sender != node->ID) messageCounter++; printf("##REQUEST recieved from Node %d(Origin: %d) and packet type is %d\n",item->sender,item->ORIGIN,item->TYPE); node->receiveRequest(*item); } else if(item->TYPE == END_PROCESS) { printf("##END_PROCESS recieved from Node %d(Origin: %d) and packet type is %d\n",item->sender,item->ORIGIN,item->TYPE); endProcessing(node->ID,messageCounter,timeCounter); } delete item; node->displayStatus(); } return NULL; }