Skip to content

Commit 647f1c0

Browse files
author
Davide Rosa
committed
Fixed execution problem. It was not working beacause of a circular import about BAS and
1 parent 5d97fe9 commit 647f1c0

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

R1/Program/sample_program.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CHAR string[3,20]
4646
print(testVariableGlobal)
4747
testVariableGlobal = SampleFuncGlobal()
4848
print(testVariableGlobal)
49-
halt
49+
;halt
5050
string[1,] = "potato"
5151
string[2,] = "pizza"
5252
string[3,] = "pepperoni"

R1/System/$config.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ STRUC TQM_TQDAT_T INT T11,T12,T13,T14,T15,T16,T21,T22,T23,T24,T25,T26,K1,K2,K3,K
8080
;==================================
8181
; External declarations:
8282
;==================================
83-
EXT BAS (BAS_COMMAND :IN,REAL :IN )
83+
;EXT BAS (BAS_COMMAND :IN,REAL :IN )
8484
EXT IR_STOPM ( )
8585

8686
;====================

global_defs_user.src

Whitespace-only changes.

main_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, project_folder):
3232
self.scandir(self.dirs['R1'], {}, self.r1_files)
3333
self.scandir(self.dirs['STEU'], {}, self.steu_files)
3434

35-
"""
35+
parser_module.KRLModule('global_defs_user', '', src_path_and_file=self.all_files['global_defs_user.src'], imports_to_prepend = _i('kuka_internals')),
3636
parser_module.KRLModule('kuka_internals', self.all_files['kuka_internals.dat'], src_path_and_file=self.all_files['kuka_internals.src'], imports_to_prepend = _i('global_defs')),
3737
parser_module.KRLModule('operate', self.r1_files['operate.dat'], src_path_and_file='', imports_to_prepend = _i('global_defs') + _i('kuka_internals')),
3838
parser_module.KRLModule('operate_r1', self.r1_files['operate_r1.dat'], src_path_and_file='', imports_to_prepend = _i('global_defs') + _i('operate')),
@@ -46,7 +46,7 @@ def __init__(self, project_folder):
4646
parser_module.KRLModule('bas', '', src_path_and_file=self.r1_files['bas.src'], imports_to_prepend = _i('global_defs') + _i('config') + _i('robcor_dat') + _i('machine_dat') + _i('steu_option') + _i('collmonlib')),
4747

4848
parser_module.KRLModule('ir_stopm', '', src_path_and_file=self.r1_files['ir_stopm.src'], imports_to_prepend = _i('global_defs')),
49-
"""
49+
5050
"""
5151
self.modules.extend( [
5252
parser_module.KRLModule('sample_program', self.r1_files['sample_program.dat'], src_path_and_file=self.r1_files['sample_program.src'], imports_to_prepend = _i('global_defs') + _i('config') + _i('operate_r1'))

parser_instructions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ def parse_single_instruction(self, code_line_original, code_line, instruction_na
402402
res = "%s = %s()"%(var,type_name)
403403

404404
if is_global:
405-
translation_result_tmp.append("from global_defs import %s"%(var))
405+
#translation_result_tmp.append("from global_defs import %s"%(var))
406+
add_user_global_def(res)
406407

407408
else:
408409
# #if the variable decl is a function parameter it have to be not declared again

0 commit comments

Comments
 (0)