示例#1
0
文件: Program.cs 项目: ATUAV/ATUAV
        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        private static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);

            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);

            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            if (Settings.ProcessorDefinitions.ContainsKey(connector.Info.ProductId))
            {
                foreach (EmdatProcessorSettings settings in Settings.ProcessorDefinitions[connector.Info.ProductId])
                {
                    EmdatProcessor processor = new EmdatProcessor(syncManager);
                    processor.CumulativeData = settings.Cumulative;
                    connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
                    fixations.FixDetector.FixationEnd     += processor.FixationEnd;
                    Processors.Add(settings.ProcessorId, processor);
                }
            }
        }
示例#2
0
        /// <summary>
        /// Adds a configuration processor.
        /// </summary>
        /// <param name="configProcessor">The configuration processor to add.</param>
        /// <returns>The table builder.</returns>
        public ITableBuilder AddProcessor(IConfigProcessor configProcessor)
        {
            CheckInitialized();

            Processors.Add(configProcessor);
            return(this);
        }
        public List <Processor> ExtractProcessors(string line, Validations validations)
        {
            // Check whether the line starts opening/closing PROCESSORS section
            // If yes, mark it exist
            ProcessorsSection.MarkSection(line, Int16.Parse(validations.LineNumber));

            // Count PROCESSOR section
            ProcessorPair.CheckValidKeyword(line);

            // Extract Processor data within PROCESSOR section
            if (ProcessorsSection.ValidSectionPair[0] &&
                !ProcessorsSection.ValidSectionPair[1])
            {
                Processor processor;

                // Check whether the reader goes within the PROCESSOR section
                CffProcessorkExtraction.MarkInsideProcessor(line, validations);

                processor = CffProcessorkExtraction.ExtractProcessor(line, validations);
                if (processor != null)
                {
                    Processors.Add(processor);
                }
            }

            return(Processors);
        }
示例#4
0
        /// <summary>
        /// The command-bound method for adding a processor to the collection.
        /// </summary>
        private void DoAddProcessor()
        {
            // create instance of selected type
            var instance = Activator.CreateInstance(_selectedProcessorType);

            // add instance to collection
            Processors.Add(instance as IImageProcessor);
        }
示例#5
0
        internal override void ReadData(AwesomeReader ar)
        {
            Pedals.Clear();
            Processors.Clear();

            AmpPath     = ar.ReadUInt64();
            GainLevel   = ar.ReadSingle();
            BassLevel   = ar.ReadSingle();
            MidLevel    = ar.ReadSingle();
            TrebleLevel = ar.ReadSingle();
            ReverbLevel = ar.ReadSingle();
            VolumeLevel = ar.ReadSingle();

            AmpReverb = ar.ReadUInt64();

            int pedalCount = ar.ReadInt32();

            ar.BaseStream.Position += 4;

            int processorCount = ar.ReadInt32();

            ar.BaseStream.Position += 4;

            // Reads pedals
            for (int i = 0; i < pedalCount; i++)
            {
                Pedal pedal = new Pedal();
                pedal.ModelPath = ar.ReadUInt64();
                pedal.Flag1     = ar.ReadBoolean();
                pedal.Flag2     = ar.ReadBoolean();
                pedal.Flag3     = ar.ReadBoolean();
                pedal.Flag4     = ar.ReadBoolean();

                pedal.Knob1 = ar.ReadSingle();
                pedal.Knob2 = ar.ReadSingle();
                pedal.Knob3 = ar.ReadSingle();

                Pedals.Add(pedal);
            }

            // Reads audio processors
            for (int i = 0; i < processorCount; i++)
            {
                AudioProcessor processor = new AudioProcessor();
                processor.ModelPath = ar.ReadUInt64();

                processor.Knob1 = ar.ReadSingle();
                processor.Knob2 = ar.ReadSingle();

                Processors.Add(processor);
            }
        }
示例#6
0
        private void OnValueAdded(string key, object value)
        {
            if (value is SkinDictionary skinValue)
            {
                skinValue.Parent = this;
                skinValue.Key    = key;
            }

            if (value is SkinDictionaryProcessor skinProcessor)
            {
                Processors.Add(skinProcessor);
            }
        }
示例#7
0
 public void Run()
 {
     foreach (var procKlass in _processors)
     {
         var processorType = Type.GetType("Elite.DataCollecting.API.Lib.Processors." + procKlass);
         var processor     = (TextProcessor)Activator
                             .CreateInstance(processorType,
                                             new object[] { _hostingEnvironment, _inputText });
         Processors.Add(processor);
         processor.ProcessText();
         _inputText = processor.OutputText;
     }
     Result = _inputText;
 }
示例#8
0
        private EntityProcessor CreateRenderProcessor(RegisteredRenderProcessors registeredRenderProcessor, VisibilityGroup visibilityGroup)
        {
            // Create
            var processor = (EntityProcessor)Activator.CreateInstance(registeredRenderProcessor.Type);

            // Set visibility group
            ((IEntityComponentRenderProcessor)processor).VisibilityGroup = visibilityGroup;

            // Add processor
            Processors.Add(processor);
            registeredRenderProcessor.Instances.Add(new KeyValuePair <VisibilityGroup, EntityProcessor>(visibilityGroup, processor));

            return(processor);
        }
示例#9
0
        private void startClient(Socket s)
        {
            var dc = new DaemonClient(this)
            {
                Peer = s.RemoteEndPoint
            };

            // [caytchen] TODO: insanse anonymous methods were ported 1:1 from jgit, do properly sometime
            var t = new Thread(
                new ThreadStart(delegate
            {
                using (NetworkStream stream = new NetworkStream(s))
                {
                    try
                    {
                        dc.Execute(new BufferedStream(stream));
                    }
                    catch (IOException)
                    {
                    }
                    catch (SocketException)
                    {
                    }
                    finally
                    {
                        try
                        {
                            s.Close();
                        }
                        catch (IOException)
                        {
                        }
                        catch (SocketException)
                        {
                        }
                    }
                }
            }));

            t.Start();
            Processors.Add("Git-Daemon-Client " + s.RemoteEndPoint, t);
        }
示例#10
0
        public CachedAppConfig(IAppConfig src)
        {
            InputPath     = src.InputFile.FilePath;
            OutputPath    = src.OutputFile.FilePath;
            ProcessorType = src.ProcessorType;

            foreach (var kvp in src.Processors)
            {
                var cachedPI = new ProcessorInfo
                {
                    MaxDistanceMultiplier = kvp.Value.MaxDistanceMultiplier,
                    MaxSeparation         = new Distance(kvp.Value.MaxSeparation.Unit, kvp.Value.MaxSeparation.OriginalValue)
                };

                Processors.Add(kvp.Key, cachedPI);
            }

            APIKey              = src.APIKey;
            RouteWidth          = src.RouteWidth;
            RouteColor          = src.RouteColor;
            RouteHighlightColor = src.RouteHighlightColor;
        }
示例#11
0
        private void AddNode(BaseProcessor node)
        {
            if (!Model.Targets.Contains(node))
            {
                Model.Targets.Add(node);
            }

            // set pipeline for subnodes
            node.Pipeline = Model;

            var nodeViewModel = new NodeViewModel
            {
                Model    = node,
                Pipeline = this
            };

            Processors.Add(nodeViewModel);

            if (Equals(Mode, PipelineMode.Started))
            {
                nodeViewModel.Start();
            }
        }
示例#12
0
        /// <summary>
        ///		Inicializa el manager de trabajo con los plugins
        /// </summary>
        public bool Initialize(System.Collections.Generic.List <string> pathPlugins)
        {
            bool initialized = false;

            // Carga los plugins
            if (!ValidateData(pathPlugins, out string error))
            {
                Context.Logger.WriteError("JobManager - Initialize plugins", error);
            }
            else
            {
                Processor.Controllers.PluginsManager <IJobStepProcessor> pluginsManager = new Processor.Controllers.PluginsManager <IJobStepProcessor>();

                // Inicializa el manejador de plugins
                pluginsManager.Initialize(pathPlugins, ".dll");
                // Controla los errores
                if (pluginsManager.Errors.Count == 0)
                {
                    // Añade los procesadores
                    foreach (IJobStepProcessor processor in pluginsManager.Plugins)
                    {
                        Processors.Add(processor.Key, processor);
                    }
                    // Indica que se ha inicializado correctamente
                    initialized = true;
                }
                else
                {
                    foreach (string pluginError in pluginsManager.Errors)
                    {
                        Context.Logger.WriteError("JobManager - Initialize plugins", pluginError);
                    }
                }
            }
            // Devuelve el valor que indica si se ha inicializado
            return(initialized);
        }
示例#13
0
 public IImportPipelineBuilder UseProcessor(ImportProcessor importProcessor)
 {
     Processors.Add(importProcessor);
     return(this);
 }
示例#14
0
 public ILogsProcessorBuilder Add <TEventDto>(Func <IEnumerable <EventLog <TEventDto> >, Task> callBack) where TEventDto : class, new()
 {
     Processors.Add(new LogProcessor <TEventDto>(callBack));
     return(this);
 }
示例#15
0
 /// <summary>
 ///		Añade un procesador
 /// </summary>
 public void AddProcessor(IJobProcesor processor)
 {
     Processors.Add(processor.Key, processor);
 }
示例#16
0
 public ILogsProcessorBuilder Add(EventSubscription eventSubscription)
 {
     Processors.Add(eventSubscription);
     return(this);
 }
示例#17
0
 public ILogsProcessorBuilder AddToQueue <TEventDto>(IQueue queue, Predicate <EventLog <TEventDto> > predicate = null, Func <EventLog <TEventDto>, object> mapper = null) where TEventDto : class, new()
 {
     Processors.Add(new EventLogQueueProcessor <TEventDto>(queue, predicate, mapper));
     return(this);
 }
示例#18
0
 public ILogsProcessorBuilder Add <TEventDto>(EventSubscription <TEventDto> eventSubscription) where TEventDto : class, new()
 {
     Processors.Add(eventSubscription);
     return(this);
 }
 public ILogsProcessorBuilder <TEventDto> OnEvents(Func <IEnumerable <EventLog <TEventDto> >, Task> callBack)
 {
     Processors.Add(new LogProcessor <TEventDto>(callBack));
     return(this);
 }
示例#20
0
 public ILogsProcessorBuilder Add(ILogProcessor processor)
 {
     Processors.Add(processor);
     return(this);
 }
示例#21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TableBuilder"/> class.
 /// </summary>
 public TableBuilder()
 {
     Processors.Add(new DefaultPropertyProcessor());
     Processors.Add(new DefaultAttributeProcessor());
     Processors.Add(new DefaultConfigProcessor());
 }
示例#22
0
 public ILogsProcessorBuilder Add(Func <IEnumerable <FilterLog>, Task> callBack)
 {
     Processors.Add(new CatchAllFilterLogProcessor(callBack));
     return(this);
 }
示例#23
0
 private void AddProcessor <TInterface>(IProcessor processor) where TInterface : IEntityBase
 {
     Processors.Add(H.Get <TInterface>(), processor);
 }
示例#24
0
 public ILogsProcessorBuilder Add(Predicate <FilterLog> isItForMe, Func <IEnumerable <FilterLog>, Task> func)
 {
     Processors.Add(new FilterLogProcessor(isItForMe, func));
     return(this);
 }
示例#25
0
 public ILogsProcessorBuilder AddToQueue(IQueue queue, Predicate <FilterLog> predicate = null, Func <FilterLog, object> mapper = null)
 {
     Processors.Add(new EventLogQueueProcessor(queue, predicate, mapper));
     return(this);
 }
示例#26
0
        public void GenerateData()
        {
            Case u1 = new Case()
            {
                Model  = "SysUniCa2000",
                Name   = "SystemUnitCase",
                Price  = 2000,
                Length = 200,
                Width  = 100,
                Height = 50,
            };
            Case u2 = new Case()
            {
                Model  = "SysUniCa150",
                Name   = "SystemUnitCase",
                Price  = 1500,
                Length = 120,
                Width  = 120,
                Height = 50,
            };
            Case u3 = new Case()
            {
                Model  = "SysUniCa3000",
                Name   = "SystemUnitCase",
                Price  = 1000,
                Length = 100,
                Width  = 80,
                Height = 30,
            };

            u1.MotherboardTypesSupported.Add(MotherboardTypes.MBT100);
            u1.MotherboardTypesSupported.Add(MotherboardTypes.MBT200);
            u1.MotherboardTypesSupported.Add(MotherboardTypes.MBT300);
            u1.MotherboardTypesSupported.Add(MotherboardTypes.MBT500);

            u2.MotherboardTypesSupported.Add(MotherboardTypes.MBT400);
            u2.MotherboardTypesSupported.Add(MotherboardTypes.MBT500);
            u2.MotherboardTypesSupported.Add(MotherboardTypes.MBT600);

            u3.MotherboardTypesSupported.Add(MotherboardTypes.MBT700);
            u3.MotherboardTypesSupported.Add(MotherboardTypes.MBT400);
            u3.MotherboardTypesSupported.Add(MotherboardTypes.MBT300);
            u3.MotherboardTypesSupported.Add(MotherboardTypes.MBT600);

            Cases.Add(u1.Id, u1);
            Cases.Add(u2.Id, u2);
            Cases.Add(u3.Id, u3);

            Motherboard m1 = new Motherboard()
            {
                Type = MotherboardTypes.MBT100, Model = "M1", Name = "Motherboard M1", Price = 600
            };
            Motherboard m2 = new Motherboard()
            {
                Type = MotherboardTypes.MBT200, Model = "M2", Name = "Motherboard M2", Price = 500
            };
            Motherboard m3 = new Motherboard()
            {
                Type = MotherboardTypes.MBT300, Model = "M3", Name = "Motherboard M3", Price = 300
            };
            Motherboard m4 = new Motherboard()
            {
                Type = MotherboardTypes.MBT500, Model = "M4", Name = "Motherboard M4", Price = 1000
            };
            Motherboard m5 = new Motherboard()
            {
                Type = MotherboardTypes.MBT700, Model = "M5", Name = "Motherboard M5", Price = 1400
            };

            m1.ProcessorTypesSupported.Add(ProcessorTypes.PT1);
            m1.ProcessorTypesSupported.Add(ProcessorTypes.PT2);
            m1.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT1);
            m1.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT2);
            m1.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT5);


            m2.ProcessorTypesSupported.Add(ProcessorTypes.PT3);
            m2.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT4);

            m3.ProcessorTypesSupported.Add(ProcessorTypes.PT4);
            m3.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT1);
            m3.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT3);


            m4.ProcessorTypesSupported.Add(ProcessorTypes.PT4);
            m4.ProcessorTypesSupported.Add(ProcessorTypes.PT5);
            m4.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT5);
            m4.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT5);


            m5.ProcessorTypesSupported.Add(ProcessorTypes.PT2);
            m5.ProcessorTypesSupported.Add(ProcessorTypes.PT3);
            m5.ProcessorTypesSupported.Add(ProcessorTypes.PT4);
            m5.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT2);
            m5.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT3);
            m5.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT4);
            m5.MemoryCardTypesSupported.Add(MemoryCardTypes.MCT5);

            Motherboards.Add(m1.Id, m1);
            Motherboards.Add(m2.Id, m2);
            Motherboards.Add(m3.Id, m3);
            Motherboards.Add(m4.Id, m4);
            Motherboards.Add(m5.Id, m5);

            Processor p1 = new Processor()
            {
                Type             = ProcessorTypes.PT1,
                NumberOfCores    = 4,
                Name             = "Processor PT1 4 cores",
                Model            = "P1",
                Price            = 300,
                Architecture     = "A1",
                ClockRate        = 4,
                PowerConsumption = 400
            };
            Processor p2 = new Processor()
            {
                Type             = ProcessorTypes.PT1,
                NumberOfCores    = 8,
                Name             = "Processor PT1 8 cores",
                Model            = "P2",
                Price            = 400,
                Architecture     = "A1",
                ClockRate        = 3,
                PowerConsumption = 500
            };
            Processor p3 = new Processor()
            {
                Type             = ProcessorTypes.PT2,
                NumberOfCores    = 4,
                Name             = "Processor PT2 4 cores",
                Model            = "P3",
                Price            = 2000,
                Architecture     = "A2",
                ClockRate        = 5,
                PowerConsumption = 600
            };
            Processor p4 = new Processor()
            {
                Type             = ProcessorTypes.PT3,
                NumberOfCores    = 16,
                Name             = "Processor PT3 16 cores",
                Model            = "P4",
                Price            = 5000,
                Architecture     = "A3",
                ClockRate        = 8,
                PowerConsumption = 700
            };

            Processors.Add(p1.Id, p1);
            Processors.Add(p2.Id, p2);
            Processors.Add(p3.Id, p3);
            Processors.Add(p4.Id, p4);

            MemoryCard c1 = new MemoryCard()
            {
                Type           = MemoryCardTypes.MCT1,
                Name           = "Memory Card MCT1",
                Model          = "MC 1 1024",
                Price          = 2000,
                MemoryCapacity = 1024
            };
            MemoryCard c2 = new MemoryCard()
            {
                Type           = MemoryCardTypes.MCT4,
                Name           = "Memory Card MCT4",
                Model          = "MC 2 2048",
                Price          = 3200,
                MemoryCapacity = 2048
            };
            MemoryCard c3 = new MemoryCard()
            {
                Type           = MemoryCardTypes.MCT5,
                Name           = "Memory Card MCT5",
                Model          = "MC 3 1024",
                Price          = 1200,
                MemoryCapacity = 1024
            };
            MemoryCard c4 = new MemoryCard()
            {
                Type           = MemoryCardTypes.MCT3,
                Name           = "Memory Card MCT3",
                Model          = "MC 3 512",
                Price          = 700,
                MemoryCapacity = 512
            };
            MemoryCard c5 = new MemoryCard()
            {
                Type           = MemoryCardTypes.MCT1,
                Name           = "Memory Card MCT1",
                Model          = "MC 1 1024",
                Price          = 1700,
                MemoryCapacity = 1024
            };

            MemoryCards.Add(c1.Id, c1);
            MemoryCards.Add(c2.Id, c2);
            MemoryCards.Add(c3.Id, c3);
            MemoryCards.Add(c4.Id, c4);
            MemoryCards.Add(c5.Id, c5);

            PowerSource s1 = new PowerSource()
            {
                Name   = "PS1000",
                Length = 120,
                Width  = 100,
                Height = 10,
                Power  = 4500,
                Price  = 500,
                Model  = "SPS 4500",
                VoltageDropsProtection = true
            };
            PowerSource s2 = new PowerSource()
            {
                Name   = "PS1000",
                Length = 80,
                Width  = 80,
                Height = 20,
                Power  = 4200,
                Price  = 700,
                Model  = "SPS 4200",
                VoltageDropsProtection = true
            };
            PowerSource s3 = new PowerSource()
            {
                Name   = "PS1000",
                Length = 100,
                Width  = 90,
                Height = 10,
                Power  = 5000,
                Price  = 500,
                Model  = "SPS 5000",
                VoltageDropsProtection = false
            };
            PowerSource s4 = new PowerSource()
            {
                Name   = "PS1000",
                Length = 120,
                Width  = 120,
                Height = 15,
                Power  = 4500,
                Price  = 400,
                Model  = "SPS 4500",
                VoltageDropsProtection = false
            };

            PowerSources.Add(s1.Id, s1);
            PowerSources.Add(s2.Id, s2);
            PowerSources.Add(s3.Id, s3);
            PowerSources.Add(s4.Id, s4);
        }