Example #1
0
        internal static Schematix.ProjectExplorer.FSM_File CreateEmptyFSM(string p, FSM_Language fSM_Language, SchematixCore core, ProjectExplorer.ProjectFolder projectFolder)
        {
            string           path  = System.IO.Path.Combine(projectFolder.Path, string.Concat(p, ".fsm"));
            string           name  = p;
            Constructor_Core cc    = new Constructor_Core(null);
            My_Graph         graph = cc.Graph;

            if (fSM_Language == FSM_Language.VHDL)
            {
                graph.VHDLModule = new VHDL_Module()
                {
                    ArchitectureName = name, EntityName = name
                }
            }
            ;
            if (fSM_Language == FSM_Language.Verilog)
            {
                graph.VerilogModule = new Verilog_Module()
                {
                    ModuleName = name
                }
            }
            ;
            graph.Language = fSM_Language;
            cc.SaveToFile(path);

            Schematix.ProjectExplorer.FSM_File fsm = new ProjectExplorer.FSM_File(path, projectFolder);
            projectFolder.AddElement(fsm);

            core.SaveSolution();
            core.UpdateExplorerPanel();
            return(fsm);
        }
Example #2
0
        public static ProjectExplorer.Schema_File CreateEmptyScheme(string p, SchematixCore core, ProjectExplorer.ProjectFolder projectFolder)
        {
            string path = System.IO.Path.Combine(projectFolder.Path, string.Concat(p, ".csx"));
            string name = p;

            ProjectExplorer.Schema_File     newFile = new ProjectExplorer.Schema_File(path, projectFolder);
            Schematix.Windows.Schema.Schema schema  = new Windows.Schema.Schema(newFile);
            schema.Save();
            projectFolder.AddElement(newFile);
            core.SaveSolution();
            core.UpdateExplorerPanel();
            return(newFile);
        }
Example #3
0
        internal static ProjectExplorer.EDR_File CreateEmptyEDRFile(string p, SchematixCore core, ProjectExplorer.ProjectFolder projectFolder)
        {
            string path = System.IO.Path.Combine(projectFolder.Path, string.Concat(p, ".edr"));

            EntityDrawning.EntityDrawningCore edr_core = new EntityDrawning.EntityDrawningCore(null);
            edr_core.Picture.SaveProject(path);

            ProjectExplorer.EDR_File newFile = new ProjectExplorer.EDR_File(path, projectFolder);
            projectFolder.AddElement(newFile);
            core.SaveSolution();
            core.UpdateExplorerPanel();

            return(newFile);
        }
Example #4
0
        internal static Schematix.ProjectExplorer.FSM_File CreateWizardFSM(string p, SchematixCore schematixCore, Verilog_Module verilog_Module, FSM_OptionsHelper fSM_OptionsHelper, SchematixCore core, ProjectExplorer.ProjectFolder projectFolder)
        {
            string           path = System.IO.Path.Combine(projectFolder.Path, string.Concat(p, ".fsm"));
            Constructor_Core cc   = new Constructor_Core(null);

            Schematix.Windows.FSM.FSM_Utils.InitVerilogData(fSM_OptionsHelper, verilog_Module, cc);
            cc.SaveToFile(path);

            Schematix.ProjectExplorer.FSM_File fsm = new ProjectExplorer.FSM_File(path, projectFolder);
            projectFolder.AddElement(fsm);

            core.SaveSolution();
            core.UpdateExplorerPanel();
            return(fsm);
        }
Example #5
0
        /// <summary>
        /// Создание файла с текстом
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="projectFolder"></param>
        public static VHDL_Code_File CreateFile(string filename, string text, ProjectExplorer.ProjectFolder projectFolder)
        {
            string         path = System.IO.Path.Combine(projectFolder.Path, string.Concat(filename, ".vhdl"));
            VHDL_Code_File res  = new VHDL_Code_File(path, projectFolder);

            projectFolder.AddElement(res);

            var writer = System.IO.File.CreateText(path);

            writer.Write(text);
            writer.Close();

            projectFolder.Save();

            return(res);
        }
Example #6
0
        /// <summary>
        /// Создание файла с текстом
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="projectFolder"></param>
        public static Text_File CreateFile(string filename, string text, ProjectExplorer.ProjectFolder projectFolder)
        {
            string    path = System.IO.Path.Combine(projectFolder.Path, filename);
            Text_File res  = new Text_File(path, projectFolder);

            projectFolder.AddElement(res);

            var writer = System.IO.File.CreateText(path);

            writer.Write(text);
            writer.Close();

            projectFolder.Save();

            return(res);
        }