##// END OF EJS Templates
Functions added to the plugin to get the number of CCSDS packets...
Functions added to the plugin to get the number of CCSDS packets transmitted (linked to the lfrcontrol plugin counter of TC transmitted, it is possible to flush the TC transmission before changing the spacewire link in use)

File last commit:

r40:cda6b4e8adc1 Patch 3 from Paul on spwplugin default
r40:cda6b4e8adc1 Patch 3 from Paul on spwplugin default
Show More
stardundeespw_usb.h
159 lines | 5.7 KiB | text/x-c | CLexer
Jeandet Alexis
Started GR-ESB driver.
r22 /*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-------------------------------------------------------------------------------*/
/*-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@member.fsf.org
----------------------------------------------------------------------------*/
#ifndef STARDUNDEESPW_USB_H
#define STARDUNDEESPW_USB_H
#include <QObject>
#include <spw_usb_api.h>
#include <spw_config_library.h>
#include <socexplorerplugin.h>
#include <abstractspwbridge.h>
#include <QThread>
#include <QMutex>
#include <QSemaphore>
#include <QGridLayout>
#include <QPushButton>
#include <QComboBox>
#include <QLabel>
#include "stardundeegui.h"
paul
Functions added to the Python API:...
r35 #define BRICK_IS_SET_AS_AN_INTERFACE true
#define BRICK_IS_SET_AS_A_ROUTER false
Jeandet Alexis
Started GR-ESB driver.
r22
class stardundeeSPW_USB_Manager: public QThread
{
Q_OBJECT
public:
explicit stardundeeSPW_USB_Manager(socexplorerplugin *plugin = 0,QObject* parent=0);
~stardundeeSPW_USB_Manager();
void run();
bool connectBridge();
paul
Functions added to the Python API:...
r35 bool connectBridgeAsInterface();
bool connectBridgeAsRouter();
void initDialog( void );
unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts, char bDelHead);
unsigned int getRoutingTableEntry(int tableEntry);
void initializeTimecodeGeneration();
paul
timecodes added to the spw plugin
r38 void setTimecodeFrequency(double requestedFrequency);
paul
Functions added to the Python API:...
r35 unsigned int getLinkStatus(unsigned char link);
Jeandet Alexis
Started GR-ESB driver.
r22 bool disconnectBridge();
int getRMAPtransactionID();
int getRMAPanswer(int transactionID,char** buffer);
bool sendPacket(char* packet,int size);
signals:
void updateAvailableBrickCount(int count);
void emitPacket(char* packet,int size);
paul
Functions added to the Python API:...
r35 void bytesReceivedFromSpw( unsigned int );
void bytesTransmittedToSpw( unsigned int);
paul
Functions added to the plugin to get the number of CCSDS packets...
r40 void ccsdsPacketTransmittedToSpw( void );
paul
Functions added to the Python API:...
r35
paul
timecodes added to the spw plugin
r38 public slots:
void sendTimecodePeriodically( bool onOff );
paul
Functions added to the plugin to get the number of CCSDS packets...
r40 int getLinkNumber( void );
paul
timecodes added to the spw plugin
r38
Jeandet Alexis
Started GR-ESB driver.
r22 private:
QMutex* handleMutex,*RMAP_AnswersMtx,*RMAP_pending_transaction_IDsMtx;
QSemaphore* RMAP_AnswersSem;
void pushRmapPacket(char* packet,int len);
star_device_handle hDevice;
socexplorerplugin* plugin;
bool connected;
char* SPWPacketBuff;
QList<RMAP_Answer*> RMAP_Answers;
QList<int> RMAP_pending_transaction_IDs;
paul
Functions added to the Python API:...
r35 QLabel *starDundeeStatusQueryDialogLabel;
QPushButton *starDundeeStatusQueryRetryButton;
QPushButton *starDundeeStatusQueryAbortButton;
QLabel *statusLink1;
QLabel *statusLink2;
QPushButton *starDundeeStatusQueryContinueButton;
QDialog *starDundeeStatusQueryDialog;
QGridLayout *starDundeeStatusQueryDialogLayout;
Jeandet Alexis
Started GR-ESB driver.
r22 public:
int selectedBrick;
int linkNumber;
int brickList;
int linkSpeed;
paul
Functions added to the Python API:...
r35 int sourceLogicalAddress;
int destinationLogicalAddress;
Jeandet Alexis
Started GR-ESB driver.
r22 int destinationKey;
int RMAPtimeout;
paul
timecodes added to the spw plugin
r38 double timecodeFrequency;
paul
Functions added to the Python API:...
r35 bool interfaceMode; // 1 => interface mode, 0 => router mode
Jeandet Alexis
Started GR-ESB driver.
r22 };
class stardundeeSPW_USB : public abstractSpwBridge
{
Q_OBJECT
public:
explicit stardundeeSPW_USB(socexplorerplugin *parent = 0);
~stardundeeSPW_USB();
signals:
void setRmapTimeout(const QString & timeout);
void SelectBrick(int brickIndex);
void SelectLinkNumber(int linkIndex);
void SelectLinkSpeed(int linkSpeed);
void SetDestinationKey(const QString & destKey);
paul
timecodes added to the spw plugin
r38 void SetSourceAddress(const QString & address);
void SetDestinationAddress(const QString & address);
Jeandet Alexis
Started GR-ESB driver.
r22 void SetRmapTimeout(const QString & timeout);
paul
timecodes added to the spw plugin
r38 void SetTimecodeFrequency( double );
paul
Functions added to the Python API:...
r35 void SetBrickAsAnInterface( bool );
void SetBrickAsARouter( bool );
int GetAvailableBrickCount( void );
paul
Functions added to the plugin to get the number of CCSDS packets...
r40 unsigned int GetNbPacketsTransmittedToSpw( void );
unsigned int GetNbCCSDSPacketsTransmittedToSpw( void );
paul
Functions added to the Python API:...
r35 void BytesReceivedFromSpw( unsigned int );
void BytesTransmittedToSpw( unsigned int );
paul
Functions added to the plugin to get the number of CCSDS packets...
r40 void CCSDSPacketTransmittedToSpw( void );
paul
timecodes added to the spw plugin
r38 void StartSendingTimecodes( bool );
paul
Functions added to the plugin to get the number of CCSDS packets...
r40 int GetLinkNumber();
Jeandet Alexis
Started GR-ESB driver.
r22
public slots:
void toggleBridgeConnection();
bool connectBridge();
bool disconnectBridge();
int pushRMAPPacket(char* packet,int size);
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);
void brickSelectionChanged(int brickIndex);
void linkNumberSelectionChanged(int linkIndex);
void linkSpeedSelectionChanged(const QString & linkSpeed);
paul
Functions added to the Python API:...
r35 void sourceLogicalAddressChanged(const QString & destKey);
paul
timecodes added to the spw plugin
r38 void destinationAddressChanged(const QString & rmapaddress);
paul
Functions added to the Python API:...
r35 void brickModeChanged( bool interfaceMode );
void destinationKeyChanged(const QString & key);
Jeandet Alexis
Started GR-ESB driver.
r22 void rmapTimeoutChanged(const QString & timeout);
paul
Functions added to the Python API:...
r35 void sendPacketComingFromTCPServer(char *packet, int size);
paul
timecodes added to the spw plugin
r38 void timecodeFrequencyChanged(const QString &frequency);
void startSendingTimecodes( bool onOff );
Jeandet Alexis
Started GR-ESB driver.
r22 private:
void makeGUI(socexplorerplugin *parent);
stardundeeSPW_USB_Manager* manager;
};
#endif // STARDUNDEESPW_USB_H