File_Therion
[ class tree: File_Therion ] [ index: File_Therion ] [ all elements ]

Class: File_Therion_Grade

Source Location: /File_Therion-0.4.1/File/Therion/Grade.php

Class Overview

File_Therion_BasicObject
   |
   --File_Therion_Grade

Class representing a therion grade definition object.


Author(s):

Copyright:

  • 2016 Benedikt Hallinger

Variables

Methods


Inherited Variables

Inherited Methods

Class: File_Therion_BasicObject

File_Therion_BasicObject::addComment()
Add a comment.
File_Therion_BasicObject::getData()
Get some simple data of this object.
File_Therion_BasicObject::getOption()
Get option of this object.
File_Therion_BasicObject::getOptionsString()
Generate basic options string.
File_Therion_BasicObject::handleCommonOption()
Handle known options supported by several objects.
File_Therion_BasicObject::setData()
Set some simple data of this object.
File_Therion_BasicObject::setOption()
Set options of this object.
File_Therion_BasicObject::_verify()
Verify basic compliance of item.

Class Details

[line 34]
Class representing a therion grade definition object.

A grade specification is a named standards deviation set defining standard deviations for a grouped set of measurements. A centreline can refer to one of this defined names to set "sd" settings for several instruments at once while retaining a centralized definition for all "sd"-settings. For applying such a grade-definition, see File_Therion_Centreline::setGrade().



[ Top ]


Class Variables

$_data = array(
        'length'   => null,
        'tape'     => null,
        'bearing'  => null,
        'compass'  => null,
        'gradient' => null,
        'clino'    => null,
        'counter'  => null,
        'depth'    => null,
        'x'        => null,
        'y'        => null,
        'z'        => null,
        'position' => null,
        'easting'  => null,
        'northing' => null,
        'dx'       => null,
        'dy'       => null,
        'dz'       => null,
        'altitude' => null
    )

[line 63]

Basic data elements.

Array contains Unit-objects when defined for this grade

  • Todo: support alias names
  • Access: protected

Type:   array


[ Top ]

$_id =  ""

[line 43]

ID of this grade
  • Access: protected

Type:   string


[ Top ]

$_options = array(
        'title' => ""
    )

[line 50]

options (title, ...).
  • Var: assoc array
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]



Method Detail

__construct (Constructor)   [line 91]

File_Therion_Grade __construct( string $id, [array $options = array()])

Create a new therion Grade object.
  • Access: public

Parameters:

string   $id   —  Name/ID of the grade definition
array   $options   —  associative options array to set

[ Top ]

clearDefinitions   [line 395]

void clearDefinitions( )

Clear all definitions from this grade definition.
  • Access: public

[ Top ]

count   [line 407]

int count( )

Count valid definitions (SPL-Interface)
  • Access: public

[ Top ]

getDefinition   [line 385]

null|File_Therion_Unit getDefinition( string $quantity)

Get the definition of an quantity.
  • Access: public

Parameters:

string   $quantity   —  Definition to return

[ Top ]

getName   [line 102]

string getName( )

Get name (id) of this grade definition.
  • Access: public

[ Top ]

parse   [line 136]

File_Therion_Grade parse( array $lines)

Parses given Therion_Line-objects into internal data structures.
  • Return: Grade object
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

array   $lines   —  File_Therion_Line objects forming a grade definition

[ Top ]

setDefinition   [line 322]

void setDefinition( string|array $quantity, [File_Therion_Unit $unit = null])

Set a definition element of this grade definition.

By using NULL as unit-object you can clear an existing definition. The precision of therion grade definition is the same as for the 'sd' command: 95.44% of readings are within the specified tolerance (2 S.D.)

  1.  // 95.44% of compass readings are within +-1.25 degrees (=2.5 =2 S.D.)
  2.  $grade->setDefinition("bearing"new File_Therion_Unit(1.25"degrees"));
  3.  
  4.  // set length ans position at once:
  5.  $grade->setDefinition(array("length""positioin")new File_Therion_Unit(1.25"meter"));
  6.  
  7.  // set several as assoc array:
  8.  $grade->setDefinition(array(
  9.      "x" => new File_Therion_Unit(1.25"m"),
  10.      "y" => new File_Therion_Unit(1.25"m"),
  11.      "z" => new File_Therion_Unit(1.25"m"),
  12.  ));

  • Todo: implement logical units checking: not all units can be used with "tape" quantity for example
  • Throws: InvalidArgumentException when quantity is not known or not a proper array
  • Throws: File_Therion_SyntaxException when units mismatch occurs (e.g. 'tape' with angle-unit)
  • Access: public

Parameters:

string|array   $quantity   —  What to speicify (string or array of keyword strings)
null|File_Therion_Unit   $unit   —  unit and how much of it (NULL clears existing units)

[ Top ]

setName   [line 115]

void setName( string $id)

Change name (id) of this grade definition.

To set a cleartext title, use setOption('title', "...") instead.

  • Todo: implement parameter checks
  • Access: public

Parameters:

string   $id   — 

[ Top ]

toLines   [line 246]

array toLines( )

Generate line content from this object.
  • Return: File_Therion_Line objects
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:09:45 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.