Exemple #1
0
        public void DoAppStartup()
        {
            //m_apppath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            //get the path separater
            if (RunningPlatform() == Platform.Windows)
            {
                m_pathsep = "\\";
            }
            else
            {
                m_pathsep = "/";
            }
            // define some default paths
//            m_PathMachines = m_apppath + "\\Machines";
//          m_PathProfiles = m_apppath + "\\Profiles";
            m_PathMachines = "." + m_pathsep + "Machines";
            m_PathProfiles = "." + m_pathsep + "Profiles";

            // set up directories if they don't exist
            if (!Directory.Exists(m_PathMachines))
            {
                Utility.CreateDirectory(m_PathMachines);
            }
            if (!Directory.Exists(m_PathProfiles))
            {
                Utility.CreateDirectory(m_PathProfiles);
            }
            // load the current application configuration

            /*
             * if (!m_appconfig.Load(m_apppath + m_pathsep + m_appconfigname))
             * {
             *  m_appconfig.CreateDefault();
             *  m_appconfig.Save(m_apppath + m_pathsep + m_appconfigname);
             * }
             */
            if (!m_appconfig.Load("." + m_pathsep + m_appconfigname))
            {
                m_appconfig.CreateDefault();
                m_appconfig.Save("." + m_pathsep + m_appconfigname);
            }

            //load the current machine configuration file
            if (!m_printerinfo.Load(m_appconfig.m_curmachineeprofilename))
            {
                m_printerinfo.Save(m_appconfig.m_curmachineeprofilename);
            }
            //load the current slicing profile
            if (!m_buildparms.Load(m_appconfig.m_cursliceprofilename))
            {
                m_buildparms.CreateDefault();
                m_buildparms.Save(m_appconfig.m_cursliceprofilename);
            }

            SetupDriver();
        }
Exemple #2
0
        public void DoAppStartup()
        {
            m_dispmgr = DisplayManager.Instance();// initialze the displays
            m_apppath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            //get the path separater
            if (RunningPlatform() == Platform.Windows)
            {
                m_pathsep = "\\";
            }
            else
            {
                m_pathsep = "/";
            }
            // define some default paths
            m_PathMachines = m_apppath + m_pathsep + "Machines";  // use full paths - SHS
            m_PathProfiles = m_apppath + m_pathsep + "Profiles";

            // set up directories if they don't exist
            if (!Directory.Exists(m_PathMachines))
            {
                Utility.CreateDirectory(m_PathMachines);
            }
            if (!Directory.Exists(m_PathProfiles))
            {
                Utility.CreateDirectory(m_PathProfiles);
            }

            if (!m_appconfig.Load(m_apppath + m_pathsep + m_appconfigname))  // use full path - SHS
            {
                m_appconfig.CreateDefault();
                m_appconfig.Save(m_apppath + m_pathsep + m_appconfigname);  // use full path - SHS
            }
            // this will check and make sure the default machines have been created
            CheckAndCreateDefaultMachines();
            //load the current machine configuration file
            if (!m_printerinfo.Load(m_appconfig.m_curmachineeprofilename))
            {
                // m_printerinfo.Save(m_appconfig.m_curmachineeprofilename);
                DebugLogger.Instance().LogError("Cannot Load Machine Profile " + m_appconfig.m_curmachineeprofilename);
            }
            // machine configuration was just loaded here.
            RaiseAppEvent(eAppEvent.eMachineTypeChanged, ""); // notify the gui to set up correctly
            //load the projector command list

            if (!LoadProjectorCommands(m_appconfig.ProjectorCommandsFile))
            {
                SaveProjectorCommands(m_appconfig.ProjectorCommandsFile);
            }
            //load the current slicing profile
            if (!m_buildparms.Load(m_appconfig.m_cursliceprofilename))
            {
                m_buildparms.CreateDefault();
                m_buildparms.Save(m_appconfig.m_cursliceprofilename);
            }
            // set up the drivers
            SetupDriver();
            //SetupDriverProjector();
            // load the support configuration
            if (!LoadSupportConfig(m_appconfig.SupportConfigName))
            {
                SaveSupportConfig(m_appconfig.SupportConfigName);
            }
            //load the license keys
            LoadLicenseKeys();
            //look for plug-ins and validate licensing
            ScanForPlugins();
            // validate those loaded plugins against license keys
            CheckLicensing();
            // initialize the plugins, the main form will send a secondary init after the main app gui is created
            PerformPluginCommand("InitCommand", true);
            m_sc = new ServerContact();
            m_sc.ServerContactEvenet += new ServerContact.Servercontacted(m_sc_ServerContactEvent);
            m_sc.UpdateRegInfo();
            m_undoer.RegisterCallback();
        }
        public void DoAppStartup()
        {
            m_dispmgr = DisplayManager.Instance();// initialze the displays
            m_apppath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            //get the path separater
            if (RunningPlatform() == Platform.Windows)
            {
                m_pathsep = "\\";
            }
            else
            {
                m_pathsep = "/";
            }
            // define some default paths
            m_PathMachines = m_apppath + m_pathsep + "Machines";  // use full paths - SHS
            m_PathProfiles = m_apppath + m_pathsep + "Profiles";

            // set up directories if they don't exist
            if (!Directory.Exists(m_PathMachines))
            {
                Utility.CreateDirectory(m_PathMachines);
            }
            if (!Directory.Exists(m_PathProfiles))
            {
                Utility.CreateDirectory(m_PathProfiles);
            }

            if (!m_appconfig.Load(m_apppath + m_pathsep + m_appconfigname))  // use full path - SHS
            {
                m_appconfig.CreateDefault();
                m_appconfig.Save(m_apppath + m_pathsep + m_appconfigname);  // use full path - SHS
            }
            // this will check and make sure the default machines have been created
            CheckAndCreateDefaultMachines();
            //load the current machine configuration file
            if (!m_printerinfo.Load(m_appconfig.m_curmachineeprofilename))
            {
                // m_printerinfo.Save(m_appconfig.m_curmachineeprofilename);
                DebugLogger.Instance().LogError("Cannot Load Machine Profile " + m_appconfig.m_curmachineeprofilename);
            }
            // machine configuration was just loaded here.
            RaiseAppEvent(eAppEvent.eMachineTypeChanged, ""); // notify the gui to set up correctly
            //load the projector command list

            if (!LoadProjectorCommands(m_appconfig.ProjectorCommandsFile))
            {
                SaveProjectorCommands(m_appconfig.ProjectorCommandsFile);
            }
            //load the current slicing profile
            if (!m_buildparms.Load(m_appconfig.m_cursliceprofilename))
            {
                m_buildparms.CreateDefault();
                m_buildparms.Save(m_appconfig.m_cursliceprofilename);
            }
            else
            {
                m_buildparms.CreateDefault();
                m_buildparms.Load(m_appconfig.m_cursliceprofilename);
            }
            // set up the drivers
            SetupDriver();
            //SetupDriverProjector();
            // load the support configuration
            if (!LoadSupportConfig(m_appconfig.SupportConfigName))
            {
                SaveSupportConfig(m_appconfig.SupportConfigName);
            }
            //load the license keys
            LoadLicenseKeys();
            //look for plug-ins and validate licensing
            ScanForPlugins();
            //look for 'lite' plugins
            ScanForPluginsLite();
            // validate those loaded plugins against license keys
            CheckLicensing();
            // initialize the plugins, the main form will send a secondary init after the main app gui is created
            PerformPluginCommand("InitCommand", true);
            m_sc = new ServerContact();
            m_sc.ServerContactEvenet += new ServerContact.Servercontacted(m_sc_ServerContactEvent);

            //contacting Server twise?? commenting this out for now
            //m_sc.UpdateRegInfo();
            m_undoer.RegisterCallback();
            // pack all 2d gl images
            //m_2d_graphics.GenereteUserTexture();


            //load Rsource files

            //this is not good way to load resource files. but the problem is visual studio cant generate auto-generation code for names with dot "."

            resman = new ResourceManager("UV_DLP_3D_Printer.Resource.en", typeof(UVDLPApp).Assembly);
            cul    = CultureInfo.CreateSpecificCulture("");

            if (UVDLPApp.Instance().m_appconfig.m_Selected_Language == "es")
            {
                resman = new ResourceManager("UV_DLP_3D_Printer.Resource.es", typeof(UVDLPApp).Assembly);
                cul    = CultureInfo.CreateSpecificCulture("");
            }
            else if (UVDLPApp.Instance().m_appconfig.m_Selected_Language == "en")
            {
                resman = new ResourceManager("UV_DLP_3D_Printer.Resource.en", typeof(UVDLPApp).Assembly);
                cul    = CultureInfo.CreateSpecificCulture("");
            }
            else
            {
                resman = new ResourceManager("UV_DLP_3D_Printer.Resource.en", typeof(UVDLPApp).Assembly);
                cul    = CultureInfo.CreateSpecificCulture("");
            }
        }
        public void DoAppStartup()
        {
            m_apppath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            //get the path separater
            if (RunningPlatform() == Platform.Windows)
            {
                m_pathsep = "\\";
            }
            else
            {
                m_pathsep = "/";
            }
            // define some default paths
            m_PathMachines = m_apppath + m_pathsep + "Machines";  // use full paths - SHS
            m_PathProfiles = m_apppath + m_pathsep + "Profiles";

            // set up directories if they don't exist
            if (!Directory.Exists(m_PathMachines))
            {
                Utility.CreateDirectory(m_PathMachines);
            }
            if (!Directory.Exists(m_PathProfiles))
            {
                Utility.CreateDirectory(m_PathProfiles);
            }

            if (!m_appconfig.Load(m_apppath + m_pathsep + m_appconfigname))  // use full path - SHS
            {
                m_appconfig.CreateDefault();
                m_appconfig.Save(m_apppath + m_pathsep + m_appconfigname);  // use full path - SHS
            }
            // this will check and make sure the default machines have been created
            CheckAndCreateDefaultMachines();
            //load the current machine configuration file
            if (!m_printerinfo.Load(m_appconfig.m_curmachineeprofilename))
            {
                // m_printerinfo.Save(m_appconfig.m_curmachineeprofilename);
                DebugLogger.Instance().LogError("Cannot Load Machine Profile " + m_appconfig.m_curmachineeprofilename);
            }
            // machine configuration was just loaded here.
            RaiseAppEvent(eAppEvent.eMachineTypeChanged, ""); // notify the gui to set up correctly
            //load the projector command list

            if (!LoadProjectorCommands(m_appconfig.ProjectorCommandsFile))
            {
                SaveProjectorCommands(m_appconfig.ProjectorCommandsFile);
            }
            //load the current slicing profile
            if (!m_buildparms.Load(m_appconfig.m_cursliceprofilename))
            {
                m_buildparms.CreateDefault();
                m_buildparms.Save(m_appconfig.m_cursliceprofilename);
            }
            // set up the drivers
            SetupDriver();
            SetupDriverProjector();
            // load the support configuration
            if (!LoadSupportConfig(m_appconfig.SupportConfigName))
            {
                SaveSupportConfig(m_appconfig.SupportConfigName);
            }
            ScanForPlugins(); // look for plug-ins
        }