MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / OnPoll

Method OnPoll

Source/URLabEditor/Private/SMjBridgeServerToggle.cpp:56–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56EActiveTimerReturnType SURLabBridgeServerToggle::OnPoll(double, float)
57{
58 UURLabBridgeServerSubsystem* Sub = GetSub();
59 if (!Sub)
60 {
61 CachedLabel = FText::FromString(TEXT("Bridge: -"));
62 CachedButtonText = FText::FromString(TEXT("Start"));
63 CachedColor = FLinearColor(0.35f, 0.35f, 0.35f, 1.0f);
64 return EActiveTimerReturnType::Continue;
65 }
66
67 if (Sub->IsRunning())
68 {
69 CachedLabel = FText::FromString(FString::Printf(
70 TEXT("Bridge: running (port %d)"), Sub->GetConfig().StepPort));
71 CachedButtonText = FText::FromString(TEXT("Stop"));
72 CachedColor = FLinearColor(0.18f, 0.55f, 0.20f, 1.0f); // green
73 }
74 else
75 {
76 CachedLabel = FText::FromString(TEXT("Bridge: stopped"));
77 CachedButtonText = FText::FromString(TEXT("Start"));
78 CachedColor = FLinearColor(0.40f, 0.40f, 0.40f, 1.0f); // grey
79 }
80 return EActiveTimerReturnType::Continue;
81}
82
83FReply SURLabBridgeServerToggle::OnButtonClicked()
84{

Callers

nothing calls this directly

Calls 2

GetSubFunction · 0.85
IsRunningMethod · 0.45

Tested by

no test coverage detected