

Versao:

 - 2017/03/17 : 0.1.0


* Para usar multi-linguas
  - Definicao
    * js/app-i18n.js
      var translations
       'pt' : {
        'Welcome' : 'Bem-vindo',
        ...
       'en' : {
        'Welcome' : 'Welcome',
        ...
  - Uso
    "{{'alt_button_eval' | i18n}}"
    {{'' | i18n}}


* var := ...
  partials/elements/attr.html : bool_expr_select_var = --- Select a variable
  partials/elements/attr.html : bool_expr_select_operator = --- Selecione um operador

* if ("Selecione...")
  partials/directives/edit-expression-java.html : if_select_var = 
  - partials/directives/edit-expression-java.html
    - 

  partials/directives/boolean-expression.html

* if ("select variable")
  partials/directives/select-variable.html
  - {{'if_select_var' | i18n}}
  partials/directives/select-variable-expression.html
  - {{'if_select_var' | i18n}}
  - {{'if_var_remove' | i18n}}
  - {{'if_var_to_value' | i18n}}
  - {{'if_var_isolate' | i18n}}


Selecione...
partials/directives/boolean-expression.html
partials/directives/edit-expression-java.html
partials/directives/edit-expression.html - ainda nao

bool_expr_title_select -> bool_expr_select_title = 
- partials/directives/edit-expression-java.html
- partials/elements/attr.html

* "+ Command"
  * partials/directives/buttons.html : "+ Command"
    itens menu sob "+ Command"
    - img/att.png | buttom_create_command | "Command"
    - img/if.png  | buttons_if            | "if (condition is true) then"
   

* "+ Variable"
  * partials/create.html : button_eval_title, alt_button_create_var, 
  * partials/elements/btns.html : 

* js/app-i18n.js
  * para popup usar como nome '<nome>_title'
    troquei: alt_button_eval, alt_button_create_var, alt_button_create_cmd, alt_button_create_clearoutputs, alt_button_create_testcases
    -> button_eval_title, button_create_var_title, button_create_cmd_title, button_create_clearoutputs_title, button_create_testcases_title


1. Comando 'if'
   * "+ Command" | "If (condition is true) then" : options "Variable" or "Value"
     * "if ( Select... )"       : partials/directives/edit-expression-java.html = bool_expr_select , bool_expr_select_title
        bool_expr_edit_re
       Variable
       * if ( select variable ) : partials/directives/select-variable.html = if_select_var
         X erro : mesmo com variavel esta vazio!
       Value
       * 

partials/directives/buttons.html :
 "+ Command"             : "Command"              | "if (condition is true) then" | "Repeat N times" | "While (condition is true)" | "Data input" | "Data output"
 buttons_create_command    buttons_create_command   buttons_if                      buttons_for        buttons_while                 buttons_input  buttons_output

partials/directives/edit-expression-java.html :
  If ( Logical expression... ) : bool_expression  | "Variable"           | "Value"
       bool_expression                              bool_expr_select_var   bool_expr_select_val

js/app.js
 + ivProgApp.directive : OU, E
      var op_text_sum, op_text_mult, op_log_or;
      if ($rootScope.currentLanguage == "en" || $rootScope.currentLanguage == "en_US") {
        op_text_sum = "Sum"; op_text_mult = "Product", op_log_or = "OR";
        }
      else {
        op_text_sum = "Somar"; op_text_mult = "Produto", op_log_or = "OU";
        }



edit-expression-java.html

partials/directives/edit-expression.html     : bool_expr_edit_re : "Relational Expression: AE == AE"
partials/directives/edit-expression-java.html: bool_expr_edit_re : "Relational Expression: AE == AE"





js/controllers.js : type=="read"
"Por favor digite um valor:"
aqui funciona!

partials/directives/select-variable.html
 if_select_var - selecionar variável
 De:
   <span ng-show="value==''"><i>{{'if_select_var' | i18n}}</i></span>
   <span ng-hide="value==''">{{vars[value].name}}</span>
 Para:

partials/elements/attr.html:
 <div class="instr attr">
  ...
  <span ng-show="node.variable==''">{{'bool_expr_select_variable' | i18n}}</span> <!-- --- select a variable -->



edit-expression-java.html
Selecione...

Arquivos com EXPR
 - partials/directives/select-variable.html
 - partials/directives/select-variable-expression.html
 - partials/directives/boolean-expression.html

operations.png
 - partials/directives/edit-expression-java.html
 - partials/directives/boolean-expression.html
 - partials/elements/attr.html


 
Comandos
 - "if" (EXPR)    : partials/directives/select-variable.html
         variable : 
         value    : -> partials/directives/boolean-expression.html

 EXPR [-/|+*]
 - partials/directives/boolean-expression.html
 - partials/directives/edit-expression-java.html
 - partials/elements/attr.html
 
 "Command"
 - "AQUI" <--- selec a variable : partials/directives/select-variable.html
 
 "Se verdadeiro entao"
 - partials/elements/if.html
 
 - "se ( Select... )" :                                         = partials/directives/edit-expression-java.html : no terceiro 'bool_expr_select'
       "variable" : "se ( AQUI [-/|+*] )"                -> NAO
       "value"    : "se ( AQUI <--- select a variable )" -> OK  = partials/directives/boolean-expression.html ?


 - "se (<select> )" : clica no <select> e pega opcao "value"

 - "se (<select> <--- select a variable (LE) )" : <select> dentro de 'partials/directives/select-variable.html'
        +-> partials/directives/select-variable.html

 - "se ( <var> [select an operator] <select> )" : 
    |_____________________________| +-> partials/directives/boolean-expression.html
    partials/directives/edit-expression-java.html



Falta:
 if ("Selection..." [-/|+*]) : para selecionar OR, AND ou Clear
 if ("VAR" OP "VAL" [-/|+*]) : para selecionar apenas Clear! (colocar aqui tb "OR" e "AND")

---
Alterei 'partials/directives/select-variable.html' e 'partials/directives/edit-expression-java.html' para inicialmente entrar
 + partials/directives/select-variable.html
   if ("Selection...") -> if ("Logical Expression" OR "Relational Expression")
   * No : <li ng-repeat="var in vars" : troquei : ng-show="var.type==type || type=='' || (type=='int' && var.type=='float') || (type=='float' && var.type=='int')
     por : ng-show="var.type==type)"
 + partials/directives/edit-expression-java.html : troquei 'var' e 'val' por apenas 'expressao relacional'
   if ("Logical Expression" OR "Relational Expression")
      bool_expr_edit_re : <li><a role="menuitem" ng-click="addEl(ex, 'val')">{{'bool_expr_edit_re' | i18n}}</a></li><!-- Relational Expression: AE == AE -->
      bool_expr_edit_le x
      tenho que criar novo 'addEl(ex, 'relexp')' com copia do codigo de "addEl(ex, 'val')" definido em 'js/app.js'
 + js/app.js : ivProgApp.directive : $scope.addEl = function(p, type)

var:= :: p=, type=val, scope=[object Object], var.type=int
if/else :: p=, type=val, scope=[object Object], var.type=boolean

select-variable.html
 var:=   :: 1o clique = <depuracao: orig=1, type=, var.type=int> ; 2o clique = <p=, type=val, scope=[object Object], var.type=int>
 if/else :: 1o clique = <p=, type=val, scope=[object Object], var.type=boolean> ; 2o clique = <depuracao: orig=1, type=, var.type=int>


 var:=   :: "Select ... <--- select a variable" -> select-variable.html            :: seleciona "var1" => "depuracao: orig=1, type=, var.type=int"
            "var1 receive Select..."            -> select-variable-expression.html :: seleciona "Relational Expression: AE == AE" (ignora e segue para "valor") => "p=, type=val, scope=[object Object], var.type=int"
	    "var1 receive 1"

 if/else :: "if ( Select... )"                  -> select-variable-expression.html :: seleciona "Relational Expression: AE == AE" => "p=, type=val, scope=[object Object], var.type=boolean"
            "if ( Select... )"                  -> select-variable.html            :: seleciona "var1" => "depuracao: orig=1, type=, var.type=int"
            "if ( var1  [select an operator]  Select... )"


js/app.js
 + ivProgApp.directive('editExpressionJava', ...)
   operadores: "Addition", ... (internacionalizei: var op_text_add, op_text_sub, op_text_mult, op_text_div, op_log_or, op_log_and, op_log_not, op_text_rest;)
   $scope.operators

 + ivProgApp.directive('selectOperator', ...)
   $scope.operators : 

 + ivProgApp.directive('buttons', function($rootScope) :
   inicio de criacao de cada comando e variaveis
   + "if" => newNode.exp = []; newNode.isChildrenVisible = true; newNode.nodes1 = []; newNode.nodes2 = [];


Fluxo de criar comando ":=":
 Atribuicao -> "Select variable..." <--- select variable -> (newVar0) -> newVar0 := "Logical expression..." -> (Variable) -> newVar0 := "Select variable..." [+*|-/]
                                                            (1)
            -> (newVar0) -> newVar0 := newVar0 [+*|-/]
               (2)
 (1) app.js: depuracao: orig=1, type=, var.type=int, lang=en
 (2) app.js: depuracao: orig=1, type=int, var.type=int, lang=en
 [+*|-/] com "Mult,..."

Fluxo de criar comando "If":
 If -> if "Logical expression..." -> (Variable) -> If ("Select variable..." [+*|-/] -> (newVar0) ->> If (newVar0 [+*|-/]
                                                                                       (1)
 (1) app.js: depuracao: orig=1, type=boolean, var.type=int, lang=en
 [+*|-/] com "AND OR Clear"


selectOp

edit-expression-java.html: if ( "select..." <--- select )
 => selectOp(item, op.id);

partials/directives/buttons.html
 + botao "+ Comando"


 + ivProgApp.config(['$routeProvider', function($routeProvider)
   - templateUrl: partials/start.html
   - templateUrl: partials/create.html
 + ivProgApp.directive('editInPlaceVarValue', function($rootScope)
   - templateUrl: partials/directives/edit-in-place-var-values.html
 + ivProgApp.directive('varValue', function($rootScope)
   - templateUrl: partials/directives/var-value.html
 + ivProgApp.directive('editExpression', function()
   - templateUrl: partials/directives/edit-expression.html
 + ivProgApp.directive('editExpressionJava', function()
   - templateUrl: partials/directives/edit-expression-java.html
 + ivProgApp.directive('editExpressionJavaReadOnly', function()
   - templateUrl: partials/directives/edit-expression-java-read-only.html
 + ivProgApp.directive('selectVariable', function()
   - templateUrl: partials/directives/select-variable.html
 + ivProgApp.directive('selectOperator', function()
   - templateUrl: partials/directives/select-operator.html
 + ivProgApp.directive('selectVariableExpression', function()
   - templateUrl: partials/directives/select-variable-expression.html
 + ivProgApp.directive('booleanExpression', function()
   - templateUrl: partials/directives/boolean-expression.html
 + ivProgApp.directive('buttons', function($rootScope)
   - templateUrl: partials/directives/buttons.html

select-variable.html
 class="dropdown select-variable-value normal" ng-class="{'need-to-set': value==''}"


select-variable-expression.html
 class="dropdown select-variable-value normal" ng-class="{'need-to-set': value==''}"