##// END OF EJS Templates
Étiquette STAR-Dundee USB brick ready for testing ajoutée à la révision 2be2e1f2c5d6
Étiquette STAR-Dundee USB brick ready for testing ajoutée à la révision 2be2e1f2c5d6

File last commit:

r12:2be2e1f2c5d6 STAR-Dundee USB brick ready for testing default
r13:c8a3067321d8 default
Show More
spwplugin.cpp
113 lines | 3.4 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
Sync
r7 #include <socexplorerproxy.h>
First init /!\ outdated spwplugin!
r0
spwplugin::spwplugin(QWidget *parent):socexplorerplugin(parent,true)
{
Q_UNUSED(parent)
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 this->bridge = NULL;
Jeandet Alexis
Sync
r7 this->scanDone = false;
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 this->mainGroupBox = new QGroupBox("SpaceWire Plugin Configuration",this);
this->bridgeSelector = new QComboBox(this);
this->mainLayout = new QGridLayout(this);
this->mainLayout->addWidget(new QLabel("Select SpaceWire bridge",this),0,0,1,1,Qt::AlignCenter);
this->mainLayout->addWidget(this->bridgeSelector,0,1,1,1);
this->mainGroupBox->setLayout(this->mainLayout);
this->setWidget(this->mainGroupBox);
this->bridgeSelector->addItem("none");
this->bridgeSelector->addItem("STAR-Dundee Spw USB Brick");
connect(this->bridgeSelector,SIGNAL(currentIndexChanged(QString)),this,SLOT(bridgeSelectionChanged(QString)));
First init /!\ outdated spwplugin!
r0 }
spwplugin::~spwplugin()
{
}
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());
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());
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)));
Jeandet Alexis
Space wire plugin GUI Work In Progress.
r8 }
}
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);
}
Jeandet Alexis
Sync
r7
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;
}