ROOT_Application
2.0
C++ Core modules and GUIStock
|
Final controller class, does not derive from ListController. More...
#include <ControllerIndicatorTHStock.h>
Public Member Functions | |
ControllerIndicatorTHStock (MainControllerIndicatorTHStock *parent, TGCompositeFrame *mother_frame_indic, TGCompositeFrame *mother_frame_thstock, std::string frame_name) | |
virtual | ~ControllerIndicatorTHStock () |
IndicatorFrame * | GetIndicatorFrame () const |
void | SetIndicatorFrame (IndicatorFrame *findic) |
THStockFrame * | GetTHStockFrame () const |
void | SetTHStockFrame (THStockFrame *fthstock) |
void | AddData (std::string fullname) |
Used when a new ListData is added, need SM access here, or in parent... More... | |
void | GetSelected (int pad_number) |
void | UpdateIndicator (std::string mode, std::string fullname) |
UpdateIndicator, call by IndicatorFrame. More... | |
void | ModifyColorIndic (std::string fullname, unsigned long color) |
void | PrintVector () |
Print the Content of the vector vec_name_data, for debugging. More... | |
void | UpdateFrames () |
keep only for updating THStockFrame for the moment, how done by Indicator ? More... | |
virtual void | Updated (std::vector< std::string > &message) |
receive an update from observer pattern, from StockManager More... | |
Public Member Functions inherited from ControllerFrame< NullType > | |
ControllerFrame () | |
ControllerFrame (ControllerBase *parent, std::string name="") | |
virtual | ~ControllerFrame () |
virtual void | DeleteList (bool call_delete=true) |
Public Member Functions inherited from ControllerBase | |
ControllerBase () | |
ControllerBase (ControllerBase *parent, std::string cont_name) | |
virtual | ~ControllerBase () |
std::string | GetName () const |
ControllerBase * | GetParentController () |
Private Types | |
typedef std::list< std::string > ::iterator | it_list |
define iterator and const iterator for loop More... | |
typedef std::list< std::string > ::const_iterator | it_clist |
typedef std::vector< std::list < std::string > >::iterator | it_vec |
typedef std::vector< std::list < std::string > >::const_iterator | it_cvec |
Private Member Functions | |
bool | IsPresent (std::string fullname, unsigned int i) const |
check if fullname is present in the pad number i More... | |
std::list< std::string > * | GetList (unsigned int nb_pad) |
return the list of name of the pad number nb_pad. More... | |
bool | NeedToUpdate (std::string stockname, ETime tmscl) const |
check if the size of ldata and object match, or if need an update. More... | |
int | AddDataToVecNameData (std::string fullname, unsigned int nb_pad=0) |
add the name of the new data in the pad nb_pad. More... | |
unsigned int | GetPadNumber (std::string fullname) const |
want the index of the vector containing the corresponding fullname, i.e. More... | |
Private Attributes | |
IndicatorFrame * | findic_frame |
pointer to the frame and indicator. More... | |
THStockFrame * | fthstock_frame |
pointer to the frame More... | |
MainControllerIndicatorTHStock * | myparent_controller |
before base was working, test if explicit, seems necessary depending on the function called More... | |
std::vector< std::list < std::string > > | vec_name_data |
add a list of loaded data, use only name ( fullname ). More... | |
Final controller class, does not derive from ListController.
\ Controller for an unique couple Indicator / THStockFrame
good point simple to know if loaded in the controller, and not in the view \ keep a list vec_name_data ( of all loaded ListDataStock and their pad number )\
Do not care if show or hidden, this is done by the view, may be good \ Less to do in view ( problem of pads...)
Definition at line 48 of file ControllerIndicatorTHStock.h.
|
private |
Definition at line 53 of file ControllerIndicatorTHStock.h.
|
private |
Definition at line 55 of file ControllerIndicatorTHStock.h.
|
private |
define iterator and const iterator for loop
Definition at line 52 of file ControllerIndicatorTHStock.h.
|
private |
Definition at line 54 of file ControllerIndicatorTHStock.h.
ControllerIndicatorTHStock::ControllerIndicatorTHStock | ( | MainControllerIndicatorTHStock * | parent, |
TGCompositeFrame * | mother_frame_indic, | ||
TGCompositeFrame * | mother_frame_thstock, | ||
std::string | frame_name | ||
) |
Definition at line 29 of file ControllerIndicatorTHStock.cxx.
References findic_frame, fthstock_frame, THStockFrame::GetECanvas(), MainControllerIndicatorTHStock::GetFrame(), ControllerBase::GetName(), ControllerBase::GetParentController(), myparent_controller, IndicatorFrame::SetController(), and THStockFrame::SetController().
|
virtual |
Definition at line 69 of file ControllerIndicatorTHStock.cxx.
References myparent_controller, and vec_name_data.
void ControllerIndicatorTHStock::AddData | ( | std::string | fullname | ) |
Used when a new ListData is added, need SM access here, or in parent...
Used when a new ListData is added, need SM access, or in parent...
Definition at line 230 of file ControllerIndicatorTHStock.cxx.
References AddDataToVecNameData(), IndicatorFrame::AddIndicator(), CanvasStock::AddListDataStockToMap(), findic_frame, fthstock_frame, THStockFrame::GetECanvas(), Indicator::GetIndicator(), StockManager::getInstance(), StockManager::GetListData(), ControllerBase::GetName(), ListDataStockBase::GetName(), ListDataStockBase::GetSize(), FactoryObjectStock::MakeColor(), Indicator::MakeColor(), Indicator::parse_description(), ListDataStockBase::PrintData(), PrintVector(), UpdateFrames(), and StockException::what().
Referenced by MainControllerIndicatorTHStock::Validation().
|
private |
add the name of the new data in the pad nb_pad.
nb_pad | : insert in this pad number, need default pad ? 0 will creates a new one ? |
fullname | : insert the fullname in the list |
Definition at line 188 of file ControllerIndicatorTHStock.cxx.
References GetList(), and vec_name_data.
Referenced by AddData().
|
inline |
Definition at line 101 of file ControllerIndicatorTHStock.h.
References findic_frame.
Referenced by MainControllerIndicatorTHStock::AddCouple_Indicator_THStock(), and MainControllerIndicatorTHStock::UpdateIndicator().
|
private |
return the list of name of the pad number nb_pad.
creates a new one if not existing
Definition at line 96 of file ControllerIndicatorTHStock.cxx.
References vec_name_data.
Referenced by AddDataToVecNameData().
|
private |
want the index of the vector containing the corresponding fullname, i.e.
the pad number
Definition at line 213 of file ControllerIndicatorTHStock.cxx.
References IsPresent(), and vec_name_data.
Referenced by ModifyColorIndic(), and UpdateIndicator().
void ControllerIndicatorTHStock::GetSelected | ( | int | pad_number | ) |
Definition at line 307 of file ControllerIndicatorTHStock.cxx.
References ControllerBase::GetParentController().
Referenced by THStockFrame::GetSignalSelected().
|
inline |
Definition at line 103 of file ControllerIndicatorTHStock.h.
References fthstock_frame.
Referenced by MainControllerIndicatorTHStock::AddCouple_Indicator_THStock(), UpdateFrames(), and MainControllerIndicatorTHStock::UpdateIndicator().
|
private |
check if fullname is present in the pad number i
Definition at line 85 of file ControllerIndicatorTHStock.cxx.
References vec_name_data.
Referenced by GetPadNumber().
void ControllerIndicatorTHStock::ModifyColorIndic | ( | std::string | fullname, |
unsigned long | color | ||
) |
Definition at line 436 of file ControllerIndicatorTHStock.cxx.
References fthstock_frame, THStockFrame::GetECanvas(), FullName::GetFrameName(), GetPadNumber(), and CanvasStock::SetColor().
Referenced by IndicatorFrame::HandleButtons().
|
private |
check if the size of ldata and object match, or if need an update.
update done by the caller
Definition at line 124 of file ControllerIndicatorTHStock.cxx.
References FullName::GetNameStock().
Referenced by Updated().
void ControllerIndicatorTHStock::PrintVector | ( | ) |
Print the Content of the vector vec_name_data, for debugging.
Definition at line 455 of file ControllerIndicatorTHStock.cxx.
References vec_name_data.
Referenced by AddData(), Updated(), and UpdateIndicator().
|
inline |
Definition at line 102 of file ControllerIndicatorTHStock.h.
References findic_frame.
Referenced by MainControllerIndicatorTHStock::UpdateIndicator().
|
inline |
Definition at line 104 of file ControllerIndicatorTHStock.h.
References fthstock_frame.
Referenced by MainControllerIndicatorTHStock::UpdateIndicator().
|
virtual |
receive an update from observer pattern, from StockManager
Implements ControllerBase.
Definition at line 468 of file ControllerIndicatorTHStock.cxx.
References ControllerBase::GetName(), INST, NeedToUpdate(), PrintVector(), and UpdateFrames().
void ControllerIndicatorTHStock::UpdateFrames | ( | ) |
keep only for updating THStockFrame for the moment, how done by Indicator ?
only THStockFrame, how is done by Indicator
Definition at line 517 of file ControllerIndicatorTHStock.cxx.
References THStockFrame::GetECanvas(), GetTHStockFrame(), and CanvasStock::UpdateTHStock().
Referenced by AddData(), MainControllerIndicatorTHStock::Update(), and Updated().
void ControllerIndicatorTHStock::UpdateIndicator | ( | std::string | mode, |
std::string | fullname | ||
) |
UpdateIndicator, call by IndicatorFrame.
First link between Frame and Controller.\ Can only make a subpart of the function here : only one thstock one indicator.\
should call functions of MainControllerIndicatorTHStock at least if a resizing of the main_frames are needed.
important to get npad from the signal, best solution ?? controller could query from the name, only one indicator/thstock here now avoid to maintain npad in indicator frame label in synchronization much later: goal is to avoid nb_pad in the signal ?
mode | : HIDE, DELETE, HIDE_ALL, DELETE_ALL, SHOW, SHOW_ALL |
fullname | |
nb_pad |
Definition at line 352 of file ControllerIndicatorTHStock.cxx.
References StockManager::DeleteListData(), fthstock_frame, THStockFrame::GetECanvas(), FullName::GetFrameName(), GetPadNumber(), MainControllerIndicatorTHStock::GetStockManager(), CanvasStock::HideListData(), myparent_controller, PrintVector(), CanvasStock::ShowListData(), and MainControllerIndicatorTHStock::UpdateIndicator().
Referenced by IndicatorFrame::HandleButtons().
|
private |
pointer to the frame and indicator.
only one associated, could be const no need of current
Definition at line 60 of file ControllerIndicatorTHStock.h.
Referenced by AddData(), ControllerIndicatorTHStock(), GetIndicatorFrame(), and SetIndicatorFrame().
|
private |
pointer to the frame
Definition at line 62 of file ControllerIndicatorTHStock.h.
Referenced by AddData(), ControllerIndicatorTHStock(), GetTHStockFrame(), ModifyColorIndic(), SetTHStockFrame(), and UpdateIndicator().
|
private |
before base was working, test if explicit, seems necessary depending on the function called
Definition at line 66 of file ControllerIndicatorTHStock.h.
Referenced by ControllerIndicatorTHStock(), UpdateIndicator(), and ~ControllerIndicatorTHStock().
|
private |
add a list of loaded data, use only name ( fullname ).
Could be other data (??) easier with map ? but need rename for a map... vector relates to pad number index, list to the data there
Definition at line 72 of file ControllerIndicatorTHStock.h.
Referenced by AddDataToVecNameData(), GetList(), GetPadNumber(), IsPresent(), PrintVector(), and ~ControllerIndicatorTHStock().