+
+ bool GBlackBoxModel::isExecutable()
+ {
+ return _isExecutable;
+ }
+
+ //=========================================================================
+
+ void GBlackBoxModel::setExecutable(bool executable)
+ {
+ _isExecutable = executable;
+ }
+
+ //=========================================================================
+
+ std::string GBlackBoxModel::getStatusText()
+ {
+ std::string temp = "";
+ temp+=_bbtkPackage;
+ temp+=":";
+ temp+=_bbtkType;
+ temp+=":";
+ temp+=_bbtkName;
+
+ return temp;
+ }
+
+ //=========================================================================
+
+ void GBlackBoxModel::setValueToInputPort(int pos,std::string value)
+ {
+ _inputs[pos]->setValue(value);
+ }
+
+ //=========================================================================
+
+ void GBlackBoxModel::save(std::string &content)
+ {
+ content+="BOX\n";
+ // Box info
+ content+=_bbtkPackage;
+ content+=":";
+ content+=_bbtkType;
+ content+=":";
+ content+=_bbtkName;
+ content+="\n";
+ content+="ISEXEC:";
+ if(_isExecutable)
+ {
+ content+="TRUE";
+ }
+ else
+ {
+ content+="FALSE";
+ }
+ content+="\n";
+
+
+ //Box Position
+ char buffer [50];
+ sprintf (buffer, "%f", _xInic);
+ content+=buffer;
+ content+=":";
+ sprintf (buffer, "%f", _yInic);
+ content+=buffer;
+ content+=":";
+ sprintf (buffer, "%f", _zInic);
+ content+=buffer;
+ content+="\n";
+
+ sprintf (buffer, "%f", _xFin);
+ content+=buffer;
+ content+=":";
+ sprintf (buffer, "%f", _yFin);
+ content+=buffer;
+ content+=":";
+ sprintf (buffer, "%f", _zFin);
+ content+=buffer;
+ content+="\n";
+
+ //Ports with a value
+ for(int i = 0; i<_inputs.size();i++)
+ {
+ if(_inputs[i]->isValueSet())
+ {
+ _inputs[i]->save(content);
+ }
+ }
+ content+="FIN_BOX\n";
+
+ }
+
+ //=========================================================================
+
+ void GBlackBoxModel::setValueToInput(std::string name,std::string value)
+ {
+ for(int i = 0; i<_inputs.size();i++)
+ {
+ if(_inputs[i]->getBBTKName()==name)
+ {
+ _inputs[i]->setValue(value);
+ }
+ }
+ }
+
+ //=========================================================================
+