enum TVerdict CEsockTest9_4::easyTestStepL()
	{
	Logger().WriteFormat(_L("TE_ESock: test 9.4"));
	TESTL(EPass == TestStepResult());
	
	// ipv4
	// List Route(s)
	ListRoutes();
	
	// Add Route
	TInt ret = SetRoute(KSoInetAddRoute, IPADDR(10,158,7,52),IPADDR(255,0,0,0),IPADDR(10,158,7,73), IPADDR(127,0,0,1), 0);
	TESTEL(KErrNone == ret, ret);
	
	// List Route(s)
	ListRoutes();
	
	// Change Route
	ret = SetRoute(KSoInetChangeRoute, IPADDR(10,158,7,52),IPADDR(255,0,0,0),IPADDR(10,158,7,70), IPADDR(127,0,0,1), 0);
	TESTEL(KErrNotFound == ret, ret);
	
	// List Route(s)
	ListRoutes();
	
	return EPass;
	}
예제 #2
0
//-----------------------------------------------------------------------------
//! 
//-----------------------------------------------------------------------------
void tSteerPanel::CreateActions()
{
    m_pSetRouteAct = new tAction( tr( "Start route" ) + "...", this );
    m_pSetRouteAct->SetAbbreviation( tr( "Start route", "[abbrev] for Start route" ));
    Connect( m_pSetRouteAct, SIGNAL( triggered() ), this, SLOT( SetRoute() ), Qt::QueuedConnection );

    m_pSetWptAct = new tAction( tr( "Goto waypoint" ) + "...", this );
    m_pSetWptAct->SetAbbreviation( tr( "Goto wpt.", "[abbrev] for Goto waypoint" ));
    Connect( m_pSetWptAct, SIGNAL( triggered() ), this, SLOT( SetWpt() ), Qt::QueuedConnection );

    m_pCancelNavAct = new tAction( tr( "Cancel" ), this );
    m_pCancelNavAct->SetAbbreviation( tr( "Cancel", "[abbrev] for Cancel" ));
    m_pCancelNavAct->SetAppearance( Action::DestructiveAppearance );
    Connect( m_pCancelNavAct, SIGNAL( triggered() ), this, SLOT( OnCancelNavigation() ), Qt::QueuedConnection );

    m_pSkipNavigationAct = new tAction( tr( "Skip" ), this );
    m_pSkipNavigationAct->SetAbbreviation( tr( "Skip", "[abbrev] for Skip" ));
    Connect( m_pSkipNavigationAct, SIGNAL( triggered() ), m_pNavigationDataEngine, SLOT( NavigateToNext() ) );

    m_pXTEResetAct = new tAction( tr( "Restart" ), this );
    m_pXTEResetAct->SetAbbreviation( tr( "Restart", "[abbrev] for Restart" ));
    Connect( m_pXTEResetAct, SIGNAL( triggered() ), m_pNavigationDataEngine, SLOT( RestartNavigation() ) );

    m_pNewWaypointAct = new tAction( style()->standardIcon( NIT(tNOSStyle::NIT_MenuNewWaypoint) ), tr( "New waypoint" ) + "...", this );
    m_pNewWaypointAct->SetAbbreviation( tr( "New wpt.", "[abbrev] for New waypoint" ));
    Connect( m_pNewWaypointAct, SIGNAL( triggered() ), this, SLOT( NewWaypoint() ), Qt::QueuedConnection );

    m_pBlankSpaceAct = new tAction( this );
}
예제 #3
0
파일: Taxi.cpp 프로젝트: paarikan/ECS60-p5
//update the position of the taxi
void CTaxi::MoveTimeStep(int dt, CGraph * graph)
{
    int f_curr, f_next;
    for (int i=0; i<dt; i++)
    {
        if (m_bAvailable == false)
        {
            m_distLeftOnEdge--;
            if (m_distLeftOnEdge == 0)
            {
                f_curr = m_route.front();
                m_location = f_curr;
                m_route.pop_front();
                if (m_route.empty())
                {
                    if (m_location == m_dropoff)
                    {
                        m_bAvailable = true;
                        cout << "Taxi " << m_name << " dropping off passenger at " << m_location << "." << endl;
                    }
                    else
                    {
                        SetRoute(graph, m_dropoff);
                        cout << "Taxi " << m_name << " picking passenger up at " << m_location << "." << endl;
                        PrintRoute();
                    }
                }
                else
                {
                    f_next = m_route.front();
                    vector <EDGE> f_edges = graph->m_adjVect.at(f_curr);
                    for (vector <EDGE>::iterator f_it = f_edges.begin(); f_it != f_edges.end(); f_it++)
                    {
                        if ((*f_it).endVert == f_next)
                        {
                            m_distLeftOnEdge = (*f_it).weight;
                        }
                    } 
                }
            }
        }
    }
}