Python Forum
[Tkinter] Anyone know what happened to my button?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Anyone know what happened to my button?
#26
(May-31-2021, 02:37 PM)Yoriz Wrote: If the update method was like this
    @submit_to_pool_executor(thread_pool_executor)
    def update(self):
        device.open()
        DATA_TO_SEND = "Hola XBee!"
        device.send_data_broadcast(DATA_TO_SEND)

        try:
            device.flush_queues()
            while True:
                xbee_message = device.read_data()
                if xbee_message is not None:
                    voltage, time, date = xbee_message.data.decode().split(',')
                    address = xbee_message.remote_device.get_64bit_addr()
                    print(f'Address: {address}')
                    print(f'Voltage: {voltage}, Time: {time}, Date: {date}')

                    self.data.set_date('30/05/2021')
                    self.data.set_time('12:00')
                    self.data.set_voltages((0.12, 3.8, 1.3))
                    self.form_frame.update()

        finally:
            if device is not None and device.is_open():
                device.close()
            self.btn_enable()
Would it on each while loop be a new sensor address and if there was 3 it would stop looping after the 3rd?

Yoriz I think I did not understand the question.
Yoriz I made a Drawing.


I am concerned about the order of the panels. Let's say I am going to indicate that the sensors are going to be located in the panels from right to left to have an order and that when reading them in the graphic interface, I know that the voltage of panel 1 is the one that is most at the left and from there on, panel 2 would be the one that follows.

So I wonder, How does one realize that the data belongs to a particular sensor?
We already know that everyone is going to send the same data, the voltage may be different but that's what the system is for determining what the lowest voltage is haha.

The address of each of the Xbee = sensors = panels, is what identifies them to identify themselves. It's like an ID.

As you are helping me, then I do not want to propose something very difficult or something very complex to do, I only express that I would love to respect the order in order to make the system more accurate, since in the interface it will indicate the panel with the Lower voltage and in this way it will be easier to look for it in the row of panels and change it because I will already know where it is according to the order that I specify at the beginning.

Attached Files

Thumbnail(s)
           
Reply


Messages In This Thread
RE: Anyone know what happened to my button? - by IgnacioMora23 - May-31-2021, 08:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,012 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020