Stefan Schuermans
implement receiving packets
Stefan Schuermans commited 5c70d9d at 2017-06-11 15:48:14
main_window.cpp
/*
* EtherPix simulator
*
* Copyright 2017 Stefan Schuermans <stefan schuermans info>
*
* 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, version 3 of the License.
*
*
* 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 Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtkmm.h>
#include "config.h"
#include "draw.h"
#include "main_window.h"
#define TIMER_MS (40)
/**
* @brief constructor
* @param[in] Gtk Window object (a C object)
* @param[in] builder reference to GTK builder object
*/
MainWindow::MainWindow(BaseObjectType *cobject,
const Glib::RefPtr<Gtk::Builder> &builder):
Gtk::Window(cobject),
m_builder(builder),
m_config(NULL),
m_packets(0),
m_time_ms(0)
{
// get widgets
builder->get_widget_derived("Draw", m_draw);
builder->get_widget("Status", m_status);
// connect callbacks
signal_hide().connect(sigc::mem_fun(*this, &MainWindow::on_hide));
// start timer
sigc::slot<bool> timer_slot = sigc::bind(
sigc::mem_fun(*this, &MainWindow::on_timer), 0);
m_timer = Glib::signal_timeout().connect(timer_slot, TIMER_MS);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX