Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Drivers/ScanLabSMC/ACT/LibMCDriver_ScanLabSMC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@
<error name="INTERPOLATIONDATAISNOTINCREASING" code="1048" description="Interpolation data is not increasing." />
<error name="EMPTYRTCSERVICEDLLRESOURCENAME" code="1049" description="Empty RTC Service DLL Resource Name." />
<error name="RTCSERVICERESOURCENOTFOUND" code="1050" description="RTC Service Resource not found." />
<error name="EMPTYRTCSERVICEDLLRESOURCEDATA" code="1051" description="Empty RTC Service DLL Resource Data." />

<error name="EMPTYRTCSERVICEDLLRESOURCEDATA" code="1051" description="Empty RTC Service DLL Resource Data." />
<error name="SIMULATIONDATALOADINGISNOTSUPPORTED" code="1052" description="Simulation data loading is not supported for this version." />
<error name="COULDNOTREADSIMULATIONFILE" code="1053" description="Could not read simulation file." />
<error name="CSVPARSERUNKNOWNFIELDPARSERTYPE" code="1054" description="Unknown Field Parser Type." />
<error name="CSVPARSERINTERPOLATEINDEXOUTOFRANGE" code="1055" description="Index out of range in Interpolate." />
</errors>

<struct name="Point2D">
Expand Down Expand Up @@ -326,14 +329,6 @@ Custom implementation
<method name="LoadSimulationData" description="Reads the SMC Simulation data into a data table.">
<param name="SimulationDataTable" type="class" class="LibMCEnv:DataTable" pass="in" description="Data table object to read the simulation into." />
</method>

<method name="LoadSimulationData_SMC_v1" description="Reads the SMC Simulation data into a data table.">
<param name="SimulationDataTable" type="class" class="LibMCEnv:DataTable" pass="in" description="Data table object to read the simulation into." />
</method>

<method name="LoadLogRecordData" description="Reads the SMC Log Record data into a data table.">
<param name="LogRecordDataTable" type="class" class="LibMCEnv:DataTable" pass="in" description="Data table object to read the simulation into." />
</method>

<method name="GetJobCharacteristic" description="Returns a characteristic value of a job.">
<param name="ValueType" type="enum" class="JobCharacteristic" pass="in" description="Type of job" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,24 +252,6 @@ typedef LibMCDriver_ScanLabSMCResult (*PLibMCDriver_ScanLabSMCSMCJob_StopExecuti
*/
typedef LibMCDriver_ScanLabSMCResult (*PLibMCDriver_ScanLabSMCSMCJob_LoadSimulationDataPtr) (LibMCDriver_ScanLabSMC_SMCJob pSMCJob, LibMCEnv_DataTable pSimulationDataTable);

/**
* Reads the SMC Simulation data into a data table.
*
* @param[in] pSMCJob - SMCJob instance.
* @param[in] pSimulationDataTable - Data table object to read the simulation into.
* @return error code or 0 (success)
*/
typedef LibMCDriver_ScanLabSMCResult (*PLibMCDriver_ScanLabSMCSMCJob_LoadSimulationData_SMC_v1Ptr) (LibMCDriver_ScanLabSMC_SMCJob pSMCJob, LibMCEnv_DataTable pSimulationDataTable);

/**
* Reads the SMC Log Record data into a data table.
*
* @param[in] pSMCJob - SMCJob instance.
* @param[in] pLogRecordDataTable - Data table object to read the simulation into.
* @return error code or 0 (success)
*/
typedef LibMCDriver_ScanLabSMCResult (*PLibMCDriver_ScanLabSMCSMCJob_LoadLogRecordDataPtr) (LibMCDriver_ScanLabSMC_SMCJob pSMCJob, LibMCEnv_DataTable pLogRecordDataTable);

/**
* Returns a characteristic value of a job.
*
Expand Down Expand Up @@ -874,8 +856,6 @@ typedef struct {
PLibMCDriver_ScanLabSMCSMCJob_WaitForExecutionPtr m_SMCJob_WaitForExecution;
PLibMCDriver_ScanLabSMCSMCJob_StopExecutionPtr m_SMCJob_StopExecution;
PLibMCDriver_ScanLabSMCSMCJob_LoadSimulationDataPtr m_SMCJob_LoadSimulationData;
PLibMCDriver_ScanLabSMCSMCJob_LoadSimulationData_SMC_v1Ptr m_SMCJob_LoadSimulationData_SMC_v1;
PLibMCDriver_ScanLabSMCSMCJob_LoadLogRecordDataPtr m_SMCJob_LoadLogRecordData;
PLibMCDriver_ScanLabSMCSMCJob_GetJobCharacteristicPtr m_SMCJob_GetJobCharacteristic;
PLibMCDriver_ScanLabSMCSMCJob_GetJobDurationPtr m_SMCJob_GetJobDuration;
PLibMCDriver_ScanLabSMCSMCConfiguration_SetDynamicViolationReactionPtr m_SMCConfiguration_SetDynamicViolationReaction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ class ELibMCDriver_ScanLabSMCException : public std::exception {
case LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCSERVICEDLLRESOURCENAME: return "EMPTYRTCSERVICEDLLRESOURCENAME";
case LIBMCDRIVER_SCANLABSMC_ERROR_RTCSERVICERESOURCENOTFOUND: return "RTCSERVICERESOURCENOTFOUND";
case LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCSERVICEDLLRESOURCEDATA: return "EMPTYRTCSERVICEDLLRESOURCEDATA";
case LIBMCDRIVER_SCANLABSMC_ERROR_SIMULATIONDATALOADINGISNOTSUPPORTED: return "SIMULATIONDATALOADINGISNOTSUPPORTED";
case LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTREADSIMULATIONFILE: return "COULDNOTREADSIMULATIONFILE";
case LIBMCDRIVER_SCANLABSMC_ERROR_CSVPARSERUNKNOWNFIELDPARSERTYPE: return "CSVPARSERUNKNOWNFIELDPARSERTYPE";
case LIBMCDRIVER_SCANLABSMC_ERROR_CSVPARSERINTERPOLATEINDEXOUTOFRANGE: return "CSVPARSERINTERPOLATEINDEXOUTOFRANGE";
}
return "UNKNOWN";
}
Expand Down Expand Up @@ -308,6 +312,10 @@ class ELibMCDriver_ScanLabSMCException : public std::exception {
case LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCSERVICEDLLRESOURCENAME: return "Empty RTC Service DLL Resource Name.";
case LIBMCDRIVER_SCANLABSMC_ERROR_RTCSERVICERESOURCENOTFOUND: return "RTC Service Resource not found.";
case LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCSERVICEDLLRESOURCEDATA: return "Empty RTC Service DLL Resource Data.";
case LIBMCDRIVER_SCANLABSMC_ERROR_SIMULATIONDATALOADINGISNOTSUPPORTED: return "Simulation data loading is not supported for this version.";
case LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTREADSIMULATIONFILE: return "Could not read simulation file.";
case LIBMCDRIVER_SCANLABSMC_ERROR_CSVPARSERUNKNOWNFIELDPARSERTYPE: return "Unknown Field Parser Type.";
case LIBMCDRIVER_SCANLABSMC_ERROR_CSVPARSERINTERPOLATEINDEXOUTOFRANGE: return "Index out of range in Interpolate.";
}
return "unknown error";
}
Expand Down Expand Up @@ -544,8 +552,6 @@ class CSMCJob : public CBase {
inline void WaitForExecution(const LibMCDriver_ScanLabSMC_uint32 nTimeOutInMilliseconds);
inline void StopExecution();
inline void LoadSimulationData(classParam<LibMCEnv::CDataTable> pSimulationDataTable);
inline void LoadSimulationData_SMC_v1(classParam<LibMCEnv::CDataTable> pSimulationDataTable);
inline void LoadLogRecordData(classParam<LibMCEnv::CDataTable> pLogRecordDataTable);
inline LibMCDriver_ScanLabSMC_double GetJobCharacteristic(const eJobCharacteristic eValueType);
inline LibMCDriver_ScanLabSMC_double GetJobDuration();
};
Expand Down Expand Up @@ -788,8 +794,6 @@ class CDriver_ScanLabSMC : public CDriver {
pWrapperTable->m_SMCJob_WaitForExecution = nullptr;
pWrapperTable->m_SMCJob_StopExecution = nullptr;
pWrapperTable->m_SMCJob_LoadSimulationData = nullptr;
pWrapperTable->m_SMCJob_LoadSimulationData_SMC_v1 = nullptr;
pWrapperTable->m_SMCJob_LoadLogRecordData = nullptr;
pWrapperTable->m_SMCJob_GetJobCharacteristic = nullptr;
pWrapperTable->m_SMCJob_GetJobDuration = nullptr;
pWrapperTable->m_SMCConfiguration_SetDynamicViolationReaction = nullptr;
Expand Down Expand Up @@ -1069,24 +1073,6 @@ class CDriver_ScanLabSMC : public CDriver {
if (pWrapperTable->m_SMCJob_LoadSimulationData == nullptr)
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_SMCJob_LoadSimulationData_SMC_v1 = (PLibMCDriver_ScanLabSMCSMCJob_LoadSimulationData_SMC_v1Ptr) GetProcAddress(hLibrary, "libmcdriver_scanlabsmc_smcjob_loadsimulationdata_smc_v1");
#else // _WIN32
pWrapperTable->m_SMCJob_LoadSimulationData_SMC_v1 = (PLibMCDriver_ScanLabSMCSMCJob_LoadSimulationData_SMC_v1Ptr) dlsym(hLibrary, "libmcdriver_scanlabsmc_smcjob_loadsimulationdata_smc_v1");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_SMCJob_LoadSimulationData_SMC_v1 == nullptr)
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_SMCJob_LoadLogRecordData = (PLibMCDriver_ScanLabSMCSMCJob_LoadLogRecordDataPtr) GetProcAddress(hLibrary, "libmcdriver_scanlabsmc_smcjob_loadlogrecorddata");
#else // _WIN32
pWrapperTable->m_SMCJob_LoadLogRecordData = (PLibMCDriver_ScanLabSMCSMCJob_LoadLogRecordDataPtr) dlsym(hLibrary, "libmcdriver_scanlabsmc_smcjob_loadlogrecorddata");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_SMCJob_LoadLogRecordData == nullptr)
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_SMCJob_GetJobCharacteristic = (PLibMCDriver_ScanLabSMCSMCJob_GetJobCharacteristicPtr) GetProcAddress(hLibrary, "libmcdriver_scanlabsmc_smcjob_getjobcharacteristic");
#else // _WIN32
Expand Down Expand Up @@ -1701,14 +1687,6 @@ class CDriver_ScanLabSMC : public CDriver {
if ( (eLookupError != 0) || (pWrapperTable->m_SMCJob_LoadSimulationData == nullptr) )
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

eLookupError = (*pLookup)("libmcdriver_scanlabsmc_smcjob_loadsimulationdata_smc_v1", (void**)&(pWrapperTable->m_SMCJob_LoadSimulationData_SMC_v1));
if ( (eLookupError != 0) || (pWrapperTable->m_SMCJob_LoadSimulationData_SMC_v1 == nullptr) )
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

eLookupError = (*pLookup)("libmcdriver_scanlabsmc_smcjob_loadlogrecorddata", (void**)&(pWrapperTable->m_SMCJob_LoadLogRecordData));
if ( (eLookupError != 0) || (pWrapperTable->m_SMCJob_LoadLogRecordData == nullptr) )
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

eLookupError = (*pLookup)("libmcdriver_scanlabsmc_smcjob_getjobcharacteristic", (void**)&(pWrapperTable->m_SMCJob_GetJobCharacteristic));
if ( (eLookupError != 0) || (pWrapperTable->m_SMCJob_GetJobCharacteristic == nullptr) )
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;
Expand Down Expand Up @@ -2177,26 +2155,6 @@ class CDriver_ScanLabSMC : public CDriver {
CheckError(m_pWrapper->m_WrapperTable.m_SMCJob_LoadSimulationData(m_pHandle, hSimulationDataTable));
}

/**
* CSMCJob::LoadSimulationData_SMC_v1 - Reads the SMC Simulation data into a data table.
* @param[in] pSimulationDataTable - Data table object to read the simulation into.
*/
void CSMCJob::LoadSimulationData_SMC_v1(classParam<LibMCEnv::CDataTable> pSimulationDataTable)
{
LibMCEnvHandle hSimulationDataTable = pSimulationDataTable.GetHandle();
CheckError(m_pWrapper->m_WrapperTable.m_SMCJob_LoadSimulationData_SMC_v1(m_pHandle, hSimulationDataTable));
}

/**
* CSMCJob::LoadLogRecordData - Reads the SMC Log Record data into a data table.
* @param[in] pLogRecordDataTable - Data table object to read the simulation into.
*/
void CSMCJob::LoadLogRecordData(classParam<LibMCEnv::CDataTable> pLogRecordDataTable)
{
LibMCEnvHandle hLogRecordDataTable = pLogRecordDataTable.GetHandle();
CheckError(m_pWrapper->m_WrapperTable.m_SMCJob_LoadLogRecordData(m_pHandle, hLogRecordDataTable));
}

/**
* CSMCJob::GetJobCharacteristic - Returns a characteristic value of a job.
* @param[in] eValueType - Type of job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ typedef void * LibMCDriver_ScanLabSMC_pvoid;
#define LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCSERVICEDLLRESOURCENAME 1049 /** Empty RTC Service DLL Resource Name. */
#define LIBMCDRIVER_SCANLABSMC_ERROR_RTCSERVICERESOURCENOTFOUND 1050 /** RTC Service Resource not found. */
#define LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCSERVICEDLLRESOURCEDATA 1051 /** Empty RTC Service DLL Resource Data. */
#define LIBMCDRIVER_SCANLABSMC_ERROR_SIMULATIONDATALOADINGISNOTSUPPORTED 1052 /** Simulation data loading is not supported for this version. */
#define LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTREADSIMULATIONFILE 1053 /** Could not read simulation file. */
#define LIBMCDRIVER_SCANLABSMC_ERROR_CSVPARSERUNKNOWNFIELDPARSERTYPE 1054 /** Unknown Field Parser Type. */
#define LIBMCDRIVER_SCANLABSMC_ERROR_CSVPARSERINTERPOLATEINDEXOUTOFRANGE 1055 /** Index out of range in Interpolate. */

/*************************************************************************************************************************
Error strings for LibMCDriver_ScanLabSMC
Expand Down Expand Up @@ -226,6 +230,10 @@ inline const char * LIBMCDRIVER_SCANLABSMC_GETERRORSTRING (LibMCDriver_ScanLabSM
case LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCSERVICEDLLRESOURCENAME: return "Empty RTC Service DLL Resource Name.";
case LIBMCDRIVER_SCANLABSMC_ERROR_RTCSERVICERESOURCENOTFOUND: return "RTC Service Resource not found.";
case LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCSERVICEDLLRESOURCEDATA: return "Empty RTC Service DLL Resource Data.";
case LIBMCDRIVER_SCANLABSMC_ERROR_SIMULATIONDATALOADINGISNOTSUPPORTED: return "Simulation data loading is not supported for this version.";
case LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTREADSIMULATIONFILE: return "Could not read simulation file.";
case LIBMCDRIVER_SCANLABSMC_ERROR_CSVPARSERUNKNOWNFIELDPARSERTYPE: return "Unknown Field Parser Type.";
case LIBMCDRIVER_SCANLABSMC_ERROR_CSVPARSERINTERPOLATEINDEXOUTOFRANGE: return "Index out of range in Interpolate.";
default: return "unknown error";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ CSMCContextInstance::CSMCContextInstance(const std::string& sContextName, ISMCCo
: m_pSDK (pSDK),
m_pDriverEnvironment (pDriverEnvironment),
m_sContextName (sContextName),
m_nSerialNumber (0)

m_nSerialNumber (0),
m_bSendToHardware (false)
{
if (pSDK.get() == nullptr)
throw ELibMCDriver_ScanLabSMCInterfaceException(LIBMCDRIVER_SCANLABSMC_ERROR_INVALIDPARAM);
Expand All @@ -115,6 +115,8 @@ CSMCContextInstance::CSMCContextInstance(const std::string& sContextName, ISMCCo

m_sIPAddress = pSMCConfiguration->GetIPAddress();

m_bSendToHardware = pSMCConfiguration->GetSendToHardware();

auto pCorrectionFile = m_pWorkingDirectory->StoreCustomStringInTempFile("ct5", "");

eSMCConfigVersion configVersion = eSMCConfigVersion::Unknown;
Expand Down Expand Up @@ -220,7 +222,7 @@ std::string CSMCContextInstance::GetSimulationSubDirectory()

PSMCJobInstance CSMCContextInstance::BeginJob(const double dStartPositionX, const double dStartPositionY)
{
return std::make_shared<CSMCJobInstance> (m_pContextHandle, dStartPositionX, dStartPositionY, m_pWorkingDirectory, m_sSimulationSubDirectory);
return std::make_shared<CSMCJobInstance> (m_pContextHandle, dStartPositionX, dStartPositionY, m_pWorkingDirectory, m_sSimulationSubDirectory, m_bSendToHardware);
}

PSMCJobInstance CSMCContextInstance::GetUnfinishedJob()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class CSMCContextInstance {

uint32_t m_nSerialNumber;

bool m_bSendToHardware;

public:

CSMCContextInstance(const std::string & sContextName, ISMCConfiguration* pSMCConfiguration, PScanLabSMCSDK pSDK, LibMCEnv::PDriverEnvironment pDriverEnvironment, const std::string & sRTCDLLDirectory);
Expand Down
Loading