Sofaswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- 390 discussions
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
Author: derek
Date: Mon Sep 25 20:44:42 2006
New Revision: 125
Added:
sofaswitch/trunk/callflow/bitmaps/senddtmf.xpm
Log:
Add this file, to indicate the sending of dtmf to some remote worker.
Added: sofaswitch/trunk/callflow/bitmaps/senddtmf.xpm
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/bitmaps/senddtmf.xpm Mon Sep 25 20:44:42 2006
@@ -0,0 +1,41 @@
+/* XPM */
+static char *senddtmf[]={
+"32 32 6 1",
+". c None",
+"c c #0000ff",
+"# c #004000",
+"b c #008000",
+"a c #008080",
+"d c #0080ff",
+"................................",
+"................................",
+"..................##............",
+"....###......#...####...........",
+"...##.#......#..##..#...........",
+"...#..#......#..#...#...........",
+"...#..#......#.....##...........",
+"...#.##......#...###............",
+"...###.......#..#####...........",
+"......................##........",
+".............#.....####.........",
+"...####.....##.....#............",
+"......##....#......###..........",
+"......##...#.........##.........",
+"...####...##.#........#.........",
+"...#..#...#..#........#aa.......",
+".....##...#####....#.##bbaa.....",
+"...###.......#.....###.bbbbaa...",
+"ccccccccccccccccccccccccccccbaa.",
+"cddddddddddddddddddddddddddcbbba",
+"cddddddddddddddddddddddddddcbbba",
+"ccccccccccccccccccccccccccccbaa.",
+".....####......#.......bbbbaa...",
+"..#.....####.###...##..bbaa.....",
+"..#.......##.#.#..#.##.aa.......",
+"..#.......#.##.#..#.##..........",
+".##......#...###..####..........",
+".###....##...##....##...........",
+".#.#...##...###....#............",
+".###..##....#.##..##............",
+"..##........###...#.............",
+"................................"};
1
0
Author: derek
Date: Mon Sep 25 01:25:25 2006
New Revision: 124
Modified:
sofaswitch/trunk/callflow/src/loadnewgraph.cpp
sofaswitch/trunk/callflow/src/transfermedia.cpp
Log:
Get colouring to work correctly. Absolutely correctly.
Modified: sofaswitch/trunk/callflow/src/loadnewgraph.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/loadnewgraph.cpp (original)
+++ sofaswitch/trunk/callflow/src/loadnewgraph.cpp Mon Sep 25 01:25:25 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/transfermedia.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/transfermedia.cpp (original)
+++ sofaswitch/trunk/callflow/src/transfermedia.cpp Mon Sep 25 01:25:25 2006
@@ -39,7 +39,8 @@
{
DrawCompileError(dc);
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
- wxPoint p1(m_rect.GetPosition());
+ 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);
1
0
Author: derek
Date: Mon Sep 25 01:19:18 2006
New Revision: 123
Modified:
sofaswitch/trunk/callflow/Makefile.am
sofaswitch/trunk/callflow/src/makecall.cpp
sofaswitch/trunk/callflow/src/makecall.h
sofaswitch/trunk/callflow/src/transfermedia.cpp
Log:
Add system code to do make call and transfer media.
Add to make clean to remove all editor backup files.
Modified: sofaswitch/trunk/callflow/Makefile.am
==============================================================================
--- sofaswitch/trunk/callflow/Makefile.am (original)
+++ sofaswitch/trunk/callflow/Makefile.am Mon Sep 25 01:19:18 2006
@@ -15,8 +15,8 @@
veryclean:distclean
@rm -fR html
- @rm -fR *~
- @rm log
+ @find . -name \*~ | xargs rm -f
+ @rm -f log
help:
Modified: sofaswitch/trunk/callflow/src/makecall.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/makecall.cpp (original)
+++ sofaswitch/trunk/callflow/src/makecall.cpp Mon Sep 25 01:19:18 2006
@@ -37,26 +37,61 @@
bool DndShapeMakeCall::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def Make_Call(self, sTuple): ");
- file.AddLine(" a,b,c = sTuple");
- file.AddLine(" return self.data[a][\"Output\"]");
- file.AddLine("");
+ file.AddLine(" def Make_Call(self, sTuple): ");
+ file.AddLine(" a,b,c = sTuple ");
+ file.AddLine(" rhost = 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))
@@ -81,6 +116,7 @@
int yPos = m_rect.y + 18 + ((i/3)*9) - (h/2);
dc.DrawText(text, xPos, yPos);
}
+
DndShape::Draw(dc); // Draw the selected overlay if required.
}
Modified: sofaswitch/trunk/callflow/src/makecall.h
==============================================================================
--- sofaswitch/trunk/callflow/src/makecall.h (original)
+++ sofaswitch/trunk/callflow/src/makecall.h Mon Sep 25 01:19:18 2006
@@ -22,6 +22,9 @@
/**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"); }
Modified: sofaswitch/trunk/callflow/src/transfermedia.cpp
==============================================================================
--- sofaswitch/trunk/callflow/src/transfermedia.cpp (original)
+++ sofaswitch/trunk/callflow/src/transfermedia.cpp Mon Sep 25 01:19:18 2006
@@ -68,33 +68,30 @@
bool DndShapeTransferMedia::WriteSystemCode(wxTextFile & file)
{
- file.AddLine(" def TransferMedia(self, sTuple): ");
- file.AddLine(" a,b,c = sTuple");
- file.AddLine(" exec(self.data[a][\"TransferMedia Code\"])");
- file.AddLine(" return self.data[a][\"Output\"]");
- file.AddLine("");
-
- return true;
+ file.AddLine(" def TransferMedia(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(" self.transport.write(rhost) ");
+ file.AddLine(" return self.data[a][\"Output\"] ");
+ file.AddLine("");
+
+ return true;
}
bool DndShapeTransferMedia::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(" \"First worker\" : "));
+ file.AddLine(wxString::Format(" \"worker node\" : "));
file.AddLine(wxString::Format(" \"%s\", ", displayData[1].data.c_str()));
- file.AddLine(wxString::Format(" \"Second worker\" : "));
+ file.AddLine(wxString::Format(" \"worker receiver\" : "));
file.AddLine(wxString::Format(" \"%s\", ", displayData[2].data.c_str()));
file.AddLine(wxString::Format(" },"));
1
0