3
« on: March 14, 2023, 11:51:07 pm »
ok. I add an element (Action Call Behaviout) from the SysML Toolbox and the name was on the top, then I change the stereotype of the element and the name go to the middle. Here is the Shape Script (I put some ... to make shorteer the text:
shape main
{
noshadow = "true";
if (HasTag("ElementType","Mechanical"))
{
setfillcolor(210,108,30);
}
...
else if (HasTag("ElementType","Mechatronical"))
{
setfillcolor(255,228,188);
}
DrawNativeShape();
}
decoration Type
{
orientation = "SW";
if (HasTag("showElementType","true"))
{
if (HasTag("isSignal","true"))
{
println("Sig");
}
...
else if (HasTag("ElementType","Mechatronical"))
{
println("Mea");
}
}
}
decoration SIL
{
orientation = "NW";
if (HasTag("showSafetyIntegrity","true"))
{
if (HasTag("SafetyIntegrity","None"))
{
// hide label
HideLabel("");
}
else
{
// Not applicable
if (HasTag("SafetyIntegrity","Not applicable"))
{
setfillcolor(255, 255, 255);
print("Na");
RoundRect(0,0,100,100,4,4);
}
....
}
}
}
shape RelatedElement
{
if(HasProperty("Connector.Type", "Realisation"))
{
if(HasProperty("Element.IsTarget"))
{
SetCompartmentName("ExternalRequirements");
AppendCompartmentText("Req #Element.Name#");
}
}
if(HasProperty("Connector.Type", "Dependency"))
{
if(HasProperty("Element.IsSource"))
{
SetCompartmentName("DerivedRequirements");
AppendCompartmentText("Req #Element.Name#");
}
}
if(HasProperty("Connector.Type", "Abstraction"))
{
if(HasProperty("Element.IsTarget"))
{
SetCompartmentName("AllocatedTo");
AppendCompartmentText("#Element.Name#");
}
}
}
I don't have any control for the text