Skip to content

Indexes and Requests #67

Closed
Closed
@danricho

Description

@danricho

Hello again!

I have run into some strange behaviour for the aq.find() method.

I'm probably doing something stupid, but here is what I am doing and observing:

signals = {
'COM_ACTIVE_FREQUENCY:1': {"getter": None, "val": None},
'COM_ACTIVE_FREQUENCY:2': {"getter": None, "val": None},
'NAV_ACTIVE_FREQUENCY:1': {"getter": None, "val": None},
'NAV_ACTIVE_FREQUENCY:2': {"getter": None, "val": None},
}

while True:

  for signal in signals.keys():

    if signals[signal]["getter"] == None:
      signals[signal]["getter"] = aq.find(signal)

    data = signals[signal]["getter"].value
    if not data == None:
      signals[signal]["val"] = data

    print(signal, signals[signal]["getter"], signals[signal]["val"])
  print()

  sleep(2)

This results in the reading for the first loop being good, but subsequent loops only show the 2nd index reading as follows:

COM_ACTIVE_FREQUENCY:1 <SimConnect.RequestList.Request object at 0x0000028F5FB9E130> 128.7
COM_ACTIVE_FREQUENCY:2 <SimConnect.RequestList.Request object at 0x0000028F5FB9E130> 124.85
NAV_ACTIVE_FREQUENCY:1 <SimConnect.RequestList.Request object at 0x0000028F5FB9E160> 113.8
NAV_ACTIVE_FREQUENCY:2 <SimConnect.RequestList.Request object at 0x0000028F5FB9E160> 112.8

COM_ACTIVE_FREQUENCY:1 <SimConnect.RequestList.Request object at 0x0000028F5FB9E130> 124.85
COM_ACTIVE_FREQUENCY:2 <SimConnect.RequestList.Request object at 0x0000028F5FB9E130> 124.85
NAV_ACTIVE_FREQUENCY:1 <SimConnect.RequestList.Request object at 0x0000028F5FB9E160> 112.8
NAV_ACTIVE_FREQUENCY:2 <SimConnect.RequestList.Request object at 0x0000028F5FB9E160> 112.8

The results also show that the two COM signals use the same request (and hence the same value) as do the NAV radio signals. I can see the index being checked for during the aq.find() method, but can't really follow how the index is considered during the .value read.

Thanks for any assistance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions