Exemple #1
0
void BinManager::initStandardBins()
{
	createCombinedMenu();
	createContextMenus();

	//DebugDialog::debug("init bin manager");
	QList<BinLocation *> actualLocations;
	findAllBins(actualLocations);

    hackLocalContrib(actualLocations);

	restoreStateAndGeometry(actualLocations);
	foreach (BinLocation * location, actualLocations) {
		PartsBinPaletteWidget* bin = newBin();
        bin->load(location->path, m_mainWindow->fileProgressDialog(), true);
		m_stackTabWidget->addTab(bin, bin->icon(), bin->title());
		m_stackTabWidget->stackTabBar()->setTabToolTip(m_stackTabWidget->count() - 1, bin->title());
		registerBin(bin);
		delete location;
	}
Exemple #2
0
/*
 * Function to create a new binList struct
 *
 * @param int runSize, size of run
 *
 * @local struct binList *bl, the new binList struct
 *
 * @return struct binList *, pointer to new binList struct
 */
struct binList *newBinList(int runSize) {
    struct binList *bl;
    bl = malloc(sizeof(struct binList));
    if(bl == NULL) {
        perror("Error malloc bin list\n");
        exit(1);
    }
    bl->badItems = malloc(runSize * sizeof(int));
    if(bl->badItems == NULL) {
        perror("Error malloc bl->badItems\n");
        exit(1);
    }
    bl->firstBin = newBin();
    bl->numBins = 1;
    bl->numFull = 0;
    bl->numBad = 0;
    bl->sum = 0;
    bl->optimal = 0;

    return bl;
}