algorithm.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. if (window.draging) {
  21. return;
  22. }
  23. window.block_render = true;
  24. console.log('rendering algorithm');
  25. $('.all_functions').children().off();
  26. $('.all_functions').empty();
  27. $('.list_globals').children().off();
  28. $('.list_globals').empty();
  29. for (var i = 0; i < window.program_obj.functions.length; i++) {
  30. FunctionsManagement.renderFunction(window.program_obj.functions[i]);
  31. }
  32. for (var i = 0; i < window.program_obj.globals.length; i++) {
  33. GlobalsManagement.renderGlobal(window.program_obj.globals[i]);
  34. }
  35. setTimeout(function(){ window.block_render = false; }, 500);
  36. }