Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
* more SAMM models
Browse files Browse the repository at this point in the history
* CD sort order structured
* box icons
  • Loading branch information
festo-i40 committed Oct 29, 2023
1 parent 9f3703c commit 977c780
Show file tree
Hide file tree
Showing 11 changed files with 970 additions and 155 deletions.
370 changes: 325 additions & 45 deletions src/AasxCore.Samm2_2_0/SammClasses.cs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/AasxCsharpLibrary/AdminShellCollections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public IEnumerable<List<V>> Keys
return dict.Values;
}
}

public void Clear() => dict.Clear();
}

public class DoubleSidedDict<T1, T2>
Expand Down
42 changes: 41 additions & 1 deletion src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,5 +310,45 @@ public static void AddIsCaseOf(this IConceptDescription cd,
cd.IsCaseOf = new List<IReference>();
cd.IsCaseOf.Add(ico);
}
}

/// <summary>
/// Returns false, if there is another element with same idShort in the list
/// </summary>
public static bool CheckIdShortIsUnique(this List<IConceptDescription> cds, string idShort)
{
idShort = idShort?.Trim();
if (idShort == null || idShort.Length < 1)
return false;

var res = true;
foreach (var smw in cds)
if (smw != null && smw.IdShort != null && smw.IdShort == idShort)
{
res = false;
break;
}

return res;
}

/// <summary>
/// Creates ids with numerical index according to template string, until a unique idShort is found
/// </summary>
public static string IterateIdShortTemplateToBeUnique(this List<IConceptDescription> cds, string idShortTemplate, int maxNum)
{
if (idShortTemplate == null || maxNum < 1 || !idShortTemplate.Contains("{0"))
return null;

int i = 1;
while (i < maxNum)
{
var ids = string.Format(idShortTemplate, i);
if (cds.CheckIdShortIsUnique(ids))
return ids;
i++;
}

return null;
}
}
}
3 changes: 2 additions & 1 deletion src/AasxPackageExplorer/options-debug.MIHO.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
/* "AasxToLoad": "C:\\MIHO\\Develop\\Aasx\\repo\\Festo_SPAU_VR3.aasx", */
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\PxC_aasT_2900542_ELR_H3_I_SC__24DC_500AC_0_6.aasx",
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\Festo_SPAU-B2R-H-G18FD-L-PNLK-PNVBA-M8U_V3c.aasx",
"AasxToLoad": "C:\\Users\\homi0002\\Desktop\\TempDesktop\\230619 Digi Twin Festo AASX Assessment\\231002_Feedback_1\\8001203_64be10f8-d4c8-4226-a56b-901b9fcbe29c_fb1.aasx",
// "AasxToLoad": "C:\\Users\\homi0002\\Desktop\\TempDesktop\\230619 Digi Twin Festo AASX Assessment\\231002_Feedback_1\\8001203_64be10f8-d4c8-4226-a56b-901b9fcbe29c_fb1.aasx",
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\01_Festo_SPAU_VR3_DPPV2.aasx",
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\bomtest1.aasx",
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\leitungssatz_tier1.aasx",
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\IDTA 02006-2-1_Template_Digital Nameplate_V3_lang.aasx",
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\SMT_Sample_B.aasx",
// "AuxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\SMT_Sample_A.aasx",
// "AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\00_FestoDemoBox-Module-2-Kopie2.aasx",
"AasxToLoad": "C:\\HOMI\\Develop\\Aasx\\repo\\samm_spiel.aasx",
"WindowLeft": 200,
"WindowTop": -1,
"WindowWidth": 900,
Expand Down
12 changes: 8 additions & 4 deletions src/AasxPackageLogic/DispEditHelperBasics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,17 @@ public void AddKeyValueExRef(
string[] auxButtonToolTips = null,
AnyUiLambdaActionBase takeOverLambdaAction = null,
bool limitToOneRowForNoEdit = false,
int comboBoxMinWidth = -1)
int comboBoxMinWidth = -1,
bool noFirstColumnWidth = false)
{
AddKeyValue(
view, key, value, nullValue, repo, setValue, comboBoxItems, comboBoxIsEditable,
auxButtonTitle, auxButtonLambda, auxButtonToolTip,
auxButtonTitles, auxButtonToolTips, takeOverLambdaAction,
(value == null) ? 0 : value.GetHashCode(), containingObject: containingObject,
limitToOneRowForNoEdit: limitToOneRowForNoEdit,
comboBoxMinWidth: comboBoxMinWidth);
comboBoxMinWidth: comboBoxMinWidth,
noFirstColumnWidth: noFirstColumnWidth);
}

/// <summary>
Expand Down Expand Up @@ -344,7 +346,8 @@ public void AddKeyValue(
Nullable<int> valueHash = null,
object containingObject = null,
bool limitToOneRowForNoEdit = false,
int comboBoxMinWidth = -1)
int comboBoxMinWidth = -1,
bool noFirstColumnWidth = false)
{
// draw anyway?
if (repo != null && value == null)
Expand Down Expand Up @@ -380,7 +383,8 @@ public void AddKeyValue(
g.Margin = new AnyUiThickness(0, 1, 0, 1);
var gc1 = new AnyUiColumnDefinition();
gc1.Width = AnyUiGridLength.Auto;
gc1.MinWidth = this.GetWidth(FirstColumnWidth.Standard);
if (!noFirstColumnWidth)
gc1.MinWidth = this.GetWidth(FirstColumnWidth.Standard);
g.ColumnDefinitions.Add(gc1);
var gc2 = new AnyUiColumnDefinition();
gc2.Width = new AnyUiGridLength(1.0, AnyUiGridUnitType.Star);
Expand Down
2 changes: 1 addition & 1 deletion src/AasxPackageLogic/DispEditHelperEntities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ public void DisplayOrEditAasEntityAasEnv(
minWidth: 250,
items: new[] {
"List index", "idShort", "Identification", "By AasSubmodel",
"By SubmodelElements"
"By SubmodelElements", "Structured"
}),
(o) =>
{
Expand Down
3 changes: 2 additions & 1 deletion src/AasxPackageLogic/DispEditHelperMiniModules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,8 @@ public void ExtensionHelper(
padding: new AnyUiThickness(5, 0, 5, 0));

// special case: SAMM extension
if (Samm.Util.HasSammSemanticId(extension))
// TODO: enable
if (false && Samm.Util.HasSammSemanticId(extension))
{
substack.Add(new AnyUiLabel()
{
Expand Down
Loading

0 comments on commit 977c780

Please sign in to comment.