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(" },"));