112 lines
2.7 KiB
C++
112 lines
2.7 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "Components/ActorComponent.h"
|
|
#include "CoreMinimal.h"
|
|
#include <HsFFI.h>
|
|
// #include
|
|
// <hstherac-hs/dist-newstyle/build/x86_64-windows/ghc-9.6.7/hstherac25-0.1.0.0/build/HsTherac25_stub.h>
|
|
#include <Therac.h>
|
|
#include <Internationalization/Text.h>
|
|
#include "TheracAdapterComponent.generated.h"
|
|
|
|
UENUM()
|
|
enum class EBeamType : uint8 {
|
|
BeamTypeXRay = 1,
|
|
BeamTypeElectron,
|
|
};
|
|
|
|
UENUM()
|
|
enum class ECollimatorPosition : uint8 {
|
|
CollimatorPositionXRay = 1,
|
|
CollimatorPositionElectronBeam,
|
|
};
|
|
|
|
UENUM()
|
|
enum class EExtCallType : uint8 {
|
|
ExtCallSendMEOS = 1,
|
|
ExtCallToggleDatentComplete,
|
|
ExtCallToggleEditingTakingPlace,
|
|
ExtCallReset,
|
|
ExtCallProceed
|
|
};
|
|
|
|
UCLASS(
|
|
BlueprintType,
|
|
ClassGroup = (Custom),
|
|
meta = (BlueprintSpawnableComponent)
|
|
)
|
|
class HSTHERAC25_API UTheracAdapterComponent : public UActorComponent {
|
|
|
|
GENERATED_BODY()
|
|
|
|
HsStablePtr wrappedComms;
|
|
|
|
TMap<FText *, StateInfoRequest> compMap;
|
|
|
|
void UpdateSimulator(
|
|
ExtCallType ect,
|
|
HsStablePtr wrapped_comms = nullptr,
|
|
BeamType beam_type = BeamTypeUndefined,
|
|
CollimatorPosition collimator_position = CollimatorPositionUndefined,
|
|
HsInt beam_energy = 25000
|
|
);
|
|
|
|
public:
|
|
// Sets default values for this component's properties
|
|
UTheracAdapterComponent();
|
|
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
FText TreatmentOutcome;
|
|
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
FText ActiveSubsystem;
|
|
|
|
// TPhase
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
FText TreatmentState;
|
|
|
|
// TreatmentOutcome
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
FText Reason;
|
|
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
FText BeamMode;
|
|
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
FText BeamEnergy;
|
|
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
TMap<FString, EBeamType> BeamTypeMap;
|
|
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
TMap<FString, EExtCallType> ExtCallTypeMap;
|
|
|
|
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
|
|
TMap<FString, ECollimatorPosition> CollimatorPositionMap;
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void WrapSimulatorCall(
|
|
EExtCallType ext_call_type,
|
|
EBeamType beam_type = EBeamType::BeamTypeXRay,
|
|
ECollimatorPosition collimator_position =
|
|
ECollimatorPosition::CollimatorPositionXRay,
|
|
int32 beam_energy = 25000
|
|
);
|
|
|
|
protected:
|
|
// Called when the game starts
|
|
virtual void BeginPlay() override;
|
|
|
|
// void shutdownSimulator();
|
|
|
|
public:
|
|
// Called every frame
|
|
virtual void TickComponent(
|
|
float DeltaTime,
|
|
ELevelTick TickType,
|
|
FActorComponentTickFunction * ThisTickFunction
|
|
) override;
|
|
};
|