示例#1
0
文件: BT200C60.cs 项目: gitllama/Tips
        /*Gain*/



        public bool ResetGain()
        {
            BTYaml yaml = App.Container.Resolve <BTYaml>("Config");

            GainList = new List <string>();
            foreach (var i in yaml["gain"].Keys)
            {
                /*かぶるとき修正*/
                rw.Add(i, ToData(yaml["gain"][i]));
                GainList.Add(i);
            }
            rw.WriteAction = (addr, data) => USBIF.WriteCISReg(addr, data);
            return(true);

            Dictionary <byte, string> ToData(BTYaml v)
            {
                var hoge = new Dictionary <byte, string>();

                foreach (var i in v.Keys)
                {
                    var addr = Convert.ToByte(i, 16);
                    var data = v[i].Parse <string>();
                    hoge.Add(addr, data);
                }
                return(hoge);
            }
        }
示例#2
0
文件: BT200C60.cs 项目: gitllama/Tips
        public bool ResetIris()
        {
            BTYaml yaml = App.Container.Resolve <BTYaml>("Config");

            var hoge = new Dictionary <byte, int[]>();

            foreach (var i in yaml["iris"].Keys)
            {
                var addr = Convert.ToByte(i, 16);
                var data = yaml["iris"][i].Values;
                hoge.Add(addr, data.ConvertAll(x => int.Parse(x)).ToArray());
            }
            rw.Add("iris", hoge);

            return(true);
        }