##// END OF EJS Templates
Étiquette socexplorer-plugins-0.7-7 enlevée
Étiquette socexplorer-plugins-0.7-7 enlevée

File last commit:

r66:a69da3403983 default
r101:10745beb94ab default
Show More
ahbuartplugin.h
101 lines | 3.2 KiB | text/x-c | CLexer
First init /!\ outdated spwplugin!
r0 /*------------------------------------------------------------------------------
Jeandet Alexis
updated plugin headers and win32/Apbuart fix tentative.
r4 -- This file is a part of the SocExplorer Software
Jeandet Alexis
Added disconnection auto-detection to the spacewire plugin.
r11 -- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
First init /!\ outdated spwplugin!
r0 --
-- 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@lpp.polytechnique.fr
----------------------------------------------------------------------------*/
#ifndef AHBUARTPLUGIN_H
#define AHBUARTPLUGIN_H
#include <QMenuBar>
#include <QMenu>
#include <QAction>
#include <QLayout>
#include <QMutex>
#include <QProgressDialog>
#include <QStringListModel>
#include <QTime>
#include <socexplorerplugin.h>
#include "ahbuartpluginui.h"
Jeandet Alexis
Removed lppserial from ahbuart now uses the one provided by socexplorercommon.
r27 #include <RS232.h>
Improved AHB UART Plugin, now check how many bytes are available on uart...
r33 #include <unistd.h>
First init /!\ outdated spwplugin!
r0
#define SAFEWRITE(data,count,timer,timeout,error) \
Improved AHB UART Plugin, now check how many bytes are available on uart...
r33 while(1)\
First init /!\ outdated spwplugin!
r0 {\
unsigned int __writen__=0; \
(timer).restart(); \
while(__writen__!=(count)) \
Improved AHB UART Plugin, now check how many bytes are available on uart...
r33 {\
__writen__ += rs232write(this->port,((data)+__writen__),((count)-__writen__)); \
if((timer).elapsed()>(timeout)) \
{\
this->port = (rs232port_t)NULL; \
this->Connected = false; \
emit this->activateSig(false); \
error; \
} \
First init /!\ outdated spwplugin!
r0 } \
break;\
Improved AHB UART Plugin, now check how many bytes are available on uart...
r33 }
First init /!\ outdated spwplugin!
r0
class ahbuartplugin : public socexplorerplugin
{
Q_OBJECT
public:
ahbuartplugin(QWidget *parent = 0);
~ahbuartplugin();
int registermenu(QMainWindow *menuHolder);
int VID(){return driver_VID;}
int PID(){return driver_PID;}
public slots:
void togglePort(QString PortName,int baudrate);
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 closeMe();
void close();
bool open(QString PortName,int baudrate);
void updatePortList();
QVariantList ReadBytes(unsigned int address,unsigned int count);
void WriteBytes(unsigned int address,QList<QVariant> dataList);
Removed deprecated genericPySysdriver interface.
r52 int detectSpeed();
void postInstantiationTrigger();
First init /!\ outdated spwplugin!
r0 signals:
void setProgressValue(int progress);
Added new MemChecker plugin....
r31 void addWritenBytes(int count);
void addReadBytes(int count);
First init /!\ outdated spwplugin!
r0 private:
bool scanDone;
QProgressDialog* progress;
QLayout * mainLayout;
ahbUartPluginUI* UI;
QMutex* portMutex;
rs232port_t port;
QCompleter *portListcompleter;
QStringListModel *portListcompleterModel;
void connectPort(QString PortName,int baudrate);
bool checkConnection();
};
#endif // AHBUARTPLUGIN_H