Files
TheracUE/Plugins/hstherac25/Source/hstherac25/Public/TheracAdapterComponent.h

112 lines
2.7 KiB
C
Raw Normal View History

2025-05-10 21:31:54 +01:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Components/ActorComponent.h"
2025-05-13 19:02:19 +01:00
#include "CoreMinimal.h"
2025-05-12 21:39:32 +01:00
#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>
2025-05-13 19:02:19 +01:00
#include <Therac.h>
#include <Internationalization/Text.h>
2025-05-12 21:39:32 +01:00
#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
};
2025-05-13 19:02:19 +01:00
UCLASS(
BlueprintType,
ClassGroup = (Custom),
meta = (BlueprintSpawnableComponent)
)
class HSTHERAC25_API UTheracAdapterComponent : public UActorComponent {
2025-05-10 21:31:54 +01:00
2025-05-13 19:02:19 +01:00
GENERATED_BODY()
2025-05-10 21:31:54 +01:00
2025-05-13 19:02:19 +01:00
HsStablePtr wrappedComms;
2025-05-10 21:31:54 +01:00
2025-05-13 19:02:19 +01:00
TMap<FText *, StateInfoRequest> compMap;
2025-05-12 21:39:32 +01:00
void UpdateSimulator(
ExtCallType ect,
HsStablePtr wrapped_comms = nullptr,
BeamType beam_type = BeamTypeUndefined,
CollimatorPosition collimator_position = CollimatorPositionUndefined,
HsInt beam_energy = 25000
);
2025-05-13 19:02:19 +01:00
public:
// Sets default values for this component's properties
UTheracAdapterComponent();
2025-05-10 21:31:54 +01:00
2025-05-13 19:02:19 +01:00
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
FText TreatmentOutcome;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
FText ActiveSubsystem;
2025-05-10 21:31:54 +01:00
2025-05-13 19:02:19 +01:00
// TPhase
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
FText TreatmentState;
2025-05-10 21:31:54 +01:00
2025-05-13 19:02:19 +01:00
// 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
2025-05-13 21:22:31 +01:00
);
2025-05-13 19:02:19 +01:00
protected:
// Called when the game starts
virtual void BeginPlay() override;
2025-05-15 19:28:04 +01:00
// void shutdownSimulator();
2025-05-13 19:02:19 +01:00
public:
// Called every frame
virtual void TickComponent(
float DeltaTime,
ELevelTick TickType,
FActorComponentTickFunction * ThisTickFunction
) override;
2025-05-10 21:31:54 +01:00
};