示例#1
0
        public AnalyticProcessor(Analytic analytic, Dictionary <string, int> framesPerSecond)
        {
            m_nextTimeStamp = Gemstone.Ticks.MinValue;

            m_analytic = analytic;
            m_instance = CreateAnalytic(m_analytic, framesPerSecond);

            InputNames = m_instance.InputNames().ToList();

            m_pastPoints = new Queue <IFrame>(m_instance.PrevFrames);
            NProcessed   = 0;
        }
示例#2
0
        public static IAnalytic CreateAnalytic(Analytic analytic, Dictionary <string, int> framesPerSecond)
        {
            try
            {
                IAnalytic Instance = (IAnalytic)Activator.CreateInstance(analytic.AdapterType);
                Instance.Configure(analytic.Configuration);
                Instance.SetInputFPS(analytic.Inputs.Select(item => framesPerSecond[item]));

                analytic.Outputs.ForEach((item) => framesPerSecond.Add(item.Name, Instance.FramesPerSecond));
                return(Instance);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }