Modification Split-Sensor-Response
This commit is contained in:
@ -240,6 +240,22 @@ EDTFluxSplitType UDTFluxDataStorage::GetSplitStatus(int ContestID, int StageID,
|
||||
return EDTFluxSplitType::UnknownSplitType;
|
||||
}
|
||||
|
||||
bool UDTFluxDataStorage::GetStageRankingForBib(int ContestID, int StageID, int Bib,
|
||||
FDTFluxStageRanking& OutStageRanking)
|
||||
{
|
||||
FDTFluxStage Stage;
|
||||
GetStage(ContestID, StageID, Stage);
|
||||
for(auto& StageRanking : Stage.StageRanking)
|
||||
{
|
||||
if(StageRanking.Bib == Bib )
|
||||
{
|
||||
OutStageRanking = StageRanking;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
TArray<FDTFluxParticipant> UDTFluxDataStorage::GetParticipants(const int ContestId)
|
||||
{
|
||||
|
||||
@ -500,17 +500,24 @@ void UDTFluxSubsystem::ProcessSplitSensor(const FDTFluxSplitSensorResponse& Spli
|
||||
UE_LOG(LogDTFluxAPI, Log, TEXT("Checking SplitStatus ..."))
|
||||
EDTFluxSplitType SplitType = DataStorage->GetSplitStatus(SplitSensorItem.ContestID,
|
||||
SplitSensorItem.StageID, SplitSensorItem.SplitID);
|
||||
FDTFluxFinisherData Data;
|
||||
Data.Bib = SplitSensorItem.Bib;
|
||||
Data.ContestId = SplitSensorItem.ContestID;
|
||||
Data.StageId = SplitSensorItem.StageID;
|
||||
Data.SplitRanking = NewRanking;
|
||||
switch(SplitType)
|
||||
{
|
||||
case PreFinnishSplit:
|
||||
|
||||
UE_LOG(LogDTFluxAPI, Warning, TEXT("SplitSensor %d for Stage%02d in Contest%02d is a Prefinish Sensor"),
|
||||
SplitSensorItem.SplitID, SplitSensorItem.StageID, SplitSensorItem.ContestID);
|
||||
OnSpotter.Broadcast(NewRanking);
|
||||
OnSpotter.Broadcast(Data);
|
||||
break;
|
||||
case FinishSplit:
|
||||
UE_LOG(LogDTFluxAPI, Warning, TEXT("SplitSensor %d for Stage%02d in Contest%02d is a Finish Sensor"),
|
||||
SplitSensorItem.SplitID, SplitSensorItem.StageID, SplitSensorItem.ContestID);
|
||||
OnFinisher.Broadcast(NewRanking);
|
||||
DataStorage->GetStageRankingForBib(SplitSensorItem.ContestID, SplitSensorItem.StageID, SplitSensorItem.Bib, Data.StageRanking);
|
||||
OnFinisher.Broadcast(Data);
|
||||
break;
|
||||
case NormalSplit:
|
||||
UE_LOG(LogDTFluxAPI, Warning, TEXT("SplitSensor %d for Stage%02d in Contest%02d is a Normal Split"),
|
||||
|
||||
@ -121,4 +121,6 @@ public:
|
||||
FDTFluxSplitRanking AddSplitRanking(const FDTFluxSplitSensorItemResponse& SplitSensorItem);
|
||||
UFUNCTION()
|
||||
EDTFluxSplitType GetSplitStatus(int ContestID, int StageID, int SplitID);
|
||||
|
||||
bool GetStageRankingForBib(int ContestID, int StageID, int Bib, FDTFluxStageRanking& OutStageRanking);
|
||||
};
|
||||
|
||||
@ -211,6 +211,24 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
||||
// ReSharper disable once IdentifierTypo
|
||||
struct DTFLUXAPI_API FDTFluxFinisherData
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
||||
int ContestId;
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
||||
int StageId;
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
||||
int Bib = -1;
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
||||
FDTFluxSplitRanking SplitRanking;
|
||||
UPROPERTY(BlueprintReadWrite, Category="DTFlux|Model")
|
||||
FDTFluxStageRanking StageRanking;
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
||||
struct DTFLUXAPI_API FDTFluxSplit
|
||||
{
|
||||
@ -526,17 +544,6 @@ struct DTFLUXAPI_API FDTFluxFinisher
|
||||
FDTFluxStageRanking CurrentRanking;
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Subsystem|Events")
|
||||
struct DTFLUXAPI_API FDTFluxWsResponseEvent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
|
||||
TEnumAsByte<EDTFluxResponseType> WsResponseType;
|
||||
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
|
||||
FString RawData;
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Subsystem|Events")
|
||||
struct DTFLUXAPI_API FDTFluxStageFinished
|
||||
{
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "UObject/Object.h"
|
||||
#include "DTFluxUtils/DTFluxEnums.h"
|
||||
#include "DTFluxModelResponse.generated.h"
|
||||
|
||||
/**
|
||||
@ -23,7 +24,6 @@ public:
|
||||
FString Name;
|
||||
};
|
||||
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
||||
struct DTFLUXAPI_API FStageResponse
|
||||
{
|
||||
@ -133,7 +133,6 @@ public:
|
||||
float SpeedTotal;
|
||||
};
|
||||
|
||||
|
||||
USTRUCT()
|
||||
struct DTFLUXAPI_API FDTFluxStageRankingResponse
|
||||
{
|
||||
@ -192,7 +191,6 @@ struct DTFLUXAPI_API FDTFluxStatusUpdateResponse
|
||||
};
|
||||
|
||||
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
||||
struct DTFLUXAPI_API FDTFluxSplitSensorItemResponse
|
||||
{
|
||||
@ -215,7 +213,6 @@ struct DTFLUXAPI_API FDTFluxSplitSensorItemResponse
|
||||
int Rank;
|
||||
};
|
||||
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
||||
struct DTFLUXAPI_API FDTFluxSplitSensorResponse
|
||||
{
|
||||
@ -227,7 +224,6 @@ struct DTFLUXAPI_API FDTFluxSplitSensorResponse
|
||||
TArray<FDTFluxSplitSensorItemResponse> Datas;
|
||||
};
|
||||
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Model")
|
||||
struct DTFLUXAPI_API FDTFluxTeamListItemResponse
|
||||
{
|
||||
@ -276,7 +272,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
|
||||
USTRUCT()
|
||||
struct DTFLUXAPI_API FDTFluxTeamUpdateResponse
|
||||
{
|
||||
@ -288,6 +283,7 @@ struct DTFLUXAPI_API FDTFluxTeamUpdateResponse
|
||||
TArray<FDTFluxTeamListItemResponse> Datas;
|
||||
|
||||
};
|
||||
|
||||
USTRUCT()
|
||||
struct DTFLUXAPI_API FDTFluxArchSelectResponseItem
|
||||
{
|
||||
@ -311,4 +307,15 @@ struct DTFLUXAPI_API FDTFluxArchSelectResponse
|
||||
TArray<FDTFluxArchSelectResponseItem> Datas;
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType, Category="DTFlux|Subsystem|Events")
|
||||
struct DTFLUXAPI_API FDTFluxWsResponseEvent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
|
||||
TEnumAsByte<EDTFluxResponseType> WsResponseType;
|
||||
UPROPERTY(BlueprintReadOnly, Category="DTFlux|Subsystem|Events")
|
||||
FString RawData;
|
||||
};
|
||||
|
||||
@ -29,8 +29,8 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnTimerTriggered);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnRaceDataReceived);
|
||||
DECLARE_DYNAMIC_DELEGATE_OneParam(FOnTimer, FString, TimerName);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWsEvent, FDTFluxWsResponseEvent, WsResponseEvent);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnFinisher, FDTFluxSplitRanking, FinisherData);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSpotter, FDTFluxSplitRanking, SpotterData);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnFinisher, FDTFluxFinisherData, FinisherData);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSpotter, FDTFluxFinisherData, SpotterData);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSplitSensor, FDTFluxSplitRanking, ParticipantSplitData);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnContestBegin, int, ContestId);
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnStageBegin, int, ContestId, int, StageId);
|
||||
|
||||
Reference in New Issue
Block a user