Aspen Touch Solutions ATM-123R Series Specifikace Strana 17

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 374
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 16
Automation 2-3
2-3
2.2 Objects
The key to understanding Automation lies in the concept of
objects. An object is a container that holds a set of related
functions and variables. In Automation terminology, the
functions of an object are called methods and the variables are
called properties.
Consider the example of a car. If it were an object, a car would
have a set of properties such as: make, colour, number of doors,
etc. The car object may also have methods such as: turn on,
drive or open hood. By utilizing the properties and methods of a
car object it is possible to define, manipulate and interact with
the object.
Each property of the car is a variable that has a value associated
with it. The colour would be a string or hexadecimal number
associated with a specific colour. The gas mileage would be
single floating point value. Methods are nothing more than
functions and sub-routines associated with the object.
An object is a container that holds all the attributes associated
with it. An object could contain other objects that are logical
sub-set of the main object. The car object may contain other
objects such as engine or tire. These objects would have their
own set of independent properties and methods. An engine
would have properties related to the number of valves and the
size of the pistons. The tires would have properties such as
Figure 2.1
Object: Car
Properties: Colour, Make, Engine
Methods: Drive, Refuel
Zobrazit stránku 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 ... 373 374

Komentáře k této Příručce

Žádné komentáře