Пример #1
0
/*! Returns the parameter of this Event with the given \a paramTypeId. */
Param Event::param(const ParamTypeId &paramTypeId) const
{
    foreach (const Param &param, m_params) {
        if (param.paramTypeId() == paramTypeId) {
            return param;
        }
    }
    return Param(QString());
}
void Interpreter::interpret(const Provider *provider) {
    this->m_computing.clear();
    this->m_rendering.clear();
    this->m_format = Format();
    if (!provider) return;

    QDomDocument document;
    document.setContent(QString::fromStdString(provider->schema()));
    QDomElement computing = document.documentElement().elementsByTagName(QString("computing")).at(0).toElement();
    for (int i = 0; i < computing.childNodes().count(); ++i) {
        this->m_computing.append(Param(computing.childNodes().at(i)));
    }
    QDomElement rendering = document.documentElement().elementsByTagName(QString("rendering")).at(0).toElement();
    for (int i = 0; i < rendering.childNodes().count(); ++i) {
        this->m_rendering.append(Param(rendering.childNodes().at(i)));
    }
    this->m_format = Format(QString::fromStdString(provider->title()), QString::fromStdString(provider->name()));
}
Пример #3
0
void QSqlExtension::bindValue( const QString& placeholder, const QVariant& val, QSql::ParameterType tp )
{
    bindm = BindByName;
    // if the index has already been set when doing emulated named
    // bindings - don't reset it
    if ( index.contains( (int)values.count() ) ) {
        index[ (int)values.count() ] = placeholder;
    }
    values[ placeholder ] = Param( val, tp );
}
Пример #4
0
list<Param> BaseWithParamList::paramList() const
{
    if(isNull()) return list<Param>();
    list<Param> result;
    list<DomElement> elementList = m_DomElement.elementsByTagName(Param::NAME);
    for(list<DomElement>::iterator i = elementList.begin(); i != elementList.end(); i++)
    {
        result.push_back(Param(*i, xmlData()));
    }
    return result;
}
Пример #5
0
Ptr SelectDiff::update()
{
    if (Input::KeyUp.clicked) {
        nowSelectDiff = (nowSelectDiff + 4) % 5;
    }
    if (Input::KeyDown.clicked) {
        nowSelectDiff = (nowSelectDiff + 1) % 5;
    }
    if (Input::KeyEnter.clicked) {
        return std::make_shared<SelectTeam>(Param(nowSelectDiff));
    }
    return getPtr();
}
Пример #6
0
bool Parser::OptParamList()
{
	if (")" == lex) {
		std::cout << "OptParamList => null\n";
		return true;
	}
	
	if (!Param()) return false;
	if (!OptParams()) return false;
	
	std::cout << "OptParamList => Param OptParams\n";
	return true;
}
void OsclSendToRequest::SendTo(const uint8* &aPtr, uint32 aLen, OsclNetworkAddress &aAddress)
{
    OsclAny *p = NewRequest(sizeof(SendToParam));
    if (!p)
        PendComplete(OsclErrNoMemory);
    else
    {
        iParam = OSCL_PLACEMENT_NEW(p, SendToParam(aPtr, aLen, aAddress, 0));
        if (!iParam)
            PendComplete(OsclErrNoMemory);
        else
            SocketI()->SendTo(*Param(), *this);
    }
}
Пример #8
0
void CNrpPlant::Load( const NrpText& saveFolder )
{
	NrpText fileName = OpFileSystem::CheckEndSlash( saveFolder ) + "plant.ini";
	assert( OpFileSystem::IsExist( fileName ) );

	INrpConfig::Load( fileName );
	IniFile rv( fileName );

	int maxNumber = (int)Param( WORKNUMBER ) + (int)Param( REKLAMENUMBER );
	for( int k=0; k < maxNumber; k++ )
	{
		NrpText type = rv.Get( SECTION_WORKS, CreateKeyType( k ), NrpText("") );
		NrpText saveFile = rv.Get( SECTION_WORKS, CreateKeyWork( k ), NrpText("") );
		
		if( OpFileSystem::IsExist( saveFile ) )
		{
			if( type == CNrpPlantWork::ClassName() )
				AddWork( new CNrpPlantWork( saveFile, true ) );
			else if( type == CNrpReklameWork::ClassName() )
				AddReklame( CNrpReklameWork( saveFile ) );
		}
	}
}
void OsclAcceptRequest::Accept(OsclSocketI &aSocket)
{
    OsclAny *p = NewRequest(sizeof(AcceptParam));
    if (!p)
        PendComplete(OsclErrNoMemory);
    else
    {
        iParam = OSCL_PLACEMENT_NEW(p, AcceptParam(aSocket));
        if (!iParam)
            PendComplete(OsclErrNoMemory);
        else
            SocketI()->Accept(*Param(), *this);
    }
}
Пример #10
0
/********************************************************************************************

>	virtual BOOL PNGFilter::GetExportOptions(BitmapExportOptions* pOptions)

	Author:		Colin_Barfoot (Xara Group Ltd) <*****@*****.**>
	Created:	12/11/96
	Purpose:	See BaseBitmapFilter for interface details

********************************************************************************************/
BOOL PNGFilter::GetExportOptions(BitmapExportOptions* pOptions)
{
	ERROR2IF(pOptions == NULL, FALSE, "NULL Args");

	PNGExportOptions* pPNGOptions = (PNGExportOptions*)pOptions;
	ERROR3IF(!pPNGOptions->IS_KIND_OF(PNGExportOptions), "pPNGOptions isn't");

	// the depth we ask GDraw to render is always 32-bit, so we can get transparency
	// we have to convert for other formats	when writing the actual bytes to the file
	SetDepthToRender(32);

	// We haven't written the header yet
	WrittenHeader = FALSE;

	// We are a first pass render and not doing the mask, by default
	SecondPass = FALSE;
	DoingMask = FALSE;

	// Determine the filter type currently in use in Accusoft format
	s_FilterType = PNG;
	pPNGOptions->SetFilterType(PNG);

	BOOL Ok = FALSE;

	OpDescriptor* pOpDes = OpDescriptor::FindOpDescriptor(OPTOKEN_GIFTABDLG);
	if (pOpDes != NULL)
	{
		// set up the data for the export options dialog
		OpParam Param((void *)pOptions, (void *)this);

		// invoke the dialog
		pOpDes->Invoke(&Param);

		// SMFIX
		// we have brought the dlg up so get the options from the dlg as the graphic type may have changed
		pOptions = BmapPrevDlg::m_pExportOptions;

		// check for valid options
		//  This may get messed up, so have to use the second line below.
		Ok = BmapPrevDlg::m_bClickedOnExport;
	}
	else
	{	
		ERROR3("Unable to find OPTOKEN_BMAPPREVDLG");
	} 

	// Return with the ok/cancel state used on the dialog box
	return Ok;
}
Пример #11
0
DeviceManager::DeviceError DevicePluginDateTime::discoverDevices(const DeviceClassId &deviceClassId, const ParamList &params)
{
    Q_UNUSED(deviceClassId);

    QList<DeviceDescriptor> deviceDescriptors;
    foreach (QByteArray timeZone, QTimeZone::availableTimeZoneIds()) {
        QByteArray continent = params.paramValue("continent").toByteArray();
        if(timeZone.contains(continent)){
            DeviceDescriptor descriptor(dateTimeDeviceClassId, timeZone.right(timeZone.length() - (continent.length() + 1)), continent);
            ParamList params;
            params.append(Param("timezone", timeZone));
            descriptor.setParams(params);
            deviceDescriptors.append(descriptor);
        }
    }
void OsclConnectRequest::Connect(OsclNetworkAddress &aAddress)
{
    OsclAny *p = NewRequest(sizeof(ConnectParam));
    if (!p)
        PendComplete(OsclErrNoMemory);
    else
    {
        iParam = OSCL_PLACEMENT_NEW(p, ConnectParam(aAddress));
        if (!iParam)
            PendComplete(OsclErrNoMemory);
        else
        {
            SocketI()->Connect(*Param(), *this);
        }
    }
}
Пример #13
0
void CCamFrame::OnUpdateStandardBar( wxUpdateUIEvent& event)
{
	// We can't find by Runtime Class as there are multiple OpDescriptors with the same Class
	// So get the resource ID (which also happens to be the dialog ID to use
	ResourceID r = (ResourceID)(event.GetId());
	// Find the Op Descriptor by name
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor((TCHAR *)(CamResource::GetObjectName(r))); 
	// Stick the resource ID in he Op Param
//	OpParam Param(CUniversalParam((INT32)r), CUniversalParam(0));
	OpParam Param((INT32)r, (INT32)0);
	String_256 disable;
	OpState opst;
	if ( pOpDesc) opst = pOpDesc->GetOpsState(&disable,&Param);
	event.Enable(pOpDesc && !opst.Greyed);
	event.Check(FALSE != opst.Ticked);
}
Пример #14
0
MeshObjectRef makeParallelMengerSponge(int level, float x0, float y0, float z0)
{
    float boxnums = std::pow(3.0f,level);
    float thirds = boxnums / 3;
    float twothirds = thirds * 2;

    QList<float> rangerx, rangery, rangerz;
    rangerx << x0 << (x0 + thirds) << (x0 + twothirds);
    rangery << y0 << (y0 + thirds) << (y0 + twothirds);
    rangerz << z0 << (z0 + thirds) << (z0 + twothirds);

    int block = 1;
    QList<int> skip; skip << 5 << 11 << 13 << 14 << 15 << 17 << 23;

    // collect the arguments for the algorithm in a list
    QList<Param> args;

    for (QList<float>::iterator i = rangerx.begin(); i != rangerx.end(); ++i) {
        for (QList<float>::iterator j = rangery.begin(); j != rangery.end(); ++j) {
            for (QList<float>::iterator k = rangerz.begin(); k != rangerz.end(); ++k) {
                if (!skip.contains(block)) {
                    args << Param(level-1, *i, *j, *k);
                }
                block++;
            }
        }
    }

    QFuture<MeshObjectRef> future = QtConcurrent::mapped(args, runSierpinski);

    QFutureWatcher<MeshObjectRef> watcher;
    watcher.setFuture(future);

    // keep it responsive during computation
    QEventLoop loop;
    QObject::connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
    loop.exec();

    MeshObjectRef mesh = new Mesh::MeshObject();
    for (QFuture<MeshObjectRef>::const_iterator it = future.begin(); it != future.end(); ++it) {
        mesh->addMesh(**it);
        (*it)->clear();
    }

    return mesh;
}
FActorPositionTraceResult FActorPositioning::TraceWorldForPosition(const UWorld& InWorld, const FSceneView& InSceneView, const FVector& RayStart, const FVector& RayEnd, const TArray<AActor*>* IgnoreActors)
{
	TArray<FHitResult> Hits;

	FCollisionQueryParams Param(TEXT("DragDropTrace"), true);
	Param.bTraceAsyncScene = true;
	
	if (IgnoreActors)
	{
		Param.AddIgnoredActors(*IgnoreActors);
	}

	FActorPositionTraceResult Results;
	if ( InWorld.LineTraceMultiByObjectType(Hits, RayStart, RayEnd, FCollisionObjectQueryParams(FCollisionObjectQueryParams::InitType::AllObjects), Param) )
	{
		{
			// Filter out anything that should be ignored
			FSuspendRenderingThread SuspendRendering(false);
			Hits.RemoveAll([&](const FHitResult& Hit){
				return IsHitIgnored(Hit, InSceneView);
			});
		}

		// Go through all hits and find closest
		float ClosestHitDistanceSqr = TNumericLimits<float>::Max();

		for (const auto& Hit : Hits)
		{
			const float DistanceToHitSqr = (Hit.ImpactPoint - RayStart).SizeSquared();
			if (DistanceToHitSqr < ClosestHitDistanceSqr)
			{
				ClosestHitDistanceSqr = DistanceToHitSqr;
				Results.Location = Hit.Location;
				Results.SurfaceNormal = Hit.Normal.GetSafeNormal();
				Results.State = FActorPositionTraceResult::HitSuccess;
				Results.HitActor = Hit.Actor;
			}
		}
	}

	return Results;
}
Пример #16
0
bool Parser::OptParams()
{
	if (")" == lex) {
		std::cout << "OptParams => null\n";
		return true;
	}
	
	if (!("," == lex)) {
		std::cout << "Parameter list not delimited by ','\n";
		return false;
	} else {
		L.getTokLex(tok,lex);
	}
	
	if (!Param()) return false;
	if (!OptParams()) return false;
	
	std::cout << "OptParamList => Param OptParams\n";
	return true;
}
Пример #17
0
  void InternalCalibration::makeLinearRegression_(std::vector<DoubleReal> & observed_masses, std::vector<DoubleReal> & theoretical_masses)
  {
    if (observed_masses.size() != theoretical_masses.size())
    {
      throw Exception::IllegalArgument(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Number of observed and theoretical masses must agree.");
    }
#ifdef DEBUG_CALIBRATION
    std::ofstream out("calibration_regression.txt");
    std::vector<DoubleReal> rel_errors(observed_masses.size(), 0.);
    // determine rel error in ppm for the two reference masses
    for (Size ref_peak = 0; ref_peak < observed_masses.size(); ++ref_peak)
    {
      rel_errors[ref_peak] = (theoretical_masses[ref_peak] - observed_masses[ref_peak]) / theoretical_masses[ref_peak] * 1e6;

      out << observed_masses[ref_peak] << "\t" << rel_errors[ref_peak] << "\n";
      std::cout << observed_masses[ref_peak] << " " << theoretical_masses[ref_peak] << std::endl;
      // std::cout << observed_masses[ref_peak]<<"\t"<<rel_errors[ref_peak]<<std::endl;
    }
#endif

    TransformationDescription::DataPoints data;
    for (Size i = 0; i < observed_masses.size(); ++i)
    {
      data.push_back(std::make_pair(observed_masses[i],
                                    theoretical_masses[i]));
    }

    trafo_ = TransformationDescription(data);
    trafo_.fitModel("linear", Param());

#ifdef DEBUG_CALIBRATION
    //          std::cout <<"\n\n---------------------------------\n\n"<< "after calibration "<<std::endl;
    for (Size i = 0; i < observed_masses.size(); ++i)
    {
      DoubleReal new_mass = trafo_.apply(observed_masses[i]);

      DoubleReal rel_error = (theoretical_masses[i] - (new_mass)) / theoretical_masses[i] * 1e6;
      std::cout << observed_masses[i] << "\t" << rel_error << std::endl;
    }
#endif
  }
int do_keyboard_config( int x_cfg,int y_cfg, int largeur_cfg, int hauteur_cfg)
{
petitchiffre.Print("KEYBOARD MAPPING" ,x_cfg, y_cfg);
Rect OverKey(Vec2D(x_cfg,y_cfg),Vec2D(60,20));
OverKey.SetRoundness(1.8);
Rect Function(Vec2D(x_cfg,y_cfg),Vec2D(120,20));
Function.SetRoundness(1.8);
Rect Param(Vec2D(x_cfg,y_cfg),Vec2D(30,20));
Param.SetRoundness(1.8);
for(int i=0;i<10;i++)
{
OverKey.MoveTo(Vec2D(x_cfg,y_cfg+15+(i*25)));
OverKey.Draw(CouleurGreen.WithAlpha(0.5));
Function.MoveTo(Vec2D(x_cfg+75,y_cfg+15+(i*25)));
Function.Draw(CouleurBlind.WithAlpha(0.5));
Param.MoveTo(Vec2D(x_cfg+205,y_cfg+15+(i*25)));
Param.Draw(CouleurBlind.WithAlpha(0.5));
petitchiffre.Print(kbd_custom[index_liste_kbd_custom+i],x_cfg+10,y_cfg+20+(i*25));
}
return(0);
}
Пример #19
0
RobotInterface::Device RobotInterface::XMLReader::Private::readDeviceTag(TiXmlElement *deviceElem)
{
    const std::string &valueStr = deviceElem->ValueStr();

    if (valueStr.compare("device") != 0) {
        SYNTAX_ERROR(deviceElem->Row()) << "Expected \"device\". Found" << valueStr;
    }

    Device device;

    if (deviceElem->QueryStringAttribute("name", &device.name()) != TIXML_SUCCESS) {
        SYNTAX_ERROR(deviceElem->Row()) << "\"device\" element should contain the \"name\" attribute";
    }

    // yDebug() << "Found device [" << device.name() << "]";

    if (deviceElem->QueryStringAttribute("type", &device.type()) != TIXML_SUCCESS) {
        SYNTAX_ERROR(deviceElem->Row()) << "\"device\" element should contain the \"type\" attribute";
    }

    device.params().push_back(Param("robotName", robot.portprefix().c_str()));

    for (TiXmlElement* childElem = deviceElem->FirstChildElement(); childElem != 0; childElem = childElem->NextSiblingElement()) {
        if (childElem->ValueStr().compare("action") == 0 ||
            childElem->ValueStr().compare("actions") == 0) {
            ActionList childActions = readActions(childElem);
            for (ActionList::const_iterator it = childActions.begin(); it != childActions.end(); ++it) {
                device.actions().push_back(*it);
            }
        } else {
            ParamList childParams = readParams(childElem);
            for (ParamList::const_iterator it = childParams.begin(); it != childParams.end(); ++it) {
                device.params().push_back(*it);
            }
        }
    }

    // yDebug() << device;
    return device;
}
Пример #20
0
void ParamManager::handle_param_value_msg(const mavlink_message_t &msg)
{
  mavlink_param_value_t param;
  mavlink_msg_param_value_decode(&msg, &param);

  if (!first_param_received_)
  {
    first_param_received_ = true;
    received_ = new bool[param.param_count];
  }

  // ensure null termination of name
  char c_name[MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN + 1];
  memcpy(c_name, param.param_id, MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN);
  c_name[MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN] = '\0';

  std::string name(c_name);

  if (!is_param_id(name)) // if we haven't received this param before, add it
  {
    params_[name] = Param(param);
    received_[param.param_index] = true; //! \todo Implement check that all parameters have been received

    for (int i = 0; i < listeners_.size(); i++)
      listeners_[i]->on_new_param_received(name, params_[name].getValue());
  }
  else // otherwise check if we have new unsaved changes as a result of a param set request
  {
    if (params_[name].handleUpdate(param))
    {
      unsaved_changes_ = true;
      for (int i = 0; i < listeners_.size(); i++)
      {
        listeners_[i]->on_param_value_updated(name, params_[name].getValue());
        listeners_[i]->on_params_saved_change(unsaved_changes_);
      }
    }
  }
}
Пример #21
0
RobotInterface::ParamList RobotInterface::XMLReader::Private::readSubDeviceTag(TiXmlElement *subDeviceElem)
{
    if (subDeviceElem->ValueStr().compare("subdevice") != 0) {
        SYNTAX_ERROR(subDeviceElem->Row()) << "Expected \"subdevice\". Found" << subDeviceElem->ValueStr();
    }

    ParamList params;

//FIXME    Param featIdParam;
    Param subDeviceParam;

//FIXME    featIdParam.name() = "FeatId";
    subDeviceParam.name() = "subdevice";

//FIXME    if (subDeviceElem->QueryStringAttribute("name", &featIdParam.value()) != TIXML_SUCCESS) {
//        SYNTAX_ERROR(subDeviceElem->Row()) << "\"subdevice\" element should contain the \"name\" attribute";
//    }

    if (subDeviceElem->QueryStringAttribute("type", &subDeviceParam.value()) != TIXML_SUCCESS) {
        SYNTAX_ERROR(subDeviceElem->Row()) << "\"subdevice\" element should contain the \"type\" attribute";
    }

//FIXME    params.push_back(featIdParam);
    params.push_back(subDeviceParam);

    // yDebug() << "Found subdevice [" << params.at(0).value() << "]";

    for (TiXmlElement* childElem = subDeviceElem->FirstChildElement(); childElem != 0; childElem = childElem->NextSiblingElement()) {
        ParamList childParams = readParams(childElem);
        for (ParamList::const_iterator it = childParams.begin(); it != childParams.end(); ++it) {
            params.push_back(Param(it->name(), it->value()));
        }
    }

    // yDebug() << params;
    return params;
}
Пример #22
0
/********************************************************************************************

>	virtual BOOL MakeBitmapFilter::GetExportOptions(BitmapExportOptions* pOptions)

	Author:		Colin_Barfoot (Xara Group Ltd) <*****@*****.**>
	Created:	12/11/96
	Purpose:	See BaseBitmapFilter for interface details

********************************************************************************************/
BOOL MakeBitmapFilter::GetExportOptions(BitmapExportOptions* pOptions)
{
	ERROR2IF(pOptions == NULL, FALSE, "pOptions NULL");
	ERROR3IF(!pOptions->IS_KIND_OF(MakeBitmapExportOptions), "pOptions isn't");

	BOOL Ok = FALSE;

	OpDescriptor* pOpDes = OpDescriptor::FindOpDescriptor(OPTOKEN_GIFTABDLG);

	if (pOpDes != NULL)
	{
		// Graeme (18-9-00)
		// We need to ensure that the correct file type is set up. The bitmap copy filter
		// uses the PNG settings, and so it's necessary to convince the dialogue that we
		// are exporting as a PNG to avoid relics from an earlier export to confuse matters.
		BmapPrevDlg::m_pthExport.SetType ( String_256 ( "png" ) );

		// set up the data for the export options dialog
		OpParam Param((INT32)pOptions, (INT32)this);

		// invoke the dialog
		pOpDes->Invoke(&Param);

		// SMFIX
		// we have brought the dlg up so get the options from the dlg as the graphic type may have changed
		pOptions = BmapPrevDlg::m_pExportOptions;
		Ok = BmapPrevDlg::m_bClickedOnExport;
	}
	else
	{	
		ERROR3("Unable to find OPTOKEN_BMAPPREVDLG");
	} 

	// Return whether or not it worked.
	return Ok;
}
Пример #23
0
void SETTINGS::Serialize(bool w, CONFIGFILE & c)
{
	c.bFltFull = false;
	for (int i=0; i < 6; ++i)
	{
		char ss[64];  sprintf(ss, "car%d.", i+1);   std::string s = ss;
		if (i < 4)
		{	Param(c,w, s+"car", gui.car[i]);			Param(c,w, s+"camera", cam_view[i]);
		}
		Param(c,w, s+"clr_hue", gui.car_hue[i]);
		Param(c,w, s+"clr_sat", gui.car_sat[i]);		Param(c,w, s+"clr_val", gui.car_val[i]);
		Param(c,w, s+"clr_gloss", gui.car_gloss[i]);	Param(c,w, s+"clr_refl", gui.car_refl[i]);
	}
	//todo: this for all 4 cars..
	Param(c,w, "car1.autotrans", autoshift);
	Param(c,w, "car1.autorear", autorear);		Param(c,w, "car1.autorear_inv", rear_inv);
	for (int i=0; i <= 1; ++i)
	{	std::string s = i==1 ? "A":"";
		Param(c,w, "car1.abs"+s, abs[i]);		Param(c,w, "car1.tcs"+s, tcs[i]);
		Param(c,w, "car1.sss_effect"+s, sss_effect[i]);
		Param(c,w, "car1.sss_velfactor"+s, sss_velfactor[i]);
		Param(c,w, "car1.steer_range"+s, steer_range[i]);
	}
	Param(c,w, "car1.steer_sim_easy", steer_sim[0]);
	Param(c,w, "car1.steer_sim_normal", steer_sim[1]);

	//  game
	Param(c,w, "game.start_in_main", startInMain);
	Param(c,w, "game.in_menu", inMenu);				Param(c,w, "game.in_main", isMain);
	Param(c,w, "game.pre_time", gui.pre_time);			Param(c,w, "game.chall_num", gui.chall_num);  //rem-
	Param(c,w, "game.champ_num", gui.champ_num);		Param(c,w, "game.champ_rev", gui.champ_rev);
	Param(c,w, "game.boost_type", gui.boost_type);		Param(c,w, "game.flip_type", gui.flip_type);
	Param(c,w, "game.rewind_type", gui.rewind_type);
	Param(c,w, "game.damage_type", gui.damage_type);	Param(c,w, "game.damage_dec", gui.damage_dec);

	Param(c,w, "game.boost_power", gui.boost_power);
	Param(c,w, "game.boost_min", gui.boost_min);		Param(c,w, "game.boost_max", gui.boost_max);
	Param(c,w, "game.boost_per_km", gui.boost_per_km);	Param(c,w, "game.boost_add_sec", gui.boost_add_sec);
	
	Param(c,w, "game.collis_cars", gui.collis_cars);	Param(c,w, "game.collis_veget", gui.collis_veget);
	Param(c,w, "game.collis_roadw", gui.collis_roadw);	Param(c,w, "game.dyn_objects", gui.dyn_objects);
	Param(c,w, "game.track", gui.track);				Param(c,w, "game.track_user", gui.track_user);
	Param(c,w, "game.trk_reverse", gui.trackreverse);	Param(c,w, "game.sim_mode", gui.sim_mode);
	Param(c,w, "game.local_players", gui.local_players); Param(c,w, "game.num_laps", gui.num_laps);
	Param(c,w, "game.start_order", gui.start_order);	Param(c,w, "game.split_vertically", split_vertically);
	
	//  graphs
	Param(c,w, "graphs.tc_r", tc_r);			Param(c,w, "graphs.tc_xr", tc_xr);
	Param(c,w, "graphs.te_yf", te_yf);			Param(c,w, "graphs.te_xf_pow", te_xf_pow);
	Param(c,w, "graphs.te_xfx", te_xfx);		Param(c,w, "graphs.te_xfy", te_xfy);

	
	//  hud
	Param(c,w, "hud_show.fps", show_fps);				Param(c,w, "hud_show.mph", show_mph);
	Param(c,w, "hud_show.gauges", show_gauges);			Param(c,w, "hud_show.show_digits", show_digits);
	Param(c,w, "hud_show.trackmap", trackmap);			Param(c,w, "hud_show.times", show_times);
	Param(c,w, "hud_show.caminfo", show_cam);			Param(c,w, "hud_show.cam_tilt", cam_tilt);
	Param(c,w, "hud_show.car_dbgtxt", car_dbgtxt);		Param(c,w, "hud_show.show_cardbg", car_dbgbars);
	Param(c,w, "hud_show.car_dbgsurf", car_dbgsurf);	Param(c,w, "hud_show.car_tirevis", car_tirevis);
	Param(c,w, "hud_show.car_dbgtxtclr", car_dbgtxtclr); Param(c,w, "hud_show.car_dbgtxtcnt", car_dbgtxtcnt);
	Param(c,w, "hud_show.check_arrow", check_arrow);	Param(c,w, "hud_show.check_beam", check_beam);
	Param(c,w, "hud_show.opponents", show_opponents);	Param(c,w, "hud_show.opplist_sort", opplist_sort);
	Param(c,w, "hud_show.graphs", show_graphs);			Param(c,w, "hud_show.graphs_type", (int&)graphs_type);

	Param(c,w, "gui.tracks_view", tracks_view);
	Param(c,w, "gui.tracks_sort", tracks_sort);		Param(c,w, "gui.tracks_sortup", tracks_sortup);
	Param(c,w, "gui.cars_sort", cars_sort);			Param(c,w, "gui.car_ed_tab", car_ed_tab);
	Param(c,w, "gui.champ_tab", champ_type);		Param(c,w, "gui.tut_tab", tut_type);
	Param(c,w, "gui.chall_tab", chall_type);		Param(c,w, "gui.champ_info", champ_info);

	Param(c,w, "hud_size.gauges", size_gauges);			Param(c,w, "hud_size.arrow", size_arrow);
	Param(c,w, "hud_size.minimap", size_minimap);		Param(c,w, "hud_size.minipos", size_minipos);
	Param(c,w, "hud_size.mini_zoom", zoom_minimap);		Param(c,w, "hud_size.mini_zoomed", mini_zoomed);
	Param(c,w, "hud_size.mini_rotated", mini_rotated);	Param(c,w, "hud_size.mini_terrain", mini_terrain);
	Param(c,w, "hud_size.mini_border", mini_border);
	Param(c,w, "hud_size.gauges_type", gauges_type);	//Param(c,w, "hud_size.gauges_layout", gauges_layout);
	//  cam
	Param(c,w, "hud_size.cam_loop_chng", cam_loop_chng); Param(c,w, "hud_size.cam_in_loop", cam_in_loop);
	Param(c,w, "hud_size.fov", fov_min);		Param(c,w, "hud_size.fov_max", fov_max);
	Param(c,w, "hud_size.fov_smooth", fov_smooth);
	Param(c,w, "hud_size.cam_bounce", cam_bounce);		Param(c,w, "hud_size.cam_bnc_mul", cam_bnc_mul);


	//  graphics
	Param(c,w, "graph_detail.preset", preset);
	Param(c,w, "graph_detail.tex_filter", tex_filt);		Param(c,w, "graph_detail.anisotropy", anisotropy);
	Param(c,w, "graph_detail.view_dist", view_distance);
	Param(c,w, "graph_detail.ter_detail", terdetail);		Param(c,w, "graph_detail.ter_dist", terdist);
	Param(c,w, "graph_detail.road_dist", road_dist);		Param(c,w, "graph_detail.tex_size", tex_size);
	Param(c,w, "graph_detail.ter_mtr", ter_mtr);			Param(c,w, "graph_detail.ter_tripl", ter_tripl);

	Param(c,w, "graph_par.particles", particles);			Param(c,w, "graph_par.trails", trails);
	Param(c,w, "graph_par.particles_len", particles_len);	Param(c,w, "graph_par.trail_len", trails_len);

	Param(c,w, "graph_reflect.skip_frames", refl_skip);		Param(c,w, "graph_reflect.faces_once", refl_faces);
	Param(c,w, "graph_reflect.map_size", refl_size);		Param(c,w, "graph_reflect.dist", refl_dist);
	Param(c,w, "graph_reflect.mode", refl_mode);
	Param(c,w, "graph_reflect.water_reflect", water_reflect); Param(c,w, "graph_reflect.water_refract", water_refract);
	Param(c,w, "graph_reflect.water_rttsize", water_rttsize);
	
	Param(c,w, "graph_shadow.dist", shadow_dist);			Param(c,w, "graph_shadow.size", shadow_size);
	Param(c,w, "graph_shadow.count",shadow_count);			Param(c,w, "graph_shadow.type", shadow_type);
	Param(c,w, "graph_shadow.shader_mode", shader_mode);	Param(c,w, "graph_shadow.lightmap_size", lightmap_size);

	Param(c,w, "graph_veget.trees", gui.trees);				Param(c,w, "graph_veget.grass", grass);
	Param(c,w, "graph_veget.trees_dist", trees_dist);		Param(c,w, "graph_veget.grass_dist", grass_dist);
	Param(c,w, "graph_veget.use_imposters", use_imposters); Param(c,w, "graph_veget.imposters_only", imposters_only);

	//  misc
	Param(c,w, "misc.version", version);			Param(c,w, "misc.autostartgame", autostart);
	Param(c,w, "misc.ogredialog", ogre_dialog);		Param(c,w, "misc.escquit", escquit);
	Param(c,w, "misc.bulletDebug", bltDebug);		Param(c,w, "misc.bulletLines", bltLines);
	Param(c,w, "misc.profilerTxt", profilerTxt);	Param(c,w, "misc.bulletProfilerTxt", bltProfilerTxt);
	Param(c,w, "misc.language", language);			Param(c,w, "misc.loadingback", loadingbackground);
	Param(c,w, "misc.dev_keys", dev_keys);			Param(c,w, "misc.dev_no_prvs", dev_no_prvs);
	Param(c,w, "misc.mouse_capture", mouse_capture);

	Param(c,w, "network.nickname", nickname);		Param(c,w, "network.master_server_address", master_server_address);
	Param(c,w, "network.local_port", local_port);	Param(c,w, "network.master_server_port", master_server_port);
	Param(c,w, "network.game_name", netGameName);

	Param(c,w, "replay.rec", rpl_rec);				Param(c,w, "replay.ghost", rpl_ghost);
	Param(c,w, "replay.bestonly", rpl_bestonly);	Param(c,w, "replay.trackghost", rpl_trackghost);
	Param(c,w, "replay.listview", rpl_listview);	Param(c,w, "replay.listghosts", rpl_listghosts);
	Param(c,w, "replay.ghostpar", rpl_ghostpar);	Param(c,w, "replay.ghostother", rpl_ghostother);
	Param(c,w, "replay.num_views", rpl_numViews);	Param(c,w, "replay.ghostrewind", rpl_ghostrewind);
	
	Param(c,w, "sim.game_freq", game_fq);			Param(c,w, "sim.multi_thr", multi_thr);
	Param(c,w, "sim.bullet_freq", blt_fq);			Param(c,w, "sim.bullet_iter", blt_iter);
	Param(c,w, "sim.dynamics_iter", dyn_iter);		Param(c,w, "sim.thread_sleep", thread_sleep);
	Param(c,w, "sim.perf_speed", perf_speed);
	
	Param(c,w, "sound.volume", vol_master);			Param(c,w, "sound.vol_engine", vol_engine);
	Param(c,w, "sound.vol_tires", vol_tires);		Param(c,w, "sound.vol_env", vol_env);
	Param(c,w, "sound.vol_susp", vol_susp);
	Param(c,w, "sound.vol_fl_splash", vol_fl_splash);	Param(c,w, "sound.vol_fl_cont", vol_fl_cont);
	Param(c,w, "sound.vol_car_crash", vol_car_crash);	Param(c,w, "sound.vol_car_scrap", vol_car_scrap);

	//  effects
	Param(c,w, "video_eff.all_effects", all_effects);
	Param(c,w, "video_eff.bloom", bloom);				Param(c,w, "video_eff.bloomintensity", bloom_int);
	Param(c,w, "video_eff.bloomorig", bloom_orig);		
	Param(c,w, "video_eff.motionblur", blur);			Param(c,w, "video_eff.motionblurintensity", blur_int);
	Param(c,w, "video_eff.ssao", ssao);					Param(c,w, "video_eff.softparticles", softparticles);
	Param(c,w, "video_eff.godrays", godrays);
	Param(c,w, "video_eff.dof", dof);
	Param(c,w, "video_eff.dof_focus", dof_focus);		Param(c,w, "video_eff.dof_far", dof_far);
	Param(c,w, "video_eff.boost_fov", boost_fov);
	//  effects hdr
	Param(c,w, "video_eff.hdr", hdr);					Param(c,w, "video_eff.hdr_p1", hdrParam1);
	Param(c,w, "video_eff.hdr_p2", hdrParam2);			Param(c,w, "video_eff.hdr_p3", hdrParam3);
	Param(c,w, "video_eff.hdr_bloomint", hdrBloomint);	Param(c,w, "video_eff.hdr_bloomorig", hdrBloomorig);
	Param(c,w, "video_eff.hdr_adaptationScale", hdrAdaptationScale);
	Param(c,w, "video_eff.hdr_vignettingRadius", vignRadius);  Param(c,w, "video_eff.hdr_vignettingDarkness", vignDarkness);
	
	//  video
	Param(c,w, "video.windowx", windowx);			Param(c,w, "video.windowy", windowy);
	Param(c,w, "video.fullscreen", fullscreen);		Param(c,w, "video.vsync", vsync);
	Param(c,w, "video.fsaa", fsaa);
	Param(c,w, "video.buffer", buffer);				Param(c,w, "video.rendersystem", rendersystem);
	Param(c,w, "video.limit_fps", limit_fps);
	Param(c,w, "video.limit_fps_val", limit_fps_val);	Param(c,w, "video.limit_sleep", limit_sleep);
	
	// not in gui-
	Param(c,w, "misc.boostFromExhaust", boostFromExhaust);
}
Пример #24
0
void SETTINGS::Serialize(bool w, CONFIGFILE & c)
{
	c.bFltFull = false;
	Param(c,w, "game.start_in_main", startInMain);
	Param(c,w, "game.in_menu", inMenu);				Param(c,w, "game.in_main", isMain);
	Param(c,w, "game.track", gui.track);			Param(c,w, "game.track_user", gui.track_user);

	Param(c,w, "hud_show.fps", show_fps);
	Param(c,w, "hud_show.trackmap", trackmap);				Param(c,w, "hud_size.minimap", size_minimap);
	Param(c,w, "hud_show.mini_num", num_mini);				Param(c,w, "hud_show.brushpreview", brush_prv);
	Param(c,w, "hud_show.tracks_view", tracks_view);
	Param(c,w, "hud_show.tracks_sort", tracks_sort);		Param(c,w, "hud_show.tracks_sortup", tracks_sortup);

	Param(c,w, "graph_detail.preset", preset);
	Param(c,w, "graph_detail.tex_filter", tex_filt);			Param(c,w, "graph_detail.anisotropy", anisotropy);
	Param(c,w, "graph_detail.view_dist", view_distance);
	Param(c,w, "graph_detail.ter_detail", terdetail);		Param(c,w, "graph_detail.ter_dist", terdist);
	Param(c,w, "graph_detail.road_dist", road_dist);		Param(c,w, "graph_detail.tex_size", tex_size);
	Param(c,w, "graph_detail.ter_mtr", ter_mtr);			Param(c,w, "graph_detail.ter_tripl", ter_tripl);

	Param(c,w, "graph_shadow.dist", shadow_dist);			Param(c,w, "graph_shadow.size", shadow_size);
	Param(c,w, "graph_shadow.count",shadow_count);			Param(c,w, "graph_shadow.type", shadow_type);
	Param(c,w, "graph_shadow.shader_mode", shader_mode);	Param(c,w, "graph_shadow.lightmap_size", lightmap_size);
	
	Param(c,w, "graph_reflect.water_reflect", water_reflect); Param(c,w, "graph_reflect.water_refract", water_refract);
	Param(c,w, "graph_reflect.water_rttsize", water_rttsize);

	Param(c,w, "graph_veget.trees", gui.trees);				Param(c,w, "graph_veget.grass", grass);
	Param(c,w, "graph_veget.trees_dist", trees_dist);		Param(c,w, "graph_veget.grass_dist", grass_dist);
	Param(c,w, "graph_veget.use_imposters", use_imposters); Param(c,w, "graph_veget.imposters_only", imposters_only);
	
	Param(c,w, "misc.allow_save", allow_save);		Param(c,w, "misc.inputBar", inputBar);		Param(c,w, "misc.camPos", camPos);
	Param(c,w, "misc.version", version);			Param(c,w, "misc.autostart", autostart);
	Param(c,w, "misc.ogredialog", ogre_dialog);		Param(c,w, "misc.escquit", escquit);
	Param(c,w, "misc.language", language);			Param(c,w, "misc.mouse_capture", mouse_capture);
	Param(c,w, "misc.check_load", check_load);		Param(c,w, "misc.check_save", check_save);
	
	Param(c,w, "set_cam.px",cam_x);  Param(c,w, "set_cam.py",cam_y);  Param(c,w, "set_cam.pz",cam_z);
	Param(c,w, "set_cam.dx",cam_dx); Param(c,w, "set_cam.dy",cam_dy); Param(c,w, "set_cam.dz",cam_dz);

	Param(c,w, "set.fog", bFog);					Param(c,w, "set.trees", bTrees);
	Param(c,w, "set.weather", bWeather);
	Param(c,w, "set.cam_speed", cam_speed);			Param(c,w, "set.cam_inert", cam_inert);
	Param(c,w, "set.ter_skip", ter_skip);			Param(c,w, "set.road_sphr", road_sphr);
	Param(c,w, "set.mini_skip", mini_skip);
	
	Param(c,w, "video.windowx", windowx);			Param(c,w, "video.windowy", windowy);
	Param(c,w, "video.fullscreen", fullscreen);
	Param(c,w, "video.fsaa", fsaa);					Param(c,w, "video.vsync", vsync);
	Param(c,w, "video.buffer", buffer);				Param(c,w, "video.rendersystem", rendersystem);
	Param(c,w, "video.limit_fps", limit_fps);
	Param(c,w, "video.limit_fps_val", limit_fps_val);	Param(c,w, "video.limit_sleep", limit_sleep);
	
	Param(c,w, "ter_gen.scale", gen_scale);
	Param(c,w, "ter_gen.ofsx", gen_ofsx);			Param(c,w, "ter_gen.ofsy", gen_ofsy);
	Param(c,w, "ter_gen.freq", gen_freq);			Param(c,w, "ter_gen.persist", gen_persist);
	Param(c,w, "ter_gen.pow", gen_pow);				Param(c,w, "ter_gen.oct", gen_oct);
	Param(c,w, "ter_gen.mul", gen_mul);				Param(c,w, "ter_gen.ofsh", gen_ofsh);
	Param(c,w, "ter_gen.roadsm", gen_roadsm);
	Param(c,w, "ter_gen.terMinA", gen_terMinA);		Param(c,w, "ter_gen.terMaxA",gen_terMaxA);
	Param(c,w, "ter_gen.terSmA", gen_terSmA);		Param(c,w, "ter_gen.terSmH",gen_terSmH);
	Param(c,w, "ter_gen.terMinH", gen_terMinH);		Param(c,w, "ter_gen.terMaxH",gen_terMaxH);	

	Param(c,w, "teralign.w_mul", al_w_mul);			Param(c,w, "teralign.smooth", al_smooth);
	Param(c,w, "teralign.w_add", al_w_add);
	Param(c,w, "tweak.mtr", tweak_mtr);
	
	Param(c,w, "pick.set_par", pick_setpar);
}
Пример #25
0
#include "Common.h"

// ============================================================================
//
// CONDITIONS
// 
// ============================================================================

CONDITION(
	/* ID */			0,
	/* Name */			"Loop %0 %1 times (Max %2)",
	/* Flags */			EVFLAGS_ALWAYS,
	/* Params */		(3,PARAM_STRING,"Loop Name",PARAM_NUMBER,"Run this event x times",PARAM_NUMBER,"Max Loop Iterations (only set this on the first event per Loop Name)")
) {
	string LoopName = string((char *)Param(TYPE_STRING));
	unsigned long LoopTimes = Param(TYPE_INT);
	unsigned long LoopMaxRT = Param(TYPE_INT);
	if(rdPtr->Run == "")
	{
		rdPtr->Run = LoopName;
		for(rdPtr->Iterations = 0; rdPtr->Iterations < LoopMaxRT; rdPtr->Iterations++)
		{
			rdPtr->rRd->GenerateEvent(0);
		}
		rdPtr->Iterations = LoopMaxRT;
		rdPtr->Run = "";
	}
	return(rdPtr->Run == LoopName && rdPtr->Iterations < LoopTimes);
}
Пример #26
0
#include "common.h"
#include "Voxel.h"

// ============================================================================
//
// CONDITIONS
// 
// ============================================================================

CONDITION(
	/* ID */			0,
	/* Name */			"%o: %0 == %1",
	/* Flags */			EVFLAGS_ALWAYS|EVFLAGS_NOTABLE,
	/* Params */		(2,PARAM_NUMBER,"First number",PARAM_NUMBER,"Second number")
) {
	int p1=Param(TYPE_INT);
	int p2=Param(TYPE_INT);
	
	return p1==p2;
}


CONDITION(
	/* ID */			1,
	/* Name */			"%o : On trigger",
	/* Flags */			0,
	/* Params */		(0)
) {
	return true;
}
Пример #27
0
Param::Param(QString name, QString description, Param::types type)
{
	Param(name, description, type, 0, 0);
}
Пример #28
0
 void addParam(const std::string& name, const T& param)
 {
    SEXP paramSEXP = sexp::create(param, &rProtect_);
    params_.push_back(Param(name, paramSEXP));
 }
Пример #29
0
 void addParam(const std::string& name, SEXP param)
 {
    params_.push_back(Param(name, param));
 }
Пример #30
0
int main(int argc, char* argv[]) {
#ifndef NDEBUG
    // report we are running with all Asserts turned on
    printf("*** Running in debug mode ***\n");
#endif    
    
	try {
		// initialize QMiner environment
		TQm::TEnv::Init();

		// create app environment
		Env = TEnv(argc, argv, TNotify::StdNotify);
		Env.SetNoLine(); // making output prettier
		// command line parameters
		Env.PrepArgs("QMiner " + TQm::TEnv::GetVersion(), 0);
		// read the action
		const bool ConfigP = Env.IsArgStr("config");
		const bool CreateP = Env.IsArgStr("create");
		const bool StartP = Env.IsArgStr("start");
		const bool StopP = Env.IsArgStr("stop");
		//const bool ReloadP = Env.IsArgStr("reload");
		const bool DebugP = Env.IsArgStr("debug");
		// stop if no action given
		const bool ActionP = (ConfigP || CreateP || StartP || StopP /*|| ReloadP*/ || DebugP);
		// provide basic instruction when no action given
		if (!ActionP) {
			printf("\n");
			printf("Usage: qm ACTION [OPTION]...\n");
			printf("\n");
			printf("Actions: config, create, start, stop, reload, debug\n");			
		} else {
			Env.SetSilent();
		}
		// configuration file
		const TStr ConfFNm = Env.GetIfArgPrefixStr("-conf=", "qm.conf", "Configration file");
		// read config-specific parameters
		if (!Env.IsSilent()) { printf("\nConfiguration parameters:\n"); }
		const int PortN = Env.GetIfArgPrefixInt("-port=", 8080, "Port number");
		const int CacheSizeMB = Env.GetIfArgPrefixInt("-cache=", 1024, "Cache size");
		const bool OverwriteP = Env.IsArgStr("-overwrite", "Overwrite existing configuration file");
		// read create-specific parameters
		if (!Env.IsSilent()) { printf("\nCreate parameters:\n"); }
		const TStr SchemaFNm = Env.GetIfArgPrefixStr("-def=", "", "Store definition file");
		// read start-specific parameters
		if (!Env.IsSilent()) { printf("\nStart parameters:\n"); }
		const bool RdOnlyP = Env.IsArgStr("-rdonly", "Open database in Read-only mode");
		const bool NoLoopP = Env.IsArgStr("-noserver", "Do not start server after script execution");
		TStr OnlyScriptNm = Env.GetIfArgPrefixStr("-script=", "", "Only run this script");
		// read stop-specific parameters
		if (!Env.IsSilent()) { printf("\nStop parameters:\n"); }
		const int ReturnCode = Env.GetIfArgPrefixInt("-return=", 0, "Return code");
		// read reload-specific parameters
		//if (!Env.IsSilent()) { printf("\nReload parameters:\n"); }
		//TStrV ReloadNmV = Env.GetIfArgPrefixStrV("-name=", "Script name");
		// read debug request parameters
		if (!Env.IsSilent()) { printf("\nDebug parameters:\n"); }
		TStr DebugFNm = Env.GetIfArgPrefixStr("-prefix=", "Debug-", "Prefix of debug output files");
		TStrV DebugTaskV = Env.GetIfArgPrefixStrV("-task=", "Debug tasks [indexvoc, index, stores, <store>, <store>_ALL]");
		const int JsStatRate = Env.GetIfArgPrefixInt("-jsmemstat=", 0, "Frequency of JavaScript memory statistics");        
		// read logging specific parameters
		if (!Env.IsSilent()) { printf("\nLogging parameters:\n"); }
		TStr LogFPath = Env.GetIfArgPrefixStr("-log=", "std", "Log Folder (std for standard output, null for silent)");
		const bool Verbose = Env.IsArgStr("-v", "Verbose output (used for debugging)");
		if (!Env.IsSilent()) { printf("\nPre-run file:\n"); }		
		const TStr PreRunFNm = Env.GetIfArgPrefixStr("-prerun=", "", "Pre-run file name");
		if (!Env.IsSilent()) { printf("\n"); }

        // execute pre-run command when provided
		if (!PreRunFNm.Empty()) { 
            const int ReturnCd = system(PreRunFNm.CStr());
            if (ReturnCd != 0) { 
                TQm::ErrorLog(TStr::Fmt("Error running prerun script: %d", ReturnCd)); 
            }
        }

		// stop if no action specified
		if (!ActionP) { return 0; }

		// initialize notifier
		TQm::TEnv::InitLogger(Verbose ? 2 : 1, LogFPath, true);
		printf("\n");

		// Create directory structure with basic qm.conf file
		if (ConfigP) {
			// check so we don't overwrite any existing configuration file
			if (TFile::Exists(ConfFNm) && ! OverwriteP) {
				TQm::InfoLog("Configuration file already exists (" + ConfFNm + ")");
				TQm::InfoLog("Use -overwrite to force overwrite");
				return 2;
			}
			// create configuration file
			PJsonVal ConfigVal = TJsonVal::NewObj();
			ConfigVal->AddToObj("port", PortN);
			PJsonVal CacheVal = TJsonVal::NewObj();
			CacheVal->AddToObj("index", CacheSizeMB);
			CacheVal->AddToObj("store", CacheSizeMB);
			ConfigVal->AddToObj("cache", CacheVal);
			// save configuration file
			ConfigVal->SaveStr().SaveTxt(ConfFNm);
			// make folders if needed
			if (!TFile::Exists("db")) { TDir::GenDir("db"); }
			if (!TFile::Exists("src")) { TDir::GenDir("src"); }
			if (!TFile::Exists("src/lib")) { TDir::GenDir("src/lib"); }
			if (!TFile::Exists("sandbox")) { TDir::GenDir("sandbox"); }			
		}

		// parse configuration file
		TQmParam Param(ConfFNm);
		// prepare lock
		TFileLock Lock(Param.LockFNm);

		// Initialize empty database
		if (CreateP) {
			// do not mess with folders with existing running qminer instance
			Lock.Lock();
            {
                // parse schema (if no given, create an empty array)
                PJsonVal SchemaVal = SchemaFNm.Empty() ? TJsonVal::NewArr() :
                    TJsonVal::GetValFromStr(TStr::LoadTxt(SchemaFNm));
                // initialize base
                TQm::PBase Base = TQm::TStorage::NewBase(Param.DbFPath, SchemaVal, 16, 16);
                // save base
                TQm::TStorage::SaveBase(Base);
            }
			// remove lock
			Lock.Unlock();
		}

		// Start QMiner engine
		if (StartP) {
			// do not mess with folders with running qminer instance
			Lock.Lock();
			// load database and start the server
			{
				// resolve access type
				TFAccess FAccess = RdOnlyP ? faRdOnly : faUpdate;
				// load base
				TQm::PBase Base = TQm::TStorage::LoadBase(Param.DbFPath, FAccess, 
                    Param.IndexCacheSize, Param.DefStoreCacheSize, Param.StoreNmCacheSizeH);
				// initialize javascript contexts
                TQm::TJsUtil::SetObjStatRate(JsStatRate);
				TVec<TQm::PScript> ScriptV; InitJs(Param, Base, OnlyScriptNm, ScriptV);
				// start server
				if (!NoLoopP) {
                    // prepare server functions 
                    TSAppSrvFunV SrvFunV;
                    // used to stop the server
                    SrvFunV.Add(TSASFunExit::New());
                    // admin webservices
                    TQm::TSrvFun::RegDefFun(Base, SrvFunV);
                    // initialize static content serving thingies
                    for (int WwwRootN = 0; WwwRootN < Param.WwwRootV.Len(); WwwRootN++) {
                        const TStrPr& WwwRoot = Param.WwwRootV[WwwRootN];
                        const TStr& UrlPath = WwwRoot.Val1, FPath = WwwRoot.Val2;
                        TQm::TEnv::Logger->OnStatusFmt("Registering '%s' at '/%s/'", FPath.CStr(), UrlPath.CStr());
                        SrvFunV.Add(TSASFunFPath::New(UrlPath, FPath));
                    }
                    // register admin services
                    SrvFunV.Add(TQm::TJsAdminSrvFun::New(ScriptV, "qm_status"));
					// register javascript contexts
					for (int ScriptN = 0; ScriptN < ScriptV.Len(); ScriptN++) {
						// register server function
						ScriptV[ScriptN]->RegSrvFun(SrvFunV);
					}
					// start server
					PWebSrv WebSrv = TSAppSrv::New(Param.PortN, SrvFunV, TQm::TEnv::Logger, true, true);
					// report we started
					TQm::TEnv::Logger->OnStatusFmt("Server started on port %d", Param.PortN);
					// wait for the end
					TLoop::Run();
				}
                // save base
                TQm::TStorage::SaveBase(Base);
			}
			// remove lock
			Lock.Unlock();
		}

		// Stop QMiner engine
		if (StopP) {
			ExecUrl(TStr::Fmt("http://127.0.0.1:%d/exit?return=%d", Param.PortN, ReturnCode),
                "Server stop procedure initiated", "Error stopping server: ");
		}

		// Reload QMiner script
		//if (ReloadP) {
		//	for (int ReloadNmN = 0; ReloadNmN < ReloadNmV.Len(); ReloadNmN++) {
		//		TStr ScriptNm = ReloadNmV[ReloadNmN];
		//		ExecUrl(TStr::Fmt("http://127.0.0.1:%d/%s/admin/reload", Param.PortN, ScriptNm.CStr()), 
		//			"Initializing reload of script '" + ScriptNm + "'", 
		//			"Error reloading script '" + ScriptNm + "': ");
		//	}
		//}

		// Debug dumps of database and index
		if (DebugP) {
			// do not mess with folders with existing running qminer instance
			Lock.Lock();
            {
                // load base
                TQm::PBase Base = TQm::TStorage::LoadBase(Param.DbFPath, faRdOnly, 
                    Param.IndexCacheSize, Param.DefStoreCacheSize, Param.StoreNmCacheSizeH);
                // go over task lists and prepare outputs
                for (int TaskN = 0; TaskN < DebugTaskV.Len(); TaskN++) {
                    TStr Task = DebugTaskV[TaskN];
                    if (Task == "index") {
                        Base->PrintIndex(DebugFNm + "index.txt", true);
                    } else if (Task == "indexvoc") {
                        Base->PrintIndexVoc(DebugFNm + "indexvoc.txt");
                    } else if (Task == "stores") {
                        Base->PrintStores(DebugFNm + "stores.txt");
                    } else if (Task.IsSuffix("_ALL")) {
                        TStr StoreNm = Task.LeftOfLast('_');
                        Base->GetStoreByStoreNm(StoreNm)->PrintAll(Base, DebugFNm + Task + ".txt");
                    } else if (Base->IsStoreNm(Task)) {
                        Base->GetStoreByStoreNm(Task)->PrintTypes(Base, DebugFNm + Task + ".txt");
                    } else {
                        TQm::InfoLog("Unkown debug task '" + Task + "'");
                    }
                }
            }
			// remove lock
			Lock.Unlock();
		}		
	} catch (const PExcept& Except) {
		// GLib exception
		TQm::ErrorLog("Error: " + Except->GetMsgStr());
		return 2;
	} catch (...) {
		// other exceptions
		TQm::ErrorLog("Unknown error");
		return 1;
	}
	return TQm::TEnv::ReturnCode.Val;
}