]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx
The creation of a panel which enables the user to set in a basic way the values of...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GPortModel.cxx
index 161efa7cc303f5f6df0f4e7e632c77c6640fc508..d866736e5f5a3d944a7cb6498a56369be273e404 100644 (file)
@@ -47,6 +47,8 @@ namespace bbtk
                _portType=-1;
                _posInBox=0;
                _isConnected=false;
+               _value="";
+               _isValueSet=false;
        }
 
        //=========================================================================
@@ -112,13 +114,18 @@ namespace bbtk
                temp+=" Type:";
                temp+=_bbtkType;
                temp+=" Box:";
-               temp+=_parentBox->getBBTKType();                
+               temp+=_parentBox->getBBTKType();
                if(_portType==GOUTPUTPORT)
                {
                        temp+=" [Output Port]";
                }
                else if(_portType==GINPUTPORT)
                {
+                       if(isValueSet())
+                       {
+                               temp+=" Value:";
+                               temp+=_value;
+                       }
                        temp+=" [Input Port]";
                }
 
@@ -146,6 +153,38 @@ namespace bbtk
                _isConnected=value;
        }
 
+       //=========================================================================
+
+       void GPortModel::setValue(std::string value)
+       {
+               _value = value;
+               if(_value=="")
+               {
+                       _isValueSet=false;
+               }
+               else
+               {
+                       _isValueSet=true;
+               }
+               notifyObservers(_objectId);
+       }
+
+       //=========================================================================
+       
+       std::string GPortModel::getValue()
+       {
+               return _value;
+       }
+
+       //=========================================================================
+
+       bool GPortModel::isValueSet()
+       {
+               return _isValueSet;
+       }
+
+       //=========================================================================
+
 }  // EO namespace bbtk
 
 // EOF