smartcitizen
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| smartcitizen [2020/11/12 18:48] – [buildozer.spec] serge | smartcitizen [2020/12/01 17:43] (Version actuelle) – ↷ Liens modifiés en raison d'un déplacement. serge | ||
|---|---|---|---|
| Ligne 10: | Ligne 10: | ||
| **Voir [[smartcitizen_hardware_software|la page dédiée aux recherches et expérimentations autour du kit SmartCitizen coté logiciel et matériel]]** : extraction de données, envoi par client mqtt, connexion au réseau Lora, ... | **Voir [[smartcitizen_hardware_software|la page dédiée aux recherches et expérimentations autour du kit SmartCitizen coté logiciel et matériel]]** : extraction de données, envoi par client mqtt, connexion au réseau Lora, ... | ||
| - | {{ :: | + | {{ media_12: |
| Ligne 25: | Ligne 25: | ||
| <WRAP group> | <WRAP group> | ||
| <WRAP third column> | <WRAP third column> | ||
| - | {{:: | + | {{media_12: |
| </ | </ | ||
| <WRAP third column> | <WRAP third column> | ||
| - | {{:: | + | {{media_12: |
| </ | </ | ||
| <WRAP third column> | <WRAP third column> | ||
| - | {{:: | + | {{media_12: |
| </ | </ | ||
| </ | </ | ||
| - | {{ : | + | {{ media_12: |
| ====Ressources==== | ====Ressources==== | ||
| * **[[https:// | * **[[https:// | ||
| Ligne 45: | Ligne 45: | ||
| * **[[https:// | * **[[https:// | ||
| ===apk=== | ===apk=== | ||
| - | **{{ :: | + | **{{ media_12: |
| ====Les choses non réussies==== | ====Les choses non réussies==== | ||
| Ligne 57: | Ligne 57: | ||
| Une solution plus élégante est utilisée dans **[[https:// | Une solution plus élégante est utilisée dans **[[https:// | ||
| <code python> | <code python> | ||
| + | class AccelerometerApp(App): | ||
| + | def build(self): | ||
| + | return Accelerometer(self) | ||
| + | | ||
| + | class Accelerometer(BoxLayout): | ||
| + | def __init__(self, | ||
| + | super().__init__(**kwargs) | ||
| + | self.app = app | ||
| + | self.app.osc = OSC() | ||
| + | | ||
| + | class OSC: | ||
| + | def __init__(self): | ||
| + | self.histo = [] | ||
| + | self.server = OSCThreadServer() | ||
| + | self.server.bind(b'/ | ||
| + | | ||
| + | def on_histo(self, | ||
| + | self.histo = .... | ||
| + | | ||
| class Screen2: | class Screen2: | ||
| - | | + | def __init__(self): |
| - | # et appel de l' | + | |
| - | self.app.osc.histo | + | # et appel de l' |
| + | self.app.osc.histo | ||
| + | Clock.schedule_once(self._once, | ||
| + | |||
| + | def _once(self, dt): | ||
| + | Clock.schedule_interval(self.update, | ||
| + | |||
| + | def update(self, | ||
| + | blabla = self.app.osc.histo | ||
| + | # blabla retrouve la valeur de histo de OSC !!!! | ||
| </ | </ | ||
| Ligne 128: | Ligne 156: | ||
| thread_update.start() | thread_update.start() | ||
| </ | </ | ||
| + | ou\\ | ||
| + | class threading.Thread(group=None, | ||
| {{tag> smartcitizen kivy python realisations_logicielles sb }} | {{tag> smartcitizen kivy python realisations_logicielles sb }} | ||
smartcitizen.1605206889.txt.gz · Dernière modification : de serge
