int _tmain(int argc, _TCHAR* argv[])
{
    
	initCommon();
	if (initConfig()==0){
		destroyConfig();
		return 1;
	};
    scanPorts();
	/*
	#define STATUS_OK                         0x000
    #define STATUS_HARDWARE_NOT_CONNECTED     0x001
    #define STATUS_HARDWARE_ON_DIFFERENT_PORT 0x002 //the hardware was detected on a different port
    #define STATUS_USER_HARDWARE_SELECTION    0x004
	*/
	if (resolveConfig() & (STATUS_HARDWARE_NOT_CONNECTED | STATUS_USER_HARDWARE_SELECTION)){
	  return 1;//error abort
	};
	initSerialCommunication();
	if (initNetwork()==0){
		destroyNetwork();
	}
	test();
	closeSerialCommunication();
	destroyConfig();
	return 0;
}
pFace::pFace(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::pFace)
{
    ui->setupUi(this);

    QObject::connect(ui->LoadButton,SIGNAL(clicked()),this,SLOT(readScript()));
    QObject::connect(ui->RunButton,SIGNAL(clicked()),this,SLOT(tmpRunner()));
    //QObject::connect(ui->RunButton,SIGNAL(clicked()),this,SLOT(parseCommands()));
    QObject::connect(ui->ConnectButton,SIGNAL(clicked()),this,SLOT(connect2Port()));
    QObject::connect(ui->DisconnectButton,SIGNAL(clicked()),this,SLOT(closePort()));
    QObject::connect(ui->scanButton,SIGNAL(clicked()),this,SLOT(scanPorts()));

    QObject::connect(ui->homeX,SIGNAL(clicked()),this,SLOT(homeX()));
    QObject::connect(ui->homeY,SIGNAL(clicked()),this,SLOT(homeY()));
    QObject::connect(ui->homeZ,SIGNAL(clicked()),this,SLOT(homeZ()));
    QObject::connect(ui->homeAll,SIGNAL(clicked()),this,SLOT(homeAll()));

    scanPorts();
}
int AdminRFID::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: onConnect(); break;
        case 1: onReadyRead(); break;
        case 2: scanPorts(); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
Exemple #4
0
RHD2000Thread::RHD2000Thread(SourceNode* sn) : DataThread(sn),
    chipRegisters(30000.0f),
    numChannels(0),
    deviceFound(false),
    isTransmitting(false),
    dacOutputShouldChange(false),
    acquireAdcChannels(false),
    acquireAuxChannels(true),
    fastSettleEnabled(false),
    dspEnabled(true),
    desiredDspCutoffFreq(0.5f),
    desiredUpperBandwidth(7500.0f),
    desiredLowerBandwidth(1.0f),
    boardSampleRate(30000.0f),
    savedSampleRateIndex(16),
    cableLengthPortA(0.914f), cableLengthPortB(0.914f), cableLengthPortC(0.914f), cableLengthPortD(0.914f), // default is 3 feet (0.914 m),
    audioOutputL(-1), audioOutputR(-1) 
{
    evalBoard = new Rhd2000EvalBoard;
    dataBlock = new Rhd2000DataBlock(1);
    dataBuffer = new DataBuffer(2, 10000); // start with 2 channels and automatically resize

    // Open Opal Kelly XEM6010 board.
	// Returns 1 if successful, -1 if FrontPanel cannot be loaded, and -2 if XEM6010 can't be found.
    File executable = File::getSpecialLocation(File::currentExecutableFile);

    #if defined(__APPLE__)
        const String executableDirectory =
            executable.getParentDirectory().getParentDirectory().getParentDirectory().getParentDirectory().getFullPathName();
    #else
	   const String executableDirectory = executable.getParentDirectory().getFullPathName();
    

    #endif
    
    std::cout << executableDirectory << std::endl;
    

	String dirName = executableDirectory;
    libraryFilePath = dirName;
	libraryFilePath += File::separatorString;
	libraryFilePath += okLIB_NAME;
    
    if (openBoard(libraryFilePath))
    {

        // upload bitfile and restore default settings
        initializeBoard();

        // automatically find connected headstages
        scanPorts(); // things would appear to run more smoothly if this were done after the editor has been created
    
        if (0)
        {
            evalBoard->setContinuousRunMode(true);
            evalBoard->run();
        }

    }

}