/* Job functions for List */ int allocateJobPtr(void** target, void* source){ Job** newJob = (Job**) target; Job* sourceJob = (Job*) source; if(newJob == NULL){ printf("allocateJobPtr: newJob Pointer is NULL! - Exiting!\n"); return EXIT_VALUE; } *newJob = malloc(sizeof(Job)); if(*newJob == NULL){ printf("allocateJobPtr: Failed to allocate memory for Job! - Exiting!\n"); return EXIT_VALUE; } (*newJob)->jobID = sourceJob->jobID; (*newJob)->priority = sourceJob->priority; (*newJob)->type = sourceJob->type; (*newJob)->status = sourceJob->status; createList(&((*newJob)->argumentList),"argumentList",&allocateArgumentPtr,&destroyArgumentPtr,NULL,NULL,&printArgumentPtr); appendLists(&((*newJob)->argumentList),&(sourceJob->argumentList)); return 0; }
/* List functions for List (List used as datatype in List!) */ int allocateListPtr(void** target, void* source){ //For when we want a List to carry a List in each Node List** targetList = (List**) target; List* sourceList = (List*) source; if(targetList == NULL){ printf("allocateListPtr: Error targetList pointer is Null!\n"); exit(1); } *targetList = malloc(sizeof(List)); //This new List must know what kind of List it will be,so it sees the source argument to determine if(*targetList == NULL){ printf("allocateListPtr: failed to allocate memory!\n"); exit(1); } if(!strcmp(sourceList->type_name,"ListOfLists")){ *targetList = sourceList; } createList(*targetList,sourceList->type_name,sourceList->allocateNode,sourceList->destroyNode,sourceList->compareNode,sourceList->assignNode,sourceList->printNode); appendLists(*targetList,sourceList); //Copy all records of List 2 to List1 return 0; }
ImageFileManger::ImageFileManger(QWidget *parent) : QMainWindow(parent) { this->FileListView = new QListWidget; this->FileListView->isSortingEnabled(); this->setCentralWidget(this->FileListView); this->InputFileList.clear(); this->exitAction = new QAction(tr("Exit"), this); connect(this->exitAction, SIGNAL(triggered()), this, SLOT(close())); this->exitAction->setShortcut(QKeySequence::Close); this->menuBar()->addAction(this->exitAction); this->loadImages = new QAction("Load Images", this); connect(this->loadImages, SIGNAL(triggered()), this, SLOT(BrowseFiles())); this->menuBar()->addAction(this->loadImages); this->append = new QAction("Append L Measure txt", this); connect(this->append, SIGNAL(triggered()), this, SLOT(appendLists())); this->menuBar()->addAction(this->append); this->StartPreprocessing = new QAction("Preprocess..", this); connect(this->StartPreprocessing, SIGNAL(triggered()), this, SLOT(Preprocess())); this->StartPreprocessing->setEnabled(false); this->menuBar()->addAction(this->StartPreprocessing); preprocessdialog = new PreprocessDialog("",this); this->ProcessImages = new QAction("Process Images", this); connect(this->ProcessImages, SIGNAL(triggered()), this, SLOT(ProcessFiles())); this->ProcessImages->setEnabled(false); this->menuBar()->addAction(this->ProcessImages); this->outputDirectories; this->outputDirectories << "DAPI" << "Cy5"<< "TRITC"<<"GFP"; }