[commit] r269 - in sofaswitch/trunk/callflow: docs src tests
Author: derek Date: Wed Jun 6 01:23:09 2007 New Revision: 269 Added: sofaswitch/trunk/callflow/docs/amtest.png (contents, props changed) Modified: sofaswitch/trunk/callflow/src/callflow.cpp sofaswitch/trunk/callflow/src/callstartstop.cpp sofaswitch/trunk/callflow/src/dnd.cpp sofaswitch/trunk/callflow/src/eventer.cpp sofaswitch/trunk/callflow/src/loadnewgraph.cpp sofaswitch/trunk/callflow/src/requestnode.cpp sofaswitch/trunk/callflow/src/senddtmf.cpp sofaswitch/trunk/callflow/src/shapelist.cpp sofaswitch/trunk/callflow/src/transfermedia.cpp sofaswitch/trunk/callflow/src/writetofile.cpp sofaswitch/trunk/callflow/tests/child.src sofaswitch/trunk/callflow/tests/loadgraph.src Log: tidy up fixes resulting from work on the docs. Added: sofaswitch/trunk/callflow/docs/amtest.png ============================================================================== Binary file. No diff available. Modified: sofaswitch/trunk/callflow/src/callflow.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.cpp (original) +++ sofaswitch/trunk/callflow/src/callflow.cpp Wed Jun 6 01:23:09 2007 @@ -325,7 +325,7 @@ toolBar->AddTool(wxH_CONTROLSDEATH, wxBitmap ( death ), wxT("End all processing in this flow chart")); toolBar->AddTool(wxH_CONTROLSENDCALL, wxBitmap ( endcall ), wxT("End a call (send hangup)")); toolBar->AddTool(wxH_CONTROLSSTARTHERE, wxBitmap ( Controlsstart ), wxT("Start processing")); - toolBar->AddTool(wxH_CONTROLSENDHERE, wxBitmap ( ControlsEndHere ), wxT("End processing")); + toolBar->AddTool(wxH_CONTROLSENDHERE, wxBitmap ( ControlsEndHere ), wxT("Suspend processing")); toolBar->AddTool(wxH_CONTROLSREQUESTNODE, wxBitmap (RequestNode ), wxT("Query Supervisor for worker node")); toolBar->AddTool(wxH_CONTROLSSENDDTMF, wxBitmap (senddtmf), wxT("Send DTMF string to worker node")); toolBar->AddTool(wxH_CONTROLSIF, wxBitmap ( ControlsIf_xpm ), wxT("Test a condition")); @@ -336,7 +336,7 @@ toolBar->AddTool(wxH_CONTROLSMAKECALL, wxBitmap (makecall), wxT("Make a voip/TDM call to outside entity")); toolBar->AddTool(wxH_CONTROLSFOR, wxBitmap ( Controlsfor_xpm ), wxT("Start a for loop")); toolBar->AddTool(wxH_CONTROLSEND_FOR, wxBitmap ( Controlsend_for_xpm ), wxT("end a for loop")); - toolBar->AddTool(wxH_CONTROLSPYTHON, wxBitmap ( Python_xpm ), wxT("arbitrary python code")); + toolBar->AddTool(wxH_CONTROLSPYTHON, wxBitmap ( Python_xpm ), wxT("arbitrary Python code")); toolBar->AddTool(wxH_CONTROLSSENDMESSAGE, wxBitmap ( sendmessage_xpm ), wxT("send arbitrary sofa message")); toolBar->AddTool(wxH_CONTROLSMASTERNODE, wxBitmap ( masternode_xpm ), wxT("collect events from remote sofa node")); toolBar->AddTool(wxH_CONTROLSCONNECT_OBJECTS, wxBitmap ( JoinObjects ), @@ -604,7 +604,7 @@ void MyFrame::OnCompile (wxCommandEvent & WXUNUSED(event)) { - wxFileDialog filedlg(this, _T("Select a file to contain the python code"), _T(""), _T(""), _T("*.py")); + wxFileDialog filedlg(this, _T("Select a file to contain the Python code"), _T(""), _T(""), _T("*.py")); if (filedlg.ShowModal() != wxID_OK) return; Modified: sofaswitch/trunk/callflow/src/callstartstop.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callstartstop.cpp (original) +++ sofaswitch/trunk/callflow/src/callstartstop.cpp Wed Jun 6 01:23:09 2007 @@ -29,15 +29,15 @@ switch(kindToMake) { case AcceptCall: displayData[displayData.size()] = - InformationSection(wxT("Worker node to inform on call status (python code)"), wxT("\"voip1\"")); + InformationSection(wxT("Worker node to inform on call status (Python code)"), wxT("\"voip1\"")); break; case EndCall: displayData[displayData.size()] = - InformationSection(wxT("Worker node for termination (python code)"), wxT("\"voip1\"")); + InformationSection(wxT("Worker node for termination (Python code)"), wxT("\"voip1\"")); break; case MakeCall: displayData[displayData.size()] = - InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\"")); + InformationSection(wxT("Worker node to activate (Python code)"), wxT("\"voip1\"")); break; } AdjustIoPoints(); @@ -64,20 +64,20 @@ file.AddLine(" try: "); file.AddLine(" self.rhost = eval(self.data[a][\"worker node\"]) "); file.AddLine(" except: "); - file.AddLine(" print \"The worker node string \", self.data[a][\"worker node\"], \" could not be evaluated as a python string\" "); + file.AddLine(" print \"The worker node string \", self.data[a][\"worker node\"], \" could not be evaluated as a Python string\" "); file.AddLine(" self.rhost = \"\" "); if (kind == MakeCall) { file.AddLine(" try: "); file.AddLine(" self.dest = eval(self.data[a][\"call destination\"]) "); file.AddLine(" except: "); - file.AddLine(" print \"The destination string \", self.data[a][\"call destination\"], \" could not be evaluated as a python string\" "); + file.AddLine(" print \"The destination string \", self.data[a][\"call destination\"], \" could not be evaluated as a Python string\" "); file.AddLine(" self.dest = None "); } if (kind == AcceptCall) { file.AddLine(" try: "); file.AddLine(" self.option = eval(self.data[a][\"answer option\"]) "); file.AddLine(" except: "); - file.AddLine(" print \"The answer call option string \", self.data[a][\"answer option\"], \" could not be evaluated as a python string\" "); + file.AddLine(" print \"The answer call option string \", self.data[a][\"answer option\"], \" could not be evaluated as a Python string\" "); file.AddLine(" self.option = \"No\" "); } Modified: sofaswitch/trunk/callflow/src/dnd.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.cpp (original) +++ sofaswitch/trunk/callflow/src/dnd.cpp Wed Jun 6 01:23:09 2007 @@ -475,13 +475,10 @@ DndShape * dndShape = NULL; MyTokenizer bits(description, GetEndBlock()); - if (bits.CountTokens() != 4) { - printf("String does not have the right number of tokens - %d suppl\n", - bits.CountTokens()); - printf("Break up \"%s\"\n", description.c_str()); return NULL; } + long kind, xpos, ypos; wxString ans = bits.GetNextToken(); Modified: sofaswitch/trunk/callflow/src/eventer.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/eventer.cpp (original) +++ sofaswitch/trunk/callflow/src/eventer.cpp Wed Jun 6 01:23:09 2007 @@ -50,7 +50,7 @@ bool vblEmpty = displayData[3].data.IsEmpty(); if (vblEmpty) - SetCompileError(wxT("There is no python variable to hold the output of the event")); + SetCompileError(wxT("There is no Python variable to hold the output of the event")); bool oneEmpty = displayData[1].data.IsEmpty(); @@ -65,9 +65,9 @@ } if (oneEmpty && twoEmpty) - SetCompileError(wxT("Cannot specify both python code and a regular expression.\nEnter just one statement.")); + SetCompileError(wxT("Cannot specify both Python code and a regular expression.\nEnter just one statement.")); else - SetCompileError(wxT("You must enter one statement.\nEither python code, or a regular expression")); + SetCompileError(wxT("You must enter one statement.\nEither Python code, or a regular expression")); return false; } Modified: sofaswitch/trunk/callflow/src/loadnewgraph.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/loadnewgraph.cpp (original) +++ sofaswitch/trunk/callflow/src/loadnewgraph.cpp Wed Jun 6 01:23:09 2007 @@ -86,6 +86,7 @@ file.AddLine(" f.setGraph(self.fname) "); file.AddLine(" f.setMaster(False) "); file.AddLine(" f.setUserData(self.udata) "); + file.AddLine(" f.setScriptArgs(self.scriptArgs) "); file.AddLine(" reactor.connectTCP(sofaServer, 5000, f) "); file.AddLine(" return self.data[a][\"Output\"] "); file.AddLine(""); Modified: sofaswitch/trunk/callflow/src/requestnode.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/requestnode.cpp (original) +++ sofaswitch/trunk/callflow/src/requestnode.cpp Wed Jun 6 01:23:09 2007 @@ -84,7 +84,7 @@ file.AddLine(" try: "); file.AddLine(" rhost = eval(rhost) + \":REQUESTNEWID \" "); file.AddLine(" except: "); - file.AddLine(" print \"Could not process \", self.data[a][\"Request node from\"], \" as a python string\" "); + file.AddLine(" print \"Could not process \", self.data[a][\"Request node from\"], \" as a Python string\" "); file.AddLine(" return self.data[a][\"Output\"] "); file.AddLine(" additional = self.data[a][\"Additional info\"] "); file.AddLine(" if len(additional) > 0: "); Modified: sofaswitch/trunk/callflow/src/senddtmf.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/senddtmf.cpp (original) +++ sofaswitch/trunk/callflow/src/senddtmf.cpp Wed Jun 6 01:23:09 2007 @@ -27,10 +27,10 @@ relOutputPoints.Add(25, 50); displayData[displayData.size()] = - InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\"")); + InformationSection(wxT("Worker node to activate (Python code)"), wxT("\"voip1\"")); displayData[displayData.size()] = - InformationSection(wxT("DTMF to send to worker node (python code)"), wxT("\"1\"")); + InformationSection(wxT("DTMF to send to worker node (Python code)"), wxT("\"1\"")); AdjustIoPoints(); } Modified: sofaswitch/trunk/callflow/src/shapelist.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/shapelist.cpp (original) +++ sofaswitch/trunk/callflow/src/shapelist.cpp Wed Jun 6 01:23:09 2007 @@ -310,7 +310,7 @@ file.AddLine(" help=\"location of the sofa switch message server\", "); file.AddLine(" default=\"localhost\") "); file.AddLine("parser.add_option(\"-o\", \"--opts\", dest=\"scriptArgs\", "); - file.AddLine(" help=\"text passed to the running python code, as self.scriptArgs\","); + file.AddLine(" help=\"text passed to the running Python code, as self.scriptArgs\","); file.AddLine(" default=\"\") "); file.AddLine("(options, args) = parser.parse_args() "); file.AddLine(" "); @@ -350,7 +350,7 @@ file.AddLine(" self.isMaster = newIsMaster "); file.AddLine(" "); file.AddLine(" def setScriptArgs(self, newScriptArgs): "); - file.AddLine(" \"\"\"Pass to the running python code the arguements that"); + file.AddLine(" \"\"\"Pass to the running Python code the arguements that"); file.AddLine(" were on the command line. This is a feature that enables"); file.AddLine(" (for example) one command file to call different hosts."); file.AddLine(" \"\"\" "); Modified: sofaswitch/trunk/callflow/src/transfermedia.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/transfermedia.cpp (original) +++ sofaswitch/trunk/callflow/src/transfermedia.cpp Wed Jun 6 01:23:09 2007 @@ -122,13 +122,13 @@ bool secondEmpty = displayData[2].data.IsEmpty(); if (firstEmpty) - SetCompileError(wxT("You must supply a valid python expression as the name of the first SofaSwitch worker")); + SetCompileError(wxT("You must supply a valid Python expression as the name of the first SofaSwitch worker")); if (secondEmpty) - SetCompileError(wxT("You must supply a valid python expression as the name of the second SofaSwitch worker")); + SetCompileError(wxT("You must supply a valid Python expression as the name of the second SofaSwitch worker")); if (firstEmpty && secondEmpty) - SetCompileError(wxT("You must supply a valid python expression for the names of the two SofaSwitch workers")); + SetCompileError(wxT("You must supply a valid Python expression for the names of the two SofaSwitch workers")); if (firstEmpty || secondEmpty) return false; Modified: sofaswitch/trunk/callflow/src/writetofile.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/writetofile.cpp (original) +++ sofaswitch/trunk/callflow/src/writetofile.cpp Wed Jun 6 01:23:09 2007 @@ -28,7 +28,7 @@ displayData[displayData.size()] = - InformationSection(wxT("answering machine node (Python code)"), wxT("Answering machine worker node")); + InformationSection(wxT("Answering machine node (Python code)"), wxT("self.amNode")); relInputPoints.Add(25, 0); relOutputPoints.Add(25, 50); Modified: sofaswitch/trunk/callflow/tests/child.src ============================================================================== --- sofaswitch/trunk/callflow/tests/child.src (original) +++ sofaswitch/trunk/callflow/tests/child.src Wed Jun 6 01:23:09 2007 @@ -1 +1 @@ -20<B>531<B>142<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>1<B>518<B>50<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>10<B>528<B>93<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "CHILD says::: parent id is ", self.parentId, " user data is ", self.userData<ms><special> <B><Shape> +1<B>518<B>50<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>10<B>528<B>93<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "CHILD says::: parent id is ", self.parentId, " user data is ", self.userData<ms><special> <B><Shape>20<B>531<B>142<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape> Modified: sofaswitch/trunk/callflow/tests/loadgraph.src ============================================================================== --- sofaswitch/trunk/callflow/tests/loadgraph.src (original) +++ sofaswitch/trunk/callflow/tests/loadgraph.src Wed Jun 6 01:23:09 2007 @@ -1 +1 @@ -10<B>387<B>114<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "have generated the new graph"<ms><special> <B><Shape>9<B>442<B>241<B>442,241,499,241,537,241<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>12<B>378<B>172<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>20<ms><special>Timer label (string literal)<ms>endloadgraph<ms><special> <B><Shape>14<B>392<B>219<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>endloadgraph<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>1<B>379<B>35<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>10<B>388<B>258<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "end the master now"<ms><special> <B><Shape>20<B>391<B>305<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>18<B>378<B>79<B> extra <special>Tool Tip<ms>Load New Graph<ms><special>new graph file (Python code)<ms>"am_test.graph"<ms><special> <B><Shape>2<B>509<B>241<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape> +14<B>393<B>334<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>thistimer<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>9<B>322<B>107<B>374,107,322,107,322,260,372,263<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>510<B>356<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>4<B>372<B>238<B> extra <special>Tool Tip<ms>End For Loop<ms><special> <B><Shape>12<B>381<B>280<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds, Python code)<ms>2<ms><special>Timer label (Python code)<ms>"thistimer"<ms><special> <B><Shape>18<B>381<B>127<B> extra <special>Tool Tip<ms>Load New Graph<ms><special>new graph file (Python code)<ms>"child.graph"<ms><special>Python variable to pass to child<ms>self.data[a]<ms><special> <B><Shape>10<B>390<B>181<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "have generated the new graph"<ms><special> <B><Shape>10<B>389<B>373<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "end the master now"<ms><special> <B><Shape>3<B>374<B>82<B> extra <special>Tool Tip<ms>Start For - to make lots of graphs<ms><special>Initialise (Python code)<ms>self.i = 0<ms><special>Test for Termination (Python code)<ms>self.i < 10<ms><special>Increment (Python code)<ms>self.i+=1<ms><special> <B><Shape>20<B>392<B>420<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>1<B>379<B>35<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>9<B>443<B>356<B>443,356,500,356,538,356<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>
participants (1)
-
SofaSWITCH SVN