Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpa
libs
pucrio-tecgraf
Commits
5ffec91d
Commit
5ffec91d
authored
Dec 13, 2021
by
Bernardo Quaresma Dias
Browse files
Ajuste de identificação de modo 9002 e verficiação limites MV
MPA-1169
parent
cb88b8de
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib-wellbot-2_0.mpad
View file @
5ffec91d
...
...
@@ -2,9 +2,9 @@
-- Copyright (C) 2003-2021 Tecgraf/PUC-Rio, PETROBRAS S/A
-- Instituto Tecgraf <mpa@tecgraf.puc-rio.br>
-- Arquivo gerado pelo programa MPA
-- Verso: 6.
7
-- Verso: 6.
8
-- Arquivo: lib-wellbot.mpad
-- Data: 1
9
/1
1
/2021 10:
15:15
-- Data: 1
3
/1
2
/2021 10:
07:37
-- =============================================================================
MPA_5_0 = true
...
...
@@ -199,7 +199,7 @@ Diagrams = {
beforemsg = nil,
aftermsg = nil,
expressions = {
"ret_mon_topo\n== \"
ok
\"",
"ret_mon_topo\n== \"
alta
\"",
},
variables = {},
types = {
...
...
@@ -3173,7 +3173,7 @@ Diagrams = {
},
{
type = "Link",
description = "
V
",
description = "
F
",
from = 9,
to = 11,
x = {
...
...
@@ -3285,7 +3285,7 @@ Diagrams = {
},
{
type = "Link",
description = "
F
",
description = "
V
",
from = 9,
to = 56,
x = {
...
...
@@ -6745,9 +6745,9 @@ Diagrams = {
operation = "call",
},
xmin = 3480,
ymin = 8
8
60,
ymin = 8
4
60,
xmax = 3680,
ymax = 8
9
80,
ymax = 8
5
80,
},
{
type = "Choice",
...
...
@@ -6763,9 +6763,9 @@ Diagrams = {
member = "informar_aberta",
operation = "call",
},
xmin = 3
20
0,
xmin = 3
48
0,
ymin = 8860,
xmax = 3
40
0,
xmax = 3
68
0,
ymax = 8980,
},
{
...
...
@@ -7204,7 +7204,7 @@ Diagrams = {
beforemsg = nil,
aftermsg = nil,
expressions = {
"ret_mon_topo\n== \"
ok
\"",
"ret_mon_topo\n== \"
alta
\"",
},
variables = {},
types = {
...
...
@@ -7296,7 +7296,7 @@ Diagrams = {
type = "Jump",
description = "wait",
x = 3580,
y = 8
5
20,
y = 8
1
20,
r = 40,
},
{
...
...
@@ -7438,9 +7438,9 @@ Diagrams = {
operation = "call",
},
xmin = 3480,
ymin = 8
6
60,
ymin = 8
2
60,
xmax = 3680,
ymax = 8
7
80,
ymax = 8
3
80,
},
{
type = "Jump",
...
...
@@ -7453,7 +7453,7 @@ Diagrams = {
type = "Jump",
description = "check",
x = 3860,
y = 9
20
0,
y = 9
14
0,
r = 40,
},
{
...
...
@@ -7664,13 +7664,6 @@ Diagrams = {
xmax = 1440,
ymax = 8980,
},
{
type = "Jump",
description = "check",
x = 3300,
y = 8720,
r = 40,
},
{
type = "Command",
description = "executa\nmalha aberta\n[$object]",
...
...
@@ -7736,7 +7729,7 @@ Diagrams = {
},
{
type = "Link",
description = "
F
",
description = "
V
",
from = 77,
to = 37,
x = {
...
...
@@ -8032,7 +8025,7 @@ Diagrams = {
type = "Link",
description = "V",
from = 16,
to = 10
5
,
to = 10
4
,
x = {
4980,
5260,
...
...
@@ -8044,7 +8037,7 @@ Diagrams = {
},
{
type = "Link",
description = "
V
",
description = "
F
",
from = 77,
to = 41,
x = {
...
...
@@ -8458,26 +8451,26 @@ Diagrams = {
from = 56,
to = 55,
x = {
3
32
0,
35
4
0,
3
58
0,
35
8
0,
},
y = {
8920,
8
9
20,
8
5
20,
},
},
{
type = "Link",
description = "V",
from = 56,
to =
104
,
to =
26
,
x = {
3
30
0,
3
30
0,
3
58
0,
3
86
0,
},
y = {
89
0
0,
8
7
20,
89
2
0,
8
9
20,
},
},
{
...
...
@@ -8901,7 +8894,7 @@ Diagrams = {
to = 56,
x = {
3020,
3
30
0,
3
58
0,
},
y = {
8520,
...
...
@@ -9002,8 +8995,8 @@ Diagrams = {
3580,
},
y = {
8
7
20,
8
5
20,
8
3
20,
8
1
20,
},
},
{
...
...
@@ -9016,8 +9009,8 @@ Diagrams = {
3580,
},
y = {
8
9
20,
8
7
20,
8
5
20,
8
3
20,
},
},
{
...
...
@@ -9030,7 +9023,7 @@ Diagrams = {
3860,
},
y = {
9
20
0,
9
14
0,
8920,
},
},
...
...
@@ -9307,7 +9300,7 @@ Diagrams = {
{
type = "Link",
description = nil,
from = 10
5
,
from = 10
4
,
to = 54,
x = {
5260,
...
...
lib-wellbot-2_0.mpam
View file @
5ffec91d
...
...
@@ -566,47 +566,51 @@ class{ id = "aux_wellbot_PID", name = "WellBot: PID", group = "WellBot",
results = {
},
code = [====[ function(self)
local mv_calc, delta_mv_calc
local tipo = self.tipo
local mv, mv_max, mv_min, mv_dif = self:informar_mv_engenharia()
if mv_dif == 0 then
self.variacao_mv = 0
return
end
local tipo = self.tipo
local mv_calc, delta_mv_calc
if tipo == 'pos' then
mv_calc = self:calcular_mv()
if mv_max and mv_min then
mv_calc = math.max(mv_min, math.min(mv_max, mv_calc))
local mv_normal = ((mv-mv_min)/mv_dif)*100
self.atualizacao_mv = mv_calc
--self:ajustar_mv(mv_calc)
if tipo == 'pos' then
mv_calc = mv
else
mv_calc = math.max(0, math.min(100, mv_calc))
self.atualizacao_mv = mv_calc
--self:ajustar_mv(mv_calc)
end
else
delta_mv_calc = self:calcular_delta_mv()
local delta_max = self.delta_max
if delta_max then
delta_mv_calc = limitar(delta_mv_calc,-delta_max,delta_max)
self.variacao_mv = 0
delta_mv_calc = 0
end
local nova_mv = mv + delta_mv_calc
if mv_max and mv_min then
nova_mv = math.max(0, math.min(100, nova_mv))
local mv_normal = ((mv-mv_min)/mv_dif)*100
delta_mv_calc = nova_mv - mv
self.variacao_mv = delta_mv_calc
--self:ajustar_mv(mv_normal)
else
if tipo == 'pos' then
mv_calc = self:calcular_mv()
if mv_max and mv_min then
mv_calc = math.max(mv_min, math.min(mv_max, mv_calc))
local mv_normal = ((mv-mv_min)/mv_dif)*100
self.atualizacao_mv = mv_calc
--self:ajustar_mv(mv_calc)
else
mv_calc = math.max(0, math.min(100, mv_calc))
self.atualizacao_mv = mv_calc
--self:ajustar_mv(mv_calc)
end
else
--self:ajustar_mv(nova_mv)
self.variacao_mv = delta_mv_calc
delta_mv_calc = self:calcular_delta_mv()
local delta_max = self.delta_max
if delta_max then
delta_mv_calc = limitar(delta_mv_calc,-delta_max,delta_max)
end
local nova_mv = mv + delta_mv_calc
if mv_max and mv_min then
nova_mv = math.max(0, math.min(100, nova_mv))
local mv_normal = ((mv-mv_min)/mv_dif)*100
delta_mv_calc = nova_mv - mv
self.variacao_mv = delta_mv_calc
--self:ajustar_mv(mv_normal)
else
--self:ajustar_mv(nova_mv)
self.variacao_mv = delta_mv_calc
end
end
end
...
...
@@ -712,13 +716,12 @@ class{ id = "aux_wellbot_PID", name = "WellBot: PID", group = "WellBot",
local ti = self:informar_ti()
local td = self:informar_td()
if not self.t_1 then -- na primeira execução não tem como calcular
return self:informar_mv()
end
local dt = self.t_0 - self.t_1
if dt == 0 then -- tempo muito curto para a execução
return self:informar_mv()
end
...
...
@@ -726,7 +729,7 @@ class{ id = "aux_wellbot_PID", name = "WellBot: PID", group = "WellBot",
if not kp then -- sem constante proporcional, nao tem como calcular
return self:informar_mv()
end
local ac
if (acao == 0) then -- direta
ac = 1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment