algorithm.js 1.3 KB

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