iipEventPropertyUpdated method

void iipEventPropertyUpdated(
  1. int resourceId,
  2. int index,
  3. TransmissionType dataType,
  4. DC data,
)

Implementation

void iipEventPropertyUpdated(
    int resourceId, int index, TransmissionType dataType, DC data) {
  fetch(resourceId, null).then((r) {
    var item = new AsyncReply<DistributedResourceQueueItem>();
    _queue.add(item);

    Codec.parse(data, 0, this, null, dataType).reply.then((arguments) {
      var pt = r.instance?.template.getPropertyTemplateByIndex(index);
      if (pt != null) {
        item.trigger(DistributedResourceQueueItem(
            r, DistributedResourceQueueItemType.Propery, arguments, index));
      } else {
        // ft found, fi not found, this should never happen
        _queue.remove(item);
      }
    });
  });

  /*
        if (resources.Contains(resourceId))
        {
            // push to the queue to gaurantee serialization
            var reply = new AsyncReply<DistributedResourceQueueItem>();
            queue.Add(reply);

            var r = resources[resourceId];
            Codec.parse(content, 0, this).then((arguments) =>
            {
                if (!r.IsAttached)
                {
                    // property updated before the template is received
                    r.AddAfterAttachement(reply,
                                            new DistributedResourceQueueItem((DistributedResource)r,
                                                              DistributedResourceQueueItem.DistributedResourceQueueItemType.Propery,
                                                              arguments, index));
                }
                else
                {
                    var pt = r.instance.template.GetPropertyTemplate(index);
                    if (pt != null)
                    {
                        reply.trigger(new DistributedResourceQueueItem((DistributedResource)r,
                                                        DistributedResourceQueueItem.DistributedResourceQueueItemType.Propery,
                                                        arguments, index));
                    }
                    else
                    {    // ft found, fi not found, this should never happen
                        queue.Remove(reply);
                    }
                }
            });
        }
        */
}