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 28: Line 28:
 
In a similar way there is a subroutine called '''self.computer_name_tweaks(  )'''  This subroutine uses the already/automatically set parameter  '''computername''' to tweak a few settings depending on the computer's name. This makes it easy for me to change the default parameters setting based on the computer I am using to run the program.  Thus I can move the program around without changing the parameter file. These setting, as shipped, are probably not useful to you, but they may be useful as an example.
 
In a similar way there is a subroutine called '''self.computer_name_tweaks(  )'''  This subroutine uses the already/automatically set parameter  '''computername''' to tweak a few settings depending on the computer's name. This makes it easy for me to change the default parameters setting based on the computer I am using to run the program.  Thus I can move the program around without changing the parameter file. These setting, as shipped, are probably not useful to you, but they may be useful as an example.
  
Finally there is a list of calls to subroutines, typically each one is for a different type of setup or mode, all but one should be commented out.  So I might make a call to a subroutine like:  '''self.well_monitor_mode()'''.  This is the mode for an arduino/python project that monitors my water well pressure.  It is a pretty complicated set up, because of the database access in the well monitor.  For this documentation I will do a subroutine called '''tutorial_example_mode()''' which make the most basic changes from the default mode.
+
Finally there is a list of subroutines, typically each one is for a different type of setup, all but one should be commented out.  So I might make a call to a subroutine like:  well_monitor_mode().  This is the file for an arduino project that monitors my water well pressure.  It is a pretty complicated set up, because of the database access in the well monitor.  For this documentation I will do a subroutine called tutorial_example_mode() which make the most basic changes from the default mode.
  
 
= Subroutine Method =
 
= Subroutine Method =
All the rest of the documentation will refer to this method of structuring the parameter.py file.  You could instead just have a separate parameter file for each application/mode that just ran from top to bottom.  I have found this method more useful.
 
 
  
 
== tutorial_example_mode() ==
 
== tutorial_example_mode() ==
Line 68: Line 66:
 
= Another example mode =
 
= Another example mode =
  
make it a bit more complicated.  Still needs to be written.
+
make it a bit more complicated.
  
= Reference/Summary for Some Values =
+
= Reference =
  
Instance variables and their meanings ( in code use self.xxxx as they are instance variables ).  This reference is not detailed/exhaustive, for that you must use the supplied parameters.py and its comments.
+
This reference is not exhaustive, for that you must use the supplied parameters.py and its comments.
  
 
== Overview ==
 
== Overview ==
Line 105: Line 103:
  
 
* '''max_send_rows'''    = 3        # the send areas are added in columns this many rows long, then a new
 
* '''max_send_rows'''    = 3        # the send areas are added in columns this many rows long, then a new
* '''default_scroll'''    = 1        # 1 auto scroll the receive area, else 0
+
* '''default_scroll'''    = 1        # 1 auto scroll the recieve area, else 0
  
 
== Extended Processing ==
 
== Extended Processing ==
Line 112: Line 110:
  
 
*'''ext_processing_module''':  module name       
 
*'''ext_processing_module''':  module name       
*'''ext_processing_class''':  class name
+
*'''ext_processing_class''':  class name  
 +
 
  
 
== Automatically Set ==
 
== Automatically Set ==
  
*'''our_os''': "win32" if your are running windows -- used by os_tweaks().
+
*'''our_os''': "win32" if your are running windows
*'''computername'''  the name of your computer if available ( it is on windows, linux ?? ) used by computer_name_tweaks().
 
  
== For the Second Thread, the Helper Thread ==
+
       
 +
== For the Second Thread ==
  
 
* '''queue_length'''        = 20
 
* '''queue_length'''        = 20
 
* '''queue_sleep'''          = .1
 
* '''queue_sleep'''          = .1
 
<!-----------
 
this cannot bee seen
 
 
 
 
  
 
# ----------  self.start_helper_function    = gh_processing.GHProcessing.find_and_monitor_arduino
 
# ----------  self.start_helper_function    = gh_processing.GHProcessing.find_and_monitor_arduino
Line 146: Line 139:
 
block_port_closed = False            # block sending if port is closed  # *todo  -- or some warning
 
block_port_closed = False            # block sending if port is closed  # *todo  -- or some warning
  
 +
== Appearance ==
  
------------->
 
 
== Appearance ==
 
  
 
* '''id_color''': color for an "ID pane" just below the title bar of the window
 
* '''id_color''': color for an "ID pane" just below the title bar of the window
Line 155: Line 146:
 
* '''bk_color'''          = "blue"  # color for the background, you can match the id color or use a neutral color like gray
 
* '''bk_color'''          = "blue"  # color for the background, you can match the id color or use a neutral color like gray
 
* '''icon''':  name of icon for the application
 
* '''icon''':  name of icon for the application
* '''mode''' name for the mode of the SmartTerminal, used in the title of the SmartTerminal window and may be use in code.
+
 
* '''self.win_geometry''' a string that specifies the initial size of the SmartTerminal window
+
* tile
 +
* size  
 
   
 
   
<!-----------
 
 
 
 
 
Sets the communications parameters. Sometimes a little confusing about port names. The arduino IDE sometimes is better at finding the name, check it. Also use the <Ports> button on the GUI. On the apple we have found from <Ports> ('/dev/tty.usbmodem1411', True) and in the parameter file using self.port = "/dev/tty.usbmodem1411" gave a good connection. Sometimes a reboot will result in a change of the port name.
 
Sets the communications parameters. Sometimes a little confusing about port names. The arduino IDE sometimes is better at finding the name, check it. Also use the <Ports> button on the GUI. On the apple we have found from <Ports> ('/dev/tty.usbmodem1411', True) and in the parameter file using self.port = "/dev/tty.usbmodem1411" gave a good connection. Sometimes a reboot will result in a change of the port name.
 
Specifies a program for file editing.
 
Specifies a program for file editing.
Line 167: Line 155:
 
Defaults data to be sent.
 
Defaults data to be sent.
 
Change number of send areas.
 
Change number of send areas.
this cannot bee seen
 
  
+
== More on Particular Parametes ==
== More on Particular Parameters ==
 
  
 
=== Parm 1 ===
 
=== Parm 1 ===
 
=== Parm 2 ===
 
=== Parm 2 ===
this cannot bee seen
 
------------->
 
  
 
= Using a Second Parameter File  =
 
= Using a Second Parameter File  =
Line 183: Line 167:
  
 
The difference in this file is the parameters are not self.xx but parameters.xx.  Else it is pretty much the same.  See the example file parameters_a.py.
 
The difference in this file is the parameters are not self.xx but parameters.xx.  Else it is pretty much the same.  See the example file parameters_a.py.
 
<!-----------
 
this cannot bee seen
 
 
 
  
 
= delete soon =
 
= delete soon =
Line 218: Line 197:
 
</pre>
 
</pre>
  
------------->
 
  
  
[[Category:SmartTerminal]] [[Category:Arduino/RaspberryPi]] [[Category:Python]]
+
 
 +
[[Category:SmartTerminal]] [[Category:Arduino/RaspberryPi]]

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)