Skip to content

Building the Binary

Gene Mosher edited this page Nov 15, 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.

This latest (October 3, 2021) build removes the dependencies on GTK3 which had been added to the loader a few years ago. The removal was done because we can't have dependencies on external packages in ViewTouch if there's no demonstrable benefit to their presence. This build maintains the additions of libcurl4-gnutls-dev and libcurlpp-dev in May, 2021. The entirety of credit and congratulations for this year's code improvements is awarded to to Reinhold G. !

Building:

Note: 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.

Required Packages

  • G++ or Clang
  • xorg-dev
  • xfonts-base
  • libmotif-dev
  • libfreetype6-dev
  • libcurlpp-dev
  • libcurl4-gnutls-dev
  • make
  • cmake
  • git
  • xwit
  • tzdata (date is Howard Hinnant's highly optimized date library. date.h)

The following development libraries are required and are automatically installed with the above packages.

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

A dedicated user (eg. 'viewtouch') who does not have admin privileges is added. User viewtouch is given a secure password and is added to the sudoers file. Adding user viewtouch is helpful when remote access to the POS host is established as this account can be used for SSH.

as root (or preface each command with sudo). # is the root user prompt. $ is viewtouch user prompt.

#useradd viewtouch

#passwd viewtouch

#usermod -aG sudo viewtouch add user viewtouch to the sudoers file.

From an account with sudo privileges, or as root, initialize the directory structure for ViewTouch binary and data files then assign ownership of the directory structure to user viewtouch and set permissions.

#mkdir /usr/viewtouch

#chown -R viewtouch.viewtouch /usr/viewtouch

#chmod -R o+rw /usr/viewtouch

#su viewtouch switch to user viewtouch

$cd /usr/viewtouch && mkdir src bin dat Do not preface with sudo !

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

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

/usr/viewtouch/bin/runonce Run ViewTouch Point of Sale

Subsequent Builds:

Pulling files which have been changed since first cloning:

$cd /usr/viewtouch/src

$git pull

$cd build

$cmake ..

$make

make coffee or tea. Yes, really.

$make install

Download the ViewTouch 'System Pages' graphical file to the ViewTouch binary directory

$cd /usr/viewtouch/bin && curl -O http://www.viewtouch.com/vt_data

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 normally be customized without forking it. A special fork of vt_data allows for hospitality customers to use ViewTouch to enter their food & beverage order instead of relying on hospitality employees to enter their food & beverage order, as has been customary in the past. Contact Gene ([email protected]) for access to this customized vt_data file.

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

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

  • fonts-liberation
  • fonts-liberation2

OK, you've downloaded and compiled the code. The program is running. 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 by someone logging is as 'Editor' and using the 'Edit' operations to create these Pages, populating them with Table Buttons and Menu Item Buttons. The function and usefulness of Menu Item Buttons is enhanced by assigning them a sub-category as Modifier (Descriptor) buttons and Qualifier Buttons. The analogy of nouns, adjectives and adverbs applies to the assignment of identification as various 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 ViewTouch interface is designed to allow ViewTouch Pages and Buttons to mirror the structure of human language. This design makes it possible for the ViewTouch interface to be intuitive to the point where it can be used with little or no training.

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.