[commit] r122 - in sofaswitch/trunk/callflow: bitmaps src
Author: derek Date: Mon Sep 25 00:25:02 2006 New Revision: 122 Modified: sofaswitch/trunk/callflow/bitmaps/makecall.xpm sofaswitch/trunk/callflow/src/callflow.cpp sofaswitch/trunk/callflow/src/callflow.h sofaswitch/trunk/callflow/src/dnd.cpp sofaswitch/trunk/callflow/src/loadnewgraph.cpp sofaswitch/trunk/callflow/src/makecall.cpp Log: Add notion of calling a remote node. Modified: sofaswitch/trunk/callflow/bitmaps/makecall.xpm ============================================================================== --- sofaswitch/trunk/callflow/bitmaps/makecall.xpm (original) +++ sofaswitch/trunk/callflow/bitmaps/makecall.xpm Mon Sep 25 00:25:02 2006 @@ -1,11 +1,12 @@ /* XPM */ static char *makecall[]={ -"32 32 5 1", +"32 32 6 1", ". c None", "# c #000000", +"b c #00c0c0", "a c #585858", -"b c #c00000", -"c c #ff0000", +"c c #c00000", +"d c #ff0000", "................................", "................###.............", "..............##a.a##...........", @@ -14,25 +15,25 @@ ".......###.a.aa.a.a.a.a..##.....", ".....##..a..a..####..a.aa.a##...", "...##.aaa.a.###....##a.a.aa.a##.", -"###.aa.a####.........##a.a.aaa.#", -".###.###...............##.a.a..#", -"....#....................##..a#.", -".......##a#..aaaa..aaaa....###..", -".......##a#..###a..###a.........", -".......##a#..##a#..#aaa.........", +"###.aa.a####bb.......##a.a.aaa.#", +".###.###bbbb.........bb##.a.a..#", +"....#bbbb.............bbb##..a#.", +"...bbb.##a#..aaaa..aaaa.bbb###..", +"..bbb..##a#..###a..###a...bbb...", +".......##a#..##a#..#aaa....bb...", ".......##a#..#a##..###a.........", ".......##a#..aaaa..aaaa.........", "................................", "................................", ".......a###..aaaa..a###.........", ".......a###..a###..a###.........", -".......a#a#..aaaa..aaaabbb......", -".......aaaa..###a..a##accccc....", -".......##a#..aaaa..aaaabbbbbbcc.", -"cccccccccccccccccccccccccccccccc", -".......................bbbbbbcc.", -".......aaaa..aaaa..aaaaccccc....", -".......###a..a##a..a##abbb......", +".......a#a#..aaaa..aaaaccc......", +".......aaaa..###a..a##addddd....", +".......##a#..aaaa..aaaaccccccdd.", +"dddddddddddddddddddddddddddddddd", +".......................ccccccdd.", +".......aaaa..aaaa..aaaaddddd....", +".......###a..a##a..a##accc......", ".......##a#..aaaa..aaaa.........", ".......##a#..a##a..##aa.........", ".......#a##..aaaa..##a#.........", Modified: sofaswitch/trunk/callflow/src/callflow.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.cpp (original) +++ sofaswitch/trunk/callflow/src/callflow.cpp Mon Sep 25 00:25:02 2006 @@ -36,6 +36,7 @@ #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" @@ -64,31 +65,32 @@ #include "callflow.h" BEGIN_EVENT_TABLE(MyFrame, wxFrame) - EVT_MENU ( wxH_EDITPASTE, MyFrame::OnEditPaste) - EVT_MENU ( wxH_EDITCOPY, MyFrame::OnEditCopy) - EVT_MENU ( wxH_EDITCUT, MyFrame::OnEditCut) - EVT_MENU ( wxH_HELPABOUT, MyFrame::OnHelpAbout) - EVT_MENU ( wxH_HELPMANUAL, MyFrame::OnHelpManual) - EVT_MENU ( wxH_CONTROLSREQUESTNODE, MyFrame::OnControlsrequestnode) - EVT_MENU ( wxH_CONTROLSPYTHON, MyFrame::OnControlspython) + EVT_MENU ( wxH_CONTROLSCOMPILE, MyFrame::OnCompile) + EVT_MENU ( wxH_CONTROLSCONNECT_OBJECTS, MyFrame::OnControlsConnectObjects) + EVT_MENU ( wxH_CONTROLSEND, MyFrame::OnControlsend) + EVT_MENU ( wxH_CONTROLSENDHERE, MyFrame::OnControlsendhere) EVT_MENU ( wxH_CONTROLSEND_FOR, MyFrame::OnControlsend_for) + EVT_MENU ( wxH_CONTROLSEVENTER, MyFrame::OnControlsEventer) EVT_MENU ( wxH_CONTROLSFOR, MyFrame::OnControlsfor) EVT_MENU ( wxH_CONTROLSIF, MyFrame::OnControlsif) - EVT_MENU ( wxH_CONTROLSTIMER, MyFrame::OnControlsTimer) - EVT_MENU ( wxH_CONTROLSSTOPTIMER, MyFrame::OnControlsStopTimer) - EVT_MENU ( wxH_CONTROLSEVENTER, MyFrame::OnControlsEventer) - EVT_MENU ( wxH_CONTROLSEND, MyFrame::OnControlsend) + EVT_MENU ( wxH_CONTROLSLOADNEWGRAPH, MyFrame::OnControlsLoadNewGraph) + EVT_MENU ( wxH_CONTROLSMAKECALL, MyFrame::OnControlsMakeCall) + EVT_MENU ( wxH_CONTROLSPYTHON, MyFrame::OnControlspython) + EVT_MENU ( wxH_CONTROLSREQUESTNODE, MyFrame::OnControlsrequestnode) EVT_MENU ( wxH_CONTROLSSTARTHERE, MyFrame::OnControlsstarthere) - EVT_MENU ( wxH_CONTROLSENDHERE, MyFrame::OnControlsendhere) - EVT_MENU ( wxH_CONTROLSCONNECT_OBJECTS, MyFrame::OnControlsConnectObjects) - EVT_MENU ( wxH_CONTROLSCOMPILE, MyFrame::OnCompile) + EVT_MENU ( wxH_CONTROLSSTOPTIMER, MyFrame::OnControlsStopTimer) + EVT_MENU ( wxH_CONTROLSTIMER, MyFrame::OnControlsTimer) EVT_MENU ( wxH_CONTROLSTRANSFERMEDIA, MyFrame::OnControlsTransferMedia) - EVT_MENU ( wxH_CONTROLSLOADNEWGRAPH, MyFrame::OnControlsLoadNewGraph) + EVT_MENU ( wxH_EDITCOPY, MyFrame::OnEditCopy) + EVT_MENU ( wxH_EDITCUT, MyFrame::OnEditCut) + EVT_MENU ( wxH_EDITPASTE, MyFrame::OnEditPaste) EVT_MENU ( wxH_FILEE_XIT, MyFrame::OnFileE_xit) - EVT_MENU ( wxH_FILESAVE__AS, MyFrame::OnFileSave__As) - EVT_MENU ( wxH_FILESAVE, MyFrame::OnFileSave) - EVT_MENU ( wxH_FILEOPEN, MyFrame::OnFileOpen) EVT_MENU ( wxH_FILENEW, MyFrame::OnFileNew) + EVT_MENU ( wxH_FILEOPEN, MyFrame::OnFileOpen) + EVT_MENU ( wxH_FILESAVE, MyFrame::OnFileSave) + EVT_MENU ( wxH_FILESAVE__AS, MyFrame::OnFileSave__As) + EVT_MENU ( wxH_HELPABOUT, MyFrame::OnHelpAbout) + EVT_MENU ( wxH_HELPMANUAL, MyFrame::OnHelpManual) EVT_CLOSE(MyFrame::OnClose) END_EVENT_TABLE() @@ -135,20 +137,21 @@ 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_CONTROLSSTARTHERE, wxT("start here"), wxT("")); - Controls_menu -> Append ( wxH_CONTROLSENDHERE, wxT("end here"), wxT("")); - Controls_menu -> Append ( wxH_CONTROLSREQUESTNODE, wxT("request node"), wxT("")); + Controls_menu -> Append ( wxH_CONTROLSCONNECT_OBJECTS, wxT("connect objects"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSEND, wxT("end"), wxT("")); - Controls_menu -> Append ( wxH_CONTROLSIF, wxT("if"), wxT("")); - Controls_menu -> Append ( wxH_CONTROLSTIMER, wxT("timer"), wxT("")); - Controls_menu -> Append ( wxH_CONTROLSSTOPTIMER, wxT("stop running timer"), 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_CONTROLSEND_FOR, wxT("end 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_CONTROLSCONNECT_OBJECTS, wxT("connect objects"), 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("")); - Controls_menu -> Append ( wxH_CONTROLSLOADNEWGRAPH, wxT("load pre-existing compiled graph"), wxT("")); Help_menu -> Append ( wxH_HELPMANUAL, wxT("Manual"), wxT("")); Help_menu -> AppendSeparator () ; Help_menu -> Append ( wxH_HELPABOUT, wxT("About"), wxT("")); @@ -303,7 +306,7 @@ toolBar->AddTool(wxH_CONTROLSTIMER, wxBitmap ( miniclock_xpm ), wxT("Start a timer")); toolBar->AddTool(wxH_CONTROLSSTOPTIMER, wxBitmap ( stoptimer ), wxT("Stop specified timer")); toolBar->AddTool(wxH_CONTROLSEVENTER, wxBitmap ( eventer_xpm ), wxT("Register for & Wait for an event")); - + toolBar->AddTool(wxH_CONTROLSMAKECALL, wxBitmap (makecall), wxT("Make a voip/TDM call to outside entity")); toolBar->AddTool(wxH_CONTROLSFOR, wxBitmap ( Controlsfor_xpm ), wxT("Start a for loop")); toolBar->AddTool(wxH_CONTROLSEND_FOR, wxBitmap ( Controlsend_for_xpm ), wxT("end a for loop")); toolBar->AddTool(wxH_CONTROLSPYTHON, wxBitmap ( Python_xpm ), wxT("arbitrary python code")); @@ -399,6 +402,12 @@ void MyFrame::OnControlsLoadNewGraph (wxCommandEvent & WXUNUSED(event)) { imageTypeForPlacing = DndShape::LoadNewGraph; + canvas->SetEditingMode(MyCanvas::PlaceOneShape); + +} +void MyFrame::OnControlsMakeCall (wxCommandEvent & WXUNUSED(event)) +{ + imageTypeForPlacing = DndShape::MakeCall, 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 00:25:02 2006 @@ -11,31 +11,32 @@ { // menu IDs these two are needed by wxHatch wxH_FILE = 1, - wxH_FILENEW, - wxH_FILEOPEN, - wxH_FILESAVE, - wxH_FILESAVE__AS, - wxH_FILEE_XIT, - wxH_CONTROLSSTARTHERE, - wxH_CONTROLSENDHERE, - wxH_CONTROLSREQUESTNODE, + wxH_CONTROLSCOMPILE, + wxH_CONTROLSCONNECT_OBJECTS, wxH_CONTROLSEND, - wxH_CONTROLSIF, - wxH_CONTROLSTIMER, - wxH_CONTROLSSTOPTIMER, + wxH_CONTROLSENDHERE, + wxH_CONTROLSEND_FOR, wxH_CONTROLSEVENTER, wxH_CONTROLSFOR, - wxH_CONTROLSEND_FOR, + wxH_CONTROLSIF, + wxH_CONTROLSLOADNEWGRAPH, + wxH_CONTROLSMAKECALL, wxH_CONTROLSPYTHON, - wxH_CONTROLSCONNECT_OBJECTS, - wxH_CONTROLSCOMPILE, + wxH_CONTROLSREQUESTNODE, + wxH_CONTROLSSTARTHERE, + wxH_CONTROLSSTOPTIMER, + wxH_CONTROLSTIMER, wxH_CONTROLSTRANSFERMEDIA, - wxH_CONTROLSLOADNEWGRAPH, - wxH_HELPMANUAL, - wxH_HELPABOUT, - wxH_EDITCUT, wxH_EDITCOPY, + wxH_EDITCUT, wxH_EDITPASTE, + wxH_FILEE_XIT, + wxH_FILENEW, + wxH_FILEOPEN, + wxH_FILESAVE, + wxH_FILESAVE__AS, + wxH_HELPABOUT, + wxH_HELPMANUAL, wxH_QUIT }; @@ -147,6 +148,12 @@ once. This is used to handle, say, incoming calls, or to make an outgong call. */ void OnControlsLoadNewGraph(wxCommandEvent & event); + + /**Called in response to a user comand to add a "Make Call" widget to the + current graph. The make call causes the running python code to grab a + current sofaswitch worker (say a voip or TDM circuit) to call outside + the building */ + void OnControlsMakeCall(wxCommandEvent & event); /**Called in response to a user comand to add a "Draw Line Segment" widget to the current graph. The multiple line segment object is used to join Modified: sofaswitch/trunk/callflow/src/dnd.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.cpp (original) +++ sofaswitch/trunk/callflow/src/dnd.cpp Mon Sep 25 00:25:02 2006 @@ -489,20 +489,22 @@ case None: printf("Construct a shape of null\n"); return NULL; - case StartHere: return new DndShapeStartHere(); - case EndHere: return new DndShapeEndHere(); - case StartFor: return new DndShapeStartFor(); - case EndFor: return new DndShapeEndFor(); - case Conditional: return new DndShapeConditional(); - case MakeCall: return new DndShapeMakeCall(); - case EndCall: return new DndShapeEndCall(); - case Select: return new DndShapeSelect(); - case JoinBlocks: return new DndShapeJoinBlocks(); - case Python: return new DndShapePython(); - case RequestNode: return new DndShapeRequestNode(); - case Timer: return new DndShapeTimer(); - case StopTimer: return new DndShapeStopTimer(); - case Eventer: return new DndShapeEventer(); + case Conditional: return new DndShapeConditional(); + case EndCall: return new DndShapeEndCall(); + case EndFor: return new DndShapeEndFor(); + case EndHere: return new DndShapeEndHere(); + case Eventer: return new DndShapeEventer(); + case JoinBlocks: return new DndShapeJoinBlocks(); + case LoadNewGraph: return new DndShapeLoadNewGraph(); + case MakeCall: return new DndShapeMakeCall(); + case Python: return new DndShapePython(); + case RequestNode: return new DndShapeRequestNode(); + case Select: return new DndShapeSelect(); + 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(); default: printf("Unknown construction of shape %d\n", shapeRequired); } Modified: sofaswitch/trunk/callflow/src/loadnewgraph.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/loadnewgraph.cpp (original) +++ sofaswitch/trunk/callflow/src/loadnewgraph.cpp Mon Sep 25 00:25:02 2006 @@ -44,20 +44,22 @@ DrawArrow(dc, pA, ArrowDown, InputPointConnected(0) ? Connected : Loose); DrawArrow(dc, pC, ArrowDown, OutputPointConnected(0) ? Connected : Loose); - dc.DrawLine(pC, pB); +// dc.DrawLine(pC, pB); - wxPoint polygon[20]; - for (int i = 0; i < 20; i++) { - int radius = (i % 2) == 0 ? 9 : 4; + for (int i = 0; i < 10; i++) { + int r1 = 25; + int r2 = 5; double theta = (270 + (36 * i)) * M_PI * 2.0/360.0; - int xx = 3 + (int)(radius * cos(theta)); - int yy = 39 + (int)(radius * sin(theta)); - polygon[i] = wxPoint(xx, yy); + wxPoint p1(m_rect.x + 25 + (int)(r1 * cos(theta)), + m_rect.y + 25 + (int)(r1 * sin(theta))); + wxPoint p2(m_rect.x + 25 + (int)(r2 * cos(theta)), + m_rect.y + 25 + (int)(r2 * sin(theta))); + dc.DrawLine(p1, p2); } - dc.DrawPolygon(10, polygon, m_rect.x, m_rect.y); - - DrawBox(dc, 15, 15, 30, 30); - + + DrawBox(dc, 20, 20, 10, 10); + + dc.SetBrush(wxBrush(*wxBLACK, wxSOLID)); DndShape::Draw(dc); } Modified: sofaswitch/trunk/callflow/src/makecall.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/makecall.cpp (original) +++ sofaswitch/trunk/callflow/src/makecall.cpp Mon Sep 25 00:25:02 2006 @@ -25,6 +25,13 @@ 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(); } @@ -42,16 +49,15 @@ void DndShapeMakeCall::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); - wxPoint pB(p1.x + 25, p1.y + 15); + wxPoint pB(p1.x + 25, p1.y + 10); - wxPoint pY(p1.x + 25, p1.y + 35); + wxPoint pY(p1.x + 25, p1.y + 40); wxPoint pZ(p1.x + 25, p1.y + 50); - DrawBox(dc, 0, 15, 50, 20); dc.DrawLine(pA, pB); if (InputPointConnected(0)) DrawArrow(dc, pB, ArrowDown, Connected); @@ -64,6 +70,18 @@ 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. }
participants (1)
-
SofaSWITCH SVN