Exemplo n.º 1
0
        private static void PCSEventProcessing(IPacketSubscriber eventPublisher, int deviceIndex, DUT_MQTT_PCS pcs, long timestamp)
        {
            eventPublisher.UpdateDigitalPoint(ENV.SiteId, 0, deviceIndex, 3, 10001, pcs.Warning[0], timestamp);
            eventPublisher.UpdateDigitalPoint(ENV.SiteId, 0, deviceIndex, 3, 10002, pcs.Warning[1], timestamp);

            for (int i = 0; i < 5; i++)
            {
                eventPublisher.UpdateDigitalPoint(ENV.SiteId, 0, deviceIndex, 3, 20001 + i, pcs.Fault[i], timestamp);
            }
        }
Exemplo n.º 2
0
        public static void EventProcessing(IPacketSubscriber eventPublisher, DUT_MQTT_ESS packet)
        {
            DUT_MQTT_PCS[] pcsPackets = packet.PCS;
            DUT_MQTT_BAT[] bmsPackets = packet.BAT;

            int      siteid    = ENV.SiteId;
            int      rccid     = ENV.RccId;
            DateTime timestamp = DateTime.FromFileTime(packet.Header.Timestamp);

            for (int pcsIdx = 0; pcsIdx < ENV.PcsCount; pcsIdx++)
            {
                DUT_MQTT_PCS pcsPacket = pcsPackets[pcsIdx];
                DUT_MQTT_BAT batPacket = bmsPackets[pcsIdx];
                PCSEventProcessing(eventPublisher, pcsIdx + 1, pcsPacket, packet.Header.Timestamp);
                BatEventProcessing(eventPublisher, pcsIdx + 1, batPacket, packet.Header.Timestamp);
            }
        }
Exemplo n.º 3
0
 public DataPublisherWorker(ILogger <DataPublisherWorker> logger, IPacketSubscriber subscriber)
 {
     _logger         = logger;
     this.subscriber = subscriber;
 }
Exemplo n.º 4
0
 private static void BatEventProcessing(IPacketSubscriber eventPublisher, int deviceIndex, DUT_MQTT_BAT bat, long timestamp)
 {
     eventPublisher.UpdateDigitalPoint(ENV.SiteId, 1, deviceIndex, 3, 30001, bat.Warning[0], timestamp);
     eventPublisher.UpdateDigitalPoint(ENV.SiteId, 1, deviceIndex, 3, 40001, bat.Fault[0], timestamp);
 }