void UAnimStateNode::PostPasteNode()
{
	// Find an interesting name, but try to keep the same if possible
	TSharedPtr<INameValidatorInterface> NameValidator = FNameValidatorFactory::MakeValidator(this);
	FBlueprintEditorUtils::RenameGraphWithSuggestion(BoundGraph, NameValidator, GetStateName());
	Super::PostPasteNode();
}
Esempio n. 2
0
void SiteTask::GotResponse(int status_code, const char * buf, int len) {
    LOG_F(LS_VERBOSE) << "state:" << GetStateName(GetState())
        << " status:" << status_code << " len:" << len
        << " current: " << curact_;

    SignalActionResponse(site_.actions()[curact_], HttpResponse(status_code, buf, len));
}
Esempio n. 3
0
AbstractMenuState* MainMenuState::GetTransitionState(uint32 selection)
{
    switch(selection)
    {
        case MAIN_OPTIONS_INVENTORY:
            return &(_menu_mode->_inventory_state);
            break;
        case MAIN_OPTIONS_SKILLS:
            return &(_menu_mode->_skills_state);
            break;
        case MAIN_OPTIONS_PARTY:
            return &(_menu_mode->_party_state);
            break;
        case MAIN_OPTIONS_QUESTS:
            return &(_menu_mode->_quests_state);
            break;
        case MAIN_OPTIONS_WORLDMAP:
            return &(_menu_mode->_world_map_state);
            break;
        default:
            PRINT_ERROR << "MENU ERROR: Invalid option in " << GetStateName() << "::GetTransitionState" << std::endl;
            break;

    }
    return NULL;
}
Esempio n. 4
0
/* ==================================================================================
	Function name:	OutputValidLines
 	Arguments:			void
	Returns:				void
	Description:			Output the contents and state of all valid lines in the cache
   ================================================================================== */
void OutputValidLines()
{
	unsigned int i, j, mesifState;
	int valid;

	// Display valid line information
	printf("\nDisplaying valid lines information\n");
	printf("----------------------------------\n");

	for(i = 0; i < cacheStatistics.numSets; ++i)
	{
		valid = 0;

			for(j = 0; j < cacheStatistics.associativity; ++j)
			{
				mesifState = GetMesifState(i, j);
				if(mesifState != eINVALID)
				{
                	char * str = GetStateName(cachePtr[i].setPtr[j].mesifBits);
					// Print line contents and state
					printf("Set %5u   Line %2u   Tag  %#8x   MESIF state: %s\n", i, j, cachePtr[i].setPtr[j].tagBits, str);
					valid = 1;
				}
			}
			if(valid)
			{
				printf("-----------------------");
				printf("\nSet %u  LRU %#x\n\n", i, cachePtr[i].plruBits);
			}
	}
} 
Esempio n. 5
0
int GeneralTask::ProcessResponse() {
    LOG_F(LS_VERBOSE) << "state:" << GetStateName(GetState());
    Assert(sent_);
    
    sent_ = false;
    http_.Close();

    return STATE_DONE;
}
Esempio n. 6
0
//////////////////////////////////////////////////////////////////////////
//
// 在 STATE_START STATE_RESPONSE 之间切换
int SiteTask::ProcessResponse() {
    LOG_F(LS_VERBOSE) << "state:" << GetStateName(GetState());
    if (curact_ == site_.actions().size() - 1) {
        Done();
        return STATE_DONE;
    }

    curact_ ++;
    GeneralTask::ProcessResponse();

    return STATE_START;
}
Esempio n. 7
0
int GeneralTask::ProcessStart() {
    LOG_F(LS_VERBOSE) << "state:" << GetStateName(GetState());
    if (sent_) {
        return STATE_RESPONSE;
    }

    http_.SetCallback(boost::bind(&GeneralTask::OnHttpResponse, this, _1, _2, _3));
    BuildRequest(http_);
    sent_ = true;
    
    return STATE_BLOCKED;
}
	FAnimStateNodeNameValidator(const UAnimStateNodeBase* InStateNode)
		: FStringSetNameValidator(FString())
	{
		TArray<UAnimStateNodeBase*> Nodes;
		UAnimationStateMachineGraph* StateMachine = CastChecked<UAnimationStateMachineGraph>(InStateNode->GetOuter());

		StateMachine->GetNodesOfClass<UAnimStateNodeBase>(Nodes);
		for (auto NodeIt = Nodes.CreateIterator(); NodeIt; ++NodeIt)
		{
			auto Node = *NodeIt;
			if (Node != InStateNode)
			{
				Names.Add(Node->GetStateName());
			}
		}
	}
Esempio n. 9
0
void SiteTask::BuildRequest(SyncHttp & http) {
    LOG_F(LS_VERBOSE) << "state:" << GetStateName(GetState());
    const Action & action_ = site_.actions()[curact_];
    switch (action_.method) {
    case HV_GET : 
        {
            // if action_.charset == ansi, wstring url
            // else utf8 ... use string
            std::wstring url(action_.url);
            if (!action_.vars.empty()) {
                std::ostringstream ss;
                bool f = PrepareForm(ss, action_);
                Assert(f);

                if (action_.charset == SC_ANSI)
                {
                    url += string2w(ss.str());
                }
                else if (action_.charset == SC_UTF8)
                {
                    std::wstring w;
                    utf82string(ss.str(), w);
                    url += w;
                }
            }
            bool f = http.PrepareGet(url, action_.referrer);
            Assert(f);
        }
        break;
    case HV_POST :
        {
            Assert(!action_.vars.empty());
            std::stringstream ss;
            bool f = PrepareForm(ss, action_);
            Assert(f);
            f = http.PreparePost(action_.url, action_.content_type
                , &ss
                , action_.referrer);
            Assert(f);
        }
        break;
    default :
        Assert(false);
        break;
    }
}
Esempio n. 10
0
StateNode::StateNode(QString name, QString updateAction, QString entryAction, QString exitAction)
{

    circle = new Circle(30,this);
    circle->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
    circle->setFlag(QGraphicsItem::ItemIsSelectable, true);

    setFlag(QGraphicsItem::ItemIsSelectable);
    setFlag(QGraphicsItem::ItemIsMovable);

    stateNameTextItem = new QGraphicsTextItem(GetStateName(),this);
    stateNameTextItem->setFlag(QGraphicsItem::ItemStacksBehindParent, true);

    SetStateName(name);
    SetUpdateActionName(updateAction);
    SetEntryActionName(entryAction);
    SetExitActionName(exitAction);

}
Esempio n. 11
0
void InterfaceAddList(int session_id)
{
	session_node *s;
	LV_ITEM lvi;
	int index;
	
	EnterServerLock();
	s = GetSessionByID(session_id);
	if (s == NULL)
	{
		LeaveServerLock();
		return;
	}
	
	index = ListView_GetItemCount(hwndLV);
	
	/* Initialize LV_ITEM members that are common to all items. */
	lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; 
	lvi.state = 0; 
	lvi.stateMask = 0; 
	lvi.pszText = "  ?";  
	lvi.iImage = -1;
	
	lvi.iItem = index;
	lvi.iSubItem = 0; 
	lvi.lParam = session_id;
	
	ListView_InsertItem(hwndLV,&lvi); 
	
	if (s->account == NULL)
	{
		/* need braces around this macro to use in an if/else */
		ListView_SetItemText(hwndLV,index,1,"");
	}
	else   
		ListView_SetItemText(hwndLV,index,1,s->account->name);
	
	ListView_SetItemText(hwndLV,index,2,ShortTimeStr(s->connected_time));
	ListView_SetItemText(hwndLV,index,3,GetStateName(s));
	ListView_SetItemText(hwndLV,index,4,s->conn.name);
	
	LeaveServerLock();
}
Esempio n. 12
0
void InterfaceUpdateList(int session_id)
{
	session_node *s;
	char buf[20];
	LV_FINDINFO lvf;
	int index;
	
	EnterServerLock();
	s = GetSessionByID(session_id);
	if (s == NULL)
	{
		LeaveServerLock();
		return;
	}
	
	lvf.flags = LVFI_PARAM;
	lvf.lParam = session_id;
	index = ListView_FindItem(hwndLV,-1,&lvf);
	
	if (index >= 0)
	{
		if (s->account == NULL)
		{
			ListView_SetItemText(hwndLV,index,0,"  ?");
			ListView_SetItemText(hwndLV,index,1,"");
		}
		else
		{
			sprintf(buf,"%3i",s->account->account_id);
			ListView_SetItemText(hwndLV,index,0,buf);
			ListView_SetItemText(hwndLV,index,1,s->account->name);
		}      
		ListView_SetItemText(hwndLV,index,2,ShortTimeStr(s->connected_time));
		ListView_SetItemText(hwndLV,index,3,GetStateName(s));
		ListView_SetItemText(hwndLV,index,4,s->conn.name);
	}
	LeaveServerLock();
	
}
Esempio n. 13
0
/**
 * Sample event processing function, dumping some event information.
 * Shared between active and passive event demo, to highlight that this part
 * is identical between the two.
 */
static HRESULT EventListenerDemoProcessEvent(IEvent *event)
{
    VBoxEventType_T evType;
    HRESULT rc;

    if (!event)
    {
        printf("event null\n");
        return S_OK;
    }

    evType = VBoxEventType_Invalid;
    rc = IEvent_get_Type(event, &evType);
    if (FAILED(rc))
    {
        printf("cannot get event type, rc=%#x\n", rc);
        return S_OK;
    }

    switch (evType)
    {
        case VBoxEventType_OnMousePointerShapeChanged:
            printf("OnMousePointerShapeChanged\n");
            break;

        case VBoxEventType_OnMouseCapabilityChanged:
            printf("OnMouseCapabilityChanged\n");
            break;

        case VBoxEventType_OnKeyboardLedsChanged:
            printf("OnMouseCapabilityChanged\n");
            break;

        case VBoxEventType_OnStateChanged:
        {
            IStateChangedEvent *ev = NULL;
            enum MachineState state;
            rc = IEvent_QueryInterface(event, &IID_IStateChangedEvent, (void **)&ev);
            if (FAILED(rc))
            {
                printf("cannot get StateChangedEvent interface, rc=%#x\n", rc);
                return S_OK;
            }
            if (!ev)
            {
                printf("StateChangedEvent reference null\n");
                return S_OK;
            }
            rc = IStateChangedEvent_get_State(ev, &state);
            if (FAILED(rc))
                printf("warning: cannot get state, rc=%#x\n", rc);
            IStateChangedEvent_Release(ev);
            printf("OnStateChanged: %s\n", GetStateName(state));

            fflush(stdout);
            if (   state == MachineState_PoweredOff
                || state == MachineState_Saved
                || state == MachineState_Teleported
                || state == MachineState_Aborted
               )
                g_fStop = 1;
            break;
        }

        case VBoxEventType_OnAdditionsStateChanged:
            printf("OnAdditionsStateChanged\n");
            break;

        case VBoxEventType_OnNetworkAdapterChanged:
            printf("OnNetworkAdapterChanged\n");
            break;

        case VBoxEventType_OnSerialPortChanged:
            printf("OnSerialPortChanged\n");
            break;

        case VBoxEventType_OnParallelPortChanged:
            printf("OnParallelPortChanged\n");
            break;

        case VBoxEventType_OnStorageControllerChanged:
            printf("OnStorageControllerChanged\n");
            break;

        case VBoxEventType_OnMediumChanged:
            printf("OnMediumChanged\n");
            break;

        case VBoxEventType_OnVRDEServerChanged:
            printf("OnVRDEServerChanged\n");
            break;

        case VBoxEventType_OnUSBControllerChanged:
            printf("OnUSBControllerChanged\n");
            break;

        case VBoxEventType_OnUSBDeviceStateChanged:
            printf("OnUSBDeviceStateChanged\n");
            break;

        case VBoxEventType_OnSharedFolderChanged:
            printf("OnSharedFolderChanged\n");
            break;

        case VBoxEventType_OnRuntimeError:
            printf("OnRuntimeError\n");
            break;

        case VBoxEventType_OnCanShowWindow:
            printf("OnCanShowWindow\n");
            break;
        case VBoxEventType_OnShowWindow:
            printf("OnShowWindow\n");
            break;

        default:
            printf("unknown event: %d\n", evType);
    }

    return S_OK;
}
FText UAnimStateNode::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	return FText::FromString(GetStateName());
}
void CTilegenState::ExecuteIteration( CLayoutSystem *pLayoutSystem )
{
	if ( m_Actions.Count() == 0 )
	{
		// No actions in this state, go to the first nested state if one exists
		// or move on to the next sibling state.
		if ( m_ChildStates.GetStateCount() > 0 )
		{
			Log_Msg( LOG_TilegenLayoutSystem, "No actions found in state %s, transitioning to first child state.\n", GetStateName() );
			pLayoutSystem->TransitionToState( m_ChildStates.GetState( 0 ) );
		}
		else
		{
			// Try to switch to the next sibling state.
			CTilegenState *pNextState = m_ChildStates.GetParentStateList()->GetNextState( this );
			if ( pNextState != NULL )
			{
				Log_Msg( LOG_TilegenLayoutSystem, "No actions or child states found in state %s, transitioning to next state.\n", GetStateName() );
				pLayoutSystem->TransitionToState( pNextState );
			}
			else
			{
				// This must be the last state in the entire layout system.
				Log_Msg( LOG_TilegenLayoutSystem, "No more states to which to transition." );
				pLayoutSystem->OnFinished();
			}
		}
	}
	else
	{
		pLayoutSystem->GetFreeVariables()->SetOrCreateFreeVariable( "CurrentState", this );
		for ( int i = 0; i < m_Actions.Count(); ++ i )
		{
			if ( pLayoutSystem->ShouldStopProcessingActions() )
			{
				break;
			}

			pLayoutSystem->ExecuteAction( m_Actions[i].m_pAction, m_Actions[i].m_pCondition );
		}
		pLayoutSystem->GetFreeVariables()->SetOrCreateFreeVariable( "CurrentState", NULL );
	}
}