Skip to content

Commit

Permalink
Merge pull request #2 from Fluigent/v1.2.1
Browse files Browse the repository at this point in the history
C++ example v1.2.1: new dll and headers. Fix Release build setup.
  • Loading branch information
mtrellet authored Sep 28, 2023
2 parents 738dd2b + a7acddd commit 215c15a
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 27 deletions.
2 changes: 1 addition & 1 deletion cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
This is a console application written in C++ 14, demonstrating the basic usage of the Fluigent Aria SDK.

## Instructions
- Make sure there is a `dll/` folder containing the SDK DLLs (`win/[x86|x64]/[*.dll|*.lib]`) and headers (`Headers/*.h`) in the root folder of the example
- Make sure there is a `dll/` folder containing the SDK DLLs (`dll/win/[x86|x64]/[*.dll|*.lib]`) and headers (`dll/Headers/*.h`) in the root folder of the example
- Open the `aria_sdk_example_cpp.sln` solution file with Visual Studio
- Build and run the `aria_sdk_example_cpp` project
16 changes: 8 additions & 8 deletions cpp/aria_sdk_example_cpp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,18 @@ copy "$(ProjectDir)\dll\win\x86\aria_sdk_clr.dll" "$(OutDir)aria_sdk_clr.dll"</C
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\Headers\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\dll\Headers\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(CoreLibraryDependencies);%(AdditionalDependencies);$(MSBuildProjectDirectory)\aria_sdk_clr.lib;</AdditionalDependencies>
<AdditionalDependencies>$(CoreLibraryDependencies);%(AdditionalDependencies);$(MSBuildProjectDirectory)\dll\win\x86\aria_sdk_clr.lib</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy $(ProjectDir)aria_sdk.dll $(OutDir)aria_sdk.dll
copy $(ProjectDir)aria_sdk_clr.dll $(OutDir)aria_sdk_clr.dll</Command>
<Command>copy "$(ProjectDir)\dll\win\x86\aria_sdk.dll" "$(OutDir)aria_sdk.dll"
copy "$(ProjectDir)\dll\win\x86\aria_sdk_clr.dll" "$(OutDir)aria_sdk_clr.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down Expand Up @@ -136,18 +136,18 @@ copy "$(ProjectDir)\dll\win\x64\aria_sdk_clr.dll" "$(OutDir)aria_sdk_clr.dll"</C
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\Headers\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\dll\Headers\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(CoreLibraryDependencies);%(AdditionalDependencies);$(MSBuildProjectDirectory)\aria_sdk_clr.lib;</AdditionalDependencies>
<AdditionalDependencies>$(CoreLibraryDependencies);%(AdditionalDependencies);$(MSBuildProjectDirectory)\dll\win\x64\aria_sdk_clr.lib</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy $(ProjectDir)aria_sdk.dll $(OutDir)aria_sdk.dll
copy $(ProjectDir)aria_sdk_clr.dll $(OutDir)aria_sdk_clr.dll</Command>
<Command>copy "$(ProjectDir)\dll\win\x64\aria_sdk.dll" "$(OutDir)aria_sdk.dll"
copy "$(ProjectDir)\dll\win\x64\aria_sdk_clr.dll" "$(OutDir)aria_sdk_clr.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions cpp/dll/Headers/AriaIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ namespace AriaSDK
static int GetTTLPulseDuration(int &error);

// Send a TCP Text Message
static void SendTCPMessage(std::string message, int &error);
static void SendTCPMessage(char* message, int &error);
// Start waiting for a TCP Message with the content [awaitedMessage]
static void StartAwaitingTCPMessage(std::string awaitedMessage, int &error);
static void StartAwaitingTCPMessage(char* awaitedMessage, int &error);
// Checks if a TCP message with the content [awaitedMessage] was received
// If it was, stops the process waiting for this message
static bool CheckTCPMessage(std::string awaitedMessage, int &error);
static bool CheckTCPMessage(char* awaitedMessage, int &error);
// Stop waiting for a TCP message with the content [awaitedMessage]
static void StopAwaitingTCPMessage(std::string awaitedMessage, int &error);
static void StopAwaitingTCPMessage(char* awaitedMessage, int &error);

// Set TCP Mode : Servor or Client
static void SetTCPMode(bool enableServer, int &error);
Expand Down
15 changes: 14 additions & 1 deletion cpp/dll/Headers/AriaSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,17 @@
// Step configuration
#include "Step.h"
// Sequence execution monitoring and control
#include "Monitoring.h"
#include "Monitoring.h"

namespace AriaSDK
{

class _declspec(dllexport) Helper
{
public:
// Deallocate a string returned by an Aria SDK function.
static void Free(char* arrayToFree);
// Deallocate a float array returned by an Aria SDK function.
static void Free(float* arrayToFree);
};
}
4 changes: 2 additions & 2 deletions cpp/dll/Headers/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace AriaSDK
{
public:
// Returns the DateTime format used in Aria SDK functions.
static std::string GetDateTimeFormat();
static char* GetDateTimeFormat();

// Define the Prefill and Preload Flow Rate from the given [flowRatePreset].
static void SetPrefillAndPreloadFlowRate(FlowRatePreset flowRatePreset, int &error);
Expand All @@ -25,7 +25,7 @@ namespace AriaSDK
// Returns [step1] and [step2] Calibration values by reference.
static void GetCalibrationValues(float &step1, float &step2, int &error);
// Returns a vector containing the Step 3 Calibration values for all Chip Ports.
static std::vector<float> GetStep3CalibrationValues(int &error);
static float* GetStep3CalibrationValues(int& calibrationValuesCount, int &error);
// Returns the maximum number of calibration values in the Calibration Step 3 table.
static int GetMaxStep3CalibrationValueCount();
};
Expand Down
4 changes: 2 additions & 2 deletions cpp/dll/Headers/Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace AriaSDK
{
public:
// Returns the Message of the Error with identifier: [errorID]
static std::string GetErrorMessage(int errorID);
static char* GetErrorMessage(int errorID);
// Returns the Severity of the Error with identifier: [errorID]
static ErrorSeverity GetErrorSeverity(int errorID);
// Returns timestamp at which the error [errorID] occured.
static std::string GetErrorTimestamp(int errorID);
static char* GetErrorTimestamp(int errorID);
// Deletes all previous Error records.
// Next Error ID will be [0]
static void ResetErrors();
Expand Down
10 changes: 5 additions & 5 deletions cpp/dll/Headers/Sequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace AriaSDK
static void StartSequence(int &error);

// Returns the Sequence saved as a JSON string.
static std::string GenerateSequenceJSON(int &error);
static char* GenerateSequenceJSON(int &error);
// Load Sequence from the file at [filePath]
static void LoadSequence(std::string filePath, int &error);
static void LoadSequence(char* filePath, int &error);
// Load Sequence from a JSON String.
static void LoadSequenceFromJSON(std::string jsonString, int &error);
static void LoadSequenceFromJSON(char* jsonString, int &error);

// Returns the reservoir used to store the buffer solution.
static int GetBufferReservoir(int &error);
Expand Down Expand Up @@ -45,10 +45,10 @@ namespace AriaSDK
// Returns True if Start ASAP is enabled, false otherwise.
static bool IsSequenceStartingASAP(int &error);
// Define the time at which the Sequence will be executed if Start ASAP is disabled.
static void SetSequenceStartTime(std::string dateTime, int &error);
static void SetSequenceStartTime(char* dateTime, int &error);

// Returns the estimated start time of the first Step of the Sequence.
static std::string GetSequenceStartTime(int &error);
static char* GetSequenceStartTime(int &error);
// Returns the estimated total duration of the Sequence.
static int GetTotalDuration(int &error);
};
Expand Down
4 changes: 2 additions & 2 deletions cpp/dll/Headers/Step.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace AriaSDK
// Set the Parameter for the step at [index] with the given [value:float].
static void SetParameter(int index, StepParameter parameterType, float value, int &error);
// Set the Parameter for the step at [index] with the given [value:string].
static void SetParameter(int index, StepParameter parameterType, std::string value, int &error);
static void SetParameter(int index, StepParameter parameterType, char* value, int &error);
// Set the Parameter for the step at [index] with the given [value:SignalType].
static void SetParameter(int index, StepParameter parameterType, SignalType value, int &error);

Expand All @@ -33,7 +33,7 @@ namespace AriaSDK
// Returns the Parameter value (float) according to the [parameterType] for the step at [index]
static float GetFloatParameter(int index, StepParameter parameterType, int &error);
// Returns the Parameter value (string) according to the [parameterType] for the step at [index]
static std::string GetStringParameter(int index, StepParameter parameterType, int &error);
static char* GetStringParameter(int index, StepParameter parameterType, int &error);
// Returns the Parameter value (SignalType) according to the [parameterType] for the step at [index]
static SignalType GetSignalTypeParameter(int index, StepParameter parameterType, int &error);
};
Expand Down
2 changes: 1 addition & 1 deletion cpp/dll/Headers/StepList.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace AriaSDK
// Insert a Flush Step at [index]
static void InsertFlushStep(int index, int inputReservoir, float flowRate, bool preSignal, SignalType preSignalType, bool postSignal, SignalType postSignalType, int &error);
// Insert a Send Signal Step at [index]
static void InsertSendSignalStep(int index, std::string message, bool preSignal, SignalType preSignalType, bool postSignal, SignalType postSignalType, int &error);
static void InsertSendSignalStep(int index, char* message, bool preSignal, SignalType preSignalType, bool postSignal, SignalType postSignalType, int &error);
// Insert a Time Injection Step at [index]
static void InsertTimedInjectionStep(int index, int inputReservoir, int destination, float flowRate, int duration_s, bool preSignal, SignalType preSignalType, bool postSignal, SignalType postSignalType, int &error);
// Insert a Volume Injection Step at [index]
Expand Down
Binary file modified cpp/dll/win/x64/aria_sdk_clr.dll
Binary file not shown.
Binary file modified cpp/dll/win/x64/aria_sdk_clr.lib
Binary file not shown.
Binary file modified cpp/dll/win/x86/aria_sdk_clr.dll
Binary file not shown.
Binary file modified cpp/dll/win/x86/aria_sdk_clr.lib
Binary file not shown.
4 changes: 3 additions & 1 deletion cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void DisplayError(int errorID)
}
std::cout << "Error ID:" << errorID << "\n";
AriaSDK::ErrorSeverity severity = AriaSDK::Error::GetErrorSeverity(errorID);
std::string errorMessage = AriaSDK::Error::GetErrorMessage(errorID);
char* errorMessage = AriaSDK::Error::GetErrorMessage(errorID);
switch (severity)
{
case AriaSDK::Warning:
Expand All @@ -26,6 +26,7 @@ void DisplayError(int errorID)
std::cout << "[None] " << errorMessage << "\n";
break;
}
AriaSDK::Helper::Free(errorMessage);
}

void GenerateAndStartSequence()
Expand All @@ -38,6 +39,7 @@ void GenerateAndStartSequence()
}
else
{
DisplayError(errorID);
std::cout << "No Instrument Detected\n";
}
std::cout << "------------\n";
Expand Down

0 comments on commit 215c15a

Please sign in to comment.