Overview | Index by: file name | procedure name | procedure call | annotation

common.tcl Annotations

Created from common.tcl
common.tcl - this file contains common instrument independent functions

Ulyxes - an open source project to drive total stations and publish observation results

GPL v2.0 license

Copyright (C) 2010-2012 Zoltan Siki

Version:
1.0
Author:
Zoltan Siki
Daniel Moka (TclDoc comments)

Procedure Summary
::Bearing { ea na eb nb }

Bearing function: Calculate whole circle bearing counter clockwise from north

::Beep { repeat }

Beep the pc speaker

::ChangeAngle { angle {in DMS} {out RAD} }

Conversion function: Universal angle conversion function

::Deg2Rad { deg }

Conversion function: Convert sexagesimal angle to radian

::DelVal { codes buf }

List handling function: Delete sublist from list

::DisplayAngles { anglist {unit DMS} }

Instrument handling (instrument type independent functions): Display angles on standard output

::Distance { ea na eb nb }

Distance function: Calculate 2D distance between two points

::DM2Rad { dm }

Conversion function: Convert angle from DM (NMEA format) to radian

::DMS { val }

Conversion function: Convert radian to DMS (sexagesimal)

::DMS2Rad { dms }

Conversion function: Convert angle from DMS (sexagesimal) to radian

::GetFace { }

Instrument handling (instrument type independent functions): Get Face info from instrument

::GetVal { codes buf }

List handling function: Get value from list of lists like {{code1 value1} {code2 value2} ...}

::Gon2Rad { angle }

Conversion function: Convert angle from gon to radian

::Line2D { e1 n1 e2 n2 }

Line2D calculates the equation of a line going through two points a * e + b * n + c = 0

::LinePointDist { a b c e n }

LinePointDist calculates distance between a point and a line

::LoadCoo { fn }

Load GeoEasy coordinate file into global array coo WARNING previous content of coo array lost! Returned error codes: -1: cannot open file positive value: line number with error

::LoadGeo { fn }

Load GeoEasy fieldbook (.geo file) into memory array geo WARNING previous content of geo array lost! Returned error codes: -1: cannot open file positive value: line number with error

::MoveRel { hz_rel v_rel {units RAD} {atr 0} }

Instrument handling (instrument type independent functions): Rotate instrument relative to the actual position

::Rad2Deg { angle }

Conversion function: Convert radian to sexagesimal into pseudo dms (ddd.mmss) format

::Rad2Gon { angle }

Conversion function: Convert angle from radian to gon

::Rad2Sec { rad }

Conversion function: Convert angle from radian to seconds (ss)

Procedure Detail

::Bearing

proc  ::Bearing { ea na eb nb }
Bearing function: Calculate whole circle bearing counter clockwise from north
Parameters:
ea,na - coordinates of station
eb,nb - coordinates of reference point
Returns:
bearing in radian
Defined in:
common.tcl, line 351

::Beep

proc  ::Beep { repeat }
Beep the pc speaker
Parameters:
repeat - number of short beeps
Defined in:
common.tcl, line 398

::ChangeAngle

proc  ::ChangeAngle { angle {in DMS} {out RAD} }
Conversion function: Universal angle conversion function
Parameters:
angle - the angle to convert
in - actual unit of angle (DMS/DEG/RAD/GON)
out - target unit for result (DMS/DEG/RAD/GON)
Returns:
angle in out unit
Defined in:
common.tcl, line 146

::Deg2Rad

proc  ::Deg2Rad { deg }
Conversion function: Convert sexagesimal angle to radian
Parameters:
angle - in pseudo dms format (ddd.mmss)
Returns:
angle in radians
Defined in:
common.tcl, line 17

::DelVal

proc  ::DelVal { codes buf }
List handling function: Delete sublist from list
Parameters:
codes - list of codes to remove from buf
buf - list of pair of elements like {{code1 value1} {code2 value2} ...}
Returns:
the list without codes
Defined in:
common.tcl, line 184

::DisplayAngles

proc  ::DisplayAngles { anglist {unit DMS} }
Instrument handling (instrument type independent functions): Display angles on standard output
Parameters:
anglist - code list with angle values in radian {{7 hz} {8 v} ...}
unit - for output
Defined in:
common.tcl, line 233

::Distance

proc  ::Distance { ea na eb nb }
Distance function: Calculate 2D distance between two points
Parameters:
ea,na - coordinates of station
eb,nb - coordinates of reference point
Returns:
bearing in radian
Defined in:
common.tcl, line 366

::DM2Rad

proc  ::DM2Rad { dm }
Conversion function: Convert angle from DM (NMEA format) to radian
Parameters:
angle - in DM (degmin.nnnn) to convert into radian
Returns:
angle in radian
Defined in:
common.tcl, line 109

::DMS

proc  ::DMS { val }
Conversion function: Convert radian to DMS (sexagesimal)
Parameters:
val - angle in radian
Returns:
angle in ddd-mm-ss format
Defined in:
common.tcl, line 127

::DMS2Rad

proc  ::DMS2Rad { dms }
Conversion function: Convert angle from DMS (sexagesimal) to radian
Parameters:
angle - in DMS (deg-min-sec) to convert into radian
Returns:
angle in radian or empty string if invalid value got
Defined in:
common.tcl, line 75

::GetFace

proc  ::GetFace {  }
Instrument handling (instrument type independent functions): Get Face info from instrument
Returns:
faceinfo 0/1/2 error/first face/second face
Defined in:
common.tcl, line 220

::GetVal

proc  ::GetVal { codes buf }
List handling function: Get value from list of lists like {{code1 value1} {code2 value2} ...}
Parameters:
codes - list of codes to look for in buf
buf - list of pair of elements like {{code1 value1} {code2 value2} ...}
Returns:
value which belongs to the first code from codes found in buf or empty string if none of the codes found.
Defined in:
common.tcl, line 169

::Gon2Rad

proc  ::Gon2Rad { angle }
Conversion function: Convert angle from gon to radian
Parameters:
angle - value in gon
Returns:
angle in radian
Defined in:
common.tcl, line 45

::Line2D

proc  ::Line2D { e1 n1 e2 n2 }
Line2D calculates the equation of a line going through two points a * e + b * n + c = 0
Parameters:
e1,n1 - easting and northing coordinates of startpoint
e2,n2 - easting and northing coordiates of endpoint
Returns:
list of line coefficients {a b c}
Defined in:
common.tcl, line 375

::LinePointDist

proc  ::LinePointDist { a b c e n }
LinePointDist calculates distance between a point and a line
Parameters:
a,b,c - coefficients of the equation of the line
e,n - easting and northing coordinates of point
Returns:
distance
Defined in:
common.tcl, line 386

::LoadCoo

proc  ::LoadCoo { fn }
Load GeoEasy coordinate file into global array coo
WARNING previous content of coo array lost!

Returned error codes:

Parameters:
fn - input file name
Returns:
0 on success or nonzero error code
Defined in:
common.tcl, line 246

::LoadGeo

proc  ::LoadGeo { fn }
Load GeoEasy fieldbook (.geo file) into memory array geo
WARNING previous content of geo array lost!

Returned error codes:

Parameters:
fn - file name of GeoEasy data set
Returns:
0 on success or nonzero error code
Defined in:
common.tcl, line 294

::MoveRel

proc  ::MoveRel { hz_rel v_rel {units RAD} {atr 0} }
Instrument handling (instrument type independent functions): Rotate instrument relative to the actual position
Parameters:
hz_rel - relative horizontal movement, + to right, - to left
v_rel - relative vertical movement, + to down, - to up
units - input angle unit (RAD/DMS/DEG/GON), optional
atr - 0/1 move without ATR/move with ATR, optional
Returns:
return 0 or error code
Defined in:
common.tcl, line 201

::Rad2Deg

proc  ::Rad2Deg { angle }
Conversion function: Convert radian to sexagesimal into pseudo dms (ddd.mmss) format
Parameters:
angle - value in radian
Returns:
angle in pseudo DMS
Defined in:
common.tcl, line 30

::Rad2Gon

proc  ::Rad2Gon { angle }
Conversion function: Convert angle from radian to gon
Parameters:
angle - angle value in radian
Returns:
angle in gon
Defined in:
common.tcl, line 55

::Rad2Sec

proc  ::Rad2Sec { rad }
Conversion function: Convert angle from radian to seconds (ss)
Parameters:
angle - angle value in radian
Returns:
angle in second
Defined in:
common.tcl, line 65

file name | procedure name | procedure call | annotation
File generated 2014-04-15 at 20:21.