Author: derek Date: Sun Jul 27 19:56:10 2008 New Revision: 437 Modified: sofaswitch/trunk/callflow/src/dnd.cpp sofaswitch/trunk/callflow/src/requestnode.cpp sofaswitch/trunk/callflow/src/requestnode.h sofaswitch/trunk/callflow/src/shapelist.cpp Log: check that the user has specified a python variable to hold the output of the requestnewid operation. mark this as a compile error if name not specified. Ensure this compile error is correctly cleared on doing the next compile. Modified: sofaswitch/trunk/callflow/src/dnd.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.cpp (original) +++ sofaswitch/trunk/callflow/src/dnd.cpp Sun Jul 27 19:56:10 2008 @@ -407,7 +407,6 @@ bool DndShape::TestInternalVariables() { - ClearCompileError(); return true; } Modified: sofaswitch/trunk/callflow/src/requestnode.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/requestnode.cpp (original) +++ sofaswitch/trunk/callflow/src/requestnode.cpp Sun Jul 27 19:56:10 2008 @@ -88,6 +88,20 @@ DndShape::Draw(dc); } + +bool DndShapeRequestNode::TestInternalVariables() +{ + if (displayData[4].data.IsEmpty()) { + wxString error; + error = wxT("You must supply a valid Python expression as \n"); + error = error + wxT("the name of the requested SofaSwitch worker"); + SetCompileError(error); + return false; + } + return true; +} + + bool DndShapeRequestNode::WriteSystemCode(wxTextFile & file) { file.AddLine(wxT(" def Request_Node(self, aTuple): ")); Modified: sofaswitch/trunk/callflow/src/requestnode.h ============================================================================== --- sofaswitch/trunk/callflow/src/requestnode.h (original) +++ sofaswitch/trunk/callflow/src/requestnode.h Sun Jul 27 19:56:10 2008 @@ -24,6 +24,12 @@ /**Draw this particular shape to the screen..*/ virtual void Draw(wxDC& dc); + /**Make cerrtain that the intenal variables have been set + correctly, so this shape will compile into good + code. Essentially, test that there is a python variable + specified to hold the derived name.*/ + virtual bool TestInternalVariables(); + /** Used to report the name of this particular class. */ static wxString GetKindName() { return wxT("Request Node"); } Modified: sofaswitch/trunk/callflow/src/shapelist.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/shapelist.cpp (original) +++ sofaswitch/trunk/callflow/src/shapelist.cpp Sun Jul 27 19:56:10 2008 @@ -273,7 +273,8 @@ while (it != end()) { DndShape *thisShape = it->second; if (thisShape != NULL) { - variablesOk = thisShape->TestInternalVariables(); + thisShape->ClearCompileError(); + variablesOk = thisShape->TestInternalVariables(); } it++; }