]> sigrok.org Git - pulseview.git/commitdiff
Made naming scheme consistent
authorJoel Holdsworth <redacted>
Mon, 2 Jul 2012 20:29:56 +0000 (21:29 +0100)
committerJoel Holdsworth <redacted>
Mon, 3 Sep 2012 12:59:06 +0000 (13:59 +0100)
mainwindow.cpp
mainwindow.h
sigsession.cpp
sigsession.h
sigview.cpp
sigview.h

index 50847e2ac1268108b48ee1a0945c28966a39fcda..510e552af9b1e751e6b44f4d04dc33363e9c627f 100644 (file)
@@ -43,30 +43,30 @@ extern "C" {
 
 MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
-       ui(new Ui::MainWindow)
+       _ui(new Ui::MainWindow)
 {
-       ui->setupUi(this);
+       _ui->setupUi(this);
 
        _sampling_bar = new SamplingBar(this);
        connect(_sampling_bar, SIGNAL(run_stop()), this,
                SLOT(run_stop()));
        addToolBar(_sampling_bar);
 
-       view = new SigView(session, this);
-       ui->verticalLayout->addWidget(view);
+       _view = new SigView(_session, this);
+       _ui->verticalLayout->addWidget(_view);
 }
 
 MainWindow::~MainWindow()
 {
-       delete ui;
+       delete _ui;
 }
 
 void MainWindow::on_actionOpen_triggered()
 {
-       QString fileName = QFileDialog::getOpenFileName(
+       QString file_name = QFileDialog::getOpenFileName(
                this, tr("Open File"), "",
                tr("Sigrok Sessions (*.sr)"));
-       session.loadFile(fileName.toStdString());
+       _session.load_file(file_name.toStdString());
 }
 
 void MainWindow::on_actionAbout_triggered()
@@ -77,7 +77,7 @@ void MainWindow::on_actionAbout_triggered()
 
 void MainWindow::run_stop()
 {
-       session.start_capture(
+       _session.start_capture(
                _sampling_bar->get_selected_device(),
                _sampling_bar->get_sample_rate());
 }
index 6ae608ccb822fe32ef1d0752306cccf71b3defdd..da103c16ccd6fb4d13dbe5af5e18d13085c5195f 100644 (file)
@@ -41,12 +41,12 @@ public:
        ~MainWindow();
 
 private:
-       Ui::MainWindow *ui;
+       Ui::MainWindow *_ui;
 
        SamplingBar *_sampling_bar;
 
-       SigSession session;
-       SigView *view;
+       SigSession _session;
+       SigView *_view;
 
 private slots:
 
index aecd21c2c3b5c5231c9407156edd24cad52acfc0..21c5624bc40790ca410002e0b5320a70ff99ae2d 100644 (file)
@@ -32,25 +32,25 @@ using namespace boost;
 using namespace std;
 
 // TODO: This should not be necessary
-SigSession* SigSession::session = NULL;
+SigSession* SigSession::_session = NULL;
 
 SigSession::SigSession()
 {
        // TODO: This should not be necessary
-       session = this;
+       _session = this;
 }
 
 SigSession::~SigSession()
 {
        // TODO: This should not be necessary
-       session = NULL;
+       _session = NULL;
 }
 
-void SigSession::loadFile(const std::string &name)
+void SigSession::load_file(const std::string &name)
 {
        if (sr_session_load(name.c_str()) == SR_OK) {
                /* sigrok session file */
-               sr_session_datafeed_callback_add(dataFeedInProc);
+               sr_session_datafeed_callback_add(data_feed_in_proc);
                sr_session_start();
                sr_session_run();
                sr_session_stop();
@@ -61,7 +61,7 @@ void SigSession::start_capture(struct sr_dev_inst *sdi,
        uint64_t sample_rate)
 {
        sr_session_new();
-       sr_session_datafeed_callback_add(dataFeedInProc);
+       sr_session_datafeed_callback_add(data_feed_in_proc);
 
        if (sr_session_dev_add(sdi) != SR_OK) {
                qDebug() << "Failed to use device.";
@@ -98,7 +98,7 @@ vector< shared_ptr<Signal> >& SigSession::get_signals()
        return _signals;
 }
 
-void SigSession::dataFeedIn(const struct sr_dev_inst *sdi,
+void SigSession::data_feed_in(const struct sr_dev_inst *sdi,
        struct sr_datafeed_packet *packet)
 {
        assert(sdi);
@@ -163,14 +163,14 @@ void SigSession::dataFeedIn(const struct sr_dev_inst *sdi,
 
        case SR_DF_END:
                _cur_logic_snapshot.reset();
-               dataUpdated();
+               data_updated();
                break;
        }
 }
 
-void SigSession::dataFeedInProc(const struct sr_dev_inst *sdi,
+void SigSession::data_feed_in_proc(const struct sr_dev_inst *sdi,
        struct sr_datafeed_packet *packet)
 {
-       assert(session);
-       session->dataFeedIn(sdi, packet);
+       assert(_session);
+       _session->data_feed_in(sdi, packet);
 }
index 851ca963ec0db1843077c8c45d6fb0080b6d14b0..24726dfe916a322098e9a6fdaab23ec9616cd8d8 100644 (file)
@@ -45,7 +45,7 @@ public:
 
        ~SigSession();
 
-       void loadFile(const std::string &name);
+       void load_file(const std::string &name);
 
        void start_capture(struct sr_dev_inst* sdi, uint64_t sample_rate);
 
@@ -53,10 +53,10 @@ public:
                get_signals();
 
 private:
-       void dataFeedIn(const struct sr_dev_inst *sdi,
+       void data_feed_in(const struct sr_dev_inst *sdi,
                struct sr_datafeed_packet *packet);
 
-       static void dataFeedInProc(const struct sr_dev_inst *sdi,
+       static void data_feed_in_proc(const struct sr_dev_inst *sdi,
                struct sr_datafeed_packet *packet);
 
 private:
@@ -65,13 +65,13 @@ private:
        boost::shared_ptr<LogicDataSnapshot> _cur_logic_snapshot;
 
 signals:
-       void dataUpdated();
+       void data_updated();
 
 private:
        // TODO: This should not be necessary. Multiple concurrent
        // sessions should should be supported and it should be
        // possible to associate a pointer with a sr_session.
-       static SigSession *session;
+       static SigSession *_session;
 };
 
 #endif // SIGSESSION_H
index 6a2b62044ddc488959dde2c64798a5554b83a105..8461af6e455f37b1182ef9b9bc1a8197ada54d09 100644 (file)
@@ -52,8 +52,8 @@ SigView::SigView(SigSession &session, QWidget *parent) :
        _scale(1e-6),
        _offset(0)
 {
-       connect(&_session, SIGNAL(dataUpdated()),
-               this, SLOT(dataUpdated()));
+       connect(&_session, SIGNAL(data_updated()),
+               this, SLOT(data_updated()));
 
        setMouseTracking(true);
        setAutoFillBackground(false);
@@ -65,7 +65,7 @@ void SigView::initializeGL()
 
 void SigView::resizeGL(int width, int height)
 {
-       setupViewport(width, height);
+       setup_viewport(width, height);
 }
 
 void SigView::paintEvent(QPaintEvent *event)
@@ -80,7 +80,7 @@ void SigView::paintEvent(QPaintEvent *event)
        glMatrixMode(GL_MODELVIEW);
        glPushMatrix();
 
-       setupViewport(width(), height());
+       setup_viewport(width(), height());
 
        qglClearColor(Qt::white);
        glClear(GL_COLOR_BUFFER_BIT);
@@ -120,12 +120,12 @@ void SigView::paintEvent(QPaintEvent *event)
        }
 
        // Paint the ruler
-       paintRuler(painter);
+       paint_ruler(painter);
 
        painter.end();
 }
 
-void SigView::dataUpdated()
+void SigView::data_updated()
 {
        update();
 }
@@ -165,7 +165,7 @@ void SigView::wheelEvent(QWheelEvent *event)
        update();
 }
 
-void SigView::setupViewport(int width, int height)
+void SigView::setup_viewport(int width, int height)
 {
        glViewport(0, 0, (GLint)width, (GLint)height);
        glMatrixMode(GL_PROJECTION);
@@ -174,7 +174,7 @@ void SigView::setupViewport(int width, int height)
        glMatrixMode(GL_MODELVIEW);
 }
 
-void SigView::paintRuler(QPainter &p)
+void SigView::paint_ruler(QPainter &p)
 {
        const double MinSpacing = 80;
 
index d66898f4c0981b8f2a933cc425402e1251570fc5..2d450df21c0822374d36aa0bdccd9cf2b24f7b6a 100644 (file)
--- a/sigview.h
+++ b/sigview.h
@@ -61,12 +61,12 @@ private:
        void wheelEvent(QWheelEvent *event);
 
 private:
-       void setupViewport(int width, int height);
+       void setup_viewport(int width, int height);
 
-       void paintRuler(QPainter &p);
+       void paint_ruler(QPainter &p);
 
 private slots:
-       void dataUpdated();
+       void data_updated();
 
 private:
        SigSession &_session;