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
September 2006
- 2 participants
- 78 discussions
Author: derek
Date: Wed Sep 27 01:25:31 2006
New Revision: 135
Added:
sofaswitch/trunk/callflow/src/callstartstop.cpp
sofaswitch/trunk/callflow/src/callstartstop.h
Modified:
sofaswitch/trunk/callflow/src/Makefile.am
sofaswitch/trunk/callflow/src/Makefile.in
sofaswitch/trunk/callflow/src/callflow.cpp
sofaswitch/trunk/callflow/src/callflow.h
sofaswitch/trunk/callflow/src/dnd.h
sofaswitch/trunk/callflow/src/endcall.cpp
sofaswitch/trunk/callflow/src/endcall.h
sofaswitch/trunk/callflow/src/fileio.h
sofaswitch/trunk/callflow/src/makecall.cpp
sofaswitch/trunk/callflow/src/makecall.h
Log:
Join EndCall and MakeCall together, as there is heaps of similarities in the look and
code required. Add new files, callstartstop to handle common pieces of code. Make
relevant downstream changes.
Modified: sofaswitch/trunk/callflow/src/Makefile.am
==============================================================================
--- sofaswitch/trunk/callflow/src/Makefile.am (original)
+++ sofaswitch/trunk/callflow/src/Makefile.am Wed Sep 27 01:25:31 2006
@@ -31,6 +31,7 @@
../bitmaps/Python.xpm \
../bitmaps/RequestNode.xpm \
../bitmaps/compile.xpm \
+ ../bitmaps/endcall.xpm \
../bitmaps/eventer.xpm \
../bitmaps/makecall.xpm \
../bitmaps/miniclock.xpm \
@@ -43,6 +44,8 @@
../bitmaps/transfermedia.xpm \
callflow.cpp \
callflow.h \
+ callstartstop.h \
+ callstartstop.cpp \
canvas.cpp \
canvas.h \
conditional.cpp \
Modified: sofaswitch/trunk/callflow/src/Makefile.in
==============================================================================
--- sofaswitch/trunk/callflow/src/Makefile.in (original)
+++ sofaswitch/trunk/callflow/src/Makefile.in Wed Sep 27 01:25:31 2006
@@ -48,13 +48,13 @@
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
-am_callflow_OBJECTS = callflow.$(OBJEXT) canvas.$(OBJEXT) \
- conditional.$(OBJEXT) dnd.$(OBJEXT) drawshape.$(OBJEXT) \
- endcall.$(OBJEXT) endfor.$(OBJEXT) endhere.$(OBJEXT) \
- eventer.$(OBJEXT) fileio.$(OBJEXT) information.$(OBJEXT) \
- joinblocks.$(OBJEXT) listpoints.$(OBJEXT) \
- loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) python.$(OBJEXT) \
- readfromfile.$(OBJEXT) requestnode.$(OBJEXT) \
+am_callflow_OBJECTS = callflow.$(OBJEXT) callstartstop.$(OBJEXT) \
+ canvas.$(OBJEXT) conditional.$(OBJEXT) dnd.$(OBJEXT) \
+ drawshape.$(OBJEXT) endcall.$(OBJEXT) endfor.$(OBJEXT) \
+ endhere.$(OBJEXT) eventer.$(OBJEXT) fileio.$(OBJEXT) \
+ information.$(OBJEXT) joinblocks.$(OBJEXT) \
+ listpoints.$(OBJEXT) loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) \
+ python.$(OBJEXT) readfromfile.$(OBJEXT) requestnode.$(OBJEXT) \
senddtmf.$(OBJEXT) shapelist.$(OBJEXT) shapeselect.$(OBJEXT) \
startfor.$(OBJEXT) starthere.$(OBJEXT) stoptimer.$(OBJEXT) \
timer.$(OBJEXT) transfermedia.$(OBJEXT) writetofile.$(OBJEXT)
@@ -210,6 +210,7 @@
../bitmaps/Python.xpm \
../bitmaps/RequestNode.xpm \
../bitmaps/compile.xpm \
+ ../bitmaps/endcall.xpm \
../bitmaps/eventer.xpm \
../bitmaps/makecall.xpm \
../bitmaps/miniclock.xpm \
@@ -222,6 +223,8 @@
../bitmaps/transfermedia.xpm \
callflow.cpp \
callflow.h \
+ callstartstop.h \
+ callstartstop.cpp \
canvas.cpp \
canvas.h \
conditional.cpp \
@@ -347,6 +350,7 @@
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callflow.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callstartstop.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canvas.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conditional.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnd.Po@am__quote@
Modified: sofaswitch/trunk/callflow/src/callflow.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.cpp (original)
+++ sofaswitch/trunk/callflow/src/callflow.cpp Wed Sep 27 01:25:31 2006
@@ -39,6 +39,7 @@
#include "bitmaps/Python.xpm"
#include "bitmaps/RequestNode.xpm"
#include "bitmaps/compile.xpm"
+#include "bitmaps/endcall.xpm"
#include "bitmaps/eventer.xpm"
#include "bitmaps/makecall.xpm"
#include "bitmaps/miniclock.xpm"
@@ -70,7 +71,7 @@
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU ( wxH_CONTROLSCOMPILE, MyFrame::OnCompile)
EVT_MENU ( wxH_CONTROLSCONNECT_OBJECTS, MyFrame::OnControlsConnectObjects)
- EVT_MENU ( wxH_CONTROLSEND, MyFrame::OnControlsend)
+ EVT_MENU ( wxH_CONTROLSENDCALL, MyFrame::OnControlsEndCall)
EVT_MENU ( wxH_CONTROLSENDHERE, MyFrame::OnControlsendhere)
EVT_MENU ( wxH_CONTROLSEND_FOR, MyFrame::OnControlsend_for)
EVT_MENU ( wxH_CONTROLSEVENTER, MyFrame::OnControlsEventer)
@@ -144,7 +145,7 @@
File_menu -> Append ( wxH_FILESAVE__AS, wxT("Save &As"), wxT(""));
File_menu -> Append ( wxH_FILEE_XIT, wxT("E&xit"), wxT(""));
Controls_menu -> Append ( wxH_CONTROLSCONNECT_OBJECTS, wxT("connect objects"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSEND, wxT("end"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSENDCALL, wxT("end a call (send hangup)"), wxT(""));
Controls_menu -> Append ( wxH_CONTROLSENDHERE, wxT("end here"), wxT(""));
Controls_menu -> Append ( wxH_CONTROLSEND_FOR, wxT("end for"), wxT(""));
Controls_menu -> Append ( wxH_CONTROLSEVENTER, wxT("event reg/wait"), wxT(""));
@@ -317,6 +318,7 @@
toolBar->AddSeparator() ;
+ toolBar->AddTool(wxH_CONTROLSENDCALL, wxBitmap ( endcall ), wxT("End a call (send hangup)"));
toolBar->AddTool(wxH_CONTROLSSTARTHERE, wxBitmap ( Controlsstart ), wxT("Start processing"));
toolBar->AddTool(wxH_CONTROLSENDHERE, wxBitmap ( ControlsEndHere ), wxT("End processing"));
toolBar->AddTool(wxH_CONTROLSREQUESTNODE, wxBitmap (RequestNode ), wxT("Query Supervisor for worker node"));
@@ -368,7 +370,7 @@
}
-void MyFrame::OnControlsend (wxCommandEvent & WXUNUSED(event))
+void MyFrame::OnControlsEndCall (wxCommandEvent & WXUNUSED(event))
{
imageTypeForPlacing = DndShape::EndCall;
canvas->SetEditingMode(MyCanvas::PlaceOneShape);
Modified: sofaswitch/trunk/callflow/src/callflow.h
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.h (original)
+++ sofaswitch/trunk/callflow/src/callflow.h Wed Sep 27 01:25:31 2006
@@ -13,7 +13,7 @@
wxH_FILE = 1,
wxH_CONTROLSCOMPILE,
wxH_CONTROLSCONNECT_OBJECTS,
- wxH_CONTROLSEND,
+ wxH_CONTROLSENDCALL,
wxH_CONTROLSENDHERE,
wxH_CONTROLSEND_FOR,
wxH_CONTROLSEVENTER,
@@ -117,9 +117,10 @@
remote sofaswitch worker. */
void OnControlsSendDtmf (wxCommandEvent & event);
- /**Called in response to a user comand to add a "End" ??? widget to the
- current graph */
- void OnControlsend (wxCommandEvent & event);
+ /**Called in response to a user comand to add a "End Call" widget to the
+ current graph. In other words, send a hangup message to the remote
+ worker node. */
+ void OnControlsEndCall (wxCommandEvent & event);
/**Called in response to a user comand to add a "Event catcher" widget to
the current graph. These widgets have two outputs - a)for an event, or
Added: sofaswitch/trunk/callflow/src/callstartstop.cpp
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/callstartstop.cpp Wed Sep 27 01:25:31 2006
@@ -0,0 +1,127 @@
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+#include <wx/textfile.h>
+#include <wx/tokenzr.h>
+#include "shapelist.h"
+
+
+#include "callstartstop.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+DndShapeCallStartStop::DndShapeCallStartStop(Kind kindToMake)
+ : DndShape(kindToMake)
+{
+ wxSize newSize(50, 50);
+ SetSize(newSize);
+
+ relInputPoints.Add(25, 0);
+ relOutputPoints.Add(25, 50);
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\""));
+
+ AdjustIoPoints();
+}
+
+
+bool DndShapeCallStartStop::WriteSystemCode(wxTextFile & file)
+{
+ wxString header = wxString::Format(" def %s(self, sTuple):", (kind == MakeCall ? "Make_Call" : "End_Call"));
+ file.AddLine(header);
+ file.AddLine(" a,b,c = sTuple ");
+ file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) ");
+ if (kind == MakeCall)
+ file.AddLine(" rhost += \":CALLNODE \" + eval(self.data[a][\"call destination\"]) + \"\\0\" ");
+ else
+ file.AddLine(" rhost += \":HANGUP \\0\" ");
+ file.AddLine(" self.transport.write(rhost) ");
+ file.AddLine(" return self.data[a][\"Output\"] ");
+ file.AddLine("");
+
+ return true;
+}
+
+bool DndShapeCallStartStop::WriteThisShapeInfo(wxTextFile & file)
+{
+ file.AddLine(wxString::Format(" \"%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(" \"worker node\" : "));
+ wxString dest = ProtectString(displayData[1].data);
+ file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+
+ if (kind == MakeCall) {
+ file.AddLine(wxString::Format(" \"call destination\" : "));
+ dest = ProtectString(displayData[2].data);
+ file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
+ }
+
+ file.AddLine(wxString::Format(" },"));
+
+ return true;
+}
+
+void DndShapeCallStartStop::Draw(wxDC& dc)
+{
+ DrawCompileError(dc);
+ dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
+ dc.SetPen(*wxBLACK_PEN);
+
+ wxPoint p1(m_rect.GetPosition());
+ wxPoint pA(p1.x + 25, p1.y);
+ wxPoint pB(p1.x + 25, p1.y + 10);
+
+ wxPoint pY(p1.x + 25, p1.y + 40);
+ wxPoint pZ(p1.x + 25, p1.y + 50);
+
+ wxPoint pL(p1.x + 3, p1.y+14);
+ wxPoint pR(p1.x + 47, p1.y + 16);
+ wxPoint pM(p1.x + 22, p1.y + 12);
+ wxPoint pL1(pL.x + 0, pL.y+1);
+ wxPoint pR1(pR.x + 0, pR.y + 1);
+ dc.DrawLine(pL, pM);
+ dc.DrawLine(pR, pM);
+ dc.DrawLine(pL1, pM);
+ dc.DrawLine(pR1, pM);
+
+ dc.DrawLine(pA, pB);
+ if (InputPointConnected(0))
+ DrawArrow(dc, pB, ArrowDown, Connected);
+ else
+ DrawArrow(dc, pB, ArrowDown, Loose);
+
+ dc.DrawLine(pY, pZ);
+ if (OutputPointConnected(0))
+ DrawArrow(dc, pZ, ArrowDown, Connected);
+ else
+ DrawArrow(dc, pZ, ArrowDown, Loose);
+
+ wxFont f = wxFont(*wxITALIC_FONT);
+ 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);
+ }
+
+
+ DndShape::Draw(dc); // Draw the selected overlay if required.
+}
Added: sofaswitch/trunk/callflow/src/callstartstop.h
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/callstartstop.h Wed Sep 27 01:25:31 2006
@@ -0,0 +1,36 @@
+#ifndef CALL_START_STOP_H
+#define CALL_START_STOP_H
+
+#include "dnd.h"
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+/**Define a call shape. This shape will be used to to either start a call, or
+ end a call. Starting or ending a call is done with two different
+ sofaswitch commands, "CALLNODE" or "HANGUP". When making a call, the
+ destination has to be specified. Store values for size, location, input &
+ output points. This instance has the ability to draw this shape to a
+ specified location on the canvas */
+class DndShapeCallStartStop : public DndShape
+{
+public:
+ /**Construtor, Define this shape in terms of size and points etc */
+ DndShapeCallStartStop(Kind kindToWrite);
+
+ /**Draw this particular shape to the screen..*/
+ virtual void Draw(wxDC& dc);
+
+ /**Write the dictionary containing relevant points for this shape This
+ shape is drawn slightly differently for make or end call. It accesses
+ the kind member variable, form the ancestor class DndShape. to
+ determine how it should be drawn exactly. */
+ virtual bool WriteThisShapeInfo(wxTextFile & file);
+
+ /**Write the code generic to this shape. If it is make call, or end call,
+ it is determined by the kind member variable in the ancestor class
+ DndShape. */
+ virtual bool WriteSystemCode(wxTextFile & file);
+
+};
+
+
+#endif // CALL_START_STOP_H
Modified: sofaswitch/trunk/callflow/src/dnd.h
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.h (original)
+++ sofaswitch/trunk/callflow/src/dnd.h Wed Sep 27 01:25:31 2006
@@ -250,14 +250,14 @@
/**The currently defined shapes that we can draw */
enum Kind
{
- /* 0 */ None /**The default kind, which is a placeholder, and is no shape at all */,
- /* 1 */ StartHere, /**Start processing here */
- /* 2 */ EndHere, /**Finish processing here */
- /* 3 */ StartFor,
- /* 4 */ EndFor,
- /* 5 */ Conditional /**An If statement. This is the beginning - the end is handled by joining wires. */,
- /* 6 */ MakeCall,
- /* 7 */ EndCall,
+ /* 0 */ None /**The default kind, which is a placeholder, and is no shape at all */,
+ /* 1 */ StartHere, /**Start processing here */
+ /* 2 */ EndHere, /**Finish processing here */
+ /* 3 */ StartFor /**Start of a for loop */,
+ /* 4 */ EndFor /**End of a for loop */,
+ /* 5 */ Conditional /**An If statement. This is the beginning - the end is handled by joining wires. */,
+ /* 6 */ MakeCall /**Get a call started. In other words, start calling some entity outside of the building*/,
+ /* 7 */ EndCall /**End a call. In other words, send a hangup message to the node */,
/* 8 */ Select /**Used to indicate the rectangle on the screen we are selecting */,
/* 9 */ JoinBlocks /**The multi line segment shape which joins two structures on the screen */,
/* 10*/ Python /**The user can enter arbitary python here */,
Modified: sofaswitch/trunk/callflow/src/endcall.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/endcall.cpp (original)
+++ sofaswitch/trunk/callflow/src/endcall.cpp Wed Sep 27 01:25:31 2006
@@ -18,40 +18,15 @@
/////////////////////////////////////////////////////////////////////////////
DndShapeEndCall::DndShapeEndCall()
- : DndShape(EndCall)
+ : DndShapeCallStartStop(EndCall)
{
- wxSize newSize(50, 50);
- SetSize(newSize);
- relInputPoints.Add(25, 0);
- AdjustIoPoints();
}
-void DndShapeEndCall::Draw(wxDC& dc)
-{
- DrawCompileError(dc);
- dc.SetPen(*wxBLACK_PEN);
-
- wxPoint p1(m_rect.GetPosition());
- wxPoint pA(p1.x + 25, p1.y);
- wxPoint pB(p1.x + 25, p1.y + 15);
-
- DrawBox(dc, 0, 15, 50, 35);
- dc.DrawLine(pA, pB);
- if (InputPointConnected(0))
- DrawArrow(dc, pB, ArrowDown, Connected);
- else
- DrawArrow(dc, pB, ArrowDown, Loose);
-
- DndShape::Draw(dc); // Draw the selected overlay if required.
-}
-bool DndShapeEndCall::WriteSystemCode(wxTextFile & file)
-{
- file.AddLine(" def End_Call(self, sTuple): ");
- file.AddLine(" a,b,c = sTuple");
- file.AddLine(" return self.data[a][\"Output\"]");
- file.AddLine("");
- return true;
-}
+
+void DndShapeEndCall::Draw(wxDC & dc)
+{
+ DndShapeCallStartStop::Draw(dc);
+}
Modified: sofaswitch/trunk/callflow/src/endcall.h
==============================================================================
--- sofaswitch/trunk/callflow/src/endcall.h (original)
+++ sofaswitch/trunk/callflow/src/endcall.h Wed Sep 27 01:25:31 2006
@@ -1,32 +1,26 @@
#ifndef END_CALL_H
#define END_CALL_H
-#include "dnd.h"
+#include "callstartstop.h"
-
//////////////////////////////////////////////////////////////////////////////////////////////
/**Define a end call shape. Store values for size, location, input & output points.
This instance has the ability to draw this shape to a specified location on the canvas */
-class DndShapeEndCall : public DndShape
+class DndShapeEndCall : public DndShapeCallStartStop
{
public:
/**Construtor, Define this shape in terms of size and points etc */
DndShapeEndCall();
+
- /**Destroy this shape, and log it */
- virtual ~DndShapeEndCall()
- {
- }
-
- /**Draw this particular shape to the screen..*/
- virtual void Draw(wxDC& dc);
-
- /** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("End Call"); }
+ /**Draw the additional things to indicate we are ending a call. Thus, we
+ add graphics to the base image provided by CallStartStop::Draw(wxDC &
+ dc) */
+ void Draw(wxDC & dc);
- /**Write the code generic to this End Call shape */
- virtual bool WriteSystemCode(wxTextFile & file);
+ /** Used to report the name of this particular class. */
+ static wxString GetKindName() { return wxString("End Call"); }
};
Modified: sofaswitch/trunk/callflow/src/fileio.h
==============================================================================
--- sofaswitch/trunk/callflow/src/fileio.h (original)
+++ sofaswitch/trunk/callflow/src/fileio.h Wed Sep 27 01:25:31 2006
@@ -26,7 +26,7 @@
/**Write the code generic to this shape. If it is a write to file, or read
from file type, is determined by the kind member variable in the
- ancesort class DndShape. */
+ ancestor class DndShape. */
virtual bool WriteSystemCode(wxTextFile & file);
};
Modified: sofaswitch/trunk/callflow/src/makecall.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/makecall.cpp (original)
+++ sofaswitch/trunk/callflow/src/makecall.cpp Wed Sep 27 01:25:31 2006
@@ -18,108 +18,18 @@
/////////////////////////////////////////////////////////////////////////////
DndShapeMakeCall::DndShapeMakeCall()
- : DndShape(MakeCall)
+ : DndShapeCallStartStop(MakeCall)
{
- wxSize newSize(50, 50);
- SetSize(newSize);
- relInputPoints.Add(25, 0);
- relOutputPoints.Add(25, 50);
-
displayData[displayData.size()] =
- InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\""));
-
- displayData[displayData.size()] =
InformationSection(wxT("Call destination (python code)"), wxT("\"h323:h323.voxgratia.org\""));
- AdjustIoPoints();
-}
-bool DndShapeMakeCall::WriteSystemCode(wxTextFile & file)
-{
- file.AddLine(" def Make_Call(self, sTuple): ");
- file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) ");
- file.AddLine(" rhost += \":CALLNODE \" + eval(self.data[a][\"call destination\"]) + \"\\0\" ");
- file.AddLine(" self.transport.write(rhost) ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine("");
-
- return true;
}
-bool DndShapeMakeCall::WriteThisShapeInfo(wxTextFile & file)
-{
- file.AddLine(wxString::Format(" \"%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(" \"worker node\" : "));
- wxString dest = ProtectString(displayData[1].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
- file.AddLine(wxString::Format(" \"call destination\" : "));
- dest = ProtectString(displayData[2].data);
- file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
-
- file.AddLine(wxString::Format(" },"));
-
- return true;
-}
-
-
-void DndShapeMakeCall::Draw(wxDC& dc)
+void DndShapeMakeCall::Draw(wxDC & dc)
{
- DrawCompileError(dc);
- dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
- dc.SetPen(*wxBLACK_PEN);
- wxPoint p1(m_rect.GetPosition());
- wxPoint pA(p1.x + 25, p1.y);
- wxPoint pB(p1.x + 25, p1.y + 10);
-
- wxPoint pY(p1.x + 25, p1.y + 40);
- wxPoint pZ(p1.x + 25, p1.y + 50);
-
- wxPoint pL(p1.x + 3, p1.y+14);
- wxPoint pR(p1.x + 47, p1.y + 16);
- wxPoint pM(p1.x + 22, p1.y + 12);
- wxPoint pL1(pL.x + 0, pL.y+1);
- wxPoint pR1(pR.x + 0, pR.y + 1);
- dc.DrawLine(pL, pM);
- dc.DrawLine(pR, pM);
- dc.DrawLine(pL1, pM);
- dc.DrawLine(pR1, pM);
-
- dc.DrawLine(pA, pB);
- if (InputPointConnected(0))
- DrawArrow(dc, pB, ArrowDown, Connected);
- else
- DrawArrow(dc, pB, ArrowDown, Loose);
-
- dc.DrawLine(pY, pZ);
- if (OutputPointConnected(0))
- DrawArrow(dc, pZ, ArrowDown, Connected);
- else
- DrawArrow(dc, pZ, ArrowDown, Loose);
-
- wxFont f = wxFont(*wxITALIC_FONT);
- 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);
- }
-
-
- DndShape::Draw(dc); // Draw the selected overlay if required.
+ DndShapeCallStartStop::Draw(dc);
}
-
Modified: sofaswitch/trunk/callflow/src/makecall.h
==============================================================================
--- sofaswitch/trunk/callflow/src/makecall.h (original)
+++ sofaswitch/trunk/callflow/src/makecall.h Wed Sep 27 01:25:31 2006
@@ -1,30 +1,21 @@
#ifndef MAKE_CALL_H
#define MAKE_CALL_H
-#include "dnd.h"
+#include "callstartstop.h"
//////////////////////////////////////////////////////////////////////////////////////////////
/**Define a create a call shape. Store values for size, location, input & output points.
This instance has the ability to draw this shape to a specified location on the canvas */
-class DndShapeMakeCall : public DndShape
+class DndShapeMakeCall : public DndShapeCallStartStop
{
public:
/**Construtor, Define this shape in terms of size and points etc */
DndShapeMakeCall();
- /**Destroy this shape, and log it */
- virtual ~DndShapeMakeCall()
- {
- }
-
- /**Draw this particular shape to the screen..*/
- virtual void Draw(wxDC& dc);
-
- /**Write the code generic to this Make Call shape */
- virtual bool WriteSystemCode(wxTextFile & file);
-
- /**Write the dictionary containing relevant points for this shape */
- virtual bool WriteThisShapeInfo(wxTextFile & file);
+ /**Draw the additional things to indicate we are making a call. Thus, we
+ add graphics to the base image provided by CallStartStop::Draw(wxDC &
+ dc) */
+ void Draw(wxDC & dc);
/** Used to report the name of this particular class. */
static wxString GetKindName() { return wxString("Make Call"); }
1
0
Author: derek
Date: Wed Sep 27 00:35:07 2006
New Revision: 134
Added:
sofaswitch/trunk/callflow/bitmaps/endcall.xpm
Log:
Add End Voip Call icon.x
Added: sofaswitch/trunk/callflow/bitmaps/endcall.xpm
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/bitmaps/endcall.xpm Wed Sep 27 00:35:07 2006
@@ -0,0 +1,41 @@
+/* XPM */
+static char *endcall[]={
+"32 32 6 1",
+"d c None",
+"# c None",
+"a c #000000",
+"c c #00c0c0",
+"b c #585858",
+". c #ff0000",
+".##############################.",
+"#.##############aaa###########.#",
+"##.###########aab#baa########.##",
+"###.########aab##b#b#aa#####.###",
+"####.#####aab##b#b##bb#aa##.####",
+"#####.#aaa#b#bb#b#b#b#b##a.#####",
+"#####a.##b##b##aaaa##b#bb.baa###",
+"###aa#b.b#b#aaa####aab#b.bb#baa#",
+"aaa#bb#b.aaacc#######aa.#b#bbb#a",
+"#aaa#aaac.cc#########c.aa#b#b##a",
+"####acccc#.##########.cccaa##ba#",
+"###ccc#aaba.#bbbb##b.bb#cccaaa##",
+"##ccc##aaba#.aaab##.aab###ccc###",
+"###.###aaba##.aba#.abbb####cc###",
+"###.###aaba##a.aa.#aaab#####.###",
+"###.###aaba##bb..##bbbb#####.###",
+"###.###########..###########.###",
+"###.##########.##.##########.###",
+"#.#.#.#baaa##.bbb#.baaa###.#.d.#",
+"#.#.#.#baaa#.baaa##.aaa###.#.#.#",
+".#...#.baba.#bbbb##b.bbdd.d...#.",
+"#.#.#.#bbb.##aaab##ba.bddd.d.#.#",
+"##...##aa.a##bbbb##bbb.dddd...dd",
+"ddd.dddd.dddddddddddddd.dddd.ddd",
+"#######.###############d.dddddd#",
+"######.bbbb##bbbb##bbbbdd.ddd###",
+"#####.#aaab##baab##baabddd.#####",
+"####.##aaba##bbbb##bbbb####.####",
+"###.###aaba##baab##aabb#####.###",
+"##.####abaa##bbbb##aaba######.##",
+"#.############################.#",
+".##############################."};
1
0
Author: derek
Date: Wed Sep 27 00:10:22 2006
New Revision: 133
Modified:
sofaswitch/trunk/callflow/src/dnd.cpp
sofaswitch/trunk/callflow/src/dnd.h
sofaswitch/trunk/callflow/src/eventer.cpp
sofaswitch/trunk/callflow/src/makecall.cpp
sofaswitch/trunk/callflow/src/python.cpp
sofaswitch/trunk/callflow/src/senddtmf.cpp
sofaswitch/trunk/callflow/src/shapelist.cpp
sofaswitch/trunk/callflow/tests/requestnode.src
sofaswitch/trunk/callflow/tests/timetest.src
Log:
Bug fixes bug fixes. Use a more sane approach for entering string parameters.
Specify a variable in the event object, which holds data from the event.
Modified: sofaswitch/trunk/callflow/src/dnd.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.cpp (original)
+++ sofaswitch/trunk/callflow/src/dnd.cpp Wed Sep 27 00:10:22 2006
@@ -913,3 +913,19 @@
return true;
}
+
+wxString DndShape::ProtectString(const wxString & src)
+{
+ 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 answer = src;
+ answer.Replace(str_dq, esc_dq);
+ answer.Replace(str_sq, esc_sq);
+
+ return answer;
+}
Modified: sofaswitch/trunk/callflow/src/dnd.h
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.h (original)
+++ sofaswitch/trunk/callflow/src/dnd.h Wed Sep 27 00:10:22 2006
@@ -509,6 +509,10 @@
void AdjustIoPoints();
protected:
+ /**Given a string (from the user command line) we need to turn all quotes
+ into \\\", so that when run in the python program, a quote will be
+ interpreted correctly. Similarily, we have to turn ' into \\\' */
+ wxString ProtectString(const wxString & src);
/**Store the supplied key in the list of input point, and in the
list of output points. Assign the supplied key to this shape,
Modified: sofaswitch/trunk/callflow/src/eventer.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/eventer.cpp (original)
+++ sofaswitch/trunk/callflow/src/eventer.cpp Wed Sep 27 00:10:22 2006
@@ -33,20 +33,28 @@
displayData[displayData.size()] =
InformationSection(wxT("Event sought (Regular Exp)"), wxT("*DTMF"));
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Python variable to hold event data"), wxT("self.eventData"));
}
bool DndShapeEventer::TestInternalVariables()
{
DndShape::TestInternalVariables();
+ bool vblEmpty = displayData[3].data.IsEmpty();
+ if (vblEmpty)
+ SetCompileError(wxT("There is no python variable to hold the output of the event"));
+
+
bool oneEmpty = displayData[1].data.IsEmpty();
bool twoEmpty = displayData[2].data.IsEmpty();
- if (oneEmpty && (!twoEmpty)) {
+ if ((!vblEmpty) && oneEmpty && (!twoEmpty)) {
return true;
}
- if (twoEmpty && (!oneEmpty)) {
+ if ((!vblEmpty) && twoEmpty && (!oneEmpty)) {
return true;
}
@@ -114,6 +122,9 @@
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 Variable\"] ");
+ file.AddLine(" pVbl += \" = None\" ");
+ file.AddLine(" exec(pVbl) ");
file.AddLine(" ePyn = self.data[a][\"Event Python\"] ");
file.AddLine(" eReg = self.data[a][\"Event RegExp\"] ");
file.AddLine(" if len(ePyn) > 0: ");
@@ -152,6 +163,9 @@
file.AddLine(wxString::Format(" \"Event RegExp\" : "));
file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
+
+ file.AddLine(wxString::Format(" \"Event Variable\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[3].data.c_str()));
file.AddLine(wxString::Format(" },"));
Modified: sofaswitch/trunk/callflow/src/makecall.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/makecall.cpp (original)
+++ sofaswitch/trunk/callflow/src/makecall.cpp Wed Sep 27 00:10:22 2006
@@ -30,7 +30,7 @@
InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\""));
displayData[displayData.size()] =
- InformationSection(wxT("Call destination (python code)"), wxT("\"h323.voxgratia.org\""));
+ InformationSection(wxT("Call destination (python code)"), wxT("\"h323:h323.voxgratia.org\""));
AdjustIoPoints();
}
@@ -40,7 +40,7 @@
file.AddLine(" def Make_Call(self, sTuple): ");
file.AddLine(" a,b,c = sTuple ");
file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) ");
- file.AddLine(" rhost += \":CALLNODE \" + self.data[a][\"call destination\"] + \"\\0\" ");
+ file.AddLine(" rhost += \":CALLNODE \" + eval(self.data[a][\"call destination\"]) + \"\\0\" ");
file.AddLine(" self.transport.write(rhost) ");
file.AddLine(" return self.data[a][\"Output\"] ");
file.AddLine("");
@@ -59,10 +59,12 @@
file.AddLine(wxString::Format(" %s, ", outputLabel.c_str()));
file.AddLine(wxString::Format(" \"worker node\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
+ wxString dest = ProtectString(displayData[1].data);
+ file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
file.AddLine(wxString::Format(" \"call destination\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
+ dest = ProtectString(displayData[2].data);
+ file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
file.AddLine(wxString::Format(" },"));
Modified: sofaswitch/trunk/callflow/src/python.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/python.cpp (original)
+++ sofaswitch/trunk/callflow/src/python.cpp Wed Sep 27 00:10:22 2006
@@ -97,7 +97,8 @@
file.AddLine(wxString::Format(" %s, ", outputLabel.c_str()));
file.AddLine(wxString::Format(" \"Python Code\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
+ wxString dest = ProtectString(displayData[1].data);
+ file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
file.AddLine(wxString::Format(" },"));
Modified: sofaswitch/trunk/callflow/src/senddtmf.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/senddtmf.cpp (original)
+++ sofaswitch/trunk/callflow/src/senddtmf.cpp Wed Sep 27 00:10:22 2006
@@ -30,14 +30,14 @@
InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\""));
displayData[displayData.size()] =
- InformationSection(wxT("Call destination (python code)"), wxT("\"h323.voxgratia.org\""));
+ InformationSection(wxT("DTMF to send to worker node (python code)"), wxT("\"1\""));
AdjustIoPoints();
}
bool DndShapeSendDtmf::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Make_Call(self, sTuple): ");
+ file.AddLine(" def Send_Dtmf(self, sTuple): ");
file.AddLine(" a,b,c = sTuple ");
file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) ");
file.AddLine(" rhost += \":SENDDTMF \" + eval(self.data[a][\"dtmf to send\"]) + \"\\0\" ");
@@ -59,10 +59,12 @@
file.AddLine(wxString::Format(" %s, ", outputLabel.c_str()));
file.AddLine(wxString::Format(" \"worker node\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
+ wxString dest = ProtectString(displayData[1].data);
+ file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
file.AddLine(wxString::Format(" \"dtmf to send\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
+ dest = ProtectString(displayData[2].data);
+ file.AddLine(wxString::Format(" \"%s\", ", dest.c_str()));
file.AddLine(wxString::Format(" },"));
Modified: sofaswitch/trunk/callflow/src/shapelist.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/shapelist.cpp (original)
+++ sofaswitch/trunk/callflow/src/shapelist.cpp Wed Sep 27 00:10:22 2006
@@ -376,9 +376,10 @@
file.AddLine(" eventNode = self.currentHandlers[handler] ");
file.AddLine(" eventData = self.generatedEvents.pop(event) ");
file.AddLine(" eHandler = self.data[eventNode][\"Event Handler\"] ");
- file.AddLine(" a,b,c = eHandler ");
- file.AddLine(" self.data[a][\"Event Data\"] = eventData ");
- file.AddLine(" self.DoWork(eHandler) ");
+ file.AddLine(" pVbl = self.data[eventNode][\"Event Variable\"] ");
+ file.AddLine(" pVbl += \" = \" + self.quote + eventData + self.quote ");
+ file.AddLine(" exec(pVbl) ");
+ file.AddLine(" self.DoWork(eHandler) ");
file.AddLine(" self.generatedEvents.clear() ");
file.AddLine(" ");
file.AddLine(" def networkEventData(self, eName, data): ");
@@ -492,8 +493,6 @@
file.AddLine(" types of messages ");
file.AddLine(" \"\"\" ");
file.AddLine(" thisMessage = thisMessage.strip() ");
- file.AddLine(" if len(thisMessage) > 2: ");
- file.AddLine(" print \"Received \", thisMessage ");
file.AddLine(" for msg in self.knownNetworkMessages: ");
file.AddLine(" if thisMessage.find(msg) >= 0: ");
file.AddLine(" pMsg = str(thisMessage).split(\" \") ");
Modified: sofaswitch/trunk/callflow/tests/requestnode.src
==============================================================================
--- sofaswitch/trunk/callflow/tests/requestnode.src (original)
+++ sofaswitch/trunk/callflow/tests/requestnode.src Wed Sep 27 00:10:22 2006
@@ -1 +1 @@
-13<B>231<B>340<B> extra <special>Tool Tip<ms>Stop Timer<ms><special>Timer to stop<ms>requestnode<ms><special> <B><Shape>1<B>231<B>108<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>10<B>323<B>322<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"timer has expired at \", time.asctime()<ms><special> <B><Shape>2<B>231<B>391<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>9<B>289<B>276<B>289,277,349,276<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>11<B>232<B>159<B> extra <special>Tool Tip<ms>Request Node<ms><special>Request node from<ms>voip<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestnode<ms><special> <B><Shape>10<B>232<B>204<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"Have requested a node from voip at \", time.asctime()<ms><special> <B><Shape>10<B>231<B>295<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"have a new node on \", self.data[self.currentNode][\"Event Data\"]<ms><special> <B><Shape>9<B>259<B>371<B>347,371,259,391<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>243<B>255<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>NEWID<ms><special> <B><Shape>14<B>334<B>279<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>requestnode<ms><special> <B><Shape>
+2<B>231<B>391<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>10<B>323<B>322<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "timer has expired at ", time.asctime(), " from ", self.timerData<ms><special> <B><Shape>9<B>259<B>371<B>347,371,259,391<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>244<B>255<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>NEWID<ms><special>Python variable to hold event data<ms>self.eventData<ms><special> <B><Shape>14<B>336<B>282<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>requestnode<ms><special>Python variable to hold event data<ms>self.timerData<ms><special> <B><Shape>13<B>231<B>340<B> extra <special>Tool Tip<ms>Stop Timer<ms><special>Timer to stop<ms>requestnode<ms><special> <B><Shape>9<B>290<B>279<B>290,280,350,279<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>10<B>231<B>295<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "have a new node on ", self.eventData<ms><special> <B><Shape>1<B>231<B>157<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>11<B>231<B>208<B> extra <special>Tool Tip<ms>Request Node<ms><special>Request node from<ms>voip<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestnode<ms><special> <B><Shape>
Modified: sofaswitch/trunk/callflow/tests/timetest.src
==============================================================================
--- sofaswitch/trunk/callflow/tests/timetest.src (original)
+++ sofaswitch/trunk/callflow/tests/timetest.src Wed Sep 27 00:10:22 2006
@@ -1 +1 @@
-12<B>207<B>202<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>2<ms><special>Timer label<ms>timer2<ms><special> <B><Shape>10<B>123<B>74<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"Start \", time.asctime()<ms><special> <B><Shape>14<B>218<B>254<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>timer2<ms><special> <B><Shape>2<B>207<B>352<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>14<B>137<B>175<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>timer1<ms><special> <B><Shape>10<B>247<B>371<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"t10 \", time.asctime(), \" data is \", self.data[self.currentNode][\"Event Data\"]<ms><special> <B><Shape>10<B>207<B>305<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"t2 \", time.asctime(), \" data is \", self.data[self.currentNode][\"Event Data\"]<ms><special> <B><Shape>10<B>126<B>221<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print \"t1 \", time.asctime(), \" data is \", self.data[self.currentNode][\"Event Data\"]<ms><special> <B><Shape>12<B>244<B>274<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>10<ms><special>Timer label (string literal)<ms>t10<ms><special> <B><Shape>9<B>188<B>201<B>188,201,231,202<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>259<B>327<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>10<ms><special> <B><Shape>9<B>175<B>354<B>275,421,175,421,181,363,228,354<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>12<B>123<B>122<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>timer1<ms><special> <B><Shape>9<B>150<B>272<B>151,272,150,344,232,354<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>1<B>123<B>26<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>
+10<B>207<B>305<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "t2 ", time.asctime(), " data is ", self.timer2<ms><special> <B><Shape>14<B>139<B>179<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>timer1<ms><special>Python variable to hold event data<ms>self.timer1Data<ms><special> <B><Shape>9<B>270<B>278<B>270,280,359,278<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>188<B>201<B>188,201,231,202<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>220<B>256<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>timer2<ms><special>Python variable to hold event data<ms>self.timer2<ms><special> <B><Shape>14<B>347<B>327<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>10<ms><special>Python variable to hold event data<ms>self.timer3<ms><special> <B><Shape>10<B>126<B>221<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "t1 ", time.asctime(), " data is ", self.timer1Data<ms><special> <B><Shape>12<B>127<B>125<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>timer1<ms><special> <B><Shape>9<B>150<B>271<B>150,271,152,406,223,407,229,423<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>12<B>335<B>275<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>10<ms><special>Timer label (string literal)<ms>t10<ms><special> <B><Shape>9<B>228<B>419<B>228,423,358,419<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>1<B>123<B>26<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>10<B>334<B>370<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "t10 ", time.asctime(), " data is ", self.timer3<ms><special> <B><Shape>10<B>123<B>74<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "Start ", time.asctime()<ms><special> <B><Shape>12<B>207<B>202<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds)<ms>2<ms><special>Timer label<ms>timer2<ms><special> <B><Shape>2<B>204<B>423<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>9<B>231<B>351<B>232,351,231,422<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>
1
0
Author: derek
Date: Tue Sep 26 21:27:17 2006
New Revision: 132
Modified:
sofaswitch/trunk/voip/comms.cxx
Log:
Remove surplus Terminating message.
Modified: sofaswitch/trunk/voip/comms.cxx
==============================================================================
--- sofaswitch/trunk/voip/comms.cxx (original)
+++ sofaswitch/trunk/voip/comms.cxx Tue Sep 26 21:27:17 2006
@@ -99,7 +99,6 @@
void Comms::CloseThisId()
{
- SendThisMessageTo("Comms-------Terminating", remoteController);
audioSocket.Close();
Terminate();
1
0
Author: derek
Date: Tue Sep 26 01:11:42 2006
New Revision: 131
Added:
sofaswitch/trunk/callflow/src/fileio.cpp
sofaswitch/trunk/callflow/src/fileio.h
Log:
Add these files, which are the base of the answering
machine specific nodes of WriteToFile/ReadFromFile.
Added: sofaswitch/trunk/callflow/src/fileio.cpp
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/fileio.cpp Tue Sep 26 01:11:42 2006
@@ -0,0 +1,128 @@
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+#include <wx/textfile.h>
+#include <wx/tokenzr.h>
+#include "shapelist.h"
+
+
+#include "fileio.h"
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+
+DndShapeFileIo::DndShapeFileIo(Kind kindToMake)
+ : DndShape(kindToMake)
+{
+}
+
+void DndShapeFileIo::Draw(wxDC& dc)
+{
+ DrawCompileError(dc);
+ dc.SetPen(*wxBLACK_PEN);
+ dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
+
+ wxPoint p1(m_rect.GetPosition());
+ wxPoint pA(p1.x + 25, p1.y + 0);
+ wxPoint pB(p1.x + 25, p1.y + 15);
+ dc.DrawLine(pA, pB);
+ DrawArrow(dc, pB, ArrowDown, InputPointConnected(0) ? Connected : Loose);
+ wxPoint pC(p1.x + 25, p1.y + 35);
+ wxPoint pD(p1.x + 25, p1.y + 50);
+ dc.DrawLine(pC, pD);
+ DrawArrow(dc, pD, ArrowDown, OutputPointConnected(0) ? Connected : Loose);
+
+ wxPoint ptl (p1.x, p1.y + 20);
+ wxPoint ptl1(p1.x + 15, p1.y + 20);
+ wxPoint ptr (p1.x + 50, p1.y + 20);
+ wxPoint ptr1(p1.x + 35, p1.y + 20);
+
+ wxPoint pbl (p1.x, p1.y + 30);
+ wxPoint pbl1(p1.x + 15, p1.y + 30);
+ wxPoint pbr (p1.x + 50, p1.y + 30);
+ wxPoint pbr1(p1.x + 35, p1.y + 30);
+
+ dc.DrawLine(ptl, ptl1);
+ dc.DrawLine(ptr, ptr1);
+ dc.DrawLine(pbl, pbl1);
+ dc.DrawLine(pbr, pbr1);
+
+ if (kind == WriteToFile) {
+ DrawArrow(dc, ptl1, ArrowRight, Loose);
+ DrawArrow(dc, pbl1, ArrowRight, Loose);
+ DrawArrow(dc, ptr1, ArrowLeft, Loose);
+ DrawArrow(dc, pbr1, ArrowLeft, Loose);
+ } else {
+ DrawArrow(dc, ptl, ArrowLeft, Loose);
+ DrawArrow(dc, pbl, ArrowLeft, Loose);
+ DrawArrow(dc, ptr, ArrowRight, Loose);
+ DrawArrow(dc, pbr, ArrowRight, Loose);
+ }
+
+ DrawBox(dc, 15, 15, 20, 20);
+ int xl = p1.x + 15 + 4;
+ int xr = p1.x + 15 + 16;
+ for (int i = 1; i < 5; i++) {
+ int y = p1.y + 15 + (i * 4);
+ wxPoint a(xl, y);
+ wxPoint b(xr, y);
+ dc.DrawLine(a, b);
+ }
+
+ DndShape::Draw(dc);
+}
+
+
+bool DndShapeFileIo::WriteThisShapeInfo(wxTextFile & file)
+{
+ file.AddLine(wxString::Format(" \"%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()));
+
+ 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(" \"File Name\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
+
+ file.AddLine(wxString::Format(" \"answering machine node\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
+
+ file.AddLine(wxString::Format(" },"));
+
+ return true;
+}
+
+bool DndShapeFileIo::WriteSystemCode(wxTextFile & file)
+{
+ if (kind == WriteToFile)
+ file.AddLine(" 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\"]) ");
+ if (kind == WriteToFile)
+ file.AddLine(" 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("");
+ return true;
+}
Added: sofaswitch/trunk/callflow/src/fileio.h
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/fileio.h Tue Sep 26 01:11:42 2006
@@ -0,0 +1,35 @@
+#ifndef FILE_IO_H
+
+#define FILE_IO_H
+
+#include "dnd.h"
+
+///////////////////////////////////////////////////////////////////////////
+/**Define a "audio to/from file" shape. Well, not quite. This shape is created
+ solely for the benefit of the DndShapeWriteToFile and DndShapeReadFromfile
+ shapes. This class is used in rendering the WriteToFile and ReadFromFile
+ shapes to the drawing area on screen. */
+class DndShapeFileIo : public DndShape
+{
+public:
+ /**Construtor, Define this shape in terms of size and points etc */
+ DndShapeFileIo(Kind kindToWrite);
+
+ /**Draw this particular shape to the screen. This method examines the
+ local kind variable to determine which direction to draw the arrows..*/
+ virtual void Draw(wxDC& dc);
+
+ /**Write the dictionary containing relevant points for this shape. This
+ shape info is identical for when we are putting audio in a file, or
+ reading audio from a file.*/
+ virtual bool WriteThisShapeInfo(wxTextFile & file);
+
+ /**Write the code generic to this shape. If it is a write to file, or read
+ from file type, is determined by the kind member variable in the
+ ancesort class DndShape. */
+ virtual bool WriteSystemCode(wxTextFile & file);
+};
+
+
+#endif // FILE_IO_H
+
1
0
Author: derek
Date: Tue Sep 26 01:10:29 2006
New Revision: 130
Modified:
sofaswitch/trunk/callflow/src/Makefile.am
sofaswitch/trunk/callflow/src/Makefile.in
sofaswitch/trunk/callflow/src/callflow.cpp
sofaswitch/trunk/callflow/src/dnd.h
sofaswitch/trunk/callflow/src/readfromfile.cpp
sofaswitch/trunk/callflow/src/readfromfile.h
sofaswitch/trunk/callflow/src/writetofile.cpp
sofaswitch/trunk/callflow/src/writetofile.h
Log:
Add read from file/write to file for answering machine.
Fixes, to get it working corectly.
Modified: sofaswitch/trunk/callflow/src/Makefile.am
==============================================================================
--- sofaswitch/trunk/callflow/src/Makefile.am (original)
+++ sofaswitch/trunk/callflow/src/Makefile.am Tue Sep 26 01:10:29 2006
@@ -59,6 +59,8 @@
endhere.h \
eventer.cpp \
eventer.h \
+ fileio.cpp \
+ fileio.h \
information.cpp \
information.h \
joinblocks.cpp \
Modified: sofaswitch/trunk/callflow/src/Makefile.in
==============================================================================
--- sofaswitch/trunk/callflow/src/Makefile.in (original)
+++ sofaswitch/trunk/callflow/src/Makefile.in Tue Sep 26 01:10:29 2006
@@ -51,12 +51,13 @@
am_callflow_OBJECTS = callflow.$(OBJEXT) canvas.$(OBJEXT) \
conditional.$(OBJEXT) dnd.$(OBJEXT) drawshape.$(OBJEXT) \
endcall.$(OBJEXT) endfor.$(OBJEXT) endhere.$(OBJEXT) \
- eventer.$(OBJEXT) information.$(OBJEXT) joinblocks.$(OBJEXT) \
- listpoints.$(OBJEXT) loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) \
- python.$(OBJEXT) requestnode.$(OBJEXT) senddtmf.$(OBJEXT) \
- shapelist.$(OBJEXT) shapeselect.$(OBJEXT) startfor.$(OBJEXT) \
- starthere.$(OBJEXT) stoptimer.$(OBJEXT) timer.$(OBJEXT) \
- transfermedia.$(OBJEXT)
+ eventer.$(OBJEXT) fileio.$(OBJEXT) information.$(OBJEXT) \
+ joinblocks.$(OBJEXT) listpoints.$(OBJEXT) \
+ loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) python.$(OBJEXT) \
+ readfromfile.$(OBJEXT) requestnode.$(OBJEXT) \
+ senddtmf.$(OBJEXT) shapelist.$(OBJEXT) shapeselect.$(OBJEXT) \
+ startfor.$(OBJEXT) starthere.$(OBJEXT) stoptimer.$(OBJEXT) \
+ timer.$(OBJEXT) transfermedia.$(OBJEXT) writetofile.$(OBJEXT)
callflow_OBJECTS = $(am_callflow_OBJECTS)
am__DEPENDENCIES_1 =
callflow_DEPENDENCIES = $(am__DEPENDENCIES_1)
@@ -216,6 +217,8 @@
../bitmaps/newshape.xpm \
../bitmaps/senddtmf.xpm \
../bitmaps/stoptimer.xpm \
+ ../bitmaps/readfromfile.xpm \
+ ../bitmaps/writetofile.xpm \
../bitmaps/transfermedia.xpm \
callflow.cpp \
callflow.h \
@@ -235,6 +238,8 @@
endhere.h \
eventer.cpp \
eventer.h \
+ fileio.cpp \
+ fileio.h \
information.cpp \
information.h \
joinblocks.cpp \
@@ -247,6 +252,8 @@
makecall.h \
python.cpp \
python.h \
+ readfromfile.cpp \
+ readfromfile.h \
requestnode.cpp \
requestnode.h \
senddtmf.cpp \
@@ -264,7 +271,9 @@
timer.cpp \
timer.h \
transfermedia.cpp \
- transfermedia.h
+ transfermedia.h \
+ writetofile.cpp \
+ writetofile.h
all: all-am
@@ -346,12 +355,14 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endfor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endhere.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/information.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/joinblocks.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listpoints.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadnewgraph.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makecall.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/python.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readfromfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/requestnode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/senddtmf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapelist.Po@am__quote@
@@ -361,6 +372,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stoptimer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transfermedia.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/writetofile.Po@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
Modified: sofaswitch/trunk/callflow/src/callflow.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.cpp (original)
+++ sofaswitch/trunk/callflow/src/callflow.cpp Tue Sep 26 01:10:29 2006
@@ -86,7 +86,7 @@
EVT_MENU ( wxH_CONTROLSTIMER, MyFrame::OnControlsTimer)
EVT_MENU ( wxH_CONTROLSTRANSFERMEDIA, MyFrame::OnControlsTransferMedia)
EVT_MENU ( wxH_CONTROLSREADFROMFILE, MyFrame::OnControlsReadFromFile)
- EVT_MENU ( wxH_CONTROLSWRITETOFILE, MyFrame::onControlsWriteToFile)
+ EVT_MENU ( wxH_CONTROLSWRITETOFILE, MyFrame::OnControlsWriteToFile)
EVT_MENU ( wxH_EDITCOPY, MyFrame::OnEditCopy)
EVT_MENU ( wxH_EDITCUT, MyFrame::OnEditCut)
EVT_MENU ( wxH_EDITPASTE, MyFrame::OnEditPaste)
Modified: sofaswitch/trunk/callflow/src/dnd.h
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.h (original)
+++ sofaswitch/trunk/callflow/src/dnd.h Tue Sep 26 01:10:29 2006
@@ -267,7 +267,7 @@
/**14*/ Eventer /**Mark me as registering for an event. Possibly, wait for the registered for event */,
/**15*/ TransferMedia /**Transfer media from one sofaswitch entity to another */,
/**16*/ ReadFromFile /**Read audio from a .wav file (answering machine specific) */,
- /**17*/ WriteToFile /**Write audio into a .wav file (answering machine specific) */
+ /**17*/ WriteToFile /**Write audio into a .wav file (answering machine specific) */,
/**18*/ LoadNewGraph /**Read in an existing graph file (pre compiled) for a new thread of exeuction */,
/**19*/ SendDtmf /**Send a dtmf symbol to some sofaswitch worker node */,
/* 20*/ KnownShapes /**Indicates the number of known shapes we can manage */
Modified: sofaswitch/trunk/callflow/src/readfromfile.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/readfromfile.cpp (original)
+++ sofaswitch/trunk/callflow/src/readfromfile.cpp Tue Sep 26 01:10:29 2006
@@ -13,103 +13,25 @@
#include "shapelist.h"
-#include "requestnode.h"
+#include "readfromfile.h"
/////////////////////////////////////////////////////////////////////////////
-
-
-
-DndShapeRequestNode::DndShapeRequestNode()
- : DndShape(RequestNode)
+DndShapeReadFromFile::DndShapeReadFromFile()
+ : DndShapeFileIo(ReadFromFile)
{
wxSize newSize(50, 50);
SetSize(newSize);
displayData[displayData.size()] =
- InformationSection(wxT("Request node from"), wxT("voip"));
+ InformationSection(wxT("Filename to read audio from"), wxT("src_audio.wav"));
+
displayData[displayData.size()] =
- InformationSection(wxT("Timer period (seconds)"), wxT("1"));
-
- displayData[displayData.size()] =
- InformationSection(wxT("Timer label"), wxT("request node"));
+ InformationSection(wxT("answering machine node"), wxT("Answering machine worker node"));
-
relInputPoints.Add(25, 0);
relOutputPoints.Add(25, 50);
AdjustIoPoints();
-}
-
-void DndShapeRequestNode::Draw(wxDC& dc)
-{
- DrawCompileError(dc);
- dc.SetPen(*wxBLACK_PEN);
-
- wxPoint p1(m_rect.GetPosition());
- wxPoint pA(p1.x + 25, p1.y + 0);
- wxPoint pB(p1.x + 25, p1.y + 50);
-
-
- dc.DrawLine(pA, pB);
-
- wxString text("R ?");
- wxFont f = wxFont(*wxITALIC_FONT);
- f.SetPointSize(20);
- dc.SetFont(f);//*wxITALIC_FONT);
- wxCoord w, h;
- dc.GetTextExtent(text, &w, &h);
-
- int xPos = m_rect.x + 0 + ((50 - w)/2);
- int yPos = m_rect.y + 10 + ((21 - h)/2);
- dc.DrawText(text, xPos, yPos);
-
- DrawArrow(dc, pA, ArrowDown, InputPointConnected(0) ? Connected : Loose);
- DrawArrow(dc, pB, ArrowDown, OutputPointConnected(0) ? Connected : Loose);
-
- DndShape::Draw(dc);
-}
-
-bool DndShapeRequestNode::WriteSystemCode(wxTextFile & file)
-{
- file.AddLine(" def Request_Node(self, aTuple): ");
- file.AddLine(" a,y,z = aTuple ");
- file.AddLine(" eName = self.data[a][\"Timer label\"] ");
- file.AddLine(" self.pendingEvents[eName] = a ");
- file.AddLine(" reactor.callLater(self.data[a][\"Timer period\"], self.timerObjectExpired, eName)");
- file.AddLine(" rhost = self.data[a][\"Request node from\"] ");
- file.AddLine(" rhost += \":REQUESTNEWID\\0\" ");
- file.AddLine(" self.transport.write(rhost) ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine("");
- return true;
-}
-
-bool DndShapeRequestNode::WriteThisShapeInfo(wxTextFile & file)
-{
- file.AddLine(wxString::Format(" \"%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()));
-
- 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(" \"Request node from\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
-
- file.AddLine(wxString::Format(" \"Timer period\" : "));
- file.AddLine(wxString::Format(" %s, ", displayData[2].data.c_str()));
-
- file.AddLine(wxString::Format(" \"Timer label\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[3].data.c_str()));
-
- file.AddLine(wxString::Format(" },"));
-
- return true;
}
Modified: sofaswitch/trunk/callflow/src/readfromfile.h
==============================================================================
--- sofaswitch/trunk/callflow/src/readfromfile.h (original)
+++ sofaswitch/trunk/callflow/src/readfromfile.h Tue Sep 26 01:10:29 2006
@@ -1,39 +1,24 @@
-#ifndef REQUEST_NODE_H
+#ifndef READ_FROM_FILE_H
-#define REQUEST_NODE_H
+#define READ_FROM_FILE_H
-#include "dnd.h"
+#include "fileio.h"
///////////////////////////////////////////////////////////////////////////
-/**Define a request node shape. This code will return almost immediately, and
- we leave it to the timer object to recover from if there was an answer, or
- noting Store values for size, location, input & output points. This
- instance has the ability to draw this shape to a specified location on the
- canvas */
-class DndShapeRequestNode : public DndShape
+/**Define a "read from file" node shape. This shape is answering machine
+ specific, and is used when the answering machine is sending audio to some
+ other sofaswitch worker. The file read from is the source of audio.
+ The file is a .wav file */
+class DndShapeReadFromFile : public DndShapeFileIo
{
public:
/**Construtor, Define this shape in terms of size and points etc */
- DndShapeRequestNode();
+ DndShapeReadFromFile();
- /**Destroy this shape, and log it */
- virtual ~DndShapeRequestNode()
- {
- }
-
- /**Draw this particular shape to the screen..*/
- virtual void Draw(wxDC& dc);
-
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Request Node"); }
-
- /**Write the code generic to this StartHere shape */
- virtual bool WriteSystemCode(wxTextFile & file);
-
- /**Write the dictionary containing relevant points for this shape */
- virtual bool WriteThisShapeInfo(wxTextFile & file);
+ static wxString GetKindName() { return wxString("Read From File"); }
};
-#endif
+#endif //READ_FROM_FILE_H
Modified: sofaswitch/trunk/callflow/src/writetofile.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/writetofile.cpp (original)
+++ sofaswitch/trunk/callflow/src/writetofile.cpp Tue Sep 26 01:10:29 2006
@@ -13,103 +13,25 @@
#include "shapelist.h"
-#include "requestnode.h"
+#include "writetofile.h"
/////////////////////////////////////////////////////////////////////////////
-
-
-
-DndShapeRequestNode::DndShapeRequestNode()
- : DndShape(RequestNode)
+DndShapeWriteToFile::DndShapeWriteToFile()
+ : DndShapeFileIo(WriteToFile)
{
wxSize newSize(50, 50);
SetSize(newSize);
displayData[displayData.size()] =
- InformationSection(wxT("Request node from"), wxT("voip"));
+ InformationSection(wxT("Filename to contain new audio"), wxT("empty_file.wav"));
+
displayData[displayData.size()] =
- InformationSection(wxT("Timer period (seconds)"), wxT("1"));
-
- displayData[displayData.size()] =
- InformationSection(wxT("Timer label"), wxT("request node"));
+ InformationSection(wxT("answering machine node"), wxT("Answering machine worker node"));
-
relInputPoints.Add(25, 0);
relOutputPoints.Add(25, 50);
AdjustIoPoints();
-}
-
-void DndShapeRequestNode::Draw(wxDC& dc)
-{
- DrawCompileError(dc);
- dc.SetPen(*wxBLACK_PEN);
-
- wxPoint p1(m_rect.GetPosition());
- wxPoint pA(p1.x + 25, p1.y + 0);
- wxPoint pB(p1.x + 25, p1.y + 50);
-
-
- dc.DrawLine(pA, pB);
-
- wxString text("R ?");
- wxFont f = wxFont(*wxITALIC_FONT);
- f.SetPointSize(20);
- dc.SetFont(f);//*wxITALIC_FONT);
- wxCoord w, h;
- dc.GetTextExtent(text, &w, &h);
-
- int xPos = m_rect.x + 0 + ((50 - w)/2);
- int yPos = m_rect.y + 10 + ((21 - h)/2);
- dc.DrawText(text, xPos, yPos);
-
- DrawArrow(dc, pA, ArrowDown, InputPointConnected(0) ? Connected : Loose);
- DrawArrow(dc, pB, ArrowDown, OutputPointConnected(0) ? Connected : Loose);
-
- DndShape::Draw(dc);
-}
-
-bool DndShapeRequestNode::WriteSystemCode(wxTextFile & file)
-{
- file.AddLine(" def Request_Node(self, aTuple): ");
- file.AddLine(" a,y,z = aTuple ");
- file.AddLine(" eName = self.data[a][\"Timer label\"] ");
- file.AddLine(" self.pendingEvents[eName] = a ");
- file.AddLine(" reactor.callLater(self.data[a][\"Timer period\"], self.timerObjectExpired, eName)");
- file.AddLine(" rhost = self.data[a][\"Request node from\"] ");
- file.AddLine(" rhost += \":REQUESTNEWID\\0\" ");
- file.AddLine(" self.transport.write(rhost) ");
- file.AddLine(" return self.data[a][\"Output\"] ");
- file.AddLine("");
- return true;
-}
-
-bool DndShapeRequestNode::WriteThisShapeInfo(wxTextFile & file)
-{
- file.AddLine(wxString::Format(" \"%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()));
-
- 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(" \"Request node from\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
-
- file.AddLine(wxString::Format(" \"Timer period\" : "));
- file.AddLine(wxString::Format(" %s, ", displayData[2].data.c_str()));
-
- file.AddLine(wxString::Format(" \"Timer label\" : "));
- file.AddLine(wxString::Format(" \"%s\", ", displayData[3].data.c_str()));
-
- file.AddLine(wxString::Format(" },"));
-
- return true;
}
Modified: sofaswitch/trunk/callflow/src/writetofile.h
==============================================================================
--- sofaswitch/trunk/callflow/src/writetofile.h (original)
+++ sofaswitch/trunk/callflow/src/writetofile.h Tue Sep 26 01:10:29 2006
@@ -1,39 +1,25 @@
-#ifndef REQUEST_NODE_H
+#ifndef WRITE_TO_FILE_H
-#define REQUEST_NODE_H
+#define WRITE_TO_FILE_H
-#include "dnd.h"
-
+#include "fileio.h"
///////////////////////////////////////////////////////////////////////////
-/**Define a request node shape. This code will return almost immediately, and
- we leave it to the timer object to recover from if there was an answer, or
- noting Store values for size, location, input & output points. This
- instance has the ability to draw this shape to a specified location on the
- canvas */
-class DndShapeRequestNode : public DndShape
+/**Define a "write audio to file" node shape. This shape is answering machine
+ specific, and is used when the answering machine is collecting audio from
+ some other sofaswitch worker (which is then stored on disk). The file
+ written to is the audio.received from the other sofa sofaswitch worker.
+ The file is a .wav file */
+class DndShapeWriteToFile : public DndShapeFileIo
{
public:
/**Construtor, Define this shape in terms of size and points etc */
- DndShapeRequestNode();
+ DndShapeWriteToFile();
- /**Destroy this shape, and log it */
- virtual ~DndShapeRequestNode()
- {
- }
- /**Draw this particular shape to the screen..*/
- virtual void Draw(wxDC& dc);
-
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Request Node"); }
-
- /**Write the code generic to this StartHere shape */
- virtual bool WriteSystemCode(wxTextFile & file);
-
- /**Write the dictionary containing relevant points for this shape */
- virtual bool WriteThisShapeInfo(wxTextFile & file);
+ static wxString GetKindName() { return wxString("Write To File"); }
};
-#endif
+#endif // WRITE_TO_FILE_H
1
0
Author: derek
Date: Mon Sep 25 22:42:11 2006
New Revision: 129
Modified:
sofaswitch/trunk/callflow/src/Makefile.am
sofaswitch/trunk/callflow/src/Makefile.in
sofaswitch/trunk/callflow/src/callflow.cpp
sofaswitch/trunk/callflow/src/callflow.h
sofaswitch/trunk/callflow/src/conditional.cpp
sofaswitch/trunk/callflow/src/dnd.cpp
sofaswitch/trunk/callflow/src/dnd.h
sofaswitch/trunk/callflow/src/drawshape.h
sofaswitch/trunk/callflow/src/makecall.cpp
sofaswitch/trunk/callflow/src/python.cpp
sofaswitch/trunk/callflow/src/senddtmf.cpp
sofaswitch/trunk/callflow/src/senddtmf.h
sofaswitch/trunk/callflow/src/transfermedia.cpp
Log:
Commit midway through of adding new shapes.
Include several fixes to adjust handling of python variables.
Modified: sofaswitch/trunk/callflow/src/Makefile.am
==============================================================================
--- sofaswitch/trunk/callflow/src/Makefile.am (original)
+++ sofaswitch/trunk/callflow/src/Makefile.am Mon Sep 25 22:42:11 2006
@@ -7,29 +7,96 @@
override CXXFLAGS = @CXXFLAGS@ -I..
callflow_SOURCES = \
+ ../bitmaps/ContEnd.xpm \
+ ../bitmaps/ContEndFor.xpm \
+ ../bitmaps/ContFor.xpm \
+ ../bitmaps/ContStart.xpm \
+ ../bitmaps/ControlsEndHere.xpm \
+ ../bitmaps/ControlsIf.xpm \
+ ../bitmaps/Controlsend.xpm \
+ ../bitmaps/Controlsend_for.xpm \
+ ../bitmaps/Controlsfor.xpm \
+ ../bitmaps/Controlsstart.xpm \
+ ../bitmaps/EditCopy.xpm \
+ ../bitmaps/EditCut.xpm \
+ ../bitmaps/EditPaste.xpm \
+ ../bitmaps/FileE_xit.xpm \
+ ../bitmaps/FileNew.xpm \
+ ../bitmaps/FileOpen.xpm \
+ ../bitmaps/FileSave.xpm \
+ ../bitmaps/FileSave__As.xpm \
+ ../bitmaps/HelpAbout.xpm \
+ ../bitmaps/HelpManual.xpm \
+ ../bitmaps/JoinObjects.xpm \
+ ../bitmaps/Python.xpm \
+ ../bitmaps/RequestNode.xpm \
+ ../bitmaps/compile.xpm \
+ ../bitmaps/eventer.xpm \
+ ../bitmaps/makecall.xpm \
+ ../bitmaps/miniclock.xpm \
+ ../bitmaps/newgraph.xpm \
+ ../bitmaps/newshape.xpm \
+ ../bitmaps/senddtmf.xpm \
+ ../bitmaps/stoptimer.xpm \
+ ../bitmaps/readfromfile.xpm \
+ ../bitmaps/writetofile.xpm \
+ ../bitmaps/transfermedia.xpm \
callflow.cpp \
+ callflow.h \
canvas.cpp \
+ canvas.h \
conditional.cpp \
+ conditional.h \
dnd.cpp \
+ dnd.h \
drawshape.cpp \
+ drawshape.h \
endcall.cpp \
+ endcall.h \
endfor.cpp \
+ endfor.h \
endhere.cpp \
+ endhere.h \
eventer.cpp \
+ eventer.h \
information.cpp \
+ information.h \
joinblocks.cpp \
+ joinblocks.h \
listpoints.cpp \
+ listpoints.h \
loadnewgraph.cpp \
+ loadnewgraph.h \
makecall.cpp \
+ makecall.h \
python.cpp \
+ python.h \
+ readfromfile.cpp \
+ readfromfile.h \
requestnode.cpp \
+ requestnode.h \
+ senddtmf.cpp \
+ senddtmf.h \
shapelist.cpp \
+ shapelist.h \
shapeselect.cpp \
+ shapeselect.h \
startfor.cpp \
+ startfor.h \
starthere.cpp \
+ starthere.h \
stoptimer.cpp \
+ stoptimer.h \
timer.cpp \
- transfermedia.cpp
+ timer.h \
+ transfermedia.cpp \
+ transfermedia.h \
+ writetofile.cpp \
+ writetofile.h
+
+
+
+
Modified: sofaswitch/trunk/callflow/src/Makefile.in
==============================================================================
--- sofaswitch/trunk/callflow/src/Makefile.in (original)
+++ sofaswitch/trunk/callflow/src/Makefile.in Mon Sep 25 22:42:11 2006
@@ -53,9 +53,10 @@
endcall.$(OBJEXT) endfor.$(OBJEXT) endhere.$(OBJEXT) \
eventer.$(OBJEXT) information.$(OBJEXT) joinblocks.$(OBJEXT) \
listpoints.$(OBJEXT) loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) \
- python.$(OBJEXT) requestnode.$(OBJEXT) shapelist.$(OBJEXT) \
- shapeselect.$(OBJEXT) startfor.$(OBJEXT) starthere.$(OBJEXT) \
- stoptimer.$(OBJEXT) timer.$(OBJEXT) transfermedia.$(OBJEXT)
+ python.$(OBJEXT) requestnode.$(OBJEXT) senddtmf.$(OBJEXT) \
+ shapelist.$(OBJEXT) shapeselect.$(OBJEXT) startfor.$(OBJEXT) \
+ starthere.$(OBJEXT) stoptimer.$(OBJEXT) timer.$(OBJEXT) \
+ transfermedia.$(OBJEXT)
callflow_OBJECTS = $(am_callflow_OBJECTS)
am__DEPENDENCIES_1 =
callflow_DEPENDENCIES = $(am__DEPENDENCIES_1)
@@ -70,6 +71,14 @@
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(callflow_SOURCES)
DIST_SOURCES = $(callflow_SOURCES)
ETAGS = etags
@@ -176,29 +185,86 @@
SUFFIXES = .cpp .rc
callflow_LDADD = $(WX_LIBS)
callflow_SOURCES = \
+ ../bitmaps/ContEnd.xpm \
+ ../bitmaps/ContEndFor.xpm \
+ ../bitmaps/ContFor.xpm \
+ ../bitmaps/ContStart.xpm \
+ ../bitmaps/ControlsEndHere.xpm \
+ ../bitmaps/ControlsIf.xpm \
+ ../bitmaps/Controlsend.xpm \
+ ../bitmaps/Controlsend_for.xpm \
+ ../bitmaps/Controlsfor.xpm \
+ ../bitmaps/Controlsstart.xpm \
+ ../bitmaps/EditCopy.xpm \
+ ../bitmaps/EditCut.xpm \
+ ../bitmaps/EditPaste.xpm \
+ ../bitmaps/FileE_xit.xpm \
+ ../bitmaps/FileNew.xpm \
+ ../bitmaps/FileOpen.xpm \
+ ../bitmaps/FileSave.xpm \
+ ../bitmaps/FileSave__As.xpm \
+ ../bitmaps/HelpAbout.xpm \
+ ../bitmaps/HelpManual.xpm \
+ ../bitmaps/JoinObjects.xpm \
+ ../bitmaps/Python.xpm \
+ ../bitmaps/RequestNode.xpm \
+ ../bitmaps/compile.xpm \
+ ../bitmaps/eventer.xpm \
+ ../bitmaps/makecall.xpm \
+ ../bitmaps/miniclock.xpm \
+ ../bitmaps/newgraph.xpm \
+ ../bitmaps/newshape.xpm \
+ ../bitmaps/senddtmf.xpm \
+ ../bitmaps/stoptimer.xpm \
+ ../bitmaps/transfermedia.xpm \
callflow.cpp \
+ callflow.h \
canvas.cpp \
+ canvas.h \
conditional.cpp \
+ conditional.h \
dnd.cpp \
+ dnd.h \
drawshape.cpp \
+ drawshape.h \
endcall.cpp \
+ endcall.h \
endfor.cpp \
+ endfor.h \
endhere.cpp \
+ endhere.h \
eventer.cpp \
+ eventer.h \
information.cpp \
+ information.h \
joinblocks.cpp \
+ joinblocks.h \
listpoints.cpp \
+ listpoints.h \
loadnewgraph.cpp \
+ loadnewgraph.h \
makecall.cpp \
+ makecall.h \
python.cpp \
+ python.h \
requestnode.cpp \
+ requestnode.h \
+ senddtmf.cpp \
+ senddtmf.h \
shapelist.cpp \
+ shapelist.h \
shapeselect.cpp \
+ shapeselect.h \
startfor.cpp \
+ startfor.h \
starthere.cpp \
+ starthere.h \
stoptimer.cpp \
+ stoptimer.h \
timer.cpp \
- transfermedia.cpp
+ timer.h \
+ transfermedia.cpp \
+ transfermedia.h
all: all-am
@@ -287,6 +353,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makecall.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/python.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/requestnode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/senddtmf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapelist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shapeselect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/startfor.Po@am__quote@
Modified: sofaswitch/trunk/callflow/src/callflow.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.cpp (original)
+++ sofaswitch/trunk/callflow/src/callflow.cpp Mon Sep 25 22:42:11 2006
@@ -36,15 +36,18 @@
#include "bitmaps/FileSave.xpm"
#include "bitmaps/FileSave__As.xpm"
#include "bitmaps/JoinObjects.xpm"
-#include "bitmaps/makecall.xpm"
#include "bitmaps/Python.xpm"
#include "bitmaps/RequestNode.xpm"
#include "bitmaps/compile.xpm"
#include "bitmaps/eventer.xpm"
+#include "bitmaps/makecall.xpm"
#include "bitmaps/miniclock.xpm"
#include "bitmaps/newgraph.xpm"
+#include "bitmaps/readfromfile.xpm"
+#include "bitmaps/senddtmf.xpm"
#include "bitmaps/stoptimer.xpm"
#include "bitmaps/transfermedia.xpm"
+#include "bitmaps/writetofile.xpm"
class MyFrame ;
@@ -77,10 +80,13 @@
EVT_MENU ( wxH_CONTROLSMAKECALL, MyFrame::OnControlsMakeCall)
EVT_MENU ( wxH_CONTROLSPYTHON, MyFrame::OnControlspython)
EVT_MENU ( wxH_CONTROLSREQUESTNODE, MyFrame::OnControlsrequestnode)
+ EVT_MENU ( wxH_CONTROLSSENDDTMF, MyFrame::OnControlsSendDtmf)
EVT_MENU ( wxH_CONTROLSSTARTHERE, MyFrame::OnControlsstarthere)
EVT_MENU ( wxH_CONTROLSSTOPTIMER, MyFrame::OnControlsStopTimer)
EVT_MENU ( wxH_CONTROLSTIMER, MyFrame::OnControlsTimer)
EVT_MENU ( wxH_CONTROLSTRANSFERMEDIA, MyFrame::OnControlsTransferMedia)
+ EVT_MENU ( wxH_CONTROLSREADFROMFILE, MyFrame::OnControlsReadFromFile)
+ EVT_MENU ( wxH_CONTROLSWRITETOFILE, MyFrame::onControlsWriteToFile)
EVT_MENU ( wxH_EDITCOPY, MyFrame::OnEditCopy)
EVT_MENU ( wxH_EDITCUT, MyFrame::OnEditCut)
EVT_MENU ( wxH_EDITPASTE, MyFrame::OnEditPaste)
@@ -132,27 +138,30 @@
wxMenu * Help_menu = new wxMenu ;
wxMenu * Controls_menu = new wxMenu ;
wxMenu * File_menu = new wxMenu ;
- File_menu -> Append ( wxH_FILENEW, wxT("&New"), wxT(""));
- File_menu -> Append ( wxH_FILEOPEN, wxT("&Open"), wxT(""));
- File_menu -> Append ( wxH_FILESAVE, wxT("&Save"), wxT(""));
- File_menu -> Append ( wxH_FILESAVE__AS, wxT("Save &As"), wxT(""));
- File_menu -> Append ( wxH_FILEE_XIT, wxT("E&xit"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSCONNECT_OBJECTS, wxT("connect objects"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSEND, wxT("end"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSENDHERE, wxT("end here"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSEND_FOR, wxT("end for"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSEVENTER, wxT("event reg/wait"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSFOR, wxT("for"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSIF, wxT("if"), wxT(""));
+ File_menu -> Append ( wxH_FILENEW, wxT("&New"), wxT(""));
+ File_menu -> Append ( wxH_FILEOPEN, wxT("&Open"), wxT(""));
+ File_menu -> Append ( wxH_FILESAVE, wxT("&Save"), wxT(""));
+ File_menu -> Append ( wxH_FILESAVE__AS, wxT("Save &As"), wxT(""));
+ File_menu -> Append ( wxH_FILEE_XIT, wxT("E&xit"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSCONNECT_OBJECTS, wxT("connect objects"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSEND, wxT("end"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSENDHERE, wxT("end here"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSEND_FOR, wxT("end for"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSEVENTER, wxT("event reg/wait"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSFOR, wxT("for"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSIF, wxT("if"), wxT(""));
Controls_menu -> Append ( wxH_CONTROLSLOADNEWGRAPH, wxT("load pre-existing compiled graph"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSMAKECALL, wxT("make a call"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSPYTHON, wxT("python"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSREQUESTNODE, wxT("request node"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSSTARTHERE, wxT("start here"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSSTOPTIMER, wxT("stop running timer"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSTIMER, wxT("timer"), wxT(""));
- Controls_menu -> Append ( wxH_CONTROLSTRANSFERMEDIA, wxT("transfer media between entities"), wxT(""));
- Help_menu -> Append ( wxH_HELPMANUAL, wxT("Manual"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSMAKECALL, wxT("make a call"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSPYTHON, wxT("python"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSREADFROMFILE, wxT("read audio from file"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSREQUESTNODE, wxT("request node"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSSENDDTMF, wxT("send dtmf"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSSTARTHERE, wxT("start here"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSSTOPTIMER, wxT("stop running timer"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSTIMER, wxT("timer"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSTRANSFERMEDIA, wxT("transfer media between workers"), wxT(""));
+ Controls_menu -> Append ( wxH_CONTROLSWRITETOFILE, wxT("write audio to file"), wxT(""));
+ Help_menu -> Append ( wxH_HELPMANUAL, wxT("Manual"), wxT(""));
Help_menu -> AppendSeparator () ;
Help_menu -> Append ( wxH_HELPABOUT, wxT("About"), wxT(""));
Edit_menu -> Append ( wxH_EDITCUT, wxT("&Cut"), wxT(""));
@@ -221,12 +230,19 @@
file.Close();
currentFileName = filedlg.GetPath();
canvas->ReadShapeInformationFromFile(currentFileName);
+ SetStatusText(wxString::Format("Read source code from %s", currentFileName.c_str()));
+ SetNewWindowName(currentFileName);
} else {
wxMessageBox(wxString::Format("Unable to open the file %s to read from", filedlg.GetFilename().c_str()));
return;
}
}
+void MyFrame::SetNewWindowName(wxString & newFileName)
+{
+ wxString title = "CallFlow " + newFileName;
+ SetLabel(title);
+}
void MyFrame::OnFileSave (wxCommandEvent & event)
{
@@ -242,6 +258,7 @@
file.Close();
canvas->ShapeInformationToFile(currentFileName);
SetStatusText(wxString::Format("Saved source code to %s", currentFileName.c_str()));
+ SetNewWindowName(currentFileName);
} else {
wxMessageBox(wxString::Format("Unable to open the file %s for saving", currentFileName.c_str()));
return;
@@ -270,6 +287,7 @@
file.Close();
canvas->ShapeInformationToFile(currentFileName);
SetStatusText(wxString::Format("Saved source code to %s", currentFileName.c_str()));
+ SetNewWindowName(currentFileName);
}
@@ -301,7 +319,8 @@
toolBar->AddTool(wxH_CONTROLSSTARTHERE, wxBitmap ( Controlsstart ), wxT("Start processing"));
toolBar->AddTool(wxH_CONTROLSENDHERE, wxBitmap ( ControlsEndHere ), wxT("End processing"));
- toolBar->AddTool(wxH_CONTROLSREQUESTNODE, wxBitmap (RequestNode ), wxT("Query Supervisor for worker"));
+ toolBar->AddTool(wxH_CONTROLSREQUESTNODE, wxBitmap (RequestNode ), wxT("Query Supervisor for worker node"));
+ toolBar->AddTool(wxH_CONTROLSSENDDTMF, wxBitmap (senddtmf), wxT("Send DTMF string to worker node"));
toolBar->AddTool(wxH_CONTROLSIF, wxBitmap ( ControlsIf_xpm ), wxT("Test a condition"));
toolBar->AddTool(wxH_CONTROLSTIMER, wxBitmap ( miniclock_xpm ), wxT("Start a timer"));
toolBar->AddTool(wxH_CONTROLSSTOPTIMER, wxBitmap ( stoptimer ), wxT("Stop specified timer"));
@@ -312,6 +331,8 @@
toolBar->AddTool(wxH_CONTROLSPYTHON, wxBitmap ( Python_xpm ), wxT("arbitrary python code"));
toolBar->AddTool(wxH_CONTROLSCONNECT_OBJECTS, wxBitmap ( JoinObjects ),
wxT("Join objects with multi segmented lines"));
+ toolBar->AddTool(wxH_CONTROLSWRITETOFILE, wxBitmap ( writetofile ), wxT("send audio to file"));
+ toolBar->AddTool(wxH_CONTROLSREADFROMFILE, wxBitmap ( readfromfile ),wxT("read audio from file"));
toolBar->AddTool(wxH_CONTROLSTRANSFERMEDIA, wxBitmap ( transfermedia ), wxT("transfer media between workers"));
toolBar->AddTool(wxH_CONTROLSLOADNEWGRAPH, wxBitmap ( newgraph ), wxT("open existing graph file to handle new task"));
toolBar->AddSeparator() ;
@@ -340,7 +361,13 @@
canvas->SetEditingMode(MyCanvas::PlaceOneShape);
}
+void MyFrame::OnControlsSendDtmf (wxCommandEvent & WXUNUSED(event))
+{
+ imageTypeForPlacing = DndShape::SendDtmf;
+ canvas->SetEditingMode(MyCanvas::PlaceOneShape);
+}
+
void MyFrame::OnControlsend (wxCommandEvent & WXUNUSED(event))
{
imageTypeForPlacing = DndShape::EndCall;
@@ -396,6 +423,18 @@
void MyFrame::OnControlsTransferMedia (wxCommandEvent & WXUNUSED(event))
{
imageTypeForPlacing = DndShape::TransferMedia;
+ canvas->SetEditingMode(MyCanvas::PlaceOneShape);
+}
+
+void MyFrame::OnControlsReadFromFile (wxCommandEvent & WXUNUSED(event))
+{
+ imageTypeForPlacing = DndShape::ReadFromFile;
+ canvas->SetEditingMode(MyCanvas::PlaceOneShape);
+}
+
+void MyFrame::OnControlsWriteToFile (wxCommandEvent & WXUNUSED(event))
+{
+ imageTypeForPlacing = DndShape::WriteToFile;
canvas->SetEditingMode(MyCanvas::PlaceOneShape);
}
Modified: sofaswitch/trunk/callflow/src/callflow.h
==============================================================================
--- sofaswitch/trunk/callflow/src/callflow.h (original)
+++ sofaswitch/trunk/callflow/src/callflow.h Mon Sep 25 22:42:11 2006
@@ -23,9 +23,12 @@
wxH_CONTROLSMAKECALL,
wxH_CONTROLSPYTHON,
wxH_CONTROLSREQUESTNODE,
+ wxH_CONTROLSSENDDTMF,
wxH_CONTROLSSTARTHERE,
wxH_CONTROLSSTOPTIMER,
wxH_CONTROLSTIMER,
+ wxH_CONTROLSWRITETOFILE,
+ wxH_CONTROLSREADFROMFILE,
wxH_CONTROLSTRANSFERMEDIA,
wxH_EDITCOPY,
wxH_EDITCUT,
@@ -101,6 +104,19 @@
handle some audio functionality. */
void OnControlsrequestnode (wxCommandEvent & event);
+ /**Called in response to a user comand to get an answering machine worker
+ to send audio to a file */
+ void OnControlsWriteToFile (wxCommandEvent & event);
+
+ /**Called in response to a user comand to get an answering machine worker
+ to grab audio from a file, and send it to the other end */
+ void OnControlsReadFromFile (wxCommandEvent & event);
+
+ /**Called in response to a user comand to add a "Send Dtmf" widget to the
+ current graph. This widget will cause the dtmf char string to go to the
+ remote sofaswitch worker. */
+ void OnControlsSendDtmf (wxCommandEvent & event);
+
/**Called in response to a user comand to add a "End" ??? widget to the
current graph */
void OnControlsend (wxCommandEvent & event);
@@ -206,6 +222,10 @@
void CloseJoinBlocks();
protected:
+ /**Write a new name to the top of the window - the current file has changed, and
+ display the new name of the current file on the window */
+ void SetNewWindowName(wxString & newFileName);
+
/**The shape that we much add to the current graph. This shape would be,
for example, a Conditional (or if) if the user had just sent a
MyFrame::OnControlsif() command */
Modified: sofaswitch/trunk/callflow/src/conditional.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/conditional.cpp (original)
+++ sofaswitch/trunk/callflow/src/conditional.cpp Mon Sep 25 22:42:11 2006
@@ -80,14 +80,13 @@
bool DndShapeConditional::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Conditional(self, aTuple): ");
- file.AddLine(" a,b,c = aTuple");
- wxString test = wxString::Format(" if %s:",
- displayData[1].data.c_str());
- file.AddLine(test);
- file.AddLine(" return self.data[a][\"OutputTrue\"]");
- file.AddLine(" return self.data[a][\"OutputFalse\"]");
- file.AddLine("");
+ file.AddLine(" def Conditional(self, aTuple): ");
+ file.AddLine(" a,b,c = aTuple ");
+ file.AddLine(" test = self.data[a][\"Test\"] ");
+ file.AddLine(" if eval(test) : ");
+ file.AddLine(" return self.data[a][\"OutputTrue\"] ");
+ file.AddLine(" return self.data[a][\"OutputFalse\"] ");
+ file.AddLine(" ");
return true;
}
Modified: sofaswitch/trunk/callflow/src/dnd.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.cpp (original)
+++ sofaswitch/trunk/callflow/src/dnd.cpp Mon Sep 25 22:42:11 2006
@@ -366,6 +366,9 @@
if (thisKind == RequestNode)
return DndShapeRequestNode::GetKindName();
+ if (thisKind == SendDtmf)
+ return DndShapeSendDtmf::GetKindName();
+
if (thisKind == StartFor)
return DndShapeStartFor::GetKindName();
@@ -400,8 +403,14 @@
return DndShapeEventer::GetKindName();
if (thisKind == TransferMedia)
- return DndShapeTransferMedia::GetKindName();
+ return DndShapeTransferMedia::GetKindName();
+ if (thisKind == ReadFromFile)
+ return DndShapeReadFromFile::GetKindName();
+
+ if (thisKind == WriteToFile)
+ return DndShapeWriteToFile::GetKindName();
+
if (thisKind == LoadNewGraph)
return DndShapeLoadNewGraph::GetKindName();
@@ -498,13 +507,16 @@
case LoadNewGraph: return new DndShapeLoadNewGraph();
case MakeCall: return new DndShapeMakeCall();
case Python: return new DndShapePython();
+ case ReadFromFile: return new DndShapeReadFromFile();
case RequestNode: return new DndShapeRequestNode();
case Select: return new DndShapeSelect();
+ case SendDtmf: return new DndShapeSendDtmf();
case StartFor: return new DndShapeStartFor();
case StartHere: return new DndShapeStartHere();
case StopTimer: return new DndShapeStopTimer();
case Timer: return new DndShapeTimer();
case TransferMedia: return new DndShapeTransferMedia();
+ case WriteToFile: return new DndShapeWriteToFile();
default:
printf("Unknown construction of shape %d\n", shapeRequired);
}
Modified: sofaswitch/trunk/callflow/src/dnd.h
==============================================================================
--- sofaswitch/trunk/callflow/src/dnd.h (original)
+++ sofaswitch/trunk/callflow/src/dnd.h Mon Sep 25 22:42:11 2006
@@ -266,8 +266,11 @@
/**13*/ StopTimer /**Stop a running timer, so it will not generate an event etc */,
/**14*/ Eventer /**Mark me as registering for an event. Possibly, wait for the registered for event */,
/**15*/ TransferMedia /**Transfer media from one sofaswitch entity to another */,
- /**16*/ LoadNewGraph /**Read in an existing graph file (pre compiled) for a new thread of exeuction */,
- /* 15*/ KnownShapes /**Indicates the number of known shapes we can manage */
+ /**16*/ ReadFromFile /**Read audio from a .wav file (answering machine specific) */,
+ /**17*/ WriteToFile /**Write audio into a .wav file (answering machine specific) */
+ /**18*/ LoadNewGraph /**Read in an existing graph file (pre compiled) for a new thread of exeuction */,
+ /**19*/ SendDtmf /**Send a dtmf symbol to some sofaswitch worker node */,
+ /* 20*/ KnownShapes /**Indicates the number of known shapes we can manage */
};
/**Constructor to a predefined shape */
Modified: sofaswitch/trunk/callflow/src/drawshape.h
==============================================================================
--- sofaswitch/trunk/callflow/src/drawshape.h (original)
+++ sofaswitch/trunk/callflow/src/drawshape.h Mon Sep 25 22:42:11 2006
@@ -10,12 +10,14 @@
#include "loadnewgraph.h"
#include "makecall.h"
#include "python.h"
+#include "readfromfile.h"
#include "requestnode.h"
+#include "senddtmf.h"
#include "shapeselect.h"
#include "startfor.h"
#include "starthere.h"
#include "timer.h"
#include "transfermedia.h"
-
+#include "writetofile.h"
#endif
Modified: sofaswitch/trunk/callflow/src/makecall.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/makecall.cpp (original)
+++ sofaswitch/trunk/callflow/src/makecall.cpp Mon Sep 25 22:42:11 2006
@@ -39,7 +39,7 @@
{
file.AddLine(" def Make_Call(self, sTuple): ");
file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" rhost = self.data[a][\"worker node\"] ");
+ file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) ");
file.AddLine(" rhost += \":CALLNODE \" + self.data[a][\"call destination\"] + \"\\0\" ");
file.AddLine(" self.transport.write(rhost) ");
file.AddLine(" return self.data[a][\"Output\"] ");
@@ -59,10 +59,10 @@
file.AddLine(wxString::Format(" %s, ", outputLabel.c_str()));
file.AddLine(wxString::Format(" \"worker node\" : "));
- file.AddLine(wxString::Format(" %s, ", displayData[1].data.c_str()));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
file.AddLine(wxString::Format(" \"call destination\" : "));
- file.AddLine(wxString::Format(" %s, ", displayData[2].data.c_str()));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
file.AddLine(wxString::Format(" },"));
Modified: sofaswitch/trunk/callflow/src/python.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/python.cpp (original)
+++ sofaswitch/trunk/callflow/src/python.cpp Mon Sep 25 22:42:11 2006
@@ -36,6 +36,7 @@
{
DrawCompileError(dc);
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
+ dc.SetPen(*wxBLACK_PEN);
wxPoint p1(m_rect.GetPosition());
wxPoint pA(p1.x + 25, p1.y + 15);
Modified: sofaswitch/trunk/callflow/src/senddtmf.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/senddtmf.cpp (original)
+++ sofaswitch/trunk/callflow/src/senddtmf.cpp Mon Sep 25 22:42:11 2006
@@ -13,12 +13,12 @@
#include "shapelist.h"
-#include "makecall.h"
+#include "senddtmf.h"
/////////////////////////////////////////////////////////////////////////////
-DndShapeMakeCall::DndShapeMakeCall()
- : DndShape(MakeCall)
+DndShapeSendDtmf::DndShapeSendDtmf()
+ : DndShape(SendDtmf)
{
wxSize newSize(50, 50);
SetSize(newSize);
@@ -35,12 +35,12 @@
AdjustIoPoints();
}
-bool DndShapeMakeCall::WriteSystemCode(wxTextFile & file)
+bool DndShapeSendDtmf::WriteSystemCode(wxTextFile & file)
{
file.AddLine(" def Make_Call(self, sTuple): ");
file.AddLine(" a,b,c = sTuple ");
file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) ");
- file.AddLine(" rhost += \":CALLNODE \" + self.data[a][\"call destination\"] + \"\\0\" ");
+ file.AddLine(" rhost += \":SENDDTMF \" + eval(self.data[a][\"dtmf to send\"]) + \"\\0\" ");
file.AddLine(" self.transport.write(rhost) ");
file.AddLine(" return self.data[a][\"Output\"] ");
file.AddLine("");
@@ -48,7 +48,7 @@
return true;
}
-bool DndShapeMakeCall::WriteThisShapeInfo(wxTextFile & file)
+bool DndShapeSendDtmf::WriteThisShapeInfo(wxTextFile & file)
{
file.AddLine(wxString::Format(" \"%s\" : { ", GetKey().c_str()));
@@ -61,7 +61,7 @@
file.AddLine(wxString::Format(" \"worker node\" : "));
file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
- file.AddLine(wxString::Format(" \"call destination\" : "));
+ file.AddLine(wxString::Format(" \"dtmf to send\" : "));
file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
file.AddLine(wxString::Format(" },"));
@@ -70,7 +70,7 @@
}
-void DndShapeMakeCall::Draw(wxDC& dc)
+void DndShapeSendDtmf::Draw(wxDC& dc)
{
DrawCompileError(dc);
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
@@ -78,21 +78,20 @@
wxPoint p1(m_rect.GetPosition());
wxPoint pA(p1.x + 25, p1.y);
- wxPoint pB(p1.x + 25, p1.y + 10);
+ wxPoint pB(p1.x + 25, p1.y + 15);
- wxPoint pY(p1.x + 25, p1.y + 40);
+ wxPoint pY(p1.x + 25, p1.y + 35);
wxPoint pZ(p1.x + 25, p1.y + 50);
- wxPoint pL(p1.x + 3, p1.y+14);
- wxPoint pR(p1.x + 47, p1.y + 16);
- wxPoint pM(p1.x + 22, p1.y + 12);
- wxPoint pL1(pL.x + 0, pL.y+1);
- wxPoint pR1(pR.x + 0, pR.y + 1);
- dc.DrawLine(pL, pM);
- dc.DrawLine(pR, pM);
- dc.DrawLine(pL1, pM);
- dc.DrawLine(pR1, pM);
-
+ wxPoint pL(p1.x + 3, p1.y+15);
+ wxPoint pR(p1.x + 47, p1.y + 15);
+ wxPoint pL1(pL.x, pL.y + 20);
+ wxPoint pR1(pR.x, pR.y + 20);
+ dc.DrawLine(pL, pR);
+ dc.DrawLine(pL1, pR1);
+ DrawArrow(dc, pR, ArrowRight, Loose);
+ DrawArrow(dc, pR1, ArrowRight, Loose);
+
dc.DrawLine(pA, pB);
if (InputPointConnected(0))
DrawArrow(dc, pB, ArrowDown, Connected);
@@ -106,14 +105,15 @@
DrawArrow(dc, pZ, ArrowDown, Loose);
wxFont f = wxFont(*wxITALIC_FONT);
- f.SetPointSize(7);
+ f.SetPointSize(12);
dc.SetFont(f);
- for (int i = 0; i < 9; i++){
- wxString text = wxString::Format("%d", i+1);
+ wxString msg("DTMF");
+ for (int i = 0; i < 4; i++){
+ wxString text = msg.Mid(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);
+ int xPos = m_rect.x + 17 + (i*9) - (w/2);
+ int yPos = m_rect.y + 26 - (h/2);
dc.DrawText(text, xPos, yPos);
}
Modified: sofaswitch/trunk/callflow/src/senddtmf.h
==============================================================================
--- sofaswitch/trunk/callflow/src/senddtmf.h (original)
+++ sofaswitch/trunk/callflow/src/senddtmf.h Mon Sep 25 22:42:11 2006
@@ -1,34 +1,34 @@
-#ifndef MAKE_CALL_H
-#define MAKE_CALL_H
+#ifndef SEND_DTMF_H
+#define SEND_DTMF_H
#include "dnd.h"
//////////////////////////////////////////////////////////////////////////////////////////////
-/**Define a create a call shape. Store values for size, location, input & output points.
+/**Define a create a send dtmf shape. . Store values for size, location, input & output points.
This instance has the ability to draw this shape to a specified location on the canvas */
-class DndShapeMakeCall : public DndShape
+class DndShapeSendDtmf : public DndShape
{
public:
/**Construtor, Define this shape in terms of size and points etc */
- DndShapeMakeCall();
+ DndShapeSendDtmf();
/**Destroy this shape, and log it */
- virtual ~DndShapeMakeCall()
+ virtual ~DndShapeSendDtmf()
{
}
/**Draw this particular shape to the screen..*/
virtual void Draw(wxDC& dc);
- /**Write the code generic to this Make Call shape */
+ /**Write the code generic to this Send DTMF shape */
virtual bool WriteSystemCode(wxTextFile & file);
/**Write the dictionary containing relevant points for this shape */
virtual bool WriteThisShapeInfo(wxTextFile & file);
/** Used to report the name of this particular class. */
- static wxString GetKindName() { return wxString("Make Call"); }
+ static wxString GetKindName() { return wxString("Send Dtmf"); }
};
-#endif // MAKE_CALL_H
+#endif // SEND_DTMF_H
Modified: sofaswitch/trunk/callflow/src/transfermedia.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/transfermedia.cpp (original)
+++ sofaswitch/trunk/callflow/src/transfermedia.cpp Mon Sep 25 22:42:11 2006
@@ -69,12 +69,12 @@
bool DndShapeTransferMedia::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def TransferMedia(self, sTuple): ");
+ file.AddLine(" def Transfer_Media(self, sTuple): ");
file.AddLine(" a,b,c = sTuple ");
- file.AddLine(" rhost = self.data[a][\"worker node\"] ");
- file.AddLine(" rhost += \":TRANSFERUDP \" + self.data[a][\"worker receiver\"] + \"\\0\" ");
+ file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) ");
+ file.AddLine(" rhost += \":TRANSFERUDP \" + eval(self.data[a][\"worker receiver\"]) + \"\\0\" ");
file.AddLine(" self.transport.write(rhost) ");
- file.AddLine(" return self.data[a][\"Output\"] ");
+ file.AddLine(" return self.data[a][\"Output\"] ");
file.AddLine("");
return true;
1
0
Author: derek
Date: Mon Sep 25 22:41:05 2006
New Revision: 128
Added:
sofaswitch/trunk/callflow/bitmaps/readfromfile.xpm
sofaswitch/trunk/callflow/bitmaps/writetofile.xpm
Modified:
sofaswitch/trunk/callflow/bitmaps/transfermedia.xpm
Log:
Add read from/write to files, which are answering machine specific.
Fix the image of the transfermedia icon.
Added: sofaswitch/trunk/callflow/bitmaps/readfromfile.xpm
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/bitmaps/readfromfile.xpm Mon Sep 25 22:41:05 2006
@@ -0,0 +1,40 @@
+/* XPM */
+static char *readfromfile[]={
+"32 32 5 1",
+"a c None",
+"# c None",
+"b c #000000",
+"c c #585858",
+". c #58a8ff",
+".......###################......",
+".a.aaa####################aaaa..",
+"#.aa..aaaaaaaaaaaaaaaaaa#aa#...#",
+"##.#aa.a##############aaaa..a#a#",
+"##a.aaa.###############a..aaa.##",
+"########bbbbbbbbbbbbbbbb########",
+"########b##############b########",
+"########b##############b########",
+"########b#cccccccccccc#b########",
+"########b##############b########",
+"##a#####b##############b########",
+"#aa#####b##############b########",
+"#aa#####b##############b####aa##",
+"#aaa#a##b#cccccccccccc#b###aaa##",
+"aaaaaaaab##############b##aaa###",
+"aaaaaaaab##############baaaaaaaa",
+"aaaaaa##b##############b##aaaaaa",
+"##aaa###b#cccccccccccc#b###aaa##",
+"##a#####b##############b###a####",
+"########b##############b##aa####",
+"########b##############b##a#####",
+"########b#cccccccccccc#b##a#####",
+"########b##############b##a#####",
+"########b##############b#a######",
+"########b##############b#a######",
+"########b##############b#a######",
+"########b##############b#a#a#a##",
+"###.####bbbbbbbbbbbbbbbb..aa.a#a",
+"##.aa...################aa.aa.aa",
+"#.a..aaa################aa#a.a.#",
+"a..a#aa################aa#aaa..a",
+"......a##################a......"};
Modified: sofaswitch/trunk/callflow/bitmaps/transfermedia.xpm
==============================================================================
--- sofaswitch/trunk/callflow/bitmaps/transfermedia.xpm (original)
+++ sofaswitch/trunk/callflow/bitmaps/transfermedia.xpm Mon Sep 25 22:41:05 2006
@@ -1,10 +1,13 @@
/* XPM */
static char *transfermedia[]={
-"32 32 4 1",
+"32 32 7 1",
+"e c None",
". c None",
"# c #000000",
+"d c #808080",
+"c c #dcdcdc",
"b c #ff0000",
-"a c #ffffc0",
+"a c #ffff00",
"................................",
"................................",
"................................",
@@ -13,23 +16,23 @@
"................................",
"................................",
"......#.........aa.......#......",
-".....##.........aaaa.....##.....",
-"....#.#.........abbaaa...#.#....",
-"####..#.aaaaaaaaabbbbbaa.#..####",
-"#..#..#.aaaaaaaaabbbbbaa.#..#..#",
-"#..#..#.........abbaaa...#..#..#",
-"#..#..#.........aaaa.....#..#..#",
-"#..#..#.........aa.......#..#..#",
-"#..#..#..................#..#..#",
-"#..#..#..................#..#..#",
-"#..#..#..................#..#..#",
-"#..#..#.......aa.........#..#..#",
-"#..#..#.....aaaa.........#..#..#",
-"#..#..#...aaabba.........#..#..#",
-"#..#..#.aabbbbbaaaaaaaaa.#..#..#",
-"####..#.aabbbbbaaaaaaaaa.#..####",
-"....#.#...aaabba.........#.#....",
-".....##.....aaaa.........##.....",
+".....##.........bbaa.....##.....",
+"....#c#.........bbbaaa...#c#....",
+"####cc#.aaaaaaaaabbbbbaa.#cc####",
+"#dd#cc#.aaaaaaaaabbbbbaa.#cc#dd#",
+"#dd#cc#.........bbbaaa...#cc#dd#",
+"#dd#cc#.........bbaa.....#cc#dd#",
+"#dd#cc#.........aa.......#cc#dd#",
+"#dd#cc#..................#cc#dd#",
+"#dd#cc#..................#cc#dd#",
+"#dd#cc#..................#cc#dd#",
+"#dd#cc#......aaa.........#cc#dd#",
+"#dd#cc#.....aabb.........#cc#dd#",
+"#dd#cc#..eaaabbb.........#cc#dd#",
+"#dd#cc#.aabbbbbaaaaaaaaa.#cc#dd#",
+"####cc#.aabbbbbaaaaaaaaa.#cc####",
+"....#c#...aaabbb.........#c#....",
+".....##.....aabb.........##.....",
"......#.......aa.........#......",
"................................",
"................................",
Added: sofaswitch/trunk/callflow/bitmaps/writetofile.xpm
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/bitmaps/writetofile.xpm Mon Sep 25 22:41:05 2006
@@ -0,0 +1,39 @@
+/* XPM */
+static char *writetofile[]={
+"32 32 4 1",
+"# c None",
+"a c #000000",
+". c #00c000",
+"b c #585858",
+".##############################.",
+"#.##.#####################.###.#",
+"##..#.###################.##..##",
+"####...#################.#..####",
+"##......###############.......##",
+"########aaaaaaaaaaaaaaaa########",
+"########a##############a########",
+"########a##############a########",
+"########a#bbbbbbbbbbbb#a########",
+"########a##############a########",
+"########a##############a########",
+"########a##############a########",
+"########a##############a########",
+"##.#####a#bbbbbbbbbbbb#a#####.##",
+"###..###a##############a###..###",
+"........a##############a........",
+"###..###a##############a###..###",
+"##.#####a#bbbbbbbbbbbb#a#####.##",
+"########a##############a########",
+"########a##############a########",
+"########a##############a########",
+"########a#bbbbbbbbbbbb#a########",
+"########a##############a########",
+"########a##############a########",
+"########a##############a########",
+"########a##############a########",
+"########a##############a########",
+"########aaaaaaaaaaaaaaaa########",
+"##......################......##",
+"####.#.#################..#..###",
+"#..##.####################..#..#",
+".###.#######################.##."};
1
0
Author: derek
Date: Mon Sep 25 22:40:03 2006
New Revision: 127
Added:
sofaswitch/trunk/callflow/src/readfromfile.cpp
sofaswitch/trunk/callflow/src/readfromfile.h
sofaswitch/trunk/callflow/src/writetofile.cpp
sofaswitch/trunk/callflow/src/writetofile.h
Log:
Add these files, which are answering machine specific.
Added: sofaswitch/trunk/callflow/src/readfromfile.cpp
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/readfromfile.cpp Mon Sep 25 22:40:03 2006
@@ -0,0 +1,115 @@
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+#include <wx/textfile.h>
+#include <wx/tokenzr.h>
+#include "shapelist.h"
+
+
+#include "requestnode.h"
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+
+DndShapeRequestNode::DndShapeRequestNode()
+ : DndShape(RequestNode)
+{
+ wxSize newSize(50, 50);
+ SetSize(newSize);
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Request node from"), wxT("voip"));
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Timer period (seconds)"), wxT("1"));
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Timer label"), wxT("request node"));
+
+
+ relInputPoints.Add(25, 0);
+ relOutputPoints.Add(25, 50);
+ AdjustIoPoints();
+}
+
+void DndShapeRequestNode::Draw(wxDC& dc)
+{
+ DrawCompileError(dc);
+ dc.SetPen(*wxBLACK_PEN);
+
+ wxPoint p1(m_rect.GetPosition());
+ wxPoint pA(p1.x + 25, p1.y + 0);
+ wxPoint pB(p1.x + 25, p1.y + 50);
+
+
+ dc.DrawLine(pA, pB);
+
+ wxString text("R ?");
+ wxFont f = wxFont(*wxITALIC_FONT);
+ f.SetPointSize(20);
+ dc.SetFont(f);//*wxITALIC_FONT);
+ wxCoord w, h;
+ dc.GetTextExtent(text, &w, &h);
+
+ int xPos = m_rect.x + 0 + ((50 - w)/2);
+ int yPos = m_rect.y + 10 + ((21 - h)/2);
+ dc.DrawText(text, xPos, yPos);
+
+ DrawArrow(dc, pA, ArrowDown, InputPointConnected(0) ? Connected : Loose);
+ DrawArrow(dc, pB, ArrowDown, OutputPointConnected(0) ? Connected : Loose);
+
+ DndShape::Draw(dc);
+}
+
+bool DndShapeRequestNode::WriteSystemCode(wxTextFile & file)
+{
+ file.AddLine(" def Request_Node(self, aTuple): ");
+ file.AddLine(" a,y,z = aTuple ");
+ file.AddLine(" eName = self.data[a][\"Timer label\"] ");
+ file.AddLine(" self.pendingEvents[eName] = a ");
+ file.AddLine(" reactor.callLater(self.data[a][\"Timer period\"], self.timerObjectExpired, eName)");
+ file.AddLine(" rhost = self.data[a][\"Request node from\"] ");
+ file.AddLine(" rhost += \":REQUESTNEWID\\0\" ");
+ file.AddLine(" self.transport.write(rhost) ");
+ file.AddLine(" return self.data[a][\"Output\"] ");
+ file.AddLine("");
+ return true;
+}
+
+bool DndShapeRequestNode::WriteThisShapeInfo(wxTextFile & file)
+{
+ file.AddLine(wxString::Format(" \"%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()));
+
+ 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(" \"Request node from\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
+
+ file.AddLine(wxString::Format(" \"Timer period\" : "));
+ file.AddLine(wxString::Format(" %s, ", displayData[2].data.c_str()));
+
+ file.AddLine(wxString::Format(" \"Timer label\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[3].data.c_str()));
+
+ file.AddLine(wxString::Format(" },"));
+
+ return true;
+}
+
Added: sofaswitch/trunk/callflow/src/readfromfile.h
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/readfromfile.h Mon Sep 25 22:40:03 2006
@@ -0,0 +1,39 @@
+#ifndef REQUEST_NODE_H
+
+#define REQUEST_NODE_H
+
+#include "dnd.h"
+
+///////////////////////////////////////////////////////////////////////////
+/**Define a request node shape. This code will return almost immediately, and
+ we leave it to the timer object to recover from if there was an answer, or
+ noting Store values for size, location, input & output points. This
+ instance has the ability to draw this shape to a specified location on the
+ canvas */
+class DndShapeRequestNode : public DndShape
+{
+public:
+ /**Construtor, Define this shape in terms of size and points etc */
+ DndShapeRequestNode();
+
+ /**Destroy this shape, and log it */
+ virtual ~DndShapeRequestNode()
+ {
+ }
+
+ /**Draw this particular shape to the screen..*/
+ virtual void Draw(wxDC& dc);
+
+ /** Used to report the name of this particular class. */
+ static wxString GetKindName() { return wxString("Request Node"); }
+
+ /**Write the code generic to this StartHere shape */
+ virtual bool WriteSystemCode(wxTextFile & file);
+
+ /**Write the dictionary containing relevant points for this shape */
+ virtual bool WriteThisShapeInfo(wxTextFile & file);
+};
+
+
+#endif
+
Added: sofaswitch/trunk/callflow/src/writetofile.cpp
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/writetofile.cpp Mon Sep 25 22:40:03 2006
@@ -0,0 +1,115 @@
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+#include <wx/textfile.h>
+#include <wx/tokenzr.h>
+#include "shapelist.h"
+
+
+#include "requestnode.h"
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+
+DndShapeRequestNode::DndShapeRequestNode()
+ : DndShape(RequestNode)
+{
+ wxSize newSize(50, 50);
+ SetSize(newSize);
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Request node from"), wxT("voip"));
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Timer period (seconds)"), wxT("1"));
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Timer label"), wxT("request node"));
+
+
+ relInputPoints.Add(25, 0);
+ relOutputPoints.Add(25, 50);
+ AdjustIoPoints();
+}
+
+void DndShapeRequestNode::Draw(wxDC& dc)
+{
+ DrawCompileError(dc);
+ dc.SetPen(*wxBLACK_PEN);
+
+ wxPoint p1(m_rect.GetPosition());
+ wxPoint pA(p1.x + 25, p1.y + 0);
+ wxPoint pB(p1.x + 25, p1.y + 50);
+
+
+ dc.DrawLine(pA, pB);
+
+ wxString text("R ?");
+ wxFont f = wxFont(*wxITALIC_FONT);
+ f.SetPointSize(20);
+ dc.SetFont(f);//*wxITALIC_FONT);
+ wxCoord w, h;
+ dc.GetTextExtent(text, &w, &h);
+
+ int xPos = m_rect.x + 0 + ((50 - w)/2);
+ int yPos = m_rect.y + 10 + ((21 - h)/2);
+ dc.DrawText(text, xPos, yPos);
+
+ DrawArrow(dc, pA, ArrowDown, InputPointConnected(0) ? Connected : Loose);
+ DrawArrow(dc, pB, ArrowDown, OutputPointConnected(0) ? Connected : Loose);
+
+ DndShape::Draw(dc);
+}
+
+bool DndShapeRequestNode::WriteSystemCode(wxTextFile & file)
+{
+ file.AddLine(" def Request_Node(self, aTuple): ");
+ file.AddLine(" a,y,z = aTuple ");
+ file.AddLine(" eName = self.data[a][\"Timer label\"] ");
+ file.AddLine(" self.pendingEvents[eName] = a ");
+ file.AddLine(" reactor.callLater(self.data[a][\"Timer period\"], self.timerObjectExpired, eName)");
+ file.AddLine(" rhost = self.data[a][\"Request node from\"] ");
+ file.AddLine(" rhost += \":REQUESTNEWID\\0\" ");
+ file.AddLine(" self.transport.write(rhost) ");
+ file.AddLine(" return self.data[a][\"Output\"] ");
+ file.AddLine("");
+ return true;
+}
+
+bool DndShapeRequestNode::WriteThisShapeInfo(wxTextFile & file)
+{
+ file.AddLine(wxString::Format(" \"%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()));
+
+ 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(" \"Request node from\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
+
+ file.AddLine(wxString::Format(" \"Timer period\" : "));
+ file.AddLine(wxString::Format(" %s, ", displayData[2].data.c_str()));
+
+ file.AddLine(wxString::Format(" \"Timer label\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[3].data.c_str()));
+
+ file.AddLine(wxString::Format(" },"));
+
+ return true;
+}
+
Added: sofaswitch/trunk/callflow/src/writetofile.h
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/writetofile.h Mon Sep 25 22:40:03 2006
@@ -0,0 +1,39 @@
+#ifndef REQUEST_NODE_H
+
+#define REQUEST_NODE_H
+
+#include "dnd.h"
+
+///////////////////////////////////////////////////////////////////////////
+/**Define a request node shape. This code will return almost immediately, and
+ we leave it to the timer object to recover from if there was an answer, or
+ noting Store values for size, location, input & output points. This
+ instance has the ability to draw this shape to a specified location on the
+ canvas */
+class DndShapeRequestNode : public DndShape
+{
+public:
+ /**Construtor, Define this shape in terms of size and points etc */
+ DndShapeRequestNode();
+
+ /**Destroy this shape, and log it */
+ virtual ~DndShapeRequestNode()
+ {
+ }
+
+ /**Draw this particular shape to the screen..*/
+ virtual void Draw(wxDC& dc);
+
+ /** Used to report the name of this particular class. */
+ static wxString GetKindName() { return wxString("Request Node"); }
+
+ /**Write the code generic to this StartHere shape */
+ virtual bool WriteSystemCode(wxTextFile & file);
+
+ /**Write the dictionary containing relevant points for this shape */
+ virtual bool WriteThisShapeInfo(wxTextFile & file);
+};
+
+
+#endif
+
1
0
Author: derek
Date: Mon Sep 25 20:48:16 2006
New Revision: 126
Added:
sofaswitch/trunk/callflow/src/senddtmf.cpp
sofaswitch/trunk/callflow/src/senddtmf.h
Log:
Add these files, to indicate the sending of dtmf to a worker node.
Added: sofaswitch/trunk/callflow/src/senddtmf.cpp
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/senddtmf.cpp Mon Sep 25 20:48:16 2006
@@ -0,0 +1,123 @@
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+#include <wx/textfile.h>
+#include <wx/tokenzr.h>
+#include "shapelist.h"
+
+
+#include "makecall.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+DndShapeMakeCall::DndShapeMakeCall()
+ : DndShape(MakeCall)
+{
+ wxSize newSize(50, 50);
+ SetSize(newSize);
+
+ relInputPoints.Add(25, 0);
+ relOutputPoints.Add(25, 50);
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\""));
+
+ displayData[displayData.size()] =
+ InformationSection(wxT("Call destination (python code)"), wxT("\"h323.voxgratia.org\""));
+
+ AdjustIoPoints();
+}
+
+bool DndShapeMakeCall::WriteSystemCode(wxTextFile & file)
+{
+ file.AddLine(" def Make_Call(self, sTuple): ");
+ file.AddLine(" a,b,c = sTuple ");
+ file.AddLine(" rhost = eval(self.data[a][\"worker node\"]) ");
+ file.AddLine(" rhost += \":CALLNODE \" + self.data[a][\"call destination\"] + \"\\0\" ");
+ file.AddLine(" self.transport.write(rhost) ");
+ file.AddLine(" return self.data[a][\"Output\"] ");
+ file.AddLine("");
+
+ return true;
+}
+
+bool DndShapeMakeCall::WriteThisShapeInfo(wxTextFile & file)
+{
+ file.AddLine(wxString::Format(" \"%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(" \"worker node\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
+
+ file.AddLine(wxString::Format(" \"call destination\" : "));
+ file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
+
+ file.AddLine(wxString::Format(" },"));
+
+ return true;
+}
+
+
+void DndShapeMakeCall::Draw(wxDC& dc)
+{
+ DrawCompileError(dc);
+ dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
+ dc.SetPen(*wxBLACK_PEN);
+
+ wxPoint p1(m_rect.GetPosition());
+ wxPoint pA(p1.x + 25, p1.y);
+ wxPoint pB(p1.x + 25, p1.y + 10);
+
+ wxPoint pY(p1.x + 25, p1.y + 40);
+ wxPoint pZ(p1.x + 25, p1.y + 50);
+
+ wxPoint pL(p1.x + 3, p1.y+14);
+ wxPoint pR(p1.x + 47, p1.y + 16);
+ wxPoint pM(p1.x + 22, p1.y + 12);
+ wxPoint pL1(pL.x + 0, pL.y+1);
+ wxPoint pR1(pR.x + 0, pR.y + 1);
+ dc.DrawLine(pL, pM);
+ dc.DrawLine(pR, pM);
+ dc.DrawLine(pL1, pM);
+ dc.DrawLine(pR1, pM);
+
+ dc.DrawLine(pA, pB);
+ if (InputPointConnected(0))
+ DrawArrow(dc, pB, ArrowDown, Connected);
+ else
+ DrawArrow(dc, pB, ArrowDown, Loose);
+
+ dc.DrawLine(pY, pZ);
+ if (OutputPointConnected(0))
+ DrawArrow(dc, pZ, ArrowDown, Connected);
+ else
+ DrawArrow(dc, pZ, ArrowDown, Loose);
+
+ wxFont f = wxFont(*wxITALIC_FONT);
+ 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);
+ }
+
+
+ DndShape::Draw(dc); // Draw the selected overlay if required.
+}
+
Added: sofaswitch/trunk/callflow/src/senddtmf.h
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/src/senddtmf.h Mon Sep 25 20:48:16 2006
@@ -0,0 +1,34 @@
+#ifndef MAKE_CALL_H
+#define MAKE_CALL_H
+
+#include "dnd.h"
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+/**Define a create a call shape. Store values for size, location, input & output points.
+ This instance has the ability to draw this shape to a specified location on the canvas */
+class DndShapeMakeCall : public DndShape
+{
+public:
+ /**Construtor, Define this shape in terms of size and points etc */
+ DndShapeMakeCall();
+
+ /**Destroy this shape, and log it */
+ virtual ~DndShapeMakeCall()
+ {
+ }
+
+ /**Draw this particular shape to the screen..*/
+ virtual void Draw(wxDC& dc);
+
+ /**Write the code generic to this Make Call shape */
+ virtual bool WriteSystemCode(wxTextFile & file);
+
+ /**Write the dictionary containing relevant points for this shape */
+ virtual bool WriteThisShapeInfo(wxTextFile & file);
+
+ /** Used to report the name of this particular class. */
+ static wxString GetKindName() { return wxString("Make Call"); }
+};
+
+
+#endif // MAKE_CALL_H
1
0