コード例 #1
0
        public Platform(string path)
        {
            boards_txt_path   = Path.Combine(path, "boards.txt");
            platform_txt_path = Path.Combine(path, "platform.txt");

            if (File.Exists(boards_txt_path) && File.Exists(platform_txt_path))
            {
                isValid = true;
                name    = Path.GetFileName(path);
            }
            else
            {
                foreach (var folder in Directory.GetDirectories(path))
                {
                    boards_txt_path   = Path.Combine(folder, "boards.txt");
                    platform_txt_path = Path.Combine(folder, "platform.txt");

                    var b = File.Exists(boards_txt_path);

                    if (File.Exists(boards_txt_path) && File.Exists(platform_txt_path))
                    {
                        isValid = true;
                        name    = Path.GetFileName(path);
                        break;
                    }
                }
            }

            if (isValid)
            {
                boards = BoardsTxt.parse(boards_txt_path).ToList();
            }
        }
コード例 #2
0
ファイル: Configuration.cs プロジェクト: WMXZ-EU/VisualTeensy
        public void parseBoardsTxt(string bt)
        {
            //log.Info("enter");

            projectTransferData.vtBoard tmp = new projectTransferData.vtBoard(selectedBoard);
            boards = BoardsTxt.parse(bt ?? boardTxtPath)./*Where(b => b.core == "teensy3").*/ ToList();
            setBoardOptions(tmp);
        }
コード例 #3
0
        public void parseBoardsTxt(string bt)
        {
            string btp = bt;

            boards.Clear();

            if (bt == null)
            {
                if (setupType == SetupTypes.expert)
                {
                    if (!coreBase.isOk)
                    {
                        return;
                    }
                    btp = Path.Combine(coreBase.path, "boards.txt");
                }
                else
                {
                    if (setup?.arduinoBaseError != null)
                    {
                        return;
                    }
                    btp = setup?.arduinoBoardsTxt;
                }
            }



            //  var vboards = BoardsTxt.parse(bt ?? boardTxtPath);
            //var vboards = BoardsTxt.parse(btp);

            ProjectTransferData.vtBoard tmp = new ProjectTransferData.vtBoard(selectedBoard);
            //  boards = BoardsTxt.parse(bt ?? boardTxtPath).Where(b => b.core == "teensy3" || b.core == "teensy4").ToList();
            boards = BoardsTxt.parse(btp).Where(b => b.core == "teensy3" || b.core == "teensy4").ToList();
            setBoardOptions(tmp);
        }