MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / initApplication

Method initApplication

src/App/Application.cpp:2989–3025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2987}
2988
2989void 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
3027std::list<std::string> Application::getCmdLineFiles()
3028{

Callers

nothing calls this directly

Calls 7

setDenominatorFunction · 0.85
GetIntMethod · 0.80
runStringMethod · 0.80
ProduceScriptMethod · 0.80
logMethod · 0.45
reportExceptionMethod · 0.45

Tested by

no test coverage detected