Skip to content

Commit

Permalink
* fix for activate actions
Browse files Browse the repository at this point in the history
  by scripting
  • Loading branch information
festo-i40 committed Aug 29, 2024
1 parent d14d421 commit 6a93d57
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
8 changes: 7 additions & 1 deletion src/AasxPackageExplorer/debug.MIHO.script
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
// Tool("sammaspectimport", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\samm-test\\Batch-MM-2_0_0.ttl");
Tool("editkey");
Select("Submodel", "First");
Select("Submodel", "Next");
Select("SME", "First");
Tool("aas-elem-copy");
Tool("aas-elem-paste-below");
Sleep(1000);
x = Select("This");
WriteLine("##RESULT#1##", x.IdShort);
Tool("aas-elem-delete");
// Tool("sammaspectimport", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\samm-test\\Aspect_Example_SML_MLP.ttl");
// Tool("exportpredefineconcepts", "File", "C:\HOMI\Develop\Aasx\repo\aid\new.txt");
// Tool("submodelinstancefromsmtconcepts");
Expand All @@ -29,4 +35,4 @@ Tool("aas-elem-copy");
// Tool("ToolsFindText", "FindText", "A");
// Tool("ToolsReplaceText", "FindText", "A", "ReplaceText", "B", "Do", "all");
// WriteLine(GetLastLogLine());
// TakeScreenShot("Test123");
// TakeScreenShot("Test123");
29 changes: 19 additions & 10 deletions src/AasxPackageLogic/DispEditHelperBasics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -697,17 +697,26 @@ public void AddActionPanel(
{
var tmi = ticketMenu[i];
var currentI = i;
tmi.Action = (name, item, ticket) =>

// may be sync?
if (ticketAction != null)
{
if (ticket != null)
ticket.UiLambdaAction = ticketAction(currentI, ticket);
};

tmi.ActionAsync = async (name, item, ticket) =>
{
if (ticket != null && ticketActionAsync != null)
ticket.UiLambdaAction = await ticketActionAsync(currentI, ticket);
};
tmi.Action = (name, item, ticket) =>
{
if (ticket != null)
ticket.UiLambdaAction = ticketAction(currentI, ticket);
};
}

// may be async
if (ticketActionAsync != null)
{
tmi.ActionAsync = async (name, item, ticket) =>
{
if (ticket != null)
ticket.UiLambdaAction = await ticketActionAsync(currentI, ticket);
};
}

superMenu.Add(tmi);
}
Expand Down

0 comments on commit 6a93d57

Please sign in to comment.