예제 #1
0
        protected void SetMap(string boxName, BoardSettings settings)
        {
            var maps = IOconfFile.GetMap();

            Map = maps.SingleOrDefault(x => x.BoxName == boxName);
            if (Map == null)
            {
                throw new Exception($"{boxName} not found in map: {string.Join(", ", maps.Select(x => x.BoxName))}");
            }
            Map.BoardSettings = settings;
        }
예제 #2
0
        public IEnumerable <IOconfInput> GetDistributedExpandedInputConf()
        {
            if (Disabled)
            {
                yield break;
            }
            //note there is no map entry for the IOconfRpiTemp as it is not an external box, but at the moment we only expose the IOconfNode through it
            var nodes = IOconfFile.GetEntries <IOconfNode>().ToList();

            if (nodes.Count == 0)
            {
                var map = Map = new IOconfMap($"Map;RpiFakeBox;{Name}Box", LineNumber);
                yield return(new IOconfInput($"RPiTemp;{Name}Gpu", LineNumber, Type, false, false, BoardSettings.Default)
                {
                    Map = map, Skip = true
                });

                yield return(new IOconfInput($"RPiTemp;{Name}Cpu", LineNumber, Type, false, false, BoardSettings.Default)
                {
                    Map = map, Skip = true
                });

                yield break;
            }

            foreach (var node in nodes)
            {
                //note there is no map entry for the IOconfRpiTemp as it not an external box, but at the moment we only expose the IOconfNode through it
                var map = Map = new IOconfMap($"Map;RpiFakeBox;{Name}_{node.Name}Box;{node.Name}", LineNumber);
                yield return(new IOconfInput($"RPiTemp;{Name}_{node.Name}Gpu", LineNumber, Type, false, false, BoardSettings.Default)
                {
                    Map = map, Skip = true
                });

                yield return(new IOconfInput($"RPiTemp;{Name}_{node.Name}Cpu", LineNumber, Type, false, false, BoardSettings.Default)
                {
                    Map = map, Skip = true
                });
            }
        }