Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modelos sistemas ciber físicos #115

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/development_VARIAMOS-WEB.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy container app to Azure Web App - variamosweb

on:
push:
branches:
- development

workflow_dispatch:

jobs:
build:
runs-on: 'ubuntu-latest'

steps:
- uses: actions/checkout@v2

- name: Login to ACR
uses: docker/login-action@v1
with:
registry: variamos.azurecr.io
username: ${{secrets.ACRUSERNAME}}
password: ${{secrets.ACRUSERPASSWORD}}

- name: Build and push container image to registry
uses: docker/build-push-action@v2
with:
push: true
tags: variamos.azurecr.io/${{secrets.ACRUSERNAME}}/variamosweb:latest
file: ./Dockerfile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 21 additions & 2 deletions public/xml/MX/adaptation_behavior_hardware/custom_shapes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,30 @@
<strokecolor color="#333333"/>
<fillcolor color="#ffffff"/>
<path>
<move x="0" y="50"/>
<move x="0" y="25"/>
<line x="100" y="0"/>
<line x="100" y="100"/>
<line x="0" y="100"/>
<line x="0" y="50"/>
<line x="0" y="25"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
</foreground>
</shape>

<shape name="customAction" aspect="variable" strokewidth="7" >
<background>
<strokecolor color="#333333"/>
<fillcolor color="#ffffff"/>
<path>
<move x="0" y="0"/>
<line x="50" y="25"/>
<line x="100" y="0"/>
<line x="100" y="100"/>
<line x="0" y="100"/>
<line x="0" y="0"/>
<close/>
</path>
</background>
Expand Down
10 changes: 5 additions & 5 deletions public/xml/MX/adaptation_hardware/custom_shapes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,18 @@
<strokecolor color="#333333"/>
<fillcolor color="#ffffff"/>
<path>
<move x="0" y="00"/>
<move x="0" y="0"/>
<line x="100" y="00"/>
<line x="100" y="100"/>
<line x="100" y="100"/>
<line x="0" y="100"/>
<line x="0" y="00"/>
<line x="0" y="0"/>
<close/>
<fillstroke/>
</path>
</background>
<foreground>
<image src="./images/models/adaptation_hardware/actuator.png" x="1" y="3" w="15" h="35" />
<image src="./images/models/adaptation_hardware/analog.png" x="84" y="3" w="15" h="35" />
<image src="./images/models/adaptation_hardware/actuator.png" x="1" y="3" w="15" h="35" />
<!--<image src="./images/models/adaptation_hardware/analog.png" x="84" y="3" w="15" h="35" /> -->
</foreground>
</shape>

Expand Down
Binary file added src/assets/images/grid - copia.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/grid.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Adaptation_behavior_hardwareOrganizer.prototype.organizeActions = function () {
let deviceGeometry = device.getGeometry();
deviceGeometry.x = this.deviceX;
deviceGeometry.y = this.deviceY;
let relations = grapUtil.getRelationsFromSource(this.graph, this.modelName, device, ["readAction", "writeAction", "controlAction"]);
let relations = grapUtil.getRelationsFromSource(this.graph, this.modelName, device, ["readAction", "writeAction", "customAction", "controlAction"]);
relations.forEach((relation) => {
let source = relation.target;
let sourceGeometry = source.getGeometry();
Expand All @@ -62,6 +62,7 @@ Adaptation_behavior_hardwareOrganizer.prototype.organizeActions = function () {
}
});

this.organizeCustomActions();
this.organizeControlActions();

};
Expand All @@ -84,6 +85,22 @@ Adaptation_behavior_hardwareOrganizer.prototype.organizeAction = function (actio
};


Adaptation_behavior_hardwareOrganizer.prototype.organizeCustomActions = function () {
let grapUtil = new GraphUtil();
let y = 15;
let x = 15;
let dx = 15;
let dy = 15;
var controlActions = grapUtil.getElementsByType(this.graph, this.modelName, "customAction");
controlActions.forEach((controlAction) => {
let controlActionGeometry = controlAction.getGeometry();
controlActionGeometry.x = this.actionX;
controlActionGeometry.y = this.actionY;
this.actionX += controlActionGeometry.width + dx ;
});
};


Adaptation_behavior_hardwareOrganizer.prototype.organizeControlActions = function () {
let grapUtil = new GraphUtil();
let y = 15;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { GraphUtil } from "@/assets/js/common/graphutil";

export function Adaptation_behavior_statesOrganizer(graph) {
this.graph = graph;
this.minActivityll=1000000;
this.maxActivityll=-1000000;
}

Adaptation_behavior_statesOrganizer.prototype.organizeComponents = function() {
Expand All @@ -18,33 +20,45 @@ Adaptation_behavior_statesOrganizer.prototype.organizeComponents = function() {
"activity",
"readAction",
"writeAction",
"customAction",
"controAction",
];
types.forEach((type) => {
var arr = grapUtil.getElementsByType(graph, modelName, type);
var arr = grapUtil.getElementsByType(graph, modelName, type);
arr.forEach((component) => {
components.push(component);
let inserted=false;
for (let i = 0; i < components.length; i++) {
if (component.getGeometry().y<components[i].getGeometry().y) {
components.splice(i, 0, component);
inserted=true;
break;
}
}
if (!inserted) {
components.push(component);
}
});
});

let y = 15;
let x = 15;
let dx = 20;
let dy = 30;
let dx = 10;
let dy = 15;

let llys = [];
llys["stateLifeLine"] = 0;
llys["actionLifeLine"] = 0;
llys["activityLifeLine"] = 0;
let llxs = [];
llxs["stateLifeLine"] = 0;
llxs["actionLifeLine"] = 0;
llxs["activityLifeLine"] = 0;

for (let index = 0; index < components.length; index++) {
let vertex = components[index];
let geometry = vertex.getGeometry();
// vertex.setStyle("dashed=1;fillColor=#000080;strokeColor=#aaaaaa;");
geometry.x = x;
geometry.y = y;
geometry.height = 25;

let lly = geometry.y + geometry.height;
let llx = geometry.x + geometry.width;

let relations = grapUtil.getRelationsFromSource(graph, modelName, vertex, [
"stateLifeLine",
Expand All @@ -53,15 +67,21 @@ Adaptation_behavior_statesOrganizer.prototype.organizeComponents = function() {
]);
relations.forEach((relation) => {
let child = relation.target;
let type = child.getAttribute("type");

let type = child.getAttribute("type");
let childGeometry = child.getGeometry();
childGeometry.x = x + geometry.width / 2 - childGeometry.width / 2;
childGeometry.y = lly + llys[type] + dy;
llys[type] += childGeometry.height + dy;
childGeometry.height=15;
childGeometry.y = y + geometry.height / 2 - childGeometry.height / 2;
childGeometry.x = llx + llxs[type] + dx;
childGeometry.width = dx*2;
llxs[type] += childGeometry.width + dx;

if(type=="activityLifeLine"){
this.minActivityll=Math.min(this.minActivityll, childGeometry.x);
this.maxActivityll=Math.max(this.maxActivityll, childGeometry.x+childGeometry.width);
}
});

x += geometry.width + dx;
y += geometry.height + 5;
}

this.organizeLifeLines("activityLifeLine",["stateLifeLine"]);
Expand Down Expand Up @@ -97,8 +117,22 @@ Adaptation_behavior_statesOrganizer.prototype.organizeLifeLines = function(
}
});
if(maxY>-1){
targetGeometry.height=maxY-minY;
targetGeometry.y = minY;
//targetGeometry.y = minY;
//targetGeometry.height=maxY-minY;
//targetGeometry.height=15;
}
if(target.getAttribute("type")=="actionLifeLine"){
//targetGeometry.y = this.minActivityll;
//targetGeometry.height=this.maxActivityll-this.minActivityll;
//targetGeometry.height=15;
}
if(target.getAttribute("type")=="activityLifeLine"){
targetGeometry.x=125;
targetGeometry.width=1000;
}
if(target.getAttribute("type")=="actionLifeLine"){
targetGeometry.x=125;
targetGeometry.width=1000;
}
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import { GraphUtil } from "@/assets/js/common/graphutil";

export function Adaptation_behavior_states_horizontalOrganizer(graph) {
this.graph = graph;
this.minActivityll=1000000;
this.maxActivityll=-1000000;
}

Adaptation_behavior_states_horizontalOrganizer.prototype.organizeComponents = function() {
let graph = this.graph;
let modelName = "adaptation_behavior_states";
let modelCell = graph.getModel().getCell(modelName);

let grapUtil = new GraphUtil();

var components = [];
var types = [
"initialState",
"state",
"activity",
"readAction",
"writeAction",
"customAction",
"controAction",
];
types.forEach((type) => {
var arr = grapUtil.getElementsByType(graph, modelName, type);
arr.forEach((component) => {
let inserted=false;
for (let i = 0; i < components.length; i++) {
if (component.getGeometry().x<components[i].getGeometry().x) {
components.splice(i, 0, component);
inserted=true;
break;
}
}
if (!inserted) {
components.push(component);
}
});
});

let y = 15;
let x = 15;
let dx = 5;
let dy = 30;

let llys = [];
llys["stateLifeLine"] = 0;
llys["actionLifeLine"] = 0;
llys["activityLifeLine"] = 0;

for (let index = 0; index < components.length; index++) {
let vertex = components[index];
let geometry = vertex.getGeometry();
// vertex.setStyle("dashed=1;fillColor=#000080;strokeColor=#aaaaaa;");
geometry.x = x;
geometry.y = y;

let lly = geometry.y + geometry.height;

let relations = grapUtil.getRelationsFromSource(graph, modelName, vertex, [
"stateLifeLine",
"actionLifeLine",
"activityLifeLine",
]);
relations.forEach((relation) => {
let child = relation.target;
let type = child.getAttribute("type");
let childGeometry = child.getGeometry();
childGeometry.x = x + geometry.width / 2 - childGeometry.width / 2;
childGeometry.y = lly + llys[type] + dy;
llys[type] += childGeometry.height + dy;

if(type=="activityLifeLine"){
this.minActivityll=Math.min(this.minActivityll, childGeometry.y);
this.maxActivityll=Math.max(this.maxActivityll, childGeometry.y+childGeometry.height);
}
});

x += geometry.width + dx;
}

this.organizeLifeLines("activityLifeLine",["stateLifeLine"]);
this.organizeLifeLines("actionLifeLine",["activityLifeLine"]);

graph.refresh();
};

Adaptation_behavior_states_horizontalOrganizer.prototype.organizeLifeLines = function(
targetType,
sourceTypes
) {
let graph = this.graph;
let modelName = "adaptation_behavior_states";
let modelCell = graph.getModel().getCell(modelName);
let grapUtil = new GraphUtil();

var targets = grapUtil.getElementsByType(graph, modelName, targetType);
targets.forEach((target) => {
let targetGeometry = target.getGeometry();
let targetLabel=target.getAttribute("label");
let minY=10000000;
let maxY=-1;
let relations = grapUtil.getRelationsToTarget(graph, modelName, target, sourceTypes);
relations.forEach((relation) => {
let source = relation.source;
let sourceGeometry = source.getGeometry();
if(minY > sourceGeometry.y){
minY = sourceGeometry.y;
}
if(maxY < sourceGeometry.y + sourceGeometry.height){
maxY = sourceGeometry.y + sourceGeometry.height;
}
});
if(maxY>-1){
targetGeometry.y = minY;
targetGeometry.height=maxY-minY;
}
if(target.getAttribute("type")=="actionLifeLine"){
targetGeometry.y = this.minActivityll;
targetGeometry.height=this.maxActivityll-this.minActivityll;
}
});
};
Loading