Editing Smart Terminal Parameter Examples

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 1: Line 1:
 
= What/Why/How the Parameter File =
 
= What/Why/How the Parameter File =
  
A lot of the behavior of the terminal is controlled by the file '''parameters.py'''.  Different projects of mine require different parameters.  The first parameters that might spring to mind are the port and baud rate for the terminal.  But the parameter file can change so much more: some are simple like adding a colored band to the terminal ( useful if you have more than one terminal running at a time ) to adding whole new modules that modify the graphical user interface ( GUI ) and add automatic processing.  While this file has the basic structure of a asci text file, you should keep in mind that it is an executable Python file.  This means it is programmatic, you can use any Python you want ( pretty much ) but try to limit yourself to setting the value of instance variables in the parameter object.
+
A lot of the behavior of the terminal is controlled by the file '''parameters.py'''.  Different projects of mine require different parameters.  The first that might spring to mind are the port and baud rate for the terminal.  But the parameter file can change so much more some are simple like adding a colored band to the terminal ( useful if you have more than one terminal running at a time ) to adding whole new modules that modify the graphical user interface ( GUI ) and add automatic processing.  While this file has the basic structure of a asci text file, you should keep in mind that it is an executable Python file.  This means it is programmatic, you can use any Python you want ( pretty much ) but try to limit yourself to setting the value of instance variables in the parameter object.
  
 
More information on this approach to configuration in: [[Configuration Files For Python]].
 
More information on this approach to configuration in: [[Configuration Files For Python]].
Line 7: Line 7:
 
== Different Approaches ==
 
== Different Approaches ==
  
*  To start with you can just run with the parameter file as shipped.  This gives a reasonable terminal that runs fine, but probably will not run with the baud rate and comm port that you desire, so almost for sure you will need to adjust these.  There are lines near the top of the parameter file to do this.  For more info see the section below.
+
*  To start with you can just run with the parameter file as shipped.  This gives a reasonable terminal that runs fine, but probably will not run with the baud rate and comm port that you desire so almost for sure you will need to adjust these.  There are lines near the top of the parameter file to do this.  For more info see the section below.
  
 
* Another method is to use different parameter files for different projects.  These might be copied into the smart terminal directory when you want to use them.  Works fine but is cumbersome.  Start from my file and modify. I do not recommend this approach, but you may want to do it.
 
* Another method is to use different parameter files for different projects.  These might be copied into the smart terminal directory when you want to use them.  Works fine but is cumbersome.  Start from my file and modify. I do not recommend this approach, but you may want to do it.
Line 13: Line 13:
 
* You can also use a secondary parameter file that overrides the settings in the first file.  This is great if you want to run 2 copies of the terminal.  Which secondary parameter file is used is controlled from the command line.  For more info see the section below. ( coming soon )
 
* You can also use a secondary parameter file that overrides the settings in the first file.  This is great if you want to run 2 copies of the terminal.  Which secondary parameter file is used is controlled from the command line.  For more info see the section below. ( coming soon )
  
* The subroutine method.  This is what I recommend for most uses.  It is easy to manage and easy to switch between parameter sets.  This is the method in the supplied parameter file and the one that I will use for may discussion of how the parameter file works in general.  The parameter file is heavily commented and these comments should be read if you have questions.  You can also search other files for parameters.xxx where xxx is the name of the parameter you are investigating.
+
* The subroutine method.  This is what I recommend for most uses.  It is easy to manage and easy to switch between parameter sets.  This is the method in the supplied parameter file and the one that I will use for may discussion of how the parameter file works in genera.  The parameter file is heavily commented and these comments should be read if you have questions.  You can also search other files for parameters.xxx where xxx is the name of the parameter you are investigating.
  
 
== How to Edit the Parameter File ==
 
== How to Edit the Parameter File ==
 
+
Yous can use any editor you want ( for text type file ).  One warning, however, is not to use an editor that inserts tab characters, tabs are ok if they are converted to spaces but not otherwise.  Use your Python editor, that should be fine.  For an external editor I use notepad++ on windows but make sure you use the tab to spaces conversion option ( google it ).  The parameter file can be set up ( .ex_editor ) so that a button on the GUI will open the parameter file in the editor.  After saving the file you can get a very fast restart of the app with the new parameter using the <Restart> button.
Yous can use any editor you want ( for text type file ).  One warning, however, is not to use an editor that inserts tab characters, tabs are ok if they are converted to spaces but not otherwise.  Use your Python editor, that should be fine.  For an external editor I use notepad++ on windows but make sure you use the tab to spaces conversion option ( google it ).  The parameter file can be set up ( .ex_editor: for example self.ex_editor  =  r"leafpad" # linux editor ) so that a button <Edit Parms> on the GUI will open the parameter file in the editor.  After saving the file you can get a very fast restart of the app with the new parameter using the <Restart> button.
 
  
 
= Structure of the Default Parameter File =
 
= Structure of the Default Parameter File =

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)