diff options
Diffstat (limited to 'lib')
110 files changed, 1170 insertions, 708 deletions
@@ -1,10 +1,13 @@ #!/usr/bin/wish -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -207,6 +210,8 @@ namespace eval X { # 2 == Sim -> Hex # 3 == Sim -> Bin variable hex__bin + variable input_file {} ;# Input file + variable output_file {} ;# Output file ## XDATA/CODE/ERAM/EEPROM/UNI memory hexadecimal editors variable opened_code_mem_windows {} ;# List of project object with opened CODE memory hex editor @@ -3543,11 +3548,15 @@ namespace eval X { variable compilation_in_progress ;# Bool: Compiler engaged variable critical_procedure_in_progress ;# Bool: Disables procedures which takes a long time variable project_menu_locked ;# Bool: Indicates than there is at least one opened project - variable compiler_pid ;# Int: PID of external compiler if used + variable compiler_pid ;# Int: PID of external compiler, if used variable compilation_start_simulator ;# Bool: Start simulator after successful compilation variable compile_this_file_only ;# Bool: Compile the current file only variable compilation_mess_project ;# Object: Project related to running compilation + if {!${::APPLICATION_LOADED}} { + return {} + } + # It is not allowed to compile the source code while simulator is engaged if {[lindex $simulator_enabled $actualProjectIdx]} { return {} @@ -4712,7 +4721,7 @@ namespace eval X { SUBP_MON_CONFIG {1 1} OPEN_WITH_DLG {} FS_BROWSER_MASK {*.asm} - FIND_IN_FILES_CONFIG {1 0 1 ~ {*.asm,*.c,*.h} {}} + FIND_IN_FILES_CONFIG {1 0 1 {} {*.asm,*.c,*.h} {}} SYMBOL_VIEWER_CONFIG {1 1 1 1 1 1 1 0 0 0 620x450} LINE2PC_JUMP 1 STOPWATCH_CONFIG {{} 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} @@ -5872,6 +5881,8 @@ namespace eval X { ## Invoke conversion dialog -- auxiliary procedure for '__bin2hex', '__hex2bin', '__sim2hex', '__sim2bin' # @return void proc hex2bin2hex {} { + variable input_file ;# Input file + variable output_file ;# Output file variable hex__bin ;# Type of conversion variable critical_procedure_in_progress ;# Bool: Disables procedures which takes a long time @@ -6533,7 +6544,10 @@ namespace eval X { # Create dialog header pack [label $win.header \ -compound left \ - -image ::ICONS::32::mcu8051ide \ + -image [image create photo \ + -format png \ + -file "${::ROOT_DIRNAME}/icons/other/Moravia_Microsystems.png" \ + ] \ -text " ${::APPNAME}" \ -font [font create \ -size -20 \ @@ -6570,8 +6584,9 @@ namespace eval X { ] -fill y -side right # fill in the about tab $about_tab.text insert end "${::APPNAME}\n" - $about_tab.text insert end [mc "An open source IDE for MCS-51 based microconrollers for POSIX Systems, this software is licenced under the GNU GPL v2 licence. You can find more at the project web page http://mcu8051ide.sourceforge.net\n"] + $about_tab.text insert end [mc "An open source IDE for MCS-51 based microconrollers for POSIX Systems, this software is licenced under the GNU GPL v2 licence. You can find more at the project web page http://www.moravia-microsystems.com/mcu-8051-ide/\n"] $about_tab.text insert end "\n(c) 2007, 2008, 2009, 2010, 2011, 2012 Martin Ošmera <mailto:martin.osmera@gmail.com>\n" + $about_tab.text insert end "\n(c) 2014 Moravia Micorsystems, s.r.o. <mailto:martin.osmera@moravia-microsystems.com>\n" if {$::MICROSOFT_WINDOWS} { $about_tab.text insert end "\n" $about_tab.text insert end [mc "You are currently using version for Microsoft® Windows®.\n"] @@ -11414,10 +11429,10 @@ namespace eval X { } ## Perform secure send command - # Secure means that it will not crash or something like that in case of any errors. - # But instead it will popup an error message to the user (Tk dialog). - # @parm List args - Arguments for the send command - # @return void + # Secure means that it will not crash or something like that in case of any errors. + # But instead it will popup an error message to the user (Tk dialog). + # @parm List args - Arguments for the send command + # @return void proc secure_send args { if {[catch { eval "send $args" diff --git a/lib/bottompanel/bottomnotebook.tcl b/lib/bottompanel/bottomnotebook.tcl index d4d1293..14c5e20 100644 --- a/lib/bottompanel/bottomnotebook.tcl +++ b/lib/bottompanel/bottomnotebook.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/bottompanel/calculator.tcl b/lib/bottompanel/calculator.tcl index b7ab722..f311cce 100644 --- a/lib/bottompanel/calculator.tcl +++ b/lib/bottompanel/calculator.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,18 +36,18 @@ set _CALCULATOR_TCL _ class Calculator { - common calc_count 0 ;# counter of instances + public common calc_count 0 ;# counter of instances # Font for numerical keypad - common large_font [font create \ + public common large_font [font create \ -family {helveticat} \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight {bold} \ ] - common oper_fg_color {#0000FF} ;# Foreground color for operator display - common error_bg_color {#FF6666} ;# Background color for display containing too many characters - common display_bg_color {#DDFFDD} ;# Background color for main display - common buffer_bg_color {#DDDDFF} ;# Background color for buffer display + public common oper_fg_color {#0000FF} ;# Foreground color for operator display + public common error_bg_color {#FF6666} ;# Background color for display containing too many characters + public common display_bg_color {#DDFFDD} ;# Background color for main display + public common buffer_bg_color {#DDDDFF} ;# Background color for buffer display # Variables related to object initialization private variable parent ;# Teportary variable -- GUI parent @@ -112,7 +115,7 @@ class Calculator { # {separator} # } # } - common calculator_keyboard { + public common calculator_keyboard { { {{AND} {and} {calc_opr and 1} {} {} {Bit-wise AND} diff --git a/lib/bottompanel/cvarsview.tcl b/lib/bottompanel/cvarsview.tcl index ebebce3..f95ed32 100644 --- a/lib/bottompanel/cvarsview.tcl +++ b/lib/bottompanel/cvarsview.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -35,28 +38,28 @@ set _CVARSVIEW_TCL _ class CVarsView { ## COMMON # Normal font fot the text widget - common text_wdg_font_n [font create \ + public common text_wdg_font_n [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight normal \ -slant roman \ ] # Bold font for the text widget - common text_wdg_font_b [font create \ + public common text_wdg_font_b [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ -slant roman \ ] # Italic font for the text widget - common text_wdg_font_i [font create \ + public common text_wdg_font_i [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight normal \ -slant italic \ ] # Background color for selected lines - common color_selected_line {#CCCCFF} + public common color_selected_line {#CCCCFF} private variable main_frame ;# Widget: Main frame diff --git a/lib/bottompanel/find_in_files.tcl b/lib/bottompanel/find_in_files.tcl index dccc823..e34ab0f 100644 --- a/lib/bottompanel/find_in_files.tcl +++ b/lib/bottompanel/find_in_files.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,7 +36,7 @@ set _FIND_IN_FILES_TCL _ # -------------------------------------------------------------------------- class FindInFiles { - common find_inf_count 0 ;# Counter of class instances + public common find_inf_count 0 ;# Counter of class instances # Variables related to object initialization private variable parent ;# Widget: parent widget @@ -61,12 +64,21 @@ class FindInFiles { set obj_idx $find_inf_count # Load configuration - set ::FindInFiles::recursive_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 0] - set ::FindInFiles::regular_expr_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 1] - set ::FindInFiles::case_sensitive_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 2] - set ::FindInFiles::folder_$obj_idx [$this cget -projectPath] ;#[lindex $::CONFIG(FIND_IN_FILES_CONFIG) 3] - set ::FindInFiles::mask_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 4] - set ::FindInFiles::pattern_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 5] + if {[catch { + set ::FindInFiles::recursive_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 0] + set ::FindInFiles::regular_expr_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 1] + set ::FindInFiles::case_sensitive_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 2] + set ::FindInFiles::folder_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 3] + set ::FindInFiles::mask_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 4] + set ::FindInFiles::pattern_$obj_idx [lindex $::CONFIG(FIND_IN_FILES_CONFIG) 5] + }]} then { + set ::FindInFiles::recursive_$obj_idx 1 + set ::FindInFiles::regular_expr_$obj_idx 0 + set ::FindInFiles::case_sensitive_$obj_idx 1 + set ::FindInFiles::folder_$obj_idx {} + set ::FindInFiles::mask_$obj_idx {*.asm,*.c,*.h} + set ::FindInFiles::pattern_$obj_idx {} + } # Validate loaded configuration if {![string is boolean -strict [subst -nocommands "\$::FindInFiles::recursive_$obj_idx"]]} { diff --git a/lib/bottompanel/graph.tcl b/lib/bottompanel/graph.tcl index 3f21052..ea6061b 100644 --- a/lib/bottompanel/graph.tcl +++ b/lib/bottompanel/graph.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -36,9 +39,9 @@ source "${::LIB_DIRNAME}/bottompanel/graph_wdg.tcl" ;# Graph widget class Graph { ## COMMON # Bool: The message: "Performance warning" was already displayed to the user - common performance_warning_already_shown 0 + public common performance_warning_already_shown 0 # Bool: show performance warning when enabling external HW simulation - common show_sim_per_warn ${::CONFIG(SHOW_PALE_WARN)} + public common show_sim_per_warn ${::CONFIG(SHOW_PALE_WARN)} # Variables related to object initialization private variable data_list ;# Teportary variable -- Configuration list diff --git a/lib/bottompanel/graph_wdg.tcl b/lib/bottompanel/graph_wdg.tcl index a528bc5..45dbd3c 100644 --- a/lib/bottompanel/graph_wdg.tcl +++ b/lib/bottompanel/graph_wdg.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,30 +36,30 @@ set _GRAPH_WDG_TCL _ class GraphWidget { ## COMMON - common step_y 13 ;# Int: Vertical distance between graph rows - common half_edge 5 ;# Int: Half length of bit edge - common full_edge 10 ;# Int: Full length of bit edge + public common step_y 13 ;# Int: Vertical distance between graph rows + public common half_edge 5 ;# Int: Half length of bit edge + public common full_edge 10 ;# Int: Full length of bit edge # Big font (vertical header) - common big_font [font create \ + public common big_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size -14 \ -weight bold \ ] # Small font (horizontal header) - common small_font [font create \ + public common small_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size -14 \ -weight bold \ ] # Font for booleans values for each port - common bool_font [font create \ + public common bool_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size -12 \ -weight bold \ ] # Definition of graph popup menu - common GRAPHMENU { + public common GRAPHMENU { {command {ON/OFF} {} 0 "graph_change_status_on" {} "Enable/Disable graph"} {separator} diff --git a/lib/bottompanel/messages.tcl b/lib/bottompanel/messages.tcl index e70c0a2..bb945ba 100644 --- a/lib/bottompanel/messages.tcl +++ b/lib/bottompanel/messages.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -34,21 +37,21 @@ set _MESSAGES_TCL _ class Messages { ## COMMON - common set_shortcuts {} ;# Currently set shortcut bindigs for messages text - common shortcuts_cat {messages} ;# Key shortcut categories related to messages text + public common set_shortcuts {} ;# Currently set shortcut bindigs for messages text + public common shortcuts_cat {messages} ;# Key shortcut categories related to messages text # Normal font for messages text - common messages_normal_font [font create \ + public common messages_normal_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ ] # Bold font for messages text - common messages_bold_font [font create \ + public common messages_bold_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ ] # Definition of popup menu for messages text - common MESSAGESMENU { + public common MESSAGESMENU { {command {Select all} {Ctrl+A} 0 "select_all_messages_text" {} "Select all text in this TextBox"} {command {Copy} {Ctrl+C} 0 "copy_messages_text" diff --git a/lib/bottompanel/terminal.tcl b/lib/bottompanel/terminal.tcl index 894fd3b..13dc40b 100644 --- a/lib/bottompanel/terminal.tcl +++ b/lib/bottompanel/terminal.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,8 +36,8 @@ set _TERMINAL_TCL _ class Terminal { # Terminal emulator configuration - common configuration - common configuration_def [subst { + public common configuration + public common configuration_def [subst { bg #FFFFFF fg #000000 font_size 12 diff --git a/lib/bottompanel/todo.tcl b/lib/bottompanel/todo.tcl index 21f79a5..1258b33 100644 --- a/lib/bottompanel/todo.tcl +++ b/lib/bottompanel/todo.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -32,44 +35,44 @@ set _TODO_TCL _ # -------------------------------------------------------------------------- class Todo { - common buttonActiveBg {#2222FF} ;# Color for button representing currently active text tags - common buttonSemiActBg {#8888FF} ;# - || - semi active tags + public common buttonActiveBg {#2222FF} ;# Color for button representing currently active text tags + public common buttonSemiActBg {#8888FF} ;# - || - semi active tags # Normal font for messages text - common todo_normal_font [font create \ + public common todo_normal_font [font create \ -family ${Editor::fontFamily} \ -size -${Editor::fontSize} \ ] - common normal_font [font create \ + public common normal_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight {normal} \ ] - common bold_font [font create \ + public common bold_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight {bold} \ ] # List of used text tags - common textTags { + public common textTags { tag_bold tag_italic tag_overstrike tag_underline } # List of XML tags for text tags (above) - common xmlTags { + public common xmlTags { b i s u } # List "tagging" buttons - common tagButtons { + public common tagButtons { button_bold button_italic button_strike button_under } # List of self closing tags - common selfCtags {bookmark} - common set_shortcuts {} ;# Currently set shortcut bindigs - common shortcuts_cat {todo} ;# Key shortcut categories related to this segment + public common selfCtags {bookmark} + public common set_shortcuts {} ;# Currently set shortcut bindigs + public common shortcuts_cat {todo} ;# Key shortcut categories related to this segment # ID of bookmark image - common bookmarkImage ok + public common bookmarkImage ok # Definition of the popup menu - common TODOMENU { + public common TODOMENU { {command {Undo} {Ctrl+Z} 0 "undo" {undo} "Undo last operation"} {command {Redo} {Ctrl+Shift+Z} 2 "redo" {redo} diff --git a/lib/cli.tcl b/lib/cli.tcl index 63b28e0..7c2f54c 100644 --- a/lib/cli.tcl +++ b/lib/cli.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -676,6 +679,11 @@ if {$CLI_OPTION(check_libraries)} { set library [lindex $::LIBRARIES_TO_LOAD [list $i 0]] ;# Library name set version [lindex $::LIBRARIES_TO_LOAD [list $i 1]] ;# Library version + # Skip optional libraries. + if {[lsearch $::OPTIONAL_LIBRARIES $library] != -1} { + continue + } + # Print what library is currently being checked if {$CLI_OPTION(nocolor)} { puts "\t\t[expr {$i + 1}]/$librariesToCheck Checking for library $library" diff --git a/lib/compiler/assembler.tcl b/lib/compiler/assembler.tcl index 17e5244..ffd7078 100644 --- a/lib/compiler/assembler.tcl +++ b/lib/compiler/assembler.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/compiler/codelisting.tcl b/lib/compiler/codelisting.tcl index a760d4c..a8cab90 100644 --- a/lib/compiler/codelisting.tcl +++ b/lib/compiler/codelisting.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -445,6 +448,7 @@ namespace eval CodeListing { # Adjust list of values foreach val $values { if {![string is digit -strict $val]} { + append new_values " {} {$val} " continue } set val [string trimleft $val 0] diff --git a/lib/compiler/compiler.tcl b/lib/compiler/compiler.tcl index 932e67a..1222a0f 100644 --- a/lib/compiler/compiler.tcl +++ b/lib/compiler/compiler.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/compiler/compilerconsts.tcl b/lib/compiler/compilerconsts.tcl index e8a71f4..ce9a507 100644 --- a/lib/compiler/compilerconsts.tcl +++ b/lib/compiler/compilerconsts.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/compiler/disassembler.tcl b/lib/compiler/disassembler.tcl index 6319c1e..c34777e 100644 --- a/lib/compiler/disassembler.tcl +++ b/lib/compiler/disassembler.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/compiler/external_compiler.tcl b/lib/compiler/external_compiler.tcl index 5d8c6b2..0b310d7 100644 --- a/lib/compiler/external_compiler.tcl +++ b/lib/compiler/external_compiler.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/compiler/preprocessor.tcl b/lib/compiler/preprocessor.tcl index d4429ea..c12e790 100644 --- a/lib/compiler/preprocessor.tcl +++ b/lib/compiler/preprocessor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1390,6 +1393,32 @@ namespace eval PreProcessor { ] } + # Resolve: "DW <label>", and "DB ..., <label>, ..." + if {${::Compiler::Settings::PRINT}} { + set new_lst {} + foreach lst_line $CodeListing::lst { + set op_code [lindex $lst_line 1] + if {[llength $op_code] > 1} { + set take_next 0 + set new_op_code {} + foreach op $op_code { + if {{} == $op} { + set take_next 1 + continue + } elseif {$take_next} { + set take_next 0 + append new_op_code [format %02X [ComputeExpr $op 0]] + } else { + append new_op_code $op + } + } + lset lst_line 1 $new_op_code + } + lappend new_lst $lst_line + } + set CodeListing::lst $new_lst + } + # Replace old code with the new one set asm $tmp_asm } @@ -2633,7 +2662,7 @@ namespace eval PreProcessor { # @return List - code of the macro proc getMacro {macro_name args} { variable macro ;# Array: Code of defined macro instructions - variable local_M_labels ;# Array of lists: Local labels in macros $local_M_labels($macro_name) == {integer label0 ... labelN} + variable local_M_labels ;# Array of lists: Local labels in macros $local_M_labels($macro_name) == {integer label0 ... labelN} variable lineNum ;# Number of the current line variable fileNum ;# Number of the current file @@ -2671,10 +2700,10 @@ namespace eval PreProcessor { if {![regexp {^(\?\?)?[A-Za-z_][^\s:]*:\s*} $line label]} { set label {} } else { - regsub {^(\?\?)?[A-Za-z_][^\s:]:*\s*} $line {} line + regsub {^(\?\?)?[A-Za-z_][^\s:]*:\s*} $line {} line regsub -all {\s+} $label {} label set label [string trimright $label {:}] - if {[lsearch -ascii -exact $local_M_labels($macro_name) $label] != -1} { + if {[lsearch -ascii -exact [lrange $local_M_labels($macro_name) 1 end] $label] != -1} { set label "${macro_name}_[lindex $local_M_labels($macro_name) 0]__${label}" } } @@ -2687,7 +2716,11 @@ namespace eval PreProcessor { } regsub {^\.?\w+\s*} $line {} operands if {$operands == {}} { - lappend result $instruction + if {$label != {}} { + lappend result "${label}:\t${instruction}" + } else { + lappend result $instruction + } continue } @@ -2724,6 +2757,8 @@ namespace eval PreProcessor { if {[isReservedKeyword [lindex $m_pars $idx] 1]} { Warning $lineNum $fileNum [mc "Reserved keyword substituted with macro argument: %s --> %s" [lindex $m_pars $idx] [lindex $args $idx]] } + } elseif {[lsearch -exact -ascii [lrange $local_M_labels($macro_name) 1 end] $o] != -1} { + set o "${macro_name}_[lindex $local_M_labels($macro_name) 0]__${o}" } append new_opr $o { } diff --git a/lib/configdialogues/compiler_config.tcl b/lib/configdialogues/compiler_config.tcl index 2f261ea..bcadabc 100644 --- a/lib/configdialogues/compiler_config.tcl +++ b/lib/configdialogues/compiler_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -77,6 +80,7 @@ namespace eval compiler { variable primary_tab_asm ;# Widget: Tab "Assembly language" variable primary_tab_c ;# Widget: Tab "C language" + variable primary_tab_make {} ;# Widget: Tab "MAIN/GNU make" variable assembler_tab_compiler ;# Widget: Tab "Compiler" variable assembler_tab_M8I ;# Widget: Tab "MCU8051IDE" variable assembler_tab_ASEM51 ;# Widget: Tab "ASEM-51" diff --git a/lib/configdialogues/configdialogues.tcl b/lib/configdialogues/configdialogues.tcl index 7dba24e..4c03d3c 100644 --- a/lib/configdialogues/configdialogues.tcl +++ b/lib/configdialogues/configdialogues.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/configdialogues/custom_commands_config.tcl b/lib/configdialogues/custom_commands_config.tcl index 0919d21..0127583 100644 --- a/lib/configdialogues/custom_commands_config.tcl +++ b/lib/configdialogues/custom_commands_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/configdialogues/editor_config.tcl b/lib/configdialogues/editor_config.tcl index 7936eda..509d559 100644 --- a/lib/configdialogues/editor_config.tcl +++ b/lib/configdialogues/editor_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -54,6 +57,7 @@ namespace eval editor { variable highlight_tab_asm ;# Widget: Tab "Syntax highlight"/"Assembler" variable highlight_tab_C ;# Widget: Tab "Syntax highlight"/"C language" variable highlight_tab_lst ;# Widget: Tab "Syntax highlight"/"Code listing" + variable tab_created_so_far ;# List: ID of already created tabs. ## Tab "Editor" ## Int: Editor to use @@ -145,6 +149,7 @@ namespace eval editor { variable highlight_tab_asm ;# Widget: Tab "Syntax highlight"/"Assembler" variable highlight_tab_C ;# Widget: Tab "Syntax highlight"/"C language" variable highlight_tab_lst ;# Widget: Tab "Syntax highlight"/"Code listing" + variable tab_created_so_far ;# List: ID of already created tabs. variable apply_button ;# ID of button "Apply" variable anything_modified ;# Bool: Settings changed (stay set to 1 even after APPLY) @@ -195,7 +200,7 @@ namespace eval editor { # Create notebook set nb [ModernNoteBook $win.nb] - set ::configDialogues::editor::tab_created_so_far [list] + set tab_created_so_far [list] # Create Tab "Editor" if {!$::MICROSOFT_WINDOWS} { ;# External editors are not available on Microsoft Windows set editor_tab [$nb insert end editor_tab -text [mc "Editor"] -createcmd {::configDialogues::editor::create_tab editor}] @@ -299,6 +304,7 @@ namespace eval editor { variable highlight_tab_asm ;# Widget: Tab "Syntax highlight"/"Assembler" variable highlight_tab_C ;# Widget: Tab "Syntax highlight"/"C language" variable highlight_tab_lst ;# Widget: Tab "Syntax highlight"/"Code listing" + variable tab_created_so_far ;# List: ID of already created tabs. variable editor_to_use ;# Int: Prefred editor variable sample_text ;# ID of text widget for sample text @@ -309,6 +315,12 @@ namespace eval editor { variable dialog_opened ;# Bool: True if this dialog is already opened variable button_index ;# Button index (for creating many buttons) + if {[lsearch $tab_created_so_far $tab_name] != -1} { + return + } else { + lappend tab_created_so_far $tab_name + } + switch -- $tab_name { {editor} { ;# Tab "Editor selection" set editor_top_frame [frame $editor_tab.top_frame] @@ -1081,7 +1093,7 @@ namespace eval editor { set state normal } foreach tab [list general_tab highlight_tab] { - $nb itemconfigure tab -state $state + $nb itemconfigure $tab -state $state } } diff --git a/lib/configdialogues/global_config.tcl b/lib/configdialogues/global_config.tcl index 66ca346..b173c53 100644 --- a/lib/configdialogues/global_config.tcl +++ b/lib/configdialogues/global_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/configdialogues/rightpanel_config.tcl b/lib/configdialogues/rightpanel_config.tcl index 0cace4e..95845f7 100644 --- a/lib/configdialogues/rightpanel_config.tcl +++ b/lib/configdialogues/rightpanel_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/configdialogues/shortcuts_config.tcl b/lib/configdialogues/shortcuts_config.tcl index 612dc6a..886e42e 100644 --- a/lib/configdialogues/shortcuts_config.tcl +++ b/lib/configdialogues/shortcuts_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/configdialogues/simulator_config.tcl b/lib/configdialogues/simulator_config.tcl index bbfd2b0..e1a7a3c 100644 --- a/lib/configdialogues/simulator_config.tcl +++ b/lib/configdialogues/simulator_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/configdialogues/terminal_config.tcl b/lib/configdialogues/terminal_config.tcl index 732b5cb..3f158bf 100644 --- a/lib/configdialogues/terminal_config.tcl +++ b/lib/configdialogues/terminal_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/configdialogues/toolbar_config.tcl b/lib/configdialogues/toolbar_config.tcl index abddd01..d3f2be7 100644 --- a/lib/configdialogues/toolbar_config.tcl +++ b/lib/configdialogues/toolbar_config.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/custom_command.tcl b/lib/custom_command.tcl index 6a5393f..d0772d3 100644 --- a/lib/custom_command.tcl +++ b/lib/custom_command.tcl @@ -2,12 +2,15 @@ # the next line restarts using wish \ exec tclsh "$0" "$@" -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/dialogues/errorhandler.tcl b/lib/dialogues/errorhandler.tcl index 93e1cf4..e829e9d 100644 --- a/lib/dialogues/errorhandler.tcl +++ b/lib/dialogues/errorhandler.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -122,8 +125,9 @@ namespace eval ErrorHandler { ] # Write error message + $middle_frame.text insert end [mc "Program version: %s\n" "${::VERSION}"] $middle_frame.text insert end [mc "Error log saved in: %s\n" "${::X::defaultDirectory}[file separator]mcu8051ide_errors.log"] - $middle_frame.text insert end [mc "Please send this file to %s\nor report this bug at: http://sourceforge.net/tracker/?group_id=185864&atid=914981\n\n\n" {<martin.osmera@gmail.com>}] + $middle_frame.text insert end [mc "Please send this file to %s\n\n\n" {<martin.osmera@moravia-microsystems.com>}] create_link_tag_in_text_widget $middle_frame.text convert_all_https_to_links $middle_frame.text $middle_frame.text tag add tag_big_bold 1.0 4.0 diff --git a/lib/dialogues/fsd.tcl b/lib/dialogues/fsd.tcl index fce7e24..4733426 100644 --- a/lib/dialogues/fsd.tcl +++ b/lib/dialogues/fsd.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -58,27 +61,27 @@ set _FSD_TCL _ itcl::class KIFSD::FSD { - common bookmark_change_command {} ;# Command to invoke on bokmark change + public common bookmark_change_command {} ;# Command to invoke on bokmark change # Font for quick navigation panel - common quick_nav_panel_font [font create \ + public common quick_nav_panel_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ ] # Font for files listbox in mode (Short view) - common listbox_font_short [font create \ + public common listbox_font_short [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight normal \ ] # Font for files listbox in mode (Detailed view) and directories listbox - common listbox_font_detailed [font create \ + public common listbox_font_detailed [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight normal \ ] # Font for listbox header - common listbox_header_font [font create \ + public common listbox_header_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ @@ -1932,13 +1935,13 @@ itcl::class KIFSD::FSD { public method file_listbox_item_menu {x y item} { set item_menu_request 1 set current_item $item - set current_item_index [$dir_listbox index $item] + set current_item_index [$file_listbox index $item] foreach entry {Rename Delete Properties {Bookmark folder}} { $win.listbox_menu entryconfigure [mc $entry] -state normal } set cur_listbox {file} set current_item $item - set current_item_index [$dir_listbox index $item] + set current_item_index [$file_listbox index $item] tk_popup $win.listbox_menu $x $y } @@ -2078,7 +2081,7 @@ itcl::class KIFSD::FSD { # Create dialog window and Notebook set dialog [toplevel $win.properties_dialog -class {Configuration dialog} -bg ${::COMMON_BG_COLOR}] - set nb [NoteBook $dialog.nb -bg ${::COMMON_BG_COLOR}] + set nb [ModernNoteBook $dialog.nb] $nb insert end general -text "General" if {!$::MICROSOFT_WINDOWS} { ;# Microsoft Windows has no file rights (compatible with posix rights) $nb insert end permission -text "Permissions" @@ -2091,7 +2094,7 @@ itcl::class KIFSD::FSD { # Name: set row 0 grid [label $frame.lbl_$row \ - -text [::mc "Name:"] -anchor w \ + -text [::mc "Name:"] -anchor w \ -font $listbox_font_short \ ] -column 0 -row $row -sticky w -pady 3 set ::KIFSD::FSD::item_properties(name) $name @@ -2186,8 +2189,8 @@ itcl::class KIFSD::FSD { ] -side left -padx 2 # Pack notebook and bottom frame - pack $nb -fill both -expand 1 -padx 10 -pady 5 - pack $bottom_frame -anchor e -after $nb -padx 10 -pady 5 + pack [$nb get_nb] -fill both -expand 1 -padx 10 -pady 5 + pack $bottom_frame -anchor e -after [$nb get_nb] -padx 10 -pady 5 # Configure dialog window wm title $dialog [::mc "Item properties"] diff --git a/lib/dialogues/my_tk_messageBox.tcl b/lib/dialogues/my_tk_messageBox.tcl index 0698e9e..42de741 100644 --- a/lib/dialogues/my_tk_messageBox.tcl +++ b/lib/dialogues/my_tk_messageBox.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -171,7 +174,12 @@ namespace eval my_tk_messageBox { destroy $dialog set ::my_tk_messageBox::return_value {} " + update + + if {![winfo exists $dialog]} { + return $return_value + } catch { grab $dialog } diff --git a/lib/dialogues/selectmcu.tcl b/lib/dialogues/selectmcu.tcl index 584a59f..711b9c7 100644 --- a/lib/dialogues/selectmcu.tcl +++ b/lib/dialogues/selectmcu.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1392,15 +1395,17 @@ namespace eval SelectMCU { image delete $image } update - if {[catch { - $image_label configure -text { } -image [image create photo \ - -format png -file "${::ROOT_DIRNAME}/icons/mcu/$mcu_name.png" - ] - }]} then { - $image_label configure \ - -fg {#DD0000} \ - -text [mc " Image not found"] \ - -image ::ICONS::16::no + if {[winfo exists $image_label]} { + if {[catch { + $image_label configure -text { } -image [image create photo \ + -format png -file "${::ROOT_DIRNAME}/icons/mcu/$mcu_name.png" + ] + }]} then { + $image_label configure \ + -fg {#DD0000} \ + -text [mc " Image not found"] \ + -image ::ICONS::16::no + } } } diff --git a/lib/dialogues/tips.tcl b/lib/dialogues/tips.tcl index d2df211..469b9e1 100644 --- a/lib/dialogues/tips.tcl +++ b/lib/dialogues/tips.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/editor/ASMsyntaxhighlight.tcl b/lib/editor/ASMsyntaxhighlight.tcl index 1486201..8de9476 100644 --- a/lib/editor/ASMsyntaxhighlight.tcl +++ b/lib/editor/ASMsyntaxhighlight.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/editor/Csyntaxhighlight.tcl b/lib/editor/Csyntaxhighlight.tcl index c4ecd2a..2e1d16a 100644 --- a/lib/editor/Csyntaxhighlight.tcl +++ b/lib/editor/Csyntaxhighlight.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -55,32 +58,38 @@ namespace eval CsyntaxHighlight { __data __near __xdata __far __idata __pdata __code __bit __sfr __sfr16 __sfr32 __sbit __at + + bool size_t addr_t + uint8_t uint16_t uint32_t uint64_t + int8_t int16_t int32_t int64_t } # List of C keywords variable keywords { auto break case _endasm while union continue default do else enum sizeof for namespace if goto return struct switch typedef using - _asm __asm __endasm + inline _asm __asm __endasm } # List of doxygen tags -- No argument variable doxy_tags_type0 { @return @see @sa @arg - @li @nosubgrouping @subpage @f$ - @f[ @f] @interface + @li @nosubgrouping @subpage @interface + @f[ @f] @f$ @{ + @} } # List of doxygen tags -- Word after tag variable doxy_tags_type1 { - @param @defgroup @addtogroup @weakgroup + @class @defgroup @addtogroup @weakgroup @ref @page @struct @union @enum @def @file @namespace - @package + @package @param @param[in] @param[out] + @param[in,out] } # List of doxygen tags -- Name after tag variable doxy_tags_type2 { @brief @ingroup @name @mainpage @fn @var @typedef @author - @authors + @authors @warning @deprecated } # List of HTML tags (HTML 4.0 Strict) variable html_tags { @@ -551,7 +560,7 @@ namespace eval CsyntaxHighlight { # Determinate string to highlight set string [string range $line_content $idx0 [expr {$idx1 - 1}]] # Split line into words - set words [split [regsub -all {>} [regsub -all {<} $string { &}] {& }]] + set words [split [regsub -all {>} [regsub -all {<} [regsub -all "\"" $string {\"}] { &}] {& }]] # Adjust HTML tags with argument(s) (they must be represented as a single word) set tag_opened 0 @@ -589,16 +598,16 @@ namespace eval CsyntaxHighlight { # Detect dogygen tag } elseif {[string index $word 0] == {@}} { # Tags without argument - if {[lsearch $doxy_tags_type0 $word] != -1 || $word == {@f[}} { + if {[lsearch -ascii -exact $doxy_tags_type0 $word] != -1 || $word == {@f[}} { set tags {tag_c_dox_tag} # Tags with one argument - } elseif {[lsearch $doxy_tags_type1 $word] != -1} { + } elseif {[lsearch -ascii -exact $doxy_tags_type1 $word] != -1} { set tags {tag_c_dox_tag} set is_word 1 # Tags witch has name after - } elseif {[lsearch $doxy_tags_type2 $word] != -1} { + } elseif {[lsearch -ascii -exact $doxy_tags_type2 $word] != -1} { $editor tag add tag_c_dox_tag \ $line_number.[expr {$idx0 + $idx}] \ $line_number.[expr {$idx0 + $idx + $len}] @@ -740,7 +749,7 @@ namespace eval CsyntaxHighlight { $editor tag add tag_c_bracket $line_number.$j $line_number.$j+1c # Other symbols - } elseif {[lsearch {; = , + - < > ! | & * / ? : % ^} $char] != -1} { + } elseif {[lsearch -ascii -exact {; = , + - < > ! | & * / ? : % ^} $char] != -1} { $editor tag add tag_c_symbol $line_number.$j $line_number.$j+1c } } @@ -781,6 +790,8 @@ namespace eval CsyntaxHighlight { set len [string length $word] set idx [string first $word $string $idx] + regsub {[uU]?[lL]?[lL]?[uU]?$} $word {} word + # Char if {![string is digit -strict [string index $word 0]]} { if {$word == {''}} { diff --git a/lib/editor/LSTsyntaxhighlight.tcl b/lib/editor/LSTsyntaxhighlight.tcl index 62f622f..cff3afb 100644 --- a/lib/editor/LSTsyntaxhighlight.tcl +++ b/lib/editor/LSTsyntaxhighlight.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/editor/R_ASMsyntaxhighlight.tcl b/lib/editor/R_ASMsyntaxhighlight.tcl index 250da57..7b83384 100644 --- a/lib/editor/R_ASMsyntaxhighlight.tcl +++ b/lib/editor/R_ASMsyntaxhighlight.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/editor/autocompletion.tcl b/lib/editor/autocompletion.tcl index 04dca79..9d9b05c 100644 --- a/lib/editor/autocompletion.tcl +++ b/lib/editor/autocompletion.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -32,8 +35,8 @@ set _AUTOCOMPLETION_TCL _ # This file should be loaded into class Editor in file "editor.tcl" # -------------------------------------------------------------------------- -common invoke_com_win_in_p 0 ;# Bool: invoke_completion_popup_window in progress -common completion_win_opened 0 ;# Bool: Editor popup-based completion window opended +public common invoke_com_win_in_p 0 ;# Bool: invoke_completion_popup_window in progress +public common completion_win_opened 0 ;# Bool: Editor popup-based completion window opended ## Array: Strings available for autocompletion # Index 0 - Labels in assembly @@ -165,47 +168,41 @@ private method autocompletion_c_syntax_analyze {line_number} { # Find word after data type specification set prev_range {} set range [list $line_number.0 $line_number.0] + set line [$editor get $line_number.0 [list $line_number.0 lineend]] + + set par_idx [string first "(" $line] + while {1} { set range [$editor tag nextrange tag_c_data_type \ [lindex $range 1] [list $line_number.0 lineend] \ ] - if {![llength $range]} { + + if {![llength $range] || ( ( $par_idx != -1 ) && ([lindex [split [lindex $range 0] {.}] 1] > $par_idx) )} { break } set prev_range $range + } + set range $prev_range - # Nothing found -> abort - if {![llength $prev_range]} { - return - } - - # Gain details about the word - set range $prev_range - set line [$editor get $line_number.0 [list $line_number.0 lineend]] - set start [lindex [split [lindex $range 1] {.}] 1] - set end 0 - set string {} - - # Find part which consist of alphanumeric characters - while {1} { - if {![regexp -start $start -- {\w+} $line string]} { - return - } - incr start - set end [expr {$start + [string length $string]}] + # Nothing found -> abort + if {![llength $range]} { + return + } - if {[string is digit [string index $string 0]]} { - incr start [string length $string] - } else { - break - } - } + set start [lindex [split [lindex $range 1] {.}] 1] + if {![regexp -start $start -- {\w+} $line string]} { + return + } + set start [string first $string $line $start] + set end [expr {$start + [string length $string]}] - # Mark the word - if {[regexp -start $end -- {\s*\(} $line]} { - $editor tag add c_lang_func $line_number.$start $line_number.$end - } else { + # Mark the word + if {[regexp -start $end -- {\s*\(} $line]} { + $editor tag add c_lang_func $line_number.$start $line_number.$end + } else { + # Skip type conversions + if {![regexp {[\(\)]} [$editor get [lindex $range 1] $line_number.$start]]} { $editor tag add c_lang_var $line_number.$start $line_number.$end } } @@ -331,13 +328,13 @@ private method invoke_completion_popup_window {mode start_idx end_idx} { if {![winfo exists .completion_win]} { set win [frame .completion_win -background {#000000}] bind $win <Button-1> "catch {$this completion_popup_window_but1 %X %Y}" - bind $win <FocusOut> "$this close_completion_popup_window" + bind $win <FocusOut> "catch {$this close_completion_popup_window}" bind $win <Destroy> " catch {$this detete_text_in_editor sel.first sel.last} $this parse \[expr {int(\[$editor index insert\])}\]" bind $win <Key-Escape> " catch {$this detete_text_in_editor sel.first sel.last} - $this close_completion_popup_window" + catch {$this close_completion_popup_window}" # Create lisbox and scrollbar set frame [frame $win.frame] @@ -364,11 +361,11 @@ private method invoke_completion_popup_window {mode start_idx end_idx} { pack $frame -padx 1 -pady 1 -fill both -expand 1 - $listbox bindText <Button-1> "$this completion_accept" - $listbox bindText <Escape> "$this close_completion_popup_window" - bind $listbox <Key-Return> "$this completion_accept \[$listbox selection get\]" - bind $listbox <KP_Enter> "$this completion_accept \[$listbox selection get\]" - bind $listbox <Escape> "$this close_completion_popup_window" + $listbox bindText <Button-1> "catch {$this completion_accept}" + $listbox bindText <Escape> "catch {$this close_completion_popup_window}" + bind $listbox <Key-Return> "catch {$this completion_accept \[$listbox selection get\]}" + bind $listbox <KP_Enter> "catch {$this completion_accept \[$listbox selection get\]}" + bind $listbox <Escape> "catch {$this close_completion_popup_window}" if {[winfo exists $listbox.c]} { bind $listbox.c <Button-5> {%W yview scroll +1 units; break} bind $listbox.c <Button-4> {%W yview scroll -1 units; break} diff --git a/lib/editor/commandline.tcl b/lib/editor/commandline.tcl index 4e15e0a..6a13cf2 100644 --- a/lib/editor/commandline.tcl +++ b/lib/editor/commandline.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/editor/editor.tcl b/lib/editor/editor.tcl index e375386..a89c63a 100644 --- a/lib/editor/editor.tcl +++ b/lib/editor/editor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -59,29 +62,29 @@ class Editor { # 3 - Nano # 4 - dav # 5 - le - common editor_to_use 0 - common intentation_mode {normal};# Editor indentation mode - common spaces_no_tabs 0 ;# Bool: Use spaces instead of tabs - common number_of_spaces 8 ;# Number of spaces to use instead of tab - common auto_brackets 1 ;# Automaticaly insert oposite brackets, quotes, etc. - common auto_completion 1 ;# Enable popup-base completion for code editor - common cline_completion 1 ;# Enable popup-base completion for command line - common autosave 0 ;# Int: 0 == Disable autosave; N > 0 == minutes - common hg_trailing_sp 1 ;# Bool: Highlight trailing spaces - - common finishigh_hg_dlg_max ;# Int: Highlight dialog -- maximum value for progress bar - common finishigh_hg_dlg_const ;# Int: Highlight dialog -- current value for progress bar - - common set_shortcuts {} ;# Currently set shortcut bindigs - common shortcuts_cat {edit} ;# Key shortcut categories related to this segment - common count 0 ;# Counter of class instances - common bookmark 0 ;# Auxiliary variable for popup menu for Icon Border - common breakpoint 0 ;# Auxiliary variable for popup menu for Line Numbers - common pmenu_cline 0 ;# Auxiliary variable for popup menu for Icon Border and Line Numbers - common wrap_char "\uB7" ;# Character intended for marking wrapped lines + public common editor_to_use 0 + public common intentation_mode {normal};# Editor indentation mode + public common spaces_no_tabs 0 ;# Bool: Use spaces instead of tabs + public common number_of_spaces 8 ;# Number of spaces to use instead of tab + public common auto_brackets 1 ;# Automaticaly insert oposite brackets, quotes, etc. + public common auto_completion 1 ;# Enable popup-base completion for code editor + public common cline_completion 1 ;# Enable popup-base completion for command line + public common autosave 0 ;# Int: 0 == Disable autosave; N > 0 == minutes + public common hg_trailing_sp 1 ;# Bool: Highlight trailing spaces + + public common finishigh_hg_dlg_max ;# Int: Highlight dialog -- maximum value for progress bar + public common finishigh_hg_dlg_const ;# Int: Highlight dialog -- current value for progress bar + + public common set_shortcuts {} ;# Currently set shortcut bindigs + public common shortcuts_cat {edit} ;# Key shortcut categories related to this segment + public common count 0 ;# Counter of class instances + public common bookmark 0 ;# Auxiliary variable for popup menu for Icon Border + public common breakpoint 0 ;# Auxiliary variable for popup menu for Line Numbers + public common pmenu_cline 0 ;# Auxiliary variable for popup menu for Icon Border and Line Numbers + public common wrap_char "\uB7" ;# Character intended for marking wrapped lines # Commands supported by editor command line - common editor_commands { + public common editor_commands { animate assemble auto-indent bookmark breakpoint capitalize clear comment copy custom cut date exit exit-program find @@ -95,10 +98,10 @@ class Editor { switch-mcu set-xcode set-xdata } # Editor commands wich can take options - common commands_with_option {find replace} + public common commands_with_option {find replace} ## Tags which defines background color for specific type of lines # {{tagname bg-color bool-priority} ...} - common line_markers { + public common line_markers { {sel #AAAAFF} {tag_current_line #FFFF88} {tag_bookmark #DDDDFF} @@ -110,34 +113,34 @@ class Editor { } # Font for command line: Normal help window text - common cl_hw_nrml_font [font create \ + public common cl_hw_nrml_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ ] # Font for command line: Bold help window text - common cl_hw_bold_font [font create \ + public common cl_hw_bold_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight bold \ ] # Font for command line: Subheader in help window text - common cl_hw_hdr_font [font create \ + public common cl_hw_hdr_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight bold \ ] # Font for command line: Main header in help window text - common cmd_line_win_font [font create \ + public common cmd_line_win_font [font create \ -size [expr {int(-17 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ ] # Font size for command line - common cmd_line_fontSize [expr {int(14 * $::font_size_factor)}] + public common cmd_line_fontSize [expr {int(14 * $::font_size_factor)}] # Font family for command line - common cmd_line_fontFamily $::DEFAULT_FIXED_FONT + public common cmd_line_fontFamily $::DEFAULT_FIXED_FONT # Font for editor command line - common cmd_line_font [font create \ + public common cmd_line_font [font create \ -family $cmd_line_fontFamily \ -size -$cmd_line_fontSize \ ] @@ -145,65 +148,65 @@ class Editor { # { # {tag_name ?foreground? ?overstrike? ?italic? ?bold?} # } - common cmd_line_highlighting { + public common cmd_line_highlighting { {tag_cmd #0000DD 0 0 1} {tag_argument #00DD00 0 0 0} {tag_option #DD0000 0 0 1} } - common normal_text_bg #FFFFFF ;# Default background color for editor - common iconBorder_bg #C8C5FF ;# Default background color for icon border - common lineNumbers_bg #9497D8 ;# Default background color for line numbers - common lineNumbers_fg #FFFFFF ;# Default foreground color for line numbers + public common normal_text_bg #FFFFFF ;# Default background color for editor + public common iconBorder_bg #C8C5FF ;# Default background color for icon border + public common lineNumbers_bg #9497D8 ;# Default background color for line numbers + public common lineNumbers_fg #FFFFFF ;# Default foreground color for line numbers # Items in editor menu, which should be disabled when editor goes to simulator mode - common freezable_menu_items { + public common freezable_menu_items { Cut Paste Undo Redo Comment Uncomment Indent Unindent Uppercase Lowercase Capitalize } # Items in editor menu, which should be disabled when editor is in read only mode - common read_na_only_menu_items { + public common read_na_only_menu_items { Cut Paste Undo Redo Comment Uncomment Indent Unindent Uppercase Lowercase Capitalize } # Maximum width of the tab character, measured in number of spaces - common tab_width 8 + public common tab_width 8 # Default font size - common fontSize [expr {int(13 * $::font_size_factor)}] + public common fontSize [expr {int(13 * $::font_size_factor)}] # Default font family - common fontFamily $::DEFAULT_FIXED_FONT + public common fontFamily $::DEFAULT_FIXED_FONT # Default font for editor - common defaultFont \ + public common defaultFont \ [font create \ -size -$fontSize \ -family $fontFamily \ -weight {normal} \ ] - common defaultFont_bold \ + public common defaultFont_bold \ [font create \ -size -$fontSize \ -family $fontFamily \ -weight {bold} \ ] - common defaultCharWidth 0 ;# Width of one character of the default font - common defaultCharHeight 0 ;# Height of one character of the default font + public common defaultCharWidth 0 ;# Width of one character of the default font + public common defaultCharHeight 0 ;# Height of one character of the default font # Font for status bar (Normal) - common statusBarFont \ + public common statusBarFont \ [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -family $::DEFAULT_FIXED_FONT \ ] # Font for status bar (Bold) - common statusBarBoldFont \ + public common statusBarBoldFont \ [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ -family $::DEFAULT_FIXED_FONT \ ] # Definition of editor popup menu - common EDITORMENU { + public common EDITORMENU { {command {LJMP this line} {$edit:jmp} 2 "ljmp_this_line {}" {exec} "Program jump"} {command {LCALL this line} {$edit:call} 4 "lcall_this_line {}" @@ -250,7 +253,7 @@ class Editor { {filesave} "Save this file"} } # Definition of popup menu for icon border - common IBMENU { + public common IBMENU { {checkbutton "Bookmark" {$edit:bookmark} {::Editor::bookmark} 1 0 0 {Bookmark ${::Editor::pmenu_cline}}} {separator} @@ -260,7 +263,7 @@ class Editor { {2leftarrow} "Hide this panel"} } # Definition of popup menu for line numbers - common LNMENU { + public common LNMENU { {checkbutton "Breakpoint" {$edit:breakpoint} {::Editor::breakpoint} 1 0 0 {Breakpoint ${::Editor::pmenu_cline}}} {separator} @@ -270,7 +273,7 @@ class Editor { {2leftarrow} "Hide this panel"} } # Definition of popup menu for editor statis bar - common STATMENU { + public common STATMENU { {command "Split vertical" {$edit:split_v} 8 {__split_vertical} {view_left_right} "Split the editor vertically"} {command "Split horizontal" {$edit:split_h} 6 {__split_horizontal} @@ -349,7 +352,7 @@ class Editor { private variable editor_height 0 private variable cmd_line ;# ID of command line entry widget private variable cmd_line_listbox {} ;# Widget: ListBox of command line auto-completion window - private variable completion_listbox ;# Widget: ListBox of editor popup-based completion + private variable completion_listbox {} ;# Widget: ListBox of editor popup-based completion private variable do_not_hide_comp_win 0 ;# Bool: Disable highing of editor completion win. on KeyRelease private variable autosave_timer {} ;# ID of autosave timer (command "after") private variable key_handler_buffer {} ;# List: Buffer for <Key> event handler diff --git a/lib/editor/eventhandlers.tcl b/lib/editor/eventhandlers.tcl index 279b2e2..85190a5 100644 --- a/lib/editor/eventhandlers.tcl +++ b/lib/editor/eventhandlers.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/editor/exports.tcl b/lib/editor/exports.tcl index 26441c7..b49b2b7 100644 --- a/lib/editor/exports.tcl +++ b/lib/editor/exports.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/editor/generalproc.tcl b/lib/editor/generalproc.tcl index 3bf8767..55209d1 100644 --- a/lib/editor/generalproc.tcl +++ b/lib/editor/generalproc.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/editor/spell_check.tcl b/lib/editor/spell_check.tcl index 7759607..c3901d7 100644 --- a/lib/editor/spell_check.tcl +++ b/lib/editor/spell_check.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -55,17 +58,17 @@ set _SPELL_CHECK_TCL _ # -------------------------------------------------------------------------- ## COMMON -common spellchecker_enabled 0 ;# Bool: Flag spell checking enabled -common spellchecker_dictionary {} ;# String: Dictionary to use (e.g. en_US or cs_CZ) -common spellchecker_process_pid [list] ;# List of Ints: Process identifiers of the spell checker and support processes -common spellchecker_command_LIFO [list] ;# List: LIFO for commands invoked by spell checker {correct_spelling_cmd wrong_spelling_cmd} -common spellchecker_RAP_ID {} ;# String: Application name of ``receive_and_print'' for IPC -common spellchecker_attempts_to_restart 0 ;# Int: Number of failed attempts to restart the spell checker process -common spellchecker_started_flag ;# None: When this variable is set that means that the spell checker process has been started -common spellchecker_start_failed 0 ;# Bool: Flag spellchecker_started_flag was set but the spell checker process was not actually started -common spellchecker_start_timer {} ;# AfterTimer: Watch dog timer for start of of the spell checker process -common available_dictionaries [list] ;# List of Strings: Dictionaries available to the Hunspell -common hunspell_process {} ;# Channel: Hunspell process invoked by command open in order to gain list of dictionaries + public common spellchecker_enabled 0 ;# Bool: Flag spell checking enabled + public common spellchecker_dictionary {} ;# String: Dictionary to use (e.g. en_US or cs_CZ) + public common spellchecker_process_pid [list] ;# List of Ints: Process identifiers of the spell checker and support processes + public common spellchecker_command_LIFO [list] ;# List: LIFO for commands invoked by spell checker {correct_spelling_cmd wrong_spelling_cmd} + public common spellchecker_RAP_ID {} ;# String: Application name of ``receive_and_print'' for IPC + public common spellchecker_attempts_to_restart 0 ;# Int: Number of failed attempts to restart the spell checker process + public common spellchecker_started_flag ;# None: When this variable is set that means that the spell checker process has been started + public common spellchecker_start_failed 0 ;# Bool: Flag spellchecker_started_flag was set but the spell checker process was not actually started + public common spellchecker_start_timer {} ;# AfterTimer: Watch dog timer for start of of the spell checker process + public common available_dictionaries [list] ;# List of Strings: Dictionaries available to the Hunspell + public common hunspell_process {} ;# Channel: Hunspell process invoked by command open in order to gain list of dictionaries ## PRIVATE private variable spellcheck_line_pre {} ;# String: Content of the line where change_detected_pre was performed @@ -80,7 +83,7 @@ private variable spellcheck_lock 0 ;# Bool: Inhibit method ``spellcheck_check_a # { Language_Name Language_Code } # ... # } -common LANGUAGE_CODES_AND_NAMES { + public common LANGUAGE_CODES_AND_NAMES { {{Abkhazian} {ab}} {{Afar} {aa}} {{Afrikaans} {af}} {{Akan} {ak}} {{Albanian} {sq}} {{Amharic} {am}} @@ -198,7 +201,7 @@ common LANGUAGE_CODES_AND_NAMES { # { Country_Name Country_Code Flag_File_Name_Without_Extension } # ... # } -common COUNTRY_CODES_AND_FLAGS { + public common COUNTRY_CODES_AND_FLAGS { {{Afghanistan} AF Afghanistan} {{Åland Islands} AX {}} {{Albania} AL Albania} diff --git a/lib/environment.tcl b/lib/environment.tcl index c64f41b..0f0a7db 100644 --- a/lib/environment.tcl +++ b/lib/environment.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1010,7 +1013,7 @@ proc create_link_tag_in_text_widget {widget} { # @parm Widget widget - Target text widget # @return void proc convert_all_https_to_links {widget} { - foreach re [list {http://[^\s]+} {[\w\.]+@[\w\.]+}] { + foreach re [list {http://[^\s]+} {[\w\-\._]+@[\w\-\._]+}] { set idx {1.0} set end {1.0} set org {1.0} @@ -3022,6 +3025,18 @@ namespace eval toolbar { destroy $wdg } + # Logo of our company: Moravia Microsystems, s.r.o. + pack [ttk::button .mainIconBar.company_logo \ + -image [image create photo \ + -format png \ + -file "${::ROOT_DIRNAME}/icons/other/Moravia_Microsystems.png" \ + ] \ + -style ToolButton.TButton \ + -command {::X::open_uri {http://www.moravia-microsystems.com/}} + ] -side right -padx 15 + DynamicHelp::add .mainIconBar.company_logo \ + -text [mc "Visit webside of the Moravia Microsystems, s.r.o. company."] + # Create hide button pack [Label .mainIconBar.hide_label \ -bd 0 -highlightthickness 0 \ diff --git a/lib/external_command.tcl b/lib/external_command.tcl index 552a73a..2322f06 100644 --- a/lib/external_command.tcl +++ b/lib/external_command.tcl @@ -2,12 +2,15 @@ # the next line restarts using wish \ exec tclsh "$0" "$@" -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/leftpanel/filelist.tcl b/lib/leftpanel/filelist.tcl index 4c65e36..2eee961 100644 --- a/lib/leftpanel/filelist.tcl +++ b/lib/leftpanel/filelist.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -45,50 +48,50 @@ class FileList { ## COMMON # String: Textvariable for dialog "Open with ..." - common open_with ${::CONFIG(OPEN_WITH_DLG)} - common open_with_cnfr 0 ;# Bool: Confirm dialog "Open with ..." - common fl_lst_count 0 ;# Instances counter - common file_indexes {} ;# List of line indexes (auxiliary variable for opening multiple files) - common ac_index_in_fl ;# Index of actual editor filelist - common default_encoding {utf-8} ;# Default encoding - common default_eol {lf} ;# Default EOL - common bookmark 0 ;# Auxiliary variable for popup menu for Icon Borders - common pmenu_cline 0 ;# Auxiliary variable for popup menu for Icon Borders + public common open_with ${::CONFIG(OPEN_WITH_DLG)} + public common open_with_cnfr 0 ;# Bool: Confirm dialog "Open with ..." + public common fl_lst_count 0 ;# Instances counter + public common file_indexes {} ;# List of line indexes (auxiliary variable for opening multiple files) + public common ac_index_in_fl ;# Index of actual editor filelist + public common default_encoding {utf-8} ;# Default encoding + public common default_eol {lf} ;# Default EOL + public common bookmark 0 ;# Auxiliary variable for popup menu for Icon Borders + public common pmenu_cline 0 ;# Auxiliary variable for popup menu for Icon Borders # Menu items to disable when entering simulator mode - common freezable_menu_items { + public common freezable_menu_items { {New} {Close} {Close All} {Open} } # Font for opened file in project files list - common opened_file_font [font create \ + public common opened_file_font [font create \ -weight normal \ -slant roman \ -size -12 \ -family $::DEFAULT_FIXED_FONT \ ] # Font for closed file in project files list - common closed_file_font [font create \ + public common closed_file_font [font create \ -weight normal \ -slant italic \ -size -12 \ -family $::DEFAULT_FIXED_FONT \ ] # Font for icon borders - common icon_border_font [font create \ + public common icon_border_font [font create \ -weight normal \ -slant roman \ -size -12 \ -family $::DEFAULT_FIXED_FONT \ ] - common filelist {} ;# List of files to open - common open_files_cur_file {} ;# Name of file currently being opened - common open_files_progress 0 ;# True if opening files in progress - common open_files_abort 0 ;# Abort variable for open files ProgressDialog - common filedetails_visible 0 ;# Bool: Is file details window visible - common filedetails_after_ID ;# ID of timeout for show window "file details" + public common filelist {} ;# List of files to open + public common open_files_cur_file {} ;# Name of file currently being opened + public common open_files_progress 0 ;# True if opening files in progress + public common open_files_abort 0 ;# Abort variable for open files ProgressDialog + public common filedetails_visible 0 ;# Bool: Is file details window visible + public common filedetails_after_ID ;# ID of timeout for show window "file details" # Definition of popup menu for listbox of opened files - common OPENEDFILESMENU { + public common OPENEDFILESMENU { {command {Append to project} {} 0 "filelist_append_to_prj" {add} "Append this file to the current project"} {separator} @@ -140,7 +143,7 @@ class FileList { } # Definition of popup menu for notebook with opened files - common FILETABSPUMENU { + public common FILETABSPUMENU { {command {Append to project} {} 0 "filelist_append_to_prj" {add} "Append this file to the current project"} {separator} @@ -169,7 +172,7 @@ class FileList { } # Definition of popup menu for listbox of project files - common PROJECTFILESMENU { + public common PROJECTFILESMENU { {command {Remove file from the project} {} 0 "filelist_remove_file_from_project" {editdelete} "Remove this file from the project"} {command {Close file} {$edit:close} 0 "filelist_project_file_close" @@ -207,12 +210,12 @@ class FileList { } # Definition of popup menu icon border for list of of opened files - common OPENEDFILESIBMENU { + public common OPENEDFILESIBMENU { {checkbutton "Bookmark" "" {::FileList::bookmark} 1 0 0 {opened_files_bookmark ${::FileList::pmenu_cline}}} } # Definition of popup menu icon border for list of of project files - common PROJECTFILESIBMENU { + public common PROJECTFILESIBMENU { {checkbutton "Bookmark" "" {::FileList::bookmark} 1 0 0 {project_files_bookmark ${::FileList::pmenu_cline}}} } @@ -1599,11 +1602,6 @@ class FileList { set index [$listbox_opened_files index $item] ;# Item index set target [expr {$index - 1}] ;# Target index - if {$last_selected_item == $item} { - return - } - set last_selected_item $item - # 1st item cannot be moved up if {$index == 0} {return} @@ -1648,11 +1646,12 @@ class FileList { set target [expr {$index + 1}] ;# Target index # Last item cannot be moved up - if {[llength [$listbox_opened_files items]] == $index} {return} + if {[llength [$listbox_opened_files items]] == ($index + 1)} {return} # Move item in listbox $listbox_opened_files move $item $target $filetabs_nb move $item $target + # Move item in list of bookmarks and icon border if {[lindex $opened_files_bookmarks $index] != [lindex $opened_files_bookmarks $target]} { # Determinate bookmark flag for source and target index @@ -1755,7 +1754,7 @@ class FileList { set editor_idx [lsearch $file_descriptors $item] # Adjust filetabs notebook - set page [lindex [$filetabs_nb pages] $editor_idx] + set page [lindex [$filetabs_nb pages] [$listbox_opened_files index $item]] if {$page == {}} { set switchfile_in_progress 0 return @@ -2162,6 +2161,17 @@ class FileList { lappend file_indexes $file_index lappend file_indexes_fb $num_of_opened_files + if { $file_index >= $filelist_length } { + set enlargeBy [expr {$file_index - $filelist_length + 1}] + append files_to_open__path [string repeat { {}} $enlargeBy] + append files_to_open__enc [string repeat { {}} $enlargeBy] + append files_to_open__eol [string repeat { {}} $enlargeBy] + append files_to_open__bm [string repeat { {}} $enlargeBy] + append files_to_open__ro [string repeat { {}} $enlargeBy] + append files_to_open__sh [string repeat { {}} $enlargeBy] + append files_to_open__nt [string repeat { {}} $enlargeBy] + } + # Adjust list of files to open lset files_to_open__path $file_index $file_path$file_name lset files_to_open__enc $file_index $enc diff --git a/lib/leftpanel/fsbrowser.tcl b/lib/leftpanel/fsbrowser.tcl index 631eb3e..1bd9afc 100644 --- a/lib/leftpanel/fsbrowser.tcl +++ b/lib/leftpanel/fsbrowser.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -34,7 +37,7 @@ set _FSBROWSER_TCL _ class FSBrowser { # Definition of popup menu for file system browser, part: configure - common FSMENU_CONFIGURE { + public common FSMENU_CONFIGURE { {cascade "Sorting" 0 "" .sorting false 1 { {radiobutton "By Name" "" {::KIFSD::FSD::config(sorting)} {name} {filelist_fsb_reload} 3 @@ -59,7 +62,7 @@ class FSBrowser { } # Definition of popup menu for file system browser, part: listbox - common FSMENU_LISTBOX { + public common FSMENU_LISTBOX { {command {Up} {} 0 "filelist_fsb_up" {up} "Go to parent folder"} {command {Back} {} 0 "filelist_fsb_back" {left} @@ -86,7 +89,7 @@ class FSBrowser { } # Definition of popup menu for file system browser, part: bookmarks - common FSMENU_BOOKMARKS { + public common FSMENU_BOOKMARKS { {command {Add bookmark} {} 0 "filelist_fsb_add_bookmark" {bookmark_add} "Bookmark the current folder"} {command {Edit bookmarks} {} 0 "filelist_fsb_edit_bookmarks" @@ -729,8 +732,7 @@ class FSBrowser { -text [mc "Create new folder in:\n%s" $fs_browser_current_dir] \ ] -side top -anchor w -padx 15 -pady 5 # Create EntryBox for name of new folder - pack [ttk::entry $dialog.entry -bg white \ - ] -side top -fill x -expand 1 -padx 5 -pady 5 + pack [ttk::entry $dialog.entry] -side top -fill x -expand 1 -padx 5 -pady 5 # Create bottom button bar set button_frame [frame $dialog.bottom] @@ -964,7 +966,7 @@ class FSBrowser { # Pack NoteBook and bottom frame pack [$nb get_nb] -fill both -expand 1 -padx 10 -pady 5 - pack $bottom_frame -anchor e -after $nb -padx 10 -pady 5 + pack $bottom_frame -anchor e -after [$nb get_nb] -padx 10 -pady 5 # Configure dialog window wm title $dialog [mc "Item properties"] diff --git a/lib/leftpanel/sfrwatches.tcl b/lib/leftpanel/sfrwatches.tcl index 8c1a8e4..0f9f1c6 100644 --- a/lib/leftpanel/sfrwatches.tcl +++ b/lib/leftpanel/sfrwatches.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -35,18 +38,18 @@ class SFRWatches { ## COMMON # Font for addresses and register names - common main_font [font create \ + public common main_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight bold \ ] # Just another font but not bold - common roman_font [font create \ + public common roman_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ ] # Fonr for register entry boxes - common entry_font [font create \ + public common entry_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ diff --git a/lib/lib/FSnotifications.tcl b/lib/lib/FSnotifications.tcl index be1d477..33a2699 100644 --- a/lib/lib/FSnotifications.tcl +++ b/lib/lib/FSnotifications.tcl @@ -4,6 +4,9 @@ # Copyright (C) 2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/lib/Math.tcl b/lib/lib/Math.tcl index af5e0ae..c59f2a8 100644 --- a/lib/lib/Math.tcl +++ b/lib/lib/Math.tcl @@ -4,6 +4,9 @@ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/lib/hexeditor.tcl b/lib/lib/hexeditor.tcl index fc3c5e6..f51dc95 100644 --- a/lib/lib/hexeditor.tcl +++ b/lib/lib/hexeditor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -36,49 +39,49 @@ set _HEXEDITOR_TCL _ class HexEditor { # Font for editor text widget(s) - normal size if {!$::MICROSOFT_WINDOWS} { - common view_font_n [font create \ + public common view_font_n [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-15 * $::font_size_factor)}] \ ] } else { - common view_font_n [font create \ + public common view_font_n [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-15 * $::font_size_factor)}] \ -weight bold \ ] } # Font for editor headers - normal size - common header_font_n [font create \ + public common header_font_n [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-15 * $::font_size_factor)}] \ -weight bold \ ] # Font for editor headers - small size - common header_font_s [font create \ + public common header_font_s [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ ] - common view_font_s $header_font_s ;# Font for editor text widget(s) - small size - common header_bg {#9999FF} ;# Background color for headers - common header_fg {#FFFFFF} ;# Foreground color for headers - common n_row_bg {#DDDDDD} ;# Background color for Nth rows - common highlight_fg {#FFAA00} ;# Foreground color for chaged values - common highlight_bg {#888888} ;# Background color for background highlight (variant 0) - common highlight_bg1 {#FFDD33} ;# Background color for background highlight (variant 1) - common highlight_bg2 {#FFAA00} ;# Background color for background highlight (variant 2) - common unprintable_fg {#FF0000} ;# Foreground color for unprintable characters in ascii view - common current_full_bg {#00FF00} ;# Background color for cursor in active view - common current_half_bg {#AAFFAA} ;# Background color for cursor in inactive view + public common view_font_s $header_font_s ;# Font for editor text widget(s) - small size + public common header_bg {#9999FF} ;# Background color for headers + public common header_fg {#FFFFFF} ;# Foreground color for headers + public common n_row_bg {#DDDDDD} ;# Background color for Nth rows + public common highlight_fg {#FFAA00} ;# Foreground color for chaged values + public common highlight_bg {#888888} ;# Background color for background highlight (variant 0) + public common highlight_bg1 {#FFDD33} ;# Background color for background highlight (variant 1) + public common highlight_bg2 {#FFAA00} ;# Background color for background highlight (variant 2) + public common unprintable_fg {#FF0000} ;# Foreground color for unprintable characters in ascii view + public common current_full_bg {#00FF00} ;# Background color for cursor in active view + public common current_half_bg {#AAFFAA} ;# Background color for cursor in inactive view ## Variables related to find dialog - common find_dialog_win {} ;# Widget: Find dialog - common find_dialog_count 0 ;# Int: Counter find dialog opens - common text_to_find {} ;# String: Text/Value to find - common where_to_search left ;# String: Where to search (left or right view) + public common find_dialog_win {} ;# Widget: Find dialog + public common find_dialog_count 0 ;# Int: Counter find dialog opens + public common text_to_find {} ;# String: Text/Value to find + public common where_to_search left ;# String: Where to search (left or right view) ## Array: Find options # fc - Bool: Find option "From cursor" # bw - Bool: Find option "Backwards" - common find_opt + public common find_opt private variable left_top_button ;# ID of button in left top corner (select all) private variable left_address_bar ;# ID of left address bar diff --git a/lib/lib/ihextools.tcl b/lib/lib/ihextools.tcl index 458f799..1b2aa89 100644 --- a/lib/lib/ihextools.tcl +++ b/lib/lib/ihextools.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/lib/innerwindow.tcl b/lib/lib/innerwindow.tcl index 4195e2d..41ad6a0 100644 --- a/lib/lib/innerwindow.tcl +++ b/lib/lib/innerwindow.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -41,12 +44,12 @@ set _INNERWINDOW_TCL _ class InnerWindow { ## COMMON - common active_titclr {#AAAAFF} ;# Color: Active background color - common inactive_titclr {#DDDDDD} ;# Color: Inactive background color - common title_bar_height 10 ;# Int: Height of the titlebar in pixels + public common active_titclr {#AAAAFF} ;# Color: Active background color + public common inactive_titclr {#DDDDDD} ;# Color: Inactive background color + public common title_bar_height 10 ;# Int: Height of the titlebar in pixels # List: Title bar popup menu - common MENU { + public common MENU { {command "Shade/Unshade" "" 0 {collapse_expand} {}} {command "Close" "" 0 {close_window} diff --git a/lib/lib/modern_notebook.tcl b/lib/lib/modern_notebook.tcl index a9760ed..5585f8f 100644 --- a/lib/lib/modern_notebook.tcl +++ b/lib/lib/modern_notebook.tcl @@ -1,10 +1,13 @@ #! /usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -29,8 +32,8 @@ proc ModernNoteBook {pathname args} { } } class ModernNoteBookClass { - common font_size 12 - common button_font [font create -family {helvetica} -size [expr {int(-$font_size * $::font_size_factor)}] -weight {normal}] + public common font_size 12 + public common button_font [font create -family {helvetica} -size [expr {int(-$font_size * $::font_size_factor)}] -weight {normal}] private variable button_counter 0 private variable tab_but_enter_cmd {} diff --git a/lib/lib/settings.tcl b/lib/lib/settings.tcl index 8dd1c53..9cfa881 100644 --- a/lib/lib/settings.tcl +++ b/lib/lib/settings.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -32,8 +35,8 @@ set _SETTINGS_TCL _ # -------------------------------------------------------------------------- class Settings { - common dir_sep [file separator] ;# Directory separator (eg. '/') - common settings_count 0 ;# Counter of instances + public common dir_sep [file separator] ;# Directory separator (eg. '/') + public common settings_count 0 ;# Counter of instances private variable isEmpty 1 ;# Is settings array empty private variable isReady 0 ;# Is interface ready diff --git a/lib/main.tcl b/lib/main.tcl index 115d9a8..e942c00 100755 --- a/lib/main.tcl +++ b/lib/main.tcl @@ -2,12 +2,15 @@ # the next line restarts using wish \ exec tclsh "$0" "$@" -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -41,8 +44,8 @@ set DEBUG 0 ;# Turn on debugging encoding system {utf-8} ;# System encoding set LIB_DIRNAME [file normalize [file dirname $argv0]] ;# Path to directory where the *.tcl file are located set INSTALLATION_DIR [file normalize "$LIB_DIRNAME/.."] ;# Path to the main executable (this file) -set ROOT_DIRNAME [file normalize "$LIB_DIRNAME/.."] ;# On Linux it's the same as INSTALLATION_DIR, but it's different on MS Windows -set VERSION "1.4.7" ;# Version of this IDE +set ROOT_DIRNAME [file normalize "$LIB_DIRNAME/.."] ;# On Linux it's the same as INSTALLATION_DIR but it's different on Windows +set VERSION "1.4.9" ;# Version of this IDE set SHORTNAME "MCU8051IDE" ;# Program short name (without white space) set APPNAME "MCU 8051 IDE v$VERSION" ;# Full program name set MIN_TCL_VER "8.5" ;# Minimum required Tcl version @@ -80,9 +83,15 @@ set LIBRARIES_TO_LOAD { {img::png 1.3} {tdom 0.8} {Tclx 8.0} + {Signal 1.4} {Tcl 8.2} } +set OPTIONAL_LIBRARIES { + Signal + Tclx +} + ## Bool: # 1 == Normal GUI operation # 0 == Program GUI suppressed @@ -97,6 +106,11 @@ set ::GUI_AVAILABLE 1 # we are not able to handle signals, but everything else works normally. set ::TCLX_AVAILABLE 1 +## Bool: + # 1 == library Signal is available + # 0 == library Signal is NOT available +set ::SIGNAL_AVAILABLE 1 + ## Determinate the host OS set ::MICROSOFT_WINDOWS 0 if {[string first {Windows} ${tcl_platform(os)}] != -1} { @@ -140,7 +154,7 @@ if {!$::CLI_OPTION(quiet)} { puts "\tLicense: GNU General Public License version 2 or later" puts "\tPlease report bugs at http://mcu8051ide.sf.net" puts "Authors:" - puts "\tMartin Osmera <martin.osmera@gmail.com>" + puts "\tMartin Osmera <martin.osmera@moravia-microsystems.com>" } else { puts "IMPORTANT INFORMATION :" puts "\tThis program is distributed in the hope that it will be useful, but with \033\[31;1mABSOLUTELY NO WARRANTY !\033\[m" @@ -148,7 +162,7 @@ if {!$::CLI_OPTION(quiet)} { puts "\tLicense: GNU General Public License version 2 or later" puts "\tPlease report bugs at \033\[34;1mhttp://mcu8051ide.sf.net\033\[m" puts "Authors:" - puts "\tMartin Osmera \033\[33;1m<martin.osmera@gmail.com>\033\[m" + puts "\tMartin Osmera \033\[33;1m<martin.osmera@moravia-microsystems.com>\033\[m" } } @@ -159,12 +173,18 @@ proc libraryLoadFailed {library} { # Itcl workarond for Debian if {$library == {Itcl}} { + if {[package vcompare $::tcl_version "8.6"] >= 0} { + if {![catch {package require Itcl}]} { + return + } + } + set library_version "3.4" set libname "libitcl" set ::env(ITCL_LIBRARY) ${::LIB_DIRNAME} - puts stderr "\nERROR: Unable to load Itcl library compatible with this version of Tcl/Tk !" + puts stderr "\nERROR: Unable to load Itcl library compatible with this version of Tcl/Tk!" puts stderr "Trying to workaround ..." if {[lsearch {Linux} ${::tcl_platform(os)}] == -1} { @@ -191,10 +211,18 @@ proc libraryLoadFailed {library} { return } - # Tclx workarond for Debian + # Tclx workarond for Debian (1/2) } elseif {$library == {Tclx}} { set ::TCLX_AVAILABLE 0 - puts stderr "\nERROR: Unable to load Tclx library, functionality will be limited" + puts stderr "\nERROR: Unable to load library Tclx, MCU 805 1IDE functionality might be limited." + return + + # Tclx workarond for Debian (2/2) + } elseif { $library == {Signal} } { + set ::SIGNAL_AVAILABLE 0 + if {!$::TCLX_AVAILABLE} { + puts stderr "\nERROR: Unable to load library Signal, MCU 805 1IDE functionality might be limited." + } return } @@ -748,7 +776,7 @@ if {$CLI_OPTION(minimalized)} { } # Configure signal handling -if {$::TCLX_AVAILABLE} { +if {$::TCLX_AVAILABLE || $::SIGNAL_AVAILABLE} { proc signal_handler {signal_name} { global cntrlc_flag puts stderr [mc "\nExiting on signal %s" $signal_name] @@ -759,8 +787,13 @@ if {$::TCLX_AVAILABLE} { exit 1 } - signal trap SIGINT {signal_handler SIGINT} - signal trap SIGTERM {signal_handler SIGTERM} + if {$::TCLX_AVAILABLE} { + signal trap SIGINT {signal_handler SIGINT} + signal trap SIGTERM {signal_handler SIGTERM} + } else { + signal add SIGINT {signal_handler SIGINT} + signal add SIGTERM {signal_handler SIGTERM} + } } @@ -775,12 +808,14 @@ catch { return ${::COMMON_BG_COLOR} } - set value [Widget::cget $path.f$page $option] - if {![string length $value]} { - set value [Widget::cget $path $option] - } + catch { + set value [Widget::cget $path.f$page $option] + if {![string length $value]} { + set value [Widget::cget $path $option] + } - return $value + return $value + } } destroy .foo } diff --git a/lib/maintab.tcl b/lib/maintab.tcl index b0159ab..f5e87bc 100644 --- a/lib/maintab.tcl +++ b/lib/maintab.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/pale/ds1620.tcl b/lib/pale/ds1620.tcl index 7c1df63..5fd15ae 100644 --- a/lib/pale/ds1620.tcl +++ b/lib/pale/ds1620.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -40,23 +43,23 @@ class Ds1620 { inherit VirtualHWComponent # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] # Font: Font to be used in the panel -- bold - common small_font [font create \ + public common small_font [font create \ -size [expr {int(-9 * $::font_size_factor)}] \ -family {helvetica} \ ] - common COMPONENT_NAME "DS1620 temperature sensor" ;# Name of this component - common CLASS_NAME "Ds1620" ;# Name of this class - common COMPONENT_ICON {ds1620} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "DS1620 temperature sensor" ;# Name of this component + public common CLASS_NAME "Ds1620" ;# Name of this class + public common COMPONENT_ICON {ds1620} ;# Icon for this panel (16x16) # Configuration menu - common CONFMENU { + public common CONFMENU { {checkbutton "Disable delays" {} {::Ds1620::_no_delays} 1 0 0 {no_delays_changed} ""} @@ -77,12 +80,12 @@ class Ds1620 { } # - common STATUS_BITS {DONE THF TLF NVB 1 0 CPU 1SHOT} - common MAX_LOG_LENGTH 100 ;# Int: Maximum number of row in the log window - common SIGNAL_NAMES {DQ CLK RST TH TL TCOM} - common EEPROM_WRITE_CYCLE_TIME 10000 - common T_CONVERSION_TIME_MS 750 - common _no_delays 0 + public common STATUS_BITS {DONE THF TLF NVB 1 0 CPU 1SHOT} + public common MAX_LOG_LENGTH 100 ;# Int: Maximum number of row in the log window + public common SIGNAL_NAMES {DQ CLK RST TH TL TCOM} + public common EEPROM_WRITE_CYCLE_TIME 10000 + public common T_CONVERSION_TIME_MS 750 + public common _no_delays 0 private variable input_error private variable input_error_desc diff --git a/lib/pale/file_interface.tcl b/lib/pale/file_interface.tcl index 58f7293..c130b3c 100644 --- a/lib/pale/file_interface.tcl +++ b/lib/pale/file_interface.tcl @@ -1,11 +1,14 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -37,27 +40,27 @@ class PaleFileInterface { inherit VirtualHWComponent # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] - common text_font [font create \ + public common text_font [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -family ${::DEFAULT_FIXED_FONT} \ ] - common text_font_bold [font create \ + public common text_font_bold [font create \ -weight bold \ -size [expr {int(-12 * $::font_size_factor)}] \ -family ${::DEFAULT_FIXED_FONT} \ ] - common COMPONENT_NAME "VHW File Interface" ;# Name of this component - common CLASS_NAME "PaleFileInterface" ;# Name of this class - common COMPONENT_ICON {compfile1} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "VHW File Interface" ;# Name of this component + public common CLASS_NAME "PaleFileInterface" ;# Name of this class + public common COMPONENT_ICON {compfile1} ;# Icon for this panel (16x16) # Configuration menu - common CONFMENU { + public common CONFMENU { {command {Sync. files now} {} 1 "sync" {filesave} "Flush output file buffer"} {checkbutton "Keep files synchronized" {} {::PaleFileInterface::_keep_sync} @@ -77,7 +80,7 @@ class PaleFileInterface { ""} } - common _keep_sync 0 + public common _keep_sync 0 private variable connection_port ;# Array of Int: Index is key number, value is port number or {-} private variable connection_pin ;# Array of Int: Index is key number, value is bit number or {-} diff --git a/lib/pale/hd44780_cgrom.tcl b/lib/pale/hd44780_cgrom.tcl index 0ce00c7..b2c2f0c 100644 --- a/lib/pale/hd44780_cgrom.tcl +++ b/lib/pale/hd44780_cgrom.tcl @@ -1,11 +1,14 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011 by Martin Ošmera and Monika Říhová (so far) # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -59,7 +62,7 @@ # # ------------------------------------------------------------------------------ -common CGROM { + public common CGROM { { { {0 0 0 0 0} {0 0 0 0 0} {0 0 0 0 0} {0 0 0 0 0} {0 0 0 0 0} diff --git a/lib/pale/lcd_hd44780.tcl b/lib/pale/lcd_hd44780.tcl index 58484b5..15ad262 100644 --- a/lib/pale/lcd_hd44780.tcl +++ b/lib/pale/lcd_hd44780.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -43,12 +46,12 @@ set _LCD_HD44780_TCL _ class LcdHD44780 { inherit VirtualHWComponent - common COMPONENT_NAME "LCD display" ;# Name of this component - common CLASS_NAME "LcdHD44780" ;# Name of this class - common COMPONENT_ICON {hd44780} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "LCD display" ;# Name of this component + public common CLASS_NAME "LcdHD44780" ;# Name of this class + public common COMPONENT_ICON {hd44780} ;# Icon for this panel (16x16) # Configuration menu - common CONFMENU { + public common CONFMENU { {cascade "Set font" 0 "hd44780" .set_rom_code false 1 { {radiobutton "ROM code A00" {} ::LcdHD44780::font_id {0} @@ -101,34 +104,34 @@ class LcdHD44780 { } # Font: Font to be used in the panel -- bold - common common_font [font create \ + public common common_font [font create \ -weight bold \ -size [expr {int(-10 * ($::font_size_factor > 1.2 ? 1.2 : $font_size_factor))}] \ -family {helvetica} \ ] # Font: Font to be used in the panel -- bold, underline - common common_font_u [font create \ + public common common_font_u [font create \ -weight bold \ -size [expr {int(-10 * ($::font_size_factor > 1.2 ? 1.2 : $font_size_factor))}] \ -family {helvetica} \ -underline 1 \ ] - common ON_COLOR {#000000} ;# RGB: Color for darken pixels - common OFF_COLOR {#DDDDDD} ;# RGB: Color for blank pixels - common USER_DEF_COLOR {#AAAAFF} ;# RGB: Color used in CGROM table for user defined characters + public common ON_COLOR {#000000} ;# RGB: Color for darken pixels + public common OFF_COLOR {#DDDDDD} ;# RGB: Color for blank pixels + public common USER_DEF_COLOR {#AAAAFF} ;# RGB: Color used in CGROM table for user defined characters # List: Names of IO signals of the simulated LCD display controller - common SIGNAL_NAMES [list {RS} {R/W} {E} {D7} {D6} {D5} {D4} {D3} {D2} {D1} {D0}] + public common SIGNAL_NAMES [list {RS} {R/W} {E} {D7} {D6} {D5} {D4} {D3} {D2} {D1} {D0}] # List: Keys for the array (status_led) of status LEDs - common STATUS_LEDS_NAMES [list {B} {S} {D} {C} {N} {F} {ID} {DL} {OMN} {BF}] + public common STATUS_LEDS_NAMES [list {B} {S} {D} {C} {N} {F} {ID} {DL} {OMN} {BF}] # List: Labels displayed beside of the status LEDs - common STATUS_LEDS_TEXTS [list {B} {S} {D} {C} {N} {F} {I/D} {DL} {OMN} {BF}] + public common STATUS_LEDS_TEXTS [list {B} {S} {D} {C} {N} {F} {I/D} {DL} {OMN} {BF}] # List: Help texts for the labels of the status LEDs - common STATUS_LEDS_HELPTEXTS [list \ + public common STATUS_LEDS_HELPTEXTS [list \ [mc "Cursor blinking"] \ [mc "Accompanies display shift"] \ [mc "Display ON/OFF"] \ @@ -140,14 +143,14 @@ class LcdHD44780 { [mc "One More Nibble to transfer / data transfer complete"] \ [mc "Internally operating / Instructions acceptable"] \ ] - common MAX_LOG_LENGTH 100 ;# Int: Maximum number of row in the log window - common CURSOR_BLINK_FREQUENCY 3 ;# Int: Frequency (in Hz) of cursor blinking + public common MAX_LOG_LENGTH 100 ;# Int: Maximum number of row in the log window + public common CURSOR_BLINK_FREQUENCY 3 ;# Int: Frequency (in Hz) of cursor blinking # Values used by the configuration menu - common _no_delays 0 ;# Bool: Disable delays (simulated execution times) - common _ignore_errors 0 ;# Bool: Do not display special error message dialog in cases when an error occurs - common font_id 0 ;# Int: Font ID to be used for addressing the CGROM - common char_size 0 ;# Bool: Character height from the HW point of view, 0 == 5x8; 1==5x10 + public common _no_delays 0 ;# Bool: Disable delays (simulated execution times) + public common _ignore_errors 0 ;# Bool: Do not display special error message dialog in cases when an error occurs + public common font_id 0 ;# Int: Font ID to be used for addressing the CGROM + public common char_size 0 ;# Bool: Character height from the HW point of view, 0 == 5x8; 1==5x10 # Load CGROM source "${::LIB_DIRNAME}/pale/hd44780_cgrom.tcl" @@ -1671,6 +1674,7 @@ class LcdHD44780 { } else { incr display_shift } + set display_shift [expr {$display_shift % 0x80}] # Move cursor } else { set address_counter_old $address_counter @@ -1681,6 +1685,7 @@ class LcdHD44780 { } else { incr address_counter -1 } + set address_counter [expr {$address_counter % 0x80}] move_cursor $address_counter } @@ -2569,14 +2574,14 @@ class LcdHD44780 { set signal_value 0 } default { - if {$diver_cfg(DL) || $i >= 7} { +# if {$diver_cfg(DL) || $i >= 7} { set input_error 1 set input_error_desc [mc \ "Received an invalid input on signal %s" \ [lindex $SIGNAL_NAMES $i] ] set signal_value [expr {rand() > 0.5 ? 1 : 0}] - } +# } } } diff --git a/lib/pale/leddisplay.tcl b/lib/pale/leddisplay.tcl index 44cc7ad..d5a8a7f 100644 --- a/lib/pale/leddisplay.tcl +++ b/lib/pale/leddisplay.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -41,19 +44,19 @@ class LedDisplay { inherit VirtualHWComponent # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] - common COMPONENT_NAME "LED Display" ;# Name of this component - common CLASS_NAME "LedDisplay" ;# Name of this class - common COMPONENT_ICON {leddisplay} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "LED Display" ;# Name of this component + public common CLASS_NAME "LedDisplay" ;# Name of this class + public common COMPONENT_ICON {leddisplay} ;# Icon for this panel (16x16) ## Colors for display segments # There are 6 lists (red orange yellow green blue purple) # and each of them contain 3 colors (semi-dim bright dim) - common COLORS { + public common COLORS { {#AA5555 #FF0000} {#AAAA55 #FF8800} {#AAAA55 #FFFF00} @@ -62,10 +65,10 @@ class LedDisplay { {#5555AA #0000FF} {#AA55AA #8800FF} } - common DIMMED_COLOR {#BBBBBB} + public common DIMMED_COLOR {#BBBBBB} # Configuration menu - common CONFMENU { + public common CONFMENU { {cascade {Common electrode} 7 "diode" .ca false 1 { {radiobutton "Common anode" {} ::LedDisplay::cfg_common_anode 1 diff --git a/lib/pale/ledmatrix.tcl b/lib/pale/ledmatrix.tcl index 1be1718..5a11a22 100644 --- a/lib/pale/ledmatrix.tcl +++ b/lib/pale/ledmatrix.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -41,17 +44,17 @@ class LedMatrix { inherit VirtualHWComponent # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] - common COMPONENT_NAME "LED Matrix" ;# Name of this component - common CLASS_NAME "LedMatrix" ;# Name of this class - common COMPONENT_ICON {ledmatrix} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "LED Matrix" ;# Name of this component + public common CLASS_NAME "LedMatrix" ;# Name of this class + public common COMPONENT_ICON {ledmatrix} ;# Icon for this panel (16x16) # Configuration menu - common CONFMENU { + public common CONFMENU { {cascade {Fade out interval} 5 "player_time" .dim false 1 { {radiobutton "0" {} ::LedMatrix::dim_interval 0 diff --git a/lib/pale/ledpanel.tcl b/lib/pale/ledpanel.tcl index a39799f..bfa4c25 100644 --- a/lib/pale/ledpanel.tcl +++ b/lib/pale/ledpanel.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -41,17 +44,17 @@ class LedPanel { inherit VirtualHWComponent # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] - common COMPONENT_NAME "LED Panel" ;# Name of this component - common CLASS_NAME "LedPanel" ;# Name of this class - common COMPONENT_ICON {ledpanel} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "LED Panel" ;# Name of this component + public common CLASS_NAME "LedPanel" ;# Name of this class + public common COMPONENT_ICON {ledpanel} ;# Icon for this panel (16x16) # Configuration menu - common CONFMENU { + public common CONFMENU { {cascade {Color} 0 "colorize" .color false 1 { {radiobutton "Red" {} ::LedPanel::color {red} diff --git a/lib/pale/matrixkeypad.tcl b/lib/pale/matrixkeypad.tcl index 9400741..076369b 100644 --- a/lib/pale/matrixkeypad.tcl +++ b/lib/pale/matrixkeypad.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -41,23 +44,23 @@ class MatrixKeyPad { inherit VirtualHWComponent # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] # Font: Font to be used in the panel -- normal weight - common cb_font_n [font create \ + public common cb_font_n [font create \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] - common COMPONENT_NAME "Matrix Keypad" ;# Name of this component - common CLASS_NAME "MatrixKeyPad" ;# Name of this class - common COMPONENT_ICON {matrixkeypad} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "Matrix Keypad" ;# Name of this component + public common CLASS_NAME "MatrixKeyPad" ;# Name of this class + public common COMPONENT_ICON {matrixkeypad} ;# Icon for this panel (16x16) # Configuration menu - common CONFMENU { + public common CONFMENU { {checkbutton "Radio buttons" {} {::MatrixKeyPad::menu_radio_buttons} 1 0 0 {value_radio_buttons_changed} ""} diff --git a/lib/pale/multiplexedleddisplay.tcl b/lib/pale/multiplexedleddisplay.tcl index 8fcf042..81d86bd 100644 --- a/lib/pale/multiplexedleddisplay.tcl +++ b/lib/pale/multiplexedleddisplay.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -40,19 +43,19 @@ class MultiplexedLedDisplay { inherit VirtualHWComponent # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] - common COMPONENT_NAME "Multiplexed LED Display" ;# Name of this component - common CLASS_NAME "MultiplexedLedDisplay" ;# Name of this class - common COMPONENT_ICON {mleddisplay} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "Multiplexed LED Display" ;# Name of this component + public common CLASS_NAME "MultiplexedLedDisplay" ;# Name of this class + public common COMPONENT_ICON {mleddisplay} ;# Icon for this panel (16x16) ## Colors for display segments # There are 6 lists (red orange yellow green blue purple) # and each of them contain 3 colors (semi-dim bright dim) - common COLORS { + public common COLORS { {#AA5555 #FF0000 #FF5555} {#AAAA55 #FF8800 #FFCC55} {#AAAA55 #FFFF00 #FFFF55} @@ -61,10 +64,10 @@ class MultiplexedLedDisplay { {#5555AA #0000FF #5555FF} {#AA55AA #8800FF #CC55FF} } - common DIMMED_COLOR {#BBBBBB} + public common DIMMED_COLOR {#BBBBBB} # Configuration menu - common CONFMENU { + public common CONFMENU { {cascade {Common electrode} 7 "diode" .ca false 1 { {radiobutton "Common anode" {} ::MultiplexedLedDisplay::cfg_common_anode 1 diff --git a/lib/pale/pale.tcl b/lib/pale/pale.tcl index 37a3fe1..eb52672 100644 --- a/lib/pale/pale.tcl +++ b/lib/pale/pale.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/pale/simplekeypad.tcl b/lib/pale/simplekeypad.tcl index 0889106..0500fb5 100644 --- a/lib/pale/simplekeypad.tcl +++ b/lib/pale/simplekeypad.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -41,23 +44,23 @@ class SimpleKeyPad { inherit VirtualHWComponent # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] # Font: Font to be used in the panel -- normal weight - common cb_font_n [font create \ + public common cb_font_n [font create \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] - common COMPONENT_NAME "Simple Keypad" ;# Name of this component - common CLASS_NAME "SimpleKeyPad" ;# Name of this class - common COMPONENT_ICON {simplekeypad} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "Simple Keypad" ;# Name of this component + public common CLASS_NAME "SimpleKeyPad" ;# Name of this class + public common COMPONENT_ICON {simplekeypad} ;# Icon for this panel (16x16) # Configuration menu - common CONFMENU { + public common CONFMENU { {checkbutton "Radio buttons" {} {::SimpleKeyPad::menu_radio_buttons} 1 0 0 {value_radio_buttons_changed} ""} diff --git a/lib/pale/virtual_hw_component.tcl b/lib/pale/virtual_hw_component.tcl index c7a637d..4ad3be9 100644 --- a/lib/pale/virtual_hw_component.tcl +++ b/lib/pale/virtual_hw_component.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,16 +36,16 @@ set _VIRTUAL_HW_COMPONENT_TCL _ # -------------------------------------------------------------------------- class VirtualHWComponent { - common count 0 ;# Int: Counter of object instances - common hlp_dlg_count 0 ;# Int: Counter of help dialog instances + public common count 0 ;# Int: Counter of object instances + public common hlp_dlg_count 0 ;# Int: Counter of help dialog instances # Create fonts used in the text - common hlp_normal_font [font create \ + public common hlp_normal_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight {normal} \ ] - common hlp_bold_font [font create \ + public common hlp_bold_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight {bold} \ diff --git a/lib/pale/virtual_uart_term.tcl b/lib/pale/virtual_uart_term.tcl index f78b803..0eaf35c 100644 --- a/lib/pale/virtual_uart_term.tcl +++ b/lib/pale/virtual_uart_term.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -35,51 +38,51 @@ class VirtualUARTTerminal { inherit VirtualHWComponent # Font: Big bold font - common bold_font [font create \ + public common bold_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] -weight {bold} \ ] # Font: Tiny normal font - common tiny_font [font create \ + public common tiny_font [font create \ -family {helvetica} \ -size [expr {int(-9 * $::font_size_factor)}] -weight {normal} \ ] # Font: Tiny bold font - common tiny_font_bold [font create \ + public common tiny_font_bold [font create \ -family {helvetica} \ -size [expr {int(-9 * $::font_size_factor)}] -weight {bold} \ ] # Font: Normal font - common normal_font [font create \ + public common normal_font [font create \ -family {helvetica} \ -size [expr {int(-11 * $::font_size_factor)}] -weight {normal} \ ] # Font: Also normal font, but a bit larger - common big_font [font create \ + public common big_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] -weight {normal} \ ] # Font: Font to be used in the panel -- bold - common cb_font [font create \ + public common cb_font [font create \ -weight bold \ -size [expr {int(-10 * $::font_size_factor)}] \ -family {helvetica} \ ] # List of Int: Available baud rates for RS232 - common available_baud_rates { + public common available_baud_rates { 50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 57600 115200 230400 460800 } - common COMPONENT_NAME "Virtual UART Terminal" ;# Name of this component - common CLASS_NAME "VirtualUARTTerminal" ;# Name of this class - common COMPONENT_ICON {chardevice} ;# Icon for this panel (16x16) + public common COMPONENT_NAME "Virtual UART Terminal" ;# Name of this component + public common CLASS_NAME "VirtualUARTTerminal" ;# Name of this class + public common COMPONENT_ICON {chardevice} ;# Icon for this panel (16x16) # Configuration menu - common CONFMENU { + public common CONFMENU { {command {Show log window} {} 5 "show_log" {bar5} "Display the log of events which are currently happening in the simulated UART driver"} {separator} @@ -96,11 +99,11 @@ class VirtualUARTTerminal { ""} } - common rect_size 12 - common empty_fill {#888888} - common empty_outline {#AAAAAA} + public common rect_size 12 + public common empty_fill {#888888} + public common empty_outline {#AAAAAA} - common MAX_LOG_LENGTH 100 ;# Int: Maximum number of row in the log window + public common MAX_LOG_LENGTH 100 ;# Int: Maximum number of row in the log window ## PRIVATE private variable status_bar_label ;# Widget: Status bar diff --git a/lib/project.tcl b/lib/project.tcl index bdab27a..6e7023a 100644 --- a/lib/project.tcl +++ b/lib/project.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/receive_and_print.tcl b/lib/receive_and_print.tcl index 1d082f3..0d18bb4 100644 --- a/lib/receive_and_print.tcl +++ b/lib/receive_and_print.tcl @@ -2,12 +2,15 @@ # the next line restarts using wish \ exec tclsh "$0" "$@" -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/rightpanel/hwmanager.tcl b/lib/rightpanel/hwmanager.tcl index 133d821..0e66fc8 100644 --- a/lib/rightpanel/hwmanager.tcl +++ b/lib/rightpanel/hwmanager.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,14 +36,14 @@ set _HWMANAGER_TCL _ class HwManager { ## COMMON - common PLUGIN_SEARCH_PATHS { + public common PLUGIN_SEARCH_PATHS { /usr/share/mcu8051ide/hwplugins /usr/local/share/mcu8051ide/hwplugins } if {$::MICROSOFT_WINDOWS} { set PLUGIN_SEARCH_PATHS ${::INSTALLATION_DIR}/hwplugins } - common inst_plg_count 0 ;# Int: Number of installed plugins + public common inst_plg_count 0 ;# Int: Number of installed plugins ## PRIVATE private variable parent ;# Widget: parent widget diff --git a/lib/rightpanel/instructiondetails.tcl b/lib/rightpanel/instructiondetails.tcl index 88f0206..711ada7 100644 --- a/lib/rightpanel/instructiondetails.tcl +++ b/lib/rightpanel/instructiondetails.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -35,9 +38,9 @@ class InstructionDetails { ## COMMON # Conter of instances - common instd_count 0 + public common instd_count 0 # Font for instruction details - common instruction_font [font create \ + public common instruction_font [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -family $::DEFAULT_FIXED_FONT \ ] @@ -46,7 +49,7 @@ class InstructionDetails { # {tag_name foreground_color ?bold_or_italic?} # ... # } - common instruction_tags { + public common instruction_tags { {tag_code8 #00AA00 0} {tag_code11 #00AA33 0} {tag_code16 #00AA55 0} @@ -75,8 +78,8 @@ class InstructionDetails { # . . # . . # } - common HELP_FOR_DIRECTIVES {} - common HELP_FOR_DIRECTIVES_RAW { + public common HELP_FOR_DIRECTIVES {} + public common HELP_FOR_DIRECTIVES_RAW { elseif {Conditional assembly\n\nSyntax:\n ELSEIF <expr>\n\nExample:\n IF(2 * 4 - CND)\n MOV A, #20h\n ELSEIF SOMETHING_ELSE\n MOV A, #40h\n ENDIF\n\n} ifn {IF Not, conditional assembly\n\nSyntax:\n IFN <expr>\n\nExample:\n IF(2 * 4 - CND)\n MOV A, #20h\n ELSE\n MOV A, #40h\n ENDIF\n\n} elseifn {ELSE IF Not\n\nSyntax:\n ELSEIFN <expr>\n\nExample:\n IF(2 * 4 - CND)\n MOV A, #20h\n ELSEIFN SOMETHING_ELSE\n MOV A, #40h\n ENDIF\n\n} @@ -199,7 +202,7 @@ class InstructionDetails { # {affected flags in order: C OV AC, for instance "{0 X 1}"} # } # } - common INSTRUCTION_DESCRIPTION { + public common INSTRUCTION_DESCRIPTION { {ADD A, Rn} { {Add register to Accumulator} {Arithmetic Operations} diff --git a/lib/rightpanel/regwatches.tcl b/lib/rightpanel/regwatches.tcl index 6760cab..2ff6d8a 100644 --- a/lib/rightpanel/regwatches.tcl +++ b/lib/rightpanel/regwatches.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -34,27 +37,27 @@ set _REGWATCHES_TCL _ class RegWatches { ## COMMON - common watches_set_shortcuts {} ;# Currently set shortcuts for register watches - common watches_shortcuts_cat {watches} ;# Key shortcut categories related to register watches + public common watches_set_shortcuts {} ;# Currently set shortcuts for register watches + public common watches_shortcuts_cat {watches} ;# Key shortcut categories related to register watches # Counter of embedded entry widgets in register watches - common watch_entry_count 0 + public common watch_entry_count 0 # Conter of instances - common regw_count 0 + public common regw_count 0 ## Highlighting tags for register watches # { # {tag_name foreground_color ?bold_or_italic?} # ... # } - common watch_text_tags { + public common watch_text_tags { {tag_Baddr #DD0000 1} {tag_Xaddr #AA00FF 1} {tag_Eaddr #00AAFF 1} {tag_addr #0000DD 1} {tag_name #8888DD {}} } - common regfont [font create -family $::DEFAULT_FIXED_FONT -size [expr {int(-14 * $::font_size_factor)}]] + public common regfont [font create -family $::DEFAULT_FIXED_FONT -size [expr {int(-14 * $::font_size_factor)}]] # Popup menu for register watches - common WATCHMENU { + public common WATCHMENU { {command {Move top} {$watches:top} 0 "rightPanel_watch_move_top" {top} "Move this register watch to the top of list"} {command {Move up} {$watches:up} 0 "rightPanel_watch_move_up" @@ -76,7 +79,7 @@ class RegWatches { "Configure this panel"} } # Configuration menu - common CONFMENU { + public common CONFMENU { {cascade "Sort by" 0 "" .sort false 1 { {command "Name" {} 0 "rightPanel_watch_sort_by N" {} ""} diff --git a/lib/rightpanel/rightpanel.tcl b/lib/rightpanel/rightpanel.tcl index 81bbb37..c5a95cd 100644 --- a/lib/rightpanel/rightpanel.tcl +++ b/lib/rightpanel/rightpanel.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -48,17 +51,17 @@ class RightPanel { ## COMMON # Background color for selected rows -- light - common selection_color {#EEFFDD} + public common selection_color {#EEFFDD} # Background color for selected rows -- dark - common selection_color_dark {#DDDDFF} + public common selection_color_dark {#DDDDFF} # Default font size for text widgets - common fontSize ${Editor::fontSize} + public common fontSize ${Editor::fontSize} # Default font family for text widgets - common fontFamily ${Editor::fontFamily} + public common fontFamily ${Editor::fontFamily} # Font used in Editor - common editor_font [font create -size -$fontSize -family $fontFamily] + public common editor_font [font create -size -$fontSize -family $fontFamily] # Definition of popup menu for bookmark list - common BOOKMARKMENU { + public common BOOKMARKMENU { {command {Remove} {$edit:bookmark} 0 "editor_procedure {} Bookmark {}" {button_cancel} "Add/Remove editor bookmark to/from current line"} {separator} @@ -71,7 +74,7 @@ class RightPanel { {editdelete} "Remove all bookmarks from the editor"} } # Definition of popup menu for breakpoint list - common BREAKPOINTMENU { + public common BREAKPOINTMENU { {command {Remove} {$edit:breakpoint} 0 "editor_procedure {} Breakpoint {}" {button_cancel} "Add/Remove editor breakpoint to/from current line"} {separator} @@ -84,7 +87,7 @@ class RightPanel { {editdelete} "Remove all breakpoints from the editor"} } # Definition of popup menu for symbols list - common SYMBOLSKMENU {} + public common SYMBOLSKMENU {} ## PRIVATE private variable notebook_frame ;# ID of panel main frame diff --git a/lib/rightpanel/subprograms.tcl b/lib/rightpanel/subprograms.tcl index c8380cb..28f34e6 100644 --- a/lib/rightpanel/subprograms.tcl +++ b/lib/rightpanel/subprograms.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,25 +36,25 @@ set _SUBPROGRAMS_TCL _ class SubPrograms { ## COMMON - common fsd_filename {} ;# Filename choosen by FSD + public common fsd_filename {} ;# Filename choosen by FSD # Main font for the text widget - common main_font [font create \ + public common main_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ ] # Bold font for the text widget - common bold_font [font create \ + public common bold_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight {bold} \ ] # Font for status bar below the text box - common large_font [font create \ + public common large_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ ] # Bold font for status bar below the text box - common large_bold_font [font create \ + public common large_bold_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight {bold} \ diff --git a/lib/simulator/bitmap.tcl b/lib/simulator/bitmap.tcl index c2b4623..0090bcb 100644 --- a/lib/simulator/bitmap.tcl +++ b/lib/simulator/bitmap.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,36 +36,36 @@ set _BITMAP_TCL _ class BitMap { ## COMMON - common btmap_count 0 ;# Int: Counter of object instances + public common btmap_count 0 ;# Int: Counter of object instances # Last window geometry - common win_geometry [lindex $::CONFIG(BITMAP_CONFIG) 0] - - common bit_addr_clr {#0000FF} ;# Color: Bit address - common reg_addr_clr {#00DD00} ;# Color: Register address - common rect_size 14 ;# Int: Size of rectangle repersenting one bit - common rect_sep 2 ;# Int: Space between bits - common reg_sep 4 ;# Int: Space between octetes - common row_sep 4 ;# Int: Space between rows - common bm_x_org 50 ;# Int: Bitmap origin (X) - common bm_y_org 20 ;# Int: Bitmap origin (Y) - - common zero_fill #FF0000 ;# Color: Bit fill color for log. 0 (Non-selected) - common zero_outline #FF8888 ;# Color: Bit outline color for log. 0 (Non-selected) - common zero_a_fill #FF8888 ;# Color: Bit fill color for log. 0 (Selected bit) - common zero_a_outline #FFDDDD ;# Color: Bit outline color for log. 0 (Selected bit) - - common one_fill #00FF00 ;# Color: Bit color for log. 1 (Non-selected) - common one_outline #88FF88 ;# Color: Bit outline color for log. 1 (Non-selected) - common one_a_fill #88FF88 ;# Color: Bit fill color for log. 1 (Selected bit) - common one_a_outline #DDFFDD ;# Color: Bit outline color for log. 1 (Selected bit) + public common win_geometry [lindex $::CONFIG(BITMAP_CONFIG) 0] + + public common bit_addr_clr {#0000FF} ;# Color: Bit address + public common reg_addr_clr {#00DD00} ;# Color: Register address + public common rect_size 14 ;# Int: Size of rectangle repersenting one bit + public common rect_sep 2 ;# Int: Space between bits + public common reg_sep 4 ;# Int: Space between octetes + public common row_sep 4 ;# Int: Space between rows + public common bm_x_org 50 ;# Int: Bitmap origin (X) + public common bm_y_org 20 ;# Int: Bitmap origin (Y) + + public common zero_fill #FF0000 ;# Color: Bit fill color for log. 0 (Non-selected) + public common zero_outline #FF8888 ;# Color: Bit outline color for log. 0 (Non-selected) + public common zero_a_fill #FF8888 ;# Color: Bit fill color for log. 0 (Selected bit) + public common zero_a_outline #FFDDDD ;# Color: Bit outline color for log. 0 (Selected bit) + + public common one_fill #00FF00 ;# Color: Bit color for log. 1 (Non-selected) + public common one_outline #88FF88 ;# Color: Bit outline color for log. 1 (Non-selected) + public common one_a_fill #88FF88 ;# Color: Bit fill color for log. 1 (Selected bit) + public common one_a_outline #DDFFDD ;# Color: Bit outline color for log. 1 (Selected bit) # Font: Normal font for canvas widget - common bitmap_n_font [font create \ + public common bitmap_n_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ ] # Font: Bold font for canvas widget - common bitmap_b_font [font create \ + public common bitmap_b_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ diff --git a/lib/simulator/engine/engine_auxiliary_alo_functions.tcl b/lib/simulator/engine/engine_auxiliary_alo_functions.tcl index 8929268..44392c3 100644 --- a/lib/simulator/engine/engine_auxiliary_alo_functions.tcl +++ b/lib/simulator/engine/engine_auxiliary_alo_functions.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -53,9 +56,10 @@ private method undefined_octet {} { } ## Add value to accumulator and affect PSW flags - # @parm Int val - value to add + # @parm Int val - value to add + # @parm Int carry - addtional value to add (ment for the Carry flag) # @return void -private method alo_add {val} { +private method alo_add {val {carry 0}} { # Adjust stepback stack if {${::Simulator::reverse_run_steps}} { @@ -69,7 +73,7 @@ private method alo_add {val} { set val_l [expr {$val & 15}] ;# Low-order nibble of val # Compute low-order nibble of result - set result [expr {$val_l + $A_l}] + set result [expr {$val_l + $A_l + $carry}] # Flag AC if {$result > 15} { @@ -109,10 +113,7 @@ private method alo_add {val} { # @parm Int val - value to add # @return void private method alo_addc {val} { - if {[getBit $symbol(C)]} { - incr val - } - alo_add $val + alo_add $val [getBit $symbol(C)] } ## Subtract tegister from ACC with borrow and affect PSW flags @@ -126,8 +127,9 @@ private method alo_subb {val} { } # Flag PSW.C + set carry 0 if {[getBit $symbol(C)]} { - incr val + set carry 1 } # Local variables @@ -137,7 +139,7 @@ private method alo_subb {val} { set val_l [expr {$val & 15}] ;# Low-order nibble of val # Compute low-order nibble of result - set result_l [expr {$A_l - $val_l}] + set result_l [expr {$A_l - $val_l - $carry}] # Flag AC if {$result_l < 0} { diff --git a/lib/simulator/engine/engine_backward_stepping.tcl b/lib/simulator/engine/engine_backward_stepping.tcl index 7914c9b..af5e7d9 100644 --- a/lib/simulator/engine/engine_backward_stepping.tcl +++ b/lib/simulator/engine/engine_backward_stepping.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_control.tcl b/lib/simulator/engine/engine_control.tcl index 6b76b5a..33fbe84 100644 --- a/lib/simulator/engine/engine_control.tcl +++ b/lib/simulator/engine/engine_control.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_core.tcl b/lib/simulator/engine/engine_core.tcl index 0c78129..6b169f1 100644 --- a/lib/simulator/engine/engine_core.tcl +++ b/lib/simulator/engine/engine_core.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -58,20 +61,20 @@ class Simulator_ENGINE { inherit Hibernate ;# Import hibernation facility ## COMMON - common symbol ;# Array of SFR symbolic names (eg. $symbol(P0) == "80") - common PIN ;# Array describing pins with some special function - common PORT_LATCHES ;# List: Port latch registers - common GUI_UPDATE_INT 66;# Int: Time interval [ms] in which the GUI is regulary updated in the run mode + public common symbol ;# Array of SFR symbolic names (eg. $symbol(P0) == "80") + public common PIN ;# Array describing pins with some special function + public common PORT_LATCHES ;# List: Port latch registers + public common GUI_UPDATE_INT 66;# Int: Time interval [ms] in which the GUI is regulary updated in the run mode # Default values for SFR (values to set after reset) - common reset_reg_values { + public common reset_reg_values { {A 0} {B 0} {DP0L 0} {DP0H 0} {IE 0} {IP 0} {PSW 0} {TCON 0} {TMOD 0} {TH0 0} {TH1 0} {TL0 0} {TL1 0} {PCON 0} {SP 7} } # Default values for special (uC dependend) SFR (values to set after reset) - common reset_reg_values_1 { + public common reset_reg_values_1 { {T2CON 0} {T2MOD 0} {RCAP2L 0} {RCAP2H 0} {TL2 0} {TH2 0} {AUXR1 0} {ACSR 0} {AUXR 0} {P0 255} {P1 255} {P2 255} diff --git a/lib/simulator/engine/engine_external_interface_management.tcl b/lib/simulator/engine/engine_external_interface_management.tcl index 5a1f220..028e824 100644 --- a/lib/simulator/engine/engine_external_interface_management.tcl +++ b/lib/simulator/engine/engine_external_interface_management.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1100,8 +1103,8 @@ public method getTime {} { } # Local variables - set us [expr {($ms % 1000)}] ;# Number of micro seconds - set ms [expr {$ms / 1000}] ;# Number of mili seconds + set us [expr {($ms % 1000)}] ;# Number of microseconds + set ms [expr {$ms / 1000}] ;# Number of miliseconds set s [expr {int($s)}] ;# Number of seconds set h [expr {$s / 3600}] ;# Number of hours set s [expr {$s % 3600}] @@ -1111,7 +1114,7 @@ public method getTime {} { # Adjust length of nano-seconds string set len [string length $ns] if {$len < 3} { - set ns_s "[string repeat { } [expr {3 - $len}]]$ns" + set ns_s "[string repeat {0} [expr {3 - $len}]]$ns" } else { set ns_s $ns } @@ -1165,11 +1168,7 @@ public method getTime {} { } # Append micro-seconds if {$us > 0 || $result != {}} { - append result " ${us_s}µs" - } - # Append nano-seconds - if {$ns > 0 || $result != {}} { - append result " ${ns_s}ns" + append result " ${us_s}.${ns_s}µs" } # Done ... diff --git a/lib/simulator/engine/engine_hibernation.tcl b/lib/simulator/engine/engine_hibernation.tcl index d5a5faa..b34d828 100644 --- a/lib/simulator/engine/engine_hibernation.tcl +++ b/lib/simulator/engine/engine_hibernation.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_initialization_cleanup.tcl b/lib/simulator/engine/engine_initialization_cleanup.tcl index 8865dd2..d0a238c 100644 --- a/lib/simulator/engine/engine_initialization_cleanup.tcl +++ b/lib/simulator/engine/engine_initialization_cleanup.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_instructions.tcl b/lib/simulator/engine/engine_instructions.tcl index 19c45af..a606f93 100644 --- a/lib/simulator/engine/engine_instructions.tcl +++ b/lib/simulator/engine/engine_instructions.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -1014,6 +1017,7 @@ private method ins_movx {opr0 opr1} { # Adjust engine configuration set eeprom_WR_time 1 set eeprom_WR 1 + $this simulator_GUI_invoke_write_to_eeprom } return diff --git a/lib/simulator/engine/engine_mcu_configuration.tcl b/lib/simulator/engine/engine_mcu_configuration.tcl index 2226a7d..3fc12dd 100644 --- a/lib/simulator/engine/engine_mcu_configuration.tcl +++ b/lib/simulator/engine/engine_mcu_configuration.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_memory_management.tcl b/lib/simulator/engine/engine_memory_management.tcl index e3a5828..5d74906 100644 --- a/lib/simulator/engine/engine_memory_management.tcl +++ b/lib/simulator/engine/engine_memory_management.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_opcodes.tcl b/lib/simulator/engine/engine_opcodes.tcl index e06dc12..17bca3d 100644 --- a/lib/simulator/engine/engine_opcodes.tcl +++ b/lib/simulator/engine/engine_opcodes.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/engine/engine_text_based_interface.tcl b/lib/simulator/engine/engine_text_based_interface.tcl index 0b6448c..ef61a61 100644 --- a/lib/simulator/engine/engine_text_based_interface.tcl +++ b/lib/simulator/engine/engine_text_based_interface.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011-2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -109,7 +112,7 @@ namespace eval SimulatorEngineCLI { class SimEngineWrapper { inherit Simulator_ENGINE Pale - common changed_registers [list] + public common changed_registers [list] # TODO: get rid of these variables: public variable procData {} diff --git a/lib/simulator/engine/engine_virtual_hw_controller.tcl b/lib/simulator/engine/engine_virtual_hw_controller.tcl index a13c9b9..3413eb3 100644 --- a/lib/simulator/engine/engine_virtual_hw_controller.tcl +++ b/lib/simulator/engine/engine_virtual_hw_controller.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # diff --git a/lib/simulator/hibernate.tcl b/lib/simulator/hibernate.tcl index 0cd090e..7966b3b 100644 --- a/lib/simulator/hibernate.tcl +++ b/lib/simulator/hibernate.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -46,34 +49,34 @@ set _HIBERNATE_TCL _ class Hibernate { ## COMMON - common version {1.0} ;# Float: Hibernate facility version - common hib_progress_d 0 ;# Int: Variable for hibernation progress dialog -- Memory - common hib_progress_s 0 ;# Int: Variable for hibernation progress dialog -- Program steps - common hib_abort 0 ;# Bool: Abort hibernation process - common expected ;# String: Expected next XML element - common take_data ;# Bool: Take element data on next parsing cycle - common current_element {} ;# String: Current XML element -- auxiliary variable for XML parser handler - common xml_tmp {} ;# Mixed: Auxiliary variable of any kind for XML parser handler - common source_file {} ;# String: Filename of the file from which the given file was generated - common exclude_stepback 0 ;# Bool: Exclude program steps - common counter 0 ;# Int: Counter of iterations for resume function for XML parser handler - common xdata_size 0 ;# Int: Size of external data memory - common eeprom_size 0 ;# Int: Size of data EEPROM - common sbs_length 0 ;# Int: Size of stepback stack - common file_variable ;# Bool: Checkbox variable for "Different filename" - common mcu_variable ;# Bool: Checkbox variable for "Different processor" - common xdata_variable ;# Int: RadioButton variable for "Different XDATA size" - common md5_variable ;# Bool: Checkbox variable for "Different MD5 hash" + public common version {1.0} ;# Float: Hibernate facility version + public common hib_progress_d 0 ;# Int: Variable for hibernation progress dialog -- Memory + public common hib_progress_s 0 ;# Int: Variable for hibernation progress dialog -- Program steps + public common hib_abort 0 ;# Bool: Abort hibernation process + public common expected ;# String: Expected next XML element + public common take_data ;# Bool: Take element data on next parsing cycle + public common current_element {} ;# String: Current XML element -- auxiliary variable for XML parser handler + public common xml_tmp {} ;# Mixed: Auxiliary variable of any kind for XML parser handler + public common source_file {} ;# String: Filename of the file from which the given file was generated + public common exclude_stepback 0 ;# Bool: Exclude program steps + public common counter 0 ;# Int: Counter of iterations for resume function for XML parser handler + public common xdata_size 0 ;# Int: Size of external data memory + public common eeprom_size 0 ;# Int: Size of data EEPROM + public common sbs_length 0 ;# Int: Size of stepback stack + public common file_variable ;# Bool: Checkbox variable for "Different filename" + public common mcu_variable ;# Bool: Checkbox variable for "Different processor" + public common xdata_variable ;# Int: RadioButton variable for "Different XDATA size" + public common md5_variable ;# Bool: Checkbox variable for "Different MD5 hash" if {$::GUI_AVAILABLE} { # Big font for dialog "Program resumption" - common big_font [font create \ + public common big_font [font create \ -family {helvetica} \ -weight bold \ -size [expr {int(-35 * $::font_size_factor)}] \ ] # Normal font for dialog "Program resumption" - common text_font [font create \ + public common text_font [font create \ -family {helvetica} \ -weight bold \ -size [expr {int(-14 * $::font_size_factor)}] \ diff --git a/lib/simulator/interruptmonitor.tcl b/lib/simulator/interruptmonitor.tcl index 510b070..6ab3335 100644 --- a/lib/simulator/interruptmonitor.tcl +++ b/lib/simulator/interruptmonitor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,34 +36,34 @@ set _INTERRUPTMONITOR_TCL _ class InterruptMonitor { ## COMMON - common geometry ${::CONFIG(INTR_MON_GEOMETRY)} ;# Last window geometry - common intr_mon_count 0 ;# Counter of intances - common bg_color {#0088FF} ;# Color for highlighted background + public common geometry ${::CONFIG(INTR_MON_GEOMETRY)} ;# Last window geometry + public common intr_mon_count 0 ;# Counter of intances + public common bg_color {#0088FF} ;# Color for highlighted background # Small header font - common header_font [font create \ + public common header_font [font create \ -size [expr {int(-17 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ ] # Big header font - common header_font_big [font create \ + public common header_font_big [font create \ -size [expr {int(-21 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ ] # Common label font - common lbl_font [font create \ + public common lbl_font [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -family {helvetica} \ ] # Font for value labels - common val_font [font create \ + public common val_font [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ ] # Font for value labels - underline - common val_font_under [font create \ + public common val_font_under [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ -family {helvetica} \ diff --git a/lib/simulator/sfrmap.tcl b/lib/simulator/sfrmap.tcl index 65e5806..5a3895c 100644 --- a/lib/simulator/sfrmap.tcl +++ b/lib/simulator/sfrmap.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,7 +36,7 @@ set _SFRMAP_TCL _ class SFRMap { ## COMMON - common sfrmap_count 0 ;# Int: Counter of object instances + public common sfrmap_count 0 ;# Int: Counter of object instances ## PRIVATE private variable dialog_opened 0 ;# Bool: Dialog window opened diff --git a/lib/simulator/simulator.tcl b/lib/simulator/simulator.tcl index 8804022..e85ea6b 100644 --- a/lib/simulator/simulator.tcl +++ b/lib/simulator/simulator.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -53,51 +56,51 @@ class Simulator { inherit Simulator_GUI Simulator_ENGINE InterruptMonitor SFRMap Stopwatch BitMap StackMonitor UARTMonitor ## COMMON - common highlight_color {#DD8800} ;# Foreground color for changed registers - common normal_color {#000000} ;# Foreground color for unchanged registers - common error_dialog_project ;# Object: $this for current addressing error dialog - common not_again_val 0 ;# Bool: Value of checkbutton "Do not shot this dialog again" - - common reverse_run_steps 10 ;# Int: Number of steps which can be taken back - common ignore_stack_overflow 0 ;# Bool: Do not show "Stack overflow" dialog - common ignore_stack_underflow 0 ;# Bool: Do not show "Stack underflow" dialog - common ignore_watchdog_reset 0 ;# Bool: Ignore reset invoked by watchdog overflow - common ignore_read_from_wr_only 0 ;# Bool: Ignore reading from read only register - common ignore_invalid_reti 0 ;# Bool: Ignore invalid return fom interrupt - common ignore_invalid_ins 0 ;# Bool: Ignore invalid instructions - common ignore_invalid_IDATA 0 ;# Bool: Ignore access to unimplemented IDATA memory - common ignore_invalid_EDATA 0 ;# Bool: Ignore access to unimplemented EDATA memory - common ignore_invalid_XDATA 0 ;# Bool: Ignore access to unimplemented XDATA memory - common ignore_invalid_BIT 0 ;# Bool: Ignore access to unimplemented bit - common ignore_invalid_CODE 0 ;# Bool: Ignore access to unimplemented CODE memory - common ignore_invalid_USB 0 ;# Bool: Ignore "UART: Frame discarded" - common ignore_invalid_UMC 0 ;# Bool: Ignore "UART mode has been changed while UART was engaged" - common ignore_invalid_TMC 0 ;# Bool: Ignore "Timer mode has been changed while timer was running" - common ignore_invalid_brkpoints 0 ;# Bool: Do not warn user about invalid (unreachable) breakpoints - - common ignore_EEPROM_WR_fail 0 ;# Bool: Ignore EEPROM write failure (due to EECON.WRTINH, EECON.RDYBSY or EECON.EEMWE) - common ignore_EEPROM_WR_abort 0 ;# Bool: Ignore EEPROM write cycle abort - common undefined_value 2 ;# Int: 2 == Random; 1 == 255; 0 == 0 + public common highlight_color {#DD8800} ;# Foreground color for changed registers + public common normal_color {#000000} ;# Foreground color for unchanged registers + public common error_dialog_project ;# Object: $this for current addressing error dialog + public common not_again_val 0 ;# Bool: Value of checkbutton "Do not shot this dialog again" + + public common reverse_run_steps 10 ;# Int: Number of steps which can be taken back + public common ignore_stack_overflow 0 ;# Bool: Do not show "Stack overflow" dialog + public common ignore_stack_underflow 0 ;# Bool: Do not show "Stack underflow" dialog + public common ignore_watchdog_reset 0 ;# Bool: Ignore reset invoked by watchdog overflow + public common ignore_read_from_wr_only 0 ;# Bool: Ignore reading from read only register + public common ignore_invalid_reti 0 ;# Bool: Ignore invalid return fom interrupt + public common ignore_invalid_ins 0 ;# Bool: Ignore invalid instructions + public common ignore_invalid_IDATA 0 ;# Bool: Ignore access to unimplemented IDATA memory + public common ignore_invalid_EDATA 0 ;# Bool: Ignore access to unimplemented EDATA memory + public common ignore_invalid_XDATA 0 ;# Bool: Ignore access to unimplemented XDATA memory + public common ignore_invalid_BIT 0 ;# Bool: Ignore access to unimplemented bit + public common ignore_invalid_CODE 0 ;# Bool: Ignore access to unimplemented CODE memory + public common ignore_invalid_USB 0 ;# Bool: Ignore "UART: Frame discarded" + public common ignore_invalid_UMC 0 ;# Bool: Ignore "UART mode has been changed while UART was engaged" + public common ignore_invalid_TMC 0 ;# Bool: Ignore "Timer mode has been changed while timer was running" + public common ignore_invalid_brkpoints 0 ;# Bool: Do not warn user about invalid (unreachable) breakpoints + + public common ignore_EEPROM_WR_fail 0 ;# Bool: Ignore EEPROM write failure (due to EECON.WRTINH, EECON.RDYBSY or EECON.EEMWE) + public common ignore_EEPROM_WR_abort 0 ;# Bool: Ignore EEPROM write cycle abort + public common undefined_value 2 ;# Int: 2 == Random; 1 == 255; 0 == 0 # Normal font for error dialog - common error_normal_font [font create \ + public common error_normal_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ ] # Bold font for error dialog - common error_bold_font [font create \ + public common error_bold_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight bold \ ] # Header font for error dialog - common error_header_font [font create \ + public common error_header_font [font create \ -family {helvetica} \ -size [expr {int(-17 * $::font_size_factor)}] \ -weight bold \ ] # Main header font - common error_main_header [font create \ + public common error_main_header [font create \ -family {helvetica} \ -size [expr {int(-20 * $::font_size_factor)}] \ -weight bold \ diff --git a/lib/simulator/simulator_gui.tcl b/lib/simulator/simulator_gui.tcl index 9ae70b9..52adb34 100644 --- a/lib/simulator/simulator_gui.tcl +++ b/lib/simulator/simulator_gui.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -40,20 +43,20 @@ set _SIMULATOR_GUI_TCL _ class Simulator_GUI { ## COMMON - common sim_gui_count 0 ;# Counter of instances - common name_color {#0000DD} ;# Color for register name labels (eg. 'SP') - common name_nr_color {#8800DD} ;# Color for not-register name labels (eg. 'Clock') + public common sim_gui_count 0 ;# Counter of instances + public common name_color {#0000DD} ;# Color for register name labels (eg. 'SP') + public common name_nr_color {#8800DD} ;# Color for not-register name labels (eg. 'Clock') - common on_color {#00CC00} ;# Foreground color for bits in state 1 (for bit maps) - common off_color {#DD0000} ;# Foreground color for bits in state 0 (for bit maps) + public common on_color {#00CC00} ;# Foreground color for bits in state 1 (for bit maps) + public common off_color {#DD0000} ;# Foreground color for bits in state 0 (for bit maps) # Font for bit labels (eg. 'EA') - common bitfont [font create \ + public common bitfont [font create \ -family {helvetica} \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight [expr {$::MICROSOFT_WINDOWS ? "normal" : "bold"}] \ ] # Same as $bitfont but underlined - common bitfont_under [font create \ + public common bitfont_under [font create \ -family {helvetica} \ -size [expr {int(-11 * $::font_size_factor)}] \ -underline 1 \ @@ -61,9 +64,9 @@ class Simulator_GUI { ] # Color for small labels (eg. 'HEX') - common small_color {#5599BB} + public common small_color {#5599BB} # Font for small labels (eg. 'OCT') - common smallfont $::smallfont + public common smallfont $::smallfont if {$::MICROSOFT_WINDOWS} { ;# On MS Windows we need some smaller font to fit in set smallfont [font create \ -size [expr {int(-9 * $::font_size_factor)}] \ @@ -72,18 +75,18 @@ class Simulator_GUI { ] } - common hcolor {#FFAA00} ;# Highlight foreground color for entry widgets - common hbcolor {#CCCCCC} ;# Highlight background color for entry widgets + public common hcolor {#FFAA00} ;# Highlight foreground color for entry widgets + public common hbcolor {#CCCCCC} ;# Highlight background color for entry widgets # Font for other memory entries (eg. PCON) - common entry_font [font create \ + public common entry_font [font create \ -size [expr {int(-12 * $::font_size_factor)}] \ -family $::DEFAULT_FIXED_FONT \ -weight [expr {$::MICROSOFT_WINDOWS ? "normal" : "bold"}] \ ] # Postfixes for entry text variables - common entry_variables { + public common entry_variables { B_char A_bin IP DPH T0 T1 DPL PCON P1_bin P3_bin TMOD A_hex PC_dec B_oct SCON B_dec A_char TL0 TL1 DATA SP P0 P1 B_bin P2 P3 PC_hex @@ -588,7 +591,7 @@ class Simulator_GUI { {Interrupt 0 Edge Flag\nCleared by hardware when interrupt is processed if edge-triggered (see IT0).\nSet by hardware when external interrupt is detected on INT0# pin.} {Interrupt 0 Type Control Bit\nClear to select low level active (level triggered) for external interrupt 0 (INT0#).\nSet to select falling edge active (edge triggered) for external interrupt 0.} } - create_bitmap_register $timers_frame_reg 2 TMOD {G1 CT1 M11 M10 G0 CT0 M01 M00} 1 { + create_bitmap_register $timers_frame_reg 2 TMOD {G1 CT1 M11 M01 G0 CT0 M10 M00} 1 { {Timer 1 Gating Control Bit} {Timer 1 Counter/Timer Select Bit} {Timer 1 Mode Select Bit} @@ -611,7 +614,7 @@ class Simulator_GUI { # Create hexadecimal entries for registers: TCON TMOD foreach reg {TCON TMOD} \ addr {136 137} \ - bits {{TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0} {G1 CT1 M11 M10 G0 CT0 M01 M00}} \ + bits {{TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0} {G1 CT1 M11 M01 G0 CT0 M10 M00}} \ stip { {SFR 0x88: Timer/Counter control register} {SFR 0x89: Timer/Counter mode control register} @@ -1521,6 +1524,7 @@ class Simulator_GUI { -style TEntry \ -textvariable ::Simulator_GUI::ENV${obj_idx}_TIME \ -state readonly \ + -justify right \ -font [font create -size [expr {int(-12 * $::font_size_factor)}] -family $::DEFAULT_FIXED_FONT] \ ] setStatusTip -widget $frame1_top_right_1._TIME_e -text [mc "Overall time"] @@ -2418,10 +2422,9 @@ class Simulator_GUI { # Create progress bar set ::Simulator_GUI::ENV${obj_idx}_EEPROM_prg 0 - set eeprom_progressbar [ttk::progressbar \ + set eeprom_progressbar [ProgressBar \ $eeprom_operation_frame.progressbar \ - -mode determinate \ - -orient horizontal \ + -type normal \ -maximum 100 \ -variable ::Simulator_GUI::ENV${obj_idx}_EEPROM_prg \ ] diff --git a/lib/simulator/stackmonitor.tcl b/lib/simulator/stackmonitor.tcl index b51fabb..ca99fc8 100644 --- a/lib/simulator/stackmonitor.tcl +++ b/lib/simulator/stackmonitor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -35,18 +38,18 @@ set _STACKMONITOR_TCL _ class StackMonitor { ## COMMON - common push_value {} ;# String: Value to PUSH onto the stack by user - common stack_mon_count 0 ;# Int: Counter of intances - common geometry ${::CONFIG(STACK_MON_GEOMETRY)} ;# Geometry: Last window geometry - common collapsed ${::CONFIG(STACK_MON_COLLAPSED)};# Bool: Bottom bar hidden + public common push_value {} ;# String: Value to PUSH onto the stack by user + public common stack_mon_count 0 ;# Int: Counter of intances + public common geometry ${::CONFIG(STACK_MON_GEOMETRY)} ;# Geometry: Last window geometry + public common collapsed ${::CONFIG(STACK_MON_COLLAPSED)};# Bool: Bottom bar hidden # Font for the text widget representing the stack (bold) - common font0 [font create \ + public common font0 [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ ] # Font for the text widget representing the stack (normal) - common font1 [font create \ + public common font1 [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight normal \ diff --git a/lib/simulator/stopwatch.tcl b/lib/simulator/stopwatch.tcl index 353ac41..824e9b9 100644 --- a/lib/simulator/stopwatch.tcl +++ b/lib/simulator/stopwatch.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,16 +36,16 @@ set _STOPWATCH_TCL _ class Stopwatch { ## Class variables - common stopw_count 0 ;# Int: Counter of class instances + public common stopw_count 0 ;# Int: Counter of class instances # List: Short names of stopwatch entries - common stats_keys { + public common stats_keys { US CC IC IP PB IN SC RT RI BR } # List: Full names of stopwatch entries - common stats_names { + public common stats_names { {Micro seconds} {Clock cycles} {Instruction cycles} {Instructions passed} {Program bytes} {Interrupts} {Subprogram calls} {RET} {RETI} diff --git a/lib/simulator/uart_monitor.tcl b/lib/simulator/uart_monitor.tcl index 28d3b48..d6febbc 100644 --- a/lib/simulator/uart_monitor.tcl +++ b/lib/simulator/uart_monitor.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,46 +36,46 @@ set _UART_MONITOR_TCL _ class UARTMonitor { - common geometry ${::CONFIG(UART_MON_GEOMETRY)} ;# Last window geometry - common uart_mon_count 0 ;# Counter of intances + public common geometry ${::CONFIG(UART_MON_GEOMETRY)} ;# Last window geometry + public common uart_mon_count 0 ;# Counter of intances # Font: Tiny normal font - common tiny_font [font create \ + public common tiny_font [font create \ -family {helvetica} \ -size [expr {int(-9 * $::font_size_factor)}] \ -weight {normal} \ ] # Font: Big bold font - common big_font [font create \ + public common big_font [font create \ -family {helvetica} \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight {bold} \ ] # Font: Normal font - common normal_font [font create \ + public common normal_font [font create \ -family {helvetica} \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight {normal} \ ] # Font: - common normal_fixed_font [font create \ + public common normal_fixed_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight {normal} \ ] # Font: - common bold_fixed_font [font create \ + public common bold_fixed_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight {bold} \ ] - common rect_size 12 - common empty_fill {#888888} - common empty_outline {#AAAAAA} + public common rect_size 12 + public common empty_fill {#888888} + public common empty_outline {#AAAAAA} - common MAX_G_LOG_LENGTH 100 ;# Int: - common MAX_D_LOG_LENGTH 100 ;# Int: + public common MAX_G_LOG_LENGTH 100 ;# Int: + public common MAX_D_LOG_LENGTH 100 ;# Int: private variable dialog_opened 0 ;# Bool: Dialog window opened private variable win ;# Widget: Dialog window diff --git a/lib/utilities/asciichart.tcl b/lib/utilities/asciichart.tcl index bc44f3e..bb6cdf5 100644 --- a/lib/utilities/asciichart.tcl +++ b/lib/utilities/asciichart.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -32,8 +35,8 @@ set _ASCIICHART_TCL _ # -------------------------------------------------------------------------- class AsciiChart { - common ascii_chr_count 0 ;# Int: Counter of object instances - common ASCII_TABLE ;# Array of List: ASCII table + public common ascii_chr_count 0 ;# Int: Counter of object instances + public common ASCII_TABLE ;# Array of List: ASCII table array set ASCII_TABLE { 0 {NUL ^@ \\0 {Null character}} 1 {SOH ^A {} {Start of Header}} diff --git a/lib/utilities/baseconverter.tcl b/lib/utilities/baseconverter.tcl index 82d656a..8c605a6 100644 --- a/lib/utilities/baseconverter.tcl +++ b/lib/utilities/baseconverter.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -34,10 +37,10 @@ set _BASECONVERTER_TCL _ class BaseConverter { ## COMMON - common base_c_count 0 ;# Int: Counter of class instances - common INITIAL_HEIGHT 130 ;# Int: Initial heightof the window in pixels - common INITIAL_WIDTH 150 ;# Int: Initial width of the window in pixels - common EXTENDED_WIDTH 340 ;# Int: Width of the window when it is in extended mode + public common base_c_count 0 ;# Int: Counter of class instances + public common INITIAL_HEIGHT 130 ;# Int: Initial heightof the window in pixels + public common INITIAL_WIDTH 150 ;# Int: Initial width of the window in pixels + public common EXTENDED_WIDTH 340 ;# Int: Width of the window when it is in extended mode # On MS Windows these values has to be a bit different if {$::MICROSOFT_WINDOWS} { @@ -46,7 +49,7 @@ class BaseConverter { set EXTENDED_WIDTH 355 } # Font entryboxes - common entry_font [font create \ + public common entry_font [font create \ -size -12 \ -family $::DEFAULT_FIXED_FONT \ -weight bold \ diff --git a/lib/utilities/eightsegment.tcl b/lib/utilities/eightsegment.tcl index 601d078..6bbefbb 100644 --- a/lib/utilities/eightsegment.tcl +++ b/lib/utilities/eightsegment.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -32,7 +35,7 @@ set _EIGHTSEGMENT_TCL _ # -------------------------------------------------------------------------- class EightSegment { - common ld_ed_count 0 ;# Int: Counter of object instances + public common ld_ed_count 0 ;# Int: Counter of object instances private variable obj_idx ;# Int: Current object ID private variable win ;# Widget: Dialog window diff --git a/lib/utilities/hexeditdlg.tcl b/lib/utilities/hexeditdlg.tcl index c18df59..a93f736 100644 --- a/lib/utilities/hexeditdlg.tcl +++ b/lib/utilities/hexeditdlg.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,25 +36,25 @@ set _HEXEDITDLG_TCL _ # -------------------------------------------------------------------------- class HexEditDlg { - common count 0 ;# Instance counter - common win_pos {+0+0} ;# Window position (+X+Y) - common mode {hex} ;# View mode {hex dec oct} - common cell {0} ;# Current cell (0 - 0xFFFF) - common current_view {left} ;# Focused view {left right} + public common count 0 ;# Instance counter + public common win_pos {+0+0} ;# Window position (+X+Y) + public common mode {hex} ;# View mode {hex dec oct} + public common cell {0} ;# Current cell (0 - 0xFFFF) + public common current_view {left} ;# Focused view {left right} # Font for mode combobox - common mode_cb_font [font create \ + public common mode_cb_font [font create \ -family {Helvetica} \ -size [expr {int(-17 * $::font_size_factor)}] \ -weight bold \ ] # General normal size bold font - common bold_font [font create \ + public common bold_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight bold \ ] # Status bar tips for main menu for XDATA mode - common HELPFILE_XDATA { + public common HELPFILE_XDATA { { {Load IHEX8 file into editor and simulator XDATA memory} {} @@ -76,7 +79,7 @@ class HexEditDlg { } } # Status bar tips for main menu for CODE mode - common HELPFILE_CODE { + public common HELPFILE_CODE { { {Load IHEX8 file into editor and simulator XDATA memory} {Save current content of program (CODE) memory to IHEX8 file} diff --git a/lib/utilities/notes.tcl b/lib/utilities/notes.tcl index d74b652..333dba9 100644 --- a/lib/utilities/notes.tcl +++ b/lib/utilities/notes.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -33,17 +36,17 @@ set _NOTES_TCL _ class Notes { ## COMMON - common count 0 ;# Int: Counter of object instances - common bgcolor {#EEEE55} ;# Color: Background color for title bar and window border - common bgcolor2 {#FFFF88} ;# Color: Background color for the canvas widget + public common count 0 ;# Int: Counter of object instances + public common bgcolor {#EEEE55} ;# Color: Background color for title bar and window border + public common bgcolor2 {#FFFF88} ;# Color: Background color for the canvas widget # Font: For inserted text - common canvas_text_font [font create \ + public common canvas_text_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight bold \ ] # List: Popup menu for the canvas widget - common MENU { + public common MENU { {radiobutton "Pencil" {} ::Notes::__mode {P} "change_mode P" 0} {radiobutton "Line" {} ::Notes::__mode {L} diff --git a/lib/utilities/rs232debugger.tcl b/lib/utilities/rs232debugger.tcl index af2354b..0f26901 100644 --- a/lib/utilities/rs232debugger.tcl +++ b/lib/utilities/rs232debugger.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -34,41 +37,41 @@ set _RS232DEBUGGER_TCL _ class RS232Debugger { ## COMMON - common count 0 ;# Int: Counter of class instances + public common count 0 ;# Int: Counter of class instances # Font: Big bold font - common bold_font [font create \ + public common bold_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight {bold} \ ] # Font: Tiny normal font - common tiny_font [font create \ + public common tiny_font [font create \ -family {helvetica} \ -size [expr {int(-9 * $::font_size_factor)}] \ -weight {normal} \ ] # Font: Tiny bold font - common tiny_font_bold [font create \ + public common tiny_font_bold [font create \ -family {helvetica} \ -size [expr {int(-9 * $::font_size_factor)}] \ -weight {bold} \ ] # Font: Normal font - common normal_font [font create \ + public common normal_font [font create \ -family {helvetica} \ -size [expr {int(-11 * $::font_size_factor)}] \ -weight {normal} \ ] # Font: Also normal font, but a bit larger - common big_font [font create \ + public common big_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight {normal} \ ] # Int: Pool interval for selected RS232 interface - common POOL_INTERVAL 50 ;# mili-seconds + public common POOL_INTERVAL 50 ;# mili-seconds # List of Int: Available baud rates for RS232 - common available_baud_rates { + public common available_baud_rates { 50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 57600 115200 230400 @@ -76,7 +79,7 @@ class RS232Debugger { } # List: Configuration list - common config_list $::CONFIG(RS232_DEBUGGER) + public common config_list $::CONFIG(RS232_DEBUGGER) ## PRIVATE @@ -1101,7 +1104,12 @@ class RS232Debugger { # @return void public method receive_data {} { # Read binary data - set data [read $channel] + if {[catch { + set data [read $channel] + }]} then { + unknown_port_io_error + return + } # Discard the data if reception is not enabled if {!$reception_enabled} { @@ -1293,7 +1301,7 @@ class RS232Debugger { -parent $win \ -title [mc "IO Error"] \ -type ok -icon warning \ - -message [mc "There is something wrong with the port. Closing connection and disabling reception on this channel !"] + -message [mc "There is something wrong with the port. Closing connection and disabling reception on this channel!"] update } diff --git a/lib/utilities/speccalc.tcl b/lib/utilities/speccalc.tcl index 49db83b..d13e1ed 100644 --- a/lib/utilities/speccalc.tcl +++ b/lib/utilities/speccalc.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -38,14 +41,14 @@ set _SPECCALC_TCL _ class SpecCalc { ## COMMON - common count 0 ;# Int: Counter of class instances - common diagram_counter 0 ;# Int: Counter of diagram dialogues instances + public common count 0 ;# Int: Counter of class instances + public common diagram_counter 0 ;# Int: Counter of diagram dialogues instances # List of pages descriptors for PagesManager - common page_list { + public common page_list { loops timer01 timer2 spi } # Configuration list - common config $::CONFIG(SPEC_CALC) + public common config $::CONFIG(SPEC_CALC) ## PRIVATE private variable win ;# Widget: The dialog window diff --git a/lib/utilities/symbol_viewer.tcl b/lib/utilities/symbol_viewer.tcl index c46b8ac..f67a8ac 100644 --- a/lib/utilities/symbol_viewer.tcl +++ b/lib/utilities/symbol_viewer.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -34,15 +37,15 @@ set _SYMBOL_VIEWER_TCL _ class SymbolViewer { ## Class variables # Int: Counter of object intances - common count 0 + public common count 0 # Font: Just normal font used in the table - common normal_font [font create \ + public common normal_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight normal \ ] # Font: Bold font (the same size as $normal_font) - common bold_font [font create \ + public common bold_font [font create \ -family $::DEFAULT_FIXED_FONT \ -size [expr {int(-14 * $::font_size_factor)}] \ -weight bold \ @@ -52,7 +55,7 @@ class SymbolViewer { set bold_font $normal_font } # Dialog configuration - common config_list $::CONFIG(SYMBOL_VIEWER_CONFIG) + public common config_list $::CONFIG(SYMBOL_VIEWER_CONFIG) ## Private object variables private variable obj_idx ;# Int: Current object number diff --git a/lib/utilities/table_of_instructions.tcl b/lib/utilities/table_of_instructions.tcl index b6587b2..3dc1597 100644 --- a/lib/utilities/table_of_instructions.tcl +++ b/lib/utilities/table_of_instructions.tcl @@ -1,10 +1,13 @@ #!/usr/bin/tclsh -# Part of MCU 8051 IDE ( http://mcu8051ide.sf.net ) +# Part of MCU 8051 IDE ( http://http://www.moravia-microsystems.com/mcu8051ide ) ############################################################################ # Copyright (C) 2011 by Martin Ošmera # # martin.osmera@gmail.com # # # +# Copyright (C) 2014 by Moravia Microsystems, s.r.o. # +# martin.osmera@moravia-microsystems.com # +# # # This program is free software; you can redistribute it and#or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # @@ -32,30 +35,30 @@ set _TABLE_OF_INSTRUCTIONS_TCL _ # -------------------------------------------------------------------------- class TableOfInstructions { - common tbl_of_inst_count 0 ;# Int: Counter of object instances - common oprs_color {#00DD00} ;# RGB Color: Number of operands - common len_color {#00AA55} ;# RGB Color: Instruction length - common time_color {#8800DD} ;# RGB Color: Time to execute - common ins_color {#0000DD} ;# RGB Color: Instruction mnemonics + public common tbl_of_inst_count 0 ;# Int: Counter of object instances + public common oprs_color {#00DD00} ;# RGB Color: Number of operands + public common len_color {#00AA55} ;# RGB Color: Instruction length + public common time_color {#8800DD} ;# RGB Color: Time to execute + public common ins_color {#0000DD} ;# RGB Color: Instruction mnemonics # Font for instruction name - common instruction_font [font create \ + public common instruction_font [font create \ -family {helvetica} \ -size [expr {int(-10 * $::font_size_factor)}] \ ] # Font for numbers below the instruction name - common number_font [font create \ + public common number_font [font create \ -family {helvetica} \ -size [expr {int(-10 * $::font_size_factor)}] \ -weight {bold} \ ] # Font for labels in details frame (normal) - common details_n_font [font create \ + public common details_n_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] \ ] # Font for labels in details frame (bold) - common details_b_font [font create \ + public common details_b_font [font create \ -family {helvetica} \ -size [expr {int(-12 * $::font_size_factor)}] \ -weight {bold} \ |