Skip to content

Building the Binary

Gene Mosher edited this page May 19, 2021 · 22 revisions

The Network graph is at https://github.com/ViewTouch/viewtouch/network


Building has been tested on on a Debian 10 (Buster) AMD64, Ubuntu 20.04 LTS AMD64 and Raspian ARM. ViewTouch binary files are designed for both 32 bit and 64 bit systems.

On the Raspberry Pi users can issue root user commands by using the command prefixsudo. Users can switch to root user with the command sudo su.

Building:

Required Packages

  • G++
  • G++-8, G++-9, G++-10
  • xorg-dev
  • xfonts-base
  • libmotif-dev
  • libfreetype6-dev
  • libgtk-3-dev (and all of the libgtk-3 files)
  • libcurlpp-dev (required May 16, 2021. There are 3 candidates in this development library. We're using libcurl4-gnutls-dev)
  • make
  • cmake
  • git
  • xwit
  • tzdata (date is Howard Hinnant's highly optimized date library. date.h)

This command installs all of the above components and required development libraries:

as root (or prefaced with sudo)

`apt install g++ xorg-dev libmotif-dev libfreetype6-dev libgtk-3-dev libcurl-dev make cmake git xwit xfonts-base xfonts-75dpi xfonts-100dpi tzdata`

Required development libraries are automatically installed with the above packages.

  • libX11-dev
  • libfontconfig1-dev
  • libxrender-dev
  • libxt-dev
  • libxft-dev
  • libxmu-dev
  • libxpm-dev
  • libzlib1g-dev

A dedicated user (eg. 'viewtouch') is set up for the application who does not have admin privileges. This user is given a secure password and user is added to the sudoers file. This is helpful when remote access to the POS host occurs as this account can be used for SSH. From an account with sudo privileges, or as root, create an initial directory structure for ViewTouch. # is the root user prompt. $ is viewtouch user prompt.

as root (or preface each command with sudo)

`useradd viewtouch`
`passwd viewtouch`

add user viewtouch to the sudoers file

`usermod -aG sudo viewtouch`

create ViewTouch directories

`mkdir /usr/viewtouch`
`chown -R viewtouch.viewtouch /usr/viewtouch`
`chmod -R o+rw /usr/viewtouch`

switch to user viewtouch. Do not preface commands with sudo.

`su viewtouch`
`mkdir /usr/viewtouch/src`
`mkdir /usr/viewtouch/bin`
`mkdir /usr/viewtouch/dat`

When ViewTouch runs, directories: /usr/viewtouch/css and /usr/viewtouch/graphics are automatically created.

It may seem tempting to set the /usr/viewtouch directory as the viewtouch user's home directory but is inadvisable as it may be necessary to delete and recreate it.

The Initial Build

Build and install binaries as user viewtouch.

Cloning the entire source tree

`cd /usr/viewtouch/src`
`git clone https://github.com/ViewTouch/viewtouch.git`
`cd viewtouch`
`mkdir build`
`cd build`
`cmake ..`
`make`
`ln -s /usr/viewtouch/dat/ dat`
`make install`

Subsequent Builds:

Pulling files which have been changed since first cloning:

`cd /usr/viewtouch/src`
`git pull`
`cd build`
`cmake ..`
`make`
`make install`

Download http://www.viewtouch.com/vt_data to /usr/viewtouch/bin

Note:

cmake .., make, and make install commands are entered from the ~/viewtouch/build directory.

Make uses the -j argument to speed its completion by launching jobs in all available processor cores. Without the -j argument make uses one processor core. To use all available cores on small project such as ViewTouch, one can use make -j, instructing make to launch an unlimited number of jobs. To specify (i.e., limit) the number of jobs make can launch, use -j(n) where n is the number of processor cores. The number of CPU processor cores is displayed with the nproc --all command.

If necessary to do a make clean in cmake, remove viewtouch/build/CMakeCache.txt

cmake .. regenerates the cmake files. Regeneration is necessary if a new file is added to source folder that is selected by *.cc, for example. While not a "clean" per se, the cmake files are 'cleaned' by regenerating the caches.

ViewTouch user interface files

There are two types of user interface (Ux) data files in ViewTouch. The first type is /usr/viewtouch/bin/vt_data; it cannot be customized. vt_data contains all of the graphical 'pages' needed by and common to all users. The second type is files residing in the default directory for restaurant filesets (i.e., all of the user interface pages unique to any restaurant), /usr/viewtouch/dat; minimally populated 'seed' versions of these files are created automatically on startup if they don't exist. The specific data files in /usr/viewtouch/dat unique to a hospitality menu (Graphical User Interface)

  • menu.dat
  • zone_db.dat
  • tables.dat
  • settings.dat
  • employee.dat
  • exception.dat
  • inventory.dat
  • locale.dat
  • media.dat

For debugging the following development library may be required libcurl4-gnutls-dev

Other important or useful files or packages, but not required:

  • fonts-liberation
  • fonts-liberation2

OK, you've downloaded and compiled the code. what next?

ViewTouch has internal documentation accessible from a 'Documentation' button in the upper right corner of Page One.

On Page One is a Copyright button at top center. Select it to see buttons which will perform the same functions as the 2nd, 3rd and 4th curl commands above.

From its outset in 1986, ViewTouch point of sale was a unique type of computer software.

  • In point of sale software, the user interface is never complete until the end user, the customer, completes it
  • the user interface which must be created by end users will be unique in every case.
  • point of sale software must include tools and instructions which enable users to complete the interface.

The software tools must be intuitive and simple, for each end user, customer, to learn and to use to complete the interface. The 'Starter' Pages mentioned above are the beginning of the journey to do this.

One is in pretty good shape with these files - the application will run - but it will be incomplete until the all of the Table and Menu Pages have been created, and when these Pages are populated with Table Buttons and Menu Item Buttons. The function and usefulness of Menu Item Buttons is enhanced by Modifier (Descriptor) buttons and Qualifier Buttons. The analogy of nouns, adjectives and adverbs applies to these Button types. As nouns are enhanced by adjectives and verbs are enhanced by adverbs, so too are menu items enhanced by modifiers and modifiers are enhanced by qualifiers.

The process of traversing ViewTouch Pages and selecting Buttons on Pages is a serial process which is quite similar to moving within a hierarchy of higher and lower levels. It is largely automatic but it is also somewhat, and crucially, dependent upon how the Menu Pages and Buttons are built. This is covered in the program's internal documentation.

My phone number is 541-515-5913, my email is [email protected]. The ViewTouch github web site answers many questions. Thank You for your interest in ViewTouch ! Anyone may call me, Gene Mosher, with comments, suggestions, questions or help.

Start ViewTouch with this command or with a desktop (or panel) icon containing this command:

`/usr/viewtouch/bin/runonce` (checks whether viewtouch is already running, then runs the vtpos loader if not yet running)

The vtpos loader allows arguments and provides terminal feedback when running ViewTouch. The argument -p allows a choice from multiple data sets in other directories than the default /usr/viewtouch/dat. Available arguments are shown when the -h argument is passed:

`/usr/viewtouch/bin/vtpos -h`

Miscellaneous

/usr/viewtouch directory can hold multiple viewtouch data directories other than the default /usr/viewtouch/dat. To run ViewTouch with different menus than the menu in /usr/viewtouch/dat use this command to launch them:

`/usr/viewtouch/bin/vtpos path /usr/viewtouch/your.directory`

All loadable .css files reside in /usr/viewtouch/css.

Desktop and/or Panel Launchers make running ViewTouch simple when using touchscreens. As noted, vtpos -p /usr/viewtouch/dirname allows any number of alternative directories (i.e., Point of Sale menu filesets) to the default fileset in /usr/viewtouch/dat.

ViewTouch automatically finds the core fonts it requires. These are shown (and are downloadable) at http://viewtouch.com/vt_fonts/

A ViewTouch pdf user manual by Alex Underwood can be found at http://www.viewtouch.com/ViewTouchManual.pdf. This file is also found on the ViewTouch Raspberry Pi image.