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

Class: File_Therion_Station

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

Class Overview


Class representing a therion station object.


Author(s):

Copyright:

  • 2016 Benedikt Hallinger

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 27]
Class representing a therion station object.

The centreline can define stations to fix or alter stations used in shots.



[ Top ]


Class Variables

$_comment =  ""

[line 48]

Comment of this station.
  • Access: protected

Type:   string


[ Top ]

$_equates = array()

[line 97]

Equated stations.
  • Var: of File_Therion_Station objects
  • Access: protected

Type:   array


[ Top ]

$_equatesBL = array()

[line 104]

Equated stations (backlinks).
  • Var: of File_Therion_Station objects
  • Access: protected

Type:   array


[ Top ]

$_fixes = array()

[line 61]

Fix-data for this station.

This links stations to a fixed coordinate on the surface.

Content is an associative array; the keys are 'coords' and 'std':

  • the value of 'coords' is coordinates array(x,y,z)
  • the value of 'std' is standard deviation for the coordinate values

  • Access: protected

Type:   array


[ Top ]

$_flags = array(
        'entrance'           => null,
        'continuation'       => null,
        'air-draught'        => null,
        'air-draught:winter' => null,
        'air-draught:summer' => null,
        'spring'             => null,
        'doline'             => null,
        'dig'                => null,
        'arch'               => null,
        'overhang'           => null,
        'explored'           => null,
        'attr'               => array()// key=>values for custom flags
)

[line 77]

Flags of this station.

NULL values mean that the flag is neither negated nor positively present.

  • Access: protected

Type:   array


[ Top ]

$_name =  ""

[line 34]

Name/ID of this station.
  • Access: protected

Type:   string


[ Top ]

$_prePostfix = array("", "")

[line 41]

Prefix/Postfix of this station
  • Var: [0]=prefix, [1]=postfix
  • Access: protected

Type:   array


[ Top ]

$_survey =  null

[line 68]

Survey context of this station (for name resolution).
  • Access: protected



[ Top ]



Method Detail

__construct (Constructor)   [line 111]

File_Therion_Station __construct( string $station)

Create a new therion station object.
  • Access: public

Parameters:

string   $station   —  Station name (like "1")

[ Top ]

addEquate   [line 688]

void addEquate( array|File_Therion_Station $station)

Add equated station.

This defines that the local station is equal to the passed one. You may also pass an array of Station objects.

A backlink will be established automatically if the equated station already links to this station (the added station will also equate to this station at hand).

  • Access: public

Parameters:

array|File_Therion_Station   $station   — 

[ Top ]

applyStationNames   [line 650]

void applyStationNames( )

Apply prefix/postfix setting permanently.

This will apply the current station-names setting to the name and reset the setting afterwards. The Stations name is then the prefixed/postfixed one with emtpy prefix/postfix setting.

Usually calling getName(true) is the better alternative because it leaves the prefix/postfix and original name intact.

  • Access: public

[ Top ]

clearEquates   [line 754]

void clearEquates( [File_Therion_Station $station = null])

Removes all equated stations.

You may optionally select a station to clear by providing the station object. Other stations will be still equated.

The referenced stations backlink will be cleared automatically.

  • Access: public

Parameters:

File_Therion_Station   $station   —  clear only this link

[ Top ]

clearFix   [line 490]

void clearFix( )

Removes the fix-data for this station.

The method will silently do nothing if there was no fix so far.

  • Access: public

[ Top ]

getAllFlags   [line 385]

array getAllFlags( )

Get all active station flags.

This returns an associative array of all flags that have set values.

  • Access: public

[ Top ]

getComment   [line 189]

string getComment( )

Get comment of this station.
  • Access: public

[ Top ]

getEquates   [line 739]

array getEquates( )

Returns equated stations.
  • Return: of equated File_Therion_Station objects
  • Access: public

[ Top ]

getFix   [line 463]

array getFix( )

Gets the fix-data for this station.

If no such data is associated for this station, an empty array will be returned.

Content is an associative array; the keys are 'coords', 'std' and 'cs':

  • the value of 'coords' is coordinates array(x,y,z), see setFix()
  • the value of 'std' is standard deviation for the coordinate values. if no standards deviation was supplied, NULL values are returned.
The coordinates are relative to a specified coordinate system that will usually get set at the centreline level. Without centreline context linked to a coordinate system, fixing stations is not meaningful. Please also look at the therion and survex manual.

  • Return: like described at $_fixes
  • Access: public

[ Top ]

getFlag   [line 364]

bool|string|array getFlag( string $flag, [boolean $null = false])

Get a station flag.

Custom attribute flags (flag 'attr') are returned as associative array holding the attrs name and value.

When the flag is not set explicitely, false is returned; this can be switched to NULL return with $null param set to true. In this case the return is false only if flag is explicitely negated and null if it is not explicitely set; true otherwise.

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string   $flag   —  name of the flag.
boolean   $null   —  When true, unset flag is returned as null

[ Top ]

getName   [line 158]

string getName( [boolean $applyNames = true])

Get name of this station.

If the station has a set prefix/postfix, this will be applied, unless the $applyNames parameter is set to false.

If the station is a anonymous one (original name is dash or dot), the prefix/postfix will always be ommitted. Please bear in mind that if you manually set a prefix/postfix as part of the stations raw name, you need to handle that yourself!

  • Return: Original or prefixed+postfixed name
  • Access: public

Parameters:

boolean   $applyNames   —  false: return name without applied pre-/postfix

[ Top ]

getStationNames   [line 635]

array: getStationNames( )

Get station-names (pre-/postfix).
  • Return: [0]=prefix, [1]=postfix
  • Access: public

[ Top ]

getSurveyContext   [line 594]

null|File_Therion_Survey getSurveyContext( )

Get survey context of this station.

This returns the survey this station is assumed to be a local part of.

  • Access: public

[ Top ]

isFixed   [line 480]

boolean isFixed( )

Tell if this station has defined fixes.
  • Access: public

[ Top ]

parse   [line 203]

File_Therion_Station parse( string|File_Therion_Line $line)

Parse Therion_Line into station object.
  • Return: object
  • Throws: File_Therion_SyntaxException
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string|File_Therion_Line   $line   —  line to parse

[ Top ]

setComment   [line 175]

void setComment( string $comment)

Set Comment of this station.
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string   $comment   — 

[ Top ]

setFix   [line 425]

void setFix( float $x, float $y, float $z, [float $stdX = null], [float $stdY = null], [float $stdZ = null])

Set fixed surface coordinates for this station.

The coordinates are relative to a specified coordinate system that will usually get set at the centreline level. Without centreline context, fixing stations is not meaningful. Please also look at the therion manual.

Latitude and longtitude in format nn°nn'nn.nn" is autoconverted to therions format (nn:nn:nn.nn). getFix() will return strings instead of floats then!

  • Access: public

Parameters:

float   $x   —  X value of coordinate (Rechtswert in Gauss-Krueger)
float   $y   —  Y value of coordinate (Hochwert in Gauss-Krueger)
float   $z   —  Z (height) value of coordinate (usually Meters above sea level)
float   $stdX   —  standard deviation for X
float   $stdY   —  standard deviation for Y
float   $stdZ   —  standard deviation for Z

[ Top ]

setFlag   [line 314]

void setFlag( string $flag, [boolean|string|array $value = true])

Set station flag.

The flag value is expected as following:

  • normal flags: TRUE or FALSE
  • flag 'explored': the value is expected to be string (eg "100m" or so)
  • flag 'attr': cutsom flag; value is array(customflag => value)

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string   $flag   —  name of the flag.
boolean|string|array   $value   —  Flag value to set

[ Top ]

setName   [line 126]

void setName( string $name)

Set Name/ID of this station.

Station name is a therion keyword and as such may only contain alphanumeric characters and additionally ‘_’ and ‘-’.

  • Todo: The syntax check for station name is probably stronger than necessary; Survex manual is a little unclear here.
  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string   $name   — 

[ Top ]

setStationNames   [line 612]

void setStationNames( string $prefix, string $postfix)

Set prefix/postfix of this station.

This is usually set automatically in centreline context. You can use this to adjust station prefix/postfix after updates from the centreline or to have such data without context.

When null is supplied, the setting will be left untouched.

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

string   $prefix   — 
string   $postfix   — 

[ Top ]

setSurveyContext   [line 582]

void setSurveyContext( [File_Therion_Survey $survey = null])

Set local survey context of this station.

This is important for name resolution because there may be more stations named the same in several subsurveys.

The context of the station will be automatically set when the station is added to a shot which is part of a centreline.

  • Throws: InvalidArgumentException
  • Access: public

Parameters:

File_Therion_Survey|null   $survey   —  Use null to reset context

[ Top ]

stripStationNames   [line 667]

void stripStationNames( )

Strip prefix/postfix setting from name.

This will remove the currently set station-names from the name The Stations name is then the non-prefixed/postfixed one with untouched prefix/postfix setting.

  • Access: public

[ Top ]

toEquateString   [line 826]

string toEquateString( [File_Therion_Survey $viewCTX = null])

Return equate command as string.

This creates an "equate"-command string with station references as viewed from the stations local context.

When no stations are equated, an empty string is returned. Otherwise the command "equate" followed by station string references will be returned.

Stations whose reference cannot be resolved will be silently suppressed.

If an alternative survey context is provided, this will be used instead of the stations context. Be aware that this may yield strange results, and be sure to pass parent surveys of the local context.

  • Return: empty string or equate command
  • Throws: UnexpectedValueException when view-context is not available
  • Access: public

Parameters:

File_Therion_Survey   $viewCTX   —  alternative context

[ Top ]

toFixString   [line 501]

string toFixString( )

Generate "fix ..." string for this station.
  • Return: Empty, if no fix is set
  • Access: public

[ Top ]

toStationString   [line 546]

string toStationString( )

Generate "station ..." string for this station.
  • Return: "station <station> <comment> <flags>"
  • 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.