|
|
#ifndef MAINWINDOW_H
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
#include <mainwindowui.h>
|
|
|
|
|
|
#include <QtGui/QMainWindow>
|
|
|
#include <QDialog>
|
|
|
#include <QObject>
|
|
|
#include <QTimer>
|
|
|
#include <tcpackettosend.h>
|
|
|
|
|
|
#include "spw_usb_api.h"
|
|
|
#include "spw_config_library.h"
|
|
|
#include "TC_types.h"
|
|
|
|
|
|
#define BWAIT_0 0
|
|
|
#define BWAIT_1 1
|
|
|
#define PATH_ADDRESSING_OFFSET 1
|
|
|
|
|
|
class MainWindow : public QWidget
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
MainWindow(QWidget *parent = 0);
|
|
|
~MainWindow();
|
|
|
unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
|
|
|
TCPacketToSend *packetToSend;
|
|
|
|
|
|
private:
|
|
|
unsigned int getLinkStatus(unsigned char link);
|
|
|
|
|
|
USB_SPACEWIRE_ID pIdentifier;
|
|
|
USB_SPACEWIRE_STATUS result; // The result of the send operation
|
|
|
star_device_handle hDevice; // Handle to the SpaceWire device
|
|
|
bool isRunning;
|
|
|
|
|
|
mainwindowui *UI;
|
|
|
QTimer *time;
|
|
|
|
|
|
long systemTime;
|
|
|
bool flag_sendSystemTimePacket;
|
|
|
bool flag_sendArbitraryTimePacket;
|
|
|
bool flag_sendTimecodesPeriodicallyStarDundee;
|
|
|
|
|
|
signals:
|
|
|
void sendMessage(QString);
|
|
|
void systemTimeHasChanged(long time);
|
|
|
|
|
|
public slots:
|
|
|
unsigned int Open();
|
|
|
unsigned int testBrick();
|
|
|
void sendOneTimecode();
|
|
|
void sendTimecodesPeriodicallyPC();
|
|
|
void sendTimecodesPeriodicallyStarDundee();
|
|
|
void periodicalTimecodeTimeout();
|
|
|
void sendTimePacketTimeout();
|
|
|
void sendSystemTime();
|
|
|
void sendArbitraryTime();
|
|
|
void sendSystemTimeAndTimecode();
|
|
|
void sendArbitraryTimeAndTimecode();
|
|
|
void sendUpdateTime(long time);
|
|
|
void reTestSPWLink();
|
|
|
};
|
|
|
|
|
|
#endif // MAINWINDOW_H
|
|
|
|