diff --git a/Content/LinacLab/vt100_Blueprint.uasset b/Content/LinacLab/vt100_Blueprint.uasset index 5aea824..029cd32 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:1c4aba487773ed26e7fde7faf0764a66b77528dc577ccba0e3b51521155a7c32 -size 79680 +oid sha256:4b217590882d6f5cc5daae12dd70d1f70d247a8cfe9bfd01eb4e2e35ef7f1eed +size 85673 diff --git a/Plugins/hstherac25/Source/hstherac25/Private/TheracAdapterComponent.cpp b/Plugins/hstherac25/Source/hstherac25/Private/TheracAdapterComponent.cpp new file mode 100644 index 0000000..caefa18 --- /dev/null +++ b/Plugins/hstherac25/Source/hstherac25/Private/TheracAdapterComponent.cpp @@ -0,0 +1,55 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "TheracAdapterComponent.h" +#include "HAL/PlatformProcess.h" +#include "Interfaces/IPluginManager.h" +#include "Misc/Paths.h" +#include +#include +#include +#include + +#define LOCTEXT_NAMESPACE "TheracAdapter" + +// Sets default values for this component's properties +UTheracAdapterComponent::UTheracAdapterComponent() { + // Set this component to be initialized when the game starts, and to be ticked + // every frame. You can turn these features off to improve performance if you + // don't need them. + // PrimaryComponentTick.bCanEverTick = true; + + // ... +} + +// Called when the game starts +void UTheracAdapterComponent::BeginPlay() { + /* + FString BaseDir = + IPluginManager::Get().FindPlugin("hstherac25")->GetBaseDir(); + FString LibraryPath = + FPaths::Combine(*BaseDir, TEXT("Source/hstherac-hs/HSdll.dll")); + + auto simulatorLibraryHandle = + !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) + : nullptr; + */ + Super::BeginPlay(); + wrappedComms = start_machine(); + auto si = FText::FromString(StaticCast( + request_state_info(wrappedComms, RequestActiveSubsystem) + )); + FMessageDialog::Open(EAppMsgType::Ok, si); + // ... +} + +// Called every frame +void UTheracAdapterComponent::TickComponent( + float DeltaTime, + ELevelTick TickType, + FActorComponentTickFunction * ThisTickFunction +) { + Super::TickComponent(DeltaTime, TickType, ThisTickFunction); + + // ... +} + diff --git a/Plugins/hstherac25/Source/hstherac25/Private/hstherac25.cpp b/Plugins/hstherac25/Source/hstherac25/Private/hstherac25.cpp index edb9548..6d6105f 100644 --- a/Plugins/hstherac25/Source/hstherac25/Private/hstherac25.cpp +++ b/Plugins/hstherac25/Source/hstherac25/Private/hstherac25.cpp @@ -1,11 +1,11 @@ // Copyright Epic Games, Inc. All Rights Reserved. #include "hstherac25.h" -#include "Misc/MessageDialog.h" -#include "Modules/ModuleManager.h" -#include "Interfaces/IPluginManager.h" -#include "Misc/Paths.h" #include "HAL/PlatformProcess.h" +#include "Interfaces/IPluginManager.h" +#include "Misc/MessageDialog.h" +#include "Misc/Paths.h" +#include "Modules/ModuleManager.h" #include "Therac.h" #define LOCTEXT_NAMESPACE "Fhstherac25Module" @@ -26,30 +26,26 @@ void Fhstherac25Module::StartupModule() { #elif PLATFORM_MAC LibraryPath = FPaths::Combine( *BaseDir, - TEXT( - "Source/ThirdParty/hstherac25Library/Mac/Release/" - "libExampleLibrary.dylib" - ) + TEXT("Source/ThirdParty/hstherac25Library/Mac/Release/" + "libExampleLibrary.dylib") ); #elif PLATFORM_LINUX LibraryPath = FPaths::Combine( *BaseDir, - TEXT( - "Binaries/ThirdParty/hstherac25Library/Linux/" - "x86_64-unknown-linux-gnu/libExampleLibrary.so" - ) + TEXT("Binaries/ThirdParty/hstherac25Library/Linux/" + "x86_64-unknown-linux-gnu/libExampleLibrary.so") ); #endif // PLATFORM_WINDOWS - ExampleLibraryHandle = !LibraryPath.IsEmpty() - ? FPlatformProcess::GetDllHandle(*LibraryPath) - : nullptr; + simulatorLibraryHandle = !LibraryPath.IsEmpty() + ? FPlatformProcess::GetDllHandle(*LibraryPath) + : nullptr; - if (ExampleLibraryHandle) { + if (simulatorLibraryHandle) { // Call the test function in the third party library that opens a message // box // ExampleLibraryFunction(); - HsStablePtr wc = start_machine(); + // HsStablePtr wc = start_machine(); } else { FMessageDialog::Open( EAppMsgType::Ok, @@ -67,8 +63,8 @@ void Fhstherac25Module::ShutdownModule() { // unloading the module. // Free the dll handle - FPlatformProcess::FreeDllHandle(ExampleLibraryHandle); - ExampleLibraryHandle = nullptr; + FPlatformProcess::FreeDllHandle(simulatorLibraryHandle); + simulatorLibraryHandle = nullptr; } #undef LOCTEXT_NAMESPACE diff --git a/Source/MyProject/Public/TheracSimComponent.h b/Plugins/hstherac25/Source/hstherac25/Public/TheracAdapterComponent.h similarity index 74% rename from Source/MyProject/Public/TheracSimComponent.h rename to Plugins/hstherac25/Source/hstherac25/Public/TheracAdapterComponent.h index c39e7be..ee4e9a3 100644 --- a/Source/MyProject/Public/TheracSimComponent.h +++ b/Plugins/hstherac25/Source/hstherac25/Public/TheracAdapterComponent.h @@ -4,17 +4,21 @@ #include "CoreMinimal.h" #include "Components/ActorComponent.h" -#include "TheracSimComponent.generated.h" +#include +#include "TheracAdapterComponent.generated.h" + UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) -class MYPROJECT_API UTheracSimComponent : public UActorComponent +class HSTHERAC25_API UTheracAdapterComponent : public UActorComponent { GENERATED_BODY() + HsStablePtr wrappedComms; + public: // Sets default values for this component's properties - UTheracSimComponent(); + UTheracAdapterComponent(); protected: // Called when the game starts diff --git a/Plugins/hstherac25/Source/hstherac25/Public/hstherac25.h b/Plugins/hstherac25/Source/hstherac25/Public/hstherac25.h index 419008d..a7a5d44 100644 --- a/Plugins/hstherac25/Source/hstherac25/Public/hstherac25.h +++ b/Plugins/hstherac25/Source/hstherac25/Public/hstherac25.h @@ -4,15 +4,13 @@ #include "Modules/ModuleManager.h" -class Fhstherac25Module : public IModuleInterface -{ +class Fhstherac25Module : public IModuleInterface { public: - - /** IModuleInterface implementation */ - virtual void StartupModule() override; - virtual void ShutdownModule() override; + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; private: - /** Handle to the test dll we will load */ - void* ExampleLibraryHandle; + /** Handle to the test dll we will load */ + void * simulatorLibraryHandle; }; diff --git a/Plugins/hstherac25/Source/hstherac25/hstherac25.Build.cs b/Plugins/hstherac25/Source/hstherac25/hstherac25.Build.cs index 708e0e3..5141c18 100644 --- a/Plugins/hstherac25/Source/hstherac25/hstherac25.Build.cs +++ b/Plugins/hstherac25/Source/hstherac25/hstherac25.Build.cs @@ -1,7 +1,6 @@ // Copyright Epic Games, Inc. All Rights Reserved. using UnrealBuildTool; -using System; using System.IO; public class hstherac25 : ModuleRules @@ -36,7 +35,13 @@ public class hstherac25 : ModuleRules new string[] { "Core", - "Projects" + "MathCore", + "Projects", + "CoreUObject", + "Engine", + "UMG", + "AudioMixerCore", + "InputCore" // ... add other public dependencies that you statically link with here ... } ); @@ -45,6 +50,7 @@ public class hstherac25 : ModuleRules PrivateDependencyModuleNames.AddRange( new string[] { + "Slate", "SlateCore" // ... add private dependencies that you statically link with here ... } ); @@ -58,5 +64,6 @@ public class hstherac25 : ModuleRules } ); PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "../hstherac-hs", "HSdll.dll.a")); - } + RuntimeDependencies.Add(Path.Combine(PluginDirectory, "Source/hstherac-hs/HSdll.dll")); + } } diff --git a/Source/MyProject/Private/TheracAdapter.cpp b/Source/MyProject/Private/TheracAdapter.cpp deleted file mode 100644 index e69e668..0000000 --- a/Source/MyProject/Private/TheracAdapter.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#include "TheracAdapter.h" - -TheracAdapter::TheracAdapter() {} - -TheracAdapter::~TheracAdapter() {} diff --git a/Source/MyProject/Private/TheracSimComponent.cpp b/Source/MyProject/Private/TheracSimComponent.cpp deleted file mode 100644 index 69fa831..0000000 --- a/Source/MyProject/Private/TheracSimComponent.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - - -#include "TheracSimComponent.h" - -// Sets default values for this component's properties -UTheracSimComponent::UTheracSimComponent() -{ - // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features - // off to improve performance if you don't need them. - PrimaryComponentTick.bCanEverTick = true; - - // ... -} - - -// Called when the game starts -void UTheracSimComponent::BeginPlay() -{ - Super::BeginPlay(); - - // ... - -} - - -// Called every frame -void UTheracSimComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) -{ - Super::TickComponent(DeltaTime, TickType, ThisTickFunction); - - // ... -} - diff --git a/Source/MyProject/Public/TheracAdapter.h b/Source/MyProject/Public/TheracAdapter.h deleted file mode 100644 index 5544827..0000000 --- a/Source/MyProject/Public/TheracAdapter.h +++ /dev/null @@ -1,15 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once - -#include "CoreMinimal.h" - -/** - * - */ -class MYPROJECT_API TheracAdapter -{ -public: - TheracAdapter(); - ~TheracAdapter(); -};