Ladder99 / fanuc-driver

Configurable Fanuc Focas data collector and post processor.
Apache License 2.0
72 stars 25 forks source link

Collectors need to be in particular order #80

Open tukusejssirs opened 1 year ago

tukusejssirs commented 1 year ago

I use ladder99/fanuc-driver:linux64-886a5a3 Docker image.

When I define collectors as follows (I sort the collectors alphabetically):

  collector-data: &collector-data
    l99.driver.fanuc.strategies.FanucMultiStrategy, fanuc:
      - l99.driver.fanuc.collectors.Alarms, fanuc
      - l99.driver.fanuc.collectors.AxisData, fanuc
      - l99.driver.fanuc.collectors.GCodeData, fanuc
      - l99.driver.fanuc.collectors.MachineInfo, fanuc
      - l99.driver.fanuc.collectors.Messages, fanuc
      - l99.driver.fanuc.collectors.ProductionData, fanuc
      - l99.driver.fanuc.collectors.SpindleData, fanuc
      - l99.driver.fanuc.collectors.StateData, fanuc
      - l99.driver.fanuc.collectors.ToolData, fanuc

it sometimes (rarely) works, sometimes it does not work.

However, when I move MachineInfo to the top (as the first collector, before Alarms), all works as expected.

I’d assume that the order in which the collectors are defined, does not matter, i.e. fanuc-driver would solve the collector dependencies on each other.

MRIIOT commented 1 year ago

Yes, this needs to be addressed internally to resolve dependencies regardless of the order in yaml.

MRIIOT commented 1 year ago

Order of collectors becomes relevant in the case of outputs backed by Scriban scripts. In the example of MTConnect output, the execution data item is created by the StateData class, however, it might be desirable to overwrite the value using data from Pmc class. In this case, Pmc must execute after StateData.