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
5 changes: 5 additions & 0 deletions Drivers/ScanLabSMC/ACT/LibMCDriver_ScanLabSMC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ Custom implementation
<param name="JobDuration" type="double" pass="return" description="Duration in seconds." />
</method>

<method name="ExecuteLaserInitSequence" description="Starts the laser initialization sequence.">
</method>

<method name="ExecuteLaserShutdownSequence" description="Starts the laser shutdown sequence.">
</method>

</class>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,22 @@ typedef LibMCDriver_ScanLabSMCResult (*PLibMCDriver_ScanLabSMCSMCJob_GetJobChara
*/
typedef LibMCDriver_ScanLabSMCResult (*PLibMCDriver_ScanLabSMCSMCJob_GetJobDurationPtr) (LibMCDriver_ScanLabSMC_SMCJob pSMCJob, LibMCDriver_ScanLabSMC_double * pJobDuration);

/**
* Starts the laser initialization sequence.
*
* @param[in] pSMCJob - SMCJob instance.
* @return error code or 0 (success)
*/
typedef LibMCDriver_ScanLabSMCResult (*PLibMCDriver_ScanLabSMCSMCJob_ExecuteLaserInitSequencePtr) (LibMCDriver_ScanLabSMC_SMCJob pSMCJob);

/**
* Starts the laser shutdown sequence.
*
* @param[in] pSMCJob - SMCJob instance.
* @return error code or 0 (success)
*/
typedef LibMCDriver_ScanLabSMCResult (*PLibMCDriver_ScanLabSMCSMCJob_ExecuteLaserShutdownSequencePtr) (LibMCDriver_ScanLabSMC_SMCJob pSMCJob);

/*************************************************************************************************************************
Class definition for SMCConfiguration
**************************************************************************************************************************/
Expand Down Expand Up @@ -858,6 +874,8 @@ typedef struct {
PLibMCDriver_ScanLabSMCSMCJob_LoadSimulationDataPtr m_SMCJob_LoadSimulationData;
PLibMCDriver_ScanLabSMCSMCJob_GetJobCharacteristicPtr m_SMCJob_GetJobCharacteristic;
PLibMCDriver_ScanLabSMCSMCJob_GetJobDurationPtr m_SMCJob_GetJobDuration;
PLibMCDriver_ScanLabSMCSMCJob_ExecuteLaserInitSequencePtr m_SMCJob_ExecuteLaserInitSequence;
PLibMCDriver_ScanLabSMCSMCJob_ExecuteLaserShutdownSequencePtr m_SMCJob_ExecuteLaserShutdownSequence;
PLibMCDriver_ScanLabSMCSMCConfiguration_SetDynamicViolationReactionPtr m_SMCConfiguration_SetDynamicViolationReaction;
PLibMCDriver_ScanLabSMCSMCConfiguration_GetDynamicViolationReactionPtr m_SMCConfiguration_GetDynamicViolationReaction;
PLibMCDriver_ScanLabSMCSMCConfiguration_SetWarnLevelPtr m_SMCConfiguration_SetWarnLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ class CSMCJob : public CBase {
inline void LoadSimulationData(classParam<LibMCEnv::CDataTable> pSimulationDataTable);
inline LibMCDriver_ScanLabSMC_double GetJobCharacteristic(const eJobCharacteristic eValueType);
inline LibMCDriver_ScanLabSMC_double GetJobDuration();
inline void ExecuteLaserInitSequence();
inline void ExecuteLaserShutdownSequence();
};

/*************************************************************************************************************************
Expand Down Expand Up @@ -796,6 +798,8 @@ class CDriver_ScanLabSMC : public CDriver {
pWrapperTable->m_SMCJob_LoadSimulationData = nullptr;
pWrapperTable->m_SMCJob_GetJobCharacteristic = nullptr;
pWrapperTable->m_SMCJob_GetJobDuration = nullptr;
pWrapperTable->m_SMCJob_ExecuteLaserInitSequence = nullptr;
pWrapperTable->m_SMCJob_ExecuteLaserShutdownSequence = nullptr;
pWrapperTable->m_SMCConfiguration_SetDynamicViolationReaction = nullptr;
pWrapperTable->m_SMCConfiguration_GetDynamicViolationReaction = nullptr;
pWrapperTable->m_SMCConfiguration_SetWarnLevel = nullptr;
Expand Down Expand Up @@ -1091,6 +1095,24 @@ class CDriver_ScanLabSMC : public CDriver {
if (pWrapperTable->m_SMCJob_GetJobDuration == nullptr)
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_SMCJob_ExecuteLaserInitSequence = (PLibMCDriver_ScanLabSMCSMCJob_ExecuteLaserInitSequencePtr) GetProcAddress(hLibrary, "libmcdriver_scanlabsmc_smcjob_executelaserinitsequence");
#else // _WIN32
pWrapperTable->m_SMCJob_ExecuteLaserInitSequence = (PLibMCDriver_ScanLabSMCSMCJob_ExecuteLaserInitSequencePtr) dlsym(hLibrary, "libmcdriver_scanlabsmc_smcjob_executelaserinitsequence");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_SMCJob_ExecuteLaserInitSequence == nullptr)
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_SMCJob_ExecuteLaserShutdownSequence = (PLibMCDriver_ScanLabSMCSMCJob_ExecuteLaserShutdownSequencePtr) GetProcAddress(hLibrary, "libmcdriver_scanlabsmc_smcjob_executelasershutdownsequence");
#else // _WIN32
pWrapperTable->m_SMCJob_ExecuteLaserShutdownSequence = (PLibMCDriver_ScanLabSMCSMCJob_ExecuteLaserShutdownSequencePtr) dlsym(hLibrary, "libmcdriver_scanlabsmc_smcjob_executelasershutdownsequence");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_SMCJob_ExecuteLaserShutdownSequence == nullptr)
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_SMCConfiguration_SetDynamicViolationReaction = (PLibMCDriver_ScanLabSMCSMCConfiguration_SetDynamicViolationReactionPtr) GetProcAddress(hLibrary, "libmcdriver_scanlabsmc_smcconfiguration_setdynamicviolationreaction");
#else // _WIN32
Expand Down Expand Up @@ -1695,6 +1717,14 @@ class CDriver_ScanLabSMC : public CDriver {
if ( (eLookupError != 0) || (pWrapperTable->m_SMCJob_GetJobDuration == nullptr) )
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;

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

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

eLookupError = (*pLookup)("libmcdriver_scanlabsmc_smcconfiguration_setdynamicviolationreaction", (void**)&(pWrapperTable->m_SMCConfiguration_SetDynamicViolationReaction));
if ( (eLookupError != 0) || (pWrapperTable->m_SMCConfiguration_SetDynamicViolationReaction == nullptr) )
return LIBMCDRIVER_SCANLABSMC_ERROR_COULDNOTFINDLIBRARYEXPORT;
Expand Down Expand Up @@ -2180,6 +2210,22 @@ class CDriver_ScanLabSMC : public CDriver {
return resultJobDuration;
}

/**
* CSMCJob::ExecuteLaserInitSequence - Starts the laser initialization sequence.
*/
void CSMCJob::ExecuteLaserInitSequence()
{
CheckError(m_pWrapper->m_WrapperTable.m_SMCJob_ExecuteLaserInitSequence(m_pHandle));
}

/**
* CSMCJob::ExecuteLaserShutdownSequence - Starts the laser shutdown sequence.
*/
void CSMCJob::ExecuteLaserShutdownSequence()
{
CheckError(m_pWrapper->m_WrapperTable.m_SMCJob_ExecuteLaserShutdownSequence(m_pHandle));
}

/**
* Method definitions for class CSMCConfiguration
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ CScanLabSMCSDK::CScanLabSMCSDK(const std::string& sDLLNameUTF8, const std::strin
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");

this->slsc_ctrl_exec_init_laser_sequence = (PScanLabSMCPtr_slsc_ctrl_exec_init_laser_sequence)_loadScanLabSMCAddress(hLibrary, "slsc_ctrl_exec_init_laser_sequence");
this->slsc_ctrl_exec_shutdown_laser_sequence = (PScanLabSMCPtr_slsc_ctrl_exec_shutdown_laser_sequence)_loadScanLabSMCAddress(hLibrary, "slsc_ctrl_exec_shutdown_laser_sequence");

m_LibraryHandle = (void*) hLibrary;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ namespace LibMCDriver_ScanLabSMC {
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);

typedef slscReturnValue(SCANLABSMC_CALLINGCONVENTION* PScanLabSMCPtr_slsc_ctrl_exec_init_laser_sequence) (size_t Handle);
typedef slscReturnValue(SCANLABSMC_CALLINGCONVENTION* PScanLabSMCPtr_slsc_ctrl_exec_shutdown_laser_sequence) (size_t Handle);

class CScanLabSMCSDK_DLLDirectoryCache {
private:
#ifdef _WIN32
Expand Down Expand Up @@ -294,6 +297,8 @@ namespace LibMCDriver_ScanLabSMC {
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;
PScanLabSMCPtr_slsc_ctrl_exec_init_laser_sequence slsc_ctrl_exec_init_laser_sequence = nullptr;
PScanLabSMCPtr_slsc_ctrl_exec_shutdown_laser_sequence slsc_ctrl_exec_shutdown_laser_sequence = 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 @@ -141,3 +141,13 @@ LibMCDriver_ScanLabSMC_double CSMCJob::GetJobDuration()
{
return m_pJobInstance->GetJobDuration ();
}

void CSMCJob::ExecuteLaserInitSequence()
{
m_pJobInstance->ExecuteLaserInitSequence();
}

void CSMCJob::ExecuteLaserShutdownSequence()
{
m_pJobInstance->ExecuteLaserShutdownSequence();
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ class CSMCJob : public virtual ISMCJob, public virtual CBase {

LibMCDriver_ScanLabSMC_double GetJobDuration() override;

void ExecuteLaserInitSequence() override;

void ExecuteLaserShutdownSequence() override;

};

} // namespace Impl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,24 @@ double CSMCJobInstance::GetJobDuration()

}

void CSMCJobInstance::ExecuteLaserInitSequence()
{
auto contextHandle = m_pContextHandle->getHandle();

std::cout << "Executing laser init sequence" << std::endl;

m_pSDK->checkError(contextHandle, m_pSDK->slsc_ctrl_exec_init_laser_sequence(contextHandle));
}

void CSMCJobInstance::ExecuteLaserShutdownSequence()
{
auto contextHandle = m_pContextHandle->getHandle();

std::cout << "Executing laser shutdown sequence" << std::endl;

m_pSDK->checkError(contextHandle, m_pSDK->slsc_ctrl_exec_shutdown_laser_sequence(contextHandle));
}

void CSMCJobInstance::ReadSimulationFile(LibMCEnv::PDataTable pDataTable)
{
slsc_VersionInfo version = m_pSDK->slsc_cfg_get_scanmotioncontrol_version();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ class CSMCJobInstance {

double GetJobDuration();

void ExecuteLaserInitSequence();

void ExecuteLaserShutdownSequence();

private:

void ReadSimulationFile_SMC_v0_8(LibMCEnv::PDataTable pDataTable);
Expand Down
16 changes: 16 additions & 0 deletions Drivers/ScanLabSMC/Interfaces/libmcdriver_scanlabsmc_abi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,22 @@ LIBMCDRIVER_SCANLABSMC_DECLSPEC LibMCDriver_ScanLabSMCResult libmcdriver_scanlab
*/
LIBMCDRIVER_SCANLABSMC_DECLSPEC LibMCDriver_ScanLabSMCResult libmcdriver_scanlabsmc_smcjob_getjobduration(LibMCDriver_ScanLabSMC_SMCJob pSMCJob, LibMCDriver_ScanLabSMC_double * pJobDuration);

/**
* Starts the laser initialization sequence.
*
* @param[in] pSMCJob - SMCJob instance.
* @return error code or 0 (success)
*/
LIBMCDRIVER_SCANLABSMC_DECLSPEC LibMCDriver_ScanLabSMCResult libmcdriver_scanlabsmc_smcjob_executelaserinitsequence(LibMCDriver_ScanLabSMC_SMCJob pSMCJob);

/**
* Starts the laser shutdown sequence.
*
* @param[in] pSMCJob - SMCJob instance.
* @return error code or 0 (success)
*/
LIBMCDRIVER_SCANLABSMC_DECLSPEC LibMCDriver_ScanLabSMCResult libmcdriver_scanlabsmc_smcjob_executelasershutdownsequence(LibMCDriver_ScanLabSMC_SMCJob pSMCJob);

/*************************************************************************************************************************
Class definition for SMCConfiguration
**************************************************************************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,16 @@ class ISMCJob : public virtual IBase {
*/
virtual LibMCDriver_ScanLabSMC_double GetJobDuration() = 0;

/**
* ISMCJob::ExecuteLaserInitSequence - Starts the laser initialization sequence.
*/
virtual void ExecuteLaserInitSequence() = 0;

/**
* ISMCJob::ExecuteLaserShutdownSequence - Starts the laser shutdown sequence.
*/
virtual void ExecuteLaserShutdownSequence() = 0;

};

typedef IBaseSharedPtr<ISMCJob> PISMCJob;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,54 @@ LibMCDriver_ScanLabSMCResult libmcdriver_scanlabsmc_smcjob_getjobduration(LibMCD
}
}

LibMCDriver_ScanLabSMCResult libmcdriver_scanlabsmc_smcjob_executelaserinitsequence(LibMCDriver_ScanLabSMC_SMCJob pSMCJob)
{
IBase* pIBaseClass = (IBase *)pSMCJob;

try {
ISMCJob* pISMCJob = dynamic_cast<ISMCJob*>(pIBaseClass);
if (!pISMCJob)
throw ELibMCDriver_ScanLabSMCInterfaceException(LIBMCDRIVER_SCANLABSMC_ERROR_INVALIDCAST);

pISMCJob->ExecuteLaserInitSequence();

return LIBMCDRIVER_SCANLABSMC_SUCCESS;
}
catch (ELibMCDriver_ScanLabSMCInterfaceException & Exception) {
return handleLibMCDriver_ScanLabSMCException(pIBaseClass, Exception);
}
catch (std::exception & StdException) {
return handleStdException(pIBaseClass, StdException);
}
catch (...) {
return handleUnhandledException(pIBaseClass);
}
}

LibMCDriver_ScanLabSMCResult libmcdriver_scanlabsmc_smcjob_executelasershutdownsequence(LibMCDriver_ScanLabSMC_SMCJob pSMCJob)
{
IBase* pIBaseClass = (IBase *)pSMCJob;

try {
ISMCJob* pISMCJob = dynamic_cast<ISMCJob*>(pIBaseClass);
if (!pISMCJob)
throw ELibMCDriver_ScanLabSMCInterfaceException(LIBMCDRIVER_SCANLABSMC_ERROR_INVALIDCAST);

pISMCJob->ExecuteLaserShutdownSequence();

return LIBMCDRIVER_SCANLABSMC_SUCCESS;
}
catch (ELibMCDriver_ScanLabSMCInterfaceException & Exception) {
return handleLibMCDriver_ScanLabSMCException(pIBaseClass, Exception);
}
catch (std::exception & StdException) {
return handleStdException(pIBaseClass, StdException);
}
catch (...) {
return handleUnhandledException(pIBaseClass);
}
}


/*************************************************************************************************************************
Class implementation for SMCConfiguration
Expand Down Expand Up @@ -2201,6 +2249,10 @@ LibMCDriver_ScanLabSMCResult LibMCDriver_ScanLabSMC::Impl::LibMCDriver_ScanLabSM
*ppProcAddress = (void*) &libmcdriver_scanlabsmc_smcjob_getjobcharacteristic;
if (sProcName == "libmcdriver_scanlabsmc_smcjob_getjobduration")
*ppProcAddress = (void*) &libmcdriver_scanlabsmc_smcjob_getjobduration;
if (sProcName == "libmcdriver_scanlabsmc_smcjob_executelaserinitsequence")
*ppProcAddress = (void*) &libmcdriver_scanlabsmc_smcjob_executelaserinitsequence;
if (sProcName == "libmcdriver_scanlabsmc_smcjob_executelasershutdownsequence")
*ppProcAddress = (void*) &libmcdriver_scanlabsmc_smcjob_executelasershutdownsequence;
if (sProcName == "libmcdriver_scanlabsmc_smcconfiguration_setdynamicviolationreaction")
*ppProcAddress = (void*) &libmcdriver_scanlabsmc_smcconfiguration_setdynamicviolationreaction;
if (sProcName == "libmcdriver_scanlabsmc_smcconfiguration_getdynamicviolationreaction")
Expand Down