######################################################################
#
# Macro Name    : c:/sce_testing/0_after_19_9_05/blast_tutorial/03a_load_&_tie_pattern1.tcl
#
# Version       : Surpac Vision V5.2-C Beta
#
# Creation Date : Mon Jan 16 13:13:53 2006
#
# Description   : 
#
######################################################################

set status [ SclFunction "EXIT GRAPHICS" {
  frm00108={
    {
      exit_mode="E"
    }
  }
}]

set status [ SclFunction "GEOLOGY DATABASE DISCONNECT" {} ]

set form {
  GuidoForm form_1 {
    -default_buttons
    -label "Exercise 3a - Load and tie in a blast pattern"
    GuidoPanel panel_1 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_1 {
      -label ""
      -height 10
      -width 35
        GuidoTextArea text_1 {
        -format none
        -linewrap true
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
In this exercise we unload a blast pattern from a blast database, create a surface tie in pattern for it, and then load the new information back into the database.

When the macro pauses click in graphics to continue

After having a look at each form, apply it to continue

"
        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "RECALL ANY FILE" {
  file="bench960_950.str"
  mode="openInNewLayer"
}]

set status [ SclFunction "BLAST LOAD FROM DATABASE" {
  frm10010={
    {
      _action=display
      dbname="blast_tutorial.ddb"
    }
  }
  frmBlastLoadFromDatabase={
    {
      _action=display
      pattern="BP1"
    }
  }
}]

set status [ SclFunction "SELECT LAYER" {
  activelayer="blast hole layer"
}]

set status [ SclFunction "ERASE DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      textalignment="<"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]

set status [ SclFunction "ERASE DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      textalignment=">"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]

########### pause here, wait for user response (say enter key), then proceed
puts ""
puts ""
puts ""
puts ""
puts "Click in graphics to continue."
puts ""
puts ""

SclPause

set form {
  GuidoForm form_2 {
    -default_buttons
    -label "Load all holes"
    GuidoPanel panel_2 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_2 {
      -label ""
      -height 4
      -width 25
        GuidoTextArea text_2 {
        -format none
        -linewrap true
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
First charge all holes in the blast pattern, BP1, with ANFO.
"

        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "BLAST CHARGE ALL HOLES" {
  frm01132={
    {
      _action=display
      charging_details=table { depth_to explosive detonator num_of_dets det_position booster num_of_boosters delay } {
        { "1.5" "stemming" null null null null null null }
        { "8" "ANFO 0.8" "Nonel LP" "1" "bottom" "Anzomex G (PG)" "1" "DET 2 (400.00ms)" }
      }
      end_charge_method="adjust charge to hole depth"
      minimum_charge_length="0"
    }
  }
}]

set status [ SclFunction "ERASE DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      textalignment="<"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]


set status [ SclFunction "ERASE DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      textalignment=">"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]


set form {
  GuidoForm form_3 {
    -default_buttons
    -label "Row by Row - Diagonal tie in pattern"
    GuidoPanel panel_3 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_3 {
      -label ""
      -height 5
      -width 30
        GuidoTextArea text_3 {
        -format none
        -linewrap true
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
Next use the \"Generate firing sequence\" menu to create a row by row\\diagonal tie in pattern
"

        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "BLAST GENERATE FIRING SEQUENCE" {
  frm11114={
    {
      _action=display
      template_name="Diagonal-Patter"
      tolerance="0.01"
      output_layer="tie_in"
      use_holes_from="Active layer"
    }
  }
  world_drag={
    {
      objectx="123.619"
      objecty="711.673"
      objectz="960.000"
      dx="4.266"
      dy="2.608"
      dz="0.000"
    }
  }
}]

set status [ SclFunction "ERASE DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      textalignment="<"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]

set status [ SclFunction "ERASE DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      textalignment=">"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]

########### pause here, wait for user response (say enter key), then proceed
puts ""
puts ""
puts ""
puts ""
puts "Click in graphics to continue."
puts ""
puts ""

SclPause

set form {
  GuidoForm form_4 {
    -default_buttons
    -label "Save and load to database"
    GuidoPanel panel_4 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_4 {
      -label ""
      -height 8
      -width 55
        GuidoTextArea text_4 {
        -format none
        -linewrap true
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
Next load the holes back into the blast database.

Note: tick the overwrite option when loading the holes back into the database to replace the original data with the new information.
"

        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}
set status [ SclFunction "BLAST LOAD TO DATABASE" {
  frmBlastLoadToDatabase={
    {
      _action="apply"
    }
  }
  frm10010={
    {
      dbname="blast_tutorial.ddb"
    }
  }
  frm01126={
    {
      _action=display
      duplicate_overwrite="Y"
      load_charging_data="Y"
      charging_table_name="charge"
      load_sample_data="N"
      increment_method="continuous"
      sampling_method="single sample"
      report_file="bp1"
      report_format=".not - Surpac Note File"
    }
  }
  frm00121={
    {
      _action="apply"
    }
  }
}]

set status [ SclFunction "CHECK DATABASE CONNECTED" {} ]

set status [ SclFunction "DRILLHOLE ATTRIBUTES" {
  trace_colour="forest green"
  trace_thickness="1"
  legend_location="no legend"
  table=""
  field=""
  tick_mark_weight="1"
  rescale="true"
  add_constraint="true"
  cylinder_style="no cylinders"
  cylinder_radius="0.000"
  cylinder_maximum="0.0"
  show_collars="true"
  frm00012={
    {
      cons={
        {
          field="blast_pattern"
          operator="="
          value="bp1"
        }
      }
    }
  }
}]

set status [ SclFunction "DRILLHOLE COLLARS" {
  show_collars="true"
  collar_marker="(+)"
  collar_marker_size="0.5"
  position="along path"
  num_rows="0"
}]

set status [ SclFunction "DRILLHOLE GEOLOGY" {
  num_rows="0"
}]

set status [ SclFunction "DRILLHOLE LABELS" {
  tick_length="1.0"
  num_rows="0"
}]

set status [ SclFunction "DRILLHOLE GRAPHS" {
  num_rows="0"
}]

set status [ SclFunction "DRILLHOLE DEPTH MARKERS" {
  position="left"
  offset="5.0"
  decimals="2"
  use_styles="false"
  colour=""
  font_style="Default"
  font_size="1.000"
  font_units="oru"
  alignment="right"
  major="10.0"
  minor="0.0"
  display="false"
  major_length="3.0"
  minor_length="1.0"
}]

set status [ SclFunction "DRILLHOLE APPARENT DIP MARKERS" {
  num_rows="0"
}]

puts ""
puts ""
puts ""
puts ""
puts "Macro 03a_load_&_tie_pattern.tcl completed."
puts ""
puts ""
