##// END OF EJS Templates
Removed APBUartPlugin bug (when switching between debug and non debug link)....
Removed APBUartPlugin bug (when switching between debug and non debug link). Added APBUart Python wrapper.

File last commit:

r34:ccd56e93ef09 default
r34:ccd56e93ef09 default
Show More
apbuart_plugin_ui.cpp
145 lines | 5.0 KiB | text/x-c | CppLexer
Added ui file for APB_UART_PLUGIN.
r26 /*------------------------------------------------------------------------------
-- 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 2 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
----------------------------------------------------------------------------*/
#include "apbuart_plugin_ui.h"
#include "ui_apbuart_plugin_ui.h"
APB UART PLUGIN rework in progress;
r28 #include "apbuartterminal.h"
Removed APBUartPlugin bug (when switching between debug and non debug link)....
r34 #include <QComboBox>
Added ui file for APB_UART_PLUGIN.
r26
APBUART_Plugin_ui::APBUART_Plugin_ui(QWidget *parent) :
QWidget(parent),
ui(new Ui::APBUART_Plugin_ui)
{
ui->setupUi(this);
connect(this->ui->FIFODebugChkBx,SIGNAL(stateChanged(int)),this,SIGNAL(loopbackChkBxStateChanged(int)));
Jeandet Alexis
APBUART Working, need some cosmetic now.
r29 connect(this,SIGNAL(apbUartTextReceived(QString)),this->ui->UART_TERM,SLOT(apbUartTextReceived(QString)));
APB UART PLUGIN rework in progress;
r28 connect(this->ui->ConnectQpb,SIGNAL(clicked()),this,SIGNAL(connectPort()));
connect(this->ui->UART_TERM,SIGNAL(sendChar(char)),this,SIGNAL(sendChar(char)));
connect(this->ui->PortNameLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(PortNameChanged(QString)));
connect(this->ui->UartSpeedLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(UartSpeedChanged(QString)));
Improved APB UART Plugin, now check how many bytes are available on uart...
r32 connect(this->ui->rescanQpb,SIGNAL(clicked()),this,SLOT(updatePortList()));
Removed APBUartPlugin bug (when switching between debug and non debug link)....
r34 connect(this->ui->APBUartsUpdateQpb,SIGNAL(clicked()),this,SIGNAL(updateAPBUartsList()));
connect(this->ui->UARTSelector,SIGNAL(currentIndexChanged(int)),this,SIGNAL(curentAPBUartChanged(int)));
Improved APB UART Plugin, now check how many bytes are available on uart...
r32 this->portListcompleter = NULL;
this->updatePortList();
Added ui file for APB_UART_PLUGIN.
r26 }
APBUART_Plugin_ui::~APBUART_Plugin_ui()
{
delete ui;
}
Removed APBUartPlugin bug (when switching between debug and non debug link)....
r34 int APBUART_Plugin_ui::curentAPBUart()
{
return this->ui->UARTSelector->currentIndex();
}
Added ui file for APB_UART_PLUGIN.
r26 void APBUART_Plugin_ui::setEnableForLoopBack(bool enable)
{
this->ui->PortNameLineEdit->setEnabled(enable);
this->ui->ConnectQpb->setEnabled(enable);
this->ui->UartSpeedLineEdit->setEnabled(enable);
Removed APBUartPlugin bug (when switching between debug and non debug link)....
r34 this->ui->APBUartsUpdateQpb->setEnabled(enable);
this->ui->rescanQpb->setEnabled(enable);
this->ui->UARTSelector->setEnabled(enable);
if(this->ui->FIFODebugChkBx->isChecked()==enable)
this->ui->FIFODebugChkBx->toggle();
Added ui file for APB_UART_PLUGIN.
r26 }
APB UART PLUGIN rework in progress;
r28
void APBUART_Plugin_ui::setUartConnected(bool enable)
{
this->ui->PortNameLineEdit->setDisabled(enable);
this->ui->UartSpeedLineEdit->setDisabled(enable);
this->ui->FIFODebugChkBx->setDisabled(enable);
Removed APBUartPlugin bug (when switching between debug and non debug link)....
r34 this->ui->APBUartsUpdateQpb->setDisabled(enable);
this->ui->rescanQpb->setDisabled(enable);
this->ui->UARTSelector->setDisabled(enable);
APB UART PLUGIN rework in progress;
r28 if(enable)
{
this->ui->ConnectQpb->setText("Close Port");
}
else
{
this->ui->ConnectQpb->setText("Open Port");
}
}
Improved APB UART Plugin, now check how many bytes are available on uart...
r32
#include <RS232.h>
void APBUART_Plugin_ui::updatePortList()
{
if(this->portListcompleter==(QCompleter*)NULL)
{
this->portListcompleter=new QCompleter(this);
this->portListcompleter->setCaseSensitivity(Qt::CaseInsensitive);
this->portListcompleterModel = new QStringListModel(this);
this->portListcompleter->setModel(this->portListcompleterModel);
this->ui->PortNameLineEdit->setCompleter(this->portListcompleter);
}
rs232portslist_t* portlist = rs232getportlist();
rs232portslist_t* portlistenum = portlist;
QStringList wordList;
while(portlistenum!=NULL)
{
wordList << portlistenum->name;
portlistenum = portlistenum->next;
}
rs232deleteportlist(portlist);
this->portListcompleterModel->setStringList(wordList);
}
Removed APBUartPlugin bug (when switching between debug and non debug link)....
r34 void APBUART_Plugin_ui::updateAPBUartList(QList<unsigned int> addresses)
{
this->ui->UARTSelector->clear();
for(int i=0;i<addresses.count();i++)
{
this->ui->UARTSelector->addItem(QString("APBUart %1 @0x%2").arg(i).arg(addresses.at(i),8,16));
}
if(addresses.count()==0)
this->ui->UARTSelector->addItem("None");
}
void APBUART_Plugin_ui::setUartSpeed(int speed)
{
this->ui->UartSpeedLineEdit->setText(QString::number(speed));
}
void APBUART_Plugin_ui::setUartPortName(QString name)
{
this->ui->PortNameLineEdit->setText(name);
}
void APBUART_Plugin_ui::setAPBUartIndex(int index)
{
if((index<this->ui->UARTSelector->count()) && (index>0) )
this->ui->UARTSelector->setCurrentIndex(index);
}
Improved APB UART Plugin, now check how many bytes are available on uart...
r32
Removed APBUartPlugin bug (when switching between debug and non debug link)....
r34