OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [gui_plugin/] [ControlWidget/] [ConsoleWidget.cpp] - Diff between revs 2 and 3

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 3
Line 29... Line 29...
    fontRISCV_ = fontMainText_;
    fontRISCV_ = fontMainText_;
    fontRISCV_.setBold(true);
    fontRISCV_.setBold(true);
 
 
    ensureCursorVisible();
    ensureCursorVisible();
 
 
 
 
    QTextCursor cursor = textCursor();
    QTextCursor cursor = textCursor();
    QTextCharFormat charFormat = cursor.charFormat();
    QTextCharFormat charFormat = cursor.charFormat();
    charFormat.setFont(fontRISCV_);
    charFormat.setFont(fontRISCV_);
    cursor.setCharFormat(charFormat);
    cursor.setCharFormat(charFormat);
 
 
 
    cursor.insertText(tr(
 
    "**********************************************************\n"
 
    "  RISC-V debugger\n"
 
    "  Author: Sergey Khabarov - sergeykhbr@gmail.com\n"
 
    "  Copyright 2017 GNSS Sensor Ltd. All right reserved.\n"
 
    "**********************************************************\n"));
 
 
    cursor.insertText(tr(CONSOLE_ENTRY));
    cursor.insertText(tr(CONSOLE_ENTRY));
    cursorMinPos_ = cursor.selectionStart();
    cursorMinPos_ = cursor.selectionStart();
 
 
    charFormat.setFont(fontMainText_);
    charFormat.setFont(fontMainText_);
    cursor.setCharFormat(charFormat);
    cursor.setCharFormat(charFormat);
Line 47... Line 54...
    cursorPos_.make_list(2);
    cursorPos_.make_list(2);
    cursorPos_[0u].make_int64(0);
    cursorPos_[0u].make_int64(0);
    cursorPos_[1].make_int64(0);
    cursorPos_[1].make_int64(0);
 
 
    connect(this, SIGNAL(signalNewData()), this, SLOT(slotUpdateByData()));
    connect(this, SIGNAL(signalNewData()), this, SLOT(slotUpdateByData()));
 
 
 
    const char *autoobj = (*igui_->getpConfig())["AutoComplete"].to_string();
 
    iauto_ = static_cast<IAutoComplete *>(
 
        RISCV_get_service_iface(autoobj, IFACE_AUTO_COMPLETE));
 
 
 
    RISCV_add_default_output(static_cast<IRawListener *>(this));
}
}
 
 
ConsoleWidget::~ConsoleWidget() {
ConsoleWidget::~ConsoleWidget() {
    igui_->removeFromQueue(static_cast<IGuiCmdHandler *>(this));
    igui_->removeFromQueue(static_cast<IGuiCmdHandler *>(this));
    RISCV_remove_default_output(static_cast<IRawListener *>(this));
    RISCV_remove_default_output(static_cast<IRawListener *>(this));
Line 104... Line 117...
 
 
    igui_->registerCommand(
    igui_->registerCommand(
        static_cast<IGuiCmdHandler *>(this), &cmd, false);
        static_cast<IGuiCmdHandler *>(this), &cmd, false);
}
}
 
 
void ConsoleWidget::slotPostInit(AttributeType *cfg) {
 
    const char *autoobj = (*cfg)["AutoComplete"].to_string();
 
    iauto_ = static_cast<IAutoComplete *>(
 
        RISCV_get_service_iface(autoobj, IFACE_AUTO_COMPLETE));
 
 
 
    RISCV_add_default_output(static_cast<IRawListener *>(this));
 
}
 
 
 
void ConsoleWidget::slotUpdateByData() {
void ConsoleWidget::slotUpdateByData() {
    if (strOutput_.size() == 0) {
    if (strOutput_.size() == 0) {
        return;
        return;
    }
    }
    // Keep current line value:
    // Keep current line value:

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.