VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Database Clients (databaseClients)

Table of Contents

The Database Clients examples demonstrate how to query database information from a Python application.

Introduction

VR-Forces can be configured to log data to a SQL database for later analysis. For more information, see the documentation on the database logging capability.

This directory contains a few simple example Python scripts for accessing the data logged by VR-Forces into your database. The examples are written with either SQLite or MySQL, though VR-Forces currently only has support for writing to SQLite databases. Also included are a few files containing some utility functions that can be used in Python scripts.

Configuring

The vrfSql.ini file allows you to configure the database connection for the Python clients. It contains similar settings to those in databaseConfig.mtl. It also allows you to specify the database implementation to use, either MySQL or SQLite. Currently VR-Forces only supports writing to SQLite databases.

Clients

  1. entityShootingStats.py - Displays a simple GUI to allow you to choose a scenario run and look at the results of all shots fired in that run. You can select multiple entities and graph their shooting statistics.
  2. printResources.py - Prints all resource amount events to the console.
  3. printSensors.py - Prints all sensor detection events to the console.
  4. printAnimals.py - Works in conjunction with the Add Database Event (addDatabaseEvent) example. Prints all animal creation events to the console.

Utility Scripts

  1. vrfSql.py - Defines functions for connecting to a SQL database and performing queries. Just a wrapper to support either MySQL or SQLite.
  2. vrfMySql.py - Used by vrfSql.py for accessing a MySQL database.
  3. vrfSqlite.py - Used by vrfSql.py for accessing a SQLite database.
  4. vrfUtils.py - Contains utility functions for accessing and processing database data.

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)