TrakHound_Server.Plugins.SnapshotData.Snapshot.Process C# (CSharp) Méthode

Process() public static méthode

public static Process ( DeviceConfiguration config, ProcessInfo info ) : void
config TrakHound.Configurations.DeviceConfiguration
info ProcessInfo
Résultat void
        public static void Process(DeviceConfiguration config, ProcessInfo info)
        {
            if (info.CurrentInstance != null)
            {
                var sdc = Configuration.Get(config);
                if (sdc != null)
                {
                    DataTable variables_DT = null;

                    foreach (var snapshot in sdc.Snapshots)
                    {
                        switch (snapshot.Type)
                        {
                            case SnapshotType.Collected:

                                ProcessCollected(snapshot, info.CurrentData);
                                break;

                            case SnapshotType.Generated:

                                var gec = GeneratedEvents.Configuration.Get(config);
                                if (gec != null)
                                {
                                    ProcessGenerated(snapshot, gec, info.CurrentInstance, info.CurrentData);
                                }

                                break;

                            case SnapshotType.Variable:

                                ProcessVariables(snapshot, variables_DT);
                                break;
                        }
                    }
                }
            }
        }

Usage Example

Exemple #1
0
        public void GetSentData(EventData data)
        {
            if (data != null && data.Id != null && configuration != null)
            {
                if (data.Id == "CURRENT_INSTANCE")
                {
                    if (data.Data02 != null)
                    {
                        var sdc = Configuration.Get(configuration);
                        if (sdc != null)
                        {
                            var currentInstance = (CurrentInstance)data.Data02;

                            var info = new Snapshot.ProcessInfo();
                            info.CurrentData     = currentInstance.CurrentData;
                            info.CurrentInstance = currentInstance.Instance;

                            Snapshot.Process(configuration, info);

                            // Send List of SnapShotItems to other Plugins
                            SendSnapShotItems(sdc.Snapshots);
                        }
                    }
                    else
                    {
                        SendSnapShotItems(null);
                    }
                }
            }
        }