WideStudio for T-Engine

WideStudio for T-Engine


WideStudio for T-Engine is one of WideStudio Suite that enables you to develop a desktop application on T-Engine.
WideStudio for T-Engine offers the following features to develop T-Engine applications:
  • Generate T-Engine native binaries that runs much faster
  • Source codes can be shared among other platforms
T-Engine
T-Engine application of WideStudio

WideStudio for T-Engine Environment Settings


WideStudio for T-Engine uses Linux or Windows Operating Systems as its development environment for T-Engine applicatons. Applications developped on Linux or Windows are transmitted to T-Engine to run or for debugging.
Required software are show below:
  • (For Linux) Compilers such as gcc/g++
  • Your favorite editor to edit source codes
  • T-Kernel Development Kit (from Personal Media Co. )
  • T-Shell Development Kit (from Personal Media Co. ) *As required*
For Linux, gcc/g++ come with Linux OS are required.
Also, gcc compiler for T-Engine come with T-Kernel development kit is required for both Linux / Window.
The rest of description below assumes T-Kernel/T-Shell development kit installed on /usr/local/te (for Linux) and c:/cygwin/usr/local/te (for Windows)

Building WideStudio for T-Engine (Linux)


As for Linux version, libraries should be built from source codes.
(NOTE)Windows version has T-Engine libraries with its package, you don't need to build the libraries.
WideStudio source codes cat be accessed with its filename name ws-vX.XX.X-src.tar.gz on the Internet.
(NOTE)X.XX.X matches the version numbers.

Get that file to expand on Linux box which T-Engine development kit is installed like as following. Tempolary directory can be used for this.
 cd /work
gzip -cd ws-vX.XX.X-src.tar.gz | tar -xvf -
WideStudio for T-Engine building consists of two phases. One is to build WideStudio itself and another is to build T-Engine libraries.
  • WideStudio Building
  • WideStudio for T-Engine Library Building
WideStudio building can be done using gcc/g++ for Linux as follows:
cd /work/ws-vX.XX-X
./configure
make
After completion of WideStudio building, go on to the next; WideStudio for T-Engine library building. WideStudio for T-Engine library building requires to set path environment variable for T-Engine compiler as follows. This is used in generating T-Engine binaries.

csh:
setenv BD /usr/local/te

After set the variable, do:
cd /work/ws-vX.XX-X/src
make TARGET (specify the TARGET as following chart)

Machine name
TARGET
Description
SH7751R
te-sh7751r
T-Shell version for SH7751R
te-sh7751r-fb
Framebuffer output version for SH7751R
SH7727
te-sh7727
T-Shell version for SH7727
te-sh7727-fb
Framebuffer output version for SH7727
SH7760
te-sh7760
T-Shell version for SH7760
te-sh7760-fb
Framebuffer output version for SH7760
MC9328
te-mc9328
T-Shell version for MC9328
te-mc9328-fb
Framebuffer output version for MC9328
MB87Q1100
te-mb87q1100
T-Shell version for MB87Q1100
te-mb87q1100-fb
Framebuffer output version for MB87Q1100
Vr5500
te-vr5500
T-Shell version for Vr5500
te-vr5500-fb
Framebuffer output version for Vr5500
Vr5701
te-vr5701
T-Shell version for Vr5701
te-vr5701-fb
Framebuffer output version for Vr5701
TX4956
te-tx4956
T-Shell version for TX4956
te-tx4956-fb
Framebuffer version for TX4956


Ex. T-Shell version for SH7751R:
cd /work/ws-vX.XX-X/src
make te-sh7751r


No error result in building completion. Let's install WideStudio as follows. (default installation goes /usr/local/ws)
su
cd /work/ws-vX.XX-X
make install

Application Builder Configuration


T-Engine compiler path should be specified in Application Builder before compling a T-Engine application.
Select [Project Setting] from [Project] menu and click on [Environment Settings] Tab to set T-Engine compiler path

Settings


Creating Hello Application by WideStudio for T-Engine


Using a simple application - hello as an example, let's see how T-Engine application can be developed by WideStudio for T-Engine

T-Engine application
Hello application on T-Engine

First of all, start wsbuilder and create a new project from [New Project] in [Project] menu. Use "hello" as its project name and select [Generic Application]. Project file name is hello.prj
Then, select [Project Setting] from [Project] menu and configure T-Engine in TARGET item below in [Basic Setting] tab.

Settings


Creating a Window


After that, create a window which will be a base for hello application. Select [New Window] from [File] menu in the builder. Here we select [Generic Window] type with a name "newwin000" and configure the property as follows:
Project name: newwin000
X coordӤ 0
Y coordӤ 0
WidthӤ 240
HeightӤ 300
Title AttribӤ No title
On the Window you just created, put a button object and configure its property as follows
Object name: newvbtn_000
X coord: 10
Y coord: 10
Width: 100
Height: 30
Text: TEST


hello window
hello window


Creating an Event Procedure


Next is the most fun time; creating an event procedure. Let's have it say, "Hello!". Using C++ for event procedures, any given program such as an access to an object or data processing can be written here by specifying an event connecting to an object.
For example, if you set mouse-click event on a button, an event procedure aligned with that event runs when you click on the button with mouse.
Chosen a push button; newvbtn_000 that displays "hello!" would have an envent procedure developed as follows. Select "newvbtn_000" and configure it in [New Procedure Create] from [Procedure Edit] in [Edit] menu:

#include 
#include 
#include 
//-----------------------------------------------
//Function for the event procedure
//-----------------------------------------------
void btnop1(WSCbase* object){
static long cnt = 0;
  if (cnt != 0){
    exit(0);
  }
  object->setProperty(WSNlabelString,"Hello!");
  cnt++;
}
static WSCfunctionRegister op("btnop1",(void*)btnop1);


Building Hello Project


After saving the hello project by [Save Project] from [Project] menu in Application Builder, build by [Build All] in [Build] menu. If you successfully complete the build with no error, hello is ready to work.

Building Hello Project
Building hello

You will see hello.bz under the project directory after the building. Serial transmit this hello.bz using gterm from T-Engine development kit and configure.
Also, you can use fget for Ethernet Transmit to send the file. Please see more details for manuals come with T-Engine development kit offered by Personal Media Co.

In T-Shell version:
[/SYS] recv -d /.../hello/hello.bz <- Specify full path for hello.bz
[/SYS] expf -v hello.bz <- Extract hello.bz
[/SYS] vup -t hello /SYS <- Register hello in a box.
[/SYS] rm hello hello.bz <- Remove hello that is not used anymore.
In framebuffer output version:
[/SYS] recv -d /.../hello/hello    <- Specify full path for hello
[/SYS] vup -t hello /SYS <- Register hello in a box.
[/SYS] rm hello <- Remove hello that is not used anymore.
Now hello has been registered in a box with a name "Sample Program" You can start this application by double-clicking from a box. The name can be changed by editing hello.f that is created in a box directory.

Running hello application
Hello application on T-Engine

Document Release 3.20 for WideStudio ver 3.20, Oct 2002

Please feel free to contact us for any questions/bugs after checking the mailing list