Table Widget Help


Serial Table Help

Table View

Help Index


Programming Help

Working with Serial Table is easy! Please read the steps below for how to use the Serial Table API.

How to create a Serial Table Widget Window

Before creating a Serial Table Widget Window you need to establish a serial communications connection to Omnia Creator first using the ILCore object. ILCore takes care of connecting to Omnia Creator using the fastest possible serial communications speed; that your microcontroller can run the Omnia Creator Interface Library code at so that you don’t have to worry about baud rates anymore.

With Omnia Creator, worrying about baud rates is a thing of the past!

Please note: you need to make sure that your serial port’s baud rate is set to Auto in Omnia Creator for the Omnia Creator Interface Library to work. You can also force your serial port’s baud rate to be another value in Omnia Creator for interfacing with devices that aren’t running the Omnia Creator Interface Library code.

To get started with Serial Table, first include the Omnia Creator Interface Library in your code (line 1). Then declare the ILCore and ILTable objects (lines 3 and 4). In your main/setup function initialize communication with Omnia Creator using the core.init() function (line 8). core.init() takes care of setting up serial communications with Omnia Creator for you. Once you’ve initialized ILCore DO NOT USE YOUR NATIVE SERIAL FUNCTIONS ANYMORE! If you need to receive or send characters use ILCore to do it for you. ILCore wraps around your native serial port and supplies its own functions to access your native serial port like read, write, print, println, etc. However, if you still want to write/print to your native serial port, this is okay and will not cause any problems. Any text sent by your microcontroller will be printed to Omnia Creator’s standard serial terminal if you use your native serial write/print functions or ILCore’s write/print functions. But, you need to use the ILCore functions for receiving serial data. Calling your native serial read functions will cause the Omnia Creator Interface Library to lose synchronization with Omnia Creator.

Please note: you can use the ILCore object to open dialog boxes on the computer and get the results. You’re not going to really ever need to type into the serial terminal to command your microcontroller anymore!

Next, after initializing the core object you can clear all the previous Widget Windows from Omnia Creator’s memory by calling core.clearAll() (line 9). Any open Widget Windows should disappear after executing this line of code. If you don’t clear previous Widget Windows from memory you can still keep adding data to them from your microcontroller. However, you’ll need to clear a previous Widget Window from memory if you change the Widget Window’s type when you initialize it in your code. Omnia Creator’s Widget Menu also has a Remove Widget command and a Remove All Widgets command for this purpose. Omnia Creator will print out debug messages when there’s a problem that you need to address.

Finally, you can create the Serial Table Widget Window by calling table.init(&core, “Hello World”) (line 11). The first argument to table.init() is a pointer to the core object. All you need to do is pass it &core always. Passing &core connects the child ILTable object to parent ILCore object. The second argument to table.init() is a title string for the Widget Window. You can make this string whatever you want. But, please try to keep it short. If you’d like a docked Widget Window call the initDocked() function instead of the init() function. This will create the Serial Table Widget Window as a docking window that can dock itself inside of the main Omnia Creator window. Otherwise the init() function will create the Serial Table Widget as a top level window.

After executing this code a Serial Table Widget Window should appear!

How to create Serial Table Items

Once you’ve created your Serial Table Widget Window you can now add rows, columns, and items to your table. Before adding an item you first need to create a row and column for that item. The newRow() function creates a new row, the first argument is the row index which can be any number. All rows that you create will be sorted by this number and displayed in ascending order. The second argument is the row name. You can make the name whatever you want. Just try to keep it short. The newColumn() function creates a new column, the first argument is the column index which can be any number. All columns that you create will be sorted by this number and displayed in ascending order. The second argument is the column name. You can make the name whatever you want. Just try to keep it short.

After you’ve created both a row and a column to hold your item you can create a new item by calling the newItem() function which will create a new text item in the supplied row and column for you. You make the text whatever you want. Just try to keep it short.

How to create lots of Serial Table Items

If you need to create a lot of items and want to set the text label for each item programmatically use the snprintf() function. snprintf() will allow you to create a formatted text string for each row, column, and item.

Please note: some microcontrollers do not implement floating point support for snprintf(). If you see a ‘?’ in your text output where a floating point number should be then this is the case.

Other Things

After creating new rows, columns, and items you can set their text again using the setRowName(), setColumnName(), and setItemText() functions; and get their text using the getRowName(), getColumnName(), and getItemText() functions. You can also delete rows, delete columns, and delete items using the deleteRow(), deleteColumn(), and deleteItem() functions. For bulk removal, call clearAll().

Have fun making tables with Omnia Creator!


User Interface Help

You can find information about user interface functions below:

Find Item

If you have a large table and need to find some particular item text go to the File Menu and click Find Item. This will open a dialog where you can type in the item text to search for. Serial Table will then highlight the first item found with the specified text and center the display on that item.

Export State

To export your table state go to the File Menu and click Save Table. This will export your table state to a JSON file that you can open with Omnia Creator later to recreate your Serial Table. Feel free to edit the exported JSON file.

Import State

To import your table state go to the main Omnia Creator window, open the Widgets Menu and click Import Widget State. Select the JSON file you want to open and Omnia Creator will recreate the saved Serial Table Widget Window for you.

Please note: the new Serial Table Widget Window is a static read-only visualization of your data and is not connected to your serial port in any way.

Export CSV (comma separated values)

To export your table state to a CSV file go to the File Menu and click Export CSV. This will export your table state to a CSV file that you can open with programs like Microsoft Excel. Serial Table will give you the option of including the column headers in the CSV file if you want them.

Copy Text

To copy text out of the Serial Table Widget Window select and hover your mouse cursor over the cell you want to copy text from and press ctrl + c.