fischertechnik TXT community firmware (2024)

This tutorial will give a basic introduction on how to write an application for the Community Firmware of the Fischertechnik TXT controller.

An app consists of at least three files:

  • The application program (executable) itself. This is typically a python script. But it could equally well be a native binary or a script in any other language supported by the TXT. Since python has become the de-facto standard for software written for the TXT this tutorial will also use the python language. Please note:
    • Spaces are the preferred indentation method in Python 3. Python 3 disallows mixing the use of tabs and spaces for indentation.
    • The line endings for Python code for CFW must be a single Line-Feed (LF), ASCII-Code 10 character. If you use Windows for writing program code, please make sure that your editor is able to save the code with the correct file endings.
  • A manifest file. This is a small text file containing additonal information about the App like its display name, its author and the name of the executable.

  • An icon. This should be a 64x64 pixel PNG file which is being used in the launcher as well as the web interface.

The application program

The application program can be any script or binary the TXT is able to execute. Since apps are usually started from the TXTs launcher the user will expect some output on the screen. Thus the program should include a minimalistic GUI.

Currently all apps use the Qt4-Toolkit for their user interface. We’ll thus also use Qt. A minimal python application opening a TXT styled window looks like this:

#! /usr/bin/env python3# -*- coding: utf-8 -*-import sysfrom TouchStyle import *class FtcGuiApplication(TouchApplication): def __init__(self, args): TouchApplication.__init__(self, args) # Creates an empty MainWindow w = TouchWindow("Test") w.show() self.exec_() if __name__ == "__main__": FtcGuiApplication(sys.argv)

Please save this file under the name test.py

This app subclasses the TouchApplication class which was imported from TouchStyle. It creates a window labeled “Test”, shows that window and hands over execution to the window so it can interact with the user until it’s closed.

The manifest

The manifest file is a simple text file containing various fields describing the app.

[app]name: Testcategory: Testsauthor: Joe Developericon: icon.pngdesc: TXT app tutorial #1url: http://cfw.ftcommunity.de/ftcommunity-TXT/en/programming/python/tutorial-1.htmlexec: test.pymanaged: yesuuid: 191fe5a6-313b-4083-af65-d1ad7fd6d281version: 1.0firmware: 0.9

The mandatory fields are name, icon, desc, exec, uuid and managed.

  • name is the display name of the app as used e.g. in the launcher. It should be short enough to fit below the icon.
  • icon is name of the icon file. This is usually icon.png
  • desc is a short description of the app. This is currently only used in the web interface
  • exec is the name of the executable. In this example it refers to our test.py python script.
  • uuid is a unique id used to identify this app. You can generate one for your app e.g. online with services like this. The uuid identifies an app, so all versions of an app must use the same uuid. The uuid is also used to generate the apps’ unique directory on the TXT. Make sure that each app has its own unique id.
  • managed is currently unused and should be set to yes. This tells the launcher that the app has a Qt GUI. In the future this will allow the launcher to support apps using a different GUI toolkit.
  • version is the current version number of this app.
  • firmware is the firmware version number this app has been tested for. Currently only 0.9 exists. Later this will allow ranges like 0.9-1.1

Some optional fields are also used:

  • category is used to group apps in the launcher
  • author gives information about the developer of this app
  • url can be used to link to a web page describing the app.
  • html gives the name of the start file of the app’s web interface on the TXT, e.g. index.html.
  • set optionally refers to the Fischertechnik set related to a model the app can be used for. E.g. 524328 ROBOTICS TXT Discovery Set
  • model optionally refers to the english model name from the set. E.g. Pedestrian Light

The set and model entries are currently unused but may be used in the future to allow the user to find apps relating to a specific model he e.g. just built.

Please save this file under the name manifest

The icon can be any file in JPG or PNG format. It should be 64x64 pixels in size.

fischertechnik TXT community firmware (1)

An example file can be found at here

This icon has been created using the Inkscape but most other paint programs will also do. The inkscape SVG file for this icon is also available here

Now we have the three mandatory files

  • test.py the app programm code itself
  • manifest the text file describing the app
  • icon.png the icon for the launcher

To get these installed on the TXT they’ll need to be put into a ZIP archive. Any program like WinZIP should work. All three files should be in the toplevel of the ZIP and not e.g. in some subfolder.

A prepared archive of our little demo app is also available.

Now use your PC’s web browser to connect to the TXT. The main web page will show all installed apps:

fischertechnik TXT community firmware (2)

Use the file dialog to select our test.zip archive and hit upload:

fischertechnik TXT community firmware (3)

The app is now being intalled on the TXT and becomes visible in the TXTs launcher:

fischertechnik TXT community firmware (4)

The app can be launched like any other app by clicking it:

fischertechnik TXT community firmware (5)

It’s now also visible in the web interface:

fischertechnik TXT community firmware (6)

Selecting it shows some of the details from the manifest file:

fischertechnik TXT community firmware (7)

In the web interface, you can also delete the app.

Continue reading Programming Python: Development

fischertechnik TXT community firmware (2024)
Top Articles
Entgeltgruppe E 4 TVöD, Bund: Gehalt
Fraternity and Sorority Life - Fraternity and Sorority Life
What Did Bimbo Airhead Reply When Asked
Devon Lannigan Obituary
Www.fresno.courts.ca.gov
Trabestis En Beaumont
Robot or human?
Vaya Timeclock
Air Canada bullish about its prospects as recovery gains steam
50 Meowbahh Fun Facts: Net Worth, Age, Birthday, Face Reveal, YouTube Earnings, Girlfriend, Doxxed, Discord, Fanart, TikTok, Instagram, Etc
13 The Musical Common Sense Media
Culos Grandes Ricos
Most McDonald's by Country 2024
Bad Moms 123Movies
Conan Exiles Colored Crystal
111 Cubic Inch To Cc
라이키 유출
Nesz_R Tanjiro
Invert Clipping Mask Illustrator
Noaa Ilx
Raz-Plus Literacy Essentials for PreK-6
Quick Answer: When Is The Zellwood Corn Festival - BikeHike
All Obituaries | Verkuilen-Van Deurzen Family Funeral Home | Little Chute WI funeral home and cremation
Utexas Iot Wifi
Bay Area Craigslist Cars For Sale By Owner
6892697335
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Weathervane Broken Monorail
They Cloned Tyrone Showtimes Near Showbiz Cinemas - Kingwood
Myaci Benefits Albertsons
Darktide Terrifying Barrage
Darknet Opsec Bible 2022
Shauna's Art Studio Laurel Mississippi
Rvtrader Com Florida
Flaky Fish Meat Rdr2
Workboy Kennel
Jay Gould co*ck
RFK Jr., in Glendale, says he's under investigation for 'collecting a whale specimen'
Selfservice Bright Lending
67-72 Chevy Truck Parts Craigslist
20 Best Things to Do in Thousand Oaks, CA - Travel Lens
Ise-Vm-K9 Eol
No Boundaries Pants For Men
Former Employees
4k Movie, Streaming, Blu-Ray Disc, and Home Theater Product Reviews & News
American Bully Puppies for Sale | Lancaster Puppies
Bama Rush Is Back! Here Are the 15 Most Outrageous Sorority Houses on the Row
Hcs Smartfind
Taterz Salad
Loss Payee And Lienholder Addresses And Contact Information Updated Daily Free List Bank Of America
San Pedro Sula To Miami Google Flights
Latest Posts
Article information

Author: Chrissy Homenick

Last Updated:

Views: 6384

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Chrissy Homenick

Birthday: 2001-10-22

Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

Phone: +96619177651654

Job: Mining Representative

Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.