public bool DoTest()
        {
            Project project = new Project();
            project.Axis1 = new Axis(new Utility.Converters.FunctionConverter("Sin(x)", 100, 1, 0));

            return true;
        }
        public OutputScene(MainForm mainForm)
        {
            _mainForm = mainForm;
            _panel = new TableLayoutPanel();
            _project = mainForm.Project;

            Initialize();
        }
        public ChooseMotorScene(MainForm mainForm)
        {
            _mainForm = mainForm;
            _project = mainForm.Project;
            _panel = new TableLayoutPanel();
            _cooling = "No Cooling";

            Initialize();
        }
        public ProjectList(MainForm mainForm)
        {
            _mainForm = mainForm;
            _project = new Project();

            _project.Environment = new SimulationEnv();
            _project.Environment.StaticFriction = 0;
            _project.Environment.DynamicFriction = 0;
            _project.Environment.AmbientTemp = 20;
            _project.Environment.MechEfficiency = 95;
            _project.Environment.ThrustForce = 0;
            _project.Environment.Cooling = "No Cooling";

            _mainForm.Project = _project;

            _project.ParameterInput = new ParameterInputScene(_mainForm);
            _project.FileConverter = new FileConverterScene(_mainForm);
            _project.FunctionConverter = new FunctionConverterScene(_mainForm);
            _project.NewProject = new NewProjectScene(_mainForm);
            _project.Profile = new ProfileScene(_mainForm);
            _project.Profile.Name = _project.ProfileName;
            _project.Sequence = new SequenceScene(_mainForm);
            _project.Sequence.Name = _project.SequenceName;
            _project.ChooseMotor = new ChooseMotorScene(_mainForm);
            _project.Warn = new OutputScene(_mainForm);

            _panels = new Dictionary<string, TableLayoutPanel>();
            _panels.Add(_project.Name, _project.NewProject.Component);
            _panels.Add(_project.Profile.Name, _project.Profile.Component);
            _panels.Add(_project.Sequence.Name, _project.Sequence.Component);

            // Subscribe to update event
            _project.Update += new Project.UpdateHandler(project_Update);

            _tree = new TreeView();

            Initialize();
            DoSetup();
        }
        public ProfileScene(MainForm mainForm)
        {
            _mainForm = mainForm;
            _panel = new TableLayoutPanel();
            _project = mainForm.Project;
            _solver = new Solver();

            Initialize();
        }
        private void InitializeComponents()
        {
            Project = new Project();
            //_projectList = new ProjectList(this, Project);

            MainMenu menu = new MainMenu(this);
            MainPanel panel = new MainPanel(this);

            this.SuspendLayout();

            // Setup Controls
            panel.SetLeft(_projectList.Component);
            panel.SetRight(Project.ChooseMotor.Component);
            panel.SetRightBottom(Project.Warn.Component);

            // Add controls
            this.Controls.Add(panel.Component);
            this.Controls.Add(menu.Component);

            this.MainMenuStrip = menu.Component;
            this.Padding = new Padding(1);
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = initialSize;
            this.Name = "MainForm";
            this.Text = "Aerotech Motor Sizer";

            this.ResumeLayout(false);
            this.PerformLayout();

            _panel = panel;
        }
 public static bool SaveProject(Project o, string filename)
 {
     try
     {
         XmlSerializer writer = new XmlSerializer(typeof(Project));
         StreamWriter file = new StreamWriter(filename);
         writer.Serialize(file, o);
         file.Close();
     }
     catch (System.Exception e)
     {
         Exception saveException = e;
         return false;
     }
     return true;
 }
        public static Project LoadProject(string filename)
        {
            Project o = new Project();

            try
            {
                XmlSerializer reader = new XmlSerializer(typeof(Project));
                StreamReader file = new StreamReader(filename);
                o = (Project)reader.Deserialize(file);
            }
            catch (System.Exception e)
            {
                return null;
            }

            return o;
        }