gresb.h
108 lines
| 3.5 KiB
| text/x-c
|
CLexer
/ rmapplugin / gresb.h
paul@pc-solar1.lab-lpp.local
|
r2 | #ifndef GRESB_H | ||
#define GRESB_H | ||||
#include <QWidget> | ||||
#include <QLabel> | ||||
#include <QPushButton> | ||||
#include <QSpinBox> | ||||
#include <QGridLayout> | ||||
r6 | #include <QTcpSocket> | |||
#include <QDialog> | ||||
r7 | #include <QSemaphore> | |||
r6 | ||||
#include "gresbstatusenquiry.h" | ||||
#include "rmapoperations.h" | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | #include "qipdialogbox.h" | ||
r11 | #include "ccsds.h" | |||
r13 | #include "tmpackettoread.h" | |||
paul@pc-solar1.lab-lpp.local
|
r2 | |||
class gresb : public QWidget | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
explicit gresb(QWidget *parent = 0); | ||||
r6 | ~gresb(); | |||
unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0); | ||||
unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0); | ||||
unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication); | ||||
r11 | ||||
unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); | ||||
r19 | ||||
gresbStatusEnquiry* spwLinkStatusEnquiry; | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | |||
signals: | ||||
r6 | void sendMessage(QString message); | |||
r17 | void sendPacket(TMPacketToRead*); | |||
r6 | void isOpen(bool); | |||
void RMAP_write_reply_setText(QString); | ||||
void appendToLog(QString); | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | public slots: | ||
r6 | void Open(); | |||
void Close(); | ||||
r11 | int receiveSPWPacketLoop(unsigned char requestID=0); | |||
r7 | int receiveSPWPacket(unsigned char requestID=0); | |||
r10 | void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;} | |||
void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;} | ||||
r11 | void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;} | |||
r10 | void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();} | |||
r9 | void reTestSPWLink(); | |||
r10 | // | |||
r9 | void RMAPSendConnectionState(QAbstractSocket::SocketState socketState); | |||
void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState); | ||||
void GRESBConnectionState(QAbstractSocket::SocketState socketState); | ||||
r11 | // | |||
void setIP(unsigned char address1, unsigned char address2, unsigned char address3, unsigned char address4) | ||||
{this->gresbBridgeIPDialogBox->setIP(address1, address2, address3, address4);} | ||||
r6 | ||||
private slots: | ||||
int GRESBStatusQuery(); | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | |||
private: | ||||
r7 | unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0); | |||
unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0); | ||||
r10 | void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();} | |||
void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();} | ||||
r6 | int GRESBStatusQueryRequest(GresbStatusQueryOption option, char link); | |||
r5 | ||||
r6 | unsigned char rmapTargetLogicalAddress ; | |||
unsigned char rmapSourceLogicalAddress ; | ||||
RMAP_command_codes commandCode; | ||||
QPushButton *gresbStatusQueryRetryButton; | ||||
QPushButton *gresbStatusQueryAbortButton; | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | QLabel *gresbBridgeIPLabel; | ||
QLabel *gresbVirtualLinkLabel; | ||||
QLabel *spwLinkLabel; | ||||
QLabel *rmapSendStateLabel; | ||||
QLabel *rmapReceiveStateLabel; | ||||
QLabel *gresbStatusQueryLabel; | ||||
r6 | QLabel *gresbStatusQueryDialogLabel; | |||
QDialog *gresbStatusQueryDialog; | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | |||
QIPDialogBox* gresbBridgeIPDialogBox; | ||||
QSpinBox *gresbVirtualLinkSpinBox; | ||||
QSpinBox *spwLinkSpinBox; | ||||
QGridLayout *connectionLayout; | ||||
r6 | QGridLayout *gresbStatusQueryDialogLayout; | |||
QTcpSocket *RMAPSend_SOCKET; | ||||
QTcpSocket *RMAPReceive_SOCKET; | ||||
QTcpSocket *GRESBStatusQuery_SOCKET; | ||||
r7 | // Packet receiver | |||
QSemaphore *rmapPacketSEMAPHORE; | ||||
QSemaphore *ccsdsPacketSEMAPHORE; | ||||
char* rmapPacket; // The buffer to receive RMAP READ packets | ||||
unsigned char *ccsdsPacket; | ||||
char *spwPacket; | ||||
unsigned int rmapPacketSize; | ||||
unsigned int ccsdsPacketSize; | ||||
paul@pc-solar1.lab-lpp.local
|
r2 | }; | ||
#endif // GRESB_H | ||||