Skip to content

Commit a65af9a

Browse files
committed
* update
1 parent 5f94093 commit a65af9a

14 files changed

+359
-128
lines changed

src/AasxCsharpLibrary/AdminShellUtil.cs

+18-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ public static string[] GetPopularMimeTypes()
263263
"image/png",
264264
System.Net.Mime.MediaTypeNames.Image.Gif,
265265
"application/iges",
266-
"application/step"
266+
"application/step",
267+
"application/octet-stream"
267268
};
268269
}
269270

@@ -1334,6 +1335,22 @@ public static bool CheckIfAsciiOnly(byte[] data, int bytesToCheck = int.MaxValue
13341335
return ascii;
13351336
}
13361337

1338+
public static bool CheckIfBase64Only(byte[] data, int bytesToCheck = int.MaxValue)
1339+
{
1340+
if (data == null)
1341+
return true;
1342+
1343+
var b64 = true;
1344+
for (int i = 0; i < Math.Min(data.Length, bytesToCheck); i++)
1345+
{
1346+
var c = data[i];
1347+
// 'manually' check for allowed char intervals of BASE64
1348+
if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '+' || c == '/' || c == '='))
1349+
b64 = false;
1350+
}
1351+
return b64;
1352+
}
1353+
13371354
// see: https://stackoverflow.com/questions/5209506/how-can-i-know-what-image-format-i-get-from-a-stream
13381355
// based on https://devblogs.microsoft.com/scripting/psimaging-part-1-test-image/
13391356
// see https://en.wikipedia.org/wiki/List_of_file_signatures

src/AasxPackageExplorer/MainWindow.xaml.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,10 @@ private async void Window_Loaded(object sender, RoutedEventArgs e)
946946
MainMenu = new AasxMenuWpf();
947947
MainMenu.LoadAndRender(logicalMainMenu, MenuMain, this.CommandBindings, this.InputBindings);
948948

949+
// editor modes?
950+
MainMenu?.SetChecked("EditMenu", Options.Curr.EditMode);
951+
MainMenu?.SetChecked("HintsMenu", !Options.Curr.NoHints);
952+
949953
// display elements has a cache
950954
DisplayElements.ActivateElementStateCache();
951955
VisualElementEnvironmentItem.SetCdSortOrderByString(Options.Curr.CdSortOrder);
@@ -1302,7 +1306,8 @@ private async void Window_Loaded(object sender, RoutedEventArgs e)
13021306
Log.Singleton.Error($"Failed to auto-load AASX from {location}");
13031307
else
13041308
UiLoadPackageWithNew(PackageCentral.MainItem,
1305-
takeOverContainer: container, onlyAuxiliary: false, indexItems: true);
1309+
takeOverContainer: container, onlyAuxiliary: false, indexItems: true,
1310+
nextEditMode: Options.Curr.EditMode);
13061311

13071312
Log.Singleton.Info($"Successfully auto-loaded AASX {location}");
13081313
}
@@ -3974,7 +3979,8 @@ private void Window_Drop(object sender, DragEventArgs e)
39743979
try
39753980
{
39763981
UiLoadPackageWithNew(
3977-
PackageCentral.MainItem, null, loadLocalFilename: fn, onlyAuxiliary: false);
3982+
PackageCentral.MainItem, null, loadLocalFilename: fn, onlyAuxiliary: false,
3983+
nextEditMode: Options.Curr.EditMode);
39783984
}
39793985
catch (Exception ex)
39803986
{

src/AasxPackageExplorer/debug.MIHO.script

+63-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Tool("sammaspectimport", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\samm-test\\BatteryPass-spiel.ttl");
99
// Tool("sammaspectimport", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\samm-test\\Batch-MM-2_0_0.ttl");
1010
// Tool("exportsmtasciidoc", "File", "C:\\HOMI\\Develop\\Aasx\\repo\\new.zip", "AntoraStyle", "true");
11-
Tool("editkey");
11+
// Tool("editkey");
1212
// Tool("createrepofromapi", "BaseAddress", "http://localhost:5001/api/v3.0/", "BaseType", "Repository");
1313
// Tool("connectextended", "BaseAddress", "http://smt-repo.admin-shell-io.com/api/v3.0", "BaseType", "Repository", "GetAllAas", "false", "GetSingleAas", "true", "AasId", "https://admin-shell.io/idta/aas/DigitalNameplate/3/0", "AutoLoadOnDemand", "false", "AutoLoadCds", "true", "ParallelReads", "10");
1414
// Tool("connectextended", "BaseAddress", "http://smt-repo.admin-shell-io.com/api/v3.0", "BaseType", "Repository", "GetSingleAas", "false", "GetAllAas", "true", "PageLimit", "4", "AutoLoadOnDemand", "false", "AutoLoadCds", "true");
@@ -17,7 +17,7 @@ Tool("editkey");
1717
// Tool("connectextended", "BaseAddress", "https://eis-data.aas-voyager.com/", "BaseType", "Repository", "GetSingleAas", "true", "PageLimit", "2", "AutoLoadOnDemand", "false", "AasId", "https://new.abb.com/products/de/2CSF204101R1400/aas");
1818
// Tool("connectextended", "BaseAddress", "https://techday2-registry.admin-shell-io.com/", "BaseType", "Registry", "GetSingleAas", "false", "GetAasByAssetLink", "true", "PageLimit", "2", "AutoLoadOnDemand", "false", "AssetId", "https://pk.harting.com/?.20P=ZSN1");
1919
// Select("AAS", "First");
20-
Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
20+
// Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
2121
// Select("Submodel", "First");
2222
// Select("Submodel", "Next");
2323
// Tool("exportsmtasciidoc", "File", "C:\Users\homi0002\Desktop\tmp\new.zip", "ExportHtml", "true", "ExportPdf", "false", "AntoraStyle", "false", "ViewResult", "true");
@@ -47,3 +47,64 @@ Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "In
4747
// Tool("ToolsReplaceText", "FindText", "A", "ReplaceText", "B", "Do", "all");
4848
// WriteLine(GetLastLogLine());
4949
// TakeScreenShot("Test123");
50+
51+
Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\\00_FestoDemoBox-Module-2.aasx");
52+
Select("AAS", "First");
53+
Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
54+
Sleep(6000);
55+
56+
Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\\12_article-dpdm-32-instance_1.aasx");
57+
Select("AAS", "First");
58+
Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
59+
Sleep(6000);
60+
61+
Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\13_article-dpdm-32-instance_2.aasx");
62+
Select("AAS", "First");
63+
Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
64+
Sleep(6000);
65+
66+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\16_article-ovel-10.aasx");
67+
//Select("AAS", "First");
68+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
69+
//Sleep(6000);
70+
71+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\17_article-spau.aasx");
72+
//Select("AAS", "First");
73+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
74+
//Sleep(1000);
75+
76+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\18_article-vuvg-l14_1.aasx");
77+
//Select("AAS", "First");
78+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
79+
//Sleep(1000);
80+
81+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\18_article-vuvg-l14_2.aasx");
82+
//Select("AAS", "First");
83+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
84+
//Sleep(1000);
85+
86+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\20_Festo_579071_SMT-8M-A-PS-24V-E-0.3-M12_proximity_switch.aasx");
87+
//Select("AAS", "First");
88+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
89+
//Sleep(1000);
90+
91+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\21_article-elgs-45-200.aasx");
92+
//Select("AAS", "First");
93+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
94+
//Sleep(1000);
95+
96+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\22_article-CPX-E-CEC-M1-PN.aasx");
97+
//Select("AAS", "First");
98+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
99+
//Sleep(1000);
100+
101+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\30_Festo_SPAU_VR3.aasx");
102+
//Select("AAS", "First");
103+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
104+
//Sleep(1000);
105+
106+
//Tool("Open", "File", "C:\\HOMI\\Develop\\Aasx\\repo_Festo_demo_case_V3\31_HMI22_Festo_CMMT.aasx");
107+
//Select("AAS", "First");
108+
//Tool("apiuploadassistant", "BaseAddress", "http://localhost:5001/api/v3.0/", "IncludeSubmodels", true, "IncludeCDs", true, "IncludeSupplFiles", true, "OverwriteIfExist", true);
109+
//Sleep(1000);
110+

src/AasxPackageExplorer/options-debug.MIHO.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
// "AasxToLoad": "C:\\MIHO\\Develop\\Aasx\\repo\\Syn2tecMachine_P2518_AAS__V3_DL2.aasx",
5252
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\test-data\\MTP\\test-data-SMT_MTP.aasx",
5353
// "AasxToLoad": "C:\\Users\\Micha\\Desktop\\Demo\\AASX\\8001203_SPAU-P10R-T-R18M-L-PNLK-PNVBA-M8D_060ff64f-9fd2-422d-81ce-b17e49f007c5_work.aasx",
54-
"AasxToLoad": "C:\\Users\\Micha\\Desktop\\t3\\dnp-t30.aasx",
54+
// "AasxToLoad": "C:\\Users\\Micha\\Desktop\\t3\\dnp-t30.aasx",
5555
// "AasxToLoad": "C:\\Users\\homi0002\\Desktop\\tmp\\00_FestoDemoBox-Module-2-Kopie.aasx",
5656
// "AasxToLoad": "C:\\Users\\homi0002\\Desktop\\tmp\\8001203_SPAU-P10R-T-R18M-L-PNLK-PNVBA-M8D_060ff64f-9fd2-422d-81ce-b17e49f007c5_work_spiel.aasx",
5757
// "AasxToLoad": "C:\\Users\\homi0002\\Desktop\\1449600_NEBM-SM12G8-E-1.5-Q5-LE6_511946fb-00c1-4aa8-9877-9ba23d86146e.aasx",
@@ -90,6 +90,8 @@
9090
"WindowWidth": 900,
9191
"WindowHeight": 600,
9292
"WindowMaximized": false,
93+
"EditMode" : true,
94+
"NoHints" : true,
9395
"TemplateIdAas": "www.example.com/ids/aas/DDDD_DDDD_DDDD_DDDD",
9496
"TemplateIdAsset": "www.example.com/ids/asset/DDDD_DDDD_DDDD_DDDD",
9597
"TemplateIdSubmodelInstance": "www.example.com/ids/sm/DDDD_DDDD_DDDD_DDDD",

0 commit comments

Comments
 (0)