Skip to content

Commit e591fef

Browse files
authored
Build api enhancements (#66)
* Add GetCreatedTimestamp and GetLastExecutionTimestamp to Build interface * Feature: Add GetRecentBuildJobs() API to UIEnvironment Add new API method to retrieve recent validated build jobs for touchscreen UI display. Changes: 1. **IDL Definition** (ACT/LibMCEnv.xml): - Added BuildIterator class following BuildExecutionIterator pattern - Added GetRecentBuildJobs(maxCount) method to UIEnvironment 2. **BuildIterator Implementation**: - New class CBuildIterator (libmcenv_builditerator.hpp/cpp) - Implements GetCurrentBuild() to return IBuild instances - Follows standard AMCF iterator pattern 3. **UIEnvironment Implementation** (libmcenv_uienvironment.cpp): - GetRecentBuildJobs() queries validated build jobs via DataModel - Returns BuildIterator with most recent jobs (newest first) - Limited by maxCount parameter 4. **CBuild Factory Methods** (libmcenv_build.cpp/hpp): - Added makeFrom() and makeSharedFrom() static methods - Enables BuildIterator to wrap existing build job instances This API enables plugins to access build job data for UI display without direct DataModel access, maintaining proper abstraction. --- InterfacesCode: Regenerate interface files from ACT for GetRecentBuildJobs API Regenerated C++ interface bindings and headers using ACT (Automatic Component Toolkit) after adding GetRecentBuildJobs() method to LibMCEnv.xml. Generated/Updated files: - Framework/HeadersDev/CppDynamic/libmcenv_dynamic.hpp - Framework/HeadersDev/CppDynamic/libmcenv_dynamic.h - Framework/HeadersDev/CppDynamic/libmcenv_types.hpp - Framework/InterfacesCore/libmcenv_abi.hpp - Framework/InterfacesCore/libmcenv_interfaces.hpp - Framework/InterfacesCore/libmcenv_interfacewrapper.cpp - Framework/InterfacesCore/libmcenv_types.hpp - ACT/act.linux (binary timestamp update) These files are auto-generated by running: ./act.linux LibMCEnv.xml
1 parent ba5f649 commit e591fef

15 files changed

Lines changed: 1146 additions & 0 deletions

ACT/LibMCEnv.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,6 +2591,12 @@
25912591
</method>
25922592
</class>
25932593

2594+
<class name="BuildIterator" parent="Iterator">
2595+
<method name="GetCurrentBuild" description="Returns the build the iterator points at.">
2596+
<param name="BuildInstance" type="handle" class="Build" pass="return" description="returns the Build instance."/>
2597+
</method>
2598+
</class>
2599+
25942600

25952601
<class name="Build" parent="Base" description="Build instance to access build files">
25962602

@@ -2602,6 +2608,14 @@
26022608
<param name="BuildUUID" type="string" pass="return" description="UUID of the build." />
26032609
</method>
26042610

2611+
<method name="GetCreatedTimestamp" description="Returns creation timestamp of the build in ISO-8601 format.">
2612+
<param name="Timestamp" type="string" pass="return" description="Creation timestamp in ISO-8601 format (e.g., 2025-10-23T14:30:00.000Z)." />
2613+
</method>
2614+
2615+
<method name="GetLastExecutionTimestamp" description="Returns the most recent execution timestamp in ISO-8601 format. Returns empty string if build has never been executed.">
2616+
<param name="Timestamp" type="string" pass="return" description="Most recent execution timestamp in ISO-8601 format. Empty string if never executed." />
2617+
</method>
2618+
26052619
<method name="GetStorageUUID" description="Returns storage uuid of the build stream.">
26062620
<param name="StorageUUID" type="string" pass="return" description="Storage UUID of the build." />
26072621
</method>
@@ -5742,6 +5756,10 @@
57425756
<param name="ExecutionUUID" type="string" pass="in" description="UUID of the execution entity." />
57435757
<param name="ExecutionInstance" type="class" class="BuildExecution" pass="return" description="Build execution instance" />
57445758
</method>
5759+
<method name="GetRecentBuildJobs" description="Returns an iterator for recent build jobs, ordered by timestamp (newest first).">
5760+
<param name="MaxCount" type="uint32" pass="in" description="Maximum number of jobs to return. Must be greater than 0." />
5761+
<param name="BuildIterator" type="class" class="BuildIterator" pass="return" description="Iterator for build jobs, ordered newest first." />
5762+
</method>
57455763

57465764
<method name="CreateDiscreteField2D" description="Creates an empty discrete field.">
57475765
<param name="PixelCountX" type="uint32" pass="in" description="Pixel count in X. MUST be positive." />
@@ -5913,6 +5931,26 @@
59135931
<param name="ReturnValueName" type="string" pass="in" description="The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)" />
59145932
<param name="ReturnValue" type="string" pass="in" description="Return value." />
59155933
</method>
5934+
5935+
<method name="SetStringResult" description="Sets a string result value for external event return (typed convenience wrapper).">
5936+
<param name="ReturnValueName" type="string" pass="in" description="The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)" />
5937+
<param name="ReturnValue" type="string" pass="in" description="Return value." />
5938+
</method>
5939+
5940+
<method name="SetIntegerResult" description="Sets an integer result value for external event return.">
5941+
<param name="ReturnValueName" type="string" pass="in" description="The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)" />
5942+
<param name="ReturnValue" type="int64" pass="in" description="Return value." />
5943+
</method>
5944+
5945+
<method name="SetBoolResult" description="Sets a boolean result value for external event return.">
5946+
<param name="ReturnValueName" type="string" pass="in" description="The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)" />
5947+
<param name="ReturnValue" type="bool" pass="in" description="Return value." />
5948+
</method>
5949+
5950+
<method name="SetDoubleResult" description="Sets a double result value for external event return.">
5951+
<param name="ReturnValueName" type="string" pass="in" description="The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)" />
5952+
<param name="ReturnValue" type="double" pass="in" description="Return value." />
5953+
</method>
59165954

59175955
<method name="GetExternalEventParameters" description="Returns the external event parameters. This JSON Object was passed on from the external API.">
59185956
<param name="ParameterValue" type="class" class="JSONObject" pass="return" description="Parameter value." />

ACT/act.linux

100644100755
File mode changed.

Framework/HeadersDev/CppDynamic/libmcenv_dynamic.h

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4234,6 +4234,19 @@ typedef LibMCEnvResult (*PLibMCEnvBuildExecution_LoadAttachedJournalPtr) (LibMCE
42344234
*/
42354235
typedef LibMCEnvResult (*PLibMCEnvBuildExecutionIterator_GetCurrentExecutionPtr) (LibMCEnv_BuildExecutionIterator pBuildExecutionIterator, LibMCEnv_BuildExecution * pBuildExecutionInstance);
42364236

4237+
/*************************************************************************************************************************
4238+
Class definition for BuildIterator
4239+
**************************************************************************************************************************/
4240+
4241+
/**
4242+
* Returns the build the iterator points at.
4243+
*
4244+
* @param[in] pBuildIterator - BuildIterator instance.
4245+
* @param[out] pBuildInstance - returns the Build instance.
4246+
* @return error code or 0 (success)
4247+
*/
4248+
typedef LibMCEnvResult (*PLibMCEnvBuildIterator_GetCurrentBuildPtr) (LibMCEnv_BuildIterator pBuildIterator, LibMCEnv_Build * pBuildInstance);
4249+
42374250
/*************************************************************************************************************************
42384251
Class definition for Build
42394252
**************************************************************************************************************************/
@@ -4260,6 +4273,28 @@ typedef LibMCEnvResult (*PLibMCEnvBuild_GetNamePtr) (LibMCEnv_Build pBuild, cons
42604273
*/
42614274
typedef LibMCEnvResult (*PLibMCEnvBuild_GetBuildUUIDPtr) (LibMCEnv_Build pBuild, const LibMCEnv_uint32 nBuildUUIDBufferSize, LibMCEnv_uint32* pBuildUUIDNeededChars, char * pBuildUUIDBuffer);
42624275

4276+
/**
4277+
* Returns creation timestamp of the build in ISO-8601 format.
4278+
*
4279+
* @param[in] pBuild - Build instance.
4280+
* @param[in] nTimestampBufferSize - size of the buffer (including trailing 0)
4281+
* @param[out] pTimestampNeededChars - will be filled with the count of the written bytes, or needed buffer size.
4282+
* @param[out] pTimestampBuffer - buffer of Creation timestamp in ISO-8601 format (e.g., 2025-10-23T14:30:00.000Z)., may be NULL
4283+
* @return error code or 0 (success)
4284+
*/
4285+
typedef LibMCEnvResult (*PLibMCEnvBuild_GetCreatedTimestampPtr) (LibMCEnv_Build pBuild, const LibMCEnv_uint32 nTimestampBufferSize, LibMCEnv_uint32* pTimestampNeededChars, char * pTimestampBuffer);
4286+
4287+
/**
4288+
* Returns the most recent execution timestamp in ISO-8601 format. Returns empty string if build has never been executed.
4289+
*
4290+
* @param[in] pBuild - Build instance.
4291+
* @param[in] nTimestampBufferSize - size of the buffer (including trailing 0)
4292+
* @param[out] pTimestampNeededChars - will be filled with the count of the written bytes, or needed buffer size.
4293+
* @param[out] pTimestampBuffer - buffer of Most recent execution timestamp in ISO-8601 format. Empty string if never executed., may be NULL
4294+
* @return error code or 0 (success)
4295+
*/
4296+
typedef LibMCEnvResult (*PLibMCEnvBuild_GetLastExecutionTimestampPtr) (LibMCEnv_Build pBuild, const LibMCEnv_uint32 nTimestampBufferSize, LibMCEnv_uint32* pTimestampNeededChars, char * pTimestampBuffer);
4297+
42634298
/**
42644299
* Returns storage uuid of the build stream.
42654300
*
@@ -10607,6 +10642,16 @@ typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_HasBuildExecutionPtr) (LibMCEnv_
1060710642
*/
1060810643
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_GetBuildExecutionPtr) (LibMCEnv_UIEnvironment pUIEnvironment, const char * pExecutionUUID, LibMCEnv_BuildExecution * pExecutionInstance);
1060910644

10645+
/**
10646+
* Returns an iterator for recent build jobs, ordered by timestamp (newest first).
10647+
*
10648+
* @param[in] pUIEnvironment - UIEnvironment instance.
10649+
* @param[in] nMaxCount - Maximum number of jobs to return. Must be greater than 0.
10650+
* @param[out] pBuildIterator - Iterator for build jobs, ordered newest first.
10651+
* @return error code or 0 (success)
10652+
*/
10653+
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_GetRecentBuildJobsPtr) (LibMCEnv_UIEnvironment pUIEnvironment, LibMCEnv_uint32 nMaxCount, LibMCEnv_BuildIterator * pBuildIterator);
10654+
1061010655
/**
1061110656
* Creates an empty discrete field.
1061210657
*
@@ -10949,6 +10994,46 @@ typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_GetExternalEventParameterPtr) (L
1094910994
*/
1095010995
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_AddExternalEventResultValuePtr) (LibMCEnv_UIEnvironment pUIEnvironment, const char * pReturnValueName, const char * pReturnValue);
1095110996

10997+
/**
10998+
* Sets a string result value for external event return (typed convenience wrapper).
10999+
*
11000+
* @param[in] pUIEnvironment - UIEnvironment instance.
11001+
* @param[in] pReturnValueName - The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)
11002+
* @param[in] pReturnValue - Return value.
11003+
* @return error code or 0 (success)
11004+
*/
11005+
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_SetStringResultPtr) (LibMCEnv_UIEnvironment pUIEnvironment, const char * pReturnValueName, const char * pReturnValue);
11006+
11007+
/**
11008+
* Sets an integer result value for external event return.
11009+
*
11010+
* @param[in] pUIEnvironment - UIEnvironment instance.
11011+
* @param[in] pReturnValueName - The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)
11012+
* @param[in] nReturnValue - Return value.
11013+
* @return error code or 0 (success)
11014+
*/
11015+
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_SetIntegerResultPtr) (LibMCEnv_UIEnvironment pUIEnvironment, const char * pReturnValueName, LibMCEnv_int64 nReturnValue);
11016+
11017+
/**
11018+
* Sets a boolean result value for external event return.
11019+
*
11020+
* @param[in] pUIEnvironment - UIEnvironment instance.
11021+
* @param[in] pReturnValueName - The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)
11022+
* @param[in] bReturnValue - Return value.
11023+
* @return error code or 0 (success)
11024+
*/
11025+
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_SetBoolResultPtr) (LibMCEnv_UIEnvironment pUIEnvironment, const char * pReturnValueName, bool bReturnValue);
11026+
11027+
/**
11028+
* Sets a double result value for external event return.
11029+
*
11030+
* @param[in] pUIEnvironment - UIEnvironment instance.
11031+
* @param[in] pReturnValueName - The name of the return parameter. MUST be an alphanumeric ASCII string (with optional _ and -)
11032+
* @param[in] dReturnValue - Return value.
11033+
* @return error code or 0 (success)
11034+
*/
11035+
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_SetDoubleResultPtr) (LibMCEnv_UIEnvironment pUIEnvironment, const char * pReturnValueName, LibMCEnv_double dReturnValue);
11036+
1095211037
/**
1095311038
* Returns the external event parameters. This JSON Object was passed on from the external API.
1095411039
*
@@ -11424,8 +11509,11 @@ typedef struct {
1142411509
PLibMCEnvBuildExecution_GetMetaDataStringPtr m_BuildExecution_GetMetaDataString;
1142511510
PLibMCEnvBuildExecution_LoadAttachedJournalPtr m_BuildExecution_LoadAttachedJournal;
1142611511
PLibMCEnvBuildExecutionIterator_GetCurrentExecutionPtr m_BuildExecutionIterator_GetCurrentExecution;
11512+
PLibMCEnvBuildIterator_GetCurrentBuildPtr m_BuildIterator_GetCurrentBuild;
1142711513
PLibMCEnvBuild_GetNamePtr m_Build_GetName;
1142811514
PLibMCEnvBuild_GetBuildUUIDPtr m_Build_GetBuildUUID;
11515+
PLibMCEnvBuild_GetCreatedTimestampPtr m_Build_GetCreatedTimestamp;
11516+
PLibMCEnvBuild_GetLastExecutionTimestampPtr m_Build_GetLastExecutionTimestamp;
1142911517
PLibMCEnvBuild_GetStorageUUIDPtr m_Build_GetStorageUUID;
1143011518
PLibMCEnvBuild_GetStorageSHA256Ptr m_Build_GetStorageSHA256;
1143111519
PLibMCEnvBuild_EnsureStorageSHA256IsValidPtr m_Build_EnsureStorageSHA256IsValid;
@@ -12019,6 +12107,7 @@ typedef struct {
1201912107
PLibMCEnvUIEnvironment_GetBuildJobPtr m_UIEnvironment_GetBuildJob;
1202012108
PLibMCEnvUIEnvironment_HasBuildExecutionPtr m_UIEnvironment_HasBuildExecution;
1202112109
PLibMCEnvUIEnvironment_GetBuildExecutionPtr m_UIEnvironment_GetBuildExecution;
12110+
PLibMCEnvUIEnvironment_GetRecentBuildJobsPtr m_UIEnvironment_GetRecentBuildJobs;
1202212111
PLibMCEnvUIEnvironment_CreateDiscreteField2DPtr m_UIEnvironment_CreateDiscreteField2D;
1202312112
PLibMCEnvUIEnvironment_CreateDiscreteField2DFromImagePtr m_UIEnvironment_CreateDiscreteField2DFromImage;
1202412113
PLibMCEnvUIEnvironment_CheckPermissionPtr m_UIEnvironment_CheckPermission;
@@ -12051,6 +12140,10 @@ typedef struct {
1205112140
PLibMCEnvUIEnvironment_HasExternalEventParameterPtr m_UIEnvironment_HasExternalEventParameter;
1205212141
PLibMCEnvUIEnvironment_GetExternalEventParameterPtr m_UIEnvironment_GetExternalEventParameter;
1205312142
PLibMCEnvUIEnvironment_AddExternalEventResultValuePtr m_UIEnvironment_AddExternalEventResultValue;
12143+
PLibMCEnvUIEnvironment_SetStringResultPtr m_UIEnvironment_SetStringResult;
12144+
PLibMCEnvUIEnvironment_SetIntegerResultPtr m_UIEnvironment_SetIntegerResult;
12145+
PLibMCEnvUIEnvironment_SetBoolResultPtr m_UIEnvironment_SetBoolResult;
12146+
PLibMCEnvUIEnvironment_SetDoubleResultPtr m_UIEnvironment_SetDoubleResult;
1205412147
PLibMCEnvUIEnvironment_GetExternalEventParametersPtr m_UIEnvironment_GetExternalEventParameters;
1205512148
PLibMCEnvUIEnvironment_GetExternalEventResultsPtr m_UIEnvironment_GetExternalEventResults;
1205612149
PLibMCEnvUIEnvironment_CreateMachineConfigurationHandlerPtr m_UIEnvironment_CreateMachineConfigurationHandler;

0 commit comments

Comments
 (0)