[Sofaswitch-svn] [commit] r93 - sofaswitch/trunk/callflow/src
Author: derek Date: Thu Sep 14 22:43:05 2006 New Revision: 93 Modified: sofaswitch/trunk/callflow/src/requestnode.cpp sofaswitch/trunk/callflow/src/timer.cpp Log: Work on the handling of request node at some other sofaswitch entity. Modified: sofaswitch/trunk/callflow/src/requestnode.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/requestnode.cpp (original) +++ sofaswitch/trunk/callflow/src/requestnode.cpp Thu Sep 14 22:43:05 2006 @@ -27,8 +27,15 @@ SetSize(newSize); displayData[displayData.size()] = - InformationSection(wxT("request node from "), wxT("voip")); + InformationSection(wxT("Request node from"), wxT("voip")); + + displayData[displayData.size()] = + InformationSection(wxT("Timer period"), wxT("1")); + displayData[displayData.size()] = + InformationSection(wxT("Timer label"), wxT("request node")); + + relInputPoints.Add(25, 0); relOutputPoints.Add(25, 50); AdjustIoPoints(); @@ -65,32 +72,43 @@ bool DndShapeRequestNode::WriteSystemCode(wxTextFile & file) { - file.AddLine(" def Request_Node(self, aTuple): "); - file.AddLine(" id,y,z = aTuple"); - file.AddLine(" return data[id][\"Output\"]"); + 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())); + 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())); + 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(" \"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(" \"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(" },")); + 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/timer.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/timer.cpp (original) +++ sofaswitch/trunk/callflow/src/timer.cpp Thu Sep 14 22:43:05 2006 @@ -57,6 +57,7 @@ void DndShapeTimer::Draw(wxDC& dc) { + dc.SetPen(*wxBLACK_PEN); DrawCompileError(dc); wxPoint p1(m_rect.GetPosition());
participants (1)
-
SofaSWITCH SVN