Commit 1267ddbb authored by Bernardo Quaresma Dias's avatar Bernardo Quaresma Dias
Browse files

Atualização de ventgas 4_0

INSTMPA-933
parent 2a7e2c6b
......@@ -4,7 +4,7 @@
-- Arquivo gerado pelo programa MPA
-- Verso: 6.6
-- Arquivo: lib-ventgas.mpad
-- Data: 18/08/2021 21:08:18
-- Data: 20/09/2021 20:10:42
-- =============================================================================
MPA_5_0 = true
......@@ -41,10 +41,10 @@ Diagrams = {
is_ret = nil,
},
{
name = "zonarisco",
type = "STRING",
name = "risco_apoio",
type = "BOOLEAN",
list = false,
value = "nil",
value = "false",
comment = nil,
is_arg = nil,
is_ret = nil,
......@@ -98,9 +98,9 @@ Diagrams = {
operation = "get",
},
xmin = 3740,
ymin = 5060,
ymin = 4860,
xmax = 3940,
ymax = 5180,
ymax = 4980,
},
{
type = "Command",
......@@ -116,9 +116,9 @@ Diagrams = {
functionid = "esperar",
},
xmin = 3740,
ymin = 4860,
ymin = 4660,
xmax = 3940,
ymax = 4980,
ymax = 4780,
},
{
type = "Command",
......@@ -129,7 +129,7 @@ Diagrams = {
aftermsg = nil,
expressions = {},
variables = {
"ret_zonasvent",
"zonasvent",
},
classid = "mod_ventgas_monZonaVent",
objname = "mon_zonavent",
......@@ -149,7 +149,7 @@ Diagrams = {
beforemsg = nil,
aftermsg = nil,
expressions = {
"{prot_apoio;'prot-apoio';zonarisco;ret_zonasvent}",
"{prot_apoio;'prot-apoio';zonasvent;risco_apoio}",
"';'",
},
variables = {
......@@ -234,41 +234,133 @@ Diagrams = {
xmax = 3660,
ymax = 5180,
},
{
type = "Foreach",
description = nil,
action = {
_switch = "LISTITERATION",
variable = "pt_risco_zona",
index = "idx_zona",
list = "l_risco_zona",
listtype = "BOOLEAN_POINT",
},
xmin = 4300,
ymin = 5060,
xmax = 4500,
ymax = 5180,
},
{
type = "Command",
description = "informa\n$results\n[$object]",
description = "avalia\n$variable_1",
action = {
_switch = "EXPRESSION",
beforemsg = nil,
aftermsg = nil,
expressions = {
"string.match(zonasvent,idx_zona) ~= nil",
},
variables = {
"vent_zona",
},
types = {
"BOOLEAN",
},
islist = {
false,
},
},
xmin = 4300,
ymin = 4860,
xmax = 4500,
ymax = 4980,
},
{
type = "Command",
description = "$variable_1\n= $expression_1",
action = {
_switch = "EXPRESSION",
beforemsg = nil,
aftermsg = nil,
expressions = {
"false",
},
variables = {
"risco_apoio",
},
types = {
"BOOLEAN",
},
islist = {
false,
},
},
xmin = 4020,
ymin = 4860,
xmax = 4220,
ymax = 4980,
},
{
type = "Command",
description = "obtm\n$results\n[$object]",
action = {
_switch = "OBJECTCALL",
beforemsg = nil,
aftermsg = nil,
expressions = {},
variables = {
"l_zonasapoio",
"l_risco_zona",
},
classid = "mod_ventgas_ProtNavioApoio",
objname = "prot_apoio",
member = "eval_zonas_apoio",
operation = "call",
member = "l_ind_risco_zona",
operation = "get",
},
xmin = 4020,
xmin = 3460,
ymin = 4860,
xmax = 4220,
xmax = 3660,
ymax = 4980,
},
{
type = "Foreach",
type = "Command",
description = "obtm\n$results\n[$object]",
action = {
_switch = "OBJECTCALL",
beforemsg = nil,
aftermsg = nil,
expressions = {},
variables = {
"l_navio_zona",
},
classid = "mod_ventgas_ProtNavioApoio",
objname = "prot_apoio",
member = "l_ind_navio_apoio_zona",
operation = "get",
},
xmin = 3460,
ymin = 4660,
xmax = 3660,
ymax = 4780,
},
{
type = "Command",
description = nil,
action = {
_switch = "LISTITERATION",
variable = "zonaapoio",
index = nil,
list = "l_zonasapoio",
listtype = "INTEGER",
_switch = "OBJECTCALL",
beforemsg = nil,
aftermsg = nil,
expressions = {},
variables = {
"navio_zona",
},
classid = "BOOLEAN_POINT",
objname = "l_navio_zona[idx_zona]",
member = "read",
operation = "call",
},
xmin = 4300,
ymin = 4860,
ymin = 4660,
xmax = 4500,
ymax = 4980,
ymax = 4780,
},
{
type = "Command",
......@@ -278,13 +370,13 @@ Diagrams = {
beforemsg = nil,
aftermsg = nil,
expressions = {
"string.match(ret_zonasvent,zonaapoio)",
"vent_zona and navio_zona",
},
variables = {
"zonarisco",
"risco_zona",
},
types = {
"STRING",
"BOOLEAN",
},
islist = {
false,
......@@ -297,61 +389,67 @@ Diagrams = {
},
{
type = "Command",
description = "$variable_1\n= $expression_1",
description = "atualiza\n$variable_1",
action = {
_switch = "EXPRESSION",
beforemsg = nil,
aftermsg = nil,
expressions = {
"nil",
"risco_apoio or risco_zona",
},
variables = {
"zonarisco",
"risco_apoio",
},
types = {
"STRING",
"BOOLEAN",
},
islist = {
false,
},
},
xmin = 4300,
ymin = 5060,
ymin = 4060,
xmax = 4500,
ymax = 5180,
ymax = 4180,
},
{
type = "Choice",
description = nil,
type = "Command",
description = "atualiza\n$variable_1\ne $variable_2",
action = {
_switch = "EXPRESSION",
beforemsg = nil,
aftermsg = nil,
expressions = {
"zonarisco\n== nil",
"risco_apoio",
"zonasvent",
},
variables = {
"risco_apoio_ant",
"zonasvent_ant",
},
variables = {},
types = {
"BOOLEAN",
"STRING",
},
islist = {
false,
false,
},
},
xmin = 4300,
ymin = 4660,
xmax = 4500,
ymax = 4780,
xmin = 3740,
ymin = 5060,
xmax = 3940,
ymax = 5180,
},
{
type = "Choice",
description = nil,
description = "atualiza\nregistro?",
action = {
_switch = "EXPRESSION",
beforemsg = nil,
aftermsg = nil,
expressions = {
"zonarisco\n~= nil",
"(risco_apoio ~= risco_apoio_ant) or\n(zonasvent ~= zonasvent_ant)",
},
variables = {},
types = {
......@@ -366,6 +464,27 @@ Diagrams = {
xmax = 4780,
ymax = 5180,
},
{
type = "Command",
description = nil,
action = {
_switch = "OBJECTCALL",
beforemsg = nil,
aftermsg = nil,
expressions = {
"risco_zona",
},
variables = {},
classid = "BOOLEAN_POINT",
objname = "pt_risco_zona",
member = "write",
operation = "call",
},
xmin = 4300,
ymin = 4260,
xmax = 4500,
ymax = 4380,
},
},
Links = {
{
......@@ -406,8 +525,8 @@ Diagrams = {
3840,
},
y = {
5120,
4920,
4720,
},
},
{
......@@ -420,7 +539,7 @@ Diagrams = {
4120,
},
y = {
4920,
4720,
5120,
},
},
......@@ -428,7 +547,7 @@ Diagrams = {
type = "Link",
description = nil,
from = 5,
to = 11,
to = 13,
x = {
4120,
4120,
......@@ -456,7 +575,7 @@ Diagrams = {
type = "Link",
description = nil,
from = 2,
to = 3,
to = 19,
x = {
3840,
3840,
......@@ -498,35 +617,105 @@ Diagrams = {
type = "Link",
description = nil,
from = 10,
to = 3,
to = 14,
x = {
3560,
3840,
3560,
},
y = {
5120,
4920,
},
},
{
type = "Link",
description = "I",
from = 11,
to = 12,
x = {
4400,
4400,
},
y = {
5120,
4920,
},
},
{
type = "Link",
description = nil,
description = "F",
from = 11,
to = 14,
to = 20,
x = {
4120,
4400,
4680,
},
y = {
5120,
5120,
},
},
{
type = "Link",
description = "V",
from = 20,
to = 6,
x = {
4680,
4680,
},
y = {
5120,
4920,
},
},
{
type = "Link",
description = "F",
from = 20,
to = 8,
x = {
4680,
4940,
},
y = {
5120,
5120,
},
},
{
type = "Link",
description = "I",
from = 12,
description = nil,
from = 14,
to = 15,
x = {
3560,
3560,
},
y = {
4920,
4720,
},
},
{
type = "Link",
description = nil,
from = 15,
to = 3,
x = {
3560,
3840,
},
y = {
4720,
4920,
},
},
{
type = "Link",
description = nil,
from = 12,
to = 16,
x = {
4400,
4400,
......@@ -539,22 +728,22 @@ Diagrams = {
{
type = "Link",
description = nil,
from = 14,
to = 12,
from = 13,
to = 11,
x = {
4400,
4120,
4400,
},
y = {
5120,
4920,
5120,
},
},
{
type = "Link",
description = "V",
from = 15,
to = 13,
description = nil,
from = 16,
to = 17,
x = {
4400,
4400,
......@@ -566,26 +755,26 @@ Diagrams = {
},
{
type = "Link",
description = "F",
from = 12,
to = 16,
description = nil,
from = 17,
to = 21,
x = {
4400,
4680,
4400,
},
y = {
4920,
5120,
4520,
4320,
},
},
{
type = "Link",
description = "V",
from = 16,
to = 6,
description = nil,
from = 19,
to = 3,
x = {
4680,
4680,
3840,
3840,
},
y = {
5120,
......@@ -594,16 +783,16 @@ Diagrams = {
},
{
type = "Link",
description = "F",
from = 16,
to = 8,
description = nil,
from = 21,
to = 18,
x = {
4680,
4940,
4400,
4400,
},
y = {
5120,
5120,
4320,
4120,
},
},
},
......@@ -639,8 +828,8 @@ Diagrams = {
},
y = {
5220,
4440,
4440,
4040,
4040,
5220,
},
},
......
......@@ -1087,31 +1087,18 @@ class{ id = "mod_ventgas_ProtNavioApoio", name = "VentGas: Prot. Navio Apoio", g
de Mon. de Zona de Vent associada.
]],
},
{ id = "l_ind_risco_zona" , name = "Ind. Risco em Zona" , type = "BOOLEAN_POINT[]", access = "g",
description = [[
Lista de indicadores de risco de vent na direção de navio de apoio em zona.
O índice nessa lista deve corresponder aos índices utilizados na configuração
de início e fim de zona na Monitoração de Zona de Vent.
]],
},
{ id = "t_intervalo_s" , name = "Intervalo (s)" , type = "REAL", access = "g",
description = [[Intervalo entre execuções da monitoração.]],
},
},
methods = {
{ id = "eval_zonas_apoio", name = "Avaliar Zonas Navio de Apoio",
description = [[]],
parameters = {
},
results = {
{ name = "Zonas Apoio", type = "INTEGER[]" },
},
code = [===[ function(self)
local zonas_apoio = {}
local inds_navio = getattribute(self, 'l_ind_navio_apoio_zona')
for i, ind_navio in ipairs(inds_navio) do
if ind_navio:read() then
zonas_apoio[#zonas_apoio+1] = i
end
end
return zonas_apoio
end ]===]
},
},
}
......@@ -4,7 +4,7 @@
-- Arquivo gerado pelo programa MPA
-- Verso: 6.6
-- Arquivo: lib-ventgas_tst.mpad
-- Data: 16/08/2021 10:43:08
-- Data: 20/08/2021 15:07:43
-- =============================================================================
MPA_5_0 = true
......@@ -50,7 +50,7 @@ Diagrams = {
action = {
_switch = "LISTITERATION",
variable = "pt_ret_risco",
index = nil,
index = "idx_ret_risco",
list = "l_rets_risco",
listtype = "INTEGER_POINT",
},
......@@ -120,13 +120,6 @@ Diagrams = {
xmax = 4760,
ymax = 5780,
},
{
type = "Fork",
description = nil,
x = 4660,
y = 5340,
r = 40,
},
{
type = "Foreach",
description = nil,
......@@ -137,17 +130,17 @@ Diagrams = {
list = "ret_vals",
listtype = "INTEGER",
},
xmin = 4560,
ymin = 5100,
xmax = 4760,
ymax = 5220,