diff --git a/Content/FirstPerson/Maps/FirstPersonMap.umap b/Content/FirstPerson/Maps/FirstPersonMap.umap index 6be53d7..cd1809f 100644 --- a/Content/FirstPerson/Maps/FirstPersonMap.umap +++ b/Content/FirstPerson/Maps/FirstPersonMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c7e5f144a554e0425f92e3965766eaf7977678105e021fac2627a89b6a00d39 -size 22866 +oid sha256:8e865ea985c965366f7fa09896561fbd12af5f70f7b49ceef4aaa76aaf6e148c +size 23299 diff --git a/Content/LinacLab/MyMyUserWidget.uasset b/Content/LinacLab/MyMyUserWidget.uasset index 457bc63..cb3c9c9 100644 --- a/Content/LinacLab/MyMyUserWidget.uasset +++ b/Content/LinacLab/MyMyUserWidget.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4218b148bc2380facdae32795e3add31987f3f2467c99d7e1b65782fc49e26ff -size 157511 +oid sha256:e257a3affe17951889e6d12766d297c265f3eb3c63710d161ca47bc53d965a5e +size 155176 diff --git a/Content/LinacLab/vt100_Blueprint.uasset b/Content/LinacLab/vt100_Blueprint.uasset index 948af7a..f542db2 100644 --- a/Content/LinacLab/vt100_Blueprint.uasset +++ b/Content/LinacLab/vt100_Blueprint.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc3c09594dc815ba26c8d7443a34d843beca39d3312eabb83f4a9316e1c28ee9 -size 232334 +oid sha256:f3976d74dfef952698b52743094d7e831ed889a198d49aa1f9ebfa4dc88b0445 +size 234024 diff --git a/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/E/MX/R1GV431P5FDO08OFULRA01.uasset b/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/E/MX/R1GV431P5FDO08OFULRA01.uasset index 4cdf51d..d2edb98 100644 --- a/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/E/MX/R1GV431P5FDO08OFULRA01.uasset +++ b/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/E/MX/R1GV431P5FDO08OFULRA01.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b206044b836f9dd22718e1d0288f91dec2c28bd7ab5b2bc92d8bd8f4ddf8b392 +oid sha256:f9dc880cda365eb231f17c1f880f1bb283c9993c99de0846f8590dc149b5ffbf size 12403 diff --git a/Plugins/hstherac25/Source/hstherac25/Private/Therac.h b/Plugins/hstherac25/Source/hstherac25/Private/Therac.h index 4c7e326..e7dbe5d 100644 --- a/Plugins/hstherac25/Source/hstherac25/Private/Therac.h +++ b/Plugins/hstherac25/Source/hstherac25/Private/Therac.h @@ -1,4 +1,4 @@ - +#pragma once #include typedef enum ExtCallType { diff --git a/Plugins/hstherac25/Source/hstherac25/Private/TheracAdapterComponent.cpp b/Plugins/hstherac25/Source/hstherac25/Private/TheracAdapterComponent.cpp index 88a3cb1..4eb25f6 100644 --- a/Plugins/hstherac25/Source/hstherac25/Private/TheracAdapterComponent.cpp +++ b/Plugins/hstherac25/Source/hstherac25/Private/TheracAdapterComponent.cpp @@ -43,11 +43,19 @@ void UTheracAdapterComponent::WrapSimulatorCall( EBeamType beam_type, ECollimatorPosition collimator_position, int32 beam_energy -) {} +) { + UpdateSimulator( + ExtCallType(ext_call_type), + wrappedComms, + BeamType(beam_type), + CollimatorPosition(collimator_position), + beam_energy + ); +} // Called when the game starts void UTheracAdapterComponent::BeginPlay() { - + /* FString BaseDir = IPluginManager::Get().FindPlugin("hstherac25")->GetBaseDir(); FString LibraryPath = @@ -56,7 +64,7 @@ void UTheracAdapterComponent::BeginPlay() { simulatorLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr; - + */ Super::BeginPlay(); wrappedComms = start_machine(); std::map hng = { @@ -70,6 +78,7 @@ void UTheracAdapterComponent::BeginPlay() { for (auto & [hnng, hnnng] : hng) { compMap.Add(hnng, hnnng); } + ExtCallTypeMap.Add("T", EExtCallType::ExtCallSendMEOS); ExtCallTypeMap.Add("R", EExtCallType::ExtCallReset); ExtCallTypeMap.Add("P", EExtCallType::ExtCallProceed); @@ -84,13 +93,13 @@ void UTheracAdapterComponent::BeginPlay() { // ... } - +/* void UTheracAdapterComponent::shutdownSimulator() { kill_machine(); FPlatformProcess::FreeDllHandle(simulatorLibraryHandle); simulatorLibraryHandle = nullptr; } - +*/ // Called every frame void UTheracAdapterComponent::TickComponent( float DeltaTime, diff --git a/Plugins/hstherac25/Source/hstherac25/Private/hstherac25.cpp b/Plugins/hstherac25/Source/hstherac25/Private/hstherac25.cpp index f14d506..fa77f76 100644 --- a/Plugins/hstherac25/Source/hstherac25/Private/hstherac25.cpp +++ b/Plugins/hstherac25/Source/hstherac25/Private/hstherac25.cpp @@ -13,16 +13,17 @@ void Fhstherac25Module::StartupModule() { // This code will execute after your module is loaded into memory; the exact // timing is specified in the .uplugin file per-module - /* + // Get the base directory of this plugin FString BaseDir = IPluginManager::Get().FindPlugin("hstherac25")->GetBaseDir(); // Add on the relative location of the third party dll and load it -/ FString LibraryPath; + FString LibraryPath; #if PLATFORM_WINDOWS - LibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/hstherac-hs/HSdll.dll")); - + LibraryPath = + // FPaths::Combine(*BaseDir, TEXT("Binaries/Win64/hstherac25.dll")); + FPaths::Combine(*BaseDir, TEXT("Binaries/Win64/HSdll.dll")); #elif PLATFORM_MAC LibraryPath = FPaths::Combine( *BaseDir, @@ -55,7 +56,6 @@ void Fhstherac25Module::StartupModule() { ) ); } - */ } void Fhstherac25Module::ShutdownModule() { @@ -64,8 +64,9 @@ void Fhstherac25Module::ShutdownModule() { // unloading the module. // Free the dll handle - // FPlatformProcess::FreeDllHandle(simulatorLibraryHandle); - // simulatorLibraryHandle = nullptr; + kill_machine(); + FPlatformProcess::FreeDllHandle(simulatorLibraryHandle); + simulatorLibraryHandle = nullptr; } #undef LOCTEXT_NAMESPACE diff --git a/Plugins/hstherac25/Source/hstherac25/Public/TheracAdapterComponent.h b/Plugins/hstherac25/Source/hstherac25/Public/TheracAdapterComponent.h index 010368e..cc43bd0 100644 --- a/Plugins/hstherac25/Source/hstherac25/Public/TheracAdapterComponent.h +++ b/Plugins/hstherac25/Source/hstherac25/Public/TheracAdapterComponent.h @@ -45,8 +45,6 @@ class HSTHERAC25_API UTheracAdapterComponent : public UActorComponent { TMap compMap; - void * simulatorLibraryHandle; - void UpdateSimulator( ExtCallType ect, HsStablePtr wrapped_comms = nullptr, @@ -100,7 +98,8 @@ public: protected: // Called when the game starts virtual void BeginPlay() override; - void shutdownSimulator(); + + // void shutdownSimulator(); public: // Called every frame diff --git a/Plugins/hstherac25/Source/hstherac25/Public/hstherac25.h b/Plugins/hstherac25/Source/hstherac25/Public/hstherac25.h index 559ff41..a7a5d44 100644 --- a/Plugins/hstherac25/Source/hstherac25/Public/hstherac25.h +++ b/Plugins/hstherac25/Source/hstherac25/Public/hstherac25.h @@ -12,5 +12,5 @@ public: private: /** Handle to the test dll we will load */ - // void * simulatorLibraryHandle; + void * simulatorLibraryHandle; }; diff --git a/Plugins/hstherac25/Source/hstherac25/hstherac25.Build.cs b/Plugins/hstherac25/Source/hstherac25/hstherac25.Build.cs index e88d502..c0e5a15 100644 --- a/Plugins/hstherac25/Source/hstherac25/hstherac25.Build.cs +++ b/Plugins/hstherac25/Source/hstherac25/hstherac25.Build.cs @@ -63,7 +63,9 @@ public class hstherac25 : ModuleRules // ... add any modules that your module loads dynamically here ... } ); - PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "../hstherac-hs", "hstherac25.dll.a")); - RuntimeDependencies.Add(Path.Combine(ModuleDirectory, "../hstherac-hs/hstherac25.dll")); + // PublicAdditionalLibraries.Add(Path.Combine(PluginDirectory, "Source", "hstherac-hs", "hstherac25.dll.a")); + // RuntimeDependencies.Add(Path.Combine(PluginDirectory, "Source", "hstherac-hs", "hstherac25.dll")); + PublicAdditionalLibraries.Add(Path.Combine(PluginDirectory, "Source", "hstherac-hs", "HSdll.dll.a")); + RuntimeDependencies.Add(Path.Combine(PluginDirectory, "Source", "hstherac-hs", "HSdll.dll")); } } diff --git a/Source/MyProject.Target.cs b/Source/MyProject.Target.cs index 3f83387..b05307b 100644 --- a/Source/MyProject.Target.cs +++ b/Source/MyProject.Target.cs @@ -9,6 +9,6 @@ public class MyProjectTarget : TargetRules Type = TargetType.Game; DefaultBuildSettings = BuildSettingsVersion.V5; - ExtraModuleNames.AddRange(new string[] { "MyProject", "hstherac25" }); + ExtraModuleNames.AddRange(new string[] { "MyProject", }); } } diff --git a/Source/MyProject/MyProject.Build.cs b/Source/MyProject/MyProject.Build.cs index 1f5f2f5..ee544cc 100644 --- a/Source/MyProject/MyProject.Build.cs +++ b/Source/MyProject/MyProject.Build.cs @@ -13,7 +13,7 @@ public class MyProject : ModuleRules PrivateDependencyModuleNames.AddRange(new string[] { }); // Uncomment if you are using Slate UI - PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore", "hstherac25" }); + PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); // Uncomment if you are using online features // PrivateDependencyModuleNames.Add("OnlineSubsystem"); diff --git a/Source/MyProject/Private/ModeInputTextBox.cpp b/Source/MyProject/Private/ModeInputTextBox.cpp index c54c4c8..5bbd372 100644 --- a/Source/MyProject/Private/ModeInputTextBox.cpp +++ b/Source/MyProject/Private/ModeInputTextBox.cpp @@ -1,37 +1,53 @@ // Fill out your copyright notice in the Description page of Project Settings. #include "ModeInputTextBox.h" +#include void UModeInputTextBox::HandleOnTextChanged(FText const & inText) { + Text = Text.GetEmpty(); auto & s = inText.ToString(); - auto lastChar = s.LeftChop(1); - lastChar.ToUpperInline(); + // UE_LOGFMT(LogTemp, Warning, "kill me {inText}", s); + + auto lastChar = s.ToUpper().Right(1); + // UE_LOGFMT(LogTemp, Warning, "fucking {lastChar}", lastChar); + SetText(FText::FromString(lastChar)); if (!lastChar.IsEmpty()) { switch (myTarget) { case THSModeTarget::Energy: - switch (lastChar[0]) { + switch (lastChar[lastChar.Len() - 1]) { case 'E': + break; case 'X': + break; default: + lastChar[lastChar.Len() - 1] = '\0'; + break; } break; case THSModeTarget::OpMode: - switch (lastChar[0]) { + switch (lastChar[lastChar.Len() - 1]) { case 'T': + break; case 'R': + break; case 'P': + break; + default: + lastChar = ""; } break; default: break; } } + // UE_LOGFMT(LogTemp, Warning, "wat {lastChar}", lastChar); SetText(FText::FromString(lastChar)); + // SetText(FText::FromString(FString::Printf(TEXT("%c"), lastChar))); } diff --git a/Source/MyProject/Private/MyUserWidget.cpp b/Source/MyProject/Private/MyUserWidget.cpp index a58469e..1756af7 100644 --- a/Source/MyProject/Private/MyUserWidget.cpp +++ b/Source/MyProject/Private/MyUserWidget.cpp @@ -3,6 +3,25 @@ #include "MyUserWidget.h" #include +bool UMyUserWidget::AllVerified() { + UTextBlock * myVerifiers[9] = { + URM_Verifier, + MU_Verifier, + Time_Verifier, + GR_Verifier, + CR_Verifier, + ColX_Verifier, + ColY_Verifier, + WN_Verifier, + AN_Verifier + }; + for (auto & v : myVerifiers) { + if (v->GetText().IsEmpty()) + return false; + } + return true; +} + void UMyUserWidget::NativeOnInitialized() { auto ps = StaticCast(GetOwningPlayerState()); if (ps == nullptr) diff --git a/Source/MyProject/Public/MyUserWidget.h b/Source/MyProject/Public/MyUserWidget.h index 5d24dc7..245f8ba 100644 --- a/Source/MyProject/Public/MyUserWidget.h +++ b/Source/MyProject/Public/MyUserWidget.h @@ -45,5 +45,35 @@ class MYPROJECT_API UMyUserWidget : public UUserWidget { UPROPERTY(meta = (BindWidget)) UTextBlock * AN_TextBlock; + UPROPERTY(meta = (BindWidget)) + UTextBlock * URM_Verifier; + + UPROPERTY(meta = (BindWidget)) + UTextBlock * MU_Verifier; + + UPROPERTY(meta = (BindWidget)) + UTextBlock * Time_Verifier; + + UPROPERTY(meta = (BindWidget)) + UTextBlock * GR_Verifier; + + UPROPERTY(meta = (BindWidget)) + UTextBlock * CR_Verifier; + + UPROPERTY(meta = (BindWidget)) + UTextBlock * ColX_Verifier; + + UPROPERTY(meta = (BindWidget)) + UTextBlock * ColY_Verifier; + + UPROPERTY(meta = (BindWidget)) + UTextBlock * WN_Verifier; + + UPROPERTY(meta = (BindWidget)) + UTextBlock * AN_Verifier; + + UFUNCTION(BlueprintCallable, BluePrintPure) + bool AllVerified(); + void NativeOnInitialized() override; }; diff --git a/Source/MyProjectEditor.Target.cs b/Source/MyProjectEditor.Target.cs index 2157b13..d8c9ed8 100644 --- a/Source/MyProjectEditor.Target.cs +++ b/Source/MyProjectEditor.Target.cs @@ -9,6 +9,6 @@ public class MyProjectEditorTarget : TargetRules Type = TargetType.Editor; DefaultBuildSettings = BuildSettingsVersion.V5; - ExtraModuleNames.AddRange(new string[] { "MyProject", "hstherac25" }); + ExtraModuleNames.AddRange(new string[] { "MyProject", }); } }