Exemple #1
0
        public static void loadXMLConfig()
        {
            bool r2 = System.IO.Directory.Exists(sd_folder);

            if (r2 == false)
            {
                System.IO.Directory.CreateDirectory(sd_folder);
            }
            bool r = System.IO.File.Exists(sd_config_path);

            if (r == false)
            {
                saveXMLConfig(); return;
            }

            try
            {
                Statics.main_config = (Config)Statics.XMLLoadData(sd_config_path, typeof(Config));
            }
            catch (Exception e)
            {
                saveXMLConfig();
            }
        }
Exemple #2
0
        public frmMain()
        {
            InitializeComponent();

            Statics.main_config = new Config();
            Statics.loadXMLConfig();

            Statics.main_network          = new Network <CarRobot, CarCommand>(Statics.local_robot_port, Statics.robot_port, Statics.main_config.robot_ip);
            Statics.main_network.updated += Main_network_updated;

            Statics.matlab_network          = new Network <CarCommand, CarRobot>(Statics.local_matlab_port, Statics.matlab_port, Statics.main_config.matlab_ip);
            Statics.matlab_network.updated += Matlab_network_updated;

            Statics.main_log = new Log();
            Statics.ref_main = this;

            this.Text = "Main RoboCar Interface V " + Statics.version;

            txt_robot_ip.Text  = Statics.main_config.robot_ip;
            txt_matlab_ip.Text = Statics.main_config.matlab_ip;

            ga = Graphics.FromImage(a);
            gb = Graphics.FromImage(b);
        }
Exemple #3
0
 public static void saveXMLConfig()
 {
     Statics.XMLSaveData(sd_config_path, typeof(Config), Statics.main_config);
 }