//--------------------------------------------------------------
void arduinoGrapher::setup(){
    
    ofSetDataPathRoot("../Resources/");
    ofSetWindowTitle("Arduino Pin Grapher");
    
    cout <<ofToDataPath("verdana.ttf")<<endl;
    
    ofSetFrameRate(60); //stop hogging cpu cycles
    
    setupGui();
    setupGraphs();
    
    serial.setupDevices();
    
//    serial.println("{pin_on:a0}");
//    serial.println("{print:begin}");
    
    ofBackgroundHex(offBlack);
    
    verdana.loadFont("verdana.ttf", 12, true, true);
    verdana20.loadFont("verdana.ttf", 24, true, true);
    
    ofSetLogLevel(OF_LOG_VERBOSE);
    
//    cout << "testing string delimit function"<<endl;
//    
//    string example = "ewf[3489923]fkjewfw{12:34}{56:78}";
//    vector<string>result;
//    result = serial.unwrapDelimited(example, '{', '}');
//    
//    message message = serial.parseMessage(example);
//    
//    cout << "pin 0 is id: "<<message.pinValues[0].pin<<", value: "<<message.pinValues[0].value<<endl;
    
}
Exemple #2
0
Bug_Popout::Bug_Popout(DAQ::BugTask *task, QWidget *parent)
    : QWidget(parent), task(task), p(task->bugParams()), ap(task->allParams()), avgPower(0.0), nAvg(0), logBER(0.0), mut(QMutex::Recursive)
{
    hasMeta = false;

	ui = new Ui::Bug_Popout;
	ui->setupUi(this);	
	
	setupGraphs();
	
	if (p.hpf > 0) { ui->hpfChk->setChecked(true); ui->hpfSB->setValue(p.hpf); } else { ui->hpfChk->setChecked(false); }
	ui->snfChk->setChecked(p.snf);
	ui->statusLabel->setText("Startup...");
	
	Connect(ui->snfChk, SIGNAL(toggled(bool)), this, SLOT(filterSettingsChanged()));
	Connect(ui->hpfChk, SIGNAL(toggled(bool)), this, SLOT(filterSettingsChanged()));
    Connect(ui->hpfSB, SIGNAL(valueChanged(int)), this, SLOT(filterSettingsChanged()));
	
    setupAOPassThru();

	mainApp()->sortGraphsByElectrodeAct->setEnabled(false);
	
	lastStatusT = getTime();
	lastStatusBlock = -1;
	lastRate = 0.;

    QTimer *t = new QTimer(this);
    t->setInterval(250);
    t->setSingleShot(false);
    Connect(t, SIGNAL(timeout()), this, SLOT(updateDisplay()));
    t->start();

    plotThread = new Bug_MetaPlotThread(this,task->samplingRate(),task->pagedWriter());
    plotThread->start(QThread::LowPriority);
}
radeon_profile::radeon_profile(QStringList a,QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::radeon_profile)
{
    ui->setupUi(this);
    timer = new QTimer(this);
    execsRunning = new QList<execBin*>();

    // checks if running as root
    if (globalStuff::grabSystemInfo("whoami")[0] == "root") {
         globalStuff::globalConfig.rootMode = true;
        ui->label_rootWarrning->setVisible(true);
    } else {
        globalStuff::globalConfig.rootMode = false;
        ui->label_rootWarrning->setVisible(false);
    }

    // setup ui elemensts
    ui->mainTabs->setCurrentIndex(0);
    ui->tabs_systemInfo->setCurrentIndex(0);
    ui->configGroups->setCurrentIndex(0);
    ui->list_currentGPUData->setHeaderHidden(false);
    ui->execPages->setCurrentIndex(0);
    setupGraphs();
    setupForcePowerLevelMenu();
    setupOptionsMenu();
    setupContextMenus();
    setupTrayIcon();

    loadConfig();

    //figure out parameters
    QString params = a.join(" ");
    if (params.contains("--driver xorg")) {
        device.driverByParam(gpu::XORG);
        ui->combo_gpus->addItems(device.initialize(true));
    }
    else if (params.contains("--driver fglrx")) {
        device.driverByParam(gpu::FGLRX);
        ui->combo_gpus->addItems(device.initialize(true));
    }
    else // driver object detects cards in pc and fill the list in ui //
        ui->combo_gpus->addItems(device.initialize());

    ui->configGroups->setTabEnabled(2,device.daemonConnected());
    setupUiEnabledFeatures(device.features);

    if(ui->cb_enableOverclock->isChecked() && ui->cb_overclockAtLaunch->isChecked())
        ui->btn_applyOverclock->click();


    connectSignals();

    // timer init
    timer->setInterval(ui->spin_timerInterval->value()*1000);

    // fill tables with data at the start //
    refreshGpuData();
    ui->list_glxinfo->addItems(device.getGLXInfo(ui->combo_gpus->currentText()));
    ui->list_connectors->addTopLevelItems(device.getCardConnectors());
    ui->list_connectors->expandToDepth(2);
    ui->list_modInfo->addTopLevelItems(device.getModuleInfo());
    refreshUI();

    timer->start();
    addRuntimeWidgets();

    showWindow();
}