Skip to content

Commit 250bec7

Browse files
Merge pull request #29 from Autodesk/develop
Merge Develop into Master
2 parents af66c18 + 751f563 commit 250bec7

File tree

456 files changed

+100498
-1209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

456 files changed

+100498
-1209
lines changed

ACT/LibMC.xml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,33 @@
336336
<error name="INVALIDEVENTCONTEXT" code="327" description="Invalid event sender" />
337337
<error name="INVALIDLAYERINDEX" code="328" description="Invalid layer index" />
338338
<error name="TEMPBASEPATHEMPTY" code="329" description="Empty base path for temporary files" />
339-
<error name="PROFILENOTFOUND" code="330" description="Profile not found." />
340-
339+
<error name="PROFILENOTFOUND" code="330" description="Profile not found." />
340+
<error name="INVALIDSERVICEHANDLER" code="331" description="Invalid service handler." />
341+
<error name="INVALIDMAXTHREADCOUNT" code="332" description="Invalid max thread count." />
342+
<error name="INVALIDTOOLPATHSTREAMUUID" code="333" description="Invalid toolpath stream uuid" />
343+
<error name="MISSINGSECTIONHEIGHT" code="334" description="Missing section height" />
344+
<error name="INVALIDSECTIONHEIGHT" code="335" description="Invalid section height" />
345+
<error name="MISSINGSECTIONWIDTH" code="336" description="Missing section width" />
346+
<error name="INVALIDSECTIONWIDTH" code="337" description="Invalid section width" />
347+
<error name="TOOLPATHMETADATANOTFOUND" code="338" description="Toolpath metadata not found" />
348+
349+
<error name="BUILDITEMHASNOUUID" code="339" description="Build item has no uuid" />
350+
<error name="OBJECTHASNOUUID" code="340" description="Object has no uuid" />
351+
352+
<error name="COULDNOTPARSEEVENTPARAMETERS" code="341" description="Could not parse event parameters" />
353+
<error name="INVALIDEVENTPARAMETERS" code="342" description="Invalid event parameters" />
354+
<error name="INVALIDFORMVALUES" code="343" description="Invalid form values" />
355+
<error name="FORMNAMEMISSING" code="344" description="Form name is missing" />
356+
<error name="FORMENTITYNAMEMISSING" code="345" description="Form entity name is missing" />
357+
<error name="FORMNOTFOUND" code="346" description="Form not found" />
358+
<error name="FORMENTITYNOTFOUND" code="347" description="Form entity not found" />
359+
<error name="DUPLICATEENTITYNAME" code="348" description="Duplicate form entity name" />
360+
<error name="COULDNOTFINDEVENTSENDERPAGE" code="349" description="Could not find event sender page" />
361+
<error name="COULDNOTFINDEVENTSENDER" code="350" description="Could not find event sender" />
362+
<error name="DUPLICATEFORMNAME" code="351" description="Duplicate form name" />
363+
364+
365+
341366
</errors>
342367

343368

ACT/LibMCEnv.xml

Lines changed: 192 additions & 11 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,30 @@ set_target_properties(libmcdata
298298
)
299299

300300

301+
add_custom_target(configuration_xml ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Plugins/config.xml)
302+
303+
set_property(TARGET configuration_xml APPEND PROPERTY SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Plugins/config.xml)
304+
305+
add_custom_command(
306+
TARGET configuration_xml PRE_BUILD
307+
COMMAND ${CMAKE_COMMAND} -E echo "creating output directory")
308+
309+
add_custom_command(
310+
TARGET configuration_xml PRE_BUILD
311+
COMMAND ${CMAKE_COMMAND} -E make_directory
312+
${CMAKE_CURRENT_BINARY_DIR}/Output)
313+
314+
add_custom_command(
315+
TARGET configuration_xml PRE_BUILD
316+
COMMAND ${CMAKE_COMMAND} -E echo "copying config.xml...")
317+
318+
319+
add_custom_command(
320+
TARGET configuration_xml PRE_BUILD
321+
COMMAND ${CMAKE_COMMAND} -E copy
322+
${CMAKE_CURRENT_SOURCE_DIR}/Plugins/config.xml
323+
${PROJECT_BINARY_DIR}/Output/${GLOBALGITHASH}_config.xml)
324+
301325
add_custom_target(copy_distribution_libraries ALL)
302326
add_dependencies(copy_distribution_libraries copy_framework)
303327

@@ -322,11 +346,6 @@ add_custom_command(
322346
endif()
323347

324348

325-
add_custom_command(
326-
TARGET copy_distribution_libraries POST_BUILD
327-
COMMAND ${CMAKE_COMMAND} -E copy
328-
${CMAKE_CURRENT_SOURCE_DIR}/Plugins/config.xml
329-
${PROJECT_BINARY_DIR}/Output/${GLOBALGITHASH}_config.xml)
330349

331350

332351
add_custom_target(create_core_resources ALL)

Client/src/App.vue

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,18 @@
6868
<Dialog_Error :Application="Application" />
6969
</v-container>
7070

71-
<v-container fluid v-if="appIsReady">
72-
73-
<template v-for="uiPage in Application.AppContent.Pages">
74-
75-
<v-row align="start" justify="center" :key="uiPage.name" v-if="(Application.AppState.activePage == uiPage.name)">
76-
77-
<template v-for="uiModule in uiPage.modules">
78-
79-
<Module_Content :key="uiModule.name" v-if="(uiModule.type == 'content')" :module="uiModule" :Application="Application" />
80-
81-
</template>
82-
83-
</v-row>
84-
</template>
85-
71+
<template v-for="uiPage in Application.AppContent.Pages">
72+
<v-container :key="uiPage.name" v-if="appIsReady && (Application.AppState.activePage == uiPage.name)" style="width:100%; height:85vh; display:block">
8673

87-
</v-container>
74+
<template v-for="uiModule in uiPage.modules">
75+
<Module_Content :key="uiModule.name" v-if="(uiModule.type == 'content')" :module="uiModule" :Application="Application" />
76+
<Module_Tabs :key="uiModule.name" v-if="(uiModule.type == 'tabs')" :module="uiModule" :Application="Application" />
77+
<Module_VerticalSplit :key="uiModule.name" v-if="(uiModule.type == 'verticalsplit')" :module="uiModule" :Application="Application" />
78+
<Module_HorizontalSplit :key="uiModule.name" v-if="(uiModule.type == 'horizontalsplit')" :module="uiModule" :Application="Application" />
79+
</template>
80+
81+
</v-container>
82+
</template>
8883

8984
</v-main>
9085

@@ -102,9 +97,12 @@
10297
10398
import Dialog_Login from "./Dialog_Login.vue";
10499
import Dialog_Error from "./Dialog_Error.vue";
100+
105101
import Module_Content from "./Module_Content.vue";
102+
import Module_Tabs from "./Module_Tabs.vue";
103+
import Module_VerticalSplit from "./Module_VerticalSplit.vue";
104+
import Module_HorizontalSplit from "./Module_HorizontalSplit.vue";
106105
107-
108106
export default {
109107
110108
created() {
@@ -179,9 +177,12 @@
179177
},
180178
181179
components: {
182-
Module_Content,
183180
Dialog_Login,
184-
Dialog_Error
181+
Dialog_Error,
182+
Module_Content,
183+
Module_Tabs,
184+
Module_VerticalSplit,
185+
Module_HorizontalSplit
185186
},
186187
187188
methods: {

Client/src/Application.js

Lines changed: 121 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default class AMCApplication {
1313
{
1414
this.API = {
1515
baseURL : apiBaseURL,
16-
authToken: nullToken
16+
authToken: nullToken,
17+
unsuccessfulUpdateCounter: 0
1718
}
1819

1920
this.AppState = {
@@ -35,7 +36,8 @@ export default class AMCApplication {
3536
MenuItems: [],
3637
ToolbarItems: [],
3738
ContentItems: [],
38-
Pages: []
39+
Pages: [],
40+
FormEntities: []
3941
}
4042

4143

@@ -123,7 +125,14 @@ export default class AMCApplication {
123125
.catch(err => {
124126
this.setStatusToError (err.response.data.message);
125127
});
126-
}
128+
}
129+
130+
131+
performLogout ()
132+
{
133+
this.authToken = nullToken;
134+
this.unsuccessfulUpdateCounter = 0;
135+
}
127136

128137
requestLogin (userName, userPassword)
129138
{
@@ -169,6 +178,79 @@ export default class AMCApplication {
169178
}
170179

171180

181+
prepareModuleItem (item)
182+
{
183+
if (item.type === "parameterlist") {
184+
185+
this.AppContent.ContentItems[item.uuid] = { uuid: item.uuid, entries: [], refresh: true };
186+
item.entries = this.AppContent.ContentItems[item.uuid].entries;
187+
188+
}
189+
190+
if (item.type === "buildlist") {
191+
192+
this.AppContent.ContentItems[item.uuid] = { uuid: item.uuid, entries: [], refresh: true };
193+
item.entries = this.AppContent.ContentItems[item.uuid].entries;
194+
195+
}
196+
197+
if (item.type === "upload") {
198+
item.state = { uploadid: 0, chosenFile: null, idcounter: 0, messages: [] }
199+
200+
}
201+
202+
if (item.type === "form") {
203+
204+
for (var entity of item.entities) {
205+
206+
this.AppContent.FormEntities[entity.uuid] =
207+
{ uuid: entity.uuid,
208+
value: entity.defaultvalue,
209+
remotevalue: entity.defaultvalue,
210+
disabled: entity.disabled,
211+
readonly: entity.readonly
212+
};
213+
entity.dataObject = this.AppContent.FormEntities[entity.uuid];
214+
}
215+
216+
217+
218+
}
219+
220+
}
221+
222+
223+
prepareModule (module)
224+
{
225+
var item, tab, section;
226+
227+
if (module.type === "content") {
228+
for (item of module.items) {
229+
this.prepareModuleItem (item)
230+
}
231+
232+
}
233+
234+
if (module.type === "tabs") {
235+
for (tab of module.tabs) {
236+
this.prepareModule (tab)
237+
}
238+
}
239+
240+
if (module.type === "verticalsplit") {
241+
for (section of module.sections) {
242+
this.prepareModule (section)
243+
}
244+
}
245+
246+
if (module.type === "horizontalsplit") {
247+
for (section of module.sections) {
248+
this.prepareModule (section)
249+
}
250+
}
251+
}
252+
253+
172254
retrieveStateUpdate () {
173255

174256
this.axiosGetRequest ("/ui/state")
@@ -177,32 +259,10 @@ export default class AMCApplication {
177259
this.AppContent.MenuItems = resultJSON.data.menuitems;
178260
this.AppContent.ToolbarItems = resultJSON.data.toolbaritems;
179261

180-
var page, module, item;
262+
var page, module;
181263
for (page of resultJSON.data.pages) {
182264
for (module of page.modules) {
183-
if (module.type === "content") {
184-
for (item of module.items) {
185-
if (item.type === "parameterlist") {
186-
187-
this.AppContent.ContentItems[item.uuid] = { uuid: item.uuid, entries: [], refresh: true };
188-
item.entries = this.AppContent.ContentItems[item.uuid].entries;
189-
190-
}
191-
192-
if (item.type === "buildlist") {
193-
194-
this.AppContent.ContentItems[item.uuid] = { uuid: item.uuid, entries: [], refresh: true };
195-
item.entries = this.AppContent.ContentItems[item.uuid].entries;
196-
197-
}
198-
199-
if (item.type === "upload") {
200-
item.state = { uploadid: 0, chosenFile: null, idcounter: 0, messages: [] }
201-
202-
}
203-
}
204-
205-
}
265+
this.prepareModule (module)
206266
}
207267

208268
}
@@ -219,13 +279,22 @@ export default class AMCApplication {
219279
updateContentItem (uuid) {
220280

221281
this.AppContent.ContentItems[uuid].refresh = false;
282+
283+
var headers = {}
284+
var authToken = this.API.authToken;
285+
286+
if (authToken != nullToken)
287+
headers.Authorization = "Bearer " + authToken;
222288

223289
var url = this.API.baseURL + "/ui/contentitem/" + uuid;
224290
Axios({
225291
method: "GET",
292+
"headers": headers,
226293
url: url
227294
})
228295
.then(resultJSON => {
296+
297+
this.unsuccessfulUpdateCounter = 0;
229298

230299
var oldentrycount = this.AppContent.ContentItems[uuid].entries.length;
231300
for (var i = 0; i < oldentrycount; i++) {
@@ -238,8 +307,14 @@ export default class AMCApplication {
238307
this.AppContent.ContentItems[uuid].refresh = true;
239308
})
240309
.catch(err => {
241-
err;
242-
this.AppContent.ContentItems[uuid].refresh = true;
310+
311+
this.unsuccessfulUpdateCounter = this.unsuccessfulUpdateCounter + 1;
312+
if (this.unsuccessfulUpdateCounter > 5) {
313+
this.setStatusToError (err.message);
314+
} else {
315+
this.AppContent.ContentItems[uuid].refresh = true;
316+
}
317+
243318
});
244319

245320
}
@@ -383,12 +458,13 @@ export default class AMCApplication {
383458
}
384459

385460

386-
triggerUIEvent (eventname, senderuuid, contextuuid) {
461+
triggerUIEvent (eventname, senderuuid, contextuuid, formvalues) {
387462

388463
this.axiosPostRequest("/ui/event", {
389464
"eventname": eventname,
390465
"senderuuid": senderuuid,
391-
"contextuuid": contextuuid
466+
"contextuuid": contextuuid,
467+
"formvalues": formvalues
392468
})
393469
.then(resultHandleEvent => {
394470
resultHandleEvent;
@@ -398,6 +474,20 @@ export default class AMCApplication {
398474
alert (err);
399475
});
400476
}
477+
478+
479+
assembleFormValues (formValueUUIDList)
480+
{
481+
var resultObject = {}
482+
483+
for (var entityuuid of formValueUUIDList) {
484+
var formValue = this.AppContent.FormEntities[entityuuid].value;
485+
resultObject[entityuuid] = formValue;
486+
}
487+
488+
return resultObject;
489+
490+
}
401491

402492
}
403493

Client/src/ContentItem_ButtonGroup.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
uiModuleButtonClick: function (button) {
2929
3030
var contextuuid = this.Application.AppState.activeObject;
31+
var formvalues = this.Application.assembleFormValues (button.eventformvalues);
3132
3233
if (button.event != "") {
33-
this.Application.triggerUIEvent (button.event, button.uuid, contextuuid);
34+
this.Application.triggerUIEvent (button.event, button.uuid, contextuuid, formvalues);
3435
}
3536
3637
if (button.targetpage != "") {

0 commit comments

Comments
 (0)