makerplane / FIX-Gateway

Flight Information eXchange Gateway
GNU General Public License v2.0
9 stars 21 forks source link

Clean up and add some database input #16

Closed jmg22 closed 7 years ago

jmg22 commented 7 years ago

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.

neil-d95 commented 7 years ago

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:

https://github.com/makerplane/FIX-Gateway/pull/16

    Commit Summary

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/makerplane/FIX-Gateway/pull/16, or mute the thread https://github.com/notifications/unsubscribe-auth/AEjkWSxI_nCy43JpPhRd5S0Dj8WnhfAIks5rM8mqgaJpZM4LXofl.

jmg22 commented 7 years ago

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 notifications@github.com 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:

https://github.com/makerplane/FIX-Gateway/pull/16

Commit Summary

  • Clean up and add some database input

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/makerplane/FIX-Gateway/pull/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.

neil-d95 commented 7 years ago

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 notifications@github.com 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:

https://github.com/makerplane/FIX-Gateway/pull/16

Commit Summary

  • Clean up and add some database input

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/makerplane/FIX-Gateway/pull/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 https://github.com/makerplane/FIX-Gateway/pull/16#issuecomment-269651564, or mute the thread https://github.com/notifications/unsubscribe-auth/AEjkWckH3EEKIn_6hB03dPoXV8SHf9s8ks5rM9pcgaJpZM4LXofl.

birkelbach commented 7 years ago

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. :-)

jmg22 commented 7 years ago

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 notifications@github.com 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 notifications@github.com 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:

https://github.com/makerplane/FIX-Gateway/pull/16

Commit Summary

  • Clean up and add some database input

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/makerplane/FIX-Gateway/pull/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 https://github.com/makerplane/FIX-Gateway/pull/16#issuecomment-269651564, 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 https://github.com/makerplane/FIX-Gateway/pull/16#issuecomment-269655389, or mute the thread https://github.com/notifications/unsubscribe-auth/ADTlMO93Vtqu8zZoWWP378PMRKmgIggWks5rM-BYgaJpZM4LXofl.