51 #include "elementInput.hh" 52 #include "elementOutput.hh" 53 #include "sceneElement.hh" 54 #include "connectionPoint.hh" 55 #include "connection.hh" 56 #include "graphicsScene.hh" 58 #include "../parser/element.hh" 59 #include "../parser/context.hh" 60 #include "../parser/type.hh" 61 #include "../parser/typeWidget.hh" 80 if (
state () & Input::Optional)
82 else if (
state () & Input::NoUserInput)
125 if (
isSet () || !(
state () & Input::NoRuntimeUserInput) ||
state () & Input::Optional)
136 return in_->
state ();
162 else if (
state () & Input::Optional && !forceAsk_)
166 else if (
state () & Input::NoUserInput)
189 else if (
state () & Input::Optional && !forceAsk_)
193 else if (
state () & Input::NoUserInput)
208 if ((
state () & Input::NoRuntimeUserInput) && (
state () & Input::NoExternalInput))
220 QDomElement main = _doc.createElement(
"input");
221 _root.appendChild(main);
222 main.setAttribute (
"name",in_->
name ());
225 QDomElement
set = _doc.createElement(
"is_set");
226 main.appendChild(
set);
227 t = _doc.createTextNode(isSet_ ?
"true" :
"false");
230 if (
state () & Input::Optional && forceAsk_)
232 QDomElement fA = _doc.createElement(
"force_ask");
233 main.appendChild(fA);
234 t = _doc.createTextNode(isSet_ ?
"true" :
"false");
240 QDomElement val = _doc.createElement(
"value");
241 main.appendChild(val);
242 t = _doc.createTextNode(value_);
248 QDomElement conn = _doc.createElement(
"connection");
249 main.appendChild(conn);
251 conn.setAttribute (
"element_id",QString::number (c->
output ()->
element ()->
id ()));
267 if (
state () & Input::Optional)
280 else if (
state () & Input::Optional && !forceAsk_)
284 else if (
state () & Input::NoUserInput)
298 if (value_ != _value)
ConnectionPoint * connectionPointItem() const
Connection point widget.
GraphicsScene * graphicsScene()
Scene.
virtual TypeWidget * widget(QMap< QString, QString >, QString, QWidget *=NULL)
Returns the configuration widget.
void saveToXml(QDomDocument &_doc, QDomElement &_root)
Save to xml.
virtual void setBackgroundBrush(QBrush _brush)
Sets the background brush.
ElementInput(Input *_in, SceneElement *_parent)
Constructor.
Context * context() const
Context of element.
int id()
Unique id for identification.
virtual void addConnection(Connection *_conn)
Add the connection.
void loadFromXml(QXmlQuery &_xml)
Load from xml.
static bool strToBool(QString _str)
Converts the given string to bool.
const QString & name() const
Name.
void setState(State _state)
sets the state
void setWidth(int _width)
Sets the diameter.
void contentChange()
handle content changes
void setBackground(bool _leftOut, bool _rightOut)
Enables background painting.
void set(bool _set)
"Set" flag to mark input as set by user
virtual void removeConnection(Connection *_conn)
Remove the Connection.
bool valid()
Returns state of valid flag (needed during code generation)
SceneElement * element()
Scene element.
Text * descriptionTextItem() const
Short description widget.
virtual QString toValue()=0
Return the type configuration result to a string.
Text * typeTextItem() const
Type text widget.
QString name() const
Element name.
bool isSet()
Return "set" flag.
void setValue(QString _value)
Set to a user value.
static QString getXmlString(QXmlQuery &_xml, QString _expr, QString _default="")
Gets the string of a xml query.
InOut * inOut() const
InOut context object.
QList< Connection * > connections() const
Connections.
unsigned int state()
Current state.
~ElementInput()
Destructor.
ElementOutput * output()
Output of this connection.
void addConnection(Connection *_conn)
Add connection.
const Element * element() const
Element of this input/output.
Type * getType(QString _type)
Get type object for given type name.
Element * element() const
Context VSI::Element.
unsigned int state()
VSI::Input state passthrough.
void removeConnection(Connection *_conn)
Remove connection.