|
@@ -1388,6 +1388,26 @@ function getVariable (function_obj, search) {
|
|
|
|
|
|
if (search.instance == "expression"
|
|
|
&& search.type == "const") {
|
|
|
+ if (search.value === true) {
|
|
|
+ var obj = new Models.VariableValueMenu(
|
|
|
+ VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
|
+ LocalizedStrings.getUI('logic_value_true'),
|
|
|
+ null,
|
|
|
+ null,
|
|
|
+ true
|
|
|
+ );
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
+ if (search.value === false) {
|
|
|
+ var obj = new Models.VariableValueMenu(
|
|
|
+ VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
|
+ LocalizedStrings.getUI('logic_value_false'),
|
|
|
+ null,
|
|
|
+ null,
|
|
|
+ true
|
|
|
+ );
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
var obj = new Models.VariableValueMenu(
|
|
|
VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
|
search.value,
|
|
@@ -1484,6 +1504,19 @@ function getVariable (function_obj, search) {
|
|
|
obj.function_called = program_obj.functions[i];
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // Se ainda não foi encontrada, procurar na biblioteca do iVProg:
|
|
|
+ if (!obj.function_called) {
|
|
|
+ for (var i = 0; i < window.system_functions.length; i++) {
|
|
|
+ if (search.value.split(".")[1] && search.value.split(".")[1]
|
|
|
+ == window.system_functions[i].identifier) {
|
|
|
+ obj.function_called = window.system_functions[i];
|
|
|
+ } else if (search.value == window.system_functions[i].identifier) {
|
|
|
+ obj.function_called = window.system_functions[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
obj.parameters_list = [];
|
|
|
|
|
|
for (var i = 0; i < search.params.length; i++) {
|
|
@@ -1558,7 +1591,19 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
|
if (program_obj.functions[j].name == parsed[i].value) {
|
|
|
funcao = program_obj.functions[j];
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Se ainda não encontrou, procurar na biblioteca do iVProg:
|
|
|
+ if (!funcao) {
|
|
|
+ for (var j = 0; j < window.system_functions.length; j++) {
|
|
|
+ if (parsed[i].value.split(".")[1] && parsed[i].value.split(".")[1]
|
|
|
+ == window.system_functions[j].identifier) {
|
|
|
+ funcao = window.system_functions[j];
|
|
|
+ } else if (parsed[i].value == window.system_functions[j].identifier) {
|
|
|
+ funcao = window.system_functions[j];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (!funcao) {
|
|
|
fun_not_found.push(parsed[i].value);
|