sofaswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- 390 discussions
19 Jun '08
Author: derek
Date: Wed Jun 18 23:46:07 2008
New Revision: 423
Modified:
sofaswitch/trunk/callflow/src/callflow.cpp
sofaswitch/trunk/callflow/src/callflow.h
sofaswitch/trunk/callflow/src/canvas.cpp
sofaswitch/trunk/callflow/src/canvas.h
Log:
Work hard to get keyboard events to be detected.
They refuse to be detected.ARRRGGGH.
Modified: sofaswitch/trunk/callflow/src/callflow.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.cpp (original)
+++ sofaswitch/trunk/callflow/src/callflow.cpp Wed Jun 18 23:46:07 2008
@@ -116,7 +116,8 @@
EVT_MENU ( wxH_FILESAVE__AS, MyFrame::OnFileSave__As)
EVT_MENU ( wxH_HELPABOUT, MyFrame::OnHelpAbout)
EVT_MENU ( wxH_HELPMANUAL, MyFrame::OnHelpManual)
- EVT_CHAR_HOOK(MyFrame::OnKeyDown)
+ EVT_CHAR_HOOK(MyFrame::OnAnyKeyDown)
+ EVT_KEY_DOWN(MyFrame::OnAnyKeyDown)
EVT_CLOSE(MyFrame::OnClose)
END_EVENT_TABLE()
@@ -142,6 +143,12 @@
MyFrame *frame = new MyFrame (wxT("Callflow"),
wxPoint(20,20), wxSize(600,450));
+ frame->PushEventHandler(new FrameKeyEvtHandler(*frame));
+
+ frame->Connect(wxID_ANY,
+ wxEVT_KEY_DOWN,
+ wxKeyEventHandler(MyFrame::OnKeyDown),
+ NULL, this);
frame->Show (TRUE);
::wxInitAllImageHandlers();
@@ -229,9 +236,9 @@
SetSize(1100, 700);
}
-void MyFrame::OnKeyDown(wxKeyEvent & event)
+void MyFrame::OnAnyKeyDown(wxKeyEvent & event)
{
- canvas->HandleKeyDown(event);
+ canvas->OnKeyDown(event);
}
void MyFrame::OnClose (wxCloseEvent& event)
@@ -701,6 +708,24 @@
}
+/////////////////////////////////////////////////////////////////////////////
+
+FrameKeyEvtHandler::FrameKeyEvtHandler(MyFrame &_myFrame)
+: myFrame(_myFrame)
+{
+}
+
+void FrameKeyEvtHandler::OnKeyDown(wxKeyEvent & event)
+{
+ myFrame.OnKeyDown(event);
+}
+
+BEGIN_EVENT_TABLE(FrameKeyEvtHandler, wxEvtHandler)
+EVT_KEY_DOWN(FrameKeyEvtHandler::OnKeyDown)
+END_EVENT_TABLE();
+
+
+
/* 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.
*
Modified: sofaswitch/trunk/callflow/src/callflow.h
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.h (original)
+++ sofaswitch/trunk/callflow/src/callflow.h Wed Jun 18 23:46:07 2008
@@ -83,11 +83,14 @@
/**Destructor */
~MyFrame ();
- protected:
/**Process event - character read from the keyboard when the key
is pressed */
- void OnKeyDown(wxKeyEvent & event);
+ void OnKeyDown(wxKeyEvent & event) { OnAnyKeyDown(event); }
+ protected:
+ /**Process event - character read from the keyboard when the key
+ is pressed */
+ void OnAnyKeyDown(wxKeyEvent & event);
public:
/**Called in response to a shutdown command issued from somewhere */
@@ -315,6 +318,33 @@
};
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+class FrameKeyEvtHandler : public wxEvtHandler
+{
+public:
+ /**Constructor */
+ FrameKeyEvtHandler(MyFrame & _myFrame);
+
+ /**Destructor */
+ ~FrameKeyEvtHandler() { }
+
+ /**The key down event goes here */
+ void OnKeyDown(wxKeyEvent & event);
+
+private:
+ /**Reference back to the class that has to collect the event */
+ MyFrame & myFrame;
+
+ /**Make WxWidgets happy, use this macro, which means we collect
+ key events in this class */
+ DECLARE_EVENT_TABLE()
+};
+
+
+
#endif
Modified: sofaswitch/trunk/callflow/src/canvas.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/canvas.cpp (original)
+++ sofaswitch/trunk/callflow/src/canvas.cpp Wed Jun 18 23:46:07 2008
@@ -39,6 +39,7 @@
EVT_ENTER_WINDOW (MyCanvas::OnMouseEnter)
EVT_LEAVE_WINDOW (MyCanvas::OnMouseLeave)
EVT_CHAR_HOOK (MyCanvas::OnKeyDown)
+ EVT_KEY_DOWN (MyCanvas::OnKeyDown)
EVT_TIMER (TimerId, MyCanvas::OnProgressTimer)
END_EVENT_TABLE ()
@@ -52,6 +53,10 @@
timerActivity = new wxTimer (this, TimerId);
timerActivity->Start (500);
+ Connect(wxID_ANY,
+ wxEVT_KEY_DOWN,
+ wxKeyEventHandler(MyCanvas::OnKeyDown),
+ NULL, this);
}
@@ -651,7 +656,7 @@
void KeyEvtHandler::OnKeyDown(wxKeyEvent & event)
{
- myCanvas.HandleKeyDown(event);
+ myCanvas.OnKeyDown(event);
}
BEGIN_EVENT_TABLE(KeyEvtHandler, wxEvtHandler)
Modified: sofaswitch/trunk/callflow/src/canvas.h
==============================================================================
--- sofaswitch/trunk/callflow/src/canvas.h (original)
+++ sofaswitch/trunk/callflow/src/canvas.h Wed Jun 18 23:46:07 2008
@@ -25,10 +25,9 @@
/**Destroy this canvas, which is called by the system on close down */
~MyCanvas ();
-
- /**Alllow the onKeyDown method to be called... */
- void HandleKeyDown(wxKeyEvent & event)
- { OnKeyDown(event); }
+ /**Process event - character read from the keyboard when the key
+ is pressed */
+ void OnKeyDown(wxKeyEvent & event);
/**Process event - left mouse button has been pressed */
void OnLeftDown (wxMouseEvent & event);
@@ -128,9 +127,6 @@
DECLARE_EVENT_TABLE();
protected:
- /**Process event - character read from the keyboard when the key
- is pressed */
- void OnKeyDown(wxKeyEvent & event);
/**Given a mouse event at some location, what is the correct (in
this canvas view point) location of this event? This method
@@ -211,10 +207,6 @@
-
-
-
-
#endif
1
0
16 Jun '08
Author: derek
Date: Mon Jun 16 01:10:08 2008
New Revision: 422
Modified:
sofaswitch/trunk/callflow/src/callflow.cpp
sofaswitch/trunk/callflow/src/callflow.h
sofaswitch/trunk/callflow/src/canvas.cpp
sofaswitch/trunk/callflow/src/canvas.h
Log:
Another attempt to make event handling of key clicks work.
Modified: sofaswitch/trunk/callflow/src/callflow.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.cpp (original)
+++ sofaswitch/trunk/callflow/src/callflow.cpp Mon Jun 16 01:10:08 2008
@@ -167,7 +167,8 @@
{
// create a child control here
canvas = new MyCanvas(this);
-
+ canvas->PushEventHandler(new KeyEvtHandler(*canvas));
+
// menu setup goes here
tbarVertical = NULL;
wxMenu * Edit_menu = new wxMenu ;
@@ -230,7 +231,7 @@
void MyFrame::OnKeyDown(wxKeyEvent & event)
{
- canvas->OnKeyDown(event);
+ canvas->HandleKeyDown(event);
}
void MyFrame::OnClose (wxCloseEvent& event)
Modified: sofaswitch/trunk/callflow/src/callflow.h
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.h (original)
+++ sofaswitch/trunk/callflow/src/callflow.h Mon Jun 16 01:10:08 2008
@@ -83,10 +83,13 @@
/**Destructor */
~MyFrame ();
+ protected:
/**Process event - character read from the keyboard when the key
is pressed */
void OnKeyDown(wxKeyEvent & event);
-
+
+ public:
+
/**Called in response to a shutdown command issued from somewhere */
void OnClose (wxCloseEvent& event);
Modified: sofaswitch/trunk/callflow/src/canvas.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/canvas.cpp (original)
+++ sofaswitch/trunk/callflow/src/canvas.cpp Mon Jun 16 01:10:08 2008
@@ -642,6 +642,23 @@
}
+/////////////////////////////////////////////////////////////////////////////
+
+KeyEvtHandler::KeyEvtHandler(MyCanvas &_myCanvas)
+: myCanvas(_myCanvas)
+{
+}
+
+void KeyEvtHandler::OnKeyDown(wxKeyEvent & event)
+{
+ myCanvas.HandleKeyDown(event);
+}
+
+BEGIN_EVENT_TABLE(KeyEvtHandler, wxEvtHandler)
+EVT_KEY_DOWN(KeyEvtHandler::OnKeyDown)
+END_EVENT_TABLE();
+
+
/* 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.
Modified: sofaswitch/trunk/callflow/src/canvas.h
==============================================================================
--- sofaswitch/trunk/callflow/src/canvas.h (original)
+++ sofaswitch/trunk/callflow/src/canvas.h Mon Jun 16 01:10:08 2008
@@ -25,9 +25,10 @@
/**Destroy this canvas, which is called by the system on close down */
~MyCanvas ();
- /**Process event - character read from the keyboard when the key
- is pressed */
- void OnKeyDown(wxKeyEvent & event);
+
+ /**Alllow the onKeyDown method to be called... */
+ void HandleKeyDown(wxKeyEvent & event)
+ { OnKeyDown(event); }
/**Process event - left mouse button has been pressed */
void OnLeftDown (wxMouseEvent & event);
@@ -124,9 +125,13 @@
bool Compile(wxTextFile & file)
{ return activeShapes.Compile(file); }
- DECLARE_EVENT_TABLE()
+ DECLARE_EVENT_TABLE();
protected:
+ /**Process event - character read from the keyboard when the key
+ is pressed */
+ void OnKeyDown(wxKeyEvent & event);
+
/**Given a mouse event at some location, what is the correct (in
this canvas view point) location of this event? This method
returns the value sought. */
@@ -182,6 +187,34 @@
/**The mouse position at which we were told the mouse last moved */
wxPoint lastMouseMovePoint;
};
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+class KeyEvtHandler : public wxEvtHandler
+{
+public:
+ /**Constructor */
+ KeyEvtHandler(MyCanvas & _myCanvas);
+
+ /**The key down event goes here */
+ void OnKeyDown(wxKeyEvent & event);
+
+private:
+ /**Reference back to the class that has to collect the event */
+ MyCanvas & myCanvas;
+
+ /**Make WxWidgets happy, use this macro, which means we collect
+ key events in this class */
+ DECLARE_EVENT_TABLE()
+};
+
+
+
+
+
+
+
#endif
1
0
15 Jun '08
Author: derek
Date: Sun Jun 15 19:28:22 2008
New Revision: 421
Modified:
sofaswitch/trunk/callflow/src/callflow.cpp
sofaswitch/trunk/callflow/src/callflow.h
sofaswitch/trunk/callflow/src/canvas.cpp
sofaswitch/trunk/callflow/src/canvas.h
Log:
Try (unsuccessfully) to get the editor to respond to keypresses. This USED to work.
Now, the thing is a bit broken. Sigh
Modified: sofaswitch/trunk/callflow/src/callflow.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.cpp (original)
+++ sofaswitch/trunk/callflow/src/callflow.cpp Sun Jun 15 19:28:22 2008
@@ -116,6 +116,7 @@
EVT_MENU ( wxH_FILESAVE__AS, MyFrame::OnFileSave__As)
EVT_MENU ( wxH_HELPABOUT, MyFrame::OnHelpAbout)
EVT_MENU ( wxH_HELPMANUAL, MyFrame::OnHelpManual)
+ EVT_CHAR_HOOK(MyFrame::OnKeyDown)
EVT_CLOSE(MyFrame::OnClose)
END_EVENT_TABLE()
@@ -227,7 +228,10 @@
SetSize(1100, 700);
}
-
+void MyFrame::OnKeyDown(wxKeyEvent & event)
+{
+ canvas->OnKeyDown(event);
+}
void MyFrame::OnClose (wxCloseEvent& event)
{
Modified: sofaswitch/trunk/callflow/src/callflow.h
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.h (original)
+++ sofaswitch/trunk/callflow/src/callflow.h Sun Jun 15 19:28:22 2008
@@ -82,6 +82,10 @@
/**Destructor */
~MyFrame ();
+
+ /**Process event - character read from the keyboard when the key
+ is pressed */
+ void OnKeyDown(wxKeyEvent & event);
/**Called in response to a shutdown command issued from somewhere */
void OnClose (wxCloseEvent& event);
Modified: sofaswitch/trunk/callflow/src/canvas.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/canvas.cpp (original)
+++ sofaswitch/trunk/callflow/src/canvas.cpp Sun Jun 15 19:28:22 2008
@@ -38,7 +38,7 @@
EVT_PAINT (MyCanvas::OnPaint)
EVT_ENTER_WINDOW (MyCanvas::OnMouseEnter)
EVT_LEAVE_WINDOW (MyCanvas::OnMouseLeave)
- EVT_CHAR (MyCanvas::OnChar)
+ EVT_CHAR_HOOK (MyCanvas::OnKeyDown)
EVT_TIMER (TimerId, MyCanvas::OnProgressTimer)
END_EVENT_TABLE ()
@@ -429,12 +429,13 @@
}
void
-MyCanvas::OnChar (wxKeyEvent & event)
+MyCanvas::OnKeyDown (wxKeyEvent & event)
{
wxString key;
bool changedScreen = false;
- long keycode = event.GetKeyCode ();
+ long keycode = event.GetKeyCode();
+ std::cerr << " have a key, " << keycode << std::endl;
if (keycode == WXK_DELETE)
{
RemoveSelectedShapes ();
Modified: sofaswitch/trunk/callflow/src/canvas.h
==============================================================================
--- sofaswitch/trunk/callflow/src/canvas.h (original)
+++ sofaswitch/trunk/callflow/src/canvas.h Sun Jun 15 19:28:22 2008
@@ -25,8 +25,9 @@
/**Destroy this canvas, which is called by the system on close down */
~MyCanvas ();
- /**Process event - character read from the keyboard */
- void OnChar(wxKeyEvent& event);
+ /**Process event - character read from the keyboard when the key
+ is pressed */
+ void OnKeyDown(wxKeyEvent & event);
/**Process event - left mouse button has been pressed */
void OnLeftDown (wxMouseEvent & event);
1
0
Author: derek
Date: Thu Jun 12 23:12:30 2008
New Revision: 420
Modified:
sofaswitch/trunk/server/client.py
Log:
tidy up the command line handler to do things like up-arrow correctly,
and to have a prompt symbol.
Modified: sofaswitch/trunk/server/client.py
==============================================================================
--- sofaswitch/trunk/server/client.py (original)
+++ sofaswitch/trunk/server/client.py Thu Jun 12 23:12:30 2008
@@ -6,7 +6,7 @@
# See the description in server.py on how you use this program.
#
-import socket, os, sys, thread
+import readline, socket, os, sys, thread
if len(sys.argv) < 3:
print "Syntax: client.py myId destination_host"
@@ -35,7 +35,7 @@
thread.start_new(report_incoming,())
while True:
- value = sys.stdin.readline()
+ value = raw_input("> ")
value = value.strip()
if value == 'end':
sys.exit()
1
0
[Sofaswitch-svn] [commit] r419 - in sofaswitch/trunk/sofa: include/sofa src
by SofaSWITCH SVN 13 Jun '08
by SofaSWITCH SVN 13 Jun '08
13 Jun '08
Author: derek
Date: Thu Jun 12 23:11:52 2008
New Revision: 419
Modified:
sofaswitch/trunk/sofa/include/sofa/messages.h
sofaswitch/trunk/sofa/src/messages.cxx
Log:
Add handling of the messageframe so that descendants can work out
when they have started running.
Tidy up the dumpmem command, to have less allocs in it.
Modified: sofaswitch/trunk/sofa/include/sofa/messages.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messages.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messages.h Thu Jun 12 23:11:52 2008
@@ -128,6 +128,10 @@
process of closing down */
bool IsTerminating() { return !keepGoing; }
+ /**report to the descendant class that all initialisation has
+ finished, and that this class is operational and running */
+ virtual void OnRunning() { };
+
protected:
/**Called when this thread finishes. An application would call
@@ -236,9 +240,10 @@
virtual void ProcessSetReadFile(PStringArray &cmds, const PString & sender);
#ifdef PMEMORY_CHECK
- /**we have received a command asking us to write all current allocations to the specified
- file. This command checks the the file is specified in the command line.
- If specified, all objects are dumped to that file.*/
+ /**we have received a command asking us to write all current
+ allocations to the specified file. This command checks the the
+ file is specified in the command line. If specified, all
+ objects are dumped to that file.*/
virtual void ProcessMemoryDump(PStringArray &cmds, PString & sender);
#endif
@@ -338,6 +343,12 @@
to. */
PString mediaPartner;
+#ifdef PMEMORY_CHECK
+ /**The state of the memory at which we last did a dump. This
+ variable is updated each time we do a memory dump */
+ static PMemoryHeap::State memoryState;
+#endif
+
private:
/**Close the messages socket, and send a terminating message to
the remote controller. Only this class can close this
@@ -373,12 +384,6 @@
/**Flag to indicate it is time to end this thread. It is only set by
the MessageFrame::Terminate() method */
bool keepGoing;
-
-#ifdef PMEMORY_CHECK
- /**The state of the memory at which we last did a dump. This variable is updated
- each time we do a memory dump */
- static PMemoryHeap::State memoryState;
-#endif
};
////////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Thu Jun 12 23:11:52 2008
@@ -312,6 +312,8 @@
Initialise();
PTRACE(3, "Initialise all done ");
+ OnRunning(); //Callback to the descendant class that we are running fine.
+
if (!keepGoing) {
PTRACE(3, "END fail warning of message frame thread for " << ourId);
}
@@ -329,8 +331,6 @@
<< messagesSocket.GetErrorText());
PTRACE(3, "End Process Incoming Messages as we had a read error.");
keepGoing = false;
- SilentlyEndAll();
- CloseMessagesSocket();
}
}
@@ -800,37 +800,8 @@
#ifdef PMEMORY_CHECK
void MessageFrame::ProcessMemoryDump(PStringArray &cmds, PString & sender)
{
- if (cmds.GetSize() != 2) {
- PStringStream error;
- error << cmds[0] << " Failed - Output file not specified";
- PTRACE(3, error << sender);
- SendThisMessageTo(error, sender);
- return;
- }
-
- PTRACE(3, "Dump current memory usage to \"" << cmds[1] << "\"");
+ PMemoryHeap::DumpObjectsSince(memoryState);
- PTextFile outputFile;
- if (!outputFile.Open(cmds[1], PFile::WriteOnly,
- PFile::Create + PFile::Truncate)) {
- PStringStream error;
- error << "Failed to open the specified file "
- << cmds[1]
- << " to dump memory to";
- SendThisMessageTo(error, sender);
- PTRACE(3, error);
- return;
- }
- PStringStream status;
- status << "Dump memory usage info to the file " << cmds[1];
- cerr << status << endl;
- SendThisMessageTo(status, sender);
- PMemoryHeap::DumpStatistics();
-
- PStringStream result;
- PMemoryHeap::DumpObjectsSince(memoryState, result);
- outputFile.WriteLine(result);
- outputFile.Close();
PMemoryHeap::GetState(memoryState);
return;
}
1
0
Author: derek
Date: Thu Jun 12 23:10:18 2008
New Revision: 418
Modified:
sofaswitch/trunk/voip/Makefile
sofaswitch/trunk/voip/comms.cxx
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/main.cxx
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/supervisor.cxx
sofaswitch/trunk/voip/supervisor.h
sofaswitch/trunk/voip/udpconnection.cxx
sofaswitch/trunk/voip/udpep.cxx
sofaswitch/trunk/voip/udpsound.cxx
Log:
Tidy up the handling of memory leak checking,
add some callbacks to find when the supervisor has started.
Modified: sofaswitch/trunk/voip/Makefile
==============================================================================
--- sofaswitch/trunk/voip/Makefile (original)
+++ sofaswitch/trunk/voip/Makefile Thu Jun 12 23:10:18 2008
@@ -51,7 +51,6 @@
##################################################
-
ifndef OPALDIR
ifneq (,$(wildcard $(HOME)/opal))
OPALDIR=$(HOME)/opal
Modified: sofaswitch/trunk/voip/comms.cxx
==============================================================================
--- sofaswitch/trunk/voip/comms.cxx (original)
+++ sofaswitch/trunk/voip/comms.cxx Thu Jun 12 23:10:18 2008
@@ -39,7 +39,6 @@
#define new PNEW
-
////////////////////////////////////////////////////////////////////////////////
Comms::Comms(LaunchNewId & _lid, MyManager & _manager)
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Thu Jun 12 23:10:18 2008
@@ -49,7 +49,6 @@
#define new PNEW
-
/////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
Modified: sofaswitch/trunk/voip/main.cxx
==============================================================================
--- sofaswitch/trunk/voip/main.cxx (original)
+++ sofaswitch/trunk/voip/main.cxx Thu Jun 12 23:10:18 2008
@@ -65,7 +65,6 @@
#define new PNEW
-
PCREATE_PROCESS(VoipProcess);
@@ -80,7 +79,6 @@
void VoipProcess::Main()
{
- void mtrace(void);
cout << GetName()
<< " Version " << GetVersion(true)
<< " by " << GetManufacturer()
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Thu Jun 12 23:10:18 2008
@@ -78,6 +78,7 @@
#include "udpconnection.h"
#define new PNEW
+
///////////////////////////////////////////////////////////////
MyManager::MyManager(LaunchNewId & _lid,
@@ -536,8 +537,13 @@
}
PSortedStringList currentNames;
- for (PSafePtr<OpalCall>call = activeCalls; call != NULL; ++call)
- currentNames.AppendString((PSafePtrCast<OpalCall, MyOpalCall>(call))->GetOurId());
+ for (PSafePtr<OpalCall>call = activeCalls; call != NULL; ++call) {
+ MyOpalCall *c = PSafePtrCast<OpalCall, MyOpalCall>(call);
+ if (c != NULL)
+ currentNames.AppendString(c->GetOurId());
+ else
+ currentNames.AppendString("No name - weird");
+ }
if (currentNames.GetSize() > 0) {
status << "Current active calls " << endl;
Modified: sofaswitch/trunk/voip/supervisor.cxx
==============================================================================
--- sofaswitch/trunk/voip/supervisor.cxx (original)
+++ sofaswitch/trunk/voip/supervisor.cxx Thu Jun 12 23:10:18 2008
@@ -43,7 +43,6 @@
#define new PNEW
-
////////////////////////////////////////////////////////////////////////////////
@@ -66,6 +65,19 @@
{
PTRACE(3, "Supervisor thread has ended");
}
+
+void Supervisor::OnRunning()
+{
+ PTRACE(3, "Create a supervisor all done");
+ PTRACE(3, "Supervisor initialisation done");
+ PTRACE(3, "Supervisor wait for commands now");
+
+#ifdef PMEMORY_CHECK
+ PMemoryHeap::GetState(memoryState);
+ cerr << "currently on allocation number "
+ << memoryState.allocationNumber << endl;
+#endif
+}
void Supervisor::ProcessAnswer(PStringArray &cmds, PString & sender)
{
Modified: sofaswitch/trunk/voip/supervisor.h
==============================================================================
--- sofaswitch/trunk/voip/supervisor.h (original)
+++ sofaswitch/trunk/voip/supervisor.h Thu Jun 12 23:10:18 2008
@@ -58,6 +58,10 @@
/**Destructor */
~Supervisor();
+ /**This class wants to know that things are happening, so it can do
+ things like memory leak checkpoints */
+ virtual void OnRunning();
+
protected:
/**The supervisor has completed. This method is called when this
supervisor instance terminates. Since there is only one
@@ -104,7 +108,8 @@
/**We have a comms error, so just close everything right now. Send
no message to the remote node - just end end end. */
virtual void SilentlyEndAll();
-
+
+
//////////////////////////////////////////////
private:
/**The interface to the external script which runs python, to provide XMPP comms for us */
Modified: sofaswitch/trunk/voip/udpconnection.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.cxx (original)
+++ sofaswitch/trunk/voip/udpconnection.cxx Thu Jun 12 23:10:18 2008
@@ -61,7 +61,6 @@
#include "udpsound.h"
#include "counts.h"
-
#define new PNEW
/////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/voip/udpep.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpep.cxx (original)
+++ sofaswitch/trunk/voip/udpep.cxx Thu Jun 12 23:10:18 2008
@@ -52,6 +52,7 @@
#include "udpep.h"
#include "udpsound.h"
+
#define new PNEW
/////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/voip/udpsound.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpsound.cxx (original)
+++ sofaswitch/trunk/voip/udpsound.cxx Thu Jun 12 23:10:18 2008
@@ -44,7 +44,6 @@
#define new PNEW
-
PString GetSSLabel(bool isSource)
{
if (isSource)
1
0
[Sofaswitch-svn] [commit] r417 - in sofaswitch/trunk: am mcu sofa/include/sofa sofa/src voip
by SofaSWITCH SVN 27 May '08
by SofaSWITCH SVN 27 May '08
27 May '08
Author: derek
Date: Tue May 27 19:09:44 2008
New Revision: 417
Modified:
sofaswitch/trunk/am/comms.cxx
sofaswitch/trunk/mcu/comms.cxx
sofaswitch/trunk/sofa/include/sofa/messlist.h
sofaswitch/trunk/sofa/src/messages.cxx
sofaswitch/trunk/sofa/src/messlist.cxx
sofaswitch/trunk/voip/comms.cxx
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/mymanager.cxx
Log:
Fix the comms constructor, so we avoid the call of pure virtual functions.
the commsProvider internal thread must start work after the creation of everything has completed.
Correctly send a message back to the remote controller that the call has been established. This is
useful in those scripts that want to know when the call is operational.
Modified: sofaswitch/trunk/am/comms.cxx
==============================================================================
--- sofaswitch/trunk/am/comms.cxx (original)
+++ sofaswitch/trunk/am/comms.cxx Tue May 27 19:09:44 2008
@@ -262,6 +262,7 @@
: MessageFrameListProvider(_lid),
manager(_manager)
{
+ StartWorkNow();
}
MessageFrame *CommsProvider::BuildMessageFrame()
Modified: sofaswitch/trunk/mcu/comms.cxx
==============================================================================
--- sofaswitch/trunk/mcu/comms.cxx (original)
+++ sofaswitch/trunk/mcu/comms.cxx Tue May 27 19:09:44 2008
@@ -222,6 +222,7 @@
: MessageFrameListProvider(_lid),
manager(_manager)
{
+ StartWorkNow();
}
MessageFrame *CommsProvider::BuildMessageFrame()
Modified: sofaswitch/trunk/sofa/include/sofa/messlist.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messlist.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messlist.h Tue May 27 19:09:44 2008
@@ -174,10 +174,17 @@
will be overridden, to create descendants of MessageFrames, and
store them in this list.
- This method is pure virtual. We DEMAND that the user provides their own
- interpretation of this method.*/
+ We DEMAND that the user provides their own interpretation of this
+ method. */
virtual MessageFrame *BuildMessageFrame() = 0;
+ /**the work of building a new message frame is started by the
+ descendant class calling this method. Thus, the constructor of
+ the descendant class should call this method. The constructor of
+ this MessageFrameListProvider MUST not call this method. You will
+ get pure virtual errors, as BuildMessageFrame is not defined. */
+ void StartWorkNow();
+
#ifdef DOC_PLUS_PLUS
/**The thread, which runs to create new and ready to go instances, runs in here */
void MakeNewMessageFrames(PThread &, INT param);
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Tue May 27 19:09:44 2008
@@ -320,45 +320,21 @@
PINDEX maxm = 2000;
PBYTEArray data(maxm);
-#define consecutiveReadNulls 10
- PINDEX readSize[consecutiveReadNulls];
- PINDEX readIndex = 0;
- PINDEX ir;
- for(ir = 0; ir < consecutiveReadNulls; ir++)
- readSize[ir] = 1;
-
while(keepGoing){
- messagesSocket.Read(data.GetPointer(), maxm);
- PINDEX size = messagesSocket.GetLastReadCount();
- PINDEX lastError = messagesSocket.GetErrorCode();
-
- readSize[readIndex] = size;
- readIndex = (readIndex + 1) % consecutiveReadNulls;
- PINDEX readSum = 0;
- for(ir = 0; ir < consecutiveReadNulls; ir++)
- readSum += readSize[ir];
- if (readSum == 0) {
- PTRACE(3, "There is an error on this socket. END NOW "
- << messagesSocket.GetErrorText());
-
- SilentlyEndAll();
- CloseMessagesSocket();
- keepGoing = false;
- continue;
- }
-
- if (lastError != PChannel::NoError) {
+ if (messagesSocket.Read(data.GetPointer(), maxm)) {
+ PINDEX size = messagesSocket.GetLastReadCount();
+ ProcessIncomingMessages(data, size);
+ } else {
PTRACE(3, "Failed in read from comms socket, code is "
<< messagesSocket.GetErrorText());
PTRACE(3, "End Process Incoming Messages as we had a read error.");
keepGoing = false;
- continue;
- } else {
- ProcessIncomingMessages(data, size);
- }
+ SilentlyEndAll();
+ CloseMessagesSocket();
+ }
}
- PTRACE(5, "End of Process Incoming Messages - thread has finished");
+ PTRACE(3, "End of Process Incoming Messages - thread has finished");
CloseMessagesSocket();
OnTermination();
Modified: sofaswitch/trunk/sofa/src/messlist.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messlist.cxx (original)
+++ sofaswitch/trunk/sofa/src/messlist.cxx Tue May 27 19:09:44 2008
@@ -161,14 +161,18 @@
keepGoing = true;
MessageFrameList::Initialise();
- makeNewMessageFrame = PThread::Create(PCREATE_NOTIFIER(MakeNewMessageFrames), 0,
- PThread::NoAutoDeleteThread,
- PThread::NormalPriority,
- "%X make Frames");
-
PTRACE(3, "Create new MessageFrame provider.");
}
+void MessageFrameListProvider::StartWorkNow()
+{
+ makeNewMessageFrame = PThread::Create(PCREATE_NOTIFIER(MakeNewMessageFrames),
+ 0,
+ PThread::NoAutoDeleteThread,
+ PThread::NormalPriority,
+ "%X make Frames");
+}
+
void MessageFrameListProvider::RemoveDeadEntries()
{
MessageFrameList deads;
@@ -210,6 +214,7 @@
makeAnother.Signal();
}
+
void MessageFrameListProvider::MakeNewMessageFrames(PThread &, INT )
{
for( ;keepGoing; ) {
@@ -224,8 +229,8 @@
PTRACE(3, "We had an error in buildmessageframe - null returned");
}
}
- if (keepGoing)
- makeAnother.Wait(1000);
+ for(PINDEX i = 0; (i < 10) && keepGoing; i++)
+ makeAnother.Wait(100);
}
PTRACE(3, "End of message frame list provider thread ");
}
Modified: sofaswitch/trunk/voip/comms.cxx
==============================================================================
--- sofaswitch/trunk/voip/comms.cxx (original)
+++ sofaswitch/trunk/voip/comms.cxx Tue May 27 19:09:44 2008
@@ -251,6 +251,7 @@
: MessageFrameListProvider(_lid),
manager(_manager)
{
+ StartWorkNow();
}
MessageFrame *CommsProvider::BuildMessageFrame()
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Tue May 27 19:09:44 2008
@@ -136,18 +136,15 @@
bool MyOpalCall::OnEstablished(OpalConnection & connection)
{
- PTRACE(2, "On Established of connection. " << connection.GetToken());
+ PTRACE(2, "OnEstablished of connection. "
+ << GetPartyA() << " and " << GetPartyB());
- if (sentEstablishedMessage)
- return OpalCall::OnEstablished(connection);
-
- if (PIsDescendant(&connection, OpalUdpSsConnection)) {
+ if (!sentEstablishedMessage) {
comms.AdviseCallCreation();
- sentEstablishedMessage = true;
-
+ sentEstablishedMessage = true;
PTRACE(3, "We have just advised that the call was created ");
}
-
+
return OpalCall::OnEstablished(connection);
}
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Tue May 27 19:09:44 2008
@@ -732,8 +732,10 @@
void MyManager::OnEstablishedCall(OpalCall & call)
{
- // cout << "In call with " << call.GetPartyB() << endl;
- OpalManager::OnEstablishedCall(call);
+ PTRACE(3, "Established call with " << call.GetPartyA()
+ << " and " << call.GetPartyB());
+ // cout << "In call with " << call.GetPartyB() << endl;
+ OpalManager::OnEstablishedCall(call);
}
1
0
27 May '08
Author: derek
Date: Mon May 26 23:02:56 2008
New Revision: 416
Modified:
sofaswitch/trunk/Makefile
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/udpconnection.cxx
sofaswitch/trunk/voip/udpconnection.h
Log:
Changes resulting from upgrades to the ptlib/opal library.
Modified: sofaswitch/trunk/Makefile
==============================================================================
--- sofaswitch/trunk/Makefile (original)
+++ sofaswitch/trunk/Makefile Mon May 26 23:02:56 2008
@@ -26,7 +26,7 @@
# $Date: 2008-03-14 16:19:22 +1300 (Fri, 14 Mar 2008) $
#
-export SOFADIR=/users/derek/sofa/sofaswitch
+export SOFADIR=/home/derek/sofa/sofaswitch
INSTALL=/usr/bin/install -c
OS_NAME=$(shell uname -s)
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Mon May 26 23:02:56 2008
@@ -97,8 +97,6 @@
PTRACE(3, "failed to lock the read write");
return false;
}
-
- partyA = connection.GetRemotePartyName();
PTRACE(3, "ConnectionsActive has a size of "
<< connectionsActive.GetSize());
Modified: sofaswitch/trunk/voip/udpconnection.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.cxx (original)
+++ sofaswitch/trunk/voip/udpconnection.cxx Mon May 26 23:02:56 2008
@@ -74,11 +74,13 @@
: OpalConnection(call, ep, newToken, options, _stringOptions),
endpoint(ep)
{
- IncOpalUdpSsConnection();
-
- silenceDetector = new OpalPCM16SilenceDetector;
-
- PTRACE(3, "UdpSs\tCreated UDP sound system OpalUdpSsConnection" << GetToken());
+ IncOpalUdpSsConnection();
+
+ silenceDetector =
+ new OpalPCM16SilenceDetector(ep.GetManager().GetSilenceDetectParams());
+
+ PTRACE(3, "UdpSs\tCreated UDP sound system OpalUdpSsConnection"
+ << GetToken());
}
@@ -93,21 +95,21 @@
{
// Check if we are A-Party in thsi call, so need to do things differently
if (ownerCall.GetConnection(0) == this) {
- phase = SetUpPhase;
- if (!OnIncomingConnection(0, NULL)) {
- Release(EndedByCallerAbort);
- return false;
- }
-
- PTRACE(3, "PCSS\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this);
- if (!ownerCall.OnSetUp(*this)) {
- Release(EndedByNoAccept);
- return false;
- }
-
- return true;
+ SetPhase(SetUpPhase);
+ if (!OnIncomingConnection(0, NULL)) {
+ Release(EndedByCallerAbort);
+ return false;
+ }
+
+ PTRACE(3, "PCSS\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this);
+ if (!ownerCall.OnSetUp(*this)) {
+ Release(EndedByNoAccept);
+ return false;
+ }
+
+ return true;
}
-
+
{
PSafePtr<OpalConnection> otherConn = ownerCall.GetOtherPartyConnection(*this);
if (otherConn == NULL)
@@ -119,7 +121,7 @@
}
PTRACE(3, "PCSS\tSetUpConnection(" << remotePartyName << ')');
- phase = AlertingPhase;
+ SetPhase(AlertingPhase);
OnAlerting();
return endpoint.OnShowIncoming(*this);
@@ -129,7 +131,7 @@
bool OpalUdpSsConnection::SetAlerting(const PString & calleeName, bool)
{
PTRACE(3, "UdpSs\tSetAlerting(" << calleeName << ')');
- phase = AlertingPhase;
+ SetPhase(AlertingPhase);
remotePartyName = calleeName;
return endpoint.OnShowOutgoing(*this);
}
@@ -137,17 +139,17 @@
bool OpalUdpSsConnection::SetConnected()
{
- PTRACE(3, "UdpSs\tSetConnected()");
-
- if (mediaStreams.IsEmpty())
- phase = ConnectedPhase;
- else {
- PTRACE(5, "UdpSs\t there are " << mediaStreams.GetSize() << " current media stream ");
- phase = EstablishedPhase;
- OnEstablished();
- }
-
- return true;
+ PTRACE(3, "UdpSs\tSetConnected()");
+
+ if (mediaStreams.IsEmpty())
+ SetPhase(ConnectedPhase);
+ else {
+ PTRACE(5, "UdpSs\t there are " << mediaStreams.GetSize() << " current media stream ");
+ SetPhase(EstablishedPhase);
+ OnEstablished();
+ }
+
+ return true;
}
void OpalUdpSsConnection::OnEstablished()
@@ -280,13 +282,13 @@
if (!LockReadOnly())
return;
- if (phase != AlertingPhase) {
+ if (GetPhase() != AlertingPhase) {
UnlockReadOnly();
return;
}
LockReadWrite();
- phase = ConnectedPhase;
+ SetPhase(ConnectedPhase);
UnlockReadWrite();
UnlockReadOnly();
@@ -301,7 +303,7 @@
}
LockReadWrite();
- phase = EstablishedPhase;
+ SetPhase(EstablishedPhase);
UnlockReadWrite();
UnlockReadOnly();
Modified: sofaswitch/trunk/voip/udpconnection.h
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.h (original)
+++ sofaswitch/trunk/voip/udpconnection.h Mon May 26 23:02:56 2008
@@ -71,6 +71,16 @@
/**@name Overrides from OpalConnection */
//@{
+ /**Get indication of connection being to a "network".
+ This indicates the if the connection may be regarded as a "network"
+ connection. The distinction is about if there is a concept of a "remote"
+ party being connected to and is best described by example: sip, h323,
+ iax and pstn are all "network" connections as they connect to something
+ "remote". While pc, pots and ivr are not as the entity being connected
+ to is intrinsically local.
+ */
+ virtual bool IsNetworkConnection() const { return false; }
+
/**Start an outgoing connection.
This function will initiate the connection to the remote entity, for
example in H.323 it sends a SETUP, in SIP it sends an INVITE etc.
1
0
[Sofaswitch-svn] [commit] r415 - in sofaswitch/trunk/callflow: src tests
by SofaSWITCH SVN 26 May '08
by SofaSWITCH SVN 26 May '08
26 May '08
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>
1
0
[Sofaswitch-svn] [commit] r414 - in sofaswitch/trunk/callflow: bitmaps src
by SofaSWITCH SVN 23 May '08
by SofaSWITCH SVN 23 May '08
23 May '08
Author: derek
Date: Fri May 23 01:04:54 2008
New Revision: 414
Modified:
sofaswitch/trunk/callflow/bitmaps/ControlsEndHere.xpm
sofaswitch/trunk/callflow/bitmaps/ControlsIf.xpm
sofaswitch/trunk/callflow/bitmaps/Controlsend_for.xpm
sofaswitch/trunk/callflow/bitmaps/Controlsfor.xpm
sofaswitch/trunk/callflow/bitmaps/Controlsstart.xpm
sofaswitch/trunk/callflow/bitmaps/EditCopy.xpm
sofaswitch/trunk/callflow/bitmaps/EditCut.xpm
sofaswitch/trunk/callflow/bitmaps/EditPaste.xpm
sofaswitch/trunk/callflow/bitmaps/FileE_xit.xpm
sofaswitch/trunk/callflow/bitmaps/FileNew.xpm
sofaswitch/trunk/callflow/bitmaps/FileOpen.xpm
sofaswitch/trunk/callflow/bitmaps/FileSave.xpm
sofaswitch/trunk/callflow/bitmaps/FileSave__As.xpm
sofaswitch/trunk/callflow/bitmaps/HelpAbout.xpm
sofaswitch/trunk/callflow/bitmaps/HelpManual.xpm
sofaswitch/trunk/callflow/bitmaps/JoinObjects.xpm
sofaswitch/trunk/callflow/bitmaps/Python.xpm
sofaswitch/trunk/callflow/bitmaps/RequestNode.xpm
sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm
sofaswitch/trunk/callflow/bitmaps/compile.xpm
sofaswitch/trunk/callflow/bitmaps/death.xpm
sofaswitch/trunk/callflow/bitmaps/endcall.xpm
sofaswitch/trunk/callflow/bitmaps/eventer.xpm
sofaswitch/trunk/callflow/bitmaps/makecall.xpm
sofaswitch/trunk/callflow/bitmaps/masternode.xpm
sofaswitch/trunk/callflow/bitmaps/miniclock.xpm
sofaswitch/trunk/callflow/bitmaps/newgraph.xpm
sofaswitch/trunk/callflow/bitmaps/readfromfile.xpm
sofaswitch/trunk/callflow/bitmaps/senddtmf.xpm
sofaswitch/trunk/callflow/bitmaps/sendmessage.xpm
sofaswitch/trunk/callflow/bitmaps/stoptimer.xpm
sofaswitch/trunk/callflow/bitmaps/transfermedia.xpm
sofaswitch/trunk/callflow/bitmaps/writetofile.xpm
sofaswitch/trunk/callflow/src/acceptcall.cpp
sofaswitch/trunk/callflow/src/acceptcall.h
sofaswitch/trunk/callflow/src/callflow.cpp
sofaswitch/trunk/callflow/src/callstartstop.cpp
sofaswitch/trunk/callflow/src/canvas.cpp
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/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/information.cpp
sofaswitch/trunk/callflow/src/joinblocks.cpp
sofaswitch/trunk/callflow/src/joinblocks.h
sofaswitch/trunk/callflow/src/loadnewgraph.cpp
sofaswitch/trunk/callflow/src/loadnewgraph.h
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.h
sofaswitch/trunk/callflow/src/requestnode.cpp
sofaswitch/trunk/callflow/src/requestnode.h
sofaswitch/trunk/callflow/src/senddtmf.h
sofaswitch/trunk/callflow/src/sendmessage.h
sofaswitch/trunk/callflow/src/shapeselect.h
sofaswitch/trunk/callflow/src/startfor.h
sofaswitch/trunk/callflow/src/starthere.h
sofaswitch/trunk/callflow/src/stoptimer.h
sofaswitch/trunk/callflow/src/timer.h
sofaswitch/trunk/callflow/src/transfermedia.h
sofaswitch/trunk/callflow/src/writetofile.h
Log:
Many lines of tedious cahnges to get it to compile on wxWidgets 2.8 Sigh, job not finished.
Modified: sofaswitch/trunk/callflow/bitmaps/ControlsEndHere.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/ControlsEndHere.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/ControlsEndHere.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *ControlsEndHere[]={
+static const char *ControlsEndHere[]={
"16 15 3 1",
". c None",
"# c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/ControlsIf.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/ControlsIf.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/ControlsIf.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *ControlsIf_xpm[]={
+static const char *ControlsIf_xpm[]={
"16 15 3 1",
". c None",
"# c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/Controlsend_for.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/Controlsend_for.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/Controlsend_for.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *Controlsend_for_xpm[] = {
+static const char *Controlsend_for_xpm[] = {
"16 15 3 1",
". c None",
"# c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/Controlsfor.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/Controlsfor.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/Controlsfor.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *Controlsfor_xpm[] = {
+static const char *Controlsfor_xpm[] = {
"16 15 3 1",
". c None",
"# c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/Controlsstart.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/Controlsstart.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/Controlsstart.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *Controlsstart[]={
+static const char *Controlsstart[]={
"16 15 3 1",
". c None",
"# c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/EditCopy.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/EditCopy.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/EditCopy.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *EditCopy_xpm[] = {
+static const char *EditCopy_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c None",
Modified: sofaswitch/trunk/callflow/bitmaps/EditCut.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/EditCut.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/EditCut.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *EditCut_xpm[] = {
+static const char *EditCut_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c None",
Modified: sofaswitch/trunk/callflow/bitmaps/EditPaste.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/EditPaste.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/EditPaste.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *EditPaste_xpm[] = {
+static const char *EditPaste_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 15 6 1",
" c None",
Modified: sofaswitch/trunk/callflow/bitmaps/FileE_xit.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/FileE_xit.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/FileE_xit.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *FileE_xit_xpm[] = {
+static const char *FileE_xit_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
"X c Black",
Modified: sofaswitch/trunk/callflow/bitmaps/FileNew.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/FileNew.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/FileNew.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *FileNew_xpm[] = {
+static const char *FileNew_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 15 3 1",
" c None",
Modified: sofaswitch/trunk/callflow/bitmaps/FileOpen.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/FileOpen.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/FileOpen.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *FileOpen_xpm[] = {
+static const char *FileOpen_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 15 5 1",
" c None",
Modified: sofaswitch/trunk/callflow/bitmaps/FileSave.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/FileSave.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/FileSave.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *FileSave_xpm[] = {
+static const char *FileSave_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c None",
Modified: sofaswitch/trunk/callflow/bitmaps/FileSave__As.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/FileSave__As.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/FileSave__As.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char * FileSave_As_xpm[] = {
+static const char * FileSave_As_xpm[] = {
"14 14 96 2",
" c None",
". c #A6A6A6",
Modified: sofaswitch/trunk/callflow/bitmaps/HelpAbout.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/HelpAbout.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/HelpAbout.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *HelpAbout[]={
+static const char *HelpAbout[]={
"16 15 4 1",
". c None",
"# c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/HelpManual.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/HelpManual.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/HelpManual.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *HelpManual_xpm[] = {
+static const char *HelpManual_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 15 4 1",
" c None",
Modified: sofaswitch/trunk/callflow/bitmaps/JoinObjects.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/JoinObjects.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/JoinObjects.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *JoinObjects[]={
+static const char *JoinObjects[]={
"16 15 2 1",
". c None",
"# c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/Python.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/Python.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/Python.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *Python_xpm[]={
+static const char *Python_xpm[]={
"32 32 358 2",
"Qt c None",
"cG c #facc6e",
Modified: sofaswitch/trunk/callflow/bitmaps/RequestNode.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/RequestNode.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/RequestNode.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *RequestNode[]={
+static const char *RequestNode[]={
"16 15 5 1",
". c None",
"# c #00c000",
Modified: sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *acceptcall_xpm[]={
+static const char *acceptcall_xpm[]={
"32 32 6 1",
". c None",
"# c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/compile.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/compile.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/compile.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char * compile_xpm[] = {
+static const char * compile_xpm[] = {
/* width height ncolors cpp [x_hot y_hot] */
"24 24 4 1 0 0",
/* colors */
Modified: sofaswitch/trunk/callflow/bitmaps/death.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/death.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/death.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *death[] = {
+static const char *death[] = {
/* columns rows colors chars-per-pixel */
"24 24 118 2",
" c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/endcall.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/endcall.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/endcall.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *endcall[]={
+static const char *endcall[]={
"32 32 6 1",
"d c None",
"# c None",
Modified: sofaswitch/trunk/callflow/bitmaps/eventer.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/eventer.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/eventer.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char * eventer_xpm[] = {
+static const char * eventer_xpm[] = {
"32 32 127 2",
" c None",
". c #FFE81F",
Modified: sofaswitch/trunk/callflow/bitmaps/makecall.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/makecall.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/makecall.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *makecall[]={
+static const char *makecall[]={
"32 32 5 1",
"c c None",
". c None",
Modified: sofaswitch/trunk/callflow/bitmaps/masternode.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/masternode.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/masternode.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *masternode_xpm[] = {
+static const char *masternode_xpm[] = {
/* columns rows colors chars-per-pixel */
"22 22 27 1",
" c #9494AD",
Modified: sofaswitch/trunk/callflow/bitmaps/miniclock.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/miniclock.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/miniclock.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char * miniclock_xpm[] = {
+static const char * miniclock_xpm[] = {
"16 16 4 1",
" c None s None",
". c Black",
Modified: sofaswitch/trunk/callflow/bitmaps/newgraph.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/newgraph.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/newgraph.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *newgraph[]={
+static const char *newgraph[]={
"32 32 5 1",
"# c None",
"b c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/readfromfile.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/readfromfile.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/readfromfile.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *readfromfile[]={
+static const char *readfromfile[]={
"32 32 5 1",
"a c None",
"# c None",
Modified: sofaswitch/trunk/callflow/bitmaps/senddtmf.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/senddtmf.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/senddtmf.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *senddtmf[]={
+static const char *senddtmf[]={
"32 32 6 1",
". c None",
"c c #0000ff",
Modified: sofaswitch/trunk/callflow/bitmaps/sendmessage.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/sendmessage.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/sendmessage.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char * sendmessage_xpm[] = {
+static const char * sendmessage_xpm[] = {
"16 16 4 1",
" c None",
". c #000000",
Modified: sofaswitch/trunk/callflow/bitmaps/stoptimer.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/stoptimer.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/stoptimer.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *stoptimer[]={
+static const char *stoptimer[]={
"16 16 5 1",
"c c None",
". c None",
Modified: sofaswitch/trunk/callflow/bitmaps/transfermedia.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/transfermedia.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/transfermedia.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *transfermedia[]={
+static const char *transfermedia[]={
"32 32 7 1",
"e c None",
". c None",
Modified: sofaswitch/trunk/callflow/bitmaps/writetofile.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/writetofile.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/writetofile.xpm Fri May 23 01:04:54 2008
@@ -1,5 +1,5 @@
/* XPM */
-static char *writetofile[]={
+static const char *writetofile[]={
"32 32 4 1",
"# c None",
"a c #000000",
Modified: sofaswitch/trunk/callflow/src/acceptcall.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/acceptcall.cpp (original)
+++ sofaswitch/trunk/callflow/src/acceptcall.cpp Fri May 23 01:04:54 2008
@@ -43,7 +43,7 @@
dc.SetPen(*wxGREEN_PEN);
dc.SetBrush(wxBrush(*wxGREEN, wxTRANSPARENT));
- wxString text = wxString::Format("? ?");
+ wxString text = wxString::Format(wxT("? ?"));
wxCoord w, h;
dc.GetTextExtent(text, &w, &h);
int xPos = m_rect.x + 25 - (w/2);
@@ -55,47 +55,46 @@
bool DndShapeAcceptCall::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Accept_Call(self, sTuple): ");
- file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" self.aMedia = self.data[a][\"dest node\"] ");
- file.AddLine(" try: ");
- file.AddLine(" self.rhost = eval(self.aMedia) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"The SofaSwitch node id \", self.aMedia, \" could not be evaluated\" ");
- file.AddLine(" return self.data[a][\"Output\"] ");
-
- file.AddLine(" self.mesg = self.data[a][\"do answer\"] ");
- file.AddLine(" try: ");
- file.AddLine(" self.myanswer = eval(self.mesg) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"The evaluation of \", self.mesg, \" failed - no idea what this means\" ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine(" self.rhost += \":ANSWER \" + self.myanswer + \"\\0\" ");
- file.AddLine(" self.transport.write(self.rhost) ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine("");
+ file.AddLine(wxT(" def Accept_Call(self, sTuple): "));
+ file.AddLine(wxT(" a,b,c = sTuple "));
+ file.AddLine(wxT(" self.aMedia = self.data[a][\"dest node\"] "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" self.rhost = eval(self.aMedia) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"The SofaSwitch node id \", self.aMedia, \" could not be evaluated\" "));
+ file.AddLine(wxT(" return self.data[a][\")Output\"] "));
+ file.AddLine(wxT(" self.mesg = self.data[a][\"do answer\"] "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" self.myanswer = eval(self.mesg) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"The evaluation of \", self.mesg, \" failed - no idea what this means\" "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(" self.rhost += \":ANSWER \" + self.myanswer + \"\\0\" "));
+ file.AddLine(wxT(" self.transport.write(self.rhost) "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(""));
- return true;
+ return true;
}
bool DndShapeAcceptCall::WriteThisShapeInfo(wxTextFile & file)
{
- file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str()));
+ file.AddLine(wxString::Format(wxT(" \"%s\" : { "), GetKey().c_str()));
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(wxString::Format(wxT(" \"Output\" : ")));
+ file.AddLine(wxString::Format(wxT(" %s, "), outputLabel.c_str()));
- file.AddLine(wxString::Format(" \"dest node\" : "));
+ file.AddLine(wxString::Format(wxT(" \"dest node\" : ")));
wxString dest = ProtectString(displayData[1].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+ file.AddLine(wxString::Format(wxT(" \"%s\", "), dest.c_str()));
- file.AddLine(wxString::Format(" \"do answer\" : "));
+ file.AddLine(wxString::Format(wxT(" \"do answer\" : ")));
dest = ProtectString(displayData[2].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+ file.AddLine(wxString::Format(wxT(" \"%s\", "), dest.c_str()));
- file.AddLine(wxString::Format(" },"));
+ file.AddLine(wxString::Format(wxT(" },")));
return true;
}
Modified: sofaswitch/trunk/callflow/src/acceptcall.h
==============================================================================
--- sofaswitch/trunk/callflow/src/acceptcall.h (original)
+++ sofaswitch/trunk/callflow/src/acceptcall.h Fri May 23 01:04:54 2008
@@ -18,7 +18,7 @@
void Draw(wxDC & dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Accept Call"); }
+ static wxString GetKindName() { return wxT("Accept Call"); }
/**Write the code generic to this Accept Call code shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/callflow.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.cpp (original)
+++ sofaswitch/trunk/callflow/src/callflow.cpp Fri May 23 01:04:54 2008
@@ -218,7 +218,7 @@
BuildToolBars();
CreateStatusBar();
- SetStatusText(" Welcome to Call Flow. ");
+ SetStatusText(wxT(" Welcome to Call Flow. "));
int w, h;
GetSize(&w, &h);
@@ -231,12 +231,12 @@
void MyFrame::OnClose (wxCloseEvent& event)
{
- int answer = wxMessageBox("Quit program?", "Confirm",
- wxYES_NO, this);
- if (answer == wxYES)
- event.Skip();
- else
- event.Veto();
+ int answer = wxMessageBox(wxT("Quit program?"), wxT("Confirm"),
+ wxYES_NO, this);
+ if (answer == wxYES)
+ event.Skip();
+ else
+ event.Veto();
}
@@ -259,13 +259,13 @@
return;
wxString name = filedlg.GetPath();
- if (name.Right(4) != wxString(".src"))
- name = name + wxString(".src");
+ if (name.Right(4) != wxT(".src"))
+ name = name + wxT(".src");
wxTextFile file(name);
if (!file.Exists()) {
- wxMessageBox(wxString::Format("The file %s must exist to read from", filedlg.GetFilename().c_str()));
+ wxMessageBox(wxT("The file ") + filedlg.GetFilename() + wxT(" must exist to read from"));
return;
}
@@ -274,18 +274,18 @@
file.Close();
currentFileName = name;
canvas->ReadShapeInformationFromFile(currentFileName);
- SetStatusText(wxString::Format("Read source code from %s", currentFileName.c_str()));
+ SetStatusText(wxT("Read source code from ") + currentFileName);
SetNewWindowName(currentFileName);
} else {
- wxMessageBox(wxString::Format("Unable to open the file %s to read from", filedlg.GetFilename().c_str()));
+ wxMessageBox(wxT("Unable to open the file ") + filedlg.GetFilename() + wxT(" to read from"));
return;
}
}
void MyFrame::SetNewWindowName(wxString & newFileName)
{
- wxString title = "CallFlow " + newFileName;
- SetLabel(title);
+ wxString title = wxT("CallFlow ") + newFileName;
+ SetLabel(title);
}
void MyFrame::OnFileSave (wxCommandEvent & event)
@@ -301,10 +301,10 @@
if (file.IsOpened()) {
file.Close();
canvas->ShapeInformationToFile(currentFileName);
- SetStatusText(wxString::Format("Saved source code to %s", currentFileName.c_str()));
+ SetStatusText(wxT("Saved source code to ") + currentFileName);
SetNewWindowName(currentFileName);
} else {
- wxMessageBox(wxString::Format("Unable to open the file %s for saving", currentFileName.c_str()));
+ wxMessageBox(wxT("Unable to open the file ") + currentFileName + wxT("for saving"));
return;
}
}
@@ -320,17 +320,17 @@
wxString name = filedlg.GetPath();
- if (name.Right(4) != wxString(".src"))
- name = name + wxString(".src");
+ if (name.Right(4) != wxT(".src"))
+ name = name + wxT(".src");
currentFileName = name;
wxTextFile file(name);
if (file.Exists()) {
- wxString msg = wxString::Format("The file \n%s\n exists. Overwrite ? ", (const char *)name);
- wxMessageDialog *dlg= new wxMessageDialog(this, msg, "Overwrite existing file", wxYES_DEFAULT | wxYES_NO);
- if (wxID_NO == dlg->ShowModal())
- return;
+ wxString msg = wxT("The file \n") + name + wxT("\n exists. Overwrite ? ");
+ wxMessageDialog *dlg= new wxMessageDialog(this, msg, wxT("Overwrite existing file"), wxYES_DEFAULT | wxYES_NO);
+ if (wxID_NO == dlg->ShowModal())
+ return;
}
if (!file.Exists())
@@ -338,13 +338,13 @@
file.Open();
if (!file.IsOpened()) {
- wxMessageBox(wxString::Format("Unable to open the file %s to write data to", name.c_str()));
+ wxMessageBox(wxT("Unable to open the file ") + name + wxT(" to write data to"));
return;
}
file.Close();
canvas->ShapeInformationToFile(name);
- SetStatusText(wxString::Format("Saved source code to %s", name.c_str()));
+ SetStatusText(wxT("Saved source code to ") + name);
SetNewWindowName(name);
}
@@ -617,8 +617,8 @@
void MyFrame::OnHelpAbout (wxCommandEvent & WXUNUSED(event))
{
- SetStatusText("Help | About");
- wxMessageBox(_T("Call Flow 1.0.0 \n\nAuthor Derek J Smithies <derek(a)indranet.co.nz>\n\n Copyright 2007"), _T("About Call Flow"));
+ SetStatusText(wxT("Help | About"));
+ wxMessageBox(_T("Call Flow 1.0.0 \n\nAuthor Derek J Smithies <derek(a)indranet.co.nz>\n\n Copyright 2007"), _T("About Call Flow"));
}
@@ -663,8 +663,8 @@
return;
wxString name = filedlg.GetPath();
- if (name.Right(3) != wxString(".py"))
- name = name + wxString(".py");
+ if (name.Right(3) != wxT(".py"))
+ name = name + wxT(".py");
wxTextFile file(name);
@@ -672,14 +672,14 @@
file.Create();
file.Open();
if (!file.IsOpened()) {
- wxMessageBox(wxString::Format("Unable to open the file %s to write data to", name.c_str()));
- return;
+ wxMessageBox(wxT("Unable to open the file ") + name + wxT(" to write data to"));
+ return;
}
if (canvas->Compile(file))
- SetStatusText(wxString::Format("wrote compiled code to %s", name.c_str()));
+ SetStatusText(wxT("wrote compiled code to ") + name);
else
- wxMessageBox(wxString::Format("failed - could not compile code to %s", name.c_str()));
+ wxMessageBox(wxT("failed - could not compile code to ") + name);
file.Close();
}
Modified: sofaswitch/trunk/callflow/src/callstartstop.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/callstartstop.cpp (original)
+++ sofaswitch/trunk/callflow/src/callstartstop.cpp Fri May 23 01:04:54 2008
@@ -48,87 +48,87 @@
{
wxString label;
switch(kind) {
- case MakeCall:
- label = "Make_Call";
- break;
- case EndCall:
- label = "End_Call";
- break;
- case AcceptCall:
- label = "Accept_Call";
- break;
+ case MakeCall:
+ label = wxT("Make_Call");
+ break;
+ case EndCall:
+ label = wxT("End_Call");
+ break;
+ case AcceptCall:
+ label = wxT("Accept_Call");
+ break;
}
- wxString header = wxString::Format(" def %s(self, sTuple):", (const char *)label);
+ wxString header = wxT(" def ") + label + wxT("(self, sTuple):");
file.AddLine(header);
- file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" try: ");
- file.AddLine(" self.rhost = eval(self.data[a][\"worker node\"]) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"The worker node string \", self.data[a][\"worker node\"], \" could not be evaluated as a Python string\" ");
- file.AddLine(" self.rhost = \"\" ");
+ file.AddLine(wxT(" a,b,c = sTuple "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" self.rhost = eval(self.data[a][\"worker node\"]) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"The worker node string \", self.data[a][\"worker node\"], \" could not be evaluated as a Python string\" "));
+ file.AddLine(wxT(" self.rhost = \"\" "));
if (kind == MakeCall) {
- file.AddLine(" try: ");
- file.AddLine(" self.dest = eval(self.data[a][\"call destination\"]) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"The destination string \", self.data[a][\"call destination\"], \" could not be evaluated as a Python string\" ");
- file.AddLine(" self.dest = None ");
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" self.dest = eval(self.data[a][\"call destination\"]) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"The destination string \", self.data[a][\"call destination\"], \" could not be evaluated as a Python string\" "));
+ file.AddLine(wxT(" self.dest = None "));
}
if (kind == AcceptCall) {
- file.AddLine(" try: ");
- file.AddLine(" self.option = eval(self.data[a][\"answer option\"]) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"The answer call option string \", self.data[a][\"answer option\"], \" could not be evaluated as a Python string\" ");
- file.AddLine(" self.option = \"No\" ");
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" self.option = eval(self.data[a][\"answer option\"]) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"The answer call option string \", self.data[a][\"answer option\"], \" could not be evaluated as a Python string\" "));
+ file.AddLine(wxT(" self.option = \"No\" "));
}
switch(kind)
{
case MakeCall:
- file.AddLine(" self.rhost += \":CALLNODE \" + self.dest + \"\\0\" ");
+ file.AddLine(wxT(" self.rhost += \":CALLNODE \" + self.dest + \"\\0\" "));
break;
case EndCall:
- file.AddLine(" self.rhost += \":HANGUP \\0\" ");
+ file.AddLine(wxT(" self.rhost += \":HANGUP \\0\" "));
break;
case AcceptCall:
- file.AddLine(" self.rhost += \":Answer \" + self.option + \"\\0\" ");
+ file.AddLine(wxT(" self.rhost += \":Answer \" + self.option + \"\\0\" "));
break;
}
- file.AddLine(" self.transport.write(self.rhost) ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine(" ");
+ file.AddLine(wxT(" self.transport.write(self.rhost) "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(" "));
return true;
}
bool DndShapeCallStartStop::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(wxString::Format(wxT(" %s, "), outputLabel.c_str()));
- file.AddLine(wxString::Format(" \"worker node\" : "));
+ file.AddLine(wxString::Format(wxT(" \"worker node\" : ")));
wxString dest = ProtectString(displayData[1].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
-
+ file.AddLine(wxString::Format(wxT(" \"%s\", "), dest.c_str()));
+
switch(kind) {
- case AcceptCall:
- file.AddLine(wxString::Format(" \"answer option\" : "));
- dest = ProtectString(displayData[2].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
- break;
- case MakeCall:
- file.AddLine(wxString::Format(" \"call destination\" : "));
- dest = ProtectString(displayData[2].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
- break;
+ case AcceptCall:
+ file.AddLine(wxString::Format(wxT(" \"answer option\" : ")));
+ dest = ProtectString(displayData[2].data);
+ file.AddLine(wxString::Format(wxT(" \"%s\", "), dest.c_str()));
+ break;
+ case MakeCall:
+ file.AddLine(wxString::Format(wxT(" \"call destination\" : ")));
+ dest = ProtectString(displayData[2].data);
+ file.AddLine(wxString::Format(wxT(" \"%s\", "), dest.c_str()));
+ break;
}
-
- file.AddLine(wxString::Format(" },"));
-
+
+ file.AddLine(wxT(" },"));
+
return true;
}
@@ -171,14 +171,13 @@
f.SetPointSize(7);
dc.SetFont(f);
for (int i = 0; i < 9; i++){
- wxString text = wxString::Format("%d", i+1);
- wxCoord w, h;
- dc.GetTextExtent(text, &w, &h);
- int xPos = m_rect.x + 17 + ((i%3)*9) - (w/2);
- int yPos = m_rect.y + 18 + ((i/3)*9) - (h/2);
- dc.DrawText(text, xPos, yPos);
+ wxString text = wxString::Format(wxT("%d"), i+1);
+ wxCoord w, h;
+ dc.GetTextExtent(text, &w, &h);
+ int xPos = m_rect.x + 17 + ((i%3)*9) - (w/2);
+ int yPos = m_rect.y + 18 + ((i/3)*9) - (h/2);
+ dc.DrawText(text, xPos, yPos);
}
-
DndShape::Draw(dc); // Draw the selected overlay if required.
}
Modified: sofaswitch/trunk/callflow/src/canvas.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/canvas.cpp (original)
+++ sofaswitch/trunk/callflow/src/canvas.cpp Fri May 23 01:04:54 2008
@@ -578,14 +578,14 @@
{
CloseJoinBlocks ();
pFrame->SetStatusText
- ("Waiting for a mouse click event");
+ (wxT("Waiting for a mouse click event"));
}
break;
case DownEventNew:;
{
CloseJoinBlocks ();
pFrame->SetStatusText
- ("Waiting for a mouse click event");
+ (wxT("Waiting for a mouse click event"));
}
break;
case PlaceOneShape:;
@@ -596,8 +596,7 @@
GetImageTypeForPlacing
());
wxString mess =
- wxString
- ("Set the mouse at desired position to place a ")
+ wxT("Set the mouse at desired position to place a ")
+ kindName;
pFrame->SetStatusText (mess);
selectingRegion.SetSelected (false);
@@ -608,7 +607,7 @@
{
CloseJoinBlocks ();
pFrame->SetStatusText
- ("Mark a rectangle on screen, and select objects within");
+ (wxT("Mark a rectangle on screen, and select objects within"));
selectingRegion.SetOtherCorner (lastMouseDownPoint);
selectingRegion.SetSelected (true);
}
@@ -617,25 +616,25 @@
{
CloseJoinBlocks ();
pFrame->SetStatusText
- ("Moving one or more shapes on the screen");
+ (wxT("Moving one or more shapes on the screen"));
}
break;
case MovingShapesRectangle:;
{
CloseJoinBlocks ();
pFrame->SetStatusText
- ("Moving one or more shapes, and a selecting rectangle, on the screen");
+ (wxT("Moving one or more shapes, and a selecting rectangle, on the screen"));
}
break;
case PlaceJoinBlocks:;
{
pFrame->SetStatusText
- ("Draw interconnecting logic flow between blocks on the screen");
+ (wxT("Draw interconnecting logic flow between blocks on the screen"));
}
break;
default:
{
- pFrame->SetStatusText ("Should not be selected");
+ pFrame->SetStatusText (wxT("Should not be selected"));
}
break;
}
Modified: sofaswitch/trunk/callflow/src/conditional.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/conditional.cpp (original)
+++ sofaswitch/trunk/callflow/src/conditional.cpp Fri May 23 01:04:54 2008
@@ -69,11 +69,11 @@
dc.DrawLine(pvr, prr);
DrawArrow(dc, pvr, ArrowRight, OutputPointConnected(1) ? Connected : Loose);
- wxString text("T");
+ wxString text(wxT("T"));
dc.SetFont(*wxITALIC_FONT);
dc.DrawText(text, m_rect.x + 10, m_rect.y + 35);
- text = "F";
+ text = wxT("F");
dc.DrawText(text, m_rect.x + 35, m_rect.y + 5);
DndShape::Draw(dc);
@@ -81,42 +81,41 @@
bool DndShapeConditional::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Conditional(self, aTuple): ");
- file.AddLine(" a,b,c = aTuple ");
- file.AddLine(" test = self.data[a][\"Test\"] ");
- file.AddLine(" try: ");
- file.AddLine(" self.conditional= eval(test) ");
- file.AddLine(" except: ");
- file.AddLine(" self.conditional=False ");
- file.AddLine(" print \"Condition of \", test, \" was not valid Python code\" ");
- file.AddLine(" if self.conditional : ");
- file.AddLine(" return self.data[a][\"OutputTrue\"] ");
- file.AddLine(" return self.data[a][\"OutputFalse\"] ");
- file.AddLine(" ");
+ file.AddLine(wxT(" def Conditional(self, aTuple): "));
+ file.AddLine(wxT(" a,b,c = aTuple "));
+ file.AddLine(wxT(" test = self.data[a][\"Test\"] "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" self.conditional= eval(test) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" self.conditional=False "));
+ file.AddLine(wxT(" print \"Condition of \", test, \" was not valid Python code\" "));
+ file.AddLine(wxT(" if self.conditional : "));
+ file.AddLine(wxT(" return self.data[a][\"OutputTrue\"] "));
+ file.AddLine(wxT(" return self.data[a][\"OutputFalse\"] "));
+ file.AddLine(wxT(" "));
return true;
}
bool DndShapeConditional::WriteThisShapeInfo(wxTextFile & file)
{
- file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str()));
+ file.AddLine(wxT(" \"") + GetKey() + wxT("\" : { "));
- file.AddLine(wxString::Format(" \"Test\" : "));
+ file.AddLine(wxT(" \"Test\" : "));
wxString dest = ProtectString(displayData[1].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
-
+ file.AddLine(wxT(" \"") + dest + wxT("\", "));
+
wxNode *outputNode = (wxNode *)GetOutputPoints().GetFirst();
const wxString & outputLabel = ((LabelledPoint *)outputNode->GetData())->GetFullLabel();
- file.AddLine(wxString::Format(" \"OutputTrue\" : "));
- file.AddLine(wxString::Format(" %s, ", outputLabel.c_str()));
+ file.AddLine(wxT(" \"OutputTrue\" : "));
+ file.AddLine(wxT(" ") + outputLabel + wxT(", "));
outputNode = outputNode->GetNext();
const wxString & outputLabel2 = ((LabelledPoint *)outputNode->GetData())->GetFullLabel();
- file.AddLine(wxString::Format(" \"OutputFalse\" : "));
- file.AddLine(wxString::Format(" %s, ", outputLabel2.c_str()));
-
- file.AddLine(wxString::Format(" },"));
+ file.AddLine(wxT(" \"OutputFalse\" : "));
+ file.AddLine(wxT(" ") + outputLabel2 + wxT(", "));
+ file.AddLine(wxT(" },"));
return true;
}
Modified: sofaswitch/trunk/callflow/src/conditional.h
==============================================================================
--- sofaswitch/trunk/callflow/src/conditional.h (original)
+++ sofaswitch/trunk/callflow/src/conditional.h Fri May 23 01:04:54 2008
@@ -22,7 +22,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Conditional"); }
+ static wxString GetKindName() { return wxT("Conditional"); }
/**Write the code generic to this Conditional shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/death.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/death.cpp (original)
+++ sofaswitch/trunk/callflow/src/death.cpp Fri May 23 01:04:54 2008
@@ -48,31 +48,31 @@
bool DndShapeDeath::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Death(self, sTuple): ");
- file.AddLine(" \"\"\"Terminate processing of this flow chart, by closing this particular connection. ");
- file.AddLine(" \"\"\" ");
- file.AddLine(" if self.isMaster: ");
- file.AddLine(" reactor.stop() ");
- file.AddLine(" else: ");
- file.AddLine(" self.transport.loseConnection() ");
- file.AddLine(" self.keepGoing = False ");
- file.AddLine(" return None ");
- file.AddLine(" ");
+ file.AddLine(wxT(" def Death(self, sTuple): "));
+ file.AddLine(wxT(" \"\"\"Terminate processing of this flow chart, by closing this particular connection. "));
+ file.AddLine(wxT(" \"\"\" "));
+ file.AddLine(wxT(" if self.isMaster: "));
+ file.AddLine(wxT(" reactor.stop() "));
+ file.AddLine(wxT(" else: "));
+ file.AddLine(wxT(" self.transport.loseConnection() "));
+ file.AddLine(wxT(" self.keepGoing = False "));
+ file.AddLine(wxT(" return None "));
+ file.AddLine(wxT(" "));
return true;
}
bool DndShapeDeath::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(", "));
- file.AddLine(wxString::Format(" },"));
+ file.AddLine(wxT(" },"));
return true;
}
Modified: sofaswitch/trunk/callflow/src/death.h
==============================================================================
--- sofaswitch/trunk/callflow/src/death.h (original)
+++ sofaswitch/trunk/callflow/src/death.h Fri May 23 01:04:54 2008
@@ -19,7 +19,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Death"); }
+ static wxString GetKindName() { return wxT("Death"); }
/**Write the code generic to this Death shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/dnd.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.cpp (original)
+++ sofaswitch/trunk/callflow/src/dnd.cpp Fri May 23 01:04:54 2008
@@ -63,7 +63,7 @@
wxString MyTokenizer::GetToken()
{
if (readPosn >= source.size()) {
- return wxString("");
+ return wxT("");
}
wxString working = source.Mid(readPosn);
@@ -87,7 +87,7 @@
LabelledPoint::LabelledPoint()
{
thisPoint = wxPoint(0, 0);
- otherNodeLabel = wxString("");
+ otherNodeLabel = wxT("");
otherNodeIndex = -1;
otherNodeKind = DndShape::None;
countLinks = 0;}
@@ -95,7 +95,7 @@
LabelledPoint::LabelledPoint(int x, int y)
{
thisPoint = wxPoint(x, y);
- otherNodeLabel = wxString("");
+ otherNodeLabel = wxT("");
otherNodeIndex = -1;
otherNodeKind = DndShape::None;
countLinks = 0;
@@ -113,7 +113,7 @@
LabelledPoint::LabelledPoint(wxPoint &srcData)
{
thisPoint = srcData;
- otherNodeLabel = wxString("");
+ otherNodeLabel = wxT("");
otherNodeIndex = -1;
otherNodeKind = DndShape::None;
countLinks = 0;
@@ -148,16 +148,13 @@
wxString LabelledPoint::GetFullLabel() const
{
if (otherNodeKind == DndShape::None)
- return "None";
+ return wxT("None");
wxString kindLabel = DndShape::GetKindName((DndShape::Kind)otherNodeKind);
- kindLabel.Replace(" ", "_", true); //Replace all spaces with underscores.
+ kindLabel.Replace(wxT(" "), wxT("_"), true); //Replace all spaces with underscores.
- wxString answer = wxString::Format("(\"%s\", %d, \"%s\" )",
- otherNodeLabel.c_str(),
- otherNodeIndex,
- kindLabel.c_str());
-
+ wxString answer = wxT("(\"") + otherNodeLabel + wxT("\", ") + wxString::Format(wxT("%d"),otherNodeIndex)
+ + wxT(", \"") + kindLabel + wxT("\" )");
return answer;
}
@@ -177,7 +174,7 @@
otherNodeIndex = -1;
if (otherNodeLabel.IsNull())
printf("not null\n");
- otherNodeLabel = wxString("");
+ otherNodeLabel = wxT("");
if (otherNodeLabel.IsNull())
printf("not null second time.\n");
@@ -188,7 +185,7 @@
if (otherNodeIndex < 0)
return false;
- if (otherNodeLabel == wxString(""))
+ if (otherNodeLabel == wxT(""))
return false;
return true;
@@ -393,7 +390,7 @@
ioPointsLinked = false;
- StoreNewKey(GetName() + wxString::Format(" %lX", (long unsigned)this));
+ StoreNewKey(GetName() + wxString::Format(wxT(" %lX"), (long unsigned)this));
displayData[displayData.size()] = InformationSection(wxT("Tool Tip"), GetName());
}
@@ -417,7 +414,7 @@
void DndShape::StoreNewKey(wxString newKey)
{
uniqueKey = newKey;
- uniqueKey.Replace(" ", "_", true); //Replace all spaces with underscores.
+ uniqueKey.Replace(wxT(" "), wxT("_"), true); //Replace all spaces with underscores.
inputPoints.SetKey(uniqueKey);
outputPoints.SetKey(uniqueKey);
}
@@ -425,7 +422,7 @@
wxString DndShape::GetKindName(Kind thisKind)
{
if (thisKind == None)
- return wxString("No kind");
+ return wxT("No kind");
if (thisKind == StartHere)
return DndShapeStartHere::GetKindName();
@@ -496,14 +493,14 @@
if (thisKind == AcceptCall)
return DndShapeAcceptCall::GetKindName();
- wxString answer = wxString::Format("node kind is %d", thisKind);
+ wxString answer = wxString::Format(wxT("node kind is %d"), thisKind);
return answer;
}
DndShape * DndShape::Construct(int shapeRequired)
{
if ((shapeRequired < 0) || ( shapeRequired >= KnownShapes)) {
- wxMessageBox(wxString::Format("Unknown DndShape of kind %d",
+ wxMessageBox(wxString::Format(wxT("Unknown DndShape of kind %d"),
shapeRequired));
return NULL;
}
@@ -831,14 +828,14 @@
wxString DndShape::GetShapeInfo()
{
- wxString answer = wxString::Format("%d", kind);
+ wxString answer = wxString::Format(wxT("%d"), kind);
answer += GetEndBlock();
- answer += wxString::Format("%d", m_rect.x);
+ answer += wxString::Format(wxT("%d"), m_rect.x);
answer += GetEndBlock();
- answer += wxString::Format("%d", m_rect.y);
+ answer += wxString::Format(wxT("%d"), m_rect.y);
answer += GetEndBlock();
- answer += GetShapeInfoSpecial() + wxString(" ") + GetEndBlock() + GetEndShape();
+ answer += GetShapeInfoSpecial() + wxT(" ") + GetEndBlock() + GetEndShape();
return answer;
}
@@ -1002,7 +999,7 @@
void DndShape::ProcessRightMouseButton(MyFrame *frame)
{
- wxString heading = "Properties: " + GetName();
+ wxString heading = wxT("Properties: ") + GetName();
Information dialog(frame, heading, displayData);
dialog.ShowModal(); //We don't care what the return value was.
@@ -1012,7 +1009,7 @@
bool DndShape::WriteSystemCode(wxTextFile & file)
{
- file.AddLine("system code ");
+ file.AddLine(wxT("system code "));
file.AddLine(GetName());
return true;
@@ -1021,7 +1018,7 @@
bool DndShape::WriteThisShapeInfo(wxTextFile & file)
{
- file.AddLine("this shape info");
+ file.AddLine(wxT("this shape info"));
file.AddLine(GetKey());
return true;
@@ -1032,10 +1029,10 @@
char dq= '\"';
char s = '\\';
char sq = '\'';
- wxString str_dq = wxString::Format("%c", dq);
- wxString str_sq = wxString::Format("%c", sq);
- wxString esc_sq = wxString::Format("%c%c", s, sq);
- wxString esc_dq = wxString::Format("%c%c", s, dq);
+ wxString str_dq = wxString::Format(wxT("%c"), dq);
+ wxString str_sq = wxString::Format(wxT("%c"), sq);
+ wxString esc_sq = wxString::Format(wxT("%c%c"), s, sq);
+ wxString esc_dq = wxString::Format(wxT("%c%c"), s, dq);
wxString answer = src;
answer.Replace(str_dq, esc_dq);
answer.Replace(str_sq, esc_sq);
Modified: sofaswitch/trunk/callflow/src/dnd.h
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.h (original)
+++ sofaswitch/trunk/callflow/src/dnd.h Fri May 23 01:04:54 2008
@@ -350,7 +350,7 @@
/** Used to report the name of this particular class. */
static wxString GetKindName()
- { return wxString("DndShape has no name"); }
+ { return wxT("DndShape has no name"); }
/**Draw this particular shape to the screen. This method could be
made pure, which means this particular class is never used
@@ -404,7 +404,7 @@
/**Report a piece of special information, which will be peculiar to a
particular shape. This is made virtual. A descendant shape will specify a full
function here */
- virtual wxString GetDescendantShapeInfo() { return wxString(" extra "); }
+ virtual wxString GetDescendantShapeInfo() { return wxT(" extra "); }
/**Set information which is highly peculiar to a descendant
shape. For example, the multi line join blocks shape has some
@@ -458,21 +458,21 @@
wxString GetToolTip() { return displayData[0].data; }
/**Get the tokenizir string to indicate end widget */
- static wxString GetEndShape() { return "<Shape>"; }
-
+ static wxString GetEndShape() { return wxT("<Shape>"); }
+
/**Get the tokenizer string to indicate end of a block of
information within the description of one shape */
- static wxString GetEndBlock() { return "<B>"; }
-
+ static wxString GetEndBlock() { return wxT("<B>"); }
+
/**Get the tokenizer string to indicate the end of one piece of
special information. One piece of special information could be
the caption and the data value */
- static wxString GetEndSpecial() { return "<special>"; }
+ static wxString GetEndSpecial() { return wxT("<special>"); }
/**Get the tokenizer string to indicate the end of one part of one
piece of special information. This could indicate the end of
the caption, or the end of the data value */
- static wxString GetMidSpecial() { return "<ms>"; }
+static wxString GetMidSpecial() { return wxT("<ms>"); }
/**Write the code which is specific to one type of shape. This
code will describe how (for example) an if statement is
@@ -512,7 +512,7 @@
/**Clear the text string associated with this shape which
describes any compile error in creating this structure */
- void ClearCompileError() { compileError = ""; }
+ void ClearCompileError() { compileError = wxT(""); }
/**Place a compile message into this shape - this will show up
when this shape is next displayed */
Modified: sofaswitch/trunk/callflow/src/endcall.h
==============================================================================
--- sofaswitch/trunk/callflow/src/endcall.h (original)
+++ sofaswitch/trunk/callflow/src/endcall.h Fri May 23 01:04:54 2008
@@ -20,7 +20,7 @@
void Draw(wxDC & dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("End Call"); }
+ static wxString GetKindName() { return wxT("End Call"); }
};
Modified: sofaswitch/trunk/callflow/src/endfor.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/endfor.cpp (original)
+++ sofaswitch/trunk/callflow/src/endfor.cpp Fri May 23 01:04:54 2008
@@ -62,30 +62,29 @@
bool DndShapeEndFor::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def End_For_Loop(self, aTuple): ");
- file.AddLine(" a,b,c = aTuple");
- file.AddLine(" return self.data[a][\"LoopAgain\"]");
- file.AddLine("");
+ file.AddLine(wxT(" def End_For_Loop(self, aTuple): "));
+ file.AddLine(wxT(" a,b,c = aTuple"));
+ file.AddLine(wxT(" return self.data[a][\"LoopAgain\"]"));
+ file.AddLine(wxT(""));
return true;
}
bool DndShapeEndFor::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(" \"LoopAgain\" : "));
- file.AddLine(wxString::Format(" %s, ", outputLabel.c_str()));
-
+
+ file.AddLine(wxT(" \"LoopAgain\" : "));
+ file.AddLine(wxT(" ") + outputLabel + wxT(" "));
+
outputNode = outputNode->GetNext();
const wxString & outputLabel2 = ((LabelledPoint *)outputNode->GetData())->GetFullLabel();
- file.AddLine(wxString::Format(" \"AllDone\" : "));
- file.AddLine(wxString::Format(" %s, ", outputLabel2.c_str()));
-
- file.AddLine(wxString::Format(" },"));
+ file.AddLine(wxT(" \"AllDone\" : "));
+ file.AddLine(wxT(" ") + outputLabel2 + wxT(", "));
+ file.AddLine(wxT(" },"));
return true;
}
Modified: sofaswitch/trunk/callflow/src/endfor.h
==============================================================================
--- sofaswitch/trunk/callflow/src/endfor.h (original)
+++ sofaswitch/trunk/callflow/src/endfor.h Fri May 23 01:04:54 2008
@@ -24,7 +24,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("End For Loop"); }
+ static wxString GetKindName() { return wxT("End For Loop"); }
/**Write the code generic to this End For loop shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/endhere.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/endhere.cpp (original)
+++ sofaswitch/trunk/callflow/src/endhere.cpp Fri May 23 01:04:54 2008
@@ -26,7 +26,7 @@
relInputPoints.Add(25, 0);
AdjustIoPoints();
- displayData[0] = InformationSection(wxT("Tool Tip"), wxString("Suspend Processing"));
+ displayData[0] = InformationSection(wxT("Tool Tip"), wxT("Suspend Processing"));
}
void DndShapeEndHere::Draw(wxDC& dc)
@@ -50,30 +50,29 @@
bool DndShapeEndHere::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def End_Processing(self, sTuple): ");
- file.AddLine(" \"\"\"Terminate processing of this flow chart, by returning a None structure ");
- file.AddLine(" Processing on this flow chart may continue if there is an outstanding signal");
- file.AddLine(" handle. ");
- file.AddLine(" \"\"\" ");
- file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" #print \"end of processing at \", a ");
- file.AddLine(" return None ");
- file.AddLine(" ");
+ file.AddLine(wxT(" def End_Processing(self, sTuple): "));
+ file.AddLine(wxT(" \"\"\"Terminate processing of this flow chart, by returning a None structure "));
+ file.AddLine(wxT(" Processing on this flow chart may continue if there is an outstanding signal"));
+ file.AddLine(wxT(" handle. "));
+ file.AddLine(wxT(" \"\"\" "));
+ file.AddLine(wxT(" a,b,c = sTuple "));
+ file.AddLine(wxT(" #print \"end of processing at \", a "));
+ file.AddLine(wxT(" return None "));
+ file.AddLine(wxT(" "));
return true;
}
bool DndShapeEndHere::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(wxString::Format(" },"));
+ file.AddLine(wxT(" \"Input\" : "));
+ file.AddLine(wxT(" ") + inputLabel + wxT(", "));
+ file.AddLine(wxT(" },"));
return true;
}
Modified: sofaswitch/trunk/callflow/src/endhere.h
==============================================================================
--- sofaswitch/trunk/callflow/src/endhere.h (original)
+++ sofaswitch/trunk/callflow/src/endhere.h Fri May 23 01:04:54 2008
@@ -23,7 +23,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Suspend Processing"); }
+ static wxString GetKindName() { return wxT("Suspend Processing"); }
/**Write the code generic to this EndHere shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/eventer.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/eventer.cpp (original)
+++ sofaswitch/trunk/callflow/src/eventer.cpp Fri May 23 01:04:54 2008
@@ -113,83 +113,83 @@
bool DndShapeEventer::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Eventer(self, sTuple): ");
- file.AddLine(" \"\"\"Register the left down output as being available to handle a particular event ");
- file.AddLine(" After registration, continue execution to right horizontal output. Should this ");
- file.AddLine(" link not be connected, a None value will be returned. ");
- file.AddLine(" \"\"\" ");
- file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" pVbl = self.data[a][\"Event Source\"] + \" = None\" ");
- file.AddLine(" try: ");
- file.AddLine(" exec(pVbl) ");
- file.AddLine(" except: ");
- file.AddLine(" pVbl = self.data[a][\"Event Source\"] ");
- file.AddLine(" print \"The Python variable \", pVbl, \" to hold event source output could not be initialisd\" ");
-
- file.AddLine(" pVbl = self.data[a][\"Event Name\"] + \" = None\" ");
- file.AddLine(" try: ");
- file.AddLine(" exec(pVbl) ");
- file.AddLine(" except: ");
- file.AddLine(" pVbl = self.data[a][\"Event Name\"] ");
- file.AddLine(" print \"The Python variable \", pVbl, \" to hold event name output could not be initialisd\" ");
-
- file.AddLine(" pVbl = self.data[a][\"Event Data\"] + \" = None\" ");
- file.AddLine(" try: ");
- file.AddLine(" exec(pVbl) ");
- file.AddLine(" except: ");
- file.AddLine(" pVbl = self.data[a][\"Event Data\"] ");
- file.AddLine(" print \"The Python variable \", pVbl, \" to hold event data output could not be initialisd\" ");
-
- file.AddLine(" ePyn = self.data[a][\"Event Python\"] ");
- file.AddLine(" eReg = self.data[a][\"Event RegExp\"] ");
- file.AddLine(" if len(ePyn) > 0: ");
- file.AddLine(" self.currentHandlers[eval(ePyn)] = a ");
- file.AddLine(" else: ");
- file.AddLine(" self.currentHandlers[eReg] = a ");
- file.AddLine(" return self.data[a][\"OutputKeepGoing\"] ");
- file.AddLine("");
+ file.AddLine(wxT(" def Eventer(self, sTuple): "));
+ file.AddLine(wxT(" \"\"\"Register the left down output as being available to handle a particular event "));
+ file.AddLine(wxT(" After registration, continue execution to right horizontal output. Should this "));
+ file.AddLine(wxT(" link not be connected, a None value will be returned. "));
+ file.AddLine(wxT(" \"\"\" "));
+ file.AddLine(wxT(" a,b,c = sTuple "));
+ file.AddLine(wxT(" pVbl = self.data[a][\"Event Source\"] + \" = None\" "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" exec(pVbl) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" pVbl = self.data[a][\"Event Source\"] "));
+ file.AddLine(wxT(" print \"The Python variable \", pVbl, \" to hold event source output could not be initialisd\" "));
+
+ file.AddLine(wxT(" pVbl = self.data[a][\"Event Name\"] + \" = None\" "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" exec(pVbl) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" pVbl = self.data[a][\"Event Name\"] "));
+ file.AddLine(wxT(" print \"The Python variable \", pVbl, \" to hold event name output could not be initialisd\" "));
+
+ file.AddLine(wxT(" pVbl = self.data[a][\"Event Data\"] + \" = None\" "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" exec(pVbl) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" pVbl = self.data[a][\"Event Data\"] "));
+ file.AddLine(wxT(" print \"The Python variable \", pVbl, \" to hold event data output could not be initialisd\" "));
+
+ file.AddLine(wxT(" ePyn = self.data[a][\"Event Python\"] "));
+ file.AddLine(wxT(" eReg = self.data[a][\"Event RegExp\"] "));
+ file.AddLine(wxT(" if len(ePyn) > 0: "));
+ file.AddLine(wxT(" self.currentHandlers[eval(ePyn)] = a "));
+ file.AddLine(wxT(" else: "));
+ file.AddLine(wxT(" self.currentHandlers[eReg] = a "));
+ file.AddLine(wxT(" return self.data[a][\"OutputKeepGoing\"] "));
+ file.AddLine(wxT(""));
return true;
}
bool DndShapeEventer::WriteThisShapeInfo(wxTextFile & file)
{
- file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str()));
+ file.AddLine(wxString::Format(wxT(" \"%s\" : { "), GetKey().c_str()));
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(" \"Event Handler\" : "));
- file.AddLine(wxString::Format(" %s, ", outputLabel.c_str()));
+ file.AddLine(wxT(" \"Event Handler\" : "));
+ file.AddLine(wxT(" ") + outputLabel + wxT(", "));
outputNode = outputNode->GetNext();
const wxString & outputLabel2 = ((LabelledPoint *)outputNode->GetData())->GetFullLabel();
- file.AddLine(wxString::Format(" \"OutputKeepGoing\" : "));
- file.AddLine(wxString::Format(" %s, ", outputLabel2.c_str()));
+ file.AddLine(wxT(" \"OutputKeepGoing\" : "));
+ file.AddLine(wxT(" ") + outputLabel2 + wxT(", "));
- file.AddLine(wxString::Format(" \"Event Python\" : "));
+ file.AddLine(wxT(" \"Event Python\" : "));
wxString dest = ProtectString(displayData[1].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+ file.AddLine(wxT(" \"") + dest + wxT("\", "));
+
+ file.AddLine(wxT(" \"Event RegExp\" : "));
+ file.AddLine(wxT(" \"") + displayData[2].data + wxT("\", "));
- file.AddLine(wxString::Format(" \"Event RegExp\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
+ file.AddLine(wxT(" \"Event Source\" : "));
+ file.AddLine(wxT(" \"") + displayData[3].data + wxT("\", "));
- file.AddLine(wxString::Format(" \"Event Source\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[3].data.c_str()));
+ file.AddLine(wxT(" \"Event Name\" : "));
+ file.AddLine(wxT(" \"") + displayData[4].data + wxT("\", "));
- file.AddLine(wxString::Format(" \"Event Name\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[4].data.c_str()));
+ file.AddLine(wxT(" \"Event Data\" : "));
+ file.AddLine(wxT(" \"") + displayData[5].data + wxT("\", "));
- file.AddLine(wxString::Format(" \"Event Data\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[5].data.c_str()));
-
- file.AddLine(wxString::Format(" },"));
+ file.AddLine(wxT(" },"));
return true;
}
Modified: sofaswitch/trunk/callflow/src/eventer.h
==============================================================================
--- sofaswitch/trunk/callflow/src/eventer.h (original)
+++ sofaswitch/trunk/callflow/src/eventer.h Fri May 23 01:04:54 2008
@@ -32,7 +32,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Eventer"); }
+ static wxString GetKindName() { return wxT("Eventer"); }
/**Write the code generic to this End Call shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/fileio.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/fileio.cpp (original)
+++ sofaswitch/trunk/callflow/src/fileio.cpp Fri May 23 01:04:54 2008
@@ -84,27 +84,27 @@
bool DndShapeFileIo::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(" \"File Name\" : "));
+ file.AddLine(wxT(" \"File Name\" : "));
wxString dest = ProtectString(displayData[1].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+ file.AddLine(wxT(" \"") + dest + wxT("\", "));
- file.AddLine(wxString::Format(" \"answering machine node\" : "));
+ file.AddLine(wxT(" \"answering machine node\" : "));
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;
}
@@ -112,19 +112,19 @@
bool DndShapeFileIo::WriteSystemCode(wxTextFile & file)
{
if (kind == WriteToFile)
- file.AddLine(" def Write_To_File(self, aTuple): ");
+ file.AddLine(wxT(" def Write_To_File(self, aTuple): "));
else
- file.AddLine(" def Read_From_File(self, aTuple): ");
- file.AddLine(" a,y,z = aTuple ");
- file.AddLine(" fName = self.data[a][\"File Name\"] ");
- file.AddLine(" rhost = eval(self.data[a][\"answering machine node\"]) ");
+ file.AddLine(wxT(" def Read_From_File(self, aTuple): "));
+ file.AddLine(wxT(" a,y,z = aTuple "));
+ file.AddLine(wxT(" fName = self.data[a][\"File Name\"] "));
+ file.AddLine(wxT(" rhost = eval(self.data[a][\"answering machine node\"]) "));
if (kind == WriteToFile)
- file.AddLine(" rhost += \":SETRECEIVEDMSGFILE \" ");
+ file.AddLine(wxT(" rhost += \":SETRECEIVEDMSGFILE \" "));
else
- file.AddLine(" rhost += \":SETANNOUNCEMENTFILE \" ");
- file.AddLine(" rhost += eval(self.data[a][\"File Name\"]) + \" \\0\" ");
- file.AddLine(" self.transport.write(rhost) ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine("");
+ file.AddLine(wxT(" rhost += \":SETANNOUNCEMENTFILE \" "));
+ file.AddLine(wxT(" rhost += eval(self.data[a][\"File Name\"]) + \" \\0\" "));
+ file.AddLine(wxT(" self.transport.write(rhost) "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(""));
return true;
}
Modified: sofaswitch/trunk/callflow/src/information.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/information.cpp (original)
+++ sofaswitch/trunk/callflow/src/information.cpp Fri May 23 01:04:54 2008
@@ -40,12 +40,12 @@
for (int i = 0; i < enabledControls; i++) {
- wxString label = wxString::Format("Control %d", i+1);
+ wxString label = wxString::Format(wxT("Control %d"), i+1);
staticText[i] = new wxStaticText(this, wxID_ANY, label);
staticText[i]->SetLabel(data[i].caption);
mainsizer -> Add (staticText[i], 0, wxALL | wxEXPAND, 1);
- wxString initialMessage = wxString::Format("initial value %d", i + 1);
+ wxString initialMessage = wxString::Format(wxT("initial value %d"), i + 1);
wxSize nSize = wxSize(400,50);
textEntry[i] = new wxTextCtrl(this, wxID_ANY,
initialMessage,
Modified: sofaswitch/trunk/callflow/src/joinblocks.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/joinblocks.cpp (original)
+++ sofaswitch/trunk/callflow/src/joinblocks.cpp Fri May 23 01:04:54 2008
@@ -170,15 +170,15 @@
{
wxNode *node = (wxNode *)points.GetFirst();
if (node == NULL)
- return wxString("");
+ return wxT("");
wxString answer;
while (node != NULL) {
wxPoint onePoint = *((wxPoint *)node->GetData());
if (answer.Length() == 0)
- answer = answer + wxString::Format("%d,%d", onePoint.x, onePoint.y);
+ answer = answer + wxString::Format(wxT("%d,%d"), onePoint.x, onePoint.y);
else
- answer = answer + wxString::Format(",%d,%d", onePoint.x, onePoint.y);
+ answer = answer + wxString::Format(wxT(",%d,%d"), onePoint.x, onePoint.y);
node = node->GetNext();
}
return answer;
@@ -186,10 +186,10 @@
void DndShapeJoinBlocks::SetDescendantShapeInfo(const wxString & newValue)
{
- wxStringTokenizer bits(newValue, ",", wxTOKEN_RET_EMPTY);
+ wxStringTokenizer bits(newValue, wxT(","), wxTOKEN_RET_EMPTY);
if ((bits.CountTokens() % 2) != 0) {
- wxMessageBox("invalid string to process");
+ wxMessageBox(wxT("invalid string to process"));
printf(" %s \n", newValue.c_str());
return;
}
Modified: sofaswitch/trunk/callflow/src/joinblocks.h
==============================================================================
--- sofaswitch/trunk/callflow/src/joinblocks.h (original)
+++ sofaswitch/trunk/callflow/src/joinblocks.h Fri May 23 01:04:54 2008
@@ -30,7 +30,7 @@
virtual void DrawSelected(wxDC &dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Join blocks shape"); }
+ static wxString GetKindName() { return wxT("Join blocks shape"); }
/**Mark this shape as having a top left postion as determined by the parameter */
virtual void SetPosition(wxPoint & newPosition);
Modified: sofaswitch/trunk/callflow/src/loadnewgraph.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/loadnewgraph.cpp (original)
+++ sofaswitch/trunk/callflow/src/loadnewgraph.cpp Fri May 23 01:04:54 2008
@@ -69,54 +69,54 @@
bool DndShapeLoadNewGraph::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Load_New_Graph(self, sTuple): ");
- file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" try: ");
- file.AddLine(" self.udata = (self.myId, eval(self.data[a][\"user variable\"]) )");
- file.AddLine(" except: ");
- file.AddLine(" self.udata = (self.myId, None) ");
- file.AddLine(" ");
- file.AddLine(" try: ");
- file.AddLine(" self.fname = eval(self.data[a][\"new graph file\"]) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"The new graph file \", self.data[a][\"new graph file\"], \" is not a valid Python string\" ");
- file.AddLine(" self.fname = None ");
- file.AddLine(" f = MyFactory() ");
- file.AddLine(" f.isMaster = False ");
- file.AddLine(" f.setGraph(self.fname) ");
- file.AddLine(" f.setMaster(False) ");
- file.AddLine(" f.setUserData(self.udata) ");
- file.AddLine(" f.setScriptArgs(self.scriptArgs) ");
- file.AddLine(" reactor.connectTCP(sofaServer, 5000, f) ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine("");
+ file.AddLine(wxT(" def Load_New_Graph(self, sTuple): "));
+ file.AddLine(wxT(" a,b,c = sTuple "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" self.udata = (self.myId, eval(self.data[a][\"user variable\"]) )"));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" self.udata = (self.myId, None) "));
+ file.AddLine(wxT(" "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" self.fname = eval(self.data[a][\"new graph file\"]) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"The new graph file \", self.data[a][\"new graph file\"], \" is not a valid Python string\" "));
+ file.AddLine(wxT(" self.fname = None "));
+ file.AddLine(wxT(" f = MyFactory() "));
+ file.AddLine(wxT(" f.isMaster = False "));
+ file.AddLine(wxT(" f.setGraph(self.fname) "));
+ file.AddLine(wxT(" f.setMaster(False) "));
+ file.AddLine(wxT(" f.setUserData(self.udata) "));
+ file.AddLine(wxT(" f.setScriptArgs(self.scriptArgs) "));
+ file.AddLine(wxT(" reactor.connectTCP(sofaServer, 5000, f) "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(""));
return true;
}
bool DndShapeLoadNewGraph::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(" \"new graph file\" : "));
+ file.AddLine(wxT(" \"new graph file\" : "));
wxString dest = ProtectString(displayData[1].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+ file.AddLine(wxT(" \"") + dest + wxT("\", "));
- file.AddLine(wxString::Format(" \"user variable\" : "));
+ file.AddLine(wxT(" \"user variable\" : "));
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;
}
Modified: sofaswitch/trunk/callflow/src/loadnewgraph.h
==============================================================================
--- sofaswitch/trunk/callflow/src/loadnewgraph.h (original)
+++ sofaswitch/trunk/callflow/src/loadnewgraph.h Fri May 23 01:04:54 2008
@@ -23,7 +23,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Load New Graph");}
+ static wxString GetKindName() { return wxT("Load New Graph");}
/**Write the code generic to this Python code shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/makecall.h
==============================================================================
--- sofaswitch/trunk/callflow/src/makecall.h (original)
+++ sofaswitch/trunk/callflow/src/makecall.h Fri May 23 01:04:54 2008
@@ -18,7 +18,7 @@
void Draw(wxDC & dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Make Call"); }
+ static wxString GetKindName() { return wxT("Make Call"); }
};
Modified: sofaswitch/trunk/callflow/src/masternode.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/masternode.cpp (original)
+++ sofaswitch/trunk/callflow/src/masternode.cpp Fri May 23 01:04:54 2008
@@ -26,7 +26,7 @@
relInputPoints.Add(16, 0);
relOutputPoints.Add(16, 40);
- displayData[0] = InformationSection(wxT("Tool Tip"), "Register for events from voip2");
+ displayData[0] = InformationSection(wxT("Tool Tip"), wxT("Register for events from voip2"));
displayData[displayData.size()] =
InformationSection(wxT("Node to receive events from (Python code)"), wxT("\"voip2\""));
@@ -58,39 +58,39 @@
bool DndShapeMasterNode::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Master_Node(self, sTuple): ");
- file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" try: ");
- file.AddLine(" mesg = eval(self.data[a][\"Master Node Code\"]) ");
- file.AddLine(" mesg = mesg + \":reporttome\" + \"\\0\" ");
- file.AddLine(" self.transport.write(mesg) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"target for Master Node \", self.data[a][\"Master Node Code\"], \" could not be parsed\" ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine("");
+ file.AddLine(wxT(" def Master_Node(self, sTuple): "));
+ file.AddLine(wxT(" a,b,c = sTuple "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" mesg = eval(self.data[a][\"Master Node Code\"]) "));
+ file.AddLine(wxT(" mesg = mesg + \":reporttome\" + \"\\0\" "));
+ file.AddLine(wxT(" self.transport.write(mesg) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"target for Master Node \", self.data[a][\"Master Node Code\"], \" could not be parsed\" "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(""));
return true;
}
bool DndShapeMasterNode::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(" \"Master Node Code\" : "));
+ file.AddLine(wxT(" \"Master Node 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;
}
Modified: sofaswitch/trunk/callflow/src/masternode.h
==============================================================================
--- sofaswitch/trunk/callflow/src/masternode.h (original)
+++ sofaswitch/trunk/callflow/src/masternode.h Fri May 23 01:04:54 2008
@@ -22,7 +22,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Master Node"); }
+ static wxString GetKindName() { return wxT("Master Node"); }
/**Write the code generic to this MasterNode code shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/python.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/python.cpp (original)
+++ sofaswitch/trunk/callflow/src/python.cpp Fri May 23 01:04:54 2008
@@ -56,37 +56,37 @@
bool DndShapePython::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Python(self, sTuple): ");
- file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" try: ");
- file.AddLine(" exec(self.data[a][\"Python Code\"]) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"Python code \", self.data[a][\"Python Code\"], \" could not be executed\" ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine("");
+ file.AddLine(wxT(" def Python(self, sTuple): "));
+ file.AddLine(wxT(" a,b,c = sTuple "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" exec(self.data[a][\"Python Code\"]) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"Python code \", self.data[a][\"Python Code\"], \" could not be executed\" "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(""));
return true;
}
bool DndShapePython::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(" \"Python Code\" : "));
+ file.AddLine(wxT(" \"Python 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;
}
Modified: sofaswitch/trunk/callflow/src/python.h
==============================================================================
--- sofaswitch/trunk/callflow/src/python.h (original)
+++ sofaswitch/trunk/callflow/src/python.h Fri May 23 01:04:54 2008
@@ -22,7 +22,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Python"); }
+ static wxString GetKindName() { return wxT("Python"); }
/**Write the code generic to this Python code shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/readfromfile.h
==============================================================================
--- sofaswitch/trunk/callflow/src/readfromfile.h (original)
+++ sofaswitch/trunk/callflow/src/readfromfile.h Fri May 23 01:04:54 2008
@@ -16,7 +16,7 @@
DndShapeReadFromFile();
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Read From File"); }
+ static wxString GetKindName() { return wxT("Read From File"); }
};
Modified: sofaswitch/trunk/callflow/src/requestnode.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/requestnode.cpp (original)
+++ sofaswitch/trunk/callflow/src/requestnode.cpp Fri May 23 01:04:54 2008
@@ -69,7 +69,7 @@
DrawStar(dc, 0, 42);
DrawClock(dc, 43, 42, 8);
- wxString text("R ?");
+ wxString text(wxT("R ?"));
wxFont f = wxFont(*wxITALIC_FONT);
f.SetPointSize(20);
dc.SetFont(f);
@@ -90,118 +90,118 @@
bool DndShapeRequestNode::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Request_Node(self, aTuple): ");
- file.AddLine(" a,y,z = aTuple ");
- file.AddLine(" eName = a + \"_Timer\" ");
- file.AddLine(" if y == 0: ");
- file.AddLine(" define=self.data[a][\"Event Source\"] ");
- file.AddLine(" define = define + \" = None\" ");
- file.AddLine(" exec(define); ");
- file.AddLine(" define=self.data[a][\"Event Name\"] ");
- file.AddLine(" define = define + \" = None\" ");
- file.AddLine(" exec(define); ");
- file.AddLine(" define=self.data[a][\"Event Data\"] ");
- file.AddLine(" define = define + \" = None\" ");
- file.AddLine(" exec(define); ");
- file.AddLine(" self.pendingEvents[eName] = (a, eName, \"\") ");
- file.AddLine(" reactor.callLater(self.data[a][\"Timer period\"], self.timerObjectExpired, eName)");
- file.AddLine(" rNode = self.data[a][\"Request node from\"] ");
- file.AddLine(" try: ");
- file.AddLine(" rhost = eval(rNode) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"Could not process \", rNode, \" as a Python string\" ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine(" rhost = rhost + \":REQUESTNEWID \" ");
- file.AddLine(" additional = self.data[a][\"Additional info\"] ");
- file.AddLine(" if len(additional) > 0: ");
- file.AddLine(" try: ");
- file.AddLine(" rhost += eval(additional) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"Could not process \", additional, \" as a Python string \" ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine(" rhost += \"\\0\" ");
- file.AddLine(" self.transport.write(rhost) ");
- file.AddLine(" self.currentHandlers[eName] = a ");
- file.AddLine(" rEvent = eval(rNode) + \"REQUESTNEWID\" ");
- file.AddLine(" self.currentHandlers[rEvent] = a ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine(" else: ");
- file.AddLine(" define=self.data[a][\"Event Name\"] ");
- file.AddLine(" try: ");
- file.AddLine(" defineName = eval(define) ");
- file.AddLine(" except: ");
- file.AddLine(" print \"Failed to turn \", data[a][\"Event Name\"], \" into a name\" ");
- file.AddLine(" defineName = \"not available\" ");
- file.AddLine(" self.DeleteThisEvent(eName) ");
- file.AddLine(" if defineName.find(\"Timer\") < 0: ");
- file.AddLine(" return self.data[a][\"Have Node Handler\"] ");
- file.AddLine(" else: ");
- file.AddLine(" return self.data[a][\"Timeout Handler\"] ");
- file.AddLine("");
+ file.AddLine(wxT(" def Request_Node(self, aTuple): "));
+ file.AddLine(wxT(" a,y,z = aTuple "));
+ file.AddLine(wxT(" eName = a + \"_Timer\" "));
+ file.AddLine(wxT(" if y == 0: "));
+ file.AddLine(wxT(" define=self.data[a][\"Event Source\"] "));
+ file.AddLine(wxT(" define = define + \" = None\" "));
+ file.AddLine(wxT(" exec(define); "));
+ file.AddLine(wxT(" define=self.data[a][\"Event Name\"] "));
+ file.AddLine(wxT(" define = define + \" = None\" "));
+ file.AddLine(wxT(" exec(define); "));
+ file.AddLine(wxT(" define=self.data[a][\"Event Data\"] "));
+ file.AddLine(wxT(" define = define + \" = None\" "));
+ file.AddLine(wxT(" exec(define); "));
+ file.AddLine(wxT(" self.pendingEvents[eName] = (a, eName, \"\") "));
+ file.AddLine(wxT(" reactor.callLater(self.data[a][\"Timer period\"], self.timerObjectExpired, eName)"));
+ file.AddLine(wxT(" rNode = self.data[a][\"Request node from\"] "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" rhost = eval(rNode) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"Could not process \", rNode, \" as a Python string\" "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(" rhost = rhost + \":REQUESTNEWID \" "));
+ file.AddLine(wxT(" additional = self.data[a][\"Additional info\"] "));
+ file.AddLine(wxT(" if len(additional) > 0: "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" rhost += eval(additional) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"Could not process \", additional, \" as a Python string \" "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(" rhost += \"\\0\" "));
+ file.AddLine(wxT(" self.transport.write(rhost) "));
+ file.AddLine(wxT(" self.currentHandlers[eName] = a "));
+ file.AddLine(wxT(" rEvent = eval(rNode) + \"REQUESTNEWID\" "));
+ file.AddLine(wxT(" self.currentHandlers[rEvent] = a "));
+ file.AddLine(wxT(" return self.data[a][\"Output\"] "));
+ file.AddLine(wxT(" else: "));
+ file.AddLine(wxT(" define=self.data[a][\"Event Name\"] "));
+ file.AddLine(wxT(" try: "));
+ file.AddLine(wxT(" defineName = eval(define) "));
+ file.AddLine(wxT(" except: "));
+ file.AddLine(wxT(" print \"Failed to turn \", data[a][\"Event Name\"], \" into a name\" "));
+ file.AddLine(wxT(" defineName = \"not available\" "));
+ file.AddLine(wxT(" self.DeleteThisEvent(eName) "));
+ file.AddLine(wxT(" if defineName.find(\"Timer\") < 0: "));
+ file.AddLine(wxT(" return self.data[a][\"Have Node Handler\"] "));
+ file.AddLine(wxT(" else: "));
+ file.AddLine(wxT(" return self.data[a][\"Timeout Handler\"] "));
+ file.AddLine(wxT(""));
return true;
}
bool DndShapeRequestNode::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(", "));
/**Output, made the request */
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(", "));
/**Output, have the answer */
outputNode = outputNode->GetNext();
const wxString & outputLabel2 = ((LabelledPoint *)outputNode->GetData())->GetFullLabel();
- file.AddLine(wxString::Format(" \"Have Node Handler\" : "));
- file.AddLine(wxString::Format(" %s, ", outputLabel2.c_str()));
+ file.AddLine(wxT(" \"Have Node Handler\" : "));
+ file.AddLine(wxT(" ") + outputLabel2 + wxT(", "));
/*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*/
- 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("\"), "));
wxString dest;
dest = ProtectString(displayData[1].data);
- file.AddLine(wxString::Format(" \"Request node from\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+ file.AddLine(wxT(" \"Request node from\" : "));
+ file.AddLine(wxT(" \"") + dest + wxT("\", "));
- file.AddLine(wxString::Format(" \"Timer period\" : "));
- file.AddLine(wxString::Format(" %s, ", displayData[2].data.c_str()));
+ file.AddLine(wxT(" \"Timer period\" : "));
+ file.AddLine(wxT(" ") + displayData[2] + wxT(", "));
- 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\", "));
- 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(" \"%s\", ", displayData[4].data.c_str()));
+ file.AddLine(wxT(" \"Event Data\" : "));
+ file.AddLine(wxT(" \"") + displayData[4] + wxT("\", "));
- file.AddLine(wxString::Format(" \"Request Pending\" : "));
- file.AddLine(wxString::Format(" 0, "));
+ file.AddLine(wxT(" \"Request Pending\" : "));
+ file.AddLine(wxT(" 0, "));
- file.AddLine(wxString::Format(" \"Additional info\" : "));
+ file.AddLine(wxT(" \"Additional info\" : "));
dest = ProtectString(displayData[3].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+ file.AddLine(wxT(" \"") + dest + wxT("\", "));
- file.AddLine(wxString::Format(" },"));
+ file.AddLine(wxT(" },"));
return true;
}
Modified: sofaswitch/trunk/callflow/src/requestnode.h
==============================================================================
--- sofaswitch/trunk/callflow/src/requestnode.h (original)
+++ sofaswitch/trunk/callflow/src/requestnode.h Fri May 23 01:04:54 2008
@@ -25,7 +25,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Request Node"); }
+ static wxString GetKindName() { return wxT("Request Node"); }
/**Write the code generic to this StartHere shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/senddtmf.h
==============================================================================
--- sofaswitch/trunk/callflow/src/senddtmf.h (original)
+++ sofaswitch/trunk/callflow/src/senddtmf.h Fri May 23 01:04:54 2008
@@ -27,7 +27,7 @@
virtual bool WriteThisShapeInfo(wxTextFile & file);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Send Dtmf"); }
+ static wxString GetKindName() { return wxT("Send Dtmf"); }
};
Modified: sofaswitch/trunk/callflow/src/sendmessage.h
==============================================================================
--- sofaswitch/trunk/callflow/src/sendmessage.h (original)
+++ sofaswitch/trunk/callflow/src/sendmessage.h Fri May 23 01:04:54 2008
@@ -22,7 +22,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Send Message"); }
+ static wxString GetKindName() { return wxT("Send Message"); }
/**Write the code generic to this SendMessage code shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/shapeselect.h
==============================================================================
--- sofaswitch/trunk/callflow/src/shapeselect.h (original)
+++ sofaswitch/trunk/callflow/src/shapeselect.h Fri May 23 01:04:54 2008
@@ -30,7 +30,7 @@
void SetOtherCorner(wxPoint & newPosition);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Select"); }
+ static wxString GetKindName() { return wxT("Select"); }
/**Mark this shape as having a top left postion as determined by the parameter */
virtual void SetPosition(wxPoint & newPosition);
Modified: sofaswitch/trunk/callflow/src/startfor.h
==============================================================================
--- sofaswitch/trunk/callflow/src/startfor.h (original)
+++ sofaswitch/trunk/callflow/src/startfor.h Fri May 23 01:04:54 2008
@@ -23,7 +23,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Start For"); }
+ static wxString GetKindName() { return wxT("Start For"); }
/**Write the code generic to this StartFor shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/starthere.h
==============================================================================
--- sofaswitch/trunk/callflow/src/starthere.h (original)
+++ sofaswitch/trunk/callflow/src/starthere.h Fri May 23 01:04:54 2008
@@ -21,7 +21,7 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Start Processing"); }
+ static wxString GetKindName() { return wxT("Start Processing"); }
/**Write the code generic to this StartHere shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/stoptimer.h
==============================================================================
--- sofaswitch/trunk/callflow/src/stoptimer.h (original)
+++ sofaswitch/trunk/callflow/src/stoptimer.h Fri May 23 01:04:54 2008
@@ -23,10 +23,10 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Stop Timer"); }
+ static wxString GetKindName() { return wxT("Stop Timer"); }
/** Used to report the name of this particular class. */
- virtual wxString GetName() { return wxString("Stop Timer"); }
+ virtual wxString GetName() { return wxT("Stop Timer"); }
/**Write the code generic to this End For loop shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/timer.h
==============================================================================
--- sofaswitch/trunk/callflow/src/timer.h (original)
+++ sofaswitch/trunk/callflow/src/timer.h Fri May 23 01:04:54 2008
@@ -30,10 +30,10 @@
virtual void Draw(wxDC& dc);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Timer"); }
+ static wxString GetKindName() { return wxT("Timer"); }
/** Used to report the name of this particular class. */
- virtual wxString GetName() const { return wxString("Timer"); }
+ virtual wxString GetName() const { return wxT("Timer"); }
/**Write the code generic to this End For loop shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/transfermedia.h
==============================================================================
--- sofaswitch/trunk/callflow/src/transfermedia.h (original)
+++ sofaswitch/trunk/callflow/src/transfermedia.h Fri May 23 01:04:54 2008
@@ -27,7 +27,7 @@
virtual bool TestInternalVariables();
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Transfer Media"); }
+ static wxString GetKindName() { return wxT("Transfer Media"); }
/**Write the code generic to this TransferMedia code shape */
virtual bool WriteSystemCode(wxTextFile & file);
Modified: sofaswitch/trunk/callflow/src/writetofile.h
==============================================================================
--- sofaswitch/trunk/callflow/src/writetofile.h (original)
+++ sofaswitch/trunk/callflow/src/writetofile.h Fri May 23 01:04:54 2008
@@ -17,7 +17,7 @@
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Write To File"); }
+ static wxString GetKindName() { return wxT("Write To File"); }
};
1
0