Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Requirement Formalization Tool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thodoris Nestoridis
Requirement Formalization Tool
Commits
225aa0cc
Commit
225aa0cc
authored
Mar 22, 2023
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugs
parent
a80a0ca2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
14 deletions
+37
-14
prefix-details.component.ts
...app/components/prefix-details/prefix-details.component.ts
+16
-1
requirements_views.py
.../reqman/apps/reqtool/rest_api/views/requirements_views.py
+21
-13
No files found.
reqtool/ReqmanAngular11/src/app/components/prefix-details/prefix-details.component.ts
View file @
225aa0cc
...
@@ -245,6 +245,12 @@ export class PrefixDetailsComponent implements OnInit {
...
@@ -245,6 +245,12 @@ export class PrefixDetailsComponent implements OnInit {
updatePrefix
():
any
{
updatePrefix
():
any
{
let
temp
;
if
(
this
.
prefixs
[
0
].
id
>
this
.
prefixs
[
1
].
id
){
this
.
prefixs
[
0
].
id
=
temp
this
.
prefixs
[
0
].
id
=
this
.
prefixs
[
1
].
id
this
.
prefixs
[
1
].
id
=
temp
}
this
.
currentprefix
.
prefix
=
this
.
simpleprefixControl
.
value
;
this
.
currentprefix
.
prefix
=
this
.
simpleprefixControl
.
value
;
this
.
currentprefix
.
system_fun_item
=
this
.
subjectsControl
.
value
;
this
.
currentprefix
.
system_fun_item
=
this
.
subjectsControl
.
value
;
this
.
currentprefix
.
state_or_verb
=
this
.
verbsControl
.
value
;
this
.
currentprefix
.
state_or_verb
=
this
.
verbsControl
.
value
;
...
@@ -273,6 +279,16 @@ export class PrefixDetailsComponent implements OnInit {
...
@@ -273,6 +279,16 @@ export class PrefixDetailsComponent implements OnInit {
if
(
this
.
numericalis2DivVisible
)
{
this
.
secondcurrentprefix
.
prefix_mumerical_units
=
this
.
prefix_mumerical2_unitsControl
.
value
;
}
else
{
this
.
secondcurrentprefix
.
prefix_mumerical_units
=
''
}
if
(
this
.
numericalis2DivVisible
)
{
this
.
secondcurrentprefix
.
prefix_mumerical_units
=
this
.
prefix_mumerical2_unitsControl
.
value
;
}
else
{
this
.
secondcurrentprefix
.
prefix_mumerical_units
=
''
}
if
(
!
this
.
numericalis2DivVisible
)
{
this
.
secondcurrentprefix
.
prefix_numerical
=
null
}
if
(
!
this
.
numericalis2DivVisible
)
{
this
.
secondcurrentprefix
.
prefix_numerical
=
null
}
this
.
secondcurrentprefix
.
item_function_flow_statevalue
=
this
.
objects2Control
.
value
;
this
.
secondcurrentprefix
.
item_function_flow_statevalue
=
this
.
objects2Control
.
value
;
}
else
{
this
.
secondcurrentprefix
.
prefix
=
"A"
;
this
.
secondcurrentprefix
.
system_fun_item
=
"A"
;
this
.
secondcurrentprefix
.
state_or_verb
=
"A"
;
this
.
secondcurrentprefix
.
prefix_quantifier
=
" "
;
this
.
secondcurrentprefix
.
prefix_mumerical_units
=
" "
;
this
.
secondcurrentprefix
.
prefix_numerical
=
null
;
this
.
secondcurrentprefix
.
item_function_flow_statevalue
=
"A"
;
this
.
secondcurrentprefix
.
simple_prefix
=
" "
;
}
this
.
prefixService
.
update
(
this
.
route
.
snapshot
.
params
.
id
,
this
.
prefixs
[
1
].
id
,
this
.
secondcurrentprefix
)
this
.
prefixService
.
update
(
this
.
route
.
snapshot
.
params
.
id
,
this
.
prefixs
[
1
].
id
,
this
.
secondcurrentprefix
)
.
subscribe
(
.
subscribe
(
response
=>
{
response
=>
{
...
@@ -282,7 +298,6 @@ export class PrefixDetailsComponent implements OnInit {
...
@@ -282,7 +298,6 @@ export class PrefixDetailsComponent implements OnInit {
this
.
notifier
.
notify
(
"warning"
,
(
"PREFIX "
+
JSON
.
stringify
(
error
[
"error"
][
'detail'
])));
this
.
notifier
.
notify
(
"warning"
,
(
"PREFIX "
+
JSON
.
stringify
(
error
[
"error"
][
'detail'
])));
});
});
}
}
}
getchoices
(
prefix_group
:
any
):
void
{
getchoices
(
prefix_group
:
any
):
void
{
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/requirements_views.py
View file @
225aa0cc
...
@@ -198,6 +198,9 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
...
@@ -198,6 +198,9 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
#Custom actions when PUT
#Custom actions when PUT
def
perform_update
(
self
,
serializer
):
def
perform_update
(
self
,
serializer
):
instance
=
serializer
.
validated_data
instance
=
serializer
.
validated_data
if
(
instance
[
'prefix'
]
==
'A'
and
instance
[
'system_fun_item'
]
==
'A'
and
instance
[
'state_or_verb'
]
==
'A'
and
instance
[
'item_function_flow_statevalue'
]
==
'A'
):
serializer
.
save
(
prefix
=
''
,
system_fun_item
=
''
,
state_or_verb
=
''
,
item_function_flow_statevalue
=
''
)
return
#add data in thn Model BoilerplateData
#add data in thn Model BoilerplateData
quantifier_instance
,
numunit_instance
=
[[
""
],
[
""
]]
quantifier_instance
,
numunit_instance
=
[[
""
],
[
""
]]
numinstance
=
''
numinstance
=
''
...
@@ -243,6 +246,7 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
...
@@ -243,6 +246,7 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
if
(
instance
[
'logic_connective'
]
!=
''
):
if
(
instance
[
'logic_connective'
]
!=
''
):
prefixstring
=
pr
+
' '
+
instance
[
'logic_connective'
]
+
' '
prefixstring
=
pr
+
' '
+
instance
[
'logic_connective'
]
+
' '
self
.
previous_values
.
append
(
prefixstring
)
self
.
previous_values
.
append
(
prefixstring
)
serializer
.
save
(
simple_prefix
=
prefix_choices
)
else
:
else
:
boildata
.
update
(
prefix_data
=
pr
)
boildata
.
update
(
prefix_data
=
pr
)
serializer
.
save
(
simple_prefix
=
prefix_choices
)
serializer
.
save
(
simple_prefix
=
prefix_choices
)
...
@@ -409,15 +413,15 @@ def getExtractedProperty(group_pk):
...
@@ -409,15 +413,15 @@ def getExtractedProperty(group_pk):
mains_to_be_properties
=
[
'M1'
,
'M2'
,
'M3'
,
'M4'
,
'M5'
,
'M6'
,
'M7'
,
'M10'
]
mains_to_be_properties
=
[
'M1'
,
'M2'
,
'M3'
,
'M4'
,
'M5'
,
'M6'
,
'M7'
,
'M10'
]
if
(
maindata
[
0
][
'main_choices'
]
in
mains_to_be_properties
):
if
(
maindata
[
0
][
'main_choices'
]
in
mains_to_be_properties
):
if
(
maindata
[
0
][
'shall'
]
==
'shall'
):
if
(
maindata
[
0
][
'shall'
]
==
'shall'
):
mainverbsub
=
maindata
[
0
][
'verb'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'('
+
maindata
[
0
][
'sys_fun_inter'
]
.
split
(
':'
)[
-
1
]
.
strip
()
mainverbsub
=
maindata
[
0
][
'verb'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'_'
else
:
else
:
mainverbsub
=
'!'
+
maindata
[
0
][
'verb'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'('
+
maindata
[
0
][
'sys_fun_inter'
]
.
split
(
':'
)[
-
1
]
.
strip
()
mainverbsub
=
'!'
+
maindata
[
0
][
'verb'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'('
+
maindata
[
0
][
'sys_fun_inter'
]
.
split
(
':'
)[
-
1
]
.
strip
()
if
(
maindata
[
0
][
'statevalue_system_connection_stateset'
]
==
''
and
(
maindata
[
0
][
'numerical'
]
==
None
or
maindata
[
0
][
'numerical'
]
==
''
)):
if
(
maindata
[
0
][
'statevalue_system_connection_stateset'
]
==
''
and
(
maindata
[
0
][
'numerical'
]
==
None
or
maindata
[
0
][
'numerical'
]
==
''
)):
main_predicate
=
mainverbsub
+
',
'
+
maindata
[
0
][
'flow_function_interface_item_system_state_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
main_predicate
=
mainverbsub
+
maindata
[
0
][
'sys_fun_inter'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'(
'
+
maindata
[
0
][
'flow_function_interface_item_system_state_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
elif
(
maindata
[
0
][
'numerical'
]
==
None
or
maindata
[
0
][
'numerical'
]
==
''
):
elif
(
maindata
[
0
][
'numerical'
]
==
None
or
maindata
[
0
][
'numerical'
]
==
''
):
main_predicate
=
mainverbsub
+
','
+
maindata
[
0
][
'flow_function_interface_item_system_state_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
',
'
+
maindata
[
0
][
'statevalue_system_connection_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
main_predicate
=
mainverbsub
+
maindata
[
0
][
'flow_function_interface_item_system_state_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'(
'
+
maindata
[
0
][
'statevalue_system_connection_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
else
:
else
:
main_predicate
=
mainverbsub
+
','
+
maindata
[
0
][
'flow_function_interface_item_system_state_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
maindata
[
0
][
'quantifier'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
maindata
[
0
][
'numerical'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
maindata
[
0
][
'mumerical_units'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
main_predicate
=
mainverbsub
+
maindata
[
0
][
'sys_fun_inter'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'('
+
maindata
[
0
][
'flow_function_interface_item_system_state_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')&('
+
maindata
[
0
][
'flow_function_interface_item_system_state_stateset'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
maindata
[
0
][
'quantifier'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
maindata
[
0
][
'numerical'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
maindata
[
0
][
'mumerical_units'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
if
(
suffixdata
!=
[]):
if
(
suffixdata
!=
[]):
#update main predicate with the suffix options
#update main predicate with the suffix options
if
(
suffixdata
[
0
][
's_choices'
]
!=
''
):
if
(
suffixdata
[
0
][
's_choices'
]
!=
''
):
...
@@ -463,26 +467,30 @@ def getExtractedProperty(group_pk):
...
@@ -463,26 +467,30 @@ def getExtractedProperty(group_pk):
if
(
prefixdata
!=
[]):
if
(
prefixdata
!=
[]):
#add code for complex Prefix
#add code for complex Prefix
if
(
prefixdata
[
0
][
'state_or_verb'
]
!=
''
):
if
(
prefixdata
[
0
][
'state_or_verb'
]
!=
''
):
prefixverbsub
=
prefixdata
[
0
][
'state_or_verb'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'('
+
prefixdata
[
0
][
'system_fun_item'
]
.
split
(
':'
)[
-
1
]
.
strip
()
prefixverbsub
=
prefixdata
[
0
][
'state_or_verb'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'_'
+
prefixdata
[
0
][
'system_fun_item'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'('
if
(
prefixdata
[
0
][
'prefix_numerical'
]
==
None
or
prefixdata
[
0
][
'prefix_numerical'
]
==
''
):
if
(
prefixdata
[
0
][
'prefix_numerical'
]
==
None
or
prefixdata
[
0
][
'prefix_numerical'
]
==
''
):
prefix
_predicate
=
prefixverbsub
+
','
+
prefixdata
[
0
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
prefix
1_predicate
=
prefixverbsub
+
prefixdata
[
0
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
else
:
else
:
prefix_predicate
=
prefixverbsub
+
','
+
prefixdata
[
0
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
0
][
'prefix_quantifier'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
0
][
'prefix_numerical'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
0
][
'prefix_mumerical_units'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
prefix1_predicate
=
'('
+
prefixverbsub
+
prefixdata
[
0
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')&('
+
prefixdata
[
0
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
0
][
'prefix_quantifier'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
0
][
'prefix_numerical'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
0
][
'prefix_mumerical_units'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'))'
prefix_predicate
=
prefix1_predicate
if
(
prefixdata
[
1
][
'state_or_verb'
]
!=
''
):
if
(
prefixdata
[
1
][
'state_or_verb'
]
!=
''
):
prefix2verbsub
=
prefixdata
[
1
][
'state_or_verb'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'('
+
prefixdata
[
1
][
'system_fun_item'
]
.
split
(
':'
)[
-
1
]
.
strip
()
#prefix2verbsub=prefixdata[1]['state_or_verb'].split(':')[-1].strip() + '('+ prefixdata[1]['system_fun_item'].split(':')[-1].strip()
prefix2verbsub
=
prefixdata
[
1
][
'state_or_verb'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'_'
+
prefixdata
[
1
][
'system_fun_item'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'('
if
(
prefixdata
[
1
][
'prefix_numerical'
]
==
None
or
prefixdata
[
1
][
'prefix_numerical'
]
==
''
):
if
(
prefixdata
[
1
][
'prefix_numerical'
]
==
None
or
prefixdata
[
1
][
'prefix_numerical'
]
==
''
):
prefix2_predicate
=
prefix2verbsub
+
','
+
prefixdata
[
1
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
prefix2_predicate
=
prefix2verbsub
+
prefixdata
[
1
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
else
:
else
:
prefix2_predicate
=
prefix2verbsub
+
','
+
prefixdata
[
1
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
1
][
'prefix_quantifier'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
1
][
'prefix_numerical'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
1
][
'prefix_mumerical_units'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')'
#prefix2_predicate=prefix2verbsub + ',' + prefixdata[1]['item_function_flow_statevalue'].split(':')[-1].strip()+' '+ prefixdata[1]['prefix_quantifier'].split(':')[-1].strip() +' '+ prefixdata[1]['prefix_numerical'].split(':')[-1].strip() +' '+ prefixdata[1]['prefix_mumerical_units'].split(':')[-1].strip() +')'
prefix2_predicate
=
'('
+
prefix2verbsub
+
prefixdata
[
1
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
')&('
+
prefixdata
[
1
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
1
][
'prefix_quantifier'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
1
][
'prefix_numerical'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
' '
+
prefixdata
[
1
][
'prefix_mumerical_units'
]
.
split
(
':'
)[
-
1
]
.
strip
()
+
'))'
if
(
prefixdata
[
0
][
'logic_connective'
]
==
'OR'
):
if
(
prefixdata
[
0
][
'logic_connective'
]
==
'OR'
):
prefix_predicate
=
'('
+
prefix
_predicate
+
' |
'
+
prefix2_predicate
+
')'
prefix_predicate
=
'('
+
prefix
1_predicate
+
' | @
'
+
prefix2_predicate
+
')'
elif
(
prefixdata
[
0
][
'logic_connective'
]
==
'AND'
):
elif
(
prefixdata
[
0
][
'logic_connective'
]
==
'AND'
):
prefix_predicate
=
'('
+
prefix
_predicate
+
' &
'
+
prefix2_predicate
+
')'
prefix_predicate
=
'('
+
prefix
1_predicate
+
' & @
'
+
prefix2_predicate
+
')'
if
(
prefixdata
[
0
][
'simple_prefix'
]
==
'P1'
):
if
(
prefixdata
[
0
][
'simple_prefix'
]
==
'P1'
):
p1main
=
'( '
+
main_predicate
+
' | ! @('
+
main_predicate
+
' S '
+
prefix_predicate
+
')'
+
')'
p1main
=
'( '
+
main_predicate
+
' | ! @('
+
main_predicate
+
' S '
+
prefix_predicate
+
')'
+
')'
return
p1main
return
p1main
elif
(
prefixdata
[
0
][
'simple_prefix'
]
==
'P2'
):
elif
(
prefixdata
[
0
][
'simple_prefix'
]
==
'P2'
):
p2main
=
'('
+
main_predicate
+
' | (! @('
+
main_predicate
+
' & @(∃ temp, !'
+
prefix_predicate
+
' S '
+
prefixverbsub
+
',temp) & !(temp='
+
(
prefix_predicate
.
replace
(
prefixverbsub
,
''
))
.
strip
(
')'
)
.
strip
(
','
)
+
')'
'))'
+
')))'
p2main
=
'('
+
main_predicate
+
' | (! @('
+
prefix_predicate
+
' & @(∃ temp, !('
+
prefix1_predicate
+
' S ('
+
prefixverbsub
+
'temp) & !(temp='
+
prefixdata
[
0
][
'item_function_flow_statevalue'
]
.
split
(
':'
)[
-
1
]
.
strip
(
)
+
')'
'))'
+
')))'
return
p2main
return
p2main
elif
(
prefixdata
[
0
][
'simple_prefix'
]
==
'P3'
):
elif
(
prefixdata
[
0
][
'simple_prefix'
]
==
'P3'
):
p3main
=
'('
+
main_predicate
+
' | (! @('
+
prefix_predicate
+
')'
p3main
=
'('
+
main_predicate
+
' | (! @('
+
prefix_predicate
+
')'
...
...
Write
Preview
Markdown
is supported
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