#include "AisDeviceTracker.h"
#include "AisInstrumentHandler.h"
#include "AisExperiment.h"
#include "AisDataManipulator.h"
#include "experiments/builder_elements/AisDiffPulseVoltammetryElement.h"
#include <QCoreApplication>
#include <QTimer>
#include <QDebug>
#define COMPORT "COM1"
#define CHANNEL 0
int main()
{
char** test = nullptr;
int args;
QCoreApplication a(args, test);
std::shared_ptr<AisExperiment> experiment = nullptr;
experiment = std::make_shared<AisExperiment>();
experiment->appendElement(dpv_element, 1);
std::shared_ptr<AisDataManipulator> dataManipulator = std::make_shared<AisDataManipulator>(dpv_element);
auto utcTime = handler->getExperimentUTCStartTime(0);
dataManipulator->loadPrimaryData(data);
if (dataManipulator->isPulseCompleted()) {
static bool writeheader = true;
if (writeheader) {
qDebug() << "time"
<< ", Pulse_current"
<< ", base_current"
<< ", diff_current"
<< ", base_voltage"
<< ", pulse_volatge";
writeheader = false;
}
qDebug() << data.timestamp << ", " << dataManipulator->getPulseCurrent() << ", " << dataManipulator->getBaseCurrent() << ", " << dataManipulator->getPulseCurrent() - dataManipulator->getBaseCurrent() << ", " << dataManipulator->getBaseVoltage() << "," << dataManipulator->getPulseVoltage();
}
});
qDebug() << "channel: " << (int)channel << "frequency :" << data.frequency << " absoluteImpedance: " << data.absoluteImpedance << " phaseAngle : " << data.phaseAngle << " timestamp : " << data.timestamp;
});
qDebug() << "New Node beginning " << data.stepName << " step number " << data.stepNumber << " step sub : " << data.substepNumber;
});
qDebug() << "Experiment Completed Signal " << channel << "Reason : " << reason;
});
qDebug() << "Experiment Paused " << channel;
});
qDebug() << "Experiment Resume " << channel;
});
};
auto& handler = tracker->getInstrumentHandler(deviceName);
connectSignals(&handler);
{
std::shared_ptr<AisExperiment> deleteExp = std::make_shared<AisExperiment>(*experiment);
auto error = handler.uploadExperimentToChannel(CHANNEL, deleteExp);
if (error) {
qDebug() << "Error: " << error.message();
}
}
auto error = handler.startUploadedExperiment(0);
if (error) {
qDebug() << "Error: " << error.message();
}
});
qDebug() << deviceName << "is disconnected ";
});
auto error = tracker->connectToDeviceOnComPort(COMPORT);
if (error) {
qDebug() << "Error: " << error.message();
}
a.exec();
}
void deviceDisconnected(const QString &deviceName)
a signal to be emitted whenever a device has been disconnected.
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.
In this experiment, the working electrode holds at a starting potential during the quiet time....
Definition AisDiffPulseVoltammetryElement.h:26
void setEndVoltageVsOCP(bool endVoltageVsOCP)
set whether to reference the end voltage against the open-circuit voltage or the reference terminal.
void setStartVoltageVsOCP(bool startVoltageVsOCP)
set whether to reference the starting potential against the open-circuit voltage or the reference ter...
this class provides control of the device including starting, pausing, resuming and stopping an exper...
Definition AisInstrumentHandler.h:27
void activeACDataReady(uint8_t channel, const AisACData &ACData)
a signal that is emitted whenever new AC data for an active experiment are ready.
void activeDCDataReady(uint8_t channel, const AisDCData &DCData)
a signal that is emitted whenever new DC data for an active experiment are ready.
void experimentNewElementStarting(uint8_t channel, const AisExperimentNode &stepInfo)
a signal that is emitted whenever a new elemental experiment has started.
void experimentPaused(uint8_t channel)
a signal that is emitted whenever an experiment was paused.
void experimentResumed(uint8_t channel)
a signal that is emitted whenever an experiment was resumed.
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 AC data collected from the instrument.
Definition AisDataPoints.h:44
A structure containing DC data collected from the instrument.
Definition AisDataPoints.h:11
A structure containing some information regarding the running element.
Definition AisDataPoints.h:113