Storyboard IO example

Crank Storyboard Designer samples and code snippets.

Moderator: jamiev

Storyboard IO example

Postby jason » Thu Apr 01, 2010 2:05 pm

This is a simple example of using StoryboardIO to communicate with an external application. When you hit one of the 4 button on the bottom the main screen the application will send a storyboard IO message to the external application. The external application (weather.c) when it receives the message will then populate the new information on the screen.

Just unzip the attached zip somewhere, then go
file-> import->Storyboard Embedded Engine (GAPP)
And just point it at the gapp file in the root directory of the unzipped archive.

The C source file is in there also (weather.c). This is the build line I use to build it

jason@ubuntu:~$ cc weather.c -L /home/jason/Crank_Software/Storyboard_Engine/linux-x86-sdl-obj/lib -I /home/jason/Crank_Software/Storyboard_Engine/linux-x86-sdl-obj/include/ -l greio -l rt -o weather

- To compile this for QNX drop the -lrt from the compile line.
- If you are running this on Linux you will need mqueue support in the kernel.
- If you want to run this on Windows, you'll want to wait until 1.1 since Storyboard IO will be supported on windows then :)
Attachments
sbio_example.zip
(796.4 KiB) Downloaded 552 times
User avatar
jason
 
Posts: 152
Joined: Mon Nov 02, 2009 4:53 pm

Re: Storyboard IO example

Postby thomas » Thu Jun 03, 2010 8:44 pm

Storyboard 1.1 is now available and with it comes a GREIO implementation for our Win32 simulator.

The weather.c file compiles without modification using Visual Studio. All you have to do is add the dependency to libgreio.lib and the paths to the Storyboard Engine headers and libraries, typically something like:

<installroot>\Storyboard Designer\storyboard\plugins\<simulatorid>\resources\sbengine\include
<installroot>\Storyboard Designer\storyboard\plugins\<simulatorid>\resources\sbengine\libs

Where <installroot> is the root of your installation, typically:
C:\Program Files\Crank Software
and <simulatorid> is the plugin id of the simulator, typically:
com.crank.gdt.simulator.runtime.win32_1.1.0.201005210959

This path is a bit out of the way, you'll find the non-simulator platforms in the Storyboard Engine directory.

I've attached a VS project archive that you should be able to use after adjusting the paths for your own installation.

Thomas
Attachments
sbio_vs.zip
Visual Studio build configuration
(285.14 KiB) Downloaded 423 times
thomas
 
Posts: 91
Joined: Mon Nov 02, 2009 4:32 pm
Location: Ottawa

Re: Storyboard IO example

Postby jamiev » Fri Jun 04, 2010 9:12 am

Our image loader does not support gifs on some platforms. I've respun Jason's example to use pngs instead of gifs.

-JamieV
Attachments
sbio_example.rar
Storyboard IO example archive
(862.97 KiB) Downloaded 399 times
User avatar
jamiev
 
Posts: 32
Joined: Wed Nov 04, 2009 2:14 pm

Re: Storyboard IO example

Postby thomas » Fri Jun 04, 2010 2:25 pm

For a bit more of an interactive view of this sample, you can watch the video that walks through the steps of associating the Storyboard IO channel with a user interface action:

http://www.youtube.com/watch?v=jNElexQ9dAI

Thomas
thomas
 
Posts: 91
Joined: Mon Nov 02, 2009 4:32 pm
Location: Ottawa

Re: Storyboard IO example

Postby garryc » Tue Mar 22, 2011 7:33 am

In addition to the above config there is a missing external symbol definition relating to errno if you are using C++ source code format. This is caused by differences in the naming conventions for symbols, firstly between C and C++ files under the Microsoft compiler and secondly between standard libraries of OS platforms.

typical error messages found on link:
Code: Select all
libgreio.lib(multi_data.obj) : error LNK2019: unresolved external symbol errno referenced in function gre_io_add_mdata
libgreio.lib(greio_cemsmq.obj) : error LNK2001: unresolved external symbol errno


The solution below was used to resolve this dependency on Windows CE 6.0R3 under Visual Studio 2008 Pro. The code snipped was added to the VS project within a new include file 'utils.h', which in turn was referenced in '<project path>\sbio_vs_ce\sbio_vs_ce.cpp':

Contents of utils.h
Code: Select all
#ifndef _UTILS_H_
#define _UTILS_H_

#include <errno.h>

// define errno to satisfy unresolved external symbol errno referenced in function gre_io_add_mdata
// extern "C"{ } declaration is essential to ensure matching library dependency definitions
#ifdef __cplusplus
extern "C"{
#endif

#define GRE_IO_NOERROR   0

extern errno_t errno;

#ifdef __cplusplus
}
#endif

#endif /*_UTILS_H_*/


Hopefully this works for you.

PS: The GREIO library requires the system components for MSMQ under WindowsCE so make sure this is included in the Platform Builder catalog for your nk.bin.

Garry
garryc
 
Posts: 2
Joined: Mon Mar 14, 2011 10:00 am

Re: Storyboard IO example

Postby cguthrie » Tue Aug 30, 2011 6:25 pm

Hi all,

I've been trying to get this to run on my pc, just as a starting point for getting used to IO and I am having a terrible time of it. I set up my Crank environment with send and receive handles, I verified that they are the same in the C code as they are in the environment. I put my additional dependencies in both linker and c/c++. When I try to run the C code after launching the simulator I receive a "can't open send handle" failure. I have checked, double checked, and triple checked for spelling errors. Am I missing a step?

Thanks,
Chelsea
cguthrie
 
Posts: 24
Joined: Thu Jun 30, 2011 7:27 pm

Re: Storyboard IO example

Postby jamiev » Wed Aug 31, 2011 11:57 am

Hello,

We changed the Storyboard IO project name but did not make the channel name change to the weather.c file. This only pertains to the example included with the Designer installation.

In weather.c just change the name of the send channel from this

send_handle = gre_io_open("sbio_example.gapp", GRE_IO_TYPE_WRONLY);
if(send_handle == NULL) {
printf("Can't open send handle\n");
return 0;
}

To this

send_handle = gre_io_open("storyboard_IO.gapp", GRE_IO_TYPE_WRONLY);
if(send_handle == NULL) {
printf("Can't open send handle\n");
return 0;
}

Thanks,

-Jamie
User avatar
jamiev
 
Posts: 32
Joined: Wed Nov 04, 2009 2:14 pm

Re: Storyboard IO example

Postby ybe » Wed Jul 17, 2013 6:04 am

Hi,

I have changed the code as shown in the message above, but still get the "can't open send handle" message when launching the c app.

thomas wrote:Storyboard 1.1 is now available and with it comes a GREIO implementation for our Win32 simulator.

The weather.c file compiles without modification using Visual Studio. All you have to do is add the dependency to libgreio.lib and the paths to the Storyboard Engine headers and libraries, typically something like:

<installroot>\Storyboard Designer\storyboard\plugins\<simulatorid>\resources\sbengine\include
<installroot>\Storyboard Designer\storyboard\plugins\<simulatorid>\resources\sbengine\libs

Where <installroot> is the root of your installation, typically:
C:\Program Files\Crank Software
and <simulatorid> is the plugin id of the simulator, typically:
com.crank.gdt.simulator.runtime.win32_1.1.0.201005210959

This path is a bit out of the way, you'll find the non-simulator platforms in the Storyboard Engine directory.

Thomas


in the C:\Program Files\Crank Software\Storyboard Designer\storyboard\plugins I can't find the libs or includes for the win32 simulator.
so I have linked the libraries to C:\Program Files\Crank Software\Storyboard Engine\3.1.0.201304081236\win32-x86-win32-obj instead (same as the storyboard SDK configured in the storyboard simulator configurations window).

regards,
Yves
Last edited by ybe on Wed Jul 17, 2013 6:40 am, edited 1 time in total.
ybe
 
Posts: 38
Joined: Tue Jun 18, 2013 2:20 am

Re: Storyboard IO example

Postby ChrisK » Wed Jul 17, 2013 6:32 am

HI Yves,

what is the name of the Storyboard app you are simulating? The name of the channel you pass to gre_io_open must match this.

Can you modify your simulator run app as follows and post the output?

sbengine.exe -vvv <gapp file>
ChrisK
 
Posts: 14
Joined: Wed Nov 04, 2009 3:34 pm

Re: Storyboard IO example

Postby ybe » Wed Jul 17, 2013 6:46 am

the name of the SB app is storyboard_IO.gapp

Yves
ybe
 
Posts: 38
Joined: Tue Jun 18, 2013 2:20 am

Next

Return to Samples

Who is online

Users browsing this forum: No registered users and 0 guests

cron