Ejemplo n.º 1
0
bool
TimeSliderForwardStepActionUI::Enabled() const
{
#ifdef HAVE_DDT
    if (DDTManager::isDDTSim(GetLogic()->GetWindow()))
        return true;
    else
#endif
        return GetLogic()->GetWindow()->GetPlotList()->HasActiveTimeSlider() &&
               GetLogic()->GetWindow()->GetPlotList()->GetNumPlots() > 0;
}
Ejemplo n.º 2
0
/////////////////// Handlers of the Port Opening
OP_STATUS UPnPXH_IPRouted::HandleTokenAuto()
{
    OpString* conn_type=tags_parser.getTagValue(0);

    if(!GetDevice())
        return OpStatus::ERR_NULL_POINTER;

    if(GetLogic() && !upnp->IsDebugging(UPNP_DBG_NO_ROUTED) && !conn_type->Compare(UNI_L("IP_Routed")))
        return ((UPnPPortOpening *)GetLogic())->QueryNATEnabled(GetDevice());

    if(GetDevice()->IsPPP())
        NotifyFailure("No PPP IP_Routed");
    else
        NotifyFailure("No IP IP_Routed");

    return OpStatus::OK;
}
Ejemplo n.º 3
0
bool
AnimationPlayActionUI::Checked() const
{
    bool retval = false;
#ifdef HAVE_DDT
    if (DDTManager::isDDTSim(GetLogic()->GetWindow()))
    {
        const EngineKey &key = GetLogic()->GetWindow()->GetPlotList()->GetEngineKey();
        const avtDatabaseMetaData *md = GetViewerEngineManager()->GetSimulationMetaData(key);
        if (md && key.IsSimulation())
            retval = md->GetSimInfo().GetMode()==avtSimulationInformation::Running;
        else
            retval = true;
    }
    else
#endif
        retval = GetLogic()->GetWindow()->GetPlotList()->GetAnimationAttributes().GetAnimationMode() ==
                 AnimationAttributes::PlayMode;
    return retval;
}
Ejemplo n.º 4
0
EnableToolbarActionUI::EnableToolbarActionUI(ViewerActionLogic *L) : ViewerActionUIMultiple(L)
{
    SetAllText(tr("Toolbars"));
    SetToolTip(tr("Enable toolbars"));
    SetExclusive(false);

    // Add all of the action groups as choices.
    ViewerActionManager *actionMgr = GetLogic()->GetWindow()->GetActionManager();
    stringVector names(actionMgr->GetActionGroupNames(false));
    for(size_t i = 0; i < names.size(); ++i)
        AddChoice(names[i].c_str());
}
Ejemplo n.º 5
0
OP_STATUS UPnPXH_PortStatus::HandleTokenAuto()
{
    OP_NEW_DBG("UPnPXH_PortStatus::HandleTokenAuto", "upnp_trace");
    OP_DBG((UNI_L("*** Internal Port: %s\n"), tags_parser.getTagValue(0)->CStr()));
    OP_DBG((UNI_L("*** Enable: %s\n"), tags_parser.getTagValue(1)->CStr()));
    OP_DBG((UNI_L("*** Port Mapping Description: %s\n"), tags_parser.getTagValue(2)->CStr()));
    OP_DBG((UNI_L("*** Lease Duration: %s\n"), tags_parser.getTagValue(3)->CStr()));

    OP_ASSERT(GetLogic());

    if(!GetLogic())
        return OpStatus::ERR_NULL_POINTER;

    if(next_action==DISABLE)
        return ((UPnPPortOpening *)GetLogic())->QueryDisablePort(GetDevice(), external_port);
    if(next_action==ENABLE)
        return ((UPnPPortOpening *)GetLogic())->QueryEnablePort(GetDevice(), external_port);
    if(next_action==STATUS)
        return ((UPnPPortOpening *)GetLogic())->QueryIDGPortStatus(GetDevice(), external_port);

    return OpStatus::OK;
}
Ejemplo n.º 6
0
OP_STATUS UPnPXH_NATEnabled::HandleTokenAuto()
{
    OpString* nat_enabled=tags_parser.getTagValue(0);

    if(!GetDevice())
        return OpStatus::ERR_NULL_POINTER;

    if(GetLogic() && !upnp->IsDebugging(UPNP_DBG_NO_ROUTED) && !nat_enabled->Compare(UNI_L("1")))
    {
        return ((UPnPPortOpening *)GetLogic())->QueryExternalIP(GetDevice());
        //((UPnPPortOpening *)GetLogic())->QueryDisablePort();
        //return ((UPnPPortOpening *)GetLogic())->QueryIDGPortStatus();
        //return ((UPnPPortOpening *)GetLogic())->QueryDisablePort();
        //return ((UPnPPortOpening *)GetLogic())->QueryIDGPortStatus();
    }

    if(GetDevice()->IsPPP())
        NotifyFailure("No PPP NAT Enabled");
    else
        NotifyFailure("No IP NAT Enabled");

    return OpStatus::OK;
}
Ejemplo n.º 7
0
// -----------------------------------------------------------------------------
// private   
LogicErrorCode LogicOperationManager::pushBackOperation(IN IOperation* pOperation, Int32 delay)
{
	assert(pOperation);
    assert(m_pOperationThread);
	if (0 == m_pOperationThread || 0 == pOperation)
    {
        return LOGIC_ARGUMENT_ERROR;
    }

	if (delay > 0)
	{
		m_vecDelayOperations.push_back(pOperation);
		ITimerEvent* pTimer = 0;
		return GetLogic()->scheduleTimerWithLambda(delay, FALSE,
			[=]()
		{
			m_pOperationThread->pushFrontOperation(pOperation);
			auto delayIter = std::remove_if(m_vecDelayOperations.begin()
											,m_vecDelayOperations.end()
											,[=](IOperation* pOper)
			{
				return (pOperation == pOper);
			}
			);
			if (delayIter != m_vecDelayOperations.end())
			{
				m_vecDelayOperations.erase(delayIter,m_vecDelayOperations.end());
			}
		}
		, &pTimer);
	}
	else
	{
		return m_pOperationThread->pushBackOperation(pOperation);
	}
}
Ejemplo n.º 8
0
bool
EnableToolbarActionUI::ChoiceChecked(int i) const
{
    ViewerActionManager *actionMgr = GetLogic()->GetWindow()->GetActionManager();
    return actionMgr->GetActionGroupEnabled(i);
}
Ejemplo n.º 9
0
bool
AnimationReversePlayActionUI::Enabled() const
{
    return GetLogic()->GetWindow()->GetPlotList()->HasActiveTimeSlider() &&
           GetLogic()->GetWindow()->GetPlotList()->GetNumPlots() > 0;
}
Ejemplo n.º 10
0
bool
AnimationReversePlayActionUI::Checked() const
{
    return (GetLogic()->GetWindow()->GetPlotList()->GetAnimationAttributes().GetAnimationMode() ==
            AnimationAttributes::ReversePlayMode);
}