Difference between revisions of "Writing You Own Extensions to SmartTerminal"

From OpenCircuits
Jump to navigation Jump to search
Line 4: Line 4:
 
This page just started, come back later for something that makes more sense.
 
This page just started, come back later for something that makes more sense.
  
This is part of the documentation of the Python Smart Terminal, the starting page is: [[Python Smart Terminal]].  While you can, of course modify any of the code for the Smart Terminal the expected way to do it is either through parameters ( see ) or through code.  Taking the code approach the plan is that you created a class like the other excomponents that are in the main code repository (  [[https://github.com/russ-hensel/python_smart_terminal Code at GitHub]] ).
+
This is part of the documentation of the Python Smart Terminal, the starting page is: [[Python Smart Terminal]].  While you can, of course modify any of the code for the Smart Terminal the expected way to do it is either through parameters ( see ) or through code.  Taking the code approach the plan is that you created a class like the other ext_process_xxxxxx.py components that are in the main code repository (  [[https://github.com/russ-hensel/python_smart_terminal Code at GitHub]] ).
 +
 
 +
Extensions are coded as classes, each extension ( typically ) in its own module.
  
  
 
= Examples =
 
= Examples =
All the extensions are included in my github repository, you can study that code.  I have additional external documentation for:
+
 
 +
All the extensions are included in my github repository, you can study that code.  The extensions have names module like: ext_process_xxxxxx.py
 +
They include:
 +
 
 +
* ext_process_co.py
 +
* ext_process_ddc.py            runs with an arduino program to control a stepper motor clock
 +
* ext_process_env_monitor.py    runs with an arduino program to monitor a greenhouse, or a root cellar, or a well.
 +
* ext_process_example.py        just an example
 +
* ext_process_gh.py            runs with an arduino program to monitor a greenhouse; obsolete, now absorbed into  ext_process_env_monitor.py   
 +
* ext_process_ir.py            runs with an arduino program to get precise timings from infrared controls, analyze them and send ir pulses, not maintained in a long time might not run.
 +
* ext_process_motor.py          runs with an arduino program to experiment with multiphase motors.
 +
* ext_process_rc.py            runs with an arduino program to monitor a root cellar; obsolete, now absorbed into  ext_process_env_monitor.py 
 +
 +
I have omitted some modules that are badly incomplete or otherwise broken.
 +
 +
 
 +
I have additional external documentation for:
  
 
[[GreenHouse Monitor Program]]
 
[[GreenHouse Monitor Program]]
 +
 +
= Parameters =
 +
 +
To make your extension load you need 2 settings in the Parameter file ( parameters.py )
 +
 +
<pre>
 +
        # add the clock processing extension
 +
        self.ext_processing_module      = "ext_process_ddc"
 +
        self.ext_processing_class      = "DDCProcessing"
 +
 +
</pre>
 +
 +
  
 
= Alter the GUI =
 
= Alter the GUI =
 +
 +
Each extension class should have method  add_gui( self, parent, )  The argument parent is a parent widget, you should make your own widget, a frame with this parent.  Populate the frame with what you want and then return it.  If you do not want to make any additions, return None.
 +
 +
  
 
= Add Processing in the Helper Thread ==
 
= Add Processing in the Helper Thread ==
  
 
[[category:Python]]  [[Category:Arduino/RaspberryPi]] [[Category:SmartTerminal]]
 
[[category:Python]]  [[Category:Arduino/RaspberryPi]] [[Category:SmartTerminal]]

Revision as of 17:15, 22 September 2018

Introduction

This page just started, come back later for something that makes more sense.

This is part of the documentation of the Python Smart Terminal, the starting page is: Python Smart Terminal. While you can, of course modify any of the code for the Smart Terminal the expected way to do it is either through parameters ( see ) or through code. Taking the code approach the plan is that you created a class like the other ext_process_xxxxxx.py components that are in the main code repository ( [Code at GitHub] ).

Extensions are coded as classes, each extension ( typically ) in its own module.


Examples

All the extensions are included in my github repository, you can study that code. The extensions have names module like: ext_process_xxxxxx.py They include:

  • ext_process_co.py
  • ext_process_ddc.py runs with an arduino program to control a stepper motor clock
  • ext_process_env_monitor.py runs with an arduino program to monitor a greenhouse, or a root cellar, or a well.
  • ext_process_example.py just an example
  • ext_process_gh.py runs with an arduino program to monitor a greenhouse; obsolete, now absorbed into ext_process_env_monitor.py
  • ext_process_ir.py runs with an arduino program to get precise timings from infrared controls, analyze them and send ir pulses, not maintained in a long time might not run.
  • ext_process_motor.py runs with an arduino program to experiment with multiphase motors.
  • ext_process_rc.py runs with an arduino program to monitor a root cellar; obsolete, now absorbed into ext_process_env_monitor.py

I have omitted some modules that are badly incomplete or otherwise broken.


I have additional external documentation for:

GreenHouse Monitor Program

Parameters

To make your extension load you need 2 settings in the Parameter file ( parameters.py )

        # add the clock processing extension
        self.ext_processing_module      = "ext_process_ddc"
        self.ext_processing_class       = "DDCProcessing"


Alter the GUI

Each extension class should have method add_gui( self, parent, ) The argument parent is a parent widget, you should make your own widget, a frame with this parent. Populate the frame with what you want and then return it. If you do not want to make any additions, return None.


Add Processing in the Helper Thread =