|
|
#ifndef MAINWINDOW_H
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
#include <mainwindowui.h>
|
|
|
|
|
|
#include <QtGui/QMainWindow>
|
|
|
#include <QDialog>
|
|
|
#include <QObject>
|
|
|
#include <QTimer>
|
|
|
|
|
|
#include "spw_usb_api.h"
|
|
|
#include "spw_config_library.h"
|
|
|
#include "TC_types.h"
|
|
|
#include "tcpackettosend.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_sendTimePacket;
|
|
|
|
|
|
signals:
|
|
|
void sendMessage(QString);
|
|
|
void systemTimeHasChanged(long time);
|
|
|
|
|
|
public slots:
|
|
|
unsigned int Open();
|
|
|
void sendOneTimecode();
|
|
|
void sendTimecodesPeriodically();
|
|
|
void periodicalTimecodeTimeout();
|
|
|
void sendTimePacketTimeout();
|
|
|
void sendSystemTime();
|
|
|
void sendArbitraryTime();
|
|
|
void sendUpdateTime(long time);
|
|
|
void reTestSPWLink();
|
|
|
};
|
|
|
|
|
|
#endif // MAINWINDOW_H
|
|
|
|