Tuesday, January 12, 2010

Kapow: Creating DataModel and Database Link

Kapow: Creating DataModel and Database Link

Kapow robosuite 6.4 works with many database, in this example I will use mysql.For mysql, you need to download and install this file


Make sure you have set this up properly.  Google is your friend.  

Create a database in  your mysql.  To do that, I log into my xamp and I did it in phpmyadmin.

After you have done that, open Kapow Settings then goto database Connection Add your database by selecting 
    Database Type
    Name and Password
  if using utf8
    goto advanced and type "utf8" in the Character Encoding Field
    I would also add this line when creating database at the end 
        DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

  Click on "test Connection" to see if it works

Start Robomanger and it will ask if you want to add the new database into use, answer yes and all basic data type will be added to that database.
If it doesn't get added automatically, then select Database->Select Database to use and find the database you recently added. This will trigger the program to check if the required tables are there, if not you will be asked and the tables will be added automatically.

In Kapow you have to have a Data Model before you can load anything.  You need to create a Data model, similar idea to a Class in the C language.  Make sure you have data model ready or use existing ones.  You can do that in Kapow ModelMaker 
Then goto Tools -> Create Database Table, you should now be able the choose the new database you just created.

If your robomaker is opened, save you work and close the program.  Restart the program and now you will be able to choose your data model as the output type or use your database as storage in debug mode.  WarningWithout restarting robomaker won't be able to see the newly added database.