-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up and add some database input #16
Conversation
some clean up and addition of (# coding: utf8) i hope this will help. I change folder name to add rpi_ i add -air pressure to database (bmp085) -Orientation sensor calibration status and cuz acceleration (bno055) - more button setting like debuncing possibility some bug correction.
Jean,
If your doing cleanup I'll hold off I did have a question about how
you are stopping Threads. I think I see you have self.getout which if
it's true you break the run function you also have. self. running which
you can have the while loop watch for it to go False.
def __init__(self, parent):
self.getout = False
# indicator for when to stop
def run(self):
while True:
if self.getout:
break
self.running = False
def stop(self):
self.getout = True def __init__(self, parent):
self.running = True
# indicator for when to stop
def run(self):
while self.running:
if self.getout:
break
def stop(self):
self.running = False
Also you have imported sys and logger but they're not being used didn't
know if that is future use?
There is my 2 cent for consideration
Neil
…On 12/29/2016 09:54 AM, Jean-manuel Gagnon wrote:
some clean up and addition of (# coding: utf8) i hope this will help.
I change folder name to add rpi_
i add
-air pressure to database (bmp085)
-Orientation sensor calibration status and cuz acceleration (bno055)
* more button setting like debuncing possibility
some bug correction.
------------------------------------------------------------------------
You can view, comment on, or merge this pull request online at:
#16
Commit Summary
* Clean up and add some database input
File Changes
* *M* src/config/database.csv
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-0> (5)
* *M* src/config/main.cfg
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-1> (33)
* *D* src/plugins/mcp3008/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-2>
(120)
* *R* src/plugins/rpi_bmp085/Adafruit_BMP/BMP085.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-3> (1)
* *R* src/plugins/rpi_bmp085/Adafruit_BMP/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-4> (0)
* *R* src/plugins/rpi_bmp085/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-5> (54)
* *R* src/plugins/rpi_bno055/Adafruit_BNO055/BNO055.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-6> (1)
* *R* src/plugins/rpi_bno055/Adafruit_BNO055/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-7> (0)
* *R* src/plugins/rpi_bno055/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-8>
(122)
* *R* src/plugins/rpi_button/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-9> (19)
* *R* src/plugins/rpi_mcp3008/Adafruit_MCP3008/MCP3008.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-10> (1)
* *R* src/plugins/rpi_mcp3008/Adafruit_MCP3008/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-11> (0)
* *A* src/plugins/rpi_mcp3008/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-12>
(121)
* *R* src/plugins/rpi_rotary_encoder/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-13> (9)
* *R* src/plugins/rpi_virtualwire/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-14>
(109)
* *R* src/plugins/rpi_virtualwire/virtualwire/__init__.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-15> (0)
* *R* src/plugins/rpi_virtualwire/virtualwire/virtualwire.py
<https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-16> (1)
Patch Links:
* https://github.com/makerplane/FIX-Gateway/pull/16.patch
* https://github.com/makerplane/FIX-Gateway/pull/16.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#16>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AEjkWSxI_nCy43JpPhRd5S0Dj8WnhfAIks5rM8mqgaJpZM4LXofl>.
|
Hello Neil,
I have use skel.py file as a model.
< Also you have imported sys and logger but they're not being used didn’t know if that is future use? > You know I'm not a programmer and in my learning curve I'm not experienced has used these functions But if you agree to give me an example in a plugins I will try to apply it
thank you
… Le 29 déc. 2016 à 10:50, Neil Domalik ***@***.***> a écrit :
Jean,
If your doing cleanup I'll hold off I did have a question about how
you are stopping Threads. I think I see you have self.getout which if
it's true you break the run function you also have. self. running which
you can have the while loop watch for it to go False.
def __init__(self, parent):
self.getout = False
# indicator for when to stop
def run(self):
while True:
if self.getout:
break
self.running = False
def stop(self):
self.getout = True def __init__(self, parent):
self.running = True
# indicator for when to stop
def run(self):
while self.running:
if self.getout:
break
def stop(self):
self.running = False
Also you have imported sys and logger but they're not being used didn't
know if that is future use?
There is my 2 cent for consideration
Neil
On 12/29/2016 09:54 AM, Jean-manuel Gagnon wrote:
>
> some clean up and addition of (# coding: utf8) i hope this will help.
>
> I change folder name to add rpi_
>
> i add
>
> -air pressure to database (bmp085)
> -Orientation sensor calibration status and cuz acceleration (bno055)
>
> * more button setting like debuncing possibility
>
> some bug correction.
>
> ------------------------------------------------------------------------
>
>
> You can view, comment on, or merge this pull request online at:
>
> #16
>
>
> Commit Summary
>
> * Clean up and add some database input
>
>
> File Changes
>
> * *M* src/config/database.csv
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-0> (5)
> * *M* src/config/main.cfg
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-1> (33)
> * *D* src/plugins/mcp3008/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-2>
> (120)
> * *R* src/plugins/rpi_bmp085/Adafruit_BMP/BMP085.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-3> (1)
> * *R* src/plugins/rpi_bmp085/Adafruit_BMP/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-4> (0)
> * *R* src/plugins/rpi_bmp085/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-5> (54)
> * *R* src/plugins/rpi_bno055/Adafruit_BNO055/BNO055.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-6> (1)
> * *R* src/plugins/rpi_bno055/Adafruit_BNO055/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-7> (0)
> * *R* src/plugins/rpi_bno055/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-8>
> (122)
> * *R* src/plugins/rpi_button/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-9> (19)
> * *R* src/plugins/rpi_mcp3008/Adafruit_MCP3008/MCP3008.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-10> (1)
> * *R* src/plugins/rpi_mcp3008/Adafruit_MCP3008/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-11> (0)
> * *A* src/plugins/rpi_mcp3008/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-12>
> (121)
> * *R* src/plugins/rpi_rotary_encoder/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-13> (9)
> * *R* src/plugins/rpi_virtualwire/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-14>
> (109)
> * *R* src/plugins/rpi_virtualwire/virtualwire/__init__.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-15> (0)
> * *R* src/plugins/rpi_virtualwire/virtualwire/virtualwire.py
> <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-16> (1)
>
>
> Patch Links:
>
> * https://github.com/makerplane/FIX-Gateway/pull/16.patch
> * https://github.com/makerplane/FIX-Gateway/pull/16.diff
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#16>, or mute the
> thread
> <https://github.com/notifications/unsubscribe-auth/AEjkWSxI_nCy43JpPhRd5S0Dj8WnhfAIks5rM8mqgaJpZM4LXofl>.
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Jean,
I understand the learning curve. I'm still learning new ways to
program. Let's pass that change to Phil since he built the skel.py and
it would be a big change to a lot of the plugin scripts heck I didn't
notice it when I did the fsfg plugin. It's always a learning process.
Did you get a chance to mount the box in your plane to try it out
in flight?
Neil
…On 12/29/2016 11:05 AM, Jean-manuel Gagnon wrote:
Hello Neil,
I have use skel.py file as a model.
< Also you have imported sys and logger but they're not being used
didn’t know if that is future use? > You know I'm not a programmer and
in my learning curve I'm not experienced has used these functions But
if you agree to give me an example in a plugins I will try to apply it
thank you
> Le 29 déc. 2016 à 10:50, Neil Domalik ***@***.***> a
écrit :
>
> Jean,
>
> If your doing cleanup I'll hold off I did have a question about how
> you are stopping Threads. I think I see you have self.getout which if
> it's true you break the run function you also have. self. running which
> you can have the while loop watch for it to go False.
>
> def __init__(self, parent):
> self.getout = False
> # indicator for when to stop
>
> def run(self):
> while True:
> if self.getout:
> break
> self.running = False
>
> def stop(self):
> self.getout = True def __init__(self, parent):
> self.running = True
> # indicator for when to stop
>
> def run(self):
> while self.running:
> if self.getout:
> break
>
> def stop(self):
> self.running = False
>
>
> Also you have imported sys and logger but they're not being used didn't
> know if that is future use?
>
> There is my 2 cent for consideration
>
> Neil
>
> On 12/29/2016 09:54 AM, Jean-manuel Gagnon wrote:
> >
> > some clean up and addition of (# coding: utf8) i hope this will help.
> >
> > I change folder name to add rpi_
> >
> > i add
> >
> > -air pressure to database (bmp085)
> > -Orientation sensor calibration status and cuz acceleration (bno055)
> >
> > * more button setting like debuncing possibility
> >
> > some bug correction.
> >
> >
------------------------------------------------------------------------
> >
> >
> > You can view, comment on, or merge this pull request online at:
> >
> > #16
> >
> >
> > Commit Summary
> >
> > * Clean up and add some database input
> >
> >
> > File Changes
> >
> > * *M* src/config/database.csv
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-0> (5)
> > * *M* src/config/main.cfg
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-1> (33)
> > * *D* src/plugins/mcp3008/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-2>
> > (120)
> > * *R* src/plugins/rpi_bmp085/Adafruit_BMP/BMP085.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-3> (1)
> > * *R* src/plugins/rpi_bmp085/Adafruit_BMP/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-4> (0)
> > * *R* src/plugins/rpi_bmp085/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-5> (54)
> > * *R* src/plugins/rpi_bno055/Adafruit_BNO055/BNO055.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-6> (1)
> > * *R* src/plugins/rpi_bno055/Adafruit_BNO055/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-7> (0)
> > * *R* src/plugins/rpi_bno055/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-8>
> > (122)
> > * *R* src/plugins/rpi_button/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-9> (19)
> > * *R* src/plugins/rpi_mcp3008/Adafruit_MCP3008/MCP3008.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-10> (1)
> > * *R* src/plugins/rpi_mcp3008/Adafruit_MCP3008/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-11> (0)
> > * *A* src/plugins/rpi_mcp3008/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-12>
> > (121)
> > * *R* src/plugins/rpi_rotary_encoder/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-13> (9)
> > * *R* src/plugins/rpi_virtualwire/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-14>
> > (109)
> > * *R* src/plugins/rpi_virtualwire/virtualwire/__init__.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-15> (0)
> > * *R* src/plugins/rpi_virtualwire/virtualwire/virtualwire.py
> > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-16> (1)
> >
> >
> > Patch Links:
> >
> > * https://github.com/makerplane/FIX-Gateway/pull/16.patch
> > * https://github.com/makerplane/FIX-Gateway/pull/16.diff
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub
> > <#16>, or mute the
> > thread
> >
<https://github.com/notifications/unsubscribe-auth/AEjkWSxI_nCy43JpPhRd5S0Dj8WnhfAIks5rM8mqgaJpZM4LXofl>.
> >
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEjkWckH3EEKIn_6hB03dPoXV8SHf9s8ks5rM9pcgaJpZM4LXofl>.
|
It would be cleaner to put the self.getout flag in the while loop. I'm not sure what I was thinking. For a simple loop it makes sense but if you had more than one place in the loop where you could bail out it would make more sense to use the break. I think that is what I was trying to do. It doesn't really matter. Don't use the self.running flag as the signal to bail out though. That flag is used elsewhere in the plugin code to determine if the plugin is actually running or not. The last thing the plugin should do is set self.running to False. Otherwise it may create a race condition elsewhere. It could be a second or two between the setting of self.getout and the plugin's threads actually stopping. Actually setting self.running to False in the plugin code may be redundant because it gets set to False in the base class' stop() method. I'll try to spend some time cleaning them up and making sure that skel.py reflects the changes. The imports would be pretty low overhead. Python won't load the same module twice. sys and logger are in just about every other file so leaving them in and not using them won't make much difference. You should be using logger though. It'll make troubleshooting your plugins easier in the long run. :-) |
Hello Neil,
sorry for the late reply,
No I did not have the chance to try pyEfis in my plane, between flying, working, families and advancing my personal project, life fly has a crazy speed.
I hope next summer i will test it.
Jean-Manuel Gagnon
… Le 29 déc. 2016 à 11:31, Neil Domalik ***@***.***> a écrit :
Jean,
I understand the learning curve. I'm still learning new ways to
program. Let's pass that change to Phil since he built the skel.py and
it would be a big change to a lot of the plugin scripts heck I didn't
notice it when I did the fsfg plugin. It's always a learning process.
Did you get a chance to mount the box in your plane to try it out
in flight?
Neil
On 12/29/2016 11:05 AM, Jean-manuel Gagnon wrote:
> Hello Neil,
>
> I have use skel.py file as a model.
>
> < Also you have imported sys and logger but they're not being used
> didn’t know if that is future use? > You know I'm not a programmer and
> in my learning curve I'm not experienced has used these functions But
> if you agree to give me an example in a plugins I will try to apply it
>
> thank you
>
> > Le 29 déc. 2016 à 10:50, Neil Domalik ***@***.***> a
> écrit :
> >
> > Jean,
> >
> > If your doing cleanup I'll hold off I did have a question about how
> > you are stopping Threads. I think I see you have self.getout which if
> > it's true you break the run function you also have. self. running which
> > you can have the while loop watch for it to go False.
> >
> > def __init__(self, parent):
> > self.getout = False
> > # indicator for when to stop
> >
> > def run(self):
> > while True:
> > if self.getout:
> > break
> > self.running = False
> >
> > def stop(self):
> > self.getout = True def __init__(self, parent):
> > self.running = True
> > # indicator for when to stop
> >
> > def run(self):
> > while self.running:
> > if self.getout:
> > break
> >
> > def stop(self):
> > self.running = False
> >
> >
> > Also you have imported sys and logger but they're not being used didn't
> > know if that is future use?
> >
> > There is my 2 cent for consideration
> >
> > Neil
> >
> > On 12/29/2016 09:54 AM, Jean-manuel Gagnon wrote:
> > >
> > > some clean up and addition of (# coding: utf8) i hope this will help.
> > >
> > > I change folder name to add rpi_
> > >
> > > i add
> > >
> > > -air pressure to database (bmp085)
> > > -Orientation sensor calibration status and cuz acceleration (bno055)
> > >
> > > * more button setting like debuncing possibility
> > >
> > > some bug correction.
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > >
> > > You can view, comment on, or merge this pull request online at:
> > >
> > > #16
> > >
> > >
> > > Commit Summary
> > >
> > > * Clean up and add some database input
> > >
> > >
> > > File Changes
> > >
> > > * *M* src/config/database.csv
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-0> (5)
> > > * *M* src/config/main.cfg
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-1> (33)
> > > * *D* src/plugins/mcp3008/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-2>
> > > (120)
> > > * *R* src/plugins/rpi_bmp085/Adafruit_BMP/BMP085.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-3> (1)
> > > * *R* src/plugins/rpi_bmp085/Adafruit_BMP/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-4> (0)
> > > * *R* src/plugins/rpi_bmp085/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-5> (54)
> > > * *R* src/plugins/rpi_bno055/Adafruit_BNO055/BNO055.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-6> (1)
> > > * *R* src/plugins/rpi_bno055/Adafruit_BNO055/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-7> (0)
> > > * *R* src/plugins/rpi_bno055/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-8>
> > > (122)
> > > * *R* src/plugins/rpi_button/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-9> (19)
> > > * *R* src/plugins/rpi_mcp3008/Adafruit_MCP3008/MCP3008.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-10> (1)
> > > * *R* src/plugins/rpi_mcp3008/Adafruit_MCP3008/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-11> (0)
> > > * *A* src/plugins/rpi_mcp3008/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-12>
> > > (121)
> > > * *R* src/plugins/rpi_rotary_encoder/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-13> (9)
> > > * *R* src/plugins/rpi_virtualwire/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-14>
> > > (109)
> > > * *R* src/plugins/rpi_virtualwire/virtualwire/__init__.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-15> (0)
> > > * *R* src/plugins/rpi_virtualwire/virtualwire/virtualwire.py
> > > <https://github.com/makerplane/FIX-Gateway/pull/16/files#diff-16> (1)
> > >
> > >
> > > Patch Links:
> > >
> > > * https://github.com/makerplane/FIX-Gateway/pull/16.patch
> > > * https://github.com/makerplane/FIX-Gateway/pull/16.diff
> > >
> > > —
> > > You are receiving this because you are subscribed to this thread.
> > > Reply to this email directly, view it on GitHub
> > > <#16>, or mute the
> > > thread
> > >
> <https://github.com/notifications/unsubscribe-auth/AEjkWSxI_nCy43JpPhRd5S0Dj8WnhfAIks5rM8mqgaJpZM4LXofl>.
> > >
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub, or mute the thread.
> >
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#16 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AEjkWckH3EEKIn_6hB03dPoXV8SHf9s8ks5rM9pcgaJpZM4LXofl>.
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#16 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ADTlMO93Vtqu8zZoWWP378PMRKmgIggWks5rM-BYgaJpZM4LXofl>.
|
some clean up and addition of (# coding: utf8) i hope this will help.
I change folder name to add rpi_
i add
some bug correction.