| 2987 | } |
| 2988 | |
| 2989 | void Application::initApplication() |
| 2990 | { |
| 2991 | // interpreter and Init script ========================================================== |
| 2992 | // register scripts |
| 2993 | new Base::ScriptProducer( "CMakeVariables", CMakeVariables ); |
| 2994 | new Base::ScriptProducer( "FreeCADInit", FreeCADInit ); |
| 2995 | new Base::ScriptProducer( "FreeCADTest", FreeCADTest ); |
| 2996 | |
| 2997 | // creating the application |
| 2998 | if (mConfig["Verbose"] != "Strict") |
| 2999 | Base::Console().log("Create Application\n"); |
| 3000 | Application::_pcSingleton = new Application(mConfig); |
| 3001 | |
| 3002 | // set up Unit system default |
| 3003 | const ParameterGrp::handle hGrp = GetApplication().GetParameterGroupByPath |
| 3004 | ("User parameter:BaseApp/Preferences/Units"); |
| 3005 | Base::UnitsApi::setSchema(hGrp->GetInt("UserSchema", Base::UnitsApi::getDefSchemaNum())); |
| 3006 | Base::UnitsApi::setDecimals(hGrp->GetInt("Decimals", Base::UnitsApi::getDecimals())); |
| 3007 | Base::UnitsApi::setDenominator(hGrp->GetInt("FracInch", Base::UnitsApi::getDenominator())); |
| 3008 | |
| 3009 | #if defined (_DEBUG) |
| 3010 | Base::Console().log("Application is built with debug information\n"); |
| 3011 | #endif |
| 3012 | |
| 3013 | // starting the init script |
| 3014 | Base::Console().log("Run App init script\n"); |
| 3015 | try { |
| 3016 | Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("CMakeVariables")); |
| 3017 | Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADInit")); |
| 3018 | } |
| 3019 | catch (const Base::Exception& e) { |
| 3020 | e.reportException(); |
| 3021 | } |
| 3022 | |
| 3023 | // seed randomizer |
| 3024 | srand(time(nullptr)); |
| 3025 | } |
| 3026 | |
| 3027 | std::list<std::string> Application::getCmdLineFiles() |
| 3028 | { |
nothing calls this directly
no test coverage detected