- Textual simulation is now brought up only if requested
by the -N switch given at the cmdline git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@754 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
3612d20ae0
commit
db34232e72
|
@ -4,12 +4,12 @@
|
||||||
<glade-interface>
|
<glade-interface>
|
||||||
|
|
||||||
<widget class="GtkWindow" id="MainWindow">
|
<widget class="GtkWindow" id="MainWindow">
|
||||||
<property name="width_request">300</property>
|
|
||||||
<property name="height_request">200</property>
|
|
||||||
<property name="title" translatable="yes"></property>
|
<property name="title" translatable="yes"></property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||||
<property name="modal">False</property>
|
<property name="modal">False</property>
|
||||||
|
<property name="default_width">800</property>
|
||||||
|
<property name="default_height">600</property>
|
||||||
<property name="resizable">True</property>
|
<property name="resizable">True</property>
|
||||||
<property name="destroy_with_parent">False</property>
|
<property name="destroy_with_parent">False</property>
|
||||||
<property name="decorated">True</property>
|
<property name="decorated">True</property>
|
||||||
|
@ -18,6 +18,7 @@
|
||||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
||||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||||
<property name="focus_on_map">True</property>
|
<property name="focus_on_map">True</property>
|
||||||
|
<property name="urgency_hint">False</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkVBox" id="MainBox">
|
<widget class="GtkVBox" id="MainBox">
|
||||||
|
@ -28,6 +29,8 @@
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenuBar" id="MenuBar">
|
<widget class="GtkMenuBar" id="MenuBar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
|
||||||
|
<property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenuItem" id="MenuItem.File">
|
<widget class="GtkMenuItem" id="MenuItem.File">
|
||||||
|
@ -282,133 +285,140 @@
|
||||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkVBox" id="ExpandersBox">
|
<widget class="GtkViewport" id="ExpandersViewport">
|
||||||
<property name="border_width">3</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||||
<property name="spacing">0</property>
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkExpander" id="SchedulablesExpander">
|
<widget class="GtkVBox" id="ExpandersBox">
|
||||||
|
<property name="border_width">3</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="homogeneous">False</property>
|
||||||
<property name="expanded">True</property>
|
|
||||||
<property name="spacing">0</property>
|
<property name="spacing">0</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<widget class="GtkExpander" id="SchedulablesExpander">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="expanded">True</property>
|
||||||
|
<property name="spacing">0</property>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="SchedulablesExpander.Label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Schedulables</property>
|
||||||
|
<property name="use_underline">False</property>
|
||||||
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0.5</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">0</property>
|
||||||
|
<property name="ypad">0</property>
|
||||||
|
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||||
|
<property name="width_chars">-1</property>
|
||||||
|
<property name="single_line_mode">False</property>
|
||||||
|
<property name="angle">0</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="type">label_item</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="padding">0</property>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="SchedulablesExpander.Label">
|
<widget class="GtkExpander" id="ResourcesExpander">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">Schedulables</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="expanded">True</property>
|
||||||
<property name="use_markup">False</property>
|
<property name="spacing">0</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
|
||||||
<property name="wrap">False</property>
|
<child>
|
||||||
<property name="selectable">False</property>
|
<placeholder/>
|
||||||
<property name="xalign">0.5</property>
|
</child>
|
||||||
<property name="yalign">0.5</property>
|
|
||||||
<property name="xpad">0</property>
|
<child>
|
||||||
<property name="ypad">0</property>
|
<widget class="GtkLabel" id="ResourcesExpander.Label">
|
||||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
<property name="visible">True</property>
|
||||||
<property name="width_chars">-1</property>
|
<property name="label" translatable="yes">Resources</property>
|
||||||
<property name="single_line_mode">False</property>
|
<property name="use_underline">False</property>
|
||||||
<property name="angle">0</property>
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0.5</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">0</property>
|
||||||
|
<property name="ypad">0</property>
|
||||||
|
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||||
|
<property name="width_chars">-1</property>
|
||||||
|
<property name="single_line_mode">False</property>
|
||||||
|
<property name="angle">0</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="type">label_item</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="type">label_item</property>
|
<property name="padding">0</property>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkExpander" id="RequestsExpander">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="expanded">False</property>
|
||||||
|
<property name="spacing">0</property>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="RequestsExpander.Label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Requests</property>
|
||||||
|
<property name="use_underline">False</property>
|
||||||
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0.5</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">0</property>
|
||||||
|
<property name="ypad">0</property>
|
||||||
|
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||||
|
<property name="width_chars">-1</property>
|
||||||
|
<property name="single_line_mode">False</property>
|
||||||
|
<property name="angle">0</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="type">label_item</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="padding">0</property>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkExpander" id="ResourcesExpander">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="expanded">True</property>
|
|
||||||
<property name="spacing">0</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="ResourcesExpander.Label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">Resources</property>
|
|
||||||
<property name="use_underline">False</property>
|
|
||||||
<property name="use_markup">False</property>
|
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
|
||||||
<property name="wrap">False</property>
|
|
||||||
<property name="selectable">False</property>
|
|
||||||
<property name="xalign">0.5</property>
|
|
||||||
<property name="yalign">0.5</property>
|
|
||||||
<property name="xpad">0</property>
|
|
||||||
<property name="ypad">0</property>
|
|
||||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
|
||||||
<property name="width_chars">-1</property>
|
|
||||||
<property name="single_line_mode">False</property>
|
|
||||||
<property name="angle">0</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="type">label_item</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkExpander" id="RequestsExpander">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="expanded">True</property>
|
|
||||||
<property name="spacing">0</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="RequestsExpander.Label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">Requests</property>
|
|
||||||
<property name="use_underline">False</property>
|
|
||||||
<property name="use_markup">False</property>
|
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
|
||||||
<property name="wrap">False</property>
|
|
||||||
<property name="selectable">False</property>
|
|
||||||
<property name="xalign">0.5</property>
|
|
||||||
<property name="yalign">0.5</property>
|
|
||||||
<property name="xpad">0</property>
|
|
||||||
<property name="ypad">0</property>
|
|
||||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
|
||||||
<property name="width_chars">-1</property>
|
|
||||||
<property name="single_line_mode">False</property>
|
|
||||||
<property name="angle">0</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="type">label_item</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
@ -463,9 +473,11 @@
|
||||||
|
|
||||||
<widget class="GtkAboutDialog" id="AboutDialog">
|
<widget class="GtkAboutDialog" id="AboutDialog">
|
||||||
<property name="destroy_with_parent">False</property>
|
<property name="destroy_with_parent">False</property>
|
||||||
<property name="name" translatable="yes">Application Name</property>
|
<property name="name" translatable="yes">SGPEMv2</property>
|
||||||
<property name="copyright">University of Padova, dept. of Pure and Applied Mathematics</property>
|
<property name="copyright">University of Padova, dept. of Pure and Applied Mathematics</property>
|
||||||
|
<property name="comments" translatable="yes">An educational simulator for process scheduling policies in a monoprocessor computer.</property>
|
||||||
<property name="license">SGPEMv2 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the terms of the GNU General Public License; for details see file COPYING contained in the source package.</property>
|
<property name="license">SGPEMv2 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the terms of the GNU General Public License; for details see file COPYING contained in the source package.</property>
|
||||||
|
<property name="wrap_license">False</property>
|
||||||
<property name="authors">Giovanni Giacobbi <ggiacobb@studenti.math.unipd.it>
|
<property name="authors">Giovanni Giacobbi <ggiacobb@studenti.math.unipd.it>
|
||||||
Filippo Paparella <ironpipp@gmail.com>
|
Filippo Paparella <ironpipp@gmail.com>
|
||||||
Paolo Santi <psanti@studenti.math.unipd.it>
|
Paolo Santi <psanti@studenti.math.unipd.it>
|
||||||
|
|
15
src/main.cc
15
src/main.cc
|
@ -24,8 +24,6 @@
|
||||||
#include "main.hh"
|
#include "main.hh"
|
||||||
|
|
||||||
#include "parse_opts.hh"
|
#include "parse_opts.hh"
|
||||||
#include "text_simulation.hh"
|
|
||||||
#include "io_manager.hh"
|
|
||||||
|
|
||||||
#include <glibmm/module.h>
|
#include <glibmm/module.h>
|
||||||
#include <glibmm/thread.h>
|
#include <glibmm/thread.h>
|
||||||
|
@ -55,17 +53,6 @@ main(int argc, char* argv[])
|
||||||
// Parses options and prepares vector with
|
// Parses options and prepares vector with
|
||||||
// filenames of documents to be opened
|
// filenames of documents to be opened
|
||||||
parse_options(argc, argv);
|
parse_options(argc, argv);
|
||||||
|
|
||||||
TextSimulation sim;
|
|
||||||
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
string str;
|
|
||||||
getline(cin, str);
|
|
||||||
|
|
||||||
TextSimulation::parse_command(sim, str);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,15 @@
|
||||||
|
|
||||||
#include "backend/global_preferences.hh"
|
#include "backend/global_preferences.hh"
|
||||||
#include "backend/plugin_manager.hh"
|
#include "backend/plugin_manager.hh"
|
||||||
|
#include "text_simulation.hh"
|
||||||
|
#include "io_manager.hh"
|
||||||
#include "gui_builder.hh"
|
#include "gui_builder.hh"
|
||||||
#include "parse_opts.hh"
|
#include "parse_opts.hh"
|
||||||
|
|
||||||
#include <glibmm/optioncontext.h>
|
#include <glibmm/optioncontext.h>
|
||||||
#include <gtkmm/main.h>
|
#include <gtkmm/main.h>
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace sgpem;
|
using namespace sgpem;
|
||||||
|
@ -49,7 +51,7 @@ parse_options(int argc, char** argv)
|
||||||
OptionEntry no_gui;
|
OptionEntry no_gui;
|
||||||
OptionEntry policies_dir;
|
OptionEntry policies_dir;
|
||||||
OptionEntry modules_dir;
|
OptionEntry modules_dir;
|
||||||
OptionEntry filename;
|
OptionEntry filename;
|
||||||
|
|
||||||
no_gui.set_short_name('N');
|
no_gui.set_short_name('N');
|
||||||
policies_dir.set_short_name('P');
|
policies_dir.set_short_name('P');
|
||||||
|
@ -114,10 +116,16 @@ parse_options(int argc, char** argv)
|
||||||
{
|
{
|
||||||
// We don't return to main, instead we
|
// We don't return to main, instead we
|
||||||
// initialize the command line version
|
// initialize the command line version
|
||||||
// of sgpemv2 (?)
|
// of sgpemv2
|
||||||
throw Glib::OptionError(Glib::OptionError::FAILED, _("The `No-GUI' option isn't active yet."));
|
TextSimulation sim;
|
||||||
|
|
||||||
// FIXME : to be written!
|
while(1)
|
||||||
|
{
|
||||||
|
std::string str;
|
||||||
|
getline(std::cin, str);
|
||||||
|
|
||||||
|
TextSimulation::parse_command(sim, str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -126,7 +134,8 @@ parse_options(int argc, char** argv)
|
||||||
gui->open_file(*fnames.begin());
|
gui->open_file(*fnames.begin());
|
||||||
main_loop.run(gui->get_initial_window());
|
main_loop.run(gui->get_initial_window());
|
||||||
delete gui;
|
delete gui;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ~ try
|
} // ~ try
|
||||||
catch(Glib::OptionError e)
|
catch(Glib::OptionError e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue