Editing Python Smart Terminal Technical

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 18: Line 18:
  
 
The application has a main thread running in a Tkinter mainloop.  There is also a second thread called a "helper" running which makes some processing much easier.  To make gui mainloop responsive to both the GUI and its own processing it uses a pseudo event loop or a polling subroutine that is implemented in SmartTerminal.polling().  This is where data is received from there comm port ( or sometimes the responsibility is passed to the helper thread). The frequency which it is called is set in parameters, the relatively low rate of 100 ms between calls ( .1 sec ) seems to give a perfectly responsive application in most cases.  I have run it as fast as once every 10 ms.  Have not tried to find a limit.  The second thread is mostly intended for your custom processing, see the section Processing below.
 
The application has a main thread running in a Tkinter mainloop.  There is also a second thread called a "helper" running which makes some processing much easier.  To make gui mainloop responsive to both the GUI and its own processing it uses a pseudo event loop or a polling subroutine that is implemented in SmartTerminal.polling().  This is where data is received from there comm port ( or sometimes the responsibility is passed to the helper thread). The frequency which it is called is set in parameters, the relatively low rate of 100 ms between calls ( .1 sec ) seems to give a perfectly responsive application in most cases.  I have run it as fast as once every 10 ms.  Have not tried to find a limit.  The second thread is mostly intended for your custom processing, see the section Processing below.
 
= Files and Directories =
 
* .../smart_terminal --------------- All the code to run the terminal
 
* .../smart_terminal/images -------- Various image files, mostly junk may be some screen shots, png versions of some icons.....
 
* .../smart_terminal/sounds -------- wave files for the ext_process_dm.py
 
* .../smart_terminal/wiki_etc - ---- various documentation including some of this wiki in pdf format.
 
 
Particular Files:
 
 
* smart_terminal.py ---------- the main program
 
* parameters.py -------------- the configuration file
 
* gui.py --------------------- the GUI of the program ( less what extensions may build )
 
* running_on.py -------------- a module to discover the environment the program is running on, helps adapt program to different machines and operating systems
 
* *.ico ---------------------- various icons that may be used with the program
 
* ext_process_xxxxx.py ------- extension modules ... I should make a page or more to document each, coming...
 
* readme_xxx.txt ------------- various readmes mostly with scratch info, and ideas I may be thinking about.
 
* smart_terminal_helper.py --- code to support a second thread and the basis for the extensions.
 
* various *.py files for misc testing or data generation, treat as junk, if not linked to smart_terminal.py they are probably not maintained.
 
  
 
= Components and Functions =
 
= Components and Functions =
Line 118: Line 100:
  
 
== Names ==
 
== Names ==
Be consistent: this is good but have not been very successful in standards: I keep changing my mind.  Names across classes are pretty consistent.  I am avoiding short names and try to make them descriptive enough that they are somewhat self documenting.  References are often copied across objects for easy access ( lots of parameters for example ); when this happens the name of the object is generally ( should be always ) the same in both objects.
+
Be consistent: this is good but have not been very successful in standards: I keep changing my mind.  Names across classes are pretty consistent.  I am avoiding short names and try to make them descriptive enough that they are somewhat self documenting.
  
 
== Formatting ==
 
== Formatting ==

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)