#include <InspectorGadget.hpp>
Public Types | |
enum | FLOAT_DISPLAY { FIXED, SCIENTIFIC, UNFORMATED } |
enum | UNIT_SYSTEM { SI, IP } |
Public Slots | |
void | addExtensible () |
void | clear (bool recursive) |
removes everything from the IG More... | |
void | commentConfig (bool showComments) |
show/hide comment fields More... | |
void | createAllFields () |
void | IGautosize (bool toggled) |
void | IGcommentChanged (const QString &) |
void | IGdefaultRemoved (const QString &) |
changes the color of widgets More... | |
void | IGvalueChanged (const QString &) |
void | rebuild (bool recursive) |
lays out the last object again. More... | |
void | removeExtensible () |
void | setPrec () |
void | setRecursive (bool recursive) |
void | showAllFields (bool state) |
void | toggleUnits (bool displayIP) |
Signals | |
void | dirty () |
void | nameChanged (QString) |
void | toggleUnitsClicked (bool) |
void | workspaceObjectRemoved (const openstudio::Handle &) |
Public Member Functions | |
void | layoutModelObj (openstudio::WorkspaceObject &workObj, bool force=false, bool recursive=true, bool locked=false, bool hideChildren=false) |
lays out the WorkspaceObj More... | |
void | removeWorkspaceObject (const openstudio::Handle &) |
void | setPrecision (unsigned int prec, FLOAT_DISPLAY dispType) |
sets the display precision for number fields More... | |
void | setUnitSystem (const UNIT_SYSTEM unitSystem) |
virtual | ~InspectorGadget () |
Public Attributes | |
InspectorGadget * | parent |
Protected Types | |
typedef std::map < openstudio::model::ModelObject, InspectorGadget * > | MODELMAP |
Protected Slots | |
void | onTimeout () |
void | onWorkspaceObjectChanged () |
void | onWorkspaceObjectRemoved (const openstudio::Handle &) |
Protected Member Functions | |
void | checkRemoveBtn (QPushButton *btn) |
void | connectWorkspaceObjectSignals () const |
void | createExtensibleToolBar (QVBoxLayout *layout,*parent, const openstudio::IddObjectProperties &props) |
void | disconnectWorkspaceObjectSignals () const |
InspectorGadget (openstudio::WorkspaceObject &workspaceObj, int indent, ComboHighlightBridge *bridge, int precision, FLOAT_DISPLAY style, bool showComments, bool showAllFields, bool recursive, bool locked) | |
constructor More... | |
void | layoutComboBox (QVBoxLayout *layout,*parent, openstudio::IddField &field, openstudio::IddFieldProperties &properties, const std::string &name, const std::string &curVal, int index, const std::string &comment, bool exists) |
virtual void | layoutItems (QVBoxLayout *layout,*parent, bool hideChildren=false) |
void | layoutText (QVBoxLayout *layout,*parent, openstudio::model::AccessPolicy::ACCESS_LEVEL level, const std::string &val, int index, const std::string &comment) |
virtual void | layoutText (QVBoxLayout *layout,*parent, openstudio::IddField &field, openstudio::model::AccessPolicy::ACCESS_LEVEL level, const std::string &name, const std::string &curVal, int index, const std::string &comment, bool exists, bool number, bool real=false) |
void | parseItem (QVBoxLayout *layout,*parent, openstudio::IddField &field, const std::string &name, const std::string &curVal, openstudio::model::AccessPolicy::ACCESS_LEVEL level, int index, const std::string &comment, bool exists) |
void | stripchar (std::string &strip, char c) |
Static Protected Member Functions | |
static openstudio::LogChannel | logChannel () |
Protected Attributes | |
MODELMAP | m_childMap |
ComboHighlightBridge * | m_comboBridge |
* | m_deleteHandle |
QErrorMessage * | m_errorMessage |
FLOAT_DISPLAY | m_floatDisplayType |
int | m_indent |
bool | m_lastHideChildren |
bool | m_lastLocked |
QVBoxLayout * | m_layout |
bool | m_locked |
boost::optional< int > | m_nameIndex |
bool | m_objectHasName |
unsigned int | m_precision |
bool | m_recursive |
QScrollArea * | m_scroll |
bool | m_showAllFields |
bool | m_showComments |
bool | m_stretch |
UNIT_SYSTEM | m_unitSystem |
openstudio::OptionalWorkspaceObject | m_workspaceObj |
bool | m_workspaceObjectChanged |
Static Protected Attributes | |
static const char * | s_indexSlotName |
InspectorGadget will take a ModelObejct (or WorkspaceObject) and display it attributes.
InsepctorGadget interrogates objects and displays their fields/attributes based on the values contained in the AccessPolicyStore. When a new model is passed into the IG, it will delete all its old QWidgets and create new ones.
AccessPolicy::FREE Real and Integers get displayed as spinboxes AccessPolicy::LOCKED Real and Integer and all Alpha get displayed as labels. Choice is displayed as a ComboBox
|
protected |
|
virtual |
destructor
The really shouldn't need to call this, the parent Widget ought to delete the IG.
|
protected |
constructor
workspaceObj | the current workspace |
indent | indentation for the child frame |
bridge | pass in a bridge here if you need signals to get out of the IG (or the IG's children) |
precision | sets the number of sigfigs to display |
style | sets the style of floating point display |
showComments | show or hide idf comment field |
showAllFields | show or hide all fields |
recursive | recursively create and show fields |
locked | if true, lock all fields the ACCESS_POLICY sets to FREE If model has children, those children will get their own InspectorGadget, indent will be passed again to that constructor so the frames will nest. |
|
slot |
|
protected |
|
slot |
removes everything from the IG
recursive | if true, deletes the children. Removes all the information from the IG. Call this if the object being inspected gets deleted. |
|
slot |
show/hide comment fields
showComments | if true, show comments, if false, hide them |
IdfObjects have comments about their fields. (and about themselves) This function allows you to toggle weather or not you wish IG to show those comments. The Default is not to show them.
|
protected |
|
slot |
Create all fields in the IDD. IDFObjects can be instantiated with some IDD fields null. (they are not 'required' fields. Once you call this function, all fields possible will be created and presented to the user.
|
protected |
|
signal |
This signal is emitted when the IG changes the model. If your program uses IG, then you should connect to this so that you know if the file needs saving or not
|
protected |
|
slot |
|
slot |
|
slot |
changes the color of widgets
When widget are built, if the Field is required but there is no value and no default value (which in a way, is bad idf) the IG will put 0 or 0.0 in there for you, but color it red to point out that you should address this. Once you set a value, this function is automatically called for you and sets the color back to black.
|
slot |
|
protected |
|
protectedvirtual |
layout | the layout to attach the items to |
parent | the widget that owns all the items that will be created. |
hideChildren | show or hide children (hidden by default) |
This function is a big loop over the attributes or fields*, it does the core of the work for deciding what exact widgets we should build. IGChildFrame uses this function to fill out its child frame.
It depends on weather or not you called layoutModel with a ModelObject or a WorkspaceObj
void InspectorGadget::layoutModelObj | ( | openstudio::WorkspaceObject & | workObj, |
bool | force = false , |
||
bool | recursive = true , |
||
bool | locked = false , |
||
bool | hideChildren = false |
||
) |
lays out the WorkspaceObj
workObj | the current workspace |
force | forces a layout even if we just laid out this modelObj |
recursive | if true, delete the children and rebuild them |
locked | set all the FREE items to LOCKED |
hideChildren | shows or hides the children |
This call lays out a model. It will ask the Model for its AttributeVector and use that to decide what to display. If the ModelObject is a ParentChildObejct, then this function will create an IGChildFrame and that child calls layoutItems for its frame.
Calling this method a 2nd time will delete everything that was previously built and regenerate the QWidgets.
Recursive only effects anything if you are sending in the same workObj, if you pick a different one, the children are ALWAYS deleted and rebuilt. (because they are different children!)
If you are calling this from a place where the user should not be allowed to edit the fields, set the lock parameter to true
|
protected |
|
protectedvirtual |
|
inlinestaticprotected |
|
signal |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protected |
|
slot |
lays out the last object again.
recursive | if true, apply the change to the children Use this if you change a config parameter that controls how the layout happens. |
|
slot |
void InspectorGadget::removeWorkspaceObject | ( | const openstudio::Handle & | ) |
|
slot |
void InspectorGadget::setPrecision | ( | unsigned int | prec, |
FLOAT_DISPLAY | dispType | ||
) |
sets the display precision for number fields
prec | the # of significant figures to display |
dispType | how to format the floating point number |
If you pass in a zero to this function, IG will not format the number in anyway, meaning you will see exactly the string that was typed into the IDF/OSM file. (Default behavior) If you pass in a non zero number, all number fields will display that number of significant figures in scientific notation.
|
slot |
void InspectorGadget::setUnitSystem | ( | const UNIT_SYSTEM | unitSystem | ) |
|
slot |
|
protected |
|
slot |
|
signal |
|
signal |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
InspectorGadget* InspectorGadget::parent |
constructor
parent | The GUI object that owns IG |
indent | The indentation for IGChildFrame |
bridge | pass in a bridge here if you need signals to get out of the IG (or the IG's children) |
|
staticprotected |