[commit] r415 - in sofaswitch/trunk/callflow: src tests
Author: derek Date: Sun May 25 21:36:03 2008 New Revision: 415 Modified: sofaswitch/trunk/callflow/src/acceptcall.cpp sofaswitch/trunk/callflow/src/acceptcall.h sofaswitch/trunk/callflow/src/callflow.cpp sofaswitch/trunk/callflow/src/callflow.h sofaswitch/trunk/callflow/src/callstartstop.cpp sofaswitch/trunk/callflow/src/callstartstop.h sofaswitch/trunk/callflow/src/canvas.cpp sofaswitch/trunk/callflow/src/canvas.h sofaswitch/trunk/callflow/src/conditional.cpp sofaswitch/trunk/callflow/src/conditional.h sofaswitch/trunk/callflow/src/death.cpp sofaswitch/trunk/callflow/src/death.h sofaswitch/trunk/callflow/src/dnd.cpp sofaswitch/trunk/callflow/src/dnd.h sofaswitch/trunk/callflow/src/drawshape.cpp sofaswitch/trunk/callflow/src/drawshape.h sofaswitch/trunk/callflow/src/endcall.cpp sofaswitch/trunk/callflow/src/endcall.h sofaswitch/trunk/callflow/src/endfor.cpp sofaswitch/trunk/callflow/src/endfor.h sofaswitch/trunk/callflow/src/endhere.cpp sofaswitch/trunk/callflow/src/endhere.h sofaswitch/trunk/callflow/src/eventer.cpp sofaswitch/trunk/callflow/src/eventer.h sofaswitch/trunk/callflow/src/fileio.cpp sofaswitch/trunk/callflow/src/fileio.h sofaswitch/trunk/callflow/src/information.cpp sofaswitch/trunk/callflow/src/information.h sofaswitch/trunk/callflow/src/joinblocks.cpp sofaswitch/trunk/callflow/src/joinblocks.h sofaswitch/trunk/callflow/src/listpoints.cpp sofaswitch/trunk/callflow/src/listpoints.h sofaswitch/trunk/callflow/src/loadnewgraph.cpp sofaswitch/trunk/callflow/src/loadnewgraph.h sofaswitch/trunk/callflow/src/makecall.cpp sofaswitch/trunk/callflow/src/makecall.h sofaswitch/trunk/callflow/src/masternode.cpp sofaswitch/trunk/callflow/src/masternode.h sofaswitch/trunk/callflow/src/python.cpp sofaswitch/trunk/callflow/src/python.h sofaswitch/trunk/callflow/src/readfromfile.cpp sofaswitch/trunk/callflow/src/readfromfile.h sofaswitch/trunk/callflow/src/requestnode.cpp sofaswitch/trunk/callflow/src/requestnode.h sofaswitch/trunk/callflow/src/senddtmf.cpp sofaswitch/trunk/callflow/src/senddtmf.h sofaswitch/trunk/callflow/src/sendmessage.cpp sofaswitch/trunk/callflow/src/sendmessage.h sofaswitch/trunk/callflow/src/shapelist.cpp sofaswitch/trunk/callflow/src/shapelist.h sofaswitch/trunk/callflow/src/shapeselect.cpp sofaswitch/trunk/callflow/src/shapeselect.h sofaswitch/trunk/callflow/src/startfor.cpp sofaswitch/trunk/callflow/src/startfor.h sofaswitch/trunk/callflow/src/starthere.cpp sofaswitch/trunk/callflow/src/starthere.h sofaswitch/trunk/callflow/src/stoptimer.cpp sofaswitch/trunk/callflow/src/stoptimer.h sofaswitch/trunk/callflow/src/timer.cpp sofaswitch/trunk/callflow/src/timer.h sofaswitch/trunk/callflow/src/transfermedia.cpp sofaswitch/trunk/callflow/src/transfermedia.h sofaswitch/trunk/callflow/src/writetofile.cpp sofaswitch/trunk/callflow/src/writetofile.h sofaswitch/trunk/callflow/tests/makevoipcall.src Log: Work hard on callflow so it compiles and runs a bit nicer. Fix compatibility issues with wxwidgets 2.8. Modified: sofaswitch/trunk/callflow/src/acceptcall.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/acceptcall.cpp (original) +++ sofaswitch/trunk/callflow/src/acceptcall.cpp Sun May 25 21:36:03 2008 @@ -98,3 +98,14 @@ return true; } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/acceptcall.h ============================================================================== --- sofaswitch/trunk/callflow/src/acceptcall.h (original) +++ sofaswitch/trunk/callflow/src/acceptcall.h Sun May 25 21:36:03 2008 @@ -29,3 +29,14 @@ #endif // ACCEPT_CALL_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/callflow.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.cpp (original) +++ sofaswitch/trunk/callflow/src/callflow.cpp Sun May 25 21:36:03 2008 @@ -658,7 +658,18 @@ void MyFrame::OnCompile (wxCommandEvent & WXUNUSED(event)) { - wxFileDialog filedlg(this, _T("Select a file to contain the Python code"), _T(""), _T(""), _T("*.py")); + wxString possibleName = currentFileName; + wxString dirName, fileName; + int locn = currentFileName.Find(wxFILE_SEP_PATH, true); + if (locn != wxNOT_FOUND) { + dirName = currentFileName.Left(locn); + fileName = currentFileName.Mid(locn +1); + fileName.Replace(wxT(".src"), wxT(".py"), true); + } + wxString titleText = wxT("Enter/Select a filename which will"); + titleText += wxT(" contain the generated Python code"); + wxFileDialog filedlg(this, titleText, dirName, fileName, + _T("*.py"), wxFD_SAVE); if (filedlg.ShowModal() != wxID_OK) return; @@ -683,3 +694,13 @@ file.Close(); } + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/callflow.h ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.h (original) +++ sofaswitch/trunk/callflow/src/callflow.h Sun May 25 21:36:03 2008 @@ -309,3 +309,14 @@ }; #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/callstartstop.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callstartstop.cpp (original) +++ sofaswitch/trunk/callflow/src/callstartstop.cpp Sun May 25 21:36:03 2008 @@ -181,3 +181,12 @@ DndShape::Draw(dc); // Draw the selected overlay if required. } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/callstartstop.h ============================================================================== --- sofaswitch/trunk/callflow/src/callstartstop.h (original) +++ sofaswitch/trunk/callflow/src/callstartstop.h Sun May 25 21:36:03 2008 @@ -34,3 +34,14 @@ #endif // CALL_START_STOP_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/canvas.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/canvas.cpp (original) +++ sofaswitch/trunk/callflow/src/canvas.cpp Sun May 25 21:36:03 2008 @@ -639,3 +639,14 @@ break; } } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/canvas.h ============================================================================== --- sofaswitch/trunk/callflow/src/canvas.h (original) +++ sofaswitch/trunk/callflow/src/canvas.h Sun May 25 21:36:03 2008 @@ -184,3 +184,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/conditional.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/conditional.cpp (original) +++ sofaswitch/trunk/callflow/src/conditional.cpp Sun May 25 21:36:03 2008 @@ -122,3 +122,12 @@ + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/conditional.h ============================================================================== --- sofaswitch/trunk/callflow/src/conditional.h (original) +++ sofaswitch/trunk/callflow/src/conditional.h Sun May 25 21:36:03 2008 @@ -34,3 +34,14 @@ #endif // SHAPE_CONDITIONAL_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/death.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/death.cpp (original) +++ sofaswitch/trunk/callflow/src/death.cpp Sun May 25 21:36:03 2008 @@ -77,3 +77,14 @@ return true; } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/death.h ============================================================================== --- sofaswitch/trunk/callflow/src/death.h (original) +++ sofaswitch/trunk/callflow/src/death.h Sun May 25 21:36:03 2008 @@ -33,3 +33,14 @@ }; #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/dnd.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.cpp (original) +++ sofaswitch/trunk/callflow/src/dnd.cpp Sun May 25 21:36:03 2008 @@ -1051,3 +1051,13 @@ return false; } + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/dnd.h ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.h (original) +++ sofaswitch/trunk/callflow/src/dnd.h Sun May 25 21:36:03 2008 @@ -683,3 +683,14 @@ #endif //_my_dnd_h + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/drawshape.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/drawshape.cpp (original) +++ sofaswitch/trunk/callflow/src/drawshape.cpp Sun May 25 21:36:03 2008 @@ -16,3 +16,14 @@ + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/drawshape.h ============================================================================== --- sofaswitch/trunk/callflow/src/drawshape.h (original) +++ sofaswitch/trunk/callflow/src/drawshape.h Sun May 25 21:36:03 2008 @@ -25,3 +25,14 @@ #include "writetofile.h" #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/endcall.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/endcall.cpp (original) +++ sofaswitch/trunk/callflow/src/endcall.cpp Sun May 25 21:36:03 2008 @@ -56,3 +56,14 @@ DrawArrow(dc, tc, ArrowDown, Loose); DrawArrow(dc, td, ArrowDown, Loose); } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/endcall.h ============================================================================== --- sofaswitch/trunk/callflow/src/endcall.h (original) +++ sofaswitch/trunk/callflow/src/endcall.h Sun May 25 21:36:03 2008 @@ -29,3 +29,14 @@ #endif // END_CALL_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/endfor.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/endfor.cpp (original) +++ sofaswitch/trunk/callflow/src/endfor.cpp Sun May 25 21:36:03 2008 @@ -78,7 +78,7 @@ const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); file.AddLine(wxT(" \"LoopAgain\" : ")); - file.AddLine(wxT(" ") + outputLabel + wxT(" ")); + file.AddLine(wxT(" ") + outputLabel + wxT(", ")); outputNode = outputNode->GetNext(); const wxString & outputLabel2 = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); @@ -91,3 +91,12 @@ + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/endfor.h ============================================================================== --- sofaswitch/trunk/callflow/src/endfor.h (original) +++ sofaswitch/trunk/callflow/src/endfor.h Sun May 25 21:36:03 2008 @@ -36,3 +36,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/endhere.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/endhere.cpp (original) +++ sofaswitch/trunk/callflow/src/endhere.cpp Sun May 25 21:36:03 2008 @@ -77,3 +77,12 @@ return true; } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/endhere.h ============================================================================== --- sofaswitch/trunk/callflow/src/endhere.h (original) +++ sofaswitch/trunk/callflow/src/endhere.h Sun May 25 21:36:03 2008 @@ -33,3 +33,14 @@ }; #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/eventer.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/eventer.cpp (original) +++ sofaswitch/trunk/callflow/src/eventer.cpp Sun May 25 21:36:03 2008 @@ -199,3 +199,14 @@ return outputPoints.PointLinked(0) && outputPoints.PointLinked(1); } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/eventer.h ============================================================================== --- sofaswitch/trunk/callflow/src/eventer.h (original) +++ sofaswitch/trunk/callflow/src/eventer.h Sun May 25 21:36:03 2008 @@ -49,3 +49,14 @@ }; #endif // SHAPE_EVENTER_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/fileio.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/fileio.cpp (original) +++ sofaswitch/trunk/callflow/src/fileio.cpp Sun May 25 21:36:03 2008 @@ -128,3 +128,14 @@ file.AddLine(wxT("")); return true; } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/fileio.h ============================================================================== --- sofaswitch/trunk/callflow/src/fileio.h (original) +++ sofaswitch/trunk/callflow/src/fileio.h Sun May 25 21:36:03 2008 @@ -33,3 +33,14 @@ #endif // FILE_IO_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/information.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/information.cpp (original) +++ sofaswitch/trunk/callflow/src/information.cpp Sun May 25 21:36:03 2008 @@ -80,3 +80,14 @@ return true; } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/information.h ============================================================================== --- sofaswitch/trunk/callflow/src/information.h (original) +++ sofaswitch/trunk/callflow/src/information.h Sun May 25 21:36:03 2008 @@ -87,3 +87,14 @@ }; #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/joinblocks.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/joinblocks.cpp (original) +++ sofaswitch/trunk/callflow/src/joinblocks.cpp Sun May 25 21:36:03 2008 @@ -442,3 +442,12 @@ { return true; } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/joinblocks.h ============================================================================== --- sofaswitch/trunk/callflow/src/joinblocks.h (original) +++ sofaswitch/trunk/callflow/src/joinblocks.h Sun May 25 21:36:03 2008 @@ -130,3 +130,14 @@ #endif // JOIN_BLOCKS_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/listpoints.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/listpoints.cpp (original) +++ sofaswitch/trunk/callflow/src/listpoints.cpp Sun May 25 21:36:03 2008 @@ -52,3 +52,14 @@ wxPoint *newPoint = new wxPoint(newData); Append(newPoint); } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/listpoints.h ============================================================================== --- sofaswitch/trunk/callflow/src/listpoints.h (original) +++ sofaswitch/trunk/callflow/src/listpoints.h Sun May 25 21:36:03 2008 @@ -37,3 +37,14 @@ #endif //LIST_POINTS_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/loadnewgraph.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/loadnewgraph.cpp (original) +++ sofaswitch/trunk/callflow/src/loadnewgraph.cpp Sun May 25 21:36:03 2008 @@ -135,3 +135,14 @@ return true; } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/loadnewgraph.h ============================================================================== --- sofaswitch/trunk/callflow/src/loadnewgraph.h (original) +++ sofaswitch/trunk/callflow/src/loadnewgraph.h Sun May 25 21:36:03 2008 @@ -38,3 +38,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/makecall.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/makecall.cpp (original) +++ sofaswitch/trunk/callflow/src/makecall.cpp Sun May 25 21:36:03 2008 @@ -43,3 +43,14 @@ DrawArrow(dc, tb, ArrowUp, Loose); DrawArrow(dc, ta, ArrowUp, Loose); } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/makecall.h ============================================================================== --- sofaswitch/trunk/callflow/src/makecall.h (original) +++ sofaswitch/trunk/callflow/src/makecall.h Sun May 25 21:36:03 2008 @@ -23,3 +23,14 @@ #endif // MAKE_CALL_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/masternode.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/masternode.cpp (original) +++ sofaswitch/trunk/callflow/src/masternode.cpp Sun May 25 21:36:03 2008 @@ -94,3 +94,14 @@ return true; } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/masternode.h ============================================================================== --- sofaswitch/trunk/callflow/src/masternode.h (original) +++ sofaswitch/trunk/callflow/src/masternode.h Sun May 25 21:36:03 2008 @@ -34,3 +34,14 @@ #endif // SHAPE_SEND_MESSAGE_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/python.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/python.cpp (original) +++ sofaswitch/trunk/callflow/src/python.cpp Sun May 25 21:36:03 2008 @@ -90,3 +90,14 @@ return true; } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/python.h ============================================================================== --- sofaswitch/trunk/callflow/src/python.h (original) +++ sofaswitch/trunk/callflow/src/python.h Sun May 25 21:36:03 2008 @@ -33,3 +33,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/readfromfile.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/readfromfile.cpp (original) +++ sofaswitch/trunk/callflow/src/readfromfile.cpp Sun May 25 21:36:03 2008 @@ -35,3 +35,12 @@ AdjustIoPoints(); } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/readfromfile.h ============================================================================== --- sofaswitch/trunk/callflow/src/readfromfile.h (original) +++ sofaswitch/trunk/callflow/src/readfromfile.h Sun May 25 21:36:03 2008 @@ -22,3 +22,14 @@ #endif //READ_FROM_FILE_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/requestnode.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/requestnode.cpp (original) +++ sofaswitch/trunk/callflow/src/requestnode.cpp Sun May 25 21:36:03 2008 @@ -183,7 +183,7 @@ file.AddLine(wxT(" \"") + dest + wxT("\", ")); file.AddLine(wxT(" \"Timer period\" : ")); - file.AddLine(wxT(" ") + displayData[2] + wxT(", ")); + file.AddLine(wxT(" ") + displayData[2].data + wxT(", ")); file.AddLine(wxT(" \"Event Source\" : ")); file.AddLine(wxT(" \"self.") + GetKey() + wxT("_Source\", ")); @@ -192,7 +192,7 @@ file.AddLine(wxT(" \"self.") + GetKey() + wxT("_Name\", ")); file.AddLine(wxT(" \"Event Data\" : ")); - file.AddLine(wxT(" \"") + displayData[4] + wxT("\", ")); + file.AddLine(wxT(" \"") + displayData[4].data + wxT("\", ")); file.AddLine(wxT(" \"Request Pending\" : ")); file.AddLine(wxT(" 0, ")); @@ -206,3 +206,14 @@ return true; } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/requestnode.h ============================================================================== --- sofaswitch/trunk/callflow/src/requestnode.h (original) +++ sofaswitch/trunk/callflow/src/requestnode.h Sun May 25 21:36:03 2008 @@ -37,3 +37,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/senddtmf.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/senddtmf.cpp (original) +++ sofaswitch/trunk/callflow/src/senddtmf.cpp Sun May 25 21:36:03 2008 @@ -37,47 +37,47 @@ bool DndShapeSendDtmf::WriteSystemCode(wxTextFile & file) { - file.AddLine(" def Send_Dtmf(self, sTuple): "); - file.AddLine(" a,b,c = sTuple "); - file.AddLine(" try: "); - file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) "); - file.AddLine(" except: "); - file.AddLine(" print \"Could not process \", self.data[a][\"worker node\"], \" as a Python string\" "); - file.AddLine(" return self.data[a][\"Output\"] "); - - file.AddLine(" self.sendDtmf= self.data[a][\"dtmf to send\"] "); - file.AddLine(" try: "); - file.AddLine(" rhost += \":SENDDTMF \" + eval(self.sendDtmf) + \"\\0\" "); - file.AddLine(" except: "); - file.AddLine(" print \"Could not process \", self.sendDtmf, \" as a Python string\" "); - file.AddLine(" return self.data[a][\"Output\"] "); - - file.AddLine(" self.transport.write(rhost) "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(""); + file.AddLine(wxT(" def Send_Dtmf(self, sTuple): ")); + file.AddLine(wxT(" a,b,c = sTuple ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" rhost = eval(self.data[a][\"worker node\"]) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"Could not process \", self.data[a][\"worker node\"], \" as a Python string\" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + + file.AddLine(wxT(" self.sendDtmf= self.data[a][\"dtmf to send\"] ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" rhost += \":SENDDTMF \" + eval(self.sendDtmf) + \"\\0\" ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"Could not process \", self.sendDtmf, \" as a Python string\" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + + file.AddLine(wxT(" self.transport.write(rhost) ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + file.AddLine(wxT("")); return true; } bool DndShapeSendDtmf::WriteThisShapeInfo(wxTextFile & file) { - file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str())); + file.AddLine(wxT(" \"") + GetKey() + wxT("\" : { ")); wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxT(" \"Output\" : ")); + file.AddLine(wxT(" ") + outputLabel + wxT(", ")); - file.AddLine(wxString::Format(" \"worker node\" : ")); + file.AddLine(wxT(" \"worker node\" : ")); wxString dest = ProtectString(displayData[1].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + file.AddLine(wxT(" \"") + dest + wxT("\", ")); - file.AddLine(wxString::Format(" \"dtmf to send\" : ")); + file.AddLine(wxT(" \"dtmf to send\" : ")); dest = ProtectString(displayData[2].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + file.AddLine(wxT(" \"") + dest + wxT("\", ")); - file.AddLine(wxString::Format(" },")); + file.AddLine(wxT(" },")); return true; } @@ -120,7 +120,7 @@ wxFont f = wxFont(*wxITALIC_FONT); f.SetPointSize(12); dc.SetFont(f); - wxString msg("DTMF"); + wxString msg(wxT("DTMF")); for (int i = 0; i < 4; i++){ wxString text = msg.Mid(i, 1); wxCoord w, h; @@ -134,3 +134,12 @@ DndShape::Draw(dc); // Draw the selected overlay if required. } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/senddtmf.h ============================================================================== --- sofaswitch/trunk/callflow/src/senddtmf.h (original) +++ sofaswitch/trunk/callflow/src/senddtmf.h Sun May 25 21:36:03 2008 @@ -32,3 +32,14 @@ #endif // SEND_DTMF_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/sendmessage.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/sendmessage.cpp (original) +++ sofaswitch/trunk/callflow/src/sendmessage.cpp Sun May 25 21:36:03 2008 @@ -56,38 +56,48 @@ bool DndShapeSendMessage::WriteSystemCode(wxTextFile & file) { - file.AddLine(" def Send_Message(self, sTuple): "); - file.AddLine(" a,b,c = sTuple "); - file.AddLine(" try: "); - file.AddLine(" mesg = eval(self.data[a][\"Send Message Code\"]) + \"\\0\" "); - file.AddLine(" self.transport.write(mesg) "); - file.AddLine(" except: "); - file.AddLine(" print \"Send Message command \", self.data[a][\"Send Message Code\"], \" could not be parsed\" "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(""); + file.AddLine(wxT(" def Send_Message(self, sTuple): ")); + file.AddLine(wxT(" a,b,c = sTuple ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" mesg = eval(self.data[a][\"Send Message Code\"]) + \"\\0\" ")); + file.AddLine(wxT(" self.transport.write(mesg) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"Send Message command \", self.data[a][\"Send Message Code\"], \" could not be parsed\" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + file.AddLine(wxT("")); return true; } bool DndShapeSendMessage::WriteThisShapeInfo(wxTextFile & file) { - file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str())); + file.AddLine(wxT(" \"") + GetKey() + wxT("\" : { ")); wxNode *inputNode = (wxNode *)GetInputPoints().GetFirst(); const wxString & inputLabel = ((LabelledPoint *)inputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Input\" : ")); - file.AddLine(wxString::Format(" %s, ", inputLabel.c_str())); + file.AddLine(wxT(" \"Input\" : ")); + file.AddLine(wxT(" ") + inputLabel + wxT(", ")); wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxT(" \"Output\" : ")); + file.AddLine(wxT(" ") + outputLabel + wxT(", ")); - file.AddLine(wxString::Format(" \"Send Message Code\" : ")); + file.AddLine(wxT(" \"Send Message Code\" : ")); wxString dest = ProtectString(displayData[1].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + file.AddLine(wxT(" \"") + dest + wxT("\", ")); - file.AddLine(wxString::Format(" },")); + file.AddLine(wxT(" },")); return true; } + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/sendmessage.h ============================================================================== --- sofaswitch/trunk/callflow/src/sendmessage.h (original) +++ sofaswitch/trunk/callflow/src/sendmessage.h Sun May 25 21:36:03 2008 @@ -34,3 +34,14 @@ #endif // SHAPE_SEND_MESSAGE_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/shapelist.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/shapelist.cpp (original) +++ sofaswitch/trunk/callflow/src/shapelist.cpp Sun May 25 21:36:03 2008 @@ -194,10 +194,10 @@ bool MyListShapesExtended::WriteGraphData(wxTextFile & file) { wxString graphName(file.GetName()); - int index = graphName.Find("."); + int index = graphName.Find(wxT(".")); if (index >= 0) graphName = graphName.Left(index); - graphName = graphName + ".graph"; + graphName = graphName + wxT(".graph"); graphFileName = graphName; wxTextFile graphFile(graphName); @@ -210,7 +210,7 @@ graphFile.Clear(); - graphFile.AddLine("{"); + graphFile.AddLine(wxT("{")); MyListShapes::iterator it = begin(); while (it != end()) { DndShape *thisShape = it->second; @@ -221,7 +221,7 @@ } it++; } - graphFile.AddLine("}"); + graphFile.AddLine(wxT("}")); graphFile.Write(); graphFile.Close(); @@ -246,7 +246,7 @@ it = begin(); while (it != end()) { DndShape *thisShape = it->second; - thisShape->SetCompileError("No Start Processing control element"); + thisShape->SetCompileError(wxT("No Start Processing control element")); it++; } return false; @@ -256,7 +256,7 @@ while (it != end()) { DndShape *thisShape = it->second; if (thisShape->GetKind() == DndShape::StartHere) - thisShape->SetCompileError("Duplicate Start Processing control element"); + thisShape->SetCompileError(wxT("Duplicate Start Processing control element")); it++; } } @@ -287,11 +287,11 @@ DndShape *thisShape = it->second; bool multipleOnOutput = thisShape->OutputOneToMany(); if (multipleOnOutput) - thisShape->SetCompileError("Ambiguous - output goes to two places"); + thisShape->SetCompileError(wxT("Ambiguous - output goes to two places")); bool thisLinked = thisShape->CheckOutputPointsLinked(); if (!thisLinked) - thisShape->SetCompileError("Not all output points are linked"); + thisShape->SetCompileError(wxT("Not all output points are linked")); pointsLinked = pointsLinked && thisLinked; it++; } @@ -331,318 +331,318 @@ file.Clear(); - file.AddLine("#!/usr/bin/python "); - file.AddLine(" "); - file.AddLine("import sys "); - file.AddLine("import os "); - file.AddLine("import time "); - file.AddLine("import socket "); - file.AddLine("import distutils "); - file.AddLine("import re "); - file.AddLine("from twisted.internet import reactor, protocol "); - file.AddLine("from optparse import OptionParser "); - file.AddLine(" "); - file.AddLine("usage = \"usage: %prog [-s|--server srv] [-o|--opts opt]\" "); - file.AddLine("parser = OptionParser(usage) "); - file.AddLine("parser.add_option(\"-s\", \"--server\", dest=\"sofaServer\","); - 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(" default=\"\") "); - file.AddLine("(options, args) = parser.parse_args() "); - file.AddLine(" "); - file.AddLine("sofaServer = options.sofaServer "); - file.AddLine("scriptArgs = options.scriptArgs "); - file.AddLine(" "); - file.AddLine(" "); - file.AddLine("class Controller(protocol.Protocol): "); - file.AddLine(" \"\"\" The class which holds all the information on how to manage each entity"); - file.AddLine(" on the flow chart, how to connect, and does the requisite calls to twisted "); - file.AddLine(" "); - file.AddLine(" \"\"\" "); - file.AddLine(" def __init__(self): "); - file.AddLine(" self.isMaster = True "); - file.AddLine(" self.graphSet = False "); - file.AddLine(" self.connectionIsMade = False "); - file.AddLine(" self.endProgramNow = False "); - file.AddLine(" self.generatedEvents = {} "); - file.AddLine(" self.pendingEvents = {} "); - file.AddLine(" self.currentHandlers= {} "); + file.AddLine(wxT("#!/usr/bin/python ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT("import sys ")); + file.AddLine(wxT("import os ")); + file.AddLine(wxT("import time ")); + file.AddLine(wxT("import socket ")); + file.AddLine(wxT("import distutils ")); + file.AddLine(wxT("import re ")); + file.AddLine(wxT("from twisted.internet import reactor, protocol ")); + file.AddLine(wxT("from optparse import OptionParser ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT("usage = \"usage: %prog [-s|--server srv] [-o|--opts opt]\" ")); + file.AddLine(wxT("parser = OptionParser(usage) ")); + file.AddLine(wxT("parser.add_option(\"-s\", \"--server\", dest=\"sofaServer\",")); + file.AddLine(wxT(" help=\"location of the sofa switch message server\", ")); + file.AddLine(wxT(" default=\"localhost\") ")); + file.AddLine(wxT("parser.add_option(\"-o\", \"--opts\", dest=\"scriptArgs\", ")); + file.AddLine(wxT(" help=\"text passed to the running Python code, as self.scriptArgs\",")); + file.AddLine(wxT(" default=\"\") ")); + file.AddLine(wxT("(options, args) = parser.parse_args() ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT("sofaServer = options.sofaServer ")); + file.AddLine(wxT("scriptArgs = options.scriptArgs ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT("class Controller(protocol.Protocol): ")); + file.AddLine(wxT(" \"\"\" The class which holds all the information on how to manage each entity")); + file.AddLine(wxT(" on the flow chart, how to connect, and does the requisite calls to twisted ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" def __init__(self): ")); + file.AddLine(wxT(" self.isMaster = True ")); + file.AddLine(wxT(" self.graphSet = False ")); + file.AddLine(wxT(" self.connectionIsMade = False ")); + file.AddLine(wxT(" self.endProgramNow = False ")); + file.AddLine(wxT(" self.generatedEvents = {} ")); + file.AddLine(wxT(" self.pendingEvents = {} ")); + file.AddLine(wxT(" self.currentHandlers= {} ")); char c= 34; - wxString tString = wxString::Format(" self.quote = \"\\%c\"", c); + wxString tString = wxString::Format(wxT(" self.quote = \"\\%c\""), c); file.AddLine(tString.c_str()); - file.AddLine(" "); - file.AddLine(" def setMaster(self, newIsMaster): "); - file.AddLine(" \"\"\"Set the flag to indicate if we have been spawned "); - file.AddLine(" as a child process, or if we are key launching "); - file.AddLine(" process that was invoked from the command line. "); - file.AddLine(" \"\"\" "); - 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(" were on the command line. This is a feature that enables"); - file.AddLine(" (for example) one command file to call different hosts."); - file.AddLine(" \"\"\" "); - file.AddLine(" self.scriptArgs = newScriptArgs "); - file.AddLine(" "); - file.AddLine(" def setUserData(self, newData): "); - file.AddLine(" \"\"\"transfer data process, which is required when we "); - file.AddLine(" create a child graph of a parent graph, when we have "); - file.AddLine(" spawned a new process. The variable self.parentId is "); - file.AddLine(" the id of the parent, or None, if there is no parent "); - file.AddLine(" The variable self.userData contains the data transferred, "); - file.AddLine(" or None, if there is no data data transferred. "); - file.AddLine(" \"\"\" "); - file.AddLine(" self.parentId, self.userData = newData "); - file.AddLine(" "); - file.AddLine(" def setGraphData(self, graphFile): "); - file.AddLine(" \"\"\"Read in the file which describes where the flow "); - file.AddLine(" of execution goes, and variables associated with "); - file.AddLine(" associated with each block on the flow chart. "); - file.AddLine(" \"\"\" "); - file.AddLine(" self.gd=open(graphFile, \"r\"); "); - file.AddLine(" self.gdc=self.gd.read() "); - file.AddLine(" try: "); - file.AddLine(" self.data = eval(self.gdc) "); - file.AddLine(" except: "); - file.AddLine(" print \"Failed to evaluate (as Python) the supplied graph file of \", graphFile"); - file.AddLine(" return "); - file.AddLine(" self.gd.close() "); - file.AddLine(" "); - file.AddLine(" self.firstNode = None "); - file.AddLine(" self.nextNode = None "); - file.AddLine(" for k,v in self.data.iteritems(): "); - file.AddLine(" if k[:16] == \"Start_Processing\": "); - file.AddLine(" self.firstNode = k "); - file.AddLine(" self.nextNode = k "); - file.AddLine(" break "); - file.AddLine(" self.timeout = reactor.callLater(0, self.startTimerExpired, \"graph\")"); - file.AddLine(" "); - file.AddLine(" def startTimerExpired(self, eventLabel): "); - file.AddLine(" \"\"\"Called during program initialisation. This provies a "); - file.AddLine(" way of ensuring execution only happens after two asynchronous"); - file.AddLine(" events (connected to server, flow chart initialised) "); - file.AddLine(" \"\"\" "); - file.AddLine(" if eventLabel == \"graph\": "); - file.AddLine(" self.graphSet = True "); - file.AddLine(" if eventLabel == \"connected\": "); - file.AddLine(" self.connectionIsMade = True "); - file.AddLine(" if self.graphSet and self.connectionIsMade: "); - file.AddLine(" #print \"start processing now \" "); - file.AddLine(" reactor.callLater(0, self.startWorkNow,\"\");"); - file.AddLine(" "); - file.AddLine(" def DeleteThisEvent(self, killEvent): "); - file.AddLine(" \"\"\" Remove a particular event from the pending and generated queue "); - file.AddLine(" This is required when we (for example) have to to stop a timer "); - file.AddLine(" \"\"\" "); - file.AddLine(" if self.pendingEvents.has_key(killEvent): "); - file.AddLine(" self.pendingEvents.pop(killEvent) "); - file.AddLine(" if self.generatedEvents.has_key(killEvent): "); - file.AddLine(" self.generatedEvents.pop(killEvent) "); - file.AddLine(" "); - file.AddLine(" def processQueue(self, unusedVariable): "); - file.AddLine(" \"\"\"This method is called after an event has been detected "); - file.AddLine(" as happening. It compares the generated events queue with the registered"); - file.AddLine(" handlers, and dispatches execution to the relevant handler "); - file.AddLine(" "); - file.AddLine(" Then, this method empties the generated events queue. These are events "); - file.AddLine(" for which there was no corresponding handler. We cannot have these "); - file.AddLine(" hanging around. It would give weird output if they were processed at "); - file.AddLine(" some later time when the program adds a handler for this case "); - file.AddLine(" \"\"\" "); - file.AddLine(" #print \"=======================================processQueue\" "); - file.AddLine(" #print \"current events \", self.generatedEvents "); - file.AddLine(" #print \"current handlers \", self.currentHandlers "); - file.AddLine(" #print \"pending events \", self.pendingEvents "); - file.AddLine(" for handler in self.currentHandlers.keys(): "); - file.AddLine(" hre = re.compile(handler) "); - file.AddLine(" for event in self.generatedEvents.keys(): "); - file.AddLine(" if len(hre.split(event)) > 1: "); - file.AddLine(" #found a match "); - file.AddLine(" eventNode = self.currentHandlers[handler] "); - file.AddLine(" eHandler = self.data[eventNode][\"Event Handler\"] "); - file.AddLine(" try: "); - file.AddLine(" eSource,eName,eData = self.generatedEvents.pop(event)"); - file.AddLine(" except: "); - file.AddLine(" print \"failed to read the generated events for \", event"); - file.AddLine(" eSource, eName, eData = \"failed\", \"to\", \"read\" "); - - file.AddLine(" pVbl = self.data[eventNode][\"Event Source\"] "); - file.AddLine(" pVbl += \" = \" + self.quote + eSource + self.quote "); - file.AddLine(" try: "); - file.AddLine(" exec(pVbl) "); - file.AddLine(" except: "); - file.AddLine(" print \"An internal error processing eSource\", pVbl"); - - file.AddLine(" pVbl = self.data[eventNode][\"Event Name\"] "); - file.AddLine(" pVbl += \" = \" + self.quote + eName + self.quote "); - file.AddLine(" try: "); - file.AddLine(" exec(pVbl) "); - file.AddLine(" except: "); - file.AddLine(" print \"An internal error processing eName\", pVbl "); - - file.AddLine(" pVbl = self.data[eventNode][\"Event Data\"] "); - file.AddLine(" pVbl += \" = \" + self.quote + eData + self.quote "); - file.AddLine(" try: "); - file.AddLine(" exec(pVbl) "); - file.AddLine(" except: "); - file.AddLine(" print \"An internal error processing eData\", pVbl "); - - - file.AddLine(" self.DoWork(eHandler) "); - file.AddLine(" self.generatedEvents.clear() "); - file.AddLine(" "); - file.AddLine(" def networkEventData(self, eName, dataTuple): "); - file.AddLine(" \"\"\"This node has received a message from some remote node. The "); - file.AddLine(" eventName is a concatanation of the sender name and the event. "); - file.AddLine(" Thus, an example eventName would be voip34REQUESTNEWID. "); - file.AddLine(" This example eventName indicates voip34 wants a new id from us "); - file.AddLine(" The data is additional information on this event. In this case, "); - file.AddLine(" the date field could be voip34 (the ID of the node node on voip)"); - file.AddLine(" A second possible set of parameters would be voip23DTMF and 9 "); - file.AddLine(" "); - file.AddLine(" This method places the event on the generated events list, and "); - file.AddLine(" places the data there also. "); - file.AddLine(" Then, this methods asks for processing to resume "); - file.AddLine(" "); - file.AddLine(" Note that the dataTuple consists of the "); - file.AddLine(" eSource, eName, eData where e implies event "); - file.AddLine(" "); - file.AddLine(" For a network event: "); - file.AddLine(" eSource is the sofaID of the node who sent the message "); - file.AddLine(" eName could be what it is - like FinishedFile "); - file.AddLine(" eData (often blank), is the data part of the network message"); - file.AddLine(" For a Timer event: "); - file.AddLine(" eSource ID of the graph entity where the event was generated"); - file.AddLine(" eName The name of the timer doing the timeout "); - file.AddLine(" eData The period of time waited for "); - file.AddLine(" \"\"\" "); - file.AddLine(" #print \"event data tuple is \", dataTuple "); - file.AddLine(" self.generatedEvents[eName] = dataTuple "); - file.AddLine(" reactor.callLater(0, self.processQueue, 0) "); - file.AddLine(" "); - file.AddLine(" def timerObjectExpired(self, timerData): "); - file.AddLine(" \"\"\"Some timer has expired. Move it from the pending list and place "); - file.AddLine(" it in the active list. Then activate processing so that things move "); - file.AddLine(" along "); - file.AddLine(" "); - file.AddLine(" Note that when the timer object was initiated, an entry was put in "); - file.AddLine(" self.pendingEvent list stating this event name. If the timer says "); - file.AddLine(" deleted (after starting it) the corresponding event in the pending "); - file.AddLine(" list will be absent "); - file.AddLine(" \"\"\" "); - file.AddLine(" #print \"Timer object expired, data is \", timerData "); - file.AddLine(" if self.pendingEvents.has_key(timerData): "); - file.AddLine(" #print \"Timer object expired, data is \", self.pendingEvents[timerData] "); - file.AddLine(" self.generatedEvents[timerData] = self.pendingEvents.pop(timerData)"); - file.AddLine(" #print \"Timer object expired, data is \", self.generatedEvents[timerData] "); - file.AddLine(" reactor.callLater(0, self.processQueue, 0) "); - file.AddLine(" "); - file.AddLine(" def startWorkNow(self, notUsed): "); - file.AddLine(" \"\"\" Initiate processing on the flow chart"); - file.AddLine(" \"\"\" "); - file.AddLine(" sTuple = \"(\" + self.quote + self.firstNode + self.quote + \", 0, \" +self.quote + \"Start_Processing\" + self.quote + \")\""); - file.AddLine(" self.DoWork(eval(sTuple)) "); - file.AddLine(" "); - file.AddLine(" def DoWork(self, sTuple): "); - file.AddLine(" \"\"\" Call one node in the flow chart, and do the "); - file.AddLine(" work of this node (in a separate method. This "); - file.AddLine(" is called when a)on startup or b)after an event "); - file.AddLine(" \"\"\" "); - file.AddLine(" a,b,c = sTuple "); - file.AddLine(" "); - file.AddLine(" self.keepGoing = True "); - file.AddLine(" "); - file.AddLine(" while self.keepGoing: "); - file.AddLine(" self.currentNode=a "); - file.AddLine(" command = \"self.\" + str(c) + \"(\" + str(sTuple) + \")\""); - file.AddLine(" try: "); - file.AddLine(" sTuple = eval(command) "); - file.AddLine(" except: "); - file.AddLine(" sTuple = None "); - file.AddLine(" if sTuple == None: "); - file.AddLine(" self.keepGoing = False "); - file.AddLine(" else: "); - file.AddLine(" a,b,c = sTuple "); - file.AddLine(" "); - file.AddLine(" def makeConnection(self, transport): "); - file.AddLine(" \"\"\" A twisted callback that connects to the remote server "); - file.AddLine(" The parameters of the connection (port & address) are set"); - file.AddLine(" elsewhere "); - file.AddLine(" \"\"\" "); - file.AddLine(" self.connected = 1 "); - file.AddLine(" self.transport = transport "); - file.AddLine(" self.connectionMade() "); - file.AddLine(" "); - file.AddLine(" def connectionMade(self): "); - file.AddLine(" \"\"\"A twisted callback that occurs after we have connected to the remote"); - file.AddLine(" sofa swerver. After connection, we send a qury to the sofa server to obtain"); - file.AddLine(" our sofa identity. "); - file.AddLine(" \"\"\" "); - file.AddLine(" self.myId = \"\" "); - file.AddLine(" self.countReceived = 0 "); - file.AddLine(" self.transport.write(\"?\\0\") "); - file.AddLine(" self.transport.write(\"whoami\\0\"); "); - file.AddLine(" self.colonChar = \':\' "); - file.AddLine(" "); - file.AddLine(" def connectionLost(self, reason): "); - file.AddLine(" \"\"\"A twisted callback to tell us the connection to the remote sofa server"); - file.AddLine(" has been lost. Currently, we do nothing with this information. It could be "); - file.AddLine(" used though to connect elsewhere. "); - file.AddLine(" \"\"\" "); - file.AddLine(" "); - file.AddLine(" def dataReceived(self, dataRx): "); - file.AddLine(" \"\"\"A twisted callback which happens each time we receive a message from the sofa "); - file.AddLine(" server. This message could be part of the initialisation process. In which case, "); - file.AddLine(" initialise, and activate the next step of initialise. Or, it is an ordinary "); - file.AddLine(" message that has to be processed "); - file.AddLine(" \"\"\" "); - file.AddLine(" #print \"Received the message \", data "); - file.AddLine(" while dataRx.find(\" \") >= 0: "); - file.AddLine(" dataRx = dataRx.replace(\" \", \" \") "); - file.AddLine(" ssdata = str(dataRx).split(\'\\0\') "); - file.AddLine(" for oneMessage in ssdata: "); - file.AddLine(" self.countReceived += 1 "); - file.AddLine(" if self.countReceived == 1: "); - file.AddLine(" self.myId = oneMessage; "); - file.AddLine(" self.timeout2 = reactor.callLater(0, self.startTimerExpired, \"connected\")"); - file.AddLine(" try: "); - file.AddLine(" self.tmsg= \"AdviseOnTermination \" + self.parentId + \"\\0\" "); - file.AddLine(" self.transport.write(self.tmsg) "); - file.AddLine(" except: "); - file.AddLine(" self.tmsg = None "); - file.AddLine(" else: "); - file.AddLine(" self.processReceivedMessage(oneMessage)"); - file.AddLine(" "); - file.AddLine(" def replyNow(self, unusedData): "); - file.AddLine(" \"\"\" Send a premade message to the remote sofa server. This method has to "); - file.AddLine(" send the message only - and not manipulate it in any way "); - file.AddLine(" \"\"\" "); - file.AddLine(" self.transport.write(self.tstring) "); - file.AddLine(" "); - file.AddLine(" def processReceivedMessage(self, thisMessage): "); - file.AddLine(" \"\"\"Handle an ordinary message from the remote sofa server. Break the message up"); - file.AddLine(" turn it into a MyEvent message, and added to the right "); - file.AddLine(" queue. On doing this, spark an event to drive queue processing. "); - file.AddLine(" Note that this method can deal with all network messages. "); - file.AddLine(" \"\"\" "); - file.AddLine(" thisMessage = thisMessage.strip() "); - file.AddLine(" idxc = thisMessage.find(\":\") "); - file.AddLine(" eventSource = thisMessage[0:idxc] "); - file.AddLine(" idxs = thisMessage.find(\" \") "); - file.AddLine(" if idxs < 0: "); - file.AddLine(" eventName = thisMessage[(idxc+1):] "); - file.AddLine(" eventData = \"\" "); - file.AddLine(" else: "); - file.AddLine(" eventName = thisMessage[(idxc+1):] "); - file.AddLine(" eventData = thisMessage[(idxs+1):] "); - file.AddLine(" eTuple = (eventSource, eventName, eventData) "); - file.AddLine(" self.networkEventData(eventSource+eventName, eTuple) "); - file.AddLine(" "); - file.AddLine(" "); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def setMaster(self, newIsMaster): ")); + file.AddLine(wxT(" \"\"\"Set the flag to indicate if we have been spawned ")); + file.AddLine(wxT(" as a child process, or if we are key launching ")); + file.AddLine(wxT(" process that was invoked from the command line. ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" self.isMaster = newIsMaster ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def setScriptArgs(self, newScriptArgs): ")); + file.AddLine(wxT(" \"\"\"Pass to the running Python code the arguements that")); + file.AddLine(wxT(" were on the command line. This is a feature that enables")); + file.AddLine(wxT(" (for example) one command file to call different hosts.")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" self.scriptArgs = newScriptArgs ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def setUserData(self, newData): ")); + file.AddLine(wxT(" \"\"\"transfer data process, which is required when we ")); + file.AddLine(wxT(" create a child graph of a parent graph, when we have ")); + file.AddLine(wxT(" spawned a new process. The variable self.parentId is ")); + file.AddLine(wxT(" the id of the parent, or None, if there is no parent ")); + file.AddLine(wxT(" The variable self.userData contains the data transferred, ")); + file.AddLine(wxT(" or None, if there is no data data transferred. ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" self.parentId, self.userData = newData ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def setGraphData(self, graphFile): ")); + file.AddLine(wxT(" \"\"\"Read in the file which describes where the flow ")); + file.AddLine(wxT(" of execution goes, and variables associated with ")); + file.AddLine(wxT(" associated with each block on the flow chart. ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" self.gd=open(graphFile, \"r\"); ")); + file.AddLine(wxT(" self.gdc=self.gd.read() ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" self.data = eval(self.gdc) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"Failed to evaluate (as Python) the supplied graph file of \", graphFile")); + file.AddLine(wxT(" return ")); + file.AddLine(wxT(" self.gd.close() ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" self.firstNode = None ")); + file.AddLine(wxT(" self.nextNode = None ")); + file.AddLine(wxT(" for k,v in self.data.iteritems(): ")); + file.AddLine(wxT(" if k[:16] == \"Start_Processing\": ")); + file.AddLine(wxT(" self.firstNode = k ")); + file.AddLine(wxT(" self.nextNode = k ")); + file.AddLine(wxT(" break ")); + file.AddLine(wxT(" self.timeout = reactor.callLater(0, self.startTimerExpired, \"graph\")")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def startTimerExpired(self, eventLabel): ")); + file.AddLine(wxT(" \"\"\"Called during program initialisation. This provies a ")); + file.AddLine(wxT(" way of ensuring execution only happens after two asynchronous")); + file.AddLine(wxT(" events (connected to server, flow chart initialised) ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" if eventLabel == \"graph\": ")); + file.AddLine(wxT(" self.graphSet = True ")); + file.AddLine(wxT(" if eventLabel == \"connected\": ")); + file.AddLine(wxT(" self.connectionIsMade = True ")); + file.AddLine(wxT(" if self.graphSet and self.connectionIsMade: ")); + file.AddLine(wxT(" #print \"start processing now \" ")); + file.AddLine(wxT(" reactor.callLater(0, self.startWorkNow,\"\");")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def DeleteThisEvent(self, killEvent): ")); + file.AddLine(wxT(" \"\"\" Remove a particular event from the pending and generated queue ")); + file.AddLine(wxT(" This is required when we (for example) have to to stop a timer ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" if self.pendingEvents.has_key(killEvent): ")); + file.AddLine(wxT(" self.pendingEvents.pop(killEvent) ")); + file.AddLine(wxT(" if self.generatedEvents.has_key(killEvent): ")); + file.AddLine(wxT(" self.generatedEvents.pop(killEvent) ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def processQueue(self, unusedVariable): ")); + file.AddLine(wxT(" \"\"\"This method is called after an event has been detected ")); + file.AddLine(wxT(" as happening. It compares the generated events queue with the registered")); + file.AddLine(wxT(" handlers, and dispatches execution to the relevant handler ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" Then, this method empties the generated events queue. These are events ")); + file.AddLine(wxT(" for which there was no corresponding handler. We cannot have these ")); + file.AddLine(wxT(" hanging around. It would give weird output if they were processed at ")); + file.AddLine(wxT(" some later time when the program adds a handler for this case ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" #print \"=======================================processQueue\" ")); + file.AddLine(wxT(" #print \"current events \", self.generatedEvents ")); + file.AddLine(wxT(" #print \"current handlers \", self.currentHandlers ")); + file.AddLine(wxT(" #print \"pending events \", self.pendingEvents ")); + file.AddLine(wxT(" for handler in self.currentHandlers.keys(): ")); + file.AddLine(wxT(" hre = re.compile(handler) ")); + file.AddLine(wxT(" for event in self.generatedEvents.keys(): ")); + file.AddLine(wxT(" if len(hre.split(event)) > 1: ")); + file.AddLine(wxT(" #found a match ")); + file.AddLine(wxT(" eventNode = self.currentHandlers[handler] ")); + file.AddLine(wxT(" eHandler = self.data[eventNode][\"Event Handler\"] ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" eSource,eName,eData = self.generatedEvents.pop(event)")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"failed to read the generated events for \", event")); + file.AddLine(wxT(" eSource, eName, eData = \"failed\", \"to\", \"read\" ")); + + file.AddLine(wxT(" pVbl = self.data[eventNode][\"Event Source\"] ")); + file.AddLine(wxT(" pVbl += \" = \" + self.quote + eSource + self.quote ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" exec(pVbl) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"An internal error processing eSource\", pVbl")); + + file.AddLine(wxT(" pVbl = self.data[eventNode][\"Event Name\"] ")); + file.AddLine(wxT(" pVbl += \" = \" + self.quote + eName + self.quote ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" exec(pVbl) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"An internal error processing eName\", pVbl ")); + + file.AddLine(wxT(" pVbl = self.data[eventNode][\"Event Data\"] ")); + file.AddLine(wxT(" pVbl += \" = \" + self.quote + eData + self.quote ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" exec(pVbl) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"An internal error processing eData\", pVbl ")); + + + file.AddLine(wxT(" self.DoWork(eHandler) ")); + file.AddLine(wxT(" self.generatedEvents.clear() ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def networkEventData(self, eName, dataTuple): ")); + file.AddLine(wxT(" \"\"\"This node has received a message from some remote node. The ")); + file.AddLine(wxT(" eventName is a concatanation of the sender name and the event. ")); + file.AddLine(wxT(" Thus, an example eventName would be voip34REQUESTNEWID. ")); + file.AddLine(wxT(" This example eventName indicates voip34 wants a new id from us ")); + file.AddLine(wxT(" The data is additional information on this event. In this case, ")); + file.AddLine(wxT(" the date field could be voip34 (the ID of the node node on voip)")); + file.AddLine(wxT(" A second possible set of parameters would be voip23DTMF and 9 ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" This method places the event on the generated events list, and ")); + file.AddLine(wxT(" places the data there also. ")); + file.AddLine(wxT(" Then, this methods asks for processing to resume ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" Note that the dataTuple consists of the ")); + file.AddLine(wxT(" eSource, eName, eData where e implies event ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" For a network event: ")); + file.AddLine(wxT(" eSource is the sofaID of the node who sent the message ")); + file.AddLine(wxT(" eName could be what it is - like FinishedFile ")); + file.AddLine(wxT(" eData (often blank), is the data part of the network message")); + file.AddLine(wxT(" For a Timer event: ")); + file.AddLine(wxT(" eSource ID of the graph entity where the event was generated")); + file.AddLine(wxT(" eName The name of the timer doing the timeout ")); + file.AddLine(wxT(" eData The period of time waited for ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" #print \"event data tuple is \", dataTuple ")); + file.AddLine(wxT(" self.generatedEvents[eName] = dataTuple ")); + file.AddLine(wxT(" reactor.callLater(0, self.processQueue, 0) ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def timerObjectExpired(self, timerData): ")); + file.AddLine(wxT(" \"\"\"Some timer has expired. Move it from the pending list and place ")); + file.AddLine(wxT(" it in the active list. Then activate processing so that things move ")); + file.AddLine(wxT(" along ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" Note that when the timer object was initiated, an entry was put in ")); + file.AddLine(wxT(" self.pendingEvent list stating this event name. If the timer says ")); + file.AddLine(wxT(" deleted (after starting it) the corresponding event in the pending ")); + file.AddLine(wxT(" list will be absent ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" #print \"Timer object expired, data is \", timerData ")); + file.AddLine(wxT(" if self.pendingEvents.has_key(timerData): ")); + file.AddLine(wxT(" #print \"Timer object expired, data is \", self.pendingEvents[timerData] ")); + file.AddLine(wxT(" self.generatedEvents[timerData] = self.pendingEvents.pop(timerData) ")); + file.AddLine(wxT(" #print \"Timer object expired, data is \", self.generatedEvents[timerData] ")); + file.AddLine(wxT(" reactor.callLater(0, self.processQueue, 0) ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def startWorkNow(self, notUsed): ")); + file.AddLine(wxT(" \"\"\" Initiate processing on the flow chart")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" sTuple = \"(\" + self.quote + self.firstNode + self.quote + \", 0, \" +self.quote + \"Start_Processing\" + self.quote + \")\"")); + file.AddLine(wxT(" self.DoWork(eval(sTuple)) ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def DoWork(self, sTuple): ")); + file.AddLine(wxT(" \"\"\" Call one node in the flow chart, and do the ")); + file.AddLine(wxT(" work of this node (in a separate method. This ")); + file.AddLine(wxT(" is called when a)on startup or b)after an event ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" a,b,c = sTuple ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" self.keepGoing = True ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" while self.keepGoing: ")); + file.AddLine(wxT(" self.currentNode=a ")); + file.AddLine(wxT(" command = \"self.\" + str(c) + \"(\" + str(sTuple) + \")\"")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" sTuple = eval(command) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" sTuple = None ")); + file.AddLine(wxT(" if sTuple == None: ")); + file.AddLine(wxT(" self.keepGoing = False ")); + file.AddLine(wxT(" else: ")); + file.AddLine(wxT(" a,b,c = sTuple ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def makeConnection(self, transport): ")); + file.AddLine(wxT(" \"\"\" A twisted callback that connects to the remote server ")); + file.AddLine(wxT(" The parameters of the connection (port & address) are set")); + file.AddLine(wxT(" elsewhere ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" self.connected = 1 ")); + file.AddLine(wxT(" self.transport = transport ")); + file.AddLine(wxT(" self.connectionMade() ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def connectionMade(self): ")); + file.AddLine(wxT(" \"\"\"A twisted callback that occurs after we have connected to the remote")); + file.AddLine(wxT(" sofa swerver. After connection, we send a qury to the sofa server to obtain")); + file.AddLine(wxT(" our sofa identity. ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" self.myId = \"\" ")); + file.AddLine(wxT(" self.countReceived = 0 ")); + file.AddLine(wxT(" self.transport.write(\"?\\0\") ")); + file.AddLine(wxT(" self.transport.write(\"whoami\\0\"); ")); + file.AddLine(wxT(" self.colonChar = \':\' ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def connectionLost(self, reason): ")); + file.AddLine(wxT(" \"\"\"A twisted callback to tell us the connection to the remote sofa server")); + file.AddLine(wxT(" has been lost. Currently, we do nothing with this information. It could be ")); + file.AddLine(wxT(" used though to connect elsewhere. ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def dataReceived(self, dataRx): ")); + file.AddLine(wxT(" \"\"\"A twisted callback which happens each time we receive a message from the sofa ")); + file.AddLine(wxT(" server. This message could be part of the initialisation process. In which case, ")); + file.AddLine(wxT(" initialise, and activate the next step of initialise. Or, it is an ordinary ")); + file.AddLine(wxT(" message that has to be processed ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" #print \"Received the message \", data ")); + file.AddLine(wxT(" while dataRx.find(\" \") >= 0: ")); + file.AddLine(wxT(" dataRx = dataRx.replace(\" \", \" \") ")); + file.AddLine(wxT(" ssdata = str(dataRx).split(\'\\0\') ")); + file.AddLine(wxT(" for oneMessage in ssdata: ")); + file.AddLine(wxT(" self.countReceived += 1 ")); + file.AddLine(wxT(" if self.countReceived == 1: ")); + file.AddLine(wxT(" self.myId = oneMessage; ")); + file.AddLine(wxT(" self.timeout2 = reactor.callLater(0, self.startTimerExpired, \"connected\")")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" self.tmsg= \"AdviseOnTermination \" + self.parentId + \"\\0\" ")); + file.AddLine(wxT(" self.transport.write(self.tmsg) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" self.tmsg = None ")); + file.AddLine(wxT(" else: ")); + file.AddLine(wxT(" self.processReceivedMessage(oneMessage)")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def replyNow(self, unusedData): ")); + file.AddLine(wxT(" \"\"\" Send a premade message to the remote sofa server. This method has to ")); + file.AddLine(wxT(" send the message only - and not manipulate it in any way ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" self.transport.write(self.tstring) ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def processReceivedMessage(self, thisMessage): ")); + file.AddLine(wxT(" \"\"\"Handle an ordinary message from the remote sofa server. Break the message up")); + file.AddLine(wxT(" turn it into a MyEvent message, and added to the right ")); + file.AddLine(wxT(" queue. On doing this, spark an event to drive queue processing. ")); + file.AddLine(wxT(" Note that this method can deal with all network messages. ")); + file.AddLine(wxT(" \"\"\" ")); + file.AddLine(wxT(" thisMessage = thisMessage.strip() ")); + file.AddLine(wxT(" idxc = thisMessage.find(\":\") ")); + file.AddLine(wxT(" eventSource = thisMessage[0:idxc] ")); + file.AddLine(wxT(" idxs = thisMessage.find(\" \") ")); + file.AddLine(wxT(" if idxs < 0: ")); + file.AddLine(wxT(" eventName = thisMessage[(idxc+1):] ")); + file.AddLine(wxT(" eventData = \"\" ")); + file.AddLine(wxT(" else: ")); + file.AddLine(wxT(" eventName = thisMessage[(idxc+1):] ")); + file.AddLine(wxT(" eventData = thisMessage[(idxs+1):] ")); + file.AddLine(wxT(" eTuple = (eventSource, eventName, eventData) ")); + file.AddLine(wxT(" self.networkEventData(eventSource+eventName, eTuple) ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" ")); for (int i = 0; i < DndShape::KnownShapes; i++) { DndShape *thisShape; if (i == DndShape::None) @@ -658,47 +658,56 @@ return false; } - file.AddLine(" "); - file.AddLine("class MyFactory(protocol.ClientFactory): "); - file.AddLine(" protocol = Controller "); - file.AddLine(" "); - file.AddLine(" def clientConnectionFailed(self, connector, reason): "); - file.AddLine(" self.zzzzzzz = reason "); - file.AddLine(" "); - file.AddLine(" def clientConnectionLost(self, connector, reason): "); - file.AddLine(" self.zzzzzzzz = reason "); - file.AddLine(" "); - file.AddLine(" def buildProtocol(self, addr): "); - file.AddLine(" p = self.protocol() "); - file.AddLine(" p.factory = self "); - file.AddLine(" self.myController = p "); - file.AddLine(" self.myController.setGraphData(self.myGraphName) "); - file.AddLine(" self.myController.setMaster(self.isMaster) "); - file.AddLine(" self.myController.setUserData(self.userData) "); - file.AddLine(" self.myController.setScriptArgs(self.scriptArgs) "); - file.AddLine(" return p "); - file.AddLine(" "); - file.AddLine(" def setGraph(self, newName): "); - file.AddLine(" self.myGraphName = newName "); - file.AddLine(" "); - file.AddLine(" def setMaster(self, newMaster): "); - file.AddLine(" self.isMaster = newMaster "); - file.AddLine(" "); - file.AddLine(" def setUserData(self, newData): "); - file.AddLine(" self.userData = newData "); - file.AddLine(" "); - file.AddLine(" def setScriptArgs(self, newData): "); - file.AddLine(" self.scriptArgs = newData "); - file.AddLine(" "); - file.AddLine(" "); - file.AddLine("f = MyFactory() "); - file.AddLine(wxString::Format("f.setGraph(\"%s\") ", graphFileName.c_str())); - file.AddLine(wxString::Format("f.setScriptArgs(scriptArgs)") ); - file.AddLine("f.setMaster(True) "); - file.AddLine("f.setUserData((None, None)) "); - file.AddLine("reactor.connectTCP(sofaServer, 5000, f) "); - file.AddLine("reactor.run() "); - file.AddLine(" "); + file.AddLine(wxT(" ")); + file.AddLine(wxT("class MyFactory(protocol.ClientFactory): ")); + file.AddLine(wxT(" protocol = Controller ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def clientConnectionFailed(self, connector, reason): ")); + file.AddLine(wxT(" self.zzzzzzz = reason ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def clientConnectionLost(self, connector, reason): ")); + file.AddLine(wxT(" self.zzzzzzzz = reason ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def buildProtocol(self, addr): ")); + file.AddLine(wxT(" p = self.protocol() ")); + file.AddLine(wxT(" p.factory = self ")); + file.AddLine(wxT(" self.myController = p ")); + file.AddLine(wxT(" self.myController.setGraphData(self.myGraphName) ")); + file.AddLine(wxT(" self.myController.setMaster(self.isMaster) ")); + file.AddLine(wxT(" self.myController.setUserData(self.userData) ")); + file.AddLine(wxT(" self.myController.setScriptArgs(self.scriptArgs) ")); + file.AddLine(wxT(" return p ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def setGraph(self, newName): ")); + file.AddLine(wxT(" self.myGraphName = newName ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def setMaster(self, newMaster): ")); + file.AddLine(wxT(" self.isMaster = newMaster ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def setUserData(self, newData): ")); + file.AddLine(wxT(" self.userData = newData ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" def setScriptArgs(self, newData): ")); + file.AddLine(wxT(" self.scriptArgs = newData ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT("f = MyFactory() ")); + file.AddLine(wxT("f.setGraph(\"") + graphFileName + wxT("\") ")); + file.AddLine(wxT("f.setScriptArgs(scriptArgs) ")); + file.AddLine(wxT("f.setMaster(True) ")); + file.AddLine(wxT("f.setUserData((None, None)) ")); + file.AddLine(wxT("reactor.connectTCP(sofaServer, 5000, f) ")); + file.AddLine(wxT("reactor.run() ")); + file.AddLine(wxT(" ")); file.Write(); return true; } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/shapelist.h ============================================================================== --- sofaswitch/trunk/callflow/src/shapelist.h (original) +++ sofaswitch/trunk/callflow/src/shapelist.h Sun May 25 21:36:03 2008 @@ -102,3 +102,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/shapeselect.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/shapeselect.cpp (original) +++ sofaswitch/trunk/callflow/src/shapeselect.cpp Sun May 25 21:36:03 2008 @@ -72,3 +72,12 @@ firstCorner = newPosition; DndShape::SetPosition(newPosition); } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/shapeselect.h ============================================================================== --- sofaswitch/trunk/callflow/src/shapeselect.h (original) +++ sofaswitch/trunk/callflow/src/shapeselect.h Sun May 25 21:36:03 2008 @@ -49,3 +49,14 @@ #endif // SHAPE_SELECT_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/startfor.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/startfor.cpp (original) +++ sofaswitch/trunk/callflow/src/startfor.cpp Sun May 25 21:36:03 2008 @@ -53,7 +53,7 @@ wxPoint bm(tm.x, m_rect.y + 35); wxPoint bm1(tm.x, m_rect.y + 50); - wxString text("For"); + wxString text(wxT("For")); dc.SetFont(*wxITALIC_FONT); wxCoord w, h; dc.GetTextExtent(text, &w, &h); @@ -76,60 +76,60 @@ bool DndShapeStartFor::WriteSystemCode(wxTextFile & file) { - file.AddLine(" def Start_For(self, aTuple): "); - file.AddLine(" a,b,c = aTuple "); - file.AddLine(" if b==0: "); - file.AddLine(" try: "); - file.AddLine(" exec(self.data[a][\"Initialise\"]) "); - file.AddLine(" except: "); - file.AddLine(" print \"The initialise statement of \", self.data[a][\"Initialise\"], \" was not valid Python\" "); - file.AddLine(" else: "); - file.AddLine(" try: "); - file.AddLine(" exec(self.data[a][\"Increment\"]) "); - file.AddLine(" except: "); - file.AddLine(" print \"The increment statement of \", self.data[a][\"Increment\"], \" was not valid Python\" "); - file.AddLine(" "); - file.AddLine(" try: "); - file.AddLine(" self.forCondition = eval(self.data[a][\"Test\"]) "); - file.AddLine(" except: "); - file.AddLine(" print \"The Test statement of \", self.data[a][\"Test\"], \" was not valid Python\" "); - file.AddLine(" self.forCondition = False "); - file.AddLine(" "); - file.AddLine(" if self.forCondition: "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(" "); - file.AddLine(" next = self.data[a][\"EndForLoop\"] "); - file.AddLine(" return self.data[next][\"AllDone\"] "); - file.AddLine(" "); + file.AddLine(wxT(" def Start_For(self, aTuple): ")); + file.AddLine(wxT(" a,b,c = aTuple ")); + file.AddLine(wxT(" if b==0: ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" exec(self.data[a][\"Initialise\"]) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"The initialise statement of \", self.data[a][\"Initialise\"], \" was not valid Python\" ")); + file.AddLine(wxT(" else: ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" exec(self.data[a][\"Increment\"]) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"The increment statement of \", self.data[a][\"Increment\"], \" was not valid Python\" ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" self.forCondition = eval(self.data[a][\"Test\"]) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"The Test statement of \", self.data[a][\"Test\"], \" was not valid Python\" ")); + file.AddLine(wxT(" self.forCondition = False ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" if self.forCondition: ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" next = self.data[a][\"EndForLoop\"] ")); + file.AddLine(wxT(" return self.data[next][\"AllDone\"] ")); + file.AddLine(wxT(" ")); return true; } bool DndShapeStartFor::WriteThisShapeInfo(wxTextFile & file) { - file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str())); + file.AddLine(wxT(" \"") + GetKey() + wxT("\" : { ")); - file.AddLine(wxString::Format(" \"Initialise\" : ")); - file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str())); + file.AddLine(wxT(" \"Initialise\" : ")); + file.AddLine(wxT(" \"") + displayData[1].data + wxT("\", ")); - file.AddLine(wxString::Format(" \"Test\" : ")); - file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str())); + file.AddLine(wxT(" \"Test\" : ")); + file.AddLine(wxT(" \"") + displayData[2].data + wxT("\", ")); - file.AddLine(wxString::Format(" \"Increment\" : ")); - file.AddLine(wxString::Format(" \"%s\", ", displayData[3].data.c_str())); + file.AddLine(wxT(" \"Increment\" : ")); + file.AddLine(wxT(" \"") + displayData[3].data + wxT("\", ")); wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxT(" \"Output\" : ")); + file.AddLine(wxT(" ") + outputLabel + wxT(", ")); /**This is the identity of the node at the bottom of the for loop. We have to jump to this node on failing the test.*/ - file.AddLine(wxString::Format(" \"EndForLoop\" : ")); - file.AddLine(wxString::Format(" \"%s\", ", endForLoop.c_str())); + file.AddLine(wxT(" \"EndForLoop\" : ")); + file.AddLine(wxT(" \"") + endForLoop + wxT("\", ")); - file.AddLine(wxString::Format(" },")); + file.AddLine(wxT(" },")); return true; } @@ -147,3 +147,12 @@ } return false; } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/startfor.h ============================================================================== --- sofaswitch/trunk/callflow/src/startfor.h (original) +++ sofaswitch/trunk/callflow/src/startfor.h Sun May 25 21:36:03 2008 @@ -47,3 +47,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/starthere.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/starthere.cpp (original) +++ sofaswitch/trunk/callflow/src/starthere.cpp Sun May 25 21:36:03 2008 @@ -49,24 +49,33 @@ bool DndShapeStartHere::WriteSystemCode(wxTextFile & file) { - file.AddLine(" def Start_Processing(self, aTuple): "); - file.AddLine(" id,y,z = aTuple"); - file.AddLine(" return self.data[id][\"Output\"]"); - file.AddLine(""); + file.AddLine(wxT(" def Start_Processing(self, aTuple): ")); + file.AddLine(wxT(" id,y,z = aTuple")); + file.AddLine(wxT(" return self.data[id][\"Output\"]")); + file.AddLine(wxT("")); return true; } bool DndShapeStartHere::WriteThisShapeInfo(wxTextFile & file) { - file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str())); + file.AddLine(wxT(" \"") + GetKey() + wxT("\" : { ")); wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxT(" \"Output\" : ")); + file.AddLine(wxT(" ") + outputLabel + wxT(", ")); - file.AddLine(wxString::Format(" },")); + file.AddLine(wxT(" },")); return true; } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/starthere.h ============================================================================== --- sofaswitch/trunk/callflow/src/starthere.h (original) +++ sofaswitch/trunk/callflow/src/starthere.h Sun May 25 21:36:03 2008 @@ -32,3 +32,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/stoptimer.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/stoptimer.cpp (original) +++ sofaswitch/trunk/callflow/src/stoptimer.cpp Sun May 25 21:36:03 2008 @@ -37,7 +37,7 @@ void DndShapeStopTimer::Draw(wxDC& dc) { - wxString text("Stop"); + wxString text(wxT("Stop")); dc.SetFont(*wxITALIC_FONT); wxCoord w, h; dc.GetTextExtent(text, &w, &h); @@ -70,40 +70,49 @@ bool DndShapeStopTimer::WriteSystemCode(wxTextFile & file) { - file.AddLine(" def Stop_Timer(self, sTuple): "); - file.AddLine(" a,b,c = sTuple "); - file.AddLine(" try: "); - file.AddLine(" killTimer = eval(self.data[a][\"Stop Timer label\"]) "); - file.AddLine(" except: "); - file.AddLine(" print \"The timer label of \", self.data[a][\"Stop Timer label\"], \" was unintelligible Python\" "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(" self.DeleteThisEvent(killTimer) "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(""); + file.AddLine(wxT(" def Stop_Timer(self, sTuple): ")); + file.AddLine(wxT(" a,b,c = sTuple ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" killTimer = eval(self.data[a][\"Stop Timer label\"]) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"The timer label of \", self.data[a][\"Stop Timer label\"], \" was unintelligible Python\" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + file.AddLine(wxT(" self.DeleteThisEvent(killTimer) ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + file.AddLine(wxT("")); return true; } bool DndShapeStopTimer::WriteThisShapeInfo(wxTextFile & file) { - file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str())); + file.AddLine(wxT(" \"") + GetKey() + wxT("\" : { ")); wxNode *inputNode = (wxNode *)GetInputPoints().GetFirst(); const wxString & inputLabel = ((LabelledPoint *)inputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Input\" : ")); - file.AddLine(wxString::Format(" %s, ", inputLabel.c_str())); + file.AddLine(wxT(" \"Input\" : ")); + file.AddLine(wxT(" ") + inputLabel + wxT(", ")); wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxT(" \"Output\" : ")); + file.AddLine(wxT(" ") + outputLabel + wxT(", ")); - file.AddLine(wxString::Format(" \"Stop Timer label\" : ")); + file.AddLine(wxT(" \"Stop Timer label\" : ")); wxString dest = ProtectString(displayData[1].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + file.AddLine(wxT(" \"") + dest + wxT("\", ")); - file.AddLine(wxString::Format(" },")); + file.AddLine(wxT(" },")); return true; } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/stoptimer.h ============================================================================== --- sofaswitch/trunk/callflow/src/stoptimer.h (original) +++ sofaswitch/trunk/callflow/src/stoptimer.h Sun May 25 21:36:03 2008 @@ -39,3 +39,14 @@ #endif //SHAPE_STOP_TIMER_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/timer.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/timer.cpp (original) +++ sofaswitch/trunk/callflow/src/timer.cpp Sun May 25 21:36:03 2008 @@ -95,94 +95,103 @@ bool DndShapeTimer::WriteSystemCode(wxTextFile & file) { - file.AddLine(" def Timer(self, sTuple): "); - file.AddLine(" #print \"Start of Timer on a tuple of \", sTuple "); - file.AddLine(" a,b,c = sTuple "); - file.AddLine(" try: "); - file.AddLine(" eName = eval(self.data[a][\"Timer label\"]) "); - file.AddLine(" except: "); - file.AddLine(" print \"The timer label of \", self.data[a][\"Timer label\"], \" was unintelligible Python\" "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(" if b == 1: "); - file.AddLine(" #print \"Rx Timeout, now goto handler of \", self.data[a][\"Timeout Handler\"] "); - file.AddLine(" #print \"Event data is \", self.data[a][\"Event Data\"] "); - file.AddLine(" #print \"Event name is \", self.data[a][\"Event Name\"] "); - file.AddLine(" #print \"Event source is \", self.data[a][\"Event Source\"] "); - file.AddLine(" return self.data[a][\"Timeout Handler\"] "); - file.AddLine(" pVbl = self.data[a][\"Event Data\"] + \" = None\" "); - file.AddLine(" exec(pVbl) "); - file.AddLine(" pVbl = self.data[a][\"Event Name\"] + \" = None\" "); - file.AddLine(" exec(pVbl) "); - file.AddLine(" pVbl = self.data[a][\"Event Source\"] + \" = None\" "); - file.AddLine(" exec(pVbl) "); - file.AddLine(" try: "); - file.AddLine(" tPeriod = eval (self.data[a][\"Timer period\"]) "); - file.AddLine(" except: "); - file.AddLine(" print \"The timer period of \", self.data[a][\"Timer period\"], \" was unintelligible\" "); - file.AddLine(" return self.data[a][\"Output\"] "); - - file.AddLine(" self.pendingEvents[eName] = (a, eName, str(tPeriod)) "); - file.AddLine(" self.currentHandlers[eName] = a "); - file.AddLine(" #print \"add an expire timer of \", tPeriod, \" seconds\" "); - file.AddLine(" reactor.callLater(tPeriod, self.timerObjectExpired, eName) "); - file.AddLine(" "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(""); + file.AddLine(wxT(" def Timer(self, sTuple): ")); + file.AddLine(wxT(" #print \"Start of Timer on a tuple of \", sTuple ")); + file.AddLine(wxT(" a,b,c = sTuple ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" eName = eval(self.data[a][\"Timer label\"]) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"The timer label of \", self.data[a][\"Timer label\"], \" was unintelligible Python\" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + file.AddLine(wxT(" if b == 1: ")); + file.AddLine(wxT(" #print \"Rx Timeout, now goto handler of \", self.data[a][\"Timeout Handler\"] ")); + file.AddLine(wxT(" #print \"Event data is \", self.data[a][\"Event Data\"] ")); + file.AddLine(wxT(" #print \"Event name is \", self.data[a][\"Event Name\"] ")); + file.AddLine(wxT(" #print \"Event source is \", self.data[a][\"Event Source\"] ")); + file.AddLine(wxT(" return self.data[a][\"Timeout Handler\"] ")); + file.AddLine(wxT(" pVbl = self.data[a][\"Event Data\"] + \" = None\" ")); + file.AddLine(wxT(" exec(pVbl) ")); + file.AddLine(wxT(" pVbl = self.data[a][\"Event Name\"] + \" = None\" ")); + file.AddLine(wxT(" exec(pVbl) ")); + file.AddLine(wxT(" pVbl = self.data[a][\"Event Source\"] + \" = None\" ")); + file.AddLine(wxT(" exec(pVbl) ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" tPeriod = eval (self.data[a][\"Timer period\"]) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"The timer period of \", self.data[a][\"Timer period\"], \" was unintelligible\" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + + file.AddLine(wxT(" self.pendingEvents[eName] = (a, eName, str(tPeriod)) ")); + file.AddLine(wxT(" self.currentHandlers[eName] = a ")); + file.AddLine(wxT(" #print \"add an expire timer of \", tPeriod, \" seconds\" ")); + file.AddLine(wxT(" reactor.callLater(tPeriod, self.timerObjectExpired, eName) ")); + file.AddLine(wxT(" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + file.AddLine(wxT("")); return true; } bool DndShapeTimer::WriteThisShapeInfo(wxTextFile & file) { - file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str())); + file.AddLine(wxT(" \"") + GetKey() + wxT("\" : { ")); wxNode *inputNode = (wxNode *)GetInputPoints().GetFirst(); const wxString & inputLabel = ((LabelledPoint *)inputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Input\" : ")); - file.AddLine(wxString::Format(" %s, ", inputLabel.c_str())); + file.AddLine(wxT(" \"Input\" : ")); + file.AddLine(wxT(" ") + inputLabel + wxT(", ")); wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxT(" \"Output\" : ")); + file.AddLine(wxT(" ") + outputLabel + wxT(", ")); - file.AddLine(wxString::Format(" \"Timer period\" : ")); + file.AddLine(wxT(" \"Timer period\" : ")); wxString dest = ProtectString(displayData[1].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + file.AddLine(wxT(" \"") + dest + wxT("\", ")); - file.AddLine(wxString::Format(" \"Timer label\" : ")); + file.AddLine(wxT(" \"Timer label\" : ")); dest = ProtectString(displayData[2].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + file.AddLine(wxT(" \"") + dest + wxT("\", ")); if (kind == Timer) { - file.AddLine(wxString::Format(" \"Event Name\" : ")); - file.AddLine(wxString::Format(" \"self.%s_Name\", ", GetKey().c_str())); + file.AddLine(wxT(" \"Event Name\" : ")); + file.AddLine(wxT(" \"self.") + GetKey() + wxT("_Name\", ")); - file.AddLine(wxString::Format(" \"Event Data\" : ")); - file.AddLine(wxString::Format(" \"self.%s_Data\", ", GetKey().c_str())); + file.AddLine(wxT(" \"Event Data\" : ")); + file.AddLine(wxT(" \"self.") + GetKey() + wxT("_Data\", ")); - file.AddLine(wxString::Format(" \"Event Source\" : ")); - file.AddLine(wxString::Format(" \"self.%s_Source\", ", GetKey().c_str())); + file.AddLine(wxT(" \"Event Source\" : ")); + file.AddLine(wxT(" \"self.") + GetKey() + wxT("_Source\", ")); } /*Output, have a timeout condition */ outputNode = outputNode->GetNext(); const wxString & outputLabel3 = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Timeout Handler\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel3.c_str())); + file.AddLine(wxT(" \"Timeout Handler\" : ")); + file.AddLine(wxT(" ") + outputLabel3 + wxT(", ")); /**We direct all events to ourselves. Out Function input handler has to determine if the incoming call is requesting a node, reporting a node supplied, or reporting a timeout event. All events that are generated are sent to Input 1 of this structrue. The processing detects events to input 1 and acts accordingly.*/ - file.AddLine(wxString::Format(" \"Event Handler\" : ")); + file.AddLine(wxT(" \"Event Handler\" : ")); wxString nameRequestNode = GetName(); - nameRequestNode.Replace(" ", "_", true); //Replace all spaces with underscores. - file.AddLine(wxString::Format(" (\"%s\", 1, \"%s\"), ", GetKey().c_str(), nameRequestNode.c_str())); + nameRequestNode.Replace(wxT(" "), wxT("_"), true); //Replace all spaces with underscores. + file.AddLine(wxT(" (\"") + GetKey() + wxT("\", 1, \"") + nameRequestNode + wxT("\"), ")); - file.AddLine(wxString::Format(" },")); + file.AddLine(wxT(" },")); return true; } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/timer.h ============================================================================== --- sofaswitch/trunk/callflow/src/timer.h (original) +++ sofaswitch/trunk/callflow/src/timer.h Sun May 25 21:36:03 2008 @@ -52,3 +52,14 @@ #endif //SHAPE_TIMER_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/transfermedia.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/transfermedia.cpp (original) +++ sofaswitch/trunk/callflow/src/transfermedia.cpp Sun May 25 21:36:03 2008 @@ -69,47 +69,47 @@ bool DndShapeTransferMedia::WriteSystemCode(wxTextFile & file) { - file.AddLine(" def Transfer_Media(self, sTuple): "); - file.AddLine(" a,b,c = sTuple "); - file.AddLine(" self.tMedia = self.data[a][\"worker node\"] "); - file.AddLine(" try: "); - file.AddLine(" self.rhost = eval(self.tMedia) "); - file.AddLine(" except: "); - file.AddLine(" print \"The Worker node Python \", self.tMedia, \" could not be evaluated\" "); - file.AddLine(" return self.data[a][\"Output\"] "); - - file.AddLine(" self.wNode = self.data[a][\"worker receiver\"] "); - file.AddLine(" try: "); - file.AddLine(" self.rhost += \":TRANSFERUDP \" + eval(self.wNode) + \"\\0\" "); - file.AddLine(" except: "); - file.AddLine(" print \"The node to transfer media to \", self.wNode, \" could not be evaluated\" "); - file.AddLine(" return self.data[a][\"Output\"] "); - - file.AddLine(" self.transport.write(self.rhost) "); - file.AddLine(" return self.data[a][\"Output\"] "); - file.AddLine(""); + file.AddLine(wxT(" def Transfer_Media(self, sTuple): ")); + file.AddLine(wxT(" a,b,c = sTuple ")); + file.AddLine(wxT(" self.tMedia = self.data[a][\"worker node\"] ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" self.rhost = eval(self.tMedia) ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"The Worker node Python \", self.tMedia, \" could not be evaluated\" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + + file.AddLine(wxT(" self.wNode = self.data[a][\"worker receiver\"] ")); + file.AddLine(wxT(" try: ")); + file.AddLine(wxT(" self.rhost += \":TRANSFERUDP \" + eval(self.wNode) + \"\\0\" ")); + file.AddLine(wxT(" except: ")); + file.AddLine(wxT(" print \"The node to transfer media to \", self.wNode, \" could not be evaluated\" ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + + file.AddLine(wxT(" self.transport.write(self.rhost) ")); + file.AddLine(wxT(" return self.data[a][\"Output\"] ")); + file.AddLine(wxT("")); return true; } bool DndShapeTransferMedia::WriteThisShapeInfo(wxTextFile & file) { - file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str())); + file.AddLine(wxT(" \"") + GetKey() + wxT("\" : { ")); wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst(); const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel(); - file.AddLine(wxString::Format(" \"Output\" : ")); - file.AddLine(wxString::Format(" %s, ", outputLabel.c_str())); + file.AddLine(wxT(" \"Output\" : ")); + file.AddLine(wxT(" ") + outputLabel + wxT(", ")); - file.AddLine(wxString::Format(" \"worker node\" : ")); + file.AddLine(wxT(" \"worker node\" : ")); wxString dest = ProtectString(displayData[1].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + file.AddLine(wxT(" \"") + dest +wxT("\", ")); - file.AddLine(wxString::Format(" \"worker receiver\" : ")); + file.AddLine(wxT(" \"worker receiver\" : ")); dest = ProtectString(displayData[2].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + file.AddLine(wxT(" \"") + dest + wxT("\", ")); - file.AddLine(wxString::Format(" },")); + file.AddLine(wxT(" },")); return true; } @@ -135,3 +135,12 @@ return true; } + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/transfermedia.h ============================================================================== --- sofaswitch/trunk/callflow/src/transfermedia.h (original) +++ sofaswitch/trunk/callflow/src/transfermedia.h Sun May 25 21:36:03 2008 @@ -38,3 +38,14 @@ #endif + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/writetofile.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/writetofile.cpp (original) +++ sofaswitch/trunk/callflow/src/writetofile.cpp Sun May 25 21:36:03 2008 @@ -35,3 +35,14 @@ AdjustIoPoints(); } + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/src/writetofile.h ============================================================================== --- sofaswitch/trunk/callflow/src/writetofile.h (original) +++ sofaswitch/trunk/callflow/src/writetofile.h Sun May 25 21:36:03 2008 @@ -23,3 +23,14 @@ #endif // WRITE_TO_FILE_H + + + +/* The comment below is magic for those who use emacs to edit this file. With + * the comment below, the tab key does auto indent to 4 spaces. + * + * Local Variables: + * mode:c + * c-basic-offset:4 + * End: + */ Modified: sofaswitch/trunk/callflow/tests/makevoipcall.src ============================================================================== --- sofaswitch/trunk/callflow/tests/makevoipcall.src (original) +++ sofaswitch/trunk/callflow/tests/makevoipcall.src Sun May 25 21:36:03 2008 @@ -1,3 +1,4 @@ -9<B>120<B>198<B>120,198,120,253,359,253<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>7<B>225<B>646<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special> <B><Shape>7<B>163<B>164<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node for termination (Python code)<ms>self.voipNode<ms><special> <B><Shape>12<B>224<B>689<B> extra <special>Tool Tip<ms>Timer which initates a shutdown, after some tidyup - messages etc have been sent.<ms><special>Timer period (seconds, Python code)<ms>1<ms><special>Timer label (Python code)<ms>"endeverything"<ms><special> <B><Shape>9<B>191<B>306<B>191,306,237,307<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>15<B>141<B>381<B> extra <special>Tool Tip<ms>Transfer Media between the voip and sound node<ms><special>First SofaSwitch worker (python)<ms>self.voipNode<ms><special>Second SofaSwitch worker (python)<ms>self.soundNode<ms><special> <B><Shape>14<B>153<B>429<B> extra <special>Tool Tip<ms>Wait for DTMF data<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>DTMF<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.dtmfData<ms><special> <B><Shape>9<B>206<B>141<B>206,141,272,141<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>15<B>226<B>601<B> extra <special>Tool Tip<ms>Make sound node -talk to itself.<ms><special>First SofaSwitch worker (python)<ms>"sound"<ms><special>Second SofaSwitch worker (python)<ms>"sound"<ms><special> <B><Shape>9<B>188<B>214<B>188,214,188,251,359,252<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>244<B>139<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>7<B>95<B>148<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node for termination (Python code)<ms>self.soundNode<ms><special> <B><Shape>11<B>89<B>96<B> extra <special>Tool Tip<ms>Request Node<ms><special>Request node from (Python code)<ms>"voip"<ms><special>Timer period (seconds)<ms>1<ms><special>Info to send to remote node (Python code)<ms><ms><special>Python variable: generated data<ms>self.voipNode<ms><special> <B><Shape>2<B>258<B>468<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>271<B>711<B>271,711,316,711<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>12<B>334<B>253<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds, Python code)<ms>0.2<ms><special>Timer label (Python code)<ms>"expire timer"<ms><special> <B><Shape>9<B>99<B>146<B>99,146,101,269,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>203<B>451<B>203,451,248,452<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>211<B>306<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>248<B>502<B>248,502,251,601<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>360<B>272<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>165<B>522<B>165,522,165,598,251,601<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>166<B>171<B>166,171,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>20<B>229<B>740<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>14<B>235<B>452<B> extra <special>Tool Tip<ms>Wait for voip call to end<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>Terminating<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>5<B>141<B>281<B> extra <special>Tool Tip<ms>TEST: have a sound and voip node.<ms><special>Test (Python code)<ms>(self.voipNode != None) and (self.soundNode != None)<ms><special> <B><Shape>20<B>336<B>305<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>2<B>169<B>538<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>1<B>89<B>43<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>9<B>139<B>116<B>139,116,181,121<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>166<B>479<B>166,479<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>291<B>710<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>5<B>140<B>472<B> extra <special>Tool Tip<ms>Test for dtmf data of "9"<ms><special>Test (Python code)<ms>self.dtmfData=="9"<ms><special> <B><Shape>19<B>168<B>499<B> extra <special>Tool Tip<ms>Send Dtmf to the voip node<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special>DTMF to send to worker node (python code)<ms>self.dtmfData<ms><special> <B><Shape>6<B>141<B>330<B> extra <special>Tool Tip<ms>Make Call to a remote entity<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special>Call destination (python code)<ms>self.scriptArgs<ms><special> <B><Shape>11<B>156<B>121<B> extra <special>Tool Tip<ms>Request Node<ms><special>Request node from (Python code)<ms>"sound"<ms><special>Timer period (seconds)<ms>1<ms><special>Info to send to remote node (Python code)<ms><ms><special>Python variable: generated data<ms>self.soundNode<ms><special> <B><Shape> +9<B>166<B>479<B>166,479<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>360<B>272<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>2<B>244<B>139<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>20<B>336<B>305<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>12<B>224<B>689<B> extra <special>Tool Tip<ms>Timer which initates a shutdown, after some tidyup + messages etc have been sent.<ms><special>Timer period (seconds, Python code)<ms>1<ms><special>Timer label (Python code)<ms>"endeverything"<ms><special> <B><Shape>9<B>191<B>306<B>191,306,237,307<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>20<B>229<B>740<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>2<B>169<B>538<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>19<B>168<B>499<B> extra <special>Tool Tip<ms>Send Dtmf to the voip node<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special>DTMF to send to worker node (python code)<ms>self.dtmfData<ms><special> <B><Shape>9<B>165<B>522<B>165,522,165,598,251,601<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>6<B>141<B>330<B> extra <special>Tool Tip<ms>Make Call to a remote entity specified on the +command line with -o remoteNode<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special>Call destination (python code)<ms>self.scriptArgs<ms><special> <B><Shape>1<B>89<B>43<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>9<B>166<B>171<B>166,171,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>5<B>141<B>281<B> extra <special>Tool Tip<ms>TEST: have a sound and voip node.<ms><special>Test (Python code)<ms>(self.voipNode != None) and (self.soundNode != None)<ms><special> <B><Shape>15<B>226<B>601<B> extra <special>Tool Tip<ms>Make sound node +talk to itself.<ms><special>First SofaSwitch worker (python)<ms>"sound"<ms><special>Second SofaSwitch worker (python)<ms>"sound"<ms><special> <B><Shape>14<B>153<B>429<B> extra <special>Tool Tip<ms>Wait for DTMF data<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>DTMF<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.dtmfData<ms><special> <B><Shape>7<B>95<B>148<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node for termination (Python code)<ms>self.soundNode<ms><special> <B><Shape>7<B>163<B>164<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node for termination (Python code)<ms>self.voipNode<ms><special> <B><Shape>9<B>99<B>146<B>99,146,101,269,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>206<B>141<B>206,141,272,141<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>188<B>214<B>188,214,188,251,359,252<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>258<B>468<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>120<B>198<B>120,198,120,253,359,253<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>11<B>89<B>96<B> extra <special>Tool Tip<ms>Request voip Node<ms><special>Request node from (Python code)<ms>"voip"<ms><special>Timer period (seconds)<ms>1<ms><special>Info to send to remote node (Python code)<ms><ms><special>Python variable: generated data<ms>self.voipNode<ms><special> <B><Shape>9<B>271<B>711<B>271,711,316,711<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>248<B>502<B>248,502,251,601<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>139<B>116<B>139,116,181,121<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>7<B>225<B>646<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special> <B><Shape>15<B>141<B>381<B> extra <special>Tool Tip<ms>Transfer Media between the voip and sound node<ms><special>First SofaSwitch worker (python)<ms>self.voipNode<ms><special>Second SofaSwitch worker (python)<ms>self.soundNode<ms><special> <B><Shape>2<B>291<B>710<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>14<B>235<B>452<B> extra <special>Tool Tip<ms>Wait for voip call to end<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>Terminating<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>2<B>211<B>306<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>12<B>334<B>253<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds, Python code)<ms>0.2<ms><special>Timer label (Python code)<ms>"expire timer"<ms><special> <B><Shape>9<B>203<B>451<B>203,451,248,452<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>5<B>140<B>472<B> extra <special>Tool Tip<ms>Test for dtmf data of "9"<ms><special>Test (Python code)<ms>self.dtmfData=="9"<ms><special> <B><Shape>11<B>156<B>121<B> extra <special>Tool Tip<ms>Request sond node<ms><special>Request node from (Python code)<ms>"sound"<ms><special>Timer period (seconds)<ms>1<ms><special>Info to send to remote node (Python code)<ms><ms><special>Python variable: generated data<ms>self.soundNode<ms><special> <B><Shape>
participants (1)
-
SofaSWITCH SVN