grail.longhaul Module

Version: 16.2

Table of Contents

Note

The 64 bit version of this library is disabled. The library will continue to be importable and "startable"; however it will no longer perform any actions in 64 bit. The module licensing that originally inspired this module is not active in 64 bit.

Overview

Longhaul is a method for acquiring a license and have subsequent MineSight® products validate against the longhaul instead of making a validation across the network or to your local dongle.

This is particularly useful if you MineSight® Grail script will spawn other MineSight® products multiple times during the duration of the script. What longhaul provides you with, is the ability to make one license check, and allow all subsequent license checks be against longhaul.

If longhaul fails, or if there is no license available, then the script will still proceed. The idea here is to provide the ability to get faster licensing, but not at the expense of causing a script to fail.

Example Usage

Suppose we have a case were we want to call the sclip.exe many times with different sets of arguments. We don't want the sclip.exe to make an expensive calls to the network, instead we would like to valid the license once, and then proceed to,

from grail import longhaul
longhaul.start()

for runNum in range(manyRuns):
   
clipArgsForRun = MakeClipArgs(runNum)
   
os.system("sclip.exe %s" % (clipArgsForRun))

The above example is simplified in the way it gets its arguments for sclip.exe; however, the basic steps are the same. In the above example, if longhaul.start succeeded, then each time you start sclip.exe program from the os.system function call, the sclip.exe program will succeed with the faster longhaul license check.

Because we didn't supply any arguments to the longhaul.start function, longhaul will use the Preferred License Module Search Order described below.

Notice that you did not need to stop longhaul, since when your script stops, longhaul will stop. However, if you wish to stop lonhaul midway through your script to release a license, you can use the stop function.

Sometimes you may want a script to execute in conditions where MineSight® Grail does not have a longhaul module. One way to make sure your scripts are backwards compatible is by inserting the following statements into your script,

try:
   
from grail import longhaul
   
longhaul.start()
except ImportError, e:
   
pass # no longhaul available

This will give you the faster longhaul license checking if it is available, but still allow your script to execute if longhaul is not available.

Preferred License Module Search Order

longhaul has a preferred search order when it comes to individual license modules. The preferred search order is as follows,

  1. FULL, All programs
  2. MSOPS, MineSight Operations
  3. SURFACE, MS3D Surface (Volumes)
  4. VISUALIZER, MS3D Visualizer Only
  5. UGFULL, Underground Full License
  6. BASICGEOLOGY, Basic Geology Module
  7. BASICENGINEERING, Basic Engineering Module
  8. IM, Industrial Minerals
  9. SURVEY, Survey
  10. EXPLORATION, Exploration
  11. GEOLOGY, Exploration + Geomodeling
  12. UGENGINEERING, Underground Engineering
  13. MSSP, MineSight Strategic Planner
  14. MSEP, MineSight Economic Planner
  15. MSHAULAGE, Haulage
  16. ENGINEERINGOPENPIT, Open Pit mine planning and scheduling
  17. GSMFULL, Full GSM
  18. MSDA, MineSight Data Analyst

Functions

start([modules])

Starts the longhaul process with a request for a module.

The modules can either be omitted, a single module value, or a list specifying license module search order. If the modules argument is omitted, longhaul defaults to a preferred module order discussed above (see Preferred License Module Search Order).

The function will raise a ValueError only if the modules supplied are not valid, or the input is not what is expected.

The function will return 1 if the license was acquired, and 0 otherwise. If the longhaul start did not succeed, it only means that your subsequent license calls in spawned MineSight® Programs may have a chance of failing as well.

stop()
Stops the longhaul process. If this function is not executed it will be executed when the python interpreter closes. This lets you not need to worry about stopping a longhaul license.

Constants

BASICENGINEERING
Basic Engineering Module
BASICGEOLOGY
Basic Geology Module
ENGINEERINGOPENPIT
Open Pit mine planning and scheduling
EXPLORATION
Exploration
FULL
All programs
GSMFULL
Full GSM
GEOLOGY
Exploration + Geomodeling
IM
Industrial Minerals
MSDA
MineSight Data Analyst
MSEP
MineSight Economic Planner
MSHAULAGE
Haulage
MSOPS
MineSight Operations
MSSP
MineSight Strategic Planner
SURFACE
MS3D Surface (Volumes)
SURVEY
Survey
UGENGINEERING
Underground Engineering
UGFULL
Underground Full License
VISUALIZER
MS3D Visualizer Only
GSM_UG
Deprecated, use UGFULL instead.