Difference between revisions of "Python Smart Terminal"

From OpenCircuits
Jump to navigation Jump to search
Line 22: Line 22:
 
= Configure to Run =
 
= Configure to Run =
  
 +
 +
Basic configuration of comm parameters like port, baud rate .... is all done in a file called parameters.py.  It seemed easier to simply use a Python text file instead of some other format like an ini file.  Pretty much all the file does is set instance variables in itself.  It is used by the program controller ( smart_terminal.SmartTermianl ) to create an instance of Parameters and then the values can be used.  Save the original ( maybe I will include a backup maybe not ) in case you mess it up too much.
 +
 +
Parameters starts out with some "meta" parameters.  These are defined early in the creation of the objects and may effect other values.  In any case you can always define a value twice, the last one always wins.
 +
 +
All the com port values are defined in pretty much one place, find it an change it to what you need.
  
 
= Design =
 
= Design =
  
 
These notes are here so you can change what you do not like.  Contact me Russ Hensel if you need additional help.
 
These notes are here so you can change what you do not like.  Contact me Russ Hensel if you need additional help.

Revision as of 12:19, 22 September 2016

This page is a very early draft, somewhat my notes as I go alogn

Installation

This program is intended for those who at least occasionally develop in Python. I expect that they already run some things in Python and will just add this as an additional project. There is no install program you just download the files, place where you keep your projects and run. A bit more later in this section.

Before you begin to install you should know a bit about the environment that I have used to build, test and run the terminal. If your environment differs too much you may have trouble getting it to run.

I run Python mostly using the install that comes with Anaconda Spyder and often use the IDE it installs. This is not necessary, it is just an nice install that downloads a lot of stuff that technical folks find useful. I have use conda an pip to add to this install and do not know offhand all that is in it. It is Python 2.7. You can look at the include statements to get some idea of what you might need to add. Or you can just keep running it and add the packages it complains about.

Download the files ( I have not decided just how they will be on git hub in at least one form ) Uncompress if they are compressed. The directory structure should looks like this

         whatever --|
                    |-- rshlib
                    |
                    |-- SmartTerminal

Put them in your system making whatever anything convenient for your Python. It should run ( at least to put up its GUI ) by running smart_terminal.py. Note that there may be a certain amount of left over, dead code, in the directory I am cleaning out bit by bit, someday it may be nice and neat. For now if you want to tinker look at the design info below first.

Run it until it stops complaining about dependencies ( in the console ), after that ( and perhaps even before ) the GUI should come up. You are installed.

Configure to Run

Basic configuration of comm parameters like port, baud rate .... is all done in a file called parameters.py. It seemed easier to simply use a Python text file instead of some other format like an ini file. Pretty much all the file does is set instance variables in itself. It is used by the program controller ( smart_terminal.SmartTermianl ) to create an instance of Parameters and then the values can be used. Save the original ( maybe I will include a backup maybe not ) in case you mess it up too much.

Parameters starts out with some "meta" parameters. These are defined early in the creation of the objects and may effect other values. In any case you can always define a value twice, the last one always wins.

All the com port values are defined in pretty much one place, find it an change it to what you need.

Design

These notes are here so you can change what you do not like. Contact me Russ Hensel if you need additional help.