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
8 changes: 8 additions & 0 deletions Drivers/ScanLabSMC/ACT/LibMCDriver_ScanLabSMC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ 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
6 changes: 6 additions & 0 deletions Drivers/ScanLabSMC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ set (DRIVERPROJECT ScanLabSMC)

include (../CMakeDriverCommon.txt)

set_property(TARGET libmcdriver_scanlabsmc PROPERTY CXX_STANDARD 17)
set_property(TARGET libmcdriver_scanlabsmc PROPERTY CXX_STANDARD_REQUIRED ON)

get_target_property(_std libmcdriver_scanlabsmc CXX_STANDARD)
message(STATUS "libmcdriver_scanlabsmc uses C++ standard: ${_std}")

##########################################################################################
### Add custom code below
##########################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,24 @@ 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 @@ -856,6 +874,8 @@ 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 @@ -544,6 +544,8 @@ 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 @@ -786,6 +788,8 @@ 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 @@ -1065,6 +1069,24 @@ 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 @@ -1679,6 +1701,14 @@ 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 @@ -2147,6 +2177,26 @@ 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 @@ -166,6 +166,10 @@ CScanLabSMCSDK::CScanLabSMCSDK(const std::string& sDLLNameUTF8, const std::strin
this->slsc_cfg_get_blend_mode = (PScanLabSMCPtr_slsc_cfg_get_blend_mode)_loadScanLabSMCAddress(hLibrary, "slsc_cfg_get_blend_mode");
this->slsc_cfg_set_blend_mode = (PScanLabSMCPtr_slsc_cfg_set_blend_mode)_loadScanLabSMCAddress(hLibrary, "slsc_cfg_set_blend_mode");

this->slsc_job_start_record = (PScanLabSMCPtr_slsc_job_start_record)_loadScanLabSMCAddress(hLibrary, "slsc_job_start_record");
this->slsc_job_stop_record = (PScanLabSMCPtr_slsc_job_stop_record)_loadScanLabSMCAddress(hLibrary, "slsc_job_stop_record");
this->slsc_ctrl_log_record = (PScanLabSMCPtr_slsc_ctrl_log_record)_loadScanLabSMCAddress(hLibrary, "slsc_ctrl_log_record");

m_LibraryHandle = (void*) hLibrary;
}

Expand Down Expand Up @@ -281,7 +285,9 @@ void CScanLabSMCSDK::resetFunctionPtrs()
slsc_cfg_get_blend_mode = nullptr;
slsc_cfg_set_blend_mode = nullptr;


slsc_job_start_record = nullptr;
slsc_job_stop_record = nullptr;
slsc_ctrl_log_record = nullptr;
}


Expand Down
24 changes: 24 additions & 0 deletions Drivers/ScanLabSMC/Implementation/libmcdriver_scanlabsmc_sdk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,23 @@ namespace LibMCDriver_ScanLabSMC {

};

enum class slsc_RecordSet : uint8_t
{
slsc_RecordSet_HeadAPosition = 0,
slsc_RecordSet_HeadBPosition = 1,
slsc_RecordSet_LaserSwitches = 2,
slsc_RecordSet_SetPositions = 3,
slsc_RecordSet_ActPositions = 4,
slsc_RecordSet_Empty = 5,
};

enum class slsc_TransformationStep : uint8_t
{
slsc_TransformationStep_Workspace = 0,
slsc_TransformationStep_Aligned = 1,
slsc_TransformationStep_Corrected = 2,
slsc_TransformationStep_Rtc = 3,
};

typedef struct _slsc_PolylineOptions slsc_PolylineOptions;
typedef struct _slsc_VersionInfo slsc_VersionInfo;
Expand Down Expand Up @@ -215,6 +232,10 @@ namespace LibMCDriver_ScanLabSMC {
typedef slscReturnValue(SCANLABSMC_CALLINGCONVENTION* PScanLabSMCPtr_slsc_cfg_get_blend_mode) (size_t Handle, slsc_BlendModes* BlendMode);
typedef slscReturnValue(SCANLABSMC_CALLINGCONVENTION* PScanLabSMCPtr_slsc_cfg_set_blend_mode) (size_t Handle, slsc_BlendModes BlendMode);

typedef slscReturnValue(SCANLABSMC_CALLINGCONVENTION* PScanLabSMCPtr_slsc_job_start_record) (size_t Handle, slsc_RecordSet RecordSetA, slsc_RecordSet RecordSetB);
typedef slscReturnValue(SCANLABSMC_CALLINGCONVENTION* PScanLabSMCPtr_slsc_job_stop_record) (size_t Handle);
typedef slscReturnValue(SCANLABSMC_CALLINGCONVENTION* PScanLabSMCPtr_slsc_ctrl_log_record) (size_t Handle, const char* DatasetPath, slsc_TransformationStep Step);

class CScanLabSMCSDK_DLLDirectoryCache {
private:
#ifdef _WIN32
Expand Down Expand Up @@ -270,6 +291,9 @@ namespace LibMCDriver_ScanLabSMC {
PScanLabSMCPtr_slsc_job_para_disable slsc_job_para_disable = nullptr;
PScanLabSMCPtr_slsc_job_para_line slsc_job_para_line = nullptr;
PScanLabSMCPtr_slsc_job_multi_para_line slsc_job_multi_para_line = nullptr;
PScanLabSMCPtr_slsc_job_start_record slsc_job_start_record = nullptr;
PScanLabSMCPtr_slsc_job_stop_record slsc_job_stop_record = nullptr;
PScanLabSMCPtr_slsc_ctrl_log_record slsc_ctrl_log_record = nullptr;

CScanLabSMCSDK(const std::string & sDLLNameUTF8, const std::string& sDLLDirectoryUTF8);
~CScanLabSMCSDK();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ void CSMCConfiguration::SetFirmwareResources(const std::string& sFirmwareDataRes
if (sFirmwareDataResource.empty())
throw ELibMCDriver_ScanLabSMCInterfaceException(LIBMCDRIVER_SCANLABSMC_ERROR_EMPTYRTCFIRMWARERESOURCENAME);

m_sFirmwareDataResource = sFirmwareDataResource;

if (m_pDriverEnvironment->MachineHasResourceData(sFirmwareDataResource)) {
m_pDriverEnvironment->RetrieveMachineResourceData(sFirmwareDataResource, m_FirmwareData);
}
Expand Down Expand Up @@ -316,7 +318,7 @@ std::string CSMCConfiguration::buildConfigurationXML(LibMCEnv::CWorkingDirectory
newCorrectionFile = pWorkingDirectory->StoreCustomDataInTempFile("ct5", m_CorrectionFileData);

pWorkingDirectory->StoreCustomData("RTC6RBF.rbf", m_FPGAData);
pWorkingDirectory->StoreCustomData("RTC6ETH.out", m_FirmwareData);
pWorkingDirectory->StoreCustomData(m_sFirmwareDataResource + ".out", m_FirmwareData);
pWorkingDirectory->StoreCustomData("RTC6DAT.dat", m_AuxiliaryData);

std::string sBaseDirectoryPath = pWorkingDirectory->GetAbsoluteFilePath();
Expand Down Expand Up @@ -389,6 +391,7 @@ std::string CSMCConfiguration::buildConfigurationXML(LibMCEnv::CWorkingDirectory
nodesToCopyFromTemplate.push_back("KinematicsList");
nodesToCopyFromTemplate.push_back("LaserConfig");
nodesToCopyFromTemplate.push_back("IOConfig");
nodesToCopyFromTemplate.push_back("SystemConfig");

break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ class CSMCConfiguration : public virtual ISMCConfiguration, public virtual CBase

uint32_t m_nSerialNumber;
std::vector<uint8_t> m_CorrectionFileData;

std::string m_sFirmwareDataResource;
std::vector<uint8_t> m_FirmwareData;

std::vector<uint8_t> m_FPGAData;
std::vector<uint8_t> m_AuxiliaryData;
std::string m_sIPAddress;
Expand Down
Loading