VPTissue Reference Manual
SimShell::Gui::Controller::ProjectController Class Reference

Project controller. More...

#include <ProjectController.h>

Inheritance diagram for SimShell::Gui::Controller::ProjectController:
Inheritance graph
Collaboration diagram for SimShell::Gui::Controller::ProjectController:
Collaboration graph

Public Member Functions

 ProjectController (AppController *m)
 
QAction * GetActionClose () const
 
QMenuGetExportMenu () const
 
const std::string & GetOpenedFileName () const
 
const std::string & GetOpenedProjectName () const
 
QDockWidgetGetParametersDock () const
 
QMenuGetParametersMenu () const
 
QDockWidgetGetPreferencesDock () const
 
QMenuGetPreferencesMenu () const
 
boost::property_tree::ptree GetPTreeState () const
 
QMenuGetSimulationMenu () const
 
virtual Timings GetTimings () const
 Timings in duration units specified above.
 
QMenuGetViewersMenu () const
 
virtual bool IsOpened () const
 
bool IsRunning () const
 
 operator bool () const
 
bool Set (const std::string &project_name, const std::shared_ptr< Ws::IProject > &project)
 
void SetPTreeState (const boost::property_tree::ptree &)
 
void SetRunning (bool)
 Set simulation running.
 
- Public Member Functions inherited from SimShell::Gui::HasUnsavedChangesPrompt
 HasUnsavedChangesPrompt (std::string &&title)
 
bool PromptClose (QWidget *parent=nullptr)
 Display dialog window containing a list (or tree) of widgets that contain unsaved changes. More...
 
- Public Member Functions inherited from SimShell::Gui::HasUnsavedChanges
 HasUnsavedChanges (std::string &&title)
 
virtual ~HasUnsavedChanges ()
 Virtual destructor.
 
ChildrenType::iterator begin ()
 Get iterator to first child.
 
ChildrenType::const_iterator begin () const
 Get iterator to first child.
 
ChildrenType::iterator end ()
 Get iterator to one position after last child.
 
ChildrenType::const_iterator end () const
 Get iterator to one position after last child.
 
void ForceClose ()
 Force this object and its children to go back to unopened state so it can be safely deleted.
 
const std::string & GetTitle ()
 Get title of this object.
 
bool IsClean () const
 
bool Save ()
 Try to save this widget's (and its children's) changes. More...
 
bool SaveAndClose ()
 Try to save this object (and its children) and, if successful, close them all.
 
- Public Member Functions inherited from SimPT_Sim::ClockMan::Timeable<>
virtual ~Timeable ()
 Destructor virtual for polymorphic class.
 

Protected Member Functions

virtual void InternalForceClose ()
 
virtual bool InternalIsClean () const
 
virtual void InternalPreForceClose ()
 
virtual bool InternalSave ()
 
- Protected Member Functions inherited from SimShell::Gui::HasUnsavedChanges
void AddChild (ChildrenType::value_type &&v)
 Add child.
 
void SetChildren (ChildrenType &&c)
 Set children.
 

Additional Inherited Members

- Public Types inherited from SimShell::Gui::HasUnsavedChanges
typedef std::vector< HasUnsavedChanges * > ChildrenType
 
- Public Types inherited from SimPT_Sim::ClockMan::Timeable<>
using Timings = typename ClockTraits< std::chrono::system_clock, typename std::chrono::system_clock::duration >::CumulativeTimings
 
- Public Types inherited from SimPT_Sim::ClockMan::ClockTraits< std::chrono::system_clock, typename std::chrono::system_clock::duration >
using Clock = std::chrono::system_clock
 Type for clock.
 
using CumulativeTimings = SimPT_Sim::ClockMan::CumulativeRecords< typename std::chrono::system_clock::duration >
 Records with cumulative timing info.
 
using Duration = typename std::chrono::system_clock::duration
 Type for time duration units.
 
using IndividualTimings = SimPT_Sim::ClockMan::IndividualRecords< typename std::chrono::system_clock::duration >
 Records with individual timing info.
 
using Stopclock = SimPT_Sim::ClockMan::Stopwatch< std::chrono::system_clock >
 Stopwatch to measure time durations.
 

Detailed Description

Project controller.

Simple state machine that has 2 states: "opened" and "closed". In opened state, it keeps a pointer to a project in the workspace and becomes owner of menus, actions and viewers concerning the opened project. The "opened" state also has a sub-state machine called RunningController.

Definition at line 52 of file ProjectController.h.

Member Function Documentation

ptree SimShell::Gui::Controller::ProjectController::GetPTreeState ( ) const
virtual
See also
IHasPTreeState

Implements SimShell::Gui::IHasPTreeState.

Definition at line 90 of file ProjectController.cpp.

void SimShell::Gui::Controller::ProjectController::InternalForceClose ( )
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 155 of file ProjectController.cpp.

bool SimShell::Gui::Controller::ProjectController::InternalIsClean ( ) const
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 177 of file ProjectController.cpp.

void SimShell::Gui::Controller::ProjectController::InternalPreForceClose ( )
protectedvirtual
See also
HasUnsavedChanges

Reimplemented from SimShell::Gui::HasUnsavedChanges.

Definition at line 182 of file ProjectController.cpp.

bool SimShell::Gui::Controller::ProjectController::InternalSave ( )
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 187 of file ProjectController.cpp.

bool SimShell::Gui::Controller::ProjectController::IsOpened ( ) const
virtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 192 of file ProjectController.cpp.

bool SimShell::Gui::Controller::ProjectController::IsRunning ( ) const
Returns
Whether simulation is running.

Definition at line 197 of file ProjectController.cpp.

SimShell::Gui::Controller::ProjectController::operator bool ( ) const
Returns
whether we are in opened state

Definition at line 276 of file ProjectController.cpp.

void SimShell::Gui::Controller::ProjectController::SetPTreeState ( const boost::property_tree::ptree &  )
virtual
See also
IHasPTreeState

Implements SimShell::Gui::IHasPTreeState.

Definition at line 258 of file ProjectController.cpp.


The documentation for this class was generated from the following files: