##// END OF EJS Templates
Removed crash on spwplugin while closing the manager thread didn't quit correctly.
Removed crash on spwplugin while closing the manager thread didn't quit correctly.

File last commit:

r82:f085b545eb20 socexplorer-plugins-0.7-2 default
r82:f085b545eb20 socexplorer-plugins-0.7-2 default
Show More
spwplugin.cpp
187 lines | 7.9 KiB | text/x-c | CppLexer
First init /!\ outdated spwplugin!
r0 /*------------------------------------------------------------------------------
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 -- This file is a part of the SocExplorer Software
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 --
-- 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
First init /!\ outdated spwplugin!
r0 -------------------------------------------------------------------------------*/
/*-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@member.fsf.org
----------------------------------------------------------------------------*/
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8
First init /!\ outdated spwplugin!
r0 #include "spwplugin.h"
#include "stardundeespw_usb.h"
Jeandet Alexis
Started GR-ESB driver.
r22 #include "gr_esb_bridge.h"
Jeandet Alexis
Sync
r7 #include <socexplorerproxy.h>
Added wrapper to use StarDundee driver as a plugin, since they don't respect...
r63 #include "fakestardundeespwusb_lib.h"
Jeandet Alexis
Sync
r18
Jeandet Alexis
Some work on GRESB driver for spwplugin.
r25
Added stop function to dsu3plugin...
r14 spwplugin::spwplugin(QWidget *parent):socexplorerplugin(parent,false)
First init /!\ outdated spwplugin!
r0 {
Q_UNUSED(parent)
Added wrapper to use StarDundee driver as a plugin, since they don't respect...
r63 FakeStarDundeeSpwUSB_Lib::resolve();
Alexis Jeandet
Removed crash on spwplugin while closing the manager thread didn't quit correctly.
r82 this->bridge = Q_NULLPTR;
Jeandet Alexis
Sync
r7 this->scanDone = false;
Removed deprecated genericPySysdriver interface.
r52 // this->pyObject = new spwPyWrapper(this);
Jeandet Alexis
Sync
r18 this->tcpServer = new SpwTcpPacketServer(this);
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 this->mainGroupBox = new QGroupBox("SpaceWire Plugin Configuration",this);
this->bridgeSelector = new QComboBox(this);
Jeandet Alexis
Sync
r18 this->mainTabWidgt = new QTabWidget(this);
Sync
r19 this->mainTabWidgt->addTab(this->mainGroupBox,"Bridge Configuration");
this->mainTabWidgt->addTab(this->tcpServer,"TCP Server");
Jeandet Alexis
Now RMAP write uses Transaction ID and waits for ack.
r16 this->mainLayout = new QGridLayout(this->mainGroupBox);
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 this->mainLayout->addWidget(new QLabel("Select SpaceWire bridge",this),0,0,1,1,Qt::AlignCenter);
this->mainLayout->addWidget(this->bridgeSelector,0,1,1,1);
Sync
r19 this->setWidget(this->mainTabWidgt);
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 this->bridgeSelector->addItem("none");
this->bridgeSelector->addItem("STAR-Dundee Spw USB Brick");
Jeandet Alexis
Started GR-ESB driver.
r22 this->bridgeSelector->addItem("GR-ESB");
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 connect(this->bridgeSelector,SIGNAL(currentIndexChanged(QString)),this,SLOT(bridgeSelectionChanged(QString)));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(selectBridge(QString)),this,SLOT(selectBridge(QString)));
connect(this,SIGNAL(TCPServerConnect()),this->tcpServer,SLOT(connectServer()));
connect(this,SIGNAL(TCPServerDisconnect()),this->tcpServer,SLOT(disconnectServer()));
connect(this,SIGNAL(TCPServerSetPort(qint32)),this->tcpServer,SLOT(setServerPort(qint32)));
connect(this,SIGNAL(TCPServerSetIP(QString)),this->tcpServer,SLOT(setServerSetIP(QString)));
First init /!\ outdated spwplugin!
r0 }
spwplugin::~spwplugin()
{
Alexis Jeandet
Removed crash on spwplugin while closing the manager thread didn't quit correctly.
r82 if(this->bridge!=Q_NULLPTR)
delete this->bridge;
First init /!\ outdated spwplugin!
r0 }
unsigned int spwplugin::Read(unsigned int *Value,unsigned int count,unsigned int address)
{
if(Connected)
{
return bridge->Read(Value,count,address);
}
return 0;
}
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 void spwplugin::bridgeSelectionChanged(const QString &text)
{
printf("test");
if(text=="none")
{
if(this->bridge!=NULL)
{
this->mainLayout->removeWidget(this->bridge->getGUI());
SpwPlugin:...
r65 this->bridge->getGUI()->hide();
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 this->disconnect(this,SLOT(setConnected(bool)));
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 delete this->bridge;
this->bridge= NULL;
}
}
if(text=="STAR-Dundee Spw USB Brick")
{
if(this->bridge!=NULL)
{
this->mainLayout->removeWidget(this->bridge->getGUI());
SpwPlugin:...
r65 this->bridge->getGUI()->hide();
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 this->disconnect(this,SLOT(setConnected(bool)));
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 delete this->bridge;
}
this->bridge = new stardundeeSPW_USB(this);
this->mainLayout->addWidget(this->bridge->getGUI(),1,0,1,2);
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 connect(this->bridge,SIGNAL(setConnected(bool)),this,SLOT(setConnected(bool)));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(StarDundeeSelectBrick(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectBrick(int)));
connect(this,SIGNAL(StarDundeeSelectLinkNumber(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkNumber(int)));
connect(this,SIGNAL(StarDundeeSelectLinkSpeed(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkSpeed(int)));
connect(this,SIGNAL(StarDundeeSetSourceAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetSourceAddress(QString)));
connect(this,SIGNAL(StarDundeeSetDestinationAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationAddress(QString)));
connect(this,SIGNAL(StarDundeeSetDestinationKey(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationKey(QString)));
connect(this,SIGNAL(StarDundeeSetRmapTimeout(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapTimeout(QString)));
connect(this,SIGNAL(connectBridge()),((stardundeeSPW_USB*)bridge),SLOT(connectBridge()));
connect(this,SIGNAL(disconnectBridge()),((stardundeeSPW_USB*)bridge),SLOT(disconnectBridge()));
connect(this,SIGNAL(StarDundeeGetAvailableBrickCount()),
paul
Functions added to the plugin to get the number of CCSDS packets...
r40 ((stardundeeSPW_USB*)bridge),SIGNAL(GetAvailableBrickCount()));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(StarDundeeGetNbPacketsTransmittedToSpw()),
paul
Functions added to the plugin to get the number of CCSDS packets...
r40 ((stardundeeSPW_USB*)bridge),SIGNAL(GetNbPacketsTransmittedToSpw()));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(StarDundeeGetNbCCSDSPacketsTransmittedToSpw()),
paul
Functions added to the plugin to get the number of CCSDS packets...
r40 ((stardundeeSPW_USB*)bridge),SIGNAL(GetNbCCSDSPacketsTransmittedToSpw()));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(StarDundeeGetLinkNumber()),((stardundeeSPW_USB*)bridge),SIGNAL(GetLinkNumber()));
Cleaniing complete, ready for testing.
r53 connect(this,SIGNAL(StarDundeeSetBrickAsAninterface(bool)),
paul
Functions added to the Python API:...
r35 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsAnInterface(bool)));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(StarDundeeSetBrickAsARouter(bool)),
paul
Functions added to the Python API:...
r35 ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsARouter(bool)));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(StarDundeeStartTimecodes(bool)),
paul
timecodes added to the spw plugin
r38 ((stardundeeSPW_USB*)bridge),SIGNAL(StartSendingTimecodes(bool)));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(StarDundeeSetTimecodeFrequency(double)),
paul
timecodes added to the spw plugin
r38 ((stardundeeSPW_USB*)bridge),SIGNAL(SetTimecodeFrequency(double)));
Removed deprecated genericPySysdriver interface.
r52 connect(this,SIGNAL(StarDundeeSendOneTimecode(unsigned char)),
paul
python wrapper added to the API...
r46 ((stardundeeSPW_USB*)bridge),SIGNAL(SendOneTimecode(unsigned char)));
Jeandet Alexis
Started GR-ESB driver.
r22 connect(this->bridge,SIGNAL(pushPacketOverTCP(char*,int)),this->tcpServer,SLOT(pushPacket(char*,int)));
paul
Functions added to the Python API:...
r35 connect(this->tcpServer, SIGNAL(sendSPWPacket(char*,int)), ((stardundeeSPW_USB*)bridge), SLOT(sendPacketComingFromTCPServer(char*,int)));
Jeandet Alexis
Started GR-ESB driver.
r22 }
if(text=="GR-ESB")
{
if(this->bridge!=NULL)
{
this->mainLayout->removeWidget(this->bridge->getGUI());
SpwPlugin:...
r65 this->bridge->getGUI()->hide();
Jeandet Alexis
Started GR-ESB driver.
r22 this->disconnect(this,SLOT(setConnected(bool)));
delete this->bridge;
}
this->bridge = new GR_ESB_bridge(this);
this->mainLayout->addWidget(this->bridge->getGUI(),1,0,1,2);
connect(this->bridge,SIGNAL(setConnected(bool)),this,SLOT(setConnected(bool)));
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 }
Jeandet Alexis
Sync
r20 }
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8
Jeandet Alexis
Sync
r15 void spwplugin::selectBridge(const QString &text)
{
if(text=="none")
{
this->bridgeSelector->setCurrentIndex(0);
}
if(text=="STAR-Dundee Spw USB Brick")
{
this->bridgeSelector->setCurrentIndex(1);
}
}
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 void spwplugin::setConnected(bool connected)
{
Jeandet Alexis
STAR-Dundee USB Brick driver ready for testing.
r12 this->bridgeSelector->setDisabled(connected);
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 this->Connected = connected;
emit activateSig(connected);
Added stop function to dsu3plugin...
r14 if(!this->scanDone)
{
socexplorerproxy::loadChildSysDriver(this,"AMBA_PLUGIN");
this->scanDone=true;
}
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 }
First init /!\ outdated spwplugin!
r0 unsigned int spwplugin::Write(unsigned int *Value,unsigned int count, unsigned int address)
{
if(Connected)
{
return bridge->Write(Value,count,address);
}
return 0;
}