Table of Contents
Provides access to the MineSight® 3D MineSight® Resource (MSR) files. The goal here is to eventually provide an interface to all the MSR files.
Each MSR file will be represented by a Python Object that provides read/write methods to the internal data.
The MineSight® Resource (MSR) objects in this module differ from the Geometry object in the grail.data.geometry module. The MSR objects within this module all read and write data in real time. In other words once you have opened a MSR object, all subsequent read/write operations are performed immediately. As a contrast Geometry object will read all the data into memory, allow you to perform set/get with data in memory, and then allow you to commit your changes to disk.
Deprecated alias as of v4.50: createlegend
Creates a new Legend object at the path's location. If a file already exists at the path's location, this function will generate a built-in IOError exception [1].
See also Legend below.
Deprecated alias as of v4.50: createlegend
Opens an existing Legend object indicated by the path. See also Legend below.
open_geomview(path)
Opens an existing geomview MSR at the given path. The object can only be accessed in read only mode. This will return a GeomView object (see GeomView) below.
The MSR Objects that provide access to the file contents are all accessiable via the Functions show below,
The Legend class provides read/write access to the contents of a MineSight® Resource (MSR) file.
Defines a file-like object that provides read/write access to a legend MSR file.
Each type (read/write type) of MSR indicates what data is relevant inside the MSR. For example, if the legend type is a legendTYPE_COMPANY, then the values stored under writecompanyimage() is important. However, if the legend type is legendDH_TYPE, then the writedhitem(), writedhdisplay() values become important. This means that even though you may have written values into one section of the Legend MSR, for instance the drillholes, these values will not be effective until you change the type for the Legend MSR.
Note
The Legend object has a handle to the underlying file during all read/write operations. Call close() to explicitly close the Legend object.
close()
Explicitly closes the operating system handle to the MSR file. If you do not call this method, the close() operation will occur when the Legend object is cleaned up by the Python garbage collector [2].
Deprecated alias as of v4.50: readbodyfont.
Returns the type of body font used for this legend.
Deprecated alias as of v4.50: readbodysize
Get the size of the legend body's font size.
Deprecated alias as of v4.50: readcompanyimage
Returns the path to the company image for this legend.
Deprecated alias as of v4.50: readcreatetime
Returns the time in seconds (since Epoch) that the file was created. To get the time in a usable format use Python's time module [3].
An example would be,
import time
from grail.data import msr
leg = msr.createlegend("mylegend.msr")
print time.ctime(leg.readcreatetime())
Deprecated alias as of v4.50: readcutoffdisplay
Returns the cutoff display type used for the legend.
Deprecated alias as of v4.50: readcutoffitem
Returns the cutoff item used for the legend.
Deprecated alias as of v4.50: readcutoffprecision
Returns the cutoff precision used for the legend.
Deprecated alias as of v4.50: readdhdisplay
Returns the type of drillhole display used for the legend.
Deprecated alias as of v4.50: readdhobject
Returns the drillhole object used for the legend.
Deprecated alias as of v4.50: readgeomobject
Returns the type of geometry object used.
Deprecated alias as of v4.50: readmaterial
Returns the material associated with the legend.
Deprecated alias as of v4.50: readmemo
Returns the contents of the memo field for this legend.
Deprecated alias as of v4.50: readmvdisplay
Returns the type of model view display used.
Deprecated alias as of v4.50: readmvobject
Return the name of the model view object used.
Deprecated alias as of v4.50: readtitlefont
Returns the type of title font used for this legend.
Deprecated alias as of v4.50: readtitleline
Returns the contents of a given title line.
Deprecated alias as of v4.50: readtitlesize
Get the font size of the legend's title
Deprecated alias as of v4.50: readtype
Read the type of legend.
Deprecated alias as of v4.50: readunit
Returns the type of units used for this legend.
Deprecated alias as of v4.50: writebodyfont
Set the type of font to use for the legend.
Deprecated alias as of v4.50: writebodysize
Set the size of the legend's body font. This is the size in either centimeters or inches.
Deprecated alias as of v4.50: writecompanyimage
Set the path to the company image you wish to use for the legend. This is only active when the Legend type is set to legendTYPE_COMPANY.
Deprecated alias as of v4.50: writecutoffdisplay
Set the cutoff display type you wish to use. This is only active when the Legend type is set to legendTYPE_CUTOFF.
- Valid display values are,
- legendCUTOFF_DISPLAY_COLOR
- legendCUTOFF_DISPLAY_PATTERN
Deprecated alias as of v4.50: writecutoffitem
Set the cutoff item you wish to use in the legend. This is only active when the Legend type is set to legendTYPE_CUTOFF.
Deprecated alias as of v4.50: writecutoffprecision.
Set the precision you should use for a cutoff value. Precision is indicated in the number of decimal points you wish to use. This is only active when the Legend type is set to legendTYPE_CUTOFF.
Deprecated alias as of v4.50: writedhdisplay.
Set the type of drillhole display you wish to use. This is only active when the Legend type is set to legendTYPE_DH.
Deprecated alias as of v4.50: writedhobject.
Set the drillhole object you wish to use for the legend. This is only active when the Legend type is set to legendTYPE_DH.
Deprecated alias as of v4.50: writegeomobject.
Set the geometry object you wish to display. This is only active when the Legend type is set to legendTYPE_GEOM.
Deprecated alias as of v4.50: writememo.
Set the contents of the memo field for the Legend.
Deprecated alias as of v4.50: writemvdisplay.
Set the type of model view display you wish to use. This is only active when the Legend type is set to legendTYPE_MV.
- Valid type values are,
- legendMV_DISPLAY_2D
- legendMV_DISPLAY_3D
Deprecated alias as of v4.50: writemvobject.
Set the modelview object you wish to display. This is only active when the Legend type is set to legendTYPE_MV.
Deprecated alias as of v4.50: writetitlefont.
Set title font for a legend.
Deprecated alias as of v4.50: writetitleline.
Set the text to use for the given title at a given line number.
Deprecated alias as of v4.50: writetitlesize.
Set the font size for the legend's title. This is the the size in either centimeters or inches.
Deprecated alias as of v4.50: writetype
Write the type of legend.
legendTYPE_COMPANY
legendTYPE_CUTOFF
All other types values will be ignored.
Deprecated alias as of v4.50: writeunit.
Set the type of units to use for the legend.
- Valid units are,
- legendUNIT_METRIC
- legendUNIT_IMPERIAL
Provides read-only access to the geomview MinSight(r) Resource (MSR) file. You can open a new GeomView object via the open_geomview function. To close the file call close, otherwise the file will close when you your object is garbage collected.
read_connection_string()
This is the ODBC connection string used to connect to the AGDM for this GeomView object.
read_query_string()
This is the query that was used to generate the contents of the GeomView object.
legendCUTOFF_DISPLAY_COLOR
legendDH_DISPLAY_2D
legendMV_DISPLAY_2D
legendTYPE_COMPANY
legendTYPE_CUTOFF
legendTYPE_DH
legendTYPE_GEOM
legendUNIT_IMPERIAL
[1] | "Built-in Exceptions" Python Library Reference. 19 December 2001. 31 May 2004. <http://www.python.org/doc/2.2/lib/module-exceptions.html> |
[2] | "gc -- Garbage Collector interface" Python Library Reference. 21 December 2001. 31 May 2004. <http://www.python.org/doc/2.2/lib/module-gc.html> |
[3] | "time -- Time access and conversions" Python Library Reference. 21 December 2001. 31 May 2004. <http://www.python.org/doc/2.2/lib/module-time.html> |