algorithm.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import $ from 'jquery';
  2. import { Types } from './types';
  3. import * as Models from './ivprog_elements';
  4. import { LocalizedStrings } from './../services/localizedStringsService';
  5. import * as GlobalsManagement from './globals';
  6. import * as VariablesManagement from './variables';
  7. import * as CommandsManagement from './commands';
  8. import * as CodeManagement from './code_generator';
  9. import * as VariableValueMenu from './commands/variable_value_menu';
  10. import * as FunctionsManagement from './functions';
  11. import { DOMConsole } from './../io/domConsole';
  12. import { IVProgParser } from './../ast/ivprogParser';
  13. import { IVProgProcessor } from './../processor/ivprogProcessor';
  14. import { LanguageService } from '../services/languageService';
  15. window.block_render = false;
  16. export function renderAlgorithm () {
  17. if (window.block_render) {
  18. return;
  19. }
  20. window.block_render = true;
  21. $('.all_functions').children().off();
  22. $('.all_functions').empty();
  23. $('.list_globals').children().off();
  24. $('.list_globals').empty();
  25. for (var i = 0; i < window.program_obj.functions.length; i++) {
  26. FunctionsManagement.renderFunction(window.program_obj.functions[i]);
  27. }
  28. for (var i = 0; i < window.program_obj.globals.length; i++) {
  29. GlobalsManagement.renderGlobal(window.program_obj.globals[i]);
  30. }
  31. setTimeout(function(){ window.block_render = false; }, 500);
  32. }