OctaveWindow::OctaveWindow(QDockWidget *parent_): QWidget(parent_, 0)
{
  QFont font;
  font = QFont("Courier New");
  font.setPointSize(QucsSettings.font.pointSize()-1);
  font.setStyleHint(QFont::Courier);
  font.setFixedPitch(true);
  setFont(font);

  vBox = new Q3VBoxLayout(this);

  output = new Q3TextEdit(this);
  output->setReadOnly(true);
  output->setUndoRedoEnabled(false);
  output->setTextFormat(Qt::LogText);
  output->setMaxLogLines(2000);
  output->setWordWrap(Q3TextEdit::NoWrap);
  output->setPaletteBackgroundColor(QucsSettings.BGColor);
  vBox->addWidget(output, 10);

  input = new QLineEdit(this);
  connect(input, SIGNAL(returnPressed()), SLOT(slotSendCommand()));
  vBox->addWidget(input);

  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  parent_->setWidget(this);
  //parent_->setResizeEnabled(true);
  //parent_->setHorizontallyStretchable(true);

  histIterator = cmdHistory.end();
}
Exemple #2
0
RPiServer::RPiServer(QObject *parent) :
    QObject(parent)
{
    m_cfg = Utilities::getConfig ("config.mts");
    qDebug() << m_cfg[IMAGE_INTERVAL].toString ();

    m_server = new TCPServer ();
    m_ip = new ImageProcessor ();
    m_cmdTimer = new QTimer ();
    m_dataPro = new DataProtocol ();
    m_client = new TCPClient (m_cfg[CLIENT_IP].toString ());
    m_cp = new CommandParser ();

    connect(m_server, SIGNAL(sigGotData(QByteArray)), this, SLOT(slotGotData(QByteArray)));
    connect(m_cmdTimer, SIGNAL(timeout()), this, SLOT(slotSendCommand ()));
    //
    // Slots to respond to Command Parser signals
    //
    connect(m_cp, SIGNAL(sigRecvImage()), this, SLOT(slotRecvImage ()));
    connect(m_cp, SIGNAL(sigSendTime()), this, SLOT(slotSendTime ()));
    connect(m_cp, SIGNAL(sigCRCMismatch()), this, SLOT(slotRequestResend ()));
    connect(m_cp, SIGNAL(sigResend()), this, SLOT(slotResend ()));
    connect(m_cp, SIGNAL(sigRecvConfig()), this, SLOT(slotRecvConfg ()));

    qDebug() << "Starting timer...";
    m_cmdTimer->start (10000);
}
Exemple #3
0
OctaveWindow::OctaveWindow(QDockWidget *parent_): QWidget()
{
  QFont font;
  font = QFont("Courier New");
  font.setPointSize(SwieeSettings.font.pointSize()-1);
  font.setStyleHint(QFont::Courier);
  font.setFixedPitch(true);
  setFont(font);

  QWidget *all = new QWidget();
  QVBoxLayout *allLayout = new QVBoxLayout();

  output = new QTextEdit(this);
  output->setReadOnly(true);
  output->setUndoRedoEnabled(false);
  output->setTextFormat(Qt::LogText);
  output->setLineWrapMode(QTextEdit::NoWrap);
  output->setPaletteBackgroundColor(SwieeSettings.BGColor);
  allLayout->addWidget(output);

  input = new QLineEdit(this);
  connect(input, SIGNAL(returnPressed()), SLOT(slotSendCommand()));
  allLayout->addWidget(input);
  all->setLayout(allLayout);

  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  parent_->setWidget(all);

  //parent_->setResizeEnabled(true);
  //parent_->setHorizontallyStretchable(true);
  histPosition = 0;

  input->installEventFilter(this);
}