#include "AisDeviceTracker.h"
#include "AisInstrumentHandler.h"
#include <QCoreApplication>
#include <QDebug>
#include <QTimer>
#define COMPORT "COM1"
#define CHANNEL 0
int main()
{
char** test = nullptr;
int args;
QCoreApplication a(args, test);
qDebug() << "Timestamp: " << data.timestamp << " Current: " << data.current << " Voltage: " << data.workingElectrodeVoltage << " CE Voltage : " << data.counterElectrodeVoltage;
});
qDebug() << "Device Error: " << error;
});
qDebug() << reason;
qDebug() << "Experiment has ended. Closing application.";
QCoreApplication::quit();
});
};
qDebug() << "Starting manual mode at open circuit potential";
AisErrorCode error = handler.startManualExperiment(CHANNEL);
qDebug() << error.message();
QCoreApplication::quit();
}
QTimer::singleShot(5000, [=, &handler]() {
qDebug() << "Switching to constant current at .1A";
AisErrorCode error = handler.setManualModeConstantCurrent(CHANNEL, .1);
qDebug() << error.message();
}
});
QTimer::singleShot(15000, [=, &handler]() {
qDebug() << "Switching to constant voltage at 1V";
AisErrorCode error = handler.setManualModeConstantVoltage(CHANNEL, 1);
qDebug() << error.message();
}
});
QTimer::singleShot(25000, [=, &handler]() {
qDebug() << "Switching to open circuit potential";
qDebug() << error.message();
}
});
QTimer::singleShot(30000, [=, &handler]() {
qDebug() << "Stopping experiment";
qDebug() << error.message();
}
});
};
qDebug() << "New Device Connected: " << deviceName;
auto& handler = tracker->getInstrumentHandler(deviceName);
connectSignals(handler);
runExperiment(handler);
});
AisErrorCode error = tracker->connectToDeviceOnComPort(COMPORT);
if (error != error.Success) {
qDebug() << error.message();
return 0;
}
return a.exec();
}
static AisDeviceTracker * Instance()
get the instance of the device tracker.
void newDeviceConnected(const QString &deviceName)
a signal to be emitted whenever a new connection has been successfully established with a device.
This class contains the possible error codes returned to the user when working with the API....
Definition AisErrorCode.h:18
@ Success
Definition AisErrorCode.h:26
this class provides control of the device including starting, pausing, resuming and stopping an exper...
Definition AisInstrumentHandler.h:27
void deviceError(uint8_t channel, const QString &error)
a signal that is emitted whenever device send any critical error.
void activeDCDataReady(uint8_t channel, const AisDCData &DCData)
a signal that is emitted whenever new DC data for an active experiment are ready.
void experimentStopped(uint8_t channel, const QString &reason)
a signal that is emitted whenever an experiment was stopped manually or has completed.
A structure containing DC data collected from the instrument.
Definition AisDataPoints.h:11