Initial commit
This commit is contained in:
146
tool/ascii/assembly_ascii.def
Normal file
146
tool/ascii/assembly_ascii.def
Normal file
@@ -0,0 +1,146 @@
|
||||
################################################################################
|
||||
# This is the definition file for tool assembly with an ASCII File as the
|
||||
# database
|
||||
#
|
||||
#=======================================================================
|
||||
#
|
||||
|
||||
DB_PREFIX "DB("
|
||||
DB_SUFFIX ")"
|
||||
ESS_PREFIX "ESS("
|
||||
ESS_SUFFIX ")"
|
||||
|
||||
#############################################################################
|
||||
# The list of DB_ALIAS
|
||||
#
|
||||
# All the <alias> defined here can be used in the class description at the end
|
||||
# of this file in order to define the fields that should appear in
|
||||
# the search criteria and search result dialogs within UG for every class.
|
||||
#
|
||||
# DB_ALIAS <alias>
|
||||
# {
|
||||
# DB_ID < Attribute Identifier defined in the ASCII Data File >
|
||||
# DB_ID_TYPE < Type of the identifier >
|
||||
# d _ double
|
||||
# i _ integer
|
||||
# s _ string
|
||||
# OPTIONS "opt1" "opt2 " "opt3"
|
||||
# OPTIONS_IDS "val1" "val2" "val3"
|
||||
# DIALOG_NAME "label in search criteria dialog"
|
||||
# RSET_NAME "label in search result dialog"
|
||||
# }
|
||||
#
|
||||
# OPTIONS and OPTIONS_IDS can be ommitted, If they are specified
|
||||
# then a corresponding option menu is created in the Search Criteria Dialog
|
||||
# instead of a simple search field.
|
||||
#############################################################################
|
||||
|
||||
# The DB_ALIAS of the library reference. It is mandatory that this DB_ALIAS
|
||||
# appears in the alias list
|
||||
#
|
||||
DB_ALIAS libref
|
||||
{
|
||||
DB_ID LIBRF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Libref"
|
||||
RSET_NAME "Libref"
|
||||
}
|
||||
|
||||
DB_ALIAS Description
|
||||
{
|
||||
DB_ID DESCR
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Description"
|
||||
RSET_NAME "Description"
|
||||
}
|
||||
|
||||
DB_ALIAS Toolref
|
||||
{
|
||||
DB_ID TOOLREF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Tool Reference"
|
||||
RSET_NAME "Tool Reference"
|
||||
}
|
||||
|
||||
DB_ALIAS ToolType
|
||||
{
|
||||
DB_ID TOOLT
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Tool Type"
|
||||
RSET_NAME "Tool Type"
|
||||
}
|
||||
|
||||
DB_ALIAS ToolSubtype
|
||||
{
|
||||
DB_ID TOOLST
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Tool Subtype"
|
||||
RSET_NAME "Tool Subtype"
|
||||
}
|
||||
|
||||
DB_ALIAS HolderRef
|
||||
{
|
||||
DB_ID HOLDREF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Holder Reference"
|
||||
RSET_NAME "Holder Reference"
|
||||
}
|
||||
|
||||
DB_ALIAS ShankRef
|
||||
{
|
||||
DB_ID SHANKREF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Shank Reference"
|
||||
RSET_NAME "Shank Reference"
|
||||
}
|
||||
|
||||
DB_ALIAS ZMount
|
||||
{
|
||||
DB_ID ZMOUNT
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(Z) ZMount"
|
||||
RSET_NAME "(Z) ZMount"
|
||||
}
|
||||
|
||||
DB_ALIAS ToolNum
|
||||
{
|
||||
DB_ID TLNUM
|
||||
DB_ID_TYPE i
|
||||
DIALOG_NAME "Tool Number"
|
||||
RSET_NAME "Tool Number"
|
||||
}
|
||||
|
||||
DB_ALIAS AdjReg
|
||||
{
|
||||
DB_ID ADJREG
|
||||
DB_ID_TYPE i
|
||||
DIALOG_NAME "Adjust Register"
|
||||
RSET_NAME "Adjust Register"
|
||||
}
|
||||
|
||||
DB_ALIAS CutcomReg
|
||||
{
|
||||
DB_ID CUTCOMREG
|
||||
DB_ID_TYPE i
|
||||
DIALOG_NAME "Cutcom Register"
|
||||
RSET_NAME "Cutcom Register"
|
||||
}
|
||||
|
||||
###################################################################
|
||||
#################################################################
|
||||
|
||||
|
||||
LIBREF libref
|
||||
|
||||
|
||||
#########################################################################
|
||||
# The Class Hierarchy #
|
||||
#########################################################################
|
||||
|
||||
CLASS ASSEMBLY
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(libref)] != [0]"
|
||||
DIALOG libref Description Toolref ToolType ToolSubtype HolderRef ShankRef ZMount ToolNum AdjReg CutcomReg
|
||||
RSET libref Description Toolref ToolType ToolSubtype HolderRef ShankRef ZMount ToolNum AdjReg CutcomReg
|
||||
}
|
||||
1124
tool/ascii/assembly_ascii.tcl
Normal file
1124
tool/ascii/assembly_ascii.tcl
Normal file
File diff suppressed because it is too large
Load Diff
2394
tool/ascii/dbc_tool_ascii.def
Normal file
2394
tool/ascii/dbc_tool_ascii.def
Normal file
File diff suppressed because it is too large
Load Diff
2711
tool/ascii/dbc_tool_ascii.tcl
Normal file
2711
tool/ascii/dbc_tool_ascii.tcl
Normal file
File diff suppressed because it is too large
Load Diff
1174
tool/ascii/dbc_tool_ascii_export.tcl
Normal file
1174
tool/ascii/dbc_tool_ascii_export.tcl
Normal file
File diff suppressed because it is too large
Load Diff
2528
tool/ascii/dbc_tool_ascii_full_rset.def
Normal file
2528
tool/ascii/dbc_tool_ascii_full_rset.def
Normal file
File diff suppressed because it is too large
Load Diff
4675
tool/ascii/dbc_tool_build_ascii.tcl
Normal file
4675
tool/ascii/dbc_tool_build_ascii.tcl
Normal file
File diff suppressed because it is too large
Load Diff
196
tool/ascii/dbc_tool_ud_data_sample.tcl
Normal file
196
tool/ascii/dbc_tool_ud_data_sample.tcl
Normal file
@@ -0,0 +1,196 @@
|
||||
###############################################################################
|
||||
# dbc_tool_ud_data_sample.tcl - Sample to add user defined tool parameters
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# REVISIONS
|
||||
# Date Who Reason
|
||||
# 27-jan-2014 Gopal Srinath & Mark Rief Initial
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# This is a sample of dbc_tool_ud_data.tcl.
|
||||
# To demonstrate, rename this file to dbc_tool_ud_data.tcl and retrieve a mill tool.
|
||||
#
|
||||
# This is called from dbc_tool_ascii.tcl, and if found, will add user defined
|
||||
# tool parameters to a tool during retrieval from the library.
|
||||
#
|
||||
# This sample will add one user parameter for each type available; and add
|
||||
# two user parameters based on tool library fields, if they exist.
|
||||
#
|
||||
# To see the parameters when editing the tool, the customizable item "user parameters"
|
||||
# must be added to the tool dialog. To do this for all retrieved tools, add it
|
||||
# to the tool dialogs in the library_dialogs template parts.
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
|
||||
#######
|
||||
# Procedure to initialize the variables for parameters of all types except Option ("o") type
|
||||
# This procedure will also increment the number of parameters
|
||||
######
|
||||
proc SetParameter { name pType value label } {
|
||||
global dbc_ud_num_parameters
|
||||
global dbc_ud_param_name
|
||||
global dbc_ud_param_type
|
||||
global dbc_ud_param_value
|
||||
global dbc_ud_param_label
|
||||
global dbc_ud_grouping_label
|
||||
|
||||
set parameterIndex $dbc_ud_num_parameters
|
||||
set dbc_ud_param_name($parameterIndex) $name ;# Name used for mom variable
|
||||
set dbc_ud_param_type($parameterIndex) $pType ;# String
|
||||
set dbc_ud_param_value($parameterIndex) $value
|
||||
set dbc_ud_param_label($parameterIndex) $label ;# Dialog Label
|
||||
set dbc_ud_num_parameters [expr $dbc_ud_num_parameters + 1]
|
||||
}
|
||||
|
||||
#######
|
||||
# Procedure to initialize the variables for parameters of the Option("o") type
|
||||
# This procedure will also increment the number of parameters
|
||||
######
|
||||
proc SetOptionParameter { name value values label } {
|
||||
global dbc_ud_num_parameters
|
||||
global dbc_ud_param_option_count
|
||||
global dbc_ud_param_options
|
||||
|
||||
set parameterIndex $dbc_ud_num_parameters
|
||||
set numOptions [llength $values]
|
||||
set dbc_ud_param_option_count($parameterIndex) $numOptions
|
||||
for {set indx 0} {$indx < $numOptions} {incr indx} \
|
||||
{
|
||||
set dbc_ud_param_options($parameterIndex,$indx) [lindex $values $indx]
|
||||
}
|
||||
SetParameter $name "o" $value $label
|
||||
}
|
||||
|
||||
##############################################
|
||||
# This procedure will read the data for the libref and find the
|
||||
# value for a given attribute id (the name of the column)
|
||||
# The last argument to this procedure will indicate if the attribute id
|
||||
# was found or not
|
||||
#
|
||||
# The possible values for this indicator are
|
||||
# 0 - The attribute was not found
|
||||
# 1 - Attribute was found but the value is "" in the database and so the return value will be set to
|
||||
# the input default value
|
||||
# 2 - Attribute found and has a value
|
||||
#################################################
|
||||
|
||||
proc AskAttVal { attId dbRow outputFormat defaultValue flagRef } {
|
||||
upvar $flagRef flag
|
||||
global asc_database
|
||||
|
||||
set cret [catch {set retValue $asc_database($dbRow,$attId)}]
|
||||
if { $cret } \
|
||||
{
|
||||
set retValue $defaultValue
|
||||
set flag 0
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set retValue [string trim $retValue]
|
||||
if { $retValue == "" } \
|
||||
{
|
||||
set retValue $defaultValue
|
||||
set flag 1
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set flag 2
|
||||
}
|
||||
}
|
||||
if { $outputFormat != "" } {set retValue [format $outputFormat $retValue] }
|
||||
return $retValue
|
||||
}
|
||||
|
||||
###############################################################
|
||||
# This procedure will read the data array or the data file for the entry
|
||||
# of the libref and return the row with the data
|
||||
############################################################
|
||||
proc FindEntry { } {
|
||||
global asc_file_loaded
|
||||
global dbc_libref
|
||||
|
||||
# This section is reading
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
return $db_row
|
||||
}
|
||||
|
||||
|
||||
####################################################
|
||||
# The procedure that adds User Defined Parameters
|
||||
####################################################
|
||||
proc DBC_ud_data {} {
|
||||
global dbc_ud_num_parameters
|
||||
global dbc_ud_param_name
|
||||
global dbc_ud_param_type
|
||||
global dbc_ud_param_value
|
||||
global dbc_ud_param_option_count
|
||||
global dbc_ud_param_options
|
||||
global dbc_ud_param_label
|
||||
global dbc_ud_grouping_label
|
||||
|
||||
# Initialize number of parameters
|
||||
set dbc_ud_num_parameters 0
|
||||
|
||||
# Label for the UI group
|
||||
set dbc_ud_grouping_label "User Tool Parameters" ;
|
||||
|
||||
# Define some sample parameters directly
|
||||
|
||||
# Define integer parameter
|
||||
SetParameter "sample_int" "i" -1 "Sample Integer"
|
||||
|
||||
# Define double parameter
|
||||
SetParameter "sample_dbl" "d" -1 "Sample Double"
|
||||
|
||||
# Define boolean parameter
|
||||
SetParameter "sample_bool" "b" "True" "Sample Toggle (Boolean)"
|
||||
|
||||
# Define string parameter
|
||||
SetParameter "sample_str" "s" "default text" "Sample Text (String)"
|
||||
|
||||
# Define option list parameter
|
||||
set values { "Yes" "No" "Maybe" }
|
||||
set value [lindex $values 0]
|
||||
SetOptionParameter "sample_opt" $value $values "Sample Option List"
|
||||
|
||||
# Define some sample parameters based on tool database fields
|
||||
|
||||
# Read the database to find the data of the libref
|
||||
set dbRow [FindEntry]
|
||||
|
||||
#####
|
||||
# The following is an example of reading 2 Attributes from the database
|
||||
# and then deciding if a parameter has to be added. In order to see the different behavior
|
||||
# retrieve tools from the following classes
|
||||
#
|
||||
# Tool->Milling->End Mill - TAPA and TIPA are both valid and so there will be 2 additional
|
||||
# Tool->Milling->Ball Mill - TAPA is valid so only 1 additional parameter
|
||||
# Tool->Milling->Mill Form Tool - Both TAPA and TIPA are not valid so no additional parameters
|
||||
#
|
||||
######
|
||||
# Search for an Attribute TAPA (Taper Angle) for the OOTB database
|
||||
set angle [AskAttVal TAPA $dbRow "%g" 0 flag]
|
||||
# If this attribute exists for the tool selected then take the value and convert it to degrees
|
||||
# and add a parameter called TAPA
|
||||
if { $flag == 1 || $flag == 2 } {
|
||||
UGLIB_convert_deg_to_rad $angle
|
||||
SetParameter "TAPA" "d" $angle "Taper Angle (Library TAPA)"
|
||||
}
|
||||
# Search for an Attribute TIPA (Tip Angle) for the OOTB database
|
||||
set angle [AskAttVal TIPA $dbRow "%g" 0 flag]
|
||||
# If this attribute exists for the tool selected then take the value and convert it to degrees
|
||||
# and add a parameter called TIPA
|
||||
if { $flag == 1 || $flag == 2 } {
|
||||
UGLIB_convert_deg_to_rad $angle
|
||||
SetParameter "TIPA" "d" $angle "Tip Angle (Library TIPA)"
|
||||
}
|
||||
}
|
||||
688
tool/ascii/holder_ascii.def
Normal file
688
tool/ascii/holder_ascii.def
Normal file
@@ -0,0 +1,688 @@
|
||||
################################################################################
|
||||
# This is the definition file for tool holders with an ASCII File as the
|
||||
# database
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
DB_PREFIX "DB("
|
||||
DB_SUFFIX ")"
|
||||
ESS_PREFIX "ESS("
|
||||
ESS_SUFFIX ")"
|
||||
|
||||
|
||||
#############################################################################
|
||||
# The list of DB_ALIAS
|
||||
#
|
||||
# All the <alias> defined here can be used in the class description at the end
|
||||
# of this file in order to define the fields that should appear in
|
||||
# the search criteria and search result dialogs within UG for every class.
|
||||
#
|
||||
# DB_ALIAS <alias>
|
||||
# {
|
||||
# DB_ID < Attribute Identifier defined in the ASCII Data File >
|
||||
# DB_ID_TYPE < Type of the identifier >
|
||||
# d _ double
|
||||
# i _ integer
|
||||
# s _ string
|
||||
# OPTIONS "opt1" "opt2 " "opt3"
|
||||
# OPTIONS_IDS "val1" "val2" "val3"
|
||||
# DIALOG_NAME "label in search criteria dialog"
|
||||
# RSET_NAME "label in search result dialog"
|
||||
# }
|
||||
#
|
||||
# OPTIONS and OPTIONS_IDS can be ommitted, If they are specified
|
||||
# then a corresponding option menu is created in the Search Criteria Dialog
|
||||
# instead of a simple search field.
|
||||
#############################################################################
|
||||
|
||||
# The DB_ALIAS of the library reference. It is mandatory that this DB_ALIAS
|
||||
# appears in the alias list
|
||||
#
|
||||
DB_ALIAS libref
|
||||
{
|
||||
DB_ID LIBRF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Libref"
|
||||
RSET_NAME "Libref"
|
||||
}
|
||||
|
||||
DB_ALIAS RecType
|
||||
{
|
||||
DB_ID RTYPE
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
##################################################################
|
||||
|
||||
DB_ALIAS Type
|
||||
{
|
||||
DB_ID HTYPE
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS SubType
|
||||
{
|
||||
DB_ID STYPE
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS N_Sections
|
||||
{
|
||||
DB_ID SNUM
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Max_offset
|
||||
{
|
||||
DB_ID MAXOFF
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Min_diameter
|
||||
{
|
||||
DB_ID MINDIA
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Max_diameter
|
||||
{
|
||||
DB_ID MAXDIA
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Description
|
||||
{
|
||||
DB_ID DESCR
|
||||
DB_ID_TYPE s
|
||||
}
|
||||
|
||||
DB_ALIAS MountingStyle
|
||||
{
|
||||
DB_ID MTS
|
||||
DB_ID_TYPE s
|
||||
OPTIONS "none" "BT30" "BT40" "BT50" "CAT30" "CAT40" "CAT50" "CAT60" "HSK_32A" "HSK_40A" "HSK_50A" "HSK_63A" "HSK_80A" "HSK_100A" "HSK_125A" "HSK_160A" "HSK_25E" "HSK_32E" "HSK_40E" "HSK_50E" "HSK_63E" "SK30" "SK40" "SK50"
|
||||
OPTIONS_IDS "none" "BT30" "BT40" "BT50" "CAT30" "CAT40" "CAT50" "CAT60" "HSK_32A" "HSK_40A" "HSK_50A" "HSK_63A" "HSK_80A" "HSK_100A" "HSK_125A" "HSK_160A" "HSK_25E" "HSK_32E" "HSK_40E" "HSK_50E" "HSK_63E" "SK30" "SK40" "SK50"
|
||||
DIALOG_NAME "Mounting Style"
|
||||
RSET_NAME "Mounting Style"
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
|
||||
DB_ALIAS Seq_no
|
||||
{
|
||||
DB_ID SEQ
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
|
||||
DB_ALIAS Diameter
|
||||
{
|
||||
DB_ID DIAM
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(D) Diameter "
|
||||
RSET_NAME "(D) Diameter "
|
||||
}
|
||||
|
||||
DB_ALIAS Height
|
||||
{
|
||||
DB_ID LENGTH
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(L) Height"
|
||||
RSET_NAME "(L) Height"
|
||||
}
|
||||
|
||||
DB_ALIAS TaperAngle
|
||||
{
|
||||
DB_ID TAPER
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(B) Taper Angle"
|
||||
RSET_NAME "(B) Taper Angle"
|
||||
}
|
||||
|
||||
DB_ALIAS CornerRadius
|
||||
{
|
||||
DB_ID CRAD
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(R1) Corner Radius"
|
||||
RSET_NAME "(R1) Corner Radius"
|
||||
}
|
||||
|
||||
# for standard turning tool holder
|
||||
DB_ALIAS HolderStyle
|
||||
{
|
||||
DB_ID HSTYLE
|
||||
DB_ID_TYPE s
|
||||
OPTIONS "All" "A-Style" "B-Style" "C-Style" "D-Style" "E-Style" "F-Style" "G-Style" "H-Style" "I-Style" "J-Style" "K-Style" "L-Style" "M-Style" "N-Style" "O-Style" "P-Style" "Q-Style" "R-Style" "S-Style" "T-Style" "U-Style" "V-Style" "UD-Style"
|
||||
OPTIONS_IDS "%" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22"
|
||||
DIALOG_NAME "Holder Style"
|
||||
RSET_NAME "Holder Style"
|
||||
}
|
||||
|
||||
DB_ALIAS HolderHand
|
||||
{
|
||||
DB_ID HHAND
|
||||
DB_ID_TYPE s
|
||||
OPTIONS "All" "Hand-Left" "Hand-Neutral" "Hand-Right"
|
||||
OPTIONS_IDS "%" "0" "1" "2"
|
||||
DIALOG_NAME "Holder Hand"
|
||||
RSET_NAME "Holder Hand"
|
||||
}
|
||||
|
||||
DB_ALIAS HolderLength
|
||||
{
|
||||
DB_ID HLENGTH
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(L) Holder Length"
|
||||
RSET_NAME "(L) Holder Length"
|
||||
}
|
||||
|
||||
DB_ALIAS HolderWidth
|
||||
{
|
||||
DB_ID HWIDTH
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(W) Holder Width"
|
||||
RSET_NAME "(W) Holder Width"
|
||||
}
|
||||
|
||||
DB_ALIAS ShankType
|
||||
{
|
||||
DB_ID SHANKT
|
||||
DB_ID_TYPE s
|
||||
OPTIONS "All" "Square-Shank" "Round-Shank"
|
||||
OPTIONS_IDS "%" "0" "1"
|
||||
DIALOG_NAME "Shank Type"
|
||||
RSET_NAME "Shank Type"
|
||||
}
|
||||
|
||||
DB_ALIAS ShankWidth
|
||||
{
|
||||
DB_ID SHANKW
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(SW) Shank Width"
|
||||
RSET_NAME "(SW) Shank Width"
|
||||
}
|
||||
|
||||
DB_ALIAS ShankLine
|
||||
{
|
||||
DB_ID SHANKL
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(SL) Shank Line"
|
||||
RSET_NAME "(SL) Shank Line"
|
||||
}
|
||||
|
||||
DB_ALIAS HolderAngle
|
||||
{
|
||||
DB_ID HANGLE
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(HA) Holder Angle"
|
||||
RSET_NAME "(HA) Holder Angle"
|
||||
}
|
||||
|
||||
DB_ALIAS ShankHeight
|
||||
{
|
||||
DB_ID SHANKH
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(SH) Shank Height"
|
||||
RSET_NAME "(SH) Shank Height"
|
||||
}
|
||||
|
||||
DB_ALIAS ShankDefinitionMode
|
||||
{
|
||||
DB_ID SDEFMODE
|
||||
DB_ID_TYPE s
|
||||
OPTIONS "All" "Insert And Holder" "Cutting Edge Angle"
|
||||
OPTIONS_IDS "%" "0" "1"
|
||||
DIALOG_NAME "Shank Definition Mode"
|
||||
RSET_NAME "Shank Definition Mode"
|
||||
}
|
||||
|
||||
DB_ALIAS CuttingEdgeAngle
|
||||
{
|
||||
DB_ID CEA
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(CEA) Cutting Edge Angle"
|
||||
RSET_NAME "(CEA) Cutting Edge Angle"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterUse
|
||||
{
|
||||
DB_ID ADAPTER
|
||||
DB_ID_TYPE s
|
||||
OPTIONS "All" "No" "Yes"
|
||||
OPTIONS_IDS "%" "0" "1"
|
||||
DIALOG_NAME "Adapter Use"
|
||||
RSET_NAME "Adapter Use"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterStyle
|
||||
{
|
||||
DB_ID ASTYLE
|
||||
DB_ID_TYPE s
|
||||
OPTIONS "All" "Axial" "Radial"
|
||||
OPTIONS_IDS "%" "0" "1"
|
||||
DIALOG_NAME "Adapter Style"
|
||||
RSET_NAME "Adapter Style"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterLength
|
||||
{
|
||||
DB_ID ALENGTH
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(L) Adapter Length"
|
||||
RSET_NAME "(L) Adapter Length"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterWidth
|
||||
{
|
||||
DB_ID AWIDTH
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(W) Adapter Width"
|
||||
RSET_NAME "(W) Adapter Width"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterHeight
|
||||
{
|
||||
DB_ID AHEIGHT
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(H) Adapter Height"
|
||||
RSET_NAME "(H) Adapter Height"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterDiameter
|
||||
{
|
||||
DB_ID ADIAM
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(DIA) Adapter Diameter"
|
||||
RSET_NAME "(DIA) Adapter Diameter"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterZOffset
|
||||
{
|
||||
DB_ID AZOFF
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(Z-OFF) Adapter Z-Offset"
|
||||
RSET_NAME "(Z-OFF) Adapter Z-Offset"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterStepLength
|
||||
{
|
||||
DB_ID ASTEPLEN
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(SL) Adapter Step Length"
|
||||
RSET_NAME "(SL) Adapter Step Length"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterStepDiameter
|
||||
{
|
||||
DB_ID ASTEPDIAM
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(SDIA) Adapter Step Diameter"
|
||||
RSET_NAME "(SDIA) Adapter Step Diameter"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterTaperLength
|
||||
{
|
||||
DB_ID ATAPERLEN
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(TL) Adapter Taper Length"
|
||||
RSET_NAME "(TL) Adapter Taper Length"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterTaperAngle
|
||||
{
|
||||
DB_ID ATAPERANG
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(TA) Adapter Taper Angle"
|
||||
RSET_NAME "(TA) Adapter Taper Angle"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterBlockLength
|
||||
{
|
||||
DB_ID ABLCKLEN
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(BL) Adapter Block Length"
|
||||
RSET_NAME "(BL) Adapter Block Length"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterBlockWidth
|
||||
{
|
||||
DB_ID ABLCKWID
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(BW) Adapter Block Width"
|
||||
RSET_NAME "(BW) Adapter Block Width"
|
||||
}
|
||||
|
||||
DB_ALIAS AdapterBlockHeight
|
||||
{
|
||||
DB_ID ABLCKHGHT
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(BH) Adapter Block Height"
|
||||
RSET_NAME "(BH) Adapter Block Height"
|
||||
}
|
||||
|
||||
# for grooving tool holder
|
||||
DB_ALIAS GrooveStyle
|
||||
{
|
||||
DB_ID GSTYLE
|
||||
DB_ID_TYPE s
|
||||
OPTIONS "All" "Groove-0" "Groove-45" "Groove-90" "Groove-UD"
|
||||
OPTIONS_IDS "%" "23" "24" "25" "26"
|
||||
DIALOG_NAME "Holder Style"
|
||||
RSET_NAME "Holder Style"
|
||||
}
|
||||
|
||||
DB_ALIAS InsertExtension
|
||||
{
|
||||
DB_ID INSERTX
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(IE) Insert Extension"
|
||||
RSET_NAME "(IE) Insert Extension"
|
||||
}
|
||||
|
||||
###################################################################
|
||||
#################################################################
|
||||
|
||||
|
||||
LIBREF libref
|
||||
|
||||
|
||||
#########################################################################
|
||||
# The Class Hierarchy #
|
||||
#########################################################################
|
||||
|
||||
CLASS HOLDER
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(libref)] != [0] && DB(RecType) == [1]"
|
||||
DIALOG libref
|
||||
RSET libref Type SubType
|
||||
UI_NAME "Holder"
|
||||
|
||||
CLASS MILLING_DRILLING
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [01]"
|
||||
DIALOG libref Type
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "Milling_Drilling"
|
||||
|
||||
CLASS BT30
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [BT30]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "BT30"
|
||||
}
|
||||
|
||||
CLASS BT40
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [BT40]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "BT40"
|
||||
}
|
||||
|
||||
CLASS BT50
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [BT50]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "BT50"
|
||||
}
|
||||
|
||||
CLASS CAT30
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [CAT30]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "CAT30"
|
||||
}
|
||||
|
||||
CLASS CAT40
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [CAT40]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "CAT40"
|
||||
}
|
||||
|
||||
CLASS CAT50
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [CAT50]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "CAT50"
|
||||
}
|
||||
|
||||
CLASS CAT60
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [CAT60]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "CAT60"
|
||||
}
|
||||
|
||||
CLASS HSK_32A
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_32A]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_32A"
|
||||
}
|
||||
|
||||
CLASS HSK_40A
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_40A]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_40A"
|
||||
}
|
||||
|
||||
CLASS HSK_50A
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_50A]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_50A"
|
||||
}
|
||||
|
||||
CLASS HSK_63A
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_63A]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_63A"
|
||||
}
|
||||
|
||||
CLASS HSK_80A
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_80A]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_80A"
|
||||
}
|
||||
|
||||
CLASS HSK_100A
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_100A]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_100A"
|
||||
}
|
||||
|
||||
CLASS HSK_125A
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_125A]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_125A"
|
||||
}
|
||||
|
||||
CLASS HSK_160A
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_160A]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_160A"
|
||||
}
|
||||
|
||||
CLASS HSK_25E
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_25E]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_25E"
|
||||
}
|
||||
|
||||
CLASS HSK_32E
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_32E]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_32E"
|
||||
}
|
||||
|
||||
CLASS HSK_40E
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_40E]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_40E"
|
||||
}
|
||||
|
||||
CLASS HSK_50E
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_50E]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_50E"
|
||||
}
|
||||
|
||||
CLASS HSK_63E
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [HSK_63E]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "HSK_63E"
|
||||
}
|
||||
|
||||
CLASS SK30
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [SK30]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "SK30"
|
||||
}
|
||||
|
||||
CLASS SK40
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [SK40]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "SK40"
|
||||
}
|
||||
|
||||
CLASS SK50
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(MountingStyle)] == [SK50]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "SK50"
|
||||
}
|
||||
}
|
||||
|
||||
CLASS TURNING
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [02]"
|
||||
DIALOG libref Type
|
||||
RSET libref Description SubType
|
||||
UI_NAME "Turning"
|
||||
|
||||
CLASS TURNING_STD
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(SubType)] == [0]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description
|
||||
UI_NAME "Std_Turning_Tool_Holder"
|
||||
}
|
||||
|
||||
CLASS GROOVE
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(SubType)] == [1]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description
|
||||
UI_NAME "Grooving_Tool_Holder"
|
||||
}
|
||||
|
||||
CLASS THREAD
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(SubType)] == [2]"
|
||||
DIALOG libref Description
|
||||
RSET libref Description
|
||||
UI_NAME "Threading_Tool_Holder"
|
||||
}
|
||||
}
|
||||
|
||||
CLASS LASER
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [03]"
|
||||
DIALOG libref Type
|
||||
RSET libref Description N_Sections Max_offset
|
||||
UI_NAME "Laser"
|
||||
}
|
||||
|
||||
CLASS WEDM
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [04]"
|
||||
DIALOG libref Type
|
||||
RSET libref Description N_Sections
|
||||
UI_NAME "Wire EDM"
|
||||
}
|
||||
|
||||
CLASS FDM
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [05]"
|
||||
DIALOG libref Type
|
||||
RSET libref Description N_Sections
|
||||
UI_NAME "FDM"
|
||||
}
|
||||
|
||||
CLASS ADDITIVE_TAPE
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [06]"
|
||||
DIALOG libref Type
|
||||
RSET libref Description N_Sections
|
||||
UI_NAME "TAPE"
|
||||
}
|
||||
}
|
||||
1382
tool/ascii/holder_ascii.tcl
Normal file
1382
tool/ascii/holder_ascii.tcl
Normal file
File diff suppressed because it is too large
Load Diff
132
tool/ascii/multitool_ascii.def
Normal file
132
tool/ascii/multitool_ascii.def
Normal file
@@ -0,0 +1,132 @@
|
||||
|
||||
|
||||
|
||||
|
||||
DB_PREFIX "DB("
|
||||
DB_SUFFIX ")"
|
||||
ESS_PREFIX "ESS("
|
||||
ESS_SUFFIX ")"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# This is the definition file for multitools with an ASCII File
|
||||
# as the database
|
||||
#
|
||||
#
|
||||
#=======================================================================
|
||||
# REVISIONS
|
||||
# Date Name Description of Change
|
||||
#
|
||||
# 12-Oct-2016 JM Initial Release
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
|
||||
|
||||
#############################################################################
|
||||
# The list of DB_ALIAS
|
||||
#
|
||||
# All the <alias> defined here can be used in the class description at the
|
||||
# end of this file in order to define the fields that should appear in
|
||||
# the search criteria and search result dialogs within UG for every class.
|
||||
#
|
||||
# DB_ALIAS <alias>
|
||||
# {
|
||||
# DB_ID < Attribute Identifier defined in the ASCII Data File >
|
||||
# DB_ID_TYPE < Type of the identifier >
|
||||
# d _ double
|
||||
# i _ integer
|
||||
# s _ string
|
||||
# OPTIONS "opt1" "opt2 " "opt3"
|
||||
# OPTIONS_IDS "val1" "val2" "val3"
|
||||
# DIALOG_NAME "label in search criteria dialog"
|
||||
# RSET_NAME "label in search result dialog"
|
||||
# }
|
||||
#
|
||||
# OPTIONS and OPTIONS_IDS can be ommitted, If they are specified
|
||||
# then a corresponding option menu is created in the Search Criteria Dialog
|
||||
# instead of a simple search field.
|
||||
#############################################################################
|
||||
|
||||
# The DB_ALIAS of the library reference. It is mandatory that this DB_ALIAS
|
||||
# appears in the alias list
|
||||
#
|
||||
DB_ALIAS libref
|
||||
{
|
||||
DB_ID LIBRF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Libref"
|
||||
RSET_NAME "Libref"
|
||||
}
|
||||
|
||||
##################################################################
|
||||
#
|
||||
# General Attributes
|
||||
#
|
||||
##################################################################
|
||||
|
||||
DB_ALIAS Type
|
||||
{
|
||||
DB_ID T
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS SubType
|
||||
{
|
||||
DB_ID STYPE
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Seq_no
|
||||
{
|
||||
DB_ID SEQ
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# multi-tool Attributes
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
DB_ALIAS CutterID
|
||||
{
|
||||
DB_ID CUTTERID
|
||||
DB_ID_TYPE s
|
||||
}
|
||||
|
||||
DB_ALIAS CutterLibref
|
||||
{
|
||||
DB_ID CUTTERLIBRF
|
||||
DB_ID_TYPE s
|
||||
}
|
||||
|
||||
|
||||
###################################################################
|
||||
#################################################################
|
||||
|
||||
|
||||
LIBREF libref
|
||||
|
||||
|
||||
#########################################################################
|
||||
# The Class Hierarchy #
|
||||
#########################################################################
|
||||
|
||||
CLASS MULTITOOL
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(libref)] != [0]"
|
||||
DIALOG libref
|
||||
RSET libref Type SubType
|
||||
UI_NAME "Multi_tool"
|
||||
}
|
||||
|
||||
861
tool/ascii/multitool_ascii.tcl
Normal file
861
tool/ascii/multitool_ascii.tcl
Normal file
@@ -0,0 +1,861 @@
|
||||
###############################################################################
|
||||
# multitool_ascii.tcl - DBC Event Handler for database stored as ascii file
|
||||
###############################################################################
|
||||
##############################################################################
|
||||
# REVISIONS
|
||||
# Date Who Reason
|
||||
# 12-Oct-2016 JM initial release
|
||||
##############################################################################
|
||||
#
|
||||
|
||||
# the variable below will control the output format for angle in segment data
|
||||
set dbc_segment_angle_decimal_place 5
|
||||
|
||||
proc ASC_t_create_filename {env_var_name filename} \
|
||||
{
|
||||
#
|
||||
# Creates a complete filename by evaluating an environment variable
|
||||
# for the directory information
|
||||
#
|
||||
set env_var [MOM_ask_env_var $env_var_name]
|
||||
if { $env_var == "" } \
|
||||
{
|
||||
set message "Can't read environment variable $env_var_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
set fname ""
|
||||
set fname [append fname $env_var $filename]
|
||||
|
||||
return $fname
|
||||
}
|
||||
|
||||
proc MOM__boot {} \
|
||||
{
|
||||
|
||||
# source some general procedures
|
||||
|
||||
#
|
||||
# dbc_ascii_general.tcl
|
||||
#
|
||||
set filename \
|
||||
[ASC_t_create_filename "UGII_UG_LIBRARY_DIR" "dbc_ascii_general.tcl"]
|
||||
if { [catch {source $filename}] == "1" } \
|
||||
{
|
||||
set message "Can't load .tcl file: $filename"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc MOM__halt {} \
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_init_db {} \
|
||||
{
|
||||
|
||||
global asc_debug
|
||||
global asc_file_name
|
||||
global asc_units
|
||||
global asc_part_units
|
||||
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global asc_file_loaded
|
||||
global asc_file_load_limit
|
||||
|
||||
|
||||
#
|
||||
# Global variables set by DBC for Input/Output
|
||||
#
|
||||
|
||||
global dbc_lhs_exp
|
||||
global dbc_rhs_exp
|
||||
global dbc_relop
|
||||
global dbc_query
|
||||
global dbc_subqry1
|
||||
global dbc_subqry2
|
||||
global dbc_boolop
|
||||
global dbc_class_name
|
||||
global dbc_attr_count
|
||||
global dbc_attr_id
|
||||
global dbc_query_count
|
||||
global dbc_libref
|
||||
global dbc_var_list
|
||||
|
||||
|
||||
set dbc_lhs_exp ""
|
||||
set dbc_rhs_exp ""
|
||||
set dbc_relop ""
|
||||
set dbc_query ""
|
||||
set dbc_subqry1 ""
|
||||
set dbc_subqry2 ""
|
||||
set dbc_boolop ""
|
||||
set dbc_class_name ""
|
||||
set dbc_attr_count 0
|
||||
set dbc_attr_id ""
|
||||
set dbc_query_count 0
|
||||
set dbc_libref ""
|
||||
set dbc_var_list ""
|
||||
|
||||
set asc_debug 0
|
||||
set asc_file_name ""
|
||||
set asc_part_units ""
|
||||
set dbc_cutter_ass_units ""
|
||||
|
||||
#
|
||||
# Set the unit for tool search to the part unit
|
||||
#
|
||||
ASC_set_part_unit
|
||||
|
||||
#
|
||||
# ask the mm and inch filenames
|
||||
#
|
||||
set asc_mm_file_name [ASC_get_data_file_name $asc_units(mm)]
|
||||
set asc_inch_file_name [ASC_get_data_file_name $asc_units(inch)]
|
||||
if { $asc_mm_file_name == "" && $asc_inch_file_name == "" } \
|
||||
{
|
||||
set message "Error looking for a multitool_database.dat file."
|
||||
set message "$message \n Neither of the environment variables"
|
||||
set message "$message \n UGII_CAM_LIBRARY_TOOL_METRIC_DIR,"
|
||||
set message "$message \n UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR"
|
||||
set message "$message \n is defined."
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
#
|
||||
# mm file
|
||||
#
|
||||
set app 0
|
||||
set mm_file_loaded 0
|
||||
|
||||
|
||||
#MOM_output_to_listing_device "xxxxxxxxxxxxxxxxxxxxxxxx init_db xxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
set ret_cd [ASC_load_data_file $asc_mm_file_name $asc_units(mm) $app]
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $asc_mm_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
set app 1
|
||||
set mm_file_loaded 1
|
||||
|
||||
#
|
||||
# and then inch file
|
||||
#
|
||||
set inch_file_loaded 0
|
||||
|
||||
set ret_cd [ASC_load_data_file $asc_inch_file_name $asc_units(inch) $app]
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $asc_inch_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
set inch_file_loaded 1
|
||||
|
||||
#
|
||||
# if mm or inch or both files are loaded set the flag
|
||||
#
|
||||
if { $inch_file_loaded == 1 || $mm_file_loaded == 1 } \
|
||||
{
|
||||
set asc_file_loaded 1
|
||||
}
|
||||
|
||||
#
|
||||
# This variable is only used for error messages
|
||||
#
|
||||
set asc_file_name " $asc_mm_file_name"
|
||||
set asc_file_name "$asc_file_name \n $asc_inch_file_name"
|
||||
|
||||
}
|
||||
|
||||
proc ASC_get_data_file_name { unit } \
|
||||
{
|
||||
#
|
||||
# Returns the filename for ASCII Data File depending on the
|
||||
# specified unit.
|
||||
#
|
||||
global asc_units
|
||||
|
||||
if {$unit == $asc_units(mm)} \
|
||||
{
|
||||
set env_var_name UGII_CAM_LIBRARY_TOOL_METRIC_DIR
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set env_var_name UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR
|
||||
}
|
||||
|
||||
set env_var [MOM_ask_env_var $env_var_name]
|
||||
if { $env_var == "" } \
|
||||
{
|
||||
return ""
|
||||
}
|
||||
|
||||
set fname ""
|
||||
set fname [append fname $env_var "multitool_database.dat"]
|
||||
|
||||
return $fname
|
||||
}
|
||||
|
||||
proc ASC_set_part_unit {} \
|
||||
{
|
||||
|
||||
global dbc_part_units
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
|
||||
MOM_ask_part_units ;# writes to dbc_part_units
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set dbc_search_units $asc_units(mm)
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set dbc_search_units $asc_units(inch)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_retrieve {} {
|
||||
#---------------------------------------------
|
||||
global dbc_libref
|
||||
|
||||
ASC_retrieve
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc ASC_retrieve {} {
|
||||
#---------------------------------------------
|
||||
#
|
||||
# global input
|
||||
# ------------
|
||||
global asc_debug
|
||||
global asc_units
|
||||
|
||||
global dbc_search_units
|
||||
|
||||
global dbc_libref
|
||||
global db_row
|
||||
|
||||
global asc_file_loaded
|
||||
global asc_database
|
||||
global asc_database_count
|
||||
global asc_file_name
|
||||
|
||||
#
|
||||
# global output
|
||||
# -------------
|
||||
|
||||
global dbc_multitool_is_multitool
|
||||
set dbc_multitool_is_multitool 0
|
||||
|
||||
global dbc_multitool_cutterlibref
|
||||
global dbc_multitool_cutterid
|
||||
|
||||
global dbc_multitool_type
|
||||
global dbc_multitool_subtype
|
||||
|
||||
|
||||
#
|
||||
# Look for the desired libref
|
||||
#
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
|
||||
if {$db_row >= 0} \
|
||||
{
|
||||
set dbc_multitool_type [ASC_ask_att_val T $db_row "%d" 0 flag]
|
||||
set dbc_multitool_type [ASC_ask_att_val STYPE $db_row "%d" 0 flag]
|
||||
|
||||
ASC_load_multitool_data
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
proc ASC_load_multitool_data {} \
|
||||
{
|
||||
global dbc_attr_count
|
||||
global dbc_attr_aliases
|
||||
global dbc_attr_id
|
||||
global dbc_libref
|
||||
global dbc_query_count
|
||||
|
||||
|
||||
global dbc_multitool_is_multitool
|
||||
set dbc_multitool_is_multitool 0
|
||||
|
||||
global dbc_multitool_cutterlibref
|
||||
global dbc_multitool_cutterid
|
||||
global dbc_multitool_cutter_count
|
||||
|
||||
global asc_database_count
|
||||
|
||||
|
||||
#MOM_output_to_listing_device "asc_database_count = $asc_database_count"
|
||||
|
||||
|
||||
# Initialize environment
|
||||
set dbc_multitool_cutter_count 0
|
||||
|
||||
set indx 0
|
||||
|
||||
# Cycle database looking for matching data records
|
||||
for {set db_row 0} {$db_row < $asc_database_count} { incr db_row 1} \
|
||||
{
|
||||
|
||||
set tmp_libref [ASC_ask_att_val LIBRF $db_row "" 0 flag]
|
||||
if {$tmp_libref == $dbc_libref} \
|
||||
{
|
||||
set dbc_multitool_is_multitool 1
|
||||
|
||||
set dbc_multitool_cutterlibref($indx) \
|
||||
[ASC_ask_att_val CUTTERLIBRF $db_row "%s" 0 flag]
|
||||
|
||||
set dbc_multitool_cutterid($indx) \
|
||||
[ASC_ask_att_val CUTTERID $db_row "%s" 0 flag]
|
||||
|
||||
incr indx
|
||||
set dbc_multitool_cutter_count $indx
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
proc DBC_ask_library_values {} \
|
||||
{
|
||||
#
|
||||
# global input
|
||||
global dbc_libref
|
||||
global dbc_db_ids_count
|
||||
global dbc_db_ids
|
||||
|
||||
global asc_file_loaded
|
||||
|
||||
#
|
||||
# global output
|
||||
global dbc_db_ids_value
|
||||
|
||||
|
||||
#
|
||||
# Look for the desired libref
|
||||
#
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
#
|
||||
# and set the desired values
|
||||
#
|
||||
for { set inx 0 } { $inx < $dbc_db_ids_count } { incr inx } \
|
||||
{
|
||||
set dbc_db_ids_value($dbc_db_ids($inx)) \
|
||||
[ASC_ask_att_val $dbc_db_ids($inx) $db_row "" "" flag]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_translate_att_alias {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_translate_att_alias
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_create_criterion {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_create_criterion
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_create_query {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_create_query
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_execute_query {} {
|
||||
#---------------------------------------------
|
||||
|
||||
|
||||
global asc_file_loaded
|
||||
global dbc_query
|
||||
global dbc_search_units
|
||||
|
||||
if { $asc_file_loaded == 0 } \
|
||||
{
|
||||
ASC_file_exec_qry 0
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_append_unit_to_query
|
||||
ASC_execute_query
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_execute_query_for_count {} {
|
||||
#---------------------------------------------
|
||||
|
||||
global asc_file_loaded
|
||||
global dbc_query
|
||||
|
||||
if { $asc_file_loaded == 0 } \
|
||||
{
|
||||
ASC_file_exec_qry 1
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_append_unit_to_query
|
||||
ASC_execute_query_for_count
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#--------------------------------------------
|
||||
proc DBC_insert {} {
|
||||
#--------------------------------------------
|
||||
|
||||
ASC_insert
|
||||
}
|
||||
|
||||
proc ASC_append_unit_to_query {} \
|
||||
{
|
||||
global dbc_search_units
|
||||
global dbc_query
|
||||
global asc_units
|
||||
|
||||
|
||||
|
||||
set lhs "\$asc_database(\$db_row,_unitt)"
|
||||
|
||||
set subquery1 "($lhs == \"$asc_units(unknown)\")"
|
||||
set subquery2 "($lhs == \"$dbc_search_units\")"
|
||||
|
||||
set subquery "($subquery1 || $subquery2)"
|
||||
|
||||
set dbc_query "$dbc_query && $subquery"
|
||||
|
||||
}
|
||||
|
||||
proc ASC_file_exec_qry { for_count } \
|
||||
{
|
||||
#
|
||||
# Executes the query on a file depending on the current setting
|
||||
# of the dbc_search_units
|
||||
#
|
||||
# for_count = 1 => do only execute_query_for_count
|
||||
|
||||
|
||||
|
||||
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global dbc_query_count
|
||||
global dbc_query
|
||||
global units_from_query
|
||||
|
||||
if {[info exists units_from_query]} {
|
||||
set dbc_search_units $units_from_query
|
||||
unset units_from_query
|
||||
}
|
||||
|
||||
if { $dbc_search_units == $asc_units(mm) } \
|
||||
{
|
||||
set file_name $asc_mm_file_name
|
||||
set units $asc_units(mm)
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set file_name $asc_inch_file_name
|
||||
set units $asc_units(inch)
|
||||
}
|
||||
|
||||
set dbc_query_count 0
|
||||
if { $for_count == 1 } \
|
||||
{
|
||||
set ret_cd [ASC_file_execute_query_for_count $file_name $units]
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set ret_cd [ASC_file_execute_query $file_name $units]
|
||||
}
|
||||
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_file_search_libref { libref db_row_ref } \
|
||||
{
|
||||
upvar $db_row_ref db_row
|
||||
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global asc_file_name
|
||||
|
||||
|
||||
#
|
||||
# We search in mm and inch file for the desired libref
|
||||
#
|
||||
set found 2
|
||||
if { $dbc_search_units == $asc_units(mm) } \
|
||||
{
|
||||
#
|
||||
# Start with the mm file
|
||||
if { $asc_mm_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_mm_file_name $asc_units(mm) \
|
||||
LIBRF $libref db_row]
|
||||
if { $found != 0 } \
|
||||
{
|
||||
# Not found -> Try again with the inch file
|
||||
if { $asc_inch_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_inch_file_name $asc_units(inch) \
|
||||
LIBRF $libref db_row]
|
||||
}
|
||||
}
|
||||
}
|
||||
} \
|
||||
else \
|
||||
{
|
||||
#
|
||||
# Start with the inch file
|
||||
if { $asc_inch_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_inch_file_name $asc_units(inch) \
|
||||
LIBRF $libref db_row]
|
||||
if { $found != 0 } \
|
||||
{
|
||||
# Not found -> Try again with the mm file
|
||||
if { $asc_mm_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_mm_file_name $asc_units(mm) \
|
||||
LIBRF $libref db_row]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if { $found == 2 } \
|
||||
{
|
||||
set message "Error retrieving segmented tool from external library."
|
||||
set message "$message \n Tool with the library reference $libref"
|
||||
set message "$message \n does not exist in the"
|
||||
set message "$message \n ASCII Data File(s):"
|
||||
set message "$message \n $asc_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
if { $found == 1 } \
|
||||
{
|
||||
set message "Error retrieving segmented tool from external library."
|
||||
set message "$message \n Neither of the files"
|
||||
set message "$message \n $asc_mm_file_name"
|
||||
set message "$message \n $asc_inch_file_name"
|
||||
set message "$message \n can be read."
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_array_search_libref { libref db_row_ref } \
|
||||
{
|
||||
upvar $db_row_ref db_row
|
||||
|
||||
global asc_file_name
|
||||
|
||||
set found [ASC_array_find_object_by_att LIBRF $libref db_row ]
|
||||
|
||||
if { $found == 2 } \
|
||||
{
|
||||
set db_row -1
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_insert {} \
|
||||
{
|
||||
global asc_database_name
|
||||
global asc_file_name
|
||||
global asc_units
|
||||
global dbc_part_units
|
||||
global dbc_event_error
|
||||
global dbc_logname
|
||||
|
||||
global dbc_class
|
||||
# In this multitool interp the class is always multitool
|
||||
set dbc_class "MULTITOOL"
|
||||
|
||||
global dbc_libref
|
||||
global dbc_segment_count
|
||||
|
||||
global dbc_clsf_decimal_places
|
||||
global mom_clsf_decimal_places
|
||||
|
||||
global asc_cur_line
|
||||
global asc_record_type
|
||||
global asc_class
|
||||
global asc_record_libref
|
||||
|
||||
global num_formats_processed
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(mm)]
|
||||
} else \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(inch)]
|
||||
}
|
||||
|
||||
set asc_tempname $base_filename
|
||||
append asc_tempname "_tmp"
|
||||
|
||||
set asc_backupname $base_filename
|
||||
append asc_backupname "_bak"
|
||||
|
||||
# back up the existing version of the library
|
||||
if [catch {file copy -force $base_filename $asc_backupname} ] \
|
||||
{
|
||||
set dbc_event_error "Can't create backup file $asc_backupname."
|
||||
return
|
||||
}
|
||||
|
||||
# open temp file and current library file
|
||||
if [catch {open $asc_tempname w} tmp_fileid] \
|
||||
{
|
||||
set dbc_event_error "Error opening $asc_tempname"
|
||||
return
|
||||
}
|
||||
|
||||
if [catch {open $base_filename r} input_fileid] \
|
||||
{
|
||||
set dbc_event_error "Error opening $base_filename"
|
||||
return
|
||||
}
|
||||
|
||||
# Cycle over all the records in the input file looking for the spot
|
||||
# to insert the input segment set
|
||||
set segments_output 0
|
||||
while {[gets $input_fileid asc_cur_line] >= 0} \
|
||||
{
|
||||
ASC_classify_line
|
||||
switch -- $asc_record_type \
|
||||
{
|
||||
"Comment"
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Revision"
|
||||
{
|
||||
# output a new revision line for the new entry and then the input record
|
||||
set daytime [clock seconds]
|
||||
set out_daytime [clock format $daytime -format "%a %b %d %Y %I:%M %p"]
|
||||
set cur_rev "# $dbc_logname $out_daytime"
|
||||
append cur_rev " Saving $dbc_libref"
|
||||
|
||||
puts $tmp_fileid $cur_rev
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Class"
|
||||
{
|
||||
# Save indicator for this class matching the input class
|
||||
set class_match [string compare $dbc_class $asc_class]
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Format"
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Data"
|
||||
{
|
||||
set libref_cmp [string compare $asc_record_libref $dbc_libref]
|
||||
|
||||
# If this data record isn't for the class we're trying to insert, just
|
||||
# pass it to the output file. Otherwise, compare the librefs and
|
||||
# determine if it needs to be output yet.
|
||||
if { $class_match != 0 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == -1 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == 0 } \
|
||||
{
|
||||
if { $segments_output == 0 } \
|
||||
{
|
||||
ASC_output_segments $tmp_fileid
|
||||
incr segments_output
|
||||
}
|
||||
} else \
|
||||
{
|
||||
if { $segments_output == 0 } \
|
||||
{
|
||||
ASC_output_segments $tmp_fileid
|
||||
incr segments_output
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
"End Data"
|
||||
{
|
||||
# If this End Data record is for the class we're trying to insert,
|
||||
# check if the segments have been output yet. If not,
|
||||
# output them now and then this record.
|
||||
if { $class_match == 0 } \
|
||||
{
|
||||
if { $segments_output == 0 } \
|
||||
{
|
||||
ASC_output_segments $tmp_fileid
|
||||
incr segments_output
|
||||
}
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Close the input and output files
|
||||
if [catch {close $tmp_fileid} ] \
|
||||
{
|
||||
set dbc_event_error "Error closing $asc_tempname"
|
||||
return
|
||||
}
|
||||
if [catch {close $input_fileid} ] \
|
||||
{
|
||||
set dbc_event_error "Error closing $base_filename"
|
||||
return
|
||||
}
|
||||
|
||||
# Rename the output file to the current file name, since we have already
|
||||
# copied the current library into a backup file.
|
||||
if [catch {file rename -force $asc_tempname $base_filename} ] \
|
||||
{
|
||||
global errorInfo
|
||||
set dbc_event_error "Can't update library file $base_filename."
|
||||
}
|
||||
|
||||
# Reinitialize the database to update the run-time data since this doesn't
|
||||
# automatically happen on subsequent access attempts.
|
||||
DBC_init_db
|
||||
}
|
||||
|
||||
proc ASC_output_segments { fileid } \
|
||||
{
|
||||
global dbc_libref
|
||||
global dbc_class
|
||||
|
||||
global dbc_segment_seqno
|
||||
|
||||
global dbc_multitool_cutter_count
|
||||
|
||||
global dbc_multitool_cutterlibref
|
||||
global dbc_segment_seqno
|
||||
global dbc_multitool_cutterid
|
||||
|
||||
#FORMAT LIBRF T STYPE SEQ CUTTERID CUTTERLIBRF
|
||||
#-------------------------------------------------------------------------------
|
||||
#DATA | ugt0801_001 | 1 | 0 | 0 | 1 | ugt0101_2003
|
||||
|
||||
|
||||
for {set mCount 0 } { $mCount < $dbc_multitool_cutter_count} {incr mCount} \
|
||||
{
|
||||
set data_line [format "DATA | %s | 1 | 0 | %d | %d | %s" \
|
||||
$dbc_libref \
|
||||
$dbc_segment_seqno($mCount) \
|
||||
$dbc_multitool_cutterid($mCount) $dbc_multitool_cutterlibref($mCount)]
|
||||
|
||||
puts $fileid $data_line
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
proc ASC_classify_line { } \
|
||||
{
|
||||
global asc_cur_line
|
||||
global asc_class
|
||||
global asc_record_libref
|
||||
global asc_record_type
|
||||
|
||||
# First check if record is some form of comment
|
||||
if {[string match {#*} $asc_cur_line] == 1} \
|
||||
{
|
||||
# It does. Sort out what kind
|
||||
if {[string match #END_DATA $asc_cur_line] == 1} \
|
||||
{
|
||||
set asc_record_type "End Data"
|
||||
} elseif {[string match *CLASS* $asc_cur_line] == 1} \
|
||||
{
|
||||
# We have a Class specification. Extract the class
|
||||
set asc_record_type "Class"
|
||||
set asc_class [string trimright $asc_cur_line]
|
||||
set tmp_ix [string first CLASS $asc_class]
|
||||
set tmp_iy [string wordend $asc_class $tmp_ix]
|
||||
set asc_class [string range $asc_class $tmp_iy end]
|
||||
set asc_class [string trimleft $asc_class]
|
||||
} elseif {[string match *dbc_logname* $asc_cur_line] == 1} \
|
||||
{
|
||||
set asc_record_type "Revision"
|
||||
} else \
|
||||
{
|
||||
set asc_record_type "Comment"
|
||||
}
|
||||
} elseif {[string match {FORMAT*} $asc_cur_line] == 1 } \
|
||||
{
|
||||
set asc_record_type "Format"
|
||||
} elseif {[string match {DATA*} $asc_cur_line] ==1} \
|
||||
{
|
||||
# We have a DATA record.
|
||||
set asc_record_type "Data"
|
||||
|
||||
# Extract the libref from this data record
|
||||
set tmp_ix [string first | $asc_cur_line]
|
||||
incr tmp_ix
|
||||
set asc_record_libref [string range $asc_cur_line $tmp_ix end]
|
||||
set tmp_iy [string first | $asc_record_libref]
|
||||
incr tmp_iy -1
|
||||
set asc_record_libref [string range $asc_record_libref 0 $tmp_iy]
|
||||
set asc_record_libref [string trim $asc_record_libref]
|
||||
} else \
|
||||
{
|
||||
# This doesn't match any previous types, so it is probably a blank line.
|
||||
# Whatever it is, treat it as a comment and pass it through.
|
||||
set asc_record_type "Comment"
|
||||
}
|
||||
}
|
||||
|
||||
207
tool/ascii/segmented_tool_ascii.def
Normal file
207
tool/ascii/segmented_tool_ascii.def
Normal file
@@ -0,0 +1,207 @@
|
||||
################################################################################
|
||||
# This is the definition file for segmented tools with an ASCII File
|
||||
# as the database
|
||||
#
|
||||
#
|
||||
#=======================================================================
|
||||
# REVISIONS
|
||||
# Date Name Description of Change
|
||||
#
|
||||
# 03Mar2006 rlm Initial Release
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
DB_PREFIX "DB("
|
||||
DB_SUFFIX ")"
|
||||
ESS_PREFIX "ESS("
|
||||
ESS_SUFFIX ")"
|
||||
|
||||
|
||||
#############################################################################
|
||||
# The list of DB_ALIAS
|
||||
#
|
||||
# All the <alias> defined here can be used in the class description at the
|
||||
# end of this file in order to define the fields that should appear in
|
||||
# the search criteria and search result dialogs within UG for every class.
|
||||
#
|
||||
# DB_ALIAS <alias>
|
||||
# {
|
||||
# DB_ID < Attribute Identifier defined in the ASCII Data File >
|
||||
# DB_ID_TYPE < Type of the identifier >
|
||||
# d _ double
|
||||
# i _ integer
|
||||
# s _ string
|
||||
# OPTIONS "opt1" "opt2 " "opt3"
|
||||
# OPTIONS_IDS "val1" "val2" "val3"
|
||||
# DIALOG_NAME "label in search criteria dialog"
|
||||
# RSET_NAME "label in search result dialog"
|
||||
# }
|
||||
#
|
||||
# OPTIONS and OPTIONS_IDS can be ommitted, If they are specified
|
||||
# then a corresponding option menu is created in the Search Criteria Dialog
|
||||
# instead of a simple search field.
|
||||
#############################################################################
|
||||
|
||||
# The DB_ALIAS of the library reference. It is mandatory that this DB_ALIAS
|
||||
# appears in the alias list
|
||||
#
|
||||
DB_ALIAS libref
|
||||
{
|
||||
DB_ID LIBRF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Libref"
|
||||
RSET_NAME "Libref"
|
||||
}
|
||||
|
||||
##################################################################
|
||||
#
|
||||
# General Attributes
|
||||
#
|
||||
##################################################################
|
||||
|
||||
DB_ALIAS Type
|
||||
{
|
||||
DB_ID T
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS SubType
|
||||
{
|
||||
DB_ID STYPE
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Seq_no
|
||||
{
|
||||
DB_ID SEQ
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Mill Form Tool Attributes
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
DB_ALIAS Seg_length
|
||||
{
|
||||
DB_ID LEN
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Seg_angle
|
||||
{
|
||||
DB_ID ANGLE
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Seg_radius
|
||||
{
|
||||
DB_ID RAD
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Seg_sweep_angle
|
||||
{
|
||||
DB_ID SWEEP
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Step Drill Attributes
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
DB_ALIAS Seg_diameter
|
||||
{
|
||||
DB_ID DIAM
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Seg_height
|
||||
{
|
||||
DB_ID HEI
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Turning Form Tool Attributes
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
DB_ALIAS Tracking_point
|
||||
{
|
||||
DB_ID TP
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Nose_radius
|
||||
{
|
||||
DB_ID RADIUS
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Nose_angle
|
||||
{
|
||||
DB_ID ANGLE
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
DB_ALIAS Edge_length
|
||||
{
|
||||
DB_ID LENGTH
|
||||
DB_ID_TYPE d
|
||||
}
|
||||
|
||||
|
||||
###################################################################
|
||||
#################################################################
|
||||
|
||||
|
||||
LIBREF libref
|
||||
|
||||
|
||||
#########################################################################
|
||||
# The Class Hierarchy #
|
||||
#########################################################################
|
||||
|
||||
CLASS SEGMENTED_TOOL
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(libref)] != [0]"
|
||||
DIALOG libref
|
||||
RSET libref Type SubType
|
||||
UI_NAME "Segmented_tool"
|
||||
|
||||
CLASS MILL_FORM
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [1] && [DB(SubType)] == [0]"
|
||||
DIALOG libref Type
|
||||
RSET libref Seg_length Seg_angle Seg_radius Seg_sweep_angle
|
||||
UI_NAME "Mill_Form"
|
||||
}
|
||||
|
||||
CLASS STEP_DRILL
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [1] && [DB(SubType)] == [1]"
|
||||
DIALOG libref Type
|
||||
RSET libref Seg_diameter Seg_height Seg_angle Seg_radius
|
||||
UI_NAME "Step_Drill"
|
||||
}
|
||||
|
||||
CLASS TURN_FORM
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [1] && [DB(SubType)] == [2]"
|
||||
DIALOG libref Type
|
||||
RSET libref Tracking_point Nose_radius Nose_angle Edge_length
|
||||
UI_NAME "Turn_Form"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
930
tool/ascii/segmented_tool_ascii.tcl
Normal file
930
tool/ascii/segmented_tool_ascii.tcl
Normal file
@@ -0,0 +1,930 @@
|
||||
###############################################################################
|
||||
# segmented_tool_ascii.tcl - DBC Event Handler for database stored as ascii file
|
||||
###############################################################################
|
||||
|
||||
|
||||
# The customization mechanism needs these two variable to be set
|
||||
|
||||
# The following variable indicates where this file originally resides in
|
||||
# the NX installation relative to the mach->resource folder
|
||||
set dbc_original_dir "library,tool,ascii"
|
||||
|
||||
# The following variable is the environment variable that points to where
|
||||
# the custom file for this file resides
|
||||
# NOTE: the name of the custom file is <current file name>_custom.tcl
|
||||
# So in this case it will be "segmented_tool_ascii_custom.tcl" and the file has to reside in the
|
||||
# directory/folder pointed to by UGII_CAM_CUSTOM_LIBRARY_TOOL_ASCII_DIR
|
||||
#
|
||||
# If the env is not set or if the env is pointing to the UGII_BASE_DIR->mach->resource->library->tool->ascii
|
||||
# customization will not take effect. The file "segmented_tool_ascii_custom.tcl" that is in the system folder is only
|
||||
# an example of how to customize and this file may/will be modified as necessary by the system
|
||||
set dbc_custom_file_dir "UGII_CAM_CUSTOM_LIBRARY_TOOL_ASCII_DIR"
|
||||
|
||||
# the variable below will control the output format for angle in segment data
|
||||
set dbc_segment_angle_decimal_place 5
|
||||
|
||||
# Default double precision value format.
|
||||
set double_precision_format "g"
|
||||
|
||||
proc ASC_t_create_filename {env_var_name filename} \
|
||||
{
|
||||
#
|
||||
# Creates a complete filename by evaluating an environment variable
|
||||
# for the directory information
|
||||
#
|
||||
set env_var [MOM_ask_env_var $env_var_name]
|
||||
if { $env_var == "" } \
|
||||
{
|
||||
set message "Can't read environment variable $env_var_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
set fname ""
|
||||
set fname [append fname $env_var $filename]
|
||||
|
||||
return $fname
|
||||
}
|
||||
|
||||
proc MOM__boot {} \
|
||||
{
|
||||
|
||||
# source some general procedures
|
||||
|
||||
#
|
||||
# dbc_ascii_general.tcl
|
||||
#
|
||||
set filename \
|
||||
[ASC_t_create_filename "UGII_UG_LIBRARY_DIR" "dbc_ascii_general.tcl"]
|
||||
if { [catch {source $filename}] == "1" } \
|
||||
{
|
||||
set message "Can't load .tcl file: $filename"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc MOM__halt {} \
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_init_db {} \
|
||||
{
|
||||
|
||||
global asc_debug
|
||||
global asc_file_name
|
||||
global asc_units
|
||||
global asc_part_units
|
||||
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global asc_file_loaded
|
||||
global asc_file_load_limit
|
||||
|
||||
|
||||
#
|
||||
# Global variables set by DBC for Input/Output
|
||||
#
|
||||
|
||||
global dbc_lhs_exp
|
||||
global dbc_rhs_exp
|
||||
global dbc_relop
|
||||
global dbc_query
|
||||
global dbc_subqry1
|
||||
global dbc_subqry2
|
||||
global dbc_boolop
|
||||
global dbc_class_name
|
||||
global dbc_attr_count
|
||||
global dbc_attr_id
|
||||
global dbc_query_count
|
||||
global dbc_libref
|
||||
global dbc_var_list
|
||||
|
||||
|
||||
set dbc_lhs_exp ""
|
||||
set dbc_rhs_exp ""
|
||||
set dbc_relop ""
|
||||
set dbc_query ""
|
||||
set dbc_subqry1 ""
|
||||
set dbc_subqry2 ""
|
||||
set dbc_boolop ""
|
||||
set dbc_class_name ""
|
||||
set dbc_attr_count 0
|
||||
set dbc_attr_id ""
|
||||
set dbc_query_count 0
|
||||
set dbc_libref ""
|
||||
set dbc_var_list ""
|
||||
|
||||
set asc_debug 0
|
||||
set asc_file_name ""
|
||||
set asc_part_units ""
|
||||
set dbc_cutter_ass_units ""
|
||||
|
||||
#
|
||||
# Set the unit for tool search to the part unit
|
||||
#
|
||||
ASC_set_part_unit
|
||||
|
||||
#
|
||||
# ask the mm and inch filenames
|
||||
#
|
||||
set asc_mm_file_name [ASC_get_data_file_name $asc_units(mm)]
|
||||
set asc_inch_file_name [ASC_get_data_file_name $asc_units(inch)]
|
||||
if { $asc_mm_file_name == "" && $asc_inch_file_name == "" } \
|
||||
{
|
||||
set message "Error looking for a segmented_tool_database.dat file."
|
||||
set message "$message \n Neither of the environment variables"
|
||||
set message "$message \n UGII_CAM_LIBRARY_TOOL_METRIC_DIR,"
|
||||
set message "$message \n UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR"
|
||||
set message "$message \n is defined."
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
#
|
||||
# mm file
|
||||
#
|
||||
set app 0
|
||||
set mm_file_loaded 0
|
||||
|
||||
set ret_cd [ASC_load_data_file $asc_mm_file_name $asc_units(mm) $app]
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $asc_mm_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
set app 1
|
||||
set mm_file_loaded 1
|
||||
|
||||
#
|
||||
# and then inch file
|
||||
#
|
||||
set inch_file_loaded 0
|
||||
|
||||
set ret_cd [ASC_load_data_file $asc_inch_file_name $asc_units(inch) $app]
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $asc_inch_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
set inch_file_loaded 1
|
||||
|
||||
#
|
||||
# if mm or inch or both files are loaded set the flag
|
||||
#
|
||||
if { $inch_file_loaded == 1 || $mm_file_loaded == 1 } \
|
||||
{
|
||||
set asc_file_loaded 1
|
||||
}
|
||||
|
||||
#
|
||||
# This variable is only used for error messages
|
||||
#
|
||||
set asc_file_name " $asc_mm_file_name"
|
||||
set asc_file_name "$asc_file_name \n $asc_inch_file_name"
|
||||
|
||||
}
|
||||
|
||||
proc ASC_get_data_file_name { unit } \
|
||||
{
|
||||
#
|
||||
# Returns the filename for ASCII Data File depending on the
|
||||
# specified unit.
|
||||
#
|
||||
global asc_units
|
||||
|
||||
if {$unit == $asc_units(mm)} \
|
||||
{
|
||||
set env_var_name UGII_CAM_LIBRARY_TOOL_METRIC_DIR
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set env_var_name UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR
|
||||
}
|
||||
|
||||
set env_var [MOM_ask_env_var $env_var_name]
|
||||
if { $env_var == "" } \
|
||||
{
|
||||
return ""
|
||||
}
|
||||
|
||||
set fname ""
|
||||
set fname [append fname $env_var "segmented_tool_database.dat"]
|
||||
|
||||
return $fname
|
||||
}
|
||||
|
||||
proc ASC_set_part_unit {} \
|
||||
{
|
||||
|
||||
global dbc_part_units
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
|
||||
MOM_ask_part_units ;# writes to dbc_part_units
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set dbc_search_units $asc_units(mm)
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set dbc_search_units $asc_units(inch)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_retrieve {} {
|
||||
#---------------------------------------------
|
||||
global dbc_libref
|
||||
|
||||
ASC_retrieve
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc ASC_retrieve {} {
|
||||
#---------------------------------------------
|
||||
#
|
||||
# global input
|
||||
# ------------
|
||||
global asc_debug
|
||||
global asc_units
|
||||
|
||||
global dbc_search_units
|
||||
|
||||
global dbc_libref
|
||||
global db_row
|
||||
|
||||
global asc_file_loaded
|
||||
global asc_database
|
||||
global asc_database_count
|
||||
global asc_file_name
|
||||
|
||||
#
|
||||
# global output
|
||||
# -------------
|
||||
global dbc_segment_count
|
||||
global dbc_segment_type
|
||||
global dbc_segment_subtype
|
||||
global dbc_query
|
||||
global dbc_query_count
|
||||
|
||||
if { $asc_debug == "1" } \
|
||||
{
|
||||
puts " =========================================="
|
||||
puts " procedure DBC_retrieve for segmented tool segments."
|
||||
puts " libref -> $dbc_libref"
|
||||
}
|
||||
|
||||
# initialize segment count so we can detect if retrieval failed
|
||||
set dbc_segment_count 0
|
||||
|
||||
#
|
||||
# Look for the desired libref
|
||||
#
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
|
||||
if {$db_row >= 0} \
|
||||
{
|
||||
set dbc_segment_type [ASC_ask_att_val T $db_row "%d" 0 flag]
|
||||
set dbc_segment_subtype [ASC_ask_att_val STYPE $db_row "%d" 0 flag]
|
||||
|
||||
ASC_load_segment_data
|
||||
}
|
||||
}
|
||||
|
||||
proc DBC_ask_library_values {} \
|
||||
{
|
||||
#
|
||||
# global input
|
||||
global dbc_libref
|
||||
global dbc_db_ids_count
|
||||
global dbc_db_ids
|
||||
|
||||
global asc_file_loaded
|
||||
|
||||
#
|
||||
# global output
|
||||
global dbc_db_ids_value
|
||||
|
||||
|
||||
#
|
||||
# Look for the desired libref
|
||||
#
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
#
|
||||
# and set the desired values
|
||||
#
|
||||
for { set inx 0 } { $inx < $dbc_db_ids_count } { incr inx } \
|
||||
{
|
||||
set dbc_db_ids_value($dbc_db_ids($inx)) \
|
||||
[ASC_ask_att_val $dbc_db_ids($inx) $db_row "" "" flag]
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_translate_att_alias {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_translate_att_alias
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_create_criterion {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_create_criterion
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_create_query {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_create_query
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_execute_query {} {
|
||||
#---------------------------------------------
|
||||
|
||||
|
||||
global asc_file_loaded
|
||||
global dbc_query
|
||||
global dbc_search_units
|
||||
|
||||
if { $asc_file_loaded == 0 } \
|
||||
{
|
||||
ASC_file_exec_qry 0
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_append_unit_to_query
|
||||
ASC_execute_query
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_execute_query_for_count {} {
|
||||
#---------------------------------------------
|
||||
|
||||
global asc_file_loaded
|
||||
global dbc_query
|
||||
|
||||
if { $asc_file_loaded == 0 } \
|
||||
{
|
||||
ASC_file_exec_qry 1
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_append_unit_to_query
|
||||
ASC_execute_query_for_count
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#--------------------------------------------
|
||||
proc DBC_insert {} {
|
||||
#--------------------------------------------
|
||||
|
||||
ASC_insert
|
||||
}
|
||||
|
||||
proc ASC_append_unit_to_query {} \
|
||||
{
|
||||
global dbc_search_units
|
||||
global dbc_query
|
||||
global asc_units
|
||||
|
||||
|
||||
|
||||
set lhs "\$asc_database(\$db_row,_unitt)"
|
||||
|
||||
set subquery1 "($lhs == \"$asc_units(unknown)\")"
|
||||
set subquery2 "($lhs == \"$dbc_search_units\")"
|
||||
|
||||
set subquery "($subquery1 || $subquery2)"
|
||||
|
||||
set dbc_query "$dbc_query && $subquery"
|
||||
|
||||
}
|
||||
|
||||
proc ASC_file_exec_qry { for_count } \
|
||||
{
|
||||
#
|
||||
# Executes the query on a file depending on the current setting
|
||||
# of the dbc_search_units
|
||||
#
|
||||
# for_count = 1 => do only execute_query_for_count
|
||||
|
||||
|
||||
|
||||
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global dbc_query_count
|
||||
global dbc_query
|
||||
global units_from_query
|
||||
|
||||
if {[info exists units_from_query]} {
|
||||
set dbc_search_units $units_from_query
|
||||
unset units_from_query
|
||||
}
|
||||
|
||||
if { $dbc_search_units == $asc_units(mm) } \
|
||||
{
|
||||
set file_name $asc_mm_file_name
|
||||
set units $asc_units(mm)
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set file_name $asc_inch_file_name
|
||||
set units $asc_units(inch)
|
||||
}
|
||||
|
||||
set dbc_query_count 0
|
||||
if { $for_count == 1 } \
|
||||
{
|
||||
set ret_cd [ASC_file_execute_query_for_count $file_name $units]
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set ret_cd [ASC_file_execute_query $file_name $units]
|
||||
}
|
||||
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_file_search_libref { libref db_row_ref } \
|
||||
{
|
||||
upvar $db_row_ref db_row
|
||||
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global asc_file_name
|
||||
|
||||
|
||||
#
|
||||
# We search in mm and inch file for the desired libref
|
||||
#
|
||||
set found 2
|
||||
if { $dbc_search_units == $asc_units(mm) } \
|
||||
{
|
||||
#
|
||||
# Start with the mm file
|
||||
if { $asc_mm_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_mm_file_name $asc_units(mm) \
|
||||
LIBRF $libref db_row]
|
||||
if { $found != 0 } \
|
||||
{
|
||||
# Not found -> Try again with the inch file
|
||||
if { $asc_inch_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_inch_file_name $asc_units(inch) \
|
||||
LIBRF $libref db_row]
|
||||
}
|
||||
}
|
||||
}
|
||||
} \
|
||||
else \
|
||||
{
|
||||
#
|
||||
# Start with the inch file
|
||||
if { $asc_inch_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_inch_file_name $asc_units(inch) \
|
||||
LIBRF $libref db_row]
|
||||
if { $found != 0 } \
|
||||
{
|
||||
# Not found -> Try again with the mm file
|
||||
if { $asc_mm_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_mm_file_name $asc_units(mm) \
|
||||
LIBRF $libref db_row]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if { $found == 2 } \
|
||||
{
|
||||
set message "Error retrieving segmented tool from external library."
|
||||
set message "$message \n Tool with the library reference $libref"
|
||||
set message "$message \n does not exist in the"
|
||||
set message "$message \n ASCII Data File(s):"
|
||||
set message "$message \n $asc_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
if { $found == 1 } \
|
||||
{
|
||||
set message "Error retrieving segmented tool from external library."
|
||||
set message "$message \n Neither of the files"
|
||||
set message "$message \n $asc_mm_file_name"
|
||||
set message "$message \n $asc_inch_file_name"
|
||||
set message "$message \n can be read."
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_array_search_libref { libref db_row_ref } \
|
||||
{
|
||||
upvar $db_row_ref db_row
|
||||
|
||||
global asc_file_name
|
||||
|
||||
set found [ASC_array_find_object_by_att LIBRF $libref db_row ]
|
||||
|
||||
if { $found == 2 } \
|
||||
{
|
||||
set db_row -1
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_load_segment_data {} \
|
||||
{
|
||||
global dbc_attr_count
|
||||
global dbc_attr_aliases
|
||||
global dbc_attr_id
|
||||
global dbc_libref
|
||||
global dbc_query_count
|
||||
|
||||
global dbc_segment_count
|
||||
global dbc_segment_seqno
|
||||
global dbc_segment_length
|
||||
global dbc_segment_diameter
|
||||
global dbc_segment_height
|
||||
global dbc_segment_angle
|
||||
global dbc_segment_radius
|
||||
global dbc_segment_sweep_angle
|
||||
global dbc_segment_tracking_point
|
||||
|
||||
global asc_database_count
|
||||
|
||||
# Initialize environment
|
||||
set dbc_segment_count 0
|
||||
|
||||
# Cycle database looking for matching data records
|
||||
for {set db_row 0} {$db_row < $asc_database_count} { incr db_row 1} \
|
||||
{
|
||||
set tmp_libref [ASC_ask_att_val LIBRF $db_row "" 0 flag]
|
||||
if {$tmp_libref == $dbc_libref} \
|
||||
{
|
||||
# Set common data
|
||||
set dbc_segment_seqno($dbc_segment_count) [ASC_ask_att_val \
|
||||
SEQ $db_row "%d" 0 flag]
|
||||
|
||||
# Get type of segment
|
||||
set type [ASC_ask_att_val STYPE $db_row "" 0 flag]
|
||||
|
||||
# Mill Form
|
||||
if {$type == "0" } \
|
||||
{
|
||||
set dbc_segment_length($dbc_segment_count) [ASC_ask_att_val \
|
||||
LEN $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_segment_angle($dbc_segment_count) [ASC_ask_att_val \
|
||||
ANGLE $db_row "%s" 0 flag]
|
||||
set dbc_segment_radius($dbc_segment_count) [ASC_ask_att_val \
|
||||
RAD $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_segment_sweep_angle($dbc_segment_count) [ASC_ask_att_val \
|
||||
SWEEP $db_row "%s" 0 flag]
|
||||
} elseif {$type == "1" } \
|
||||
{
|
||||
# Step Drill
|
||||
set dbc_segment_diameter($dbc_segment_count) [ASC_ask_att_val \
|
||||
DIAM $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_segment_height($dbc_segment_count) [ASC_ask_att_val \
|
||||
HEI $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_segment_angle($dbc_segment_count) [ASC_ask_att_val \
|
||||
ANGLE $db_row "%s" 0 flag]
|
||||
set dbc_segment_radius($dbc_segment_count) [ASC_ask_att_val \
|
||||
RAD $db_row "%$::double_precision_format" 0 flag]
|
||||
} elseif {$type == "2" } \
|
||||
{
|
||||
# Turn Form
|
||||
set dbc_segment_tracking_point($dbc_segment_count) [ASC_ask_att_val \
|
||||
TP $db_row "%d" 0 flag]
|
||||
set dbc_segment_radius($dbc_segment_count) [ASC_ask_att_val \
|
||||
RADIUS $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_segment_angle($dbc_segment_count) [ASC_ask_att_val \
|
||||
ANGLE $db_row "%s" 0 flag]
|
||||
set dbc_segment_length($dbc_segment_count) [ASC_ask_att_val \
|
||||
LENGTH $db_row "%$::double_precision_format" 0 flag]
|
||||
}
|
||||
|
||||
incr dbc_segment_count
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_insert {} \
|
||||
{
|
||||
global asc_database_name
|
||||
global asc_file_name
|
||||
global asc_units
|
||||
global dbc_part_units
|
||||
global dbc_event_error
|
||||
global dbc_logname
|
||||
|
||||
global dbc_class
|
||||
global dbc_libref
|
||||
global dbc_segment_count
|
||||
|
||||
global dbc_clsf_decimal_places
|
||||
global mom_clsf_decimal_places
|
||||
|
||||
global asc_cur_line
|
||||
global asc_record_type
|
||||
global asc_class
|
||||
global asc_record_libref
|
||||
|
||||
global num_formats_processed
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(mm)]
|
||||
} else \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(inch)]
|
||||
}
|
||||
|
||||
set asc_tempname $base_filename
|
||||
append asc_tempname "_tmp"
|
||||
|
||||
set asc_backupname $base_filename
|
||||
append asc_backupname "_bak"
|
||||
|
||||
# back up the existing version of the library
|
||||
if [catch {file copy -force $base_filename $asc_backupname} ] \
|
||||
{
|
||||
set dbc_event_error "Can't create backup file $asc_backupname."
|
||||
return
|
||||
}
|
||||
|
||||
# open temp file and current library file
|
||||
if [catch {open $asc_tempname w} tmp_fileid] \
|
||||
{
|
||||
set dbc_event_error "Error opening $asc_tempname"
|
||||
return
|
||||
}
|
||||
|
||||
if [catch {open $base_filename r} input_fileid] \
|
||||
{
|
||||
set dbc_event_error "Error opening $base_filename"
|
||||
return
|
||||
}
|
||||
|
||||
# Cycle over all the records in the input file looking for the spot
|
||||
# to insert the input segment set
|
||||
set segments_output 0
|
||||
while {[gets $input_fileid asc_cur_line] >= 0} \
|
||||
{
|
||||
ASC_classify_line
|
||||
switch -- $asc_record_type \
|
||||
{
|
||||
"Comment"
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Revision"
|
||||
{
|
||||
# output a new revision line for the new entry and then the input record
|
||||
set daytime [clock seconds]
|
||||
set out_daytime [clock format $daytime -format "%a %b %d %Y %I:%M %p"]
|
||||
set cur_rev "# $dbc_logname $out_daytime"
|
||||
append cur_rev " Saving $dbc_libref"
|
||||
|
||||
puts $tmp_fileid $cur_rev
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Class"
|
||||
{
|
||||
# Save indicator for this class matching the input class
|
||||
set class_match [string compare $dbc_class $asc_class]
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Format"
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Data"
|
||||
{
|
||||
set libref_cmp [string compare $asc_record_libref $dbc_libref]
|
||||
|
||||
# If this data record isn't for the class we're trying to insert, just
|
||||
# pass it to the output file. Otherwise, compare the librefs and
|
||||
# determine if it needs to be output yet.
|
||||
if { $class_match != 0 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == -1 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == 0 } \
|
||||
{
|
||||
if { $segments_output == 0 } \
|
||||
{
|
||||
ASC_output_segments $tmp_fileid
|
||||
incr segments_output
|
||||
}
|
||||
} else \
|
||||
{
|
||||
if { $segments_output == 0 } \
|
||||
{
|
||||
ASC_output_segments $tmp_fileid
|
||||
incr segments_output
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
"End Data"
|
||||
{
|
||||
# If this End Data record is for the class we're trying to insert,
|
||||
# check if the segments have been output yet. If not,
|
||||
# output them now and then this record.
|
||||
if { $class_match == 0 } \
|
||||
{
|
||||
if { $segments_output == 0 } \
|
||||
{
|
||||
ASC_output_segments $tmp_fileid
|
||||
incr segments_output
|
||||
}
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Close the input and output files
|
||||
if [catch {close $tmp_fileid} ] \
|
||||
{
|
||||
set dbc_event_error "Error closing $asc_tempname"
|
||||
return
|
||||
}
|
||||
if [catch {close $input_fileid} ] \
|
||||
{
|
||||
set dbc_event_error "Error closing $base_filename"
|
||||
return
|
||||
}
|
||||
|
||||
# Rename the output file to the current file name, since we have already
|
||||
# copied the current library into a backup file.
|
||||
if [catch {file rename -force $asc_tempname $base_filename} ] \
|
||||
{
|
||||
global errorInfo
|
||||
set dbc_event_error "Can't update library file $base_filename."
|
||||
}
|
||||
|
||||
# Reinitialize the database to update the run-time data since this doesn't
|
||||
# automatically happen on subsequent access attempts.
|
||||
DBC_init_db
|
||||
}
|
||||
|
||||
proc ASC_output_segments { fileid } \
|
||||
{
|
||||
global dbc_libref
|
||||
global dbc_class
|
||||
global dbc_segment_count
|
||||
|
||||
global dbc_segment_seqno
|
||||
global dbc_segment_length
|
||||
global dbc_segment_angle
|
||||
global dbc_segment_radius
|
||||
global dbc_segment_sweep_angle
|
||||
global dbc_segment_diameter
|
||||
global dbc_segment_height
|
||||
global dbc_segment_tracking_point
|
||||
global dbc_segment_angle_decimal_place
|
||||
|
||||
set dp $dbc_segment_angle_decimal_place
|
||||
|
||||
switch -- $dbc_class \
|
||||
{
|
||||
"MILL_FORM"
|
||||
{
|
||||
for {set segment_count 0 } { $segment_count < $dbc_segment_count} {incr segment_count} \
|
||||
{
|
||||
set data_line [format "DATA | %s | 1 | 0 | %d | %9.5f | %9.${dp}f | %9.5f | %9.${dp}f" \
|
||||
$dbc_libref \
|
||||
$dbc_segment_seqno($segment_count) \
|
||||
$dbc_segment_length($segment_count) $dbc_segment_angle($segment_count) \
|
||||
$dbc_segment_radius($segment_count) $dbc_segment_sweep_angle($segment_count)]
|
||||
puts $fileid $data_line
|
||||
}
|
||||
}
|
||||
"STEP_DRILL"
|
||||
{
|
||||
for {set segment_count 0 } { $segment_count < $dbc_segment_count} {incr segment_count} \
|
||||
{
|
||||
set data_line [format "DATA | %s | 1 | 1 | %d | %9.5f | %9.5f | %9.${dp}f | %9.5f" \
|
||||
$dbc_libref \
|
||||
$dbc_segment_seqno($segment_count) \
|
||||
$dbc_segment_diameter($segment_count) $dbc_segment_height($segment_count) \
|
||||
$dbc_segment_angle($segment_count) $dbc_segment_radius($segment_count)]
|
||||
puts $fileid $data_line
|
||||
}
|
||||
}
|
||||
"TURN_FORM"
|
||||
{
|
||||
for {set segment_count 0 } { $segment_count < $dbc_segment_count} {incr segment_count} \
|
||||
{
|
||||
set data_line [format "DATA | %s | 1 | 2 | %d | %d | %9.5f | %9.${dp}f | %9.5f" \
|
||||
$dbc_libref \
|
||||
$dbc_segment_seqno($segment_count) \
|
||||
$dbc_segment_tracking_point($segment_count) $dbc_segment_radius($segment_count) \
|
||||
$dbc_segment_angle($segment_count) $dbc_segment_length($segment_count) ]
|
||||
puts $fileid $data_line
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_classify_line { } \
|
||||
{
|
||||
global asc_cur_line
|
||||
global asc_class
|
||||
global asc_record_libref
|
||||
global asc_record_type
|
||||
|
||||
# First check if record is some form of comment
|
||||
if {[string match {#*} $asc_cur_line] == 1} \
|
||||
{
|
||||
# It does. Sort out what kind
|
||||
if {[string match #END_DATA $asc_cur_line] == 1} \
|
||||
{
|
||||
set asc_record_type "End Data"
|
||||
} elseif {[string match *CLASS* $asc_cur_line] == 1} \
|
||||
{
|
||||
# We have a Class specification. Extract the class
|
||||
set asc_record_type "Class"
|
||||
set asc_class [string trimright $asc_cur_line]
|
||||
set tmp_ix [string first CLASS $asc_class]
|
||||
set tmp_iy [string wordend $asc_class $tmp_ix]
|
||||
set asc_class [string range $asc_class $tmp_iy end]
|
||||
set asc_class [string trimleft $asc_class]
|
||||
} elseif {[string match *dbc_logname* $asc_cur_line] == 1} \
|
||||
{
|
||||
set asc_record_type "Revision"
|
||||
} else \
|
||||
{
|
||||
set asc_record_type "Comment"
|
||||
}
|
||||
} elseif {[string match {FORMAT*} $asc_cur_line] == 1 } \
|
||||
{
|
||||
set asc_record_type "Format"
|
||||
} elseif {[string match {DATA*} $asc_cur_line] ==1} \
|
||||
{
|
||||
# We have a DATA record.
|
||||
set asc_record_type "Data"
|
||||
|
||||
# Extract the libref from this data record
|
||||
set tmp_ix [string first | $asc_cur_line]
|
||||
incr tmp_ix
|
||||
set asc_record_libref [string range $asc_cur_line $tmp_ix end]
|
||||
set tmp_iy [string first | $asc_record_libref]
|
||||
incr tmp_iy -1
|
||||
set asc_record_libref [string range $asc_record_libref 0 $tmp_iy]
|
||||
set asc_record_libref [string trim $asc_record_libref]
|
||||
} else \
|
||||
{
|
||||
# This doesn't match any previous types, so it is probably a blank line.
|
||||
# Whatever it is, treat it as a comment and pass it through.
|
||||
set asc_record_type "Comment"
|
||||
}
|
||||
}
|
||||
|
||||
# To enable the new customization mechanism.
|
||||
# This should ALWAYS be the last line in the file.
|
||||
MOM_extend_for_customization UGII_CAM_CUSTOM_LIBRARY_TOOL_ASCII_DIR dbc_custom_segmented_tool_ascii.tcl
|
||||
|
||||
25
tool/ascii/segmented_tool_ascii_custom.tcl
Normal file
25
tool/ascii/segmented_tool_ascii_custom.tcl
Normal file
@@ -0,0 +1,25 @@
|
||||
###############################################################################
|
||||
# segmented_tool_ascii_custom.tcl - This is the customization file that will be sourced in
|
||||
# after the segmented_tool_ascii.tcl is sourced in. This file is supplied as a sample and should be
|
||||
# copied and modified and placed in a different location than the NX installation and the directory
|
||||
# should be pointed to by the environment variable UGII_CAM_CUSTOM_LIBRARY_TOOL_ASCII_DIR
|
||||
###############################################################################
|
||||
|
||||
|
||||
# Global variable override
|
||||
set ::dbc_segment_angle_decimal_place 8
|
||||
|
||||
namespace eval CUSTOM \
|
||||
{
|
||||
# The proc in the CUSTOM namespace will be called instead of the system DBC_retrieve to enable
|
||||
# user customization
|
||||
proc DBC_retrieve {} \
|
||||
{
|
||||
# Take custom action before the system/global namespace DBC_retrieve
|
||||
|
||||
#Call to the system/global DBC_retrieve
|
||||
::DBC_retrieve
|
||||
|
||||
# Take custom action after the system/global namespace DBC_retrieve
|
||||
}
|
||||
}
|
||||
145
tool/ascii/shank_ascii.def
Normal file
145
tool/ascii/shank_ascii.def
Normal file
@@ -0,0 +1,145 @@
|
||||
################################################################################
|
||||
# This is the definition file for tool shanks with an ASCII File as the
|
||||
# database
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
DB_PREFIX "DB("
|
||||
DB_SUFFIX ")"
|
||||
ESS_PREFIX "ESS("
|
||||
ESS_SUFFIX ")"
|
||||
|
||||
|
||||
#############################################################################
|
||||
# The list of DB_ALIAS
|
||||
#
|
||||
# All the <alias> defined here can be used in the class description at the end
|
||||
# of this file in order to define the fields that should appear in
|
||||
# the search criteria and search result dialogs within UG for every class.
|
||||
#
|
||||
# DB_ALIAS <alias>
|
||||
# {
|
||||
# DB_ID < Attribute Identifier defined in the ASCII Data File >
|
||||
# DB_ID_TYPE < Type of the identifier >
|
||||
# d _ double
|
||||
# i _ integer
|
||||
# s _ string
|
||||
# OPTIONS "opt1" "opt2 " "opt3"
|
||||
# OPTIONS_IDS "val1" "val2" "val3"
|
||||
# DIALOG_NAME "label in search criteria dialog"
|
||||
# RSET_NAME "label in search result dialog"
|
||||
# }
|
||||
#
|
||||
# OPTIONS and OPTIONS_IDS can be ommitted, If they are specified
|
||||
# then a corresponding option menu is created in the Search Criteria Dialog
|
||||
# instead of a simple search field.
|
||||
#############################################################################
|
||||
|
||||
# The DB_ALIAS of the library reference. It is mandatory that this DB_ALIAS
|
||||
# appears in the alias list
|
||||
#
|
||||
DB_ALIAS libref
|
||||
{
|
||||
DB_ID LIBRF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Libref"
|
||||
RSET_NAME "Libref"
|
||||
}
|
||||
|
||||
|
||||
DB_ALIAS RecType
|
||||
{
|
||||
DB_ID RTYPE
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
##################################################################
|
||||
|
||||
DB_ALIAS Type
|
||||
{
|
||||
DB_ID STYPE
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS N_Sections
|
||||
{
|
||||
DB_ID SNUM
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Description
|
||||
{
|
||||
DB_ID DESCR
|
||||
DB_ID_TYPE s
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
|
||||
DB_ALIAS Seq_no
|
||||
{
|
||||
DB_ID SEQ
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
|
||||
DB_ALIAS Diameter
|
||||
{
|
||||
DB_ID DIAM
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(D) Diameter "
|
||||
RSET_NAME "(D) Diameter "
|
||||
}
|
||||
|
||||
DB_ALIAS Height
|
||||
{
|
||||
DB_ID LENGTH
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(L) Height"
|
||||
RSET_NAME "(L) Height"
|
||||
}
|
||||
|
||||
DB_ALIAS TaperAngle
|
||||
{
|
||||
DB_ID TAPER
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(B) Taper Angle"
|
||||
RSET_NAME "(B) Taper Angle"
|
||||
}
|
||||
|
||||
DB_ALIAS CornerRadius
|
||||
{
|
||||
DB_ID CRAD
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "(R1) Corner Radius"
|
||||
RSET_NAME "(R1) Corner Radius"
|
||||
}
|
||||
|
||||
|
||||
###################################################################
|
||||
#################################################################
|
||||
|
||||
|
||||
LIBREF libref
|
||||
|
||||
|
||||
#########################################################################
|
||||
# The Class Hierarchy #
|
||||
#########################################################################
|
||||
|
||||
CLASS SHANK
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(libref)] != [0] && DB(RecType) == [1]"
|
||||
DIALOG libref
|
||||
RSET libref Type
|
||||
UI_NAME "Shank"
|
||||
|
||||
CLASS MILLING_DRILLING
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [01]"
|
||||
DIALOG libref Type
|
||||
RSET libref Description N_Sections
|
||||
UI_NAME "Milling_Drilling"
|
||||
}
|
||||
}
|
||||
949
tool/ascii/shank_ascii.tcl
Normal file
949
tool/ascii/shank_ascii.tcl
Normal file
@@ -0,0 +1,949 @@
|
||||
###############################################################################
|
||||
# shank.tcl - DBC Event Handler for database stored as ascii file
|
||||
###############################################################################
|
||||
#
|
||||
|
||||
# Default double precision value format.
|
||||
set double_precision_format "g"
|
||||
|
||||
proc ASC_t_create_filename {env_var_name filename} \
|
||||
{
|
||||
#
|
||||
# Creates a complete filename by evaluating an environment variable
|
||||
# for the directory information
|
||||
#
|
||||
set env_var [MOM_ask_env_var $env_var_name]
|
||||
if { $env_var == "" } \
|
||||
{
|
||||
set message "Can't read environment variable $env_var_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
set fname ""
|
||||
set fname [append fname $env_var $filename]
|
||||
|
||||
return $fname
|
||||
}
|
||||
|
||||
proc MOM__boot {} \
|
||||
{
|
||||
|
||||
# source some general procedures
|
||||
|
||||
#
|
||||
# dbc_ascii_general.tcl
|
||||
#
|
||||
set filename \
|
||||
[ASC_t_create_filename "UGII_UG_LIBRARY_DIR" "dbc_ascii_general.tcl"]
|
||||
if { [catch {source $filename}] == "1" } \
|
||||
{
|
||||
set message "Can't load .tcl file: $filename"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc MOM__halt {} \
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_init_db {} \
|
||||
{
|
||||
|
||||
global asc_debug
|
||||
global asc_file_name
|
||||
global asc_units
|
||||
global asc_part_units
|
||||
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global asc_file_loaded
|
||||
global asc_file_load_limit
|
||||
|
||||
|
||||
#
|
||||
# Global variables set by DBC for Input/Output
|
||||
#
|
||||
|
||||
global dbc_lhs_exp
|
||||
global dbc_rhs_exp
|
||||
global dbc_relop
|
||||
global dbc_query
|
||||
global dbc_subqry1
|
||||
global dbc_subqry2
|
||||
global dbc_boolop
|
||||
global dbc_class_name
|
||||
global dbc_attr_count
|
||||
global dbc_attr_id
|
||||
global dbc_query_count
|
||||
global dbc_libref
|
||||
global dbc_var_list
|
||||
#
|
||||
# This is path+name of the shank_database.dat file
|
||||
# where a shank gets exported.
|
||||
# It is used within NX CAM to provide feedback
|
||||
# to the user about tool export
|
||||
#
|
||||
global dbc_export_file_name
|
||||
|
||||
|
||||
set dbc_lhs_exp ""
|
||||
set dbc_rhs_exp ""
|
||||
set dbc_relop ""
|
||||
set dbc_query ""
|
||||
set dbc_subqry1 ""
|
||||
set dbc_subqry2 ""
|
||||
set dbc_boolop ""
|
||||
set dbc_class_name ""
|
||||
set dbc_attr_count 0
|
||||
set dbc_attr_id ""
|
||||
set dbc_query_count 0
|
||||
set dbc_libref ""
|
||||
set dbc_var_list ""
|
||||
|
||||
set asc_debug 0
|
||||
set asc_file_name ""
|
||||
set dbc_export_file_name ""
|
||||
set asc_part_units ""
|
||||
set dbc_cutter_ass_units ""
|
||||
|
||||
#
|
||||
# Set the unit for tool search to the part unit
|
||||
#
|
||||
ASC_set_part_unit
|
||||
|
||||
#
|
||||
# ask the mm and inch filenames
|
||||
#
|
||||
set asc_mm_file_name [ASC_get_data_file_name $asc_units(mm)]
|
||||
set asc_inch_file_name [ASC_get_data_file_name $asc_units(inch)]
|
||||
if { $asc_mm_file_name == "" && $asc_inch_file_name == "" } \
|
||||
{
|
||||
set message "Error looking for a shank_database.dat file."
|
||||
set message "$message \n Neither of the environment variables"
|
||||
set message "$message \n UGII_CAM_LIBRARY_TOOL_METRIC_DIR,"
|
||||
set message "$message \n UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR"
|
||||
set message "$message \n is defined."
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
#
|
||||
# mm file
|
||||
#
|
||||
set app 0
|
||||
set mm_file_loaded 0
|
||||
|
||||
set ret_cd [ASC_load_data_file $asc_mm_file_name $asc_units(mm) $app]
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $asc_mm_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
set app 1
|
||||
set mm_file_loaded 1
|
||||
|
||||
#
|
||||
# and then inch file
|
||||
#
|
||||
set inch_file_loaded 0
|
||||
|
||||
set ret_cd [ASC_load_data_file $asc_inch_file_name $asc_units(inch) $app]
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $asc_inch_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
set inch_file_loaded 1
|
||||
|
||||
#
|
||||
# if mm or inch or both files are loaded set the flag
|
||||
#
|
||||
if { $inch_file_loaded == 1 || $mm_file_loaded == 1 } \
|
||||
{
|
||||
set asc_file_loaded 1
|
||||
}
|
||||
|
||||
#
|
||||
# This variable is only used for error messages
|
||||
#
|
||||
set asc_file_name " $asc_mm_file_name"
|
||||
set asc_file_name "$asc_file_name \n $asc_inch_file_name"
|
||||
|
||||
}
|
||||
|
||||
proc ASC_get_data_file_name { unit } \
|
||||
{
|
||||
#
|
||||
# Returns the filename for ASCII Data File depending on the
|
||||
# specified unit.
|
||||
#
|
||||
global asc_units
|
||||
|
||||
if {$unit == $asc_units(mm)} \
|
||||
{
|
||||
set env_var_name UGII_CAM_LIBRARY_TOOL_METRIC_DIR
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set env_var_name UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR
|
||||
}
|
||||
|
||||
set env_var [MOM_ask_env_var $env_var_name]
|
||||
if { $env_var == "" } \
|
||||
{
|
||||
return ""
|
||||
}
|
||||
|
||||
set fname ""
|
||||
set fname [append fname $env_var "shank_database.dat"]
|
||||
|
||||
return $fname
|
||||
}
|
||||
|
||||
proc ASC_set_part_unit {} \
|
||||
{
|
||||
|
||||
global dbc_part_units
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
|
||||
MOM_ask_part_units ;# writes to dbc_part_units
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set dbc_search_units $asc_units(mm)
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set dbc_search_units $asc_units(inch)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_retrieve {} {
|
||||
#---------------------------------------------
|
||||
ASC_retrieve
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc ASC_retrieve {} {
|
||||
#---------------------------------------------
|
||||
#
|
||||
# global input
|
||||
# ------------
|
||||
global asc_debug
|
||||
global asc_units
|
||||
|
||||
global dbc_search_units
|
||||
|
||||
global dbc_libref
|
||||
global db_row
|
||||
|
||||
global asc_file_loaded
|
||||
global asc_database
|
||||
global asc_database_count
|
||||
global asc_file_name
|
||||
|
||||
global uglib_shank_type ;# UG/Library shank type
|
||||
|
||||
#
|
||||
# global output
|
||||
# -------------
|
||||
global dbc_shank_count
|
||||
global dbc_shank_type
|
||||
global dbc_shank_num_sections
|
||||
global dbc_shank_description
|
||||
global dbc_query
|
||||
global dbc_query_count
|
||||
global dbc_cutter_ass_units
|
||||
|
||||
if { $asc_debug == "1" } \
|
||||
{
|
||||
puts " =========================================="
|
||||
puts " procedure DBC_retrieve for tool shank"
|
||||
puts " libref -> $dbc_libref"
|
||||
}
|
||||
|
||||
# initialize section count so we can detect if retrieval failed
|
||||
set dbc_shank_num_sections 0
|
||||
|
||||
#
|
||||
# Look for the desired libref
|
||||
#
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
|
||||
if {$db_row >= 0} \
|
||||
{
|
||||
set units [ASC_ask_att_val _unitt $db_row "" $asc_units(mm) flag]
|
||||
if { "$units" == "$asc_units(mm)" } \
|
||||
{
|
||||
set dbc_cutter_ass_units 0
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set dbc_cutter_ass_units 1
|
||||
}
|
||||
|
||||
set dbc_shank_type [ASC_ask_att_val STYPE $db_row "%d" 0 flag]
|
||||
set dbc_shank_description [ASC_ask_att_val DESCR $db_row "" "" flag]
|
||||
if {$dbc_shank_type == 1 } {
|
||||
set dbc_shank_num_sections [ASC_ask_att_val SNUM $db_row "%d" 0 flag]
|
||||
}
|
||||
|
||||
ASC_load_shank_data
|
||||
}
|
||||
}
|
||||
|
||||
proc DBC_ask_library_values {} \
|
||||
{
|
||||
#
|
||||
# global input
|
||||
global dbc_libref
|
||||
global dbc_db_ids_count
|
||||
global dbc_db_ids
|
||||
|
||||
global asc_file_loaded
|
||||
|
||||
#
|
||||
# global output
|
||||
global dbc_db_ids_value
|
||||
|
||||
|
||||
#
|
||||
# Look for the desired libref
|
||||
#
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
#
|
||||
# and set the desired values
|
||||
#
|
||||
for { set inx 0 } { $inx < $dbc_db_ids_count } { incr inx } \
|
||||
{
|
||||
set dbc_db_ids_value($dbc_db_ids($inx)) \
|
||||
[ASC_ask_att_val $dbc_db_ids($inx) $db_row "" "" flag]
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_translate_att_alias {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_translate_att_alias
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_create_criterion {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_create_criterion
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_create_query {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_create_query
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_execute_query {} {
|
||||
#---------------------------------------------
|
||||
|
||||
|
||||
global asc_file_loaded
|
||||
global dbc_query
|
||||
global dbc_search_units
|
||||
|
||||
if { $asc_file_loaded == 0 } \
|
||||
{
|
||||
ASC_file_exec_qry 0
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_append_unit_to_query
|
||||
ASC_execute_query
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_execute_query_for_count {} {
|
||||
#---------------------------------------------
|
||||
|
||||
global asc_file_loaded
|
||||
global dbc_query
|
||||
|
||||
if { $asc_file_loaded == 0 } \
|
||||
{
|
||||
ASC_file_exec_qry 1
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_append_unit_to_query
|
||||
ASC_execute_query_for_count
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#--------------------------------------------
|
||||
proc DBC_insert {} {
|
||||
#--------------------------------------------
|
||||
ASC_insert
|
||||
}
|
||||
|
||||
proc ASC_append_unit_to_query {} \
|
||||
{
|
||||
global dbc_search_units
|
||||
global dbc_query
|
||||
global asc_units
|
||||
|
||||
|
||||
|
||||
set lhs "\$asc_database(\$db_row,_unitt)"
|
||||
|
||||
set subquery1 "($lhs == \"$asc_units(unknown)\")"
|
||||
set subquery2 "($lhs == \"$dbc_search_units\")"
|
||||
|
||||
set subquery "($subquery1 || $subquery2)"
|
||||
|
||||
set dbc_query "$dbc_query && $subquery"
|
||||
|
||||
}
|
||||
|
||||
proc ASC_file_exec_qry { for_count } \
|
||||
{
|
||||
#
|
||||
# Executes the query on a file depending on the current setting
|
||||
# of the dbc_search_units
|
||||
#
|
||||
# for_count = 1 => do only execute_query_for_count
|
||||
|
||||
|
||||
|
||||
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global dbc_query_count
|
||||
global dbc_query
|
||||
global units_from_query
|
||||
|
||||
if {[info exists units_from_query]} {
|
||||
set dbc_search_units $units_from_query
|
||||
unset units_from_query
|
||||
}
|
||||
|
||||
if { $dbc_search_units == $asc_units(mm) } \
|
||||
{
|
||||
set file_name $asc_mm_file_name
|
||||
set units $asc_units(mm)
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set file_name $asc_inch_file_name
|
||||
set units $asc_units(inch)
|
||||
}
|
||||
|
||||
set dbc_query_count 0
|
||||
if { $for_count == 1 } \
|
||||
{
|
||||
set ret_cd [ASC_file_execute_query_for_count $file_name $units]
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set ret_cd [ASC_file_execute_query $file_name $units]
|
||||
}
|
||||
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_file_search_libref { libref db_row_ref } \
|
||||
{
|
||||
upvar $db_row_ref db_row
|
||||
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global asc_file_name
|
||||
|
||||
|
||||
#
|
||||
# We search in mm and inch file for the desired libref
|
||||
#
|
||||
set found 2
|
||||
if { $dbc_search_units == $asc_units(mm) } \
|
||||
{
|
||||
#
|
||||
# Start with the mm file
|
||||
if { $asc_mm_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_mm_file_name $asc_units(mm) \
|
||||
LIBRF $libref db_row]
|
||||
if { $found != 0 } \
|
||||
{
|
||||
# Not found -> Try again with the inch file
|
||||
if { $asc_inch_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_inch_file_name $asc_units(inch) \
|
||||
LIBRF $libref db_row]
|
||||
}
|
||||
}
|
||||
}
|
||||
} \
|
||||
else \
|
||||
{
|
||||
#
|
||||
# Start with the inch file
|
||||
if { $asc_inch_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_inch_file_name $asc_units(inch) \
|
||||
LIBRF $libref db_row]
|
||||
if { $found != 0 } \
|
||||
{
|
||||
# Not found -> Try again with the mm file
|
||||
if { $asc_mm_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_mm_file_name $asc_units(mm) \
|
||||
LIBRF $libref db_row]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if { $found == 2 } \
|
||||
{
|
||||
set message "Error retrieving shank from external library."
|
||||
set message "$message \n Shank with the library reference $libref"
|
||||
set message "$message \n does not exist in the"
|
||||
set message "$message \n ASCII Data File(s):"
|
||||
set message "$message \n $asc_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
if { $found == 1 } \
|
||||
{
|
||||
set message "Error retrieving shank from external library."
|
||||
set message "$message \n Neither of the files"
|
||||
set message "$message \n $asc_mm_file_name"
|
||||
set message "$message \n $asc_inch_file_name"
|
||||
set message "$message \n can be read."
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_array_search_libref { libref db_row_ref } \
|
||||
{
|
||||
upvar $db_row_ref db_row
|
||||
|
||||
global asc_file_name
|
||||
|
||||
set found [ASC_array_find_object_by_att LIBRF $libref db_row ]
|
||||
|
||||
if { $found == 2 } \
|
||||
{
|
||||
set db_row -1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
proc ASC_load_shank_data {} \
|
||||
{
|
||||
global dbc_shank_type
|
||||
|
||||
if {$dbc_shank_type == 1} {
|
||||
ASC_load_milling_shank_data
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_load_milling_shank_data {} \
|
||||
{
|
||||
global dbc_attr_count
|
||||
global dbc_attr_aliases
|
||||
global dbc_attr_id
|
||||
global dbc_libref
|
||||
global dbc_query_count
|
||||
|
||||
global dbc_seqno
|
||||
global dbc_hld_diam
|
||||
global dbc_hld_hgt
|
||||
global dbc_hld_taper
|
||||
global dbc_hld_corner
|
||||
|
||||
global asc_database_count
|
||||
|
||||
# Initialize environment
|
||||
set dbc_query_count 0
|
||||
|
||||
# Cycle database looking for matching data records
|
||||
for {set db_row 0} {$db_row < $asc_database_count} { incr db_row 1} \
|
||||
{
|
||||
set tmp_libref [ASC_ask_att_val LIBRF $db_row "" 0 flag]
|
||||
if {$tmp_libref == $dbc_libref} \
|
||||
{
|
||||
set rtype [ASC_ask_att_val RTYPE $db_row "" 0 flag]
|
||||
if {$rtype == "2" } \
|
||||
{
|
||||
set dbc_seqno($dbc_query_count) [ASC_ask_att_val SEQ $db_row "" 0 flag]
|
||||
set dbc_hld_diam($dbc_query_count) [ASC_ask_att_val DIAM $db_row "" 0 flag]
|
||||
set dbc_hld_hgt($dbc_query_count) [ASC_ask_att_val LENGTH $db_row "" 0 flag]
|
||||
set dbc_hld_taper($dbc_query_count) [ASC_ask_att_val TAPER $db_row "" 0 flag]
|
||||
set dbc_hld_corner($dbc_query_count) [ASC_ask_att_val CRAD $db_row "" 0 flag]
|
||||
|
||||
incr dbc_query_count
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_insert {} \
|
||||
{
|
||||
global asc_database_name
|
||||
global asc_file_name
|
||||
global asc_units
|
||||
global dbc_part_units
|
||||
global dbc_event_error
|
||||
global dbc_logname
|
||||
|
||||
global dbc_class
|
||||
global dbc_cutter_shank_libref
|
||||
global dbc_shank_count
|
||||
global dbc_shank_num_sections
|
||||
global dbc_shank_description
|
||||
global dbc_shank_type
|
||||
|
||||
global dbc_clsf_decimal_places
|
||||
global mom_clsf_decimal_places
|
||||
|
||||
global asc_cur_line
|
||||
global asc_record_type
|
||||
global asc_class
|
||||
global asc_record_libref
|
||||
|
||||
global num_formats_processed
|
||||
|
||||
global dbc_export_file_name
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(mm)]
|
||||
} else \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(inch)]
|
||||
}
|
||||
|
||||
|
||||
set asc_tempname $base_filename
|
||||
append asc_tempname "_tmp"
|
||||
|
||||
set asc_backupname $base_filename
|
||||
append asc_backupname "_bak"
|
||||
|
||||
# back up the existing version of the library
|
||||
if [catch {file copy -force $base_filename $asc_backupname} ] \
|
||||
{
|
||||
set dbc_event_error "Can't create backup file $asc_backupname."
|
||||
return
|
||||
}
|
||||
|
||||
# open temp file and current library file
|
||||
if [catch {open $asc_tempname w} tmp_fileid] \
|
||||
{
|
||||
set dbc_event_error "Error opening $asc_tempname"
|
||||
return
|
||||
}
|
||||
|
||||
if [catch {open $base_filename r} input_fileid] \
|
||||
{
|
||||
set dbc_event_error "Error opening $base_filename"
|
||||
return
|
||||
}
|
||||
|
||||
# initialize processing flags
|
||||
set num_formats_processed 0
|
||||
set directory_record_output 0
|
||||
set section_records_output 0
|
||||
|
||||
|
||||
set new_record \
|
||||
[format "DATA | %s | 1 | %d | %d | %s" \
|
||||
$dbc_cutter_shank_libref $dbc_shank_type $dbc_shank_num_sections $dbc_shank_description]
|
||||
|
||||
# Cycle over all the records in the input file looking for the spot
|
||||
# to insert the input shank
|
||||
while {[gets $input_fileid asc_cur_line] >= 0} \
|
||||
{
|
||||
ASC_classify_line
|
||||
switch -- $asc_record_type \
|
||||
{
|
||||
"Comment"
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Revision"
|
||||
{
|
||||
# output a new revision line for the new entry and then the input record
|
||||
set daytime [clock seconds]
|
||||
set out_daytime [clock format $daytime -format "%a %b %d %Y %I:%M %p"]
|
||||
set cur_rev "# $dbc_logname $out_daytime"
|
||||
append cur_rev " Saving $dbc_cutter_shank_libref"
|
||||
|
||||
puts $tmp_fileid $cur_rev
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Class"
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Format"
|
||||
{
|
||||
incr num_formats_processed
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Directory Data"
|
||||
{
|
||||
set libref_cmp [string compare $asc_record_libref $dbc_cutter_shank_libref]
|
||||
# If the libref is greater than the current record, output the current record
|
||||
if { $libref_cmp == -1 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == 0 } \
|
||||
{
|
||||
# We have a matching directory record. Set the directory record output flag
|
||||
# and output the new record
|
||||
if { $directory_record_output == 0 } \
|
||||
{
|
||||
puts $tmp_fileid $new_record
|
||||
incr directory_record_output
|
||||
}
|
||||
} else \
|
||||
{
|
||||
# The new record belongs between the previous and current record. Output
|
||||
# it here and then the current one.
|
||||
if { $directory_record_output == 0 } \
|
||||
{
|
||||
puts $tmp_fileid $new_record
|
||||
incr directory_record_output
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
"End Directory Data"
|
||||
{
|
||||
# If we haven't output the directory record yet, do it now. Then this rec
|
||||
if { $directory_record_output == 0} \
|
||||
{
|
||||
puts $tmp_fileid $new_record
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Section Data"
|
||||
{
|
||||
set libref_cmp [string compare $asc_record_libref $dbc_cutter_shank_libref]
|
||||
|
||||
# If this data record isn't for the class we're trying to insert, just
|
||||
# pass it to the output file. Otherwise, compare the librefs and
|
||||
# determine if it needs to be output yet.
|
||||
if { [string compare $dbc_class $asc_class] != 0 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == -1 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == 0 } \
|
||||
{
|
||||
if { $section_records_output == 0 } \
|
||||
{
|
||||
ASC_insert_shank_data $tmp_fileid section_records_output
|
||||
}
|
||||
} else \
|
||||
{
|
||||
if { $section_records_output == 0 } \
|
||||
{
|
||||
ASC_insert_shank_data $tmp_fileid section_records_output
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
"End Section Data"
|
||||
{
|
||||
|
||||
# If we haven't output the section records, do it now and then this rec
|
||||
if { $section_records_output == 0 && [string compare $dbc_class $asc_class] == 0} \
|
||||
{
|
||||
ASC_insert_shank_data $tmp_fileid section_records_output
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Close the input and output files
|
||||
if [catch {close $tmp_fileid} ] \
|
||||
{
|
||||
set dbc_event_error "Error closing $asc_tempname"
|
||||
return
|
||||
}
|
||||
if [catch {close $input_fileid} ] \
|
||||
{
|
||||
set dbc_event_error "Error closing $base_filename"
|
||||
return
|
||||
}
|
||||
|
||||
# Rename the output file to the current file name, since we have already
|
||||
# copied the current library into a backup file.
|
||||
if [catch {file rename -force $asc_tempname $base_filename} ] \
|
||||
{
|
||||
global errorInfo
|
||||
set dbc_event_error "Can't update library file $base_filename."
|
||||
}
|
||||
|
||||
# Reinitialize the database to update the run-time data since this doesn't
|
||||
# automatically happen on subsequent access attempts.
|
||||
DBC_init_db
|
||||
|
||||
# Set this here because init_db sets everything to ""
|
||||
set dbc_export_file_name $base_filename
|
||||
}
|
||||
|
||||
proc ASC_insert_shank_data {fileId OUTPUT_MARK} {
|
||||
global dbc_shank_type
|
||||
upvar $OUTPUT_MARK output_mark
|
||||
|
||||
if {$dbc_shank_type == 1 } {
|
||||
|
||||
ASC_output_section_records $fileId
|
||||
}
|
||||
|
||||
incr output_mark
|
||||
}
|
||||
|
||||
|
||||
proc ASC_output_section_records { fileid } \
|
||||
{
|
||||
global dbc_cutter_shank_libref
|
||||
global dbc_class
|
||||
global dbc_shank_num_sections
|
||||
|
||||
global dbc_seqno
|
||||
global dbc_hld_diam
|
||||
global dbc_hld_hgt
|
||||
global dbc_hld_taper
|
||||
global dbc_hld_corner
|
||||
|
||||
switch -- $dbc_class \
|
||||
{
|
||||
"MILLING_DRILLING"
|
||||
{
|
||||
for {set section_count 0 } { $section_count < $dbc_shank_num_sections} {incr section_count} \
|
||||
{
|
||||
set data_line [format "DATA | %s | 2 | %d |%9.5f |%9.5f |%9.5f |%9.5f" \
|
||||
$dbc_cutter_shank_libref $dbc_seqno($section_count) \
|
||||
$dbc_hld_diam($section_count) $dbc_hld_hgt($section_count) \
|
||||
$dbc_hld_taper($section_count) $dbc_hld_corner($section_count)]
|
||||
|
||||
puts $fileid $data_line
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_classify_line { } \
|
||||
{
|
||||
global asc_cur_line
|
||||
global asc_class
|
||||
global num_formats_processed
|
||||
global asc_record_libref
|
||||
global asc_record_type
|
||||
|
||||
# First check if record is some form of comment
|
||||
if {[string match {#*} $asc_cur_line] == 1} \
|
||||
{
|
||||
# It does. Sort out what kind
|
||||
if {[string match #END_DATA $asc_cur_line] == 1} \
|
||||
{
|
||||
if {$num_formats_processed == 1} \
|
||||
{
|
||||
set asc_record_type "End Directory Data"
|
||||
} else \
|
||||
{
|
||||
set asc_record_type "End Section Data"
|
||||
}
|
||||
} elseif {[string match *CLASS* $asc_cur_line] == 1} \
|
||||
{
|
||||
# We have a Class specification. Extract the class
|
||||
set asc_record_type "Class"
|
||||
set asc_class [string trimright $asc_cur_line]
|
||||
set tmp_ix [string first CLASS $asc_class]
|
||||
set tmp_iy [string wordend $asc_class $tmp_ix]
|
||||
set asc_class [string range $asc_class $tmp_iy end]
|
||||
set asc_class [string trimleft $asc_class]
|
||||
} elseif {[string match *dbc_logname* $asc_cur_line] == 1} \
|
||||
{
|
||||
set asc_record_type "Revision"
|
||||
} else \
|
||||
{
|
||||
set asc_record_type "Comment"
|
||||
}
|
||||
} elseif {[string match {FORMAT*} $asc_cur_line] == 1 } \
|
||||
{
|
||||
set asc_record_type "Format"
|
||||
} elseif {[string match {DATA*} $asc_cur_line] ==1} \
|
||||
{
|
||||
# We have a DATA record. Check if we are in the directory
|
||||
# or a shank section region
|
||||
if {$num_formats_processed == 1} \
|
||||
{
|
||||
set asc_record_type "Directory Data"
|
||||
} else \
|
||||
{
|
||||
set asc_record_type "Section Data"
|
||||
}
|
||||
# Extract the libref from this data record
|
||||
set tmp_ix [string first | $asc_cur_line]
|
||||
incr tmp_ix
|
||||
set asc_record_libref [string range $asc_cur_line $tmp_ix end]
|
||||
set tmp_iy [string first | $asc_record_libref]
|
||||
incr tmp_iy -1
|
||||
set asc_record_libref [string range $asc_record_libref 0 $tmp_iy]
|
||||
set asc_record_libref [string trim $asc_record_libref]
|
||||
} else \
|
||||
{
|
||||
# This doesn't match any previous types, so it is probably a blank line.
|
||||
# Whatever it is, treat it as a comment and pass it through.
|
||||
set asc_record_type "Comment"
|
||||
}
|
||||
}
|
||||
|
||||
# To enable the new customization mechanism.
|
||||
# This should ALWAYS be the last line in the file.
|
||||
MOM_extend_for_customization UGII_CAM_CUSTOM_LIBRARY_TOOL_ASCII_DIR dbc_custom_shank_ascii.tcl
|
||||
|
||||
242
tool/ascii/trackpoint_ascii.def
Normal file
242
tool/ascii/trackpoint_ascii.def
Normal file
@@ -0,0 +1,242 @@
|
||||
################################################################################
|
||||
# This is the definition file for tool tracking points with an ASCII File
|
||||
# as the database
|
||||
#
|
||||
#
|
||||
#=======================================================================
|
||||
# REVISIONS
|
||||
# Date Name Description of Change
|
||||
#
|
||||
# 25Jan2006 rlm Initial Release
|
||||
# 27Feb2014 Cheng Wang cam10008: Add Definition_type
|
||||
###############################################################################
|
||||
|
||||
DB_PREFIX "DB("
|
||||
DB_SUFFIX ")"
|
||||
ESS_PREFIX "ESS("
|
||||
ESS_SUFFIX ")"
|
||||
|
||||
|
||||
#############################################################################
|
||||
# The list of DB_ALIAS
|
||||
#
|
||||
# All the <alias> defined here can be used in the class description at the
|
||||
# end of this file in order to define the fields that should appear in
|
||||
# the search criteria and search result dialogs within UG for every class.
|
||||
#
|
||||
# DB_ALIAS <alias>
|
||||
# {
|
||||
# DB_ID < Attribute Identifier defined in the ASCII Data File >
|
||||
# DB_ID_TYPE < Type of the identifier >
|
||||
# d _ double
|
||||
# i _ integer
|
||||
# s _ string
|
||||
# OPTIONS "opt1" "opt2 " "opt3"
|
||||
# OPTIONS_IDS "val1" "val2" "val3"
|
||||
# DIALOG_NAME "label in search criteria dialog"
|
||||
# RSET_NAME "label in search result dialog"
|
||||
# }
|
||||
#
|
||||
# OPTIONS and OPTIONS_IDS can be ommitted, If they are specified
|
||||
# then a corresponding option menu is created in the Search Criteria Dialog
|
||||
# instead of a simple search field.
|
||||
#############################################################################
|
||||
|
||||
# The DB_ALIAS of the library reference. It is mandatory that this DB_ALIAS
|
||||
# appears in the alias list
|
||||
#
|
||||
DB_ALIAS libref
|
||||
{
|
||||
DB_ID LIBRF
|
||||
DB_ID_TYPE s
|
||||
DIALOG_NAME "Libref"
|
||||
RSET_NAME "Libref"
|
||||
}
|
||||
|
||||
##################################################################
|
||||
#
|
||||
# General Attributes
|
||||
#
|
||||
##################################################################
|
||||
|
||||
DB_ALIAS Type
|
||||
{
|
||||
DB_ID T
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS SubType
|
||||
{
|
||||
DB_ID STYPE
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Name
|
||||
{
|
||||
DB_ID NAME
|
||||
DB_ID_TYPE s
|
||||
}
|
||||
|
||||
DB_ALIAS Seq_no
|
||||
{
|
||||
DB_ID SEQ
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Adjust
|
||||
{
|
||||
DB_ID ADJREG
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Cutcom
|
||||
{
|
||||
DB_ID CUTREG
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Milling Trackpoint Attributes
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
DB_ALIAS Adjust_status
|
||||
{
|
||||
DB_ID ADJSTAT
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Cutcom_status
|
||||
{
|
||||
DB_ID CUTSTAT
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Diameter
|
||||
{
|
||||
DB_ID DIAM
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "Diameter "
|
||||
RSET_NAME "Diameter "
|
||||
}
|
||||
|
||||
DB_ALIAS Distance
|
||||
{
|
||||
DB_ID DIST
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "Distance"
|
||||
RSET_NAME "Distance"
|
||||
}
|
||||
|
||||
DB_ALIAS Z_offset
|
||||
{
|
||||
DB_ID ZOFF
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "Z Offset"
|
||||
RSET_NAME "Z Offset"
|
||||
}
|
||||
|
||||
DB_ALIAS Z_off_status
|
||||
{
|
||||
DB_ID ZOFFSTAT
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Definition_type
|
||||
{
|
||||
DB_ID DEFTYPE
|
||||
DB_ID_TYPE i
|
||||
DIALOG_NAME "Definition"
|
||||
RSET_NAME "Definition"
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Turning Trackpoint Attributes
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
DB_ALIAS X_offset
|
||||
{
|
||||
DB_ID XOFF
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "X Offset"
|
||||
RSET_NAME "X Offset"
|
||||
}
|
||||
|
||||
DB_ALIAS Y_offset
|
||||
{
|
||||
DB_ID YOFF
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "Y Offset"
|
||||
RSET_NAME "Y Offset"
|
||||
}
|
||||
|
||||
DB_ALIAS Radius_id
|
||||
{
|
||||
DB_ID RADID
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Cluster_id
|
||||
{
|
||||
DB_ID CLUSTID
|
||||
DB_ID_TYPE i
|
||||
}
|
||||
|
||||
DB_ALIAS Angle
|
||||
{
|
||||
DB_ID ANGLE
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "Angle"
|
||||
RSET_NAME "Angle"
|
||||
}
|
||||
|
||||
DB_ALIAS Radius
|
||||
{
|
||||
DB_ID RAD
|
||||
DB_ID_TYPE d
|
||||
DIALOG_NAME "Radius"
|
||||
RSET_NAME "Radius"
|
||||
}
|
||||
|
||||
###################################################################
|
||||
#################################################################
|
||||
|
||||
|
||||
LIBREF libref
|
||||
|
||||
|
||||
#########################################################################
|
||||
# The Class Hierarchy #
|
||||
#########################################################################
|
||||
|
||||
CLASS TRACKPOINT
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(libref)] != [0]"
|
||||
DIALOG libref
|
||||
RSET libref Type SubType
|
||||
UI_NAME "Trackpoint"
|
||||
|
||||
CLASS MILLING_DRILLING
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [01]"
|
||||
DIALOG libref Type
|
||||
RSET libref
|
||||
UI_NAME "Milling_Drilling"
|
||||
}
|
||||
|
||||
CLASS TURNING
|
||||
{
|
||||
TYPE QRY
|
||||
QUERY "[DB(Type)] == [02]"
|
||||
DIALOG libref Type
|
||||
RSET libref
|
||||
UI_NAME "Turning"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
991
tool/ascii/trackpoint_ascii.tcl
Normal file
991
tool/ascii/trackpoint_ascii.tcl
Normal file
@@ -0,0 +1,991 @@
|
||||
###############################################################################
|
||||
# trackpoint_ascii.tcl - DBC Event Handler for database stored as ascii file
|
||||
###############################################################################
|
||||
##############################################################################
|
||||
# REVISIONS
|
||||
# Date Who Reason
|
||||
# 25-Jan-2006 rlm initial release
|
||||
# 14-Dec-2011 JM Add dbc_export_file_name
|
||||
# 27-Feb-2014 Cheng Wang cam10008: Add definition type
|
||||
# 13-Nov-2017 JM no export backup if multitool export
|
||||
# 26-Oct-2018 Shorbojeet Das PR#8340732: Add customization support for double precision control.
|
||||
##############################################################################
|
||||
#
|
||||
|
||||
# Default double precision value format.
|
||||
set double_precision_format "g"
|
||||
|
||||
proc ASC_t_create_filename {env_var_name filename} \
|
||||
{
|
||||
#
|
||||
# Creates a complete filename by evaluating an environment variable
|
||||
# for the directory information
|
||||
#
|
||||
set env_var [MOM_ask_env_var $env_var_name]
|
||||
if { $env_var == "" } \
|
||||
{
|
||||
set message "Can't read environment variable $env_var_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
set fname ""
|
||||
set fname [append fname $env_var $filename]
|
||||
|
||||
return $fname
|
||||
}
|
||||
|
||||
proc MOM__boot {} \
|
||||
{
|
||||
|
||||
# source some general procedures
|
||||
|
||||
#
|
||||
# dbc_ascii_general.tcl
|
||||
#
|
||||
set filename \
|
||||
[ASC_t_create_filename "UGII_UG_LIBRARY_DIR" "dbc_ascii_general.tcl"]
|
||||
if { [catch {source $filename}] == "1" } \
|
||||
{
|
||||
set message "Can't load .tcl file: $filename"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc MOM__halt {} \
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_init_db {} \
|
||||
{
|
||||
|
||||
global asc_debug
|
||||
global asc_file_name
|
||||
global asc_units
|
||||
global asc_part_units
|
||||
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global asc_file_loaded
|
||||
global asc_file_load_limit
|
||||
|
||||
|
||||
#
|
||||
# Global variables set by DBC for Input/Output
|
||||
#
|
||||
|
||||
global dbc_lhs_exp
|
||||
global dbc_rhs_exp
|
||||
global dbc_relop
|
||||
global dbc_query
|
||||
global dbc_subqry1
|
||||
global dbc_subqry2
|
||||
global dbc_boolop
|
||||
global dbc_class_name
|
||||
global dbc_attr_count
|
||||
global dbc_attr_id
|
||||
global dbc_query_count
|
||||
global dbc_libref
|
||||
global dbc_var_list
|
||||
#
|
||||
#
|
||||
# This is path+name of the trackpoint_database.dat file
|
||||
# where a tracking point gets exported.
|
||||
# It is used within NX CAM to provide feedback
|
||||
# to the user about tool export
|
||||
#
|
||||
global dbc_export_file_name
|
||||
|
||||
|
||||
|
||||
set dbc_lhs_exp ""
|
||||
set dbc_rhs_exp ""
|
||||
set dbc_relop ""
|
||||
set dbc_query ""
|
||||
set dbc_subqry1 ""
|
||||
set dbc_subqry2 ""
|
||||
set dbc_boolop ""
|
||||
set dbc_class_name ""
|
||||
set dbc_attr_count 0
|
||||
set dbc_attr_id ""
|
||||
set dbc_query_count 0
|
||||
set dbc_libref ""
|
||||
set dbc_var_list ""
|
||||
|
||||
set asc_debug 0
|
||||
set asc_file_name ""
|
||||
set dbc_export_file_name ""
|
||||
set asc_part_units ""
|
||||
set dbc_cutter_ass_units ""
|
||||
|
||||
#
|
||||
# Set the unit for tool search to the part unit
|
||||
#
|
||||
ASC_set_part_unit
|
||||
|
||||
#
|
||||
# ask the mm and inch filenames
|
||||
#
|
||||
set asc_mm_file_name [ASC_get_data_file_name $asc_units(mm)]
|
||||
set asc_inch_file_name [ASC_get_data_file_name $asc_units(inch)]
|
||||
if { $asc_mm_file_name == "" && $asc_inch_file_name == "" } \
|
||||
{
|
||||
set message "Error looking for a trackpoint_database.dat file."
|
||||
set message "$message \n Neither of the environment variables"
|
||||
set message "$message \n UGII_CAM_LIBRARY_TOOL_METRIC_DIR,"
|
||||
set message "$message \n UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR"
|
||||
set message "$message \n is defined."
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
#
|
||||
# mm file
|
||||
#
|
||||
set app 0
|
||||
set mm_file_loaded 0
|
||||
|
||||
set ret_cd [ASC_load_data_file $asc_mm_file_name $asc_units(mm) $app]
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $asc_mm_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
set app 1
|
||||
set mm_file_loaded 1
|
||||
|
||||
#
|
||||
# and then inch file
|
||||
#
|
||||
set inch_file_loaded 0
|
||||
|
||||
set ret_cd [ASC_load_data_file $asc_inch_file_name $asc_units(inch) $app]
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $asc_inch_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
set inch_file_loaded 1
|
||||
|
||||
#
|
||||
# if mm or inch or both files are loaded set the flag
|
||||
#
|
||||
if { $inch_file_loaded == 1 || $mm_file_loaded == 1 } \
|
||||
{
|
||||
set asc_file_loaded 1
|
||||
}
|
||||
|
||||
#
|
||||
# This variable is only used for error messages
|
||||
#
|
||||
set asc_file_name " $asc_mm_file_name"
|
||||
set asc_file_name "$asc_file_name \n $asc_inch_file_name"
|
||||
|
||||
}
|
||||
|
||||
proc ASC_get_data_file_name { unit } \
|
||||
{
|
||||
#
|
||||
# Returns the filename for ASCII Data File depending on the
|
||||
# specified unit.
|
||||
#
|
||||
global asc_units
|
||||
|
||||
if {$unit == $asc_units(mm)} \
|
||||
{
|
||||
set env_var_name UGII_CAM_LIBRARY_TOOL_METRIC_DIR
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set env_var_name UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR
|
||||
}
|
||||
|
||||
set env_var [MOM_ask_env_var $env_var_name]
|
||||
if { $env_var == "" } \
|
||||
{
|
||||
return ""
|
||||
}
|
||||
|
||||
set fname ""
|
||||
set fname [append fname $env_var "trackpoint_database.dat"]
|
||||
|
||||
return $fname
|
||||
}
|
||||
|
||||
proc ASC_set_part_unit {} \
|
||||
{
|
||||
|
||||
global dbc_part_units
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
|
||||
MOM_ask_part_units ;# writes to dbc_part_units
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set dbc_search_units $asc_units(mm)
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set dbc_search_units $asc_units(inch)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_retrieve {} {
|
||||
#---------------------------------------------
|
||||
global dbc_libref
|
||||
|
||||
ASC_retrieve
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc ASC_retrieve {} {
|
||||
#---------------------------------------------
|
||||
#
|
||||
# global input
|
||||
# ------------
|
||||
global asc_debug
|
||||
global asc_units
|
||||
|
||||
global dbc_search_units
|
||||
|
||||
global dbc_libref
|
||||
global db_row
|
||||
|
||||
global asc_file_loaded
|
||||
global asc_database
|
||||
global asc_database_count
|
||||
global asc_file_name
|
||||
|
||||
#
|
||||
# global output
|
||||
# -------------
|
||||
global dbc_trackpoint_count
|
||||
global dbc_trackpoint_type
|
||||
global dbc_trackpoint_subtype
|
||||
global dbc_query
|
||||
global dbc_query_count
|
||||
|
||||
|
||||
if { $asc_debug == "1" } \
|
||||
{
|
||||
puts " =========================================="
|
||||
puts " procedure DBC_retrieve for tool tracking points"
|
||||
puts " libref -> $dbc_libref"
|
||||
}
|
||||
|
||||
# initialize point count so we can detect if retrieval failed
|
||||
set dbc_trackpoint_count 0
|
||||
|
||||
#
|
||||
# Look for the desired libref
|
||||
#
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
|
||||
if {$db_row >= 0} \
|
||||
{
|
||||
set dbc_trackpoint_type [ASC_ask_att_val T $db_row "%d" 0 flag]
|
||||
set dbc_trackpoint_subtype [ASC_ask_att_val STYPE $db_row "%d" 0 flag]
|
||||
|
||||
ASC_load_trackpoint_data
|
||||
}
|
||||
}
|
||||
|
||||
proc DBC_ask_library_values {} \
|
||||
{
|
||||
#
|
||||
# global input
|
||||
global dbc_libref
|
||||
global dbc_db_ids_count
|
||||
global dbc_db_ids
|
||||
|
||||
global asc_file_loaded
|
||||
|
||||
#
|
||||
# global output
|
||||
global dbc_db_ids_value
|
||||
|
||||
|
||||
#
|
||||
# Look for the desired libref
|
||||
#
|
||||
if { $asc_file_loaded == 1 } \
|
||||
{
|
||||
ASC_array_search_libref $dbc_libref db_row
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_file_search_libref $dbc_libref db_row
|
||||
}
|
||||
#
|
||||
# and set the desired values
|
||||
#
|
||||
for { set inx 0 } { $inx < $dbc_db_ids_count } { incr inx } \
|
||||
{
|
||||
set dbc_db_ids_value($dbc_db_ids($inx)) \
|
||||
[ASC_ask_att_val $dbc_db_ids($inx) $db_row "" "" flag]
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_translate_att_alias {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_translate_att_alias
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_create_criterion {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_create_criterion
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_create_query {} {
|
||||
#---------------------------------------------
|
||||
|
||||
ASC_create_query
|
||||
}
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_execute_query {} {
|
||||
#---------------------------------------------
|
||||
|
||||
|
||||
global asc_file_loaded
|
||||
global dbc_query
|
||||
global dbc_search_units
|
||||
|
||||
if { $asc_file_loaded == 0 } \
|
||||
{
|
||||
ASC_file_exec_qry 0
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_append_unit_to_query
|
||||
ASC_execute_query
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
proc DBC_execute_query_for_count {} {
|
||||
#---------------------------------------------
|
||||
|
||||
global asc_file_loaded
|
||||
global dbc_query
|
||||
|
||||
if { $asc_file_loaded == 0 } \
|
||||
{
|
||||
ASC_file_exec_qry 1
|
||||
} \
|
||||
else \
|
||||
{
|
||||
ASC_append_unit_to_query
|
||||
ASC_execute_query_for_count
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#--------------------------------------------
|
||||
proc DBC_insert {} {
|
||||
#--------------------------------------------
|
||||
|
||||
ASC_insert
|
||||
}
|
||||
|
||||
proc ASC_append_unit_to_query {} \
|
||||
{
|
||||
global dbc_search_units
|
||||
global dbc_query
|
||||
global asc_units
|
||||
|
||||
|
||||
|
||||
set lhs "\$asc_database(\$db_row,_unitt)"
|
||||
|
||||
set subquery1 "($lhs == \"$asc_units(unknown)\")"
|
||||
set subquery2 "($lhs == \"$dbc_search_units\")"
|
||||
|
||||
set subquery "($subquery1 || $subquery2)"
|
||||
|
||||
set dbc_query "$dbc_query && $subquery"
|
||||
|
||||
}
|
||||
|
||||
proc ASC_file_exec_qry { for_count } \
|
||||
{
|
||||
#
|
||||
# Executes the query on a file depending on the current setting
|
||||
# of the dbc_search_units
|
||||
#
|
||||
# for_count = 1 => do only execute_query_for_count
|
||||
|
||||
|
||||
|
||||
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global dbc_query_count
|
||||
global dbc_query
|
||||
global units_from_query
|
||||
|
||||
if {[info exists units_from_query]} {
|
||||
set dbc_search_units $units_from_query
|
||||
unset units_from_query
|
||||
}
|
||||
|
||||
if { $dbc_search_units == $asc_units(mm) } \
|
||||
{
|
||||
set file_name $asc_mm_file_name
|
||||
set units $asc_units(mm)
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set file_name $asc_inch_file_name
|
||||
set units $asc_units(inch)
|
||||
}
|
||||
|
||||
set dbc_query_count 0
|
||||
if { $for_count == 1 } \
|
||||
{
|
||||
set ret_cd [ASC_file_execute_query_for_count $file_name $units]
|
||||
} \
|
||||
else \
|
||||
{
|
||||
set ret_cd [ASC_file_execute_query $file_name $units]
|
||||
}
|
||||
|
||||
if { $ret_cd != 0 } \
|
||||
{
|
||||
set message "Error, can't open file:"
|
||||
set message "$message \n $file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_file_search_libref { libref db_row_ref } \
|
||||
{
|
||||
upvar $db_row_ref db_row
|
||||
|
||||
global dbc_search_units
|
||||
global asc_units
|
||||
global asc_mm_file_name
|
||||
global asc_inch_file_name
|
||||
global asc_file_name
|
||||
|
||||
|
||||
#
|
||||
# We search in mm and inch file for the desired libref
|
||||
#
|
||||
set found 2
|
||||
if { $dbc_search_units == $asc_units(mm) } \
|
||||
{
|
||||
#
|
||||
# Start with the mm file
|
||||
if { $asc_mm_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_mm_file_name $asc_units(mm) \
|
||||
LIBRF $libref db_row]
|
||||
if { $found != 0 } \
|
||||
{
|
||||
# Not found -> Try again with the inch file
|
||||
if { $asc_inch_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_inch_file_name $asc_units(inch) \
|
||||
LIBRF $libref db_row]
|
||||
}
|
||||
}
|
||||
}
|
||||
} \
|
||||
else \
|
||||
{
|
||||
#
|
||||
# Start with the inch file
|
||||
if { $asc_inch_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_inch_file_name $asc_units(inch) \
|
||||
LIBRF $libref db_row]
|
||||
if { $found != 0 } \
|
||||
{
|
||||
# Not found -> Try again with the mm file
|
||||
if { $asc_mm_file_name != "" } \
|
||||
{
|
||||
set found [ASC_file_find_object_by_att \
|
||||
$asc_mm_file_name $asc_units(mm) \
|
||||
LIBRF $libref db_row]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if { $found == 2 } \
|
||||
{
|
||||
set message "Error retrieving trackpoints from external library."
|
||||
set message "$message \n Trackpoints with the library reference $libref"
|
||||
set message "$message \n do not exist in the"
|
||||
set message "$message \n ASCII Data File(s):"
|
||||
set message "$message \n $asc_file_name"
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
|
||||
if { $found == 1 } \
|
||||
{
|
||||
set message "Error retrieving trackpoints from external library."
|
||||
set message "$message \n Neither of the files"
|
||||
set message "$message \n $asc_mm_file_name"
|
||||
set message "$message \n $asc_inch_file_name"
|
||||
set message "$message \n can be read."
|
||||
MOM_abort "\n $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_array_search_libref { libref db_row_ref } \
|
||||
{
|
||||
upvar $db_row_ref db_row
|
||||
|
||||
global asc_file_name
|
||||
|
||||
set found [ASC_array_find_object_by_att LIBRF $libref db_row ]
|
||||
|
||||
if { $found == 2 } \
|
||||
{
|
||||
set db_row -1
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_load_trackpoint_data {} \
|
||||
{
|
||||
global dbc_attr_count
|
||||
global dbc_attr_aliases
|
||||
global dbc_attr_id
|
||||
global dbc_libref
|
||||
global dbc_query_count
|
||||
|
||||
global dbc_trackpoint_count
|
||||
global dbc_trackpoint_name
|
||||
global dbc_trackpoint_seqno
|
||||
global dbc_trackpoint_adjust
|
||||
global dbc_trackpoint_adjust_status
|
||||
global dbc_trackpoint_cutcom
|
||||
global dbc_trackpoint_cutcom_status
|
||||
global dbc_trackpoint_diam
|
||||
global dbc_trackpoint_length
|
||||
global dbc_trackpoint_z_offset
|
||||
global dbc_trackpoint_zoff_status
|
||||
global dbc_trackpoint_x_offset
|
||||
global dbc_trackpoint_y_offset
|
||||
global dbc_trackpoint_radius_id
|
||||
global dbc_trackpoint_cluster_id
|
||||
global dbc_trackpoint_tool_angle
|
||||
global dbc_trackpoint_radius
|
||||
global dbc_trackpoint_def_type
|
||||
|
||||
global asc_database_count
|
||||
|
||||
# Initialize environment
|
||||
set dbc_trackpoint_count 0
|
||||
|
||||
# Cycle database looking for matching data records
|
||||
for {set db_row 0} {$db_row < $asc_database_count} { incr db_row 1} \
|
||||
{
|
||||
set tmp_libref [ASC_ask_att_val LIBRF $db_row "" 0 flag]
|
||||
if {$tmp_libref == $dbc_libref} \
|
||||
{
|
||||
# Set common data
|
||||
set dbc_trackpoint_name($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
NAME $db_row "%s" 0 flag]
|
||||
set dbc_trackpoint_seqno($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
SEQ $db_row "%d" 0 flag]
|
||||
set dbc_trackpoint_adjust($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
ADJREG $db_row "%d" 0 flag]
|
||||
set dbc_trackpoint_cutcom($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
CUTREG $db_row "%d" 0 flag]
|
||||
|
||||
# Get type of Tracking point
|
||||
set type [ASC_ask_att_val T $db_row "" 0 flag]
|
||||
|
||||
# Milling_Drilling
|
||||
if {$type == "1" } \
|
||||
{
|
||||
set dbc_trackpoint_adjust_status($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
ADJSTAT $db_row "%d" 0 flag]
|
||||
set dbc_trackpoint_cutcom_status($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
CUTSTAT $db_row "%d" 0 flag]
|
||||
set dbc_trackpoint_diam($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
DIAM $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_trackpoint_length($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
DIST $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_trackpoint_z_offset($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
ZOFF $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_trackpoint_zoff_status($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
ZOFFSTAT $db_row "%d" 0 flag]
|
||||
set dbc_trackpoint_def_type($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
DEFTYPE $db_row "%d" 0 flag]
|
||||
} elseif {$type == "2" } \
|
||||
{
|
||||
# Turning
|
||||
set dbc_trackpoint_x_offset($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
XOFF $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_trackpoint_y_offset($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
YOFF $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_trackpoint_radius_id($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
RADID $db_row "%d" 0 flag]
|
||||
set dbc_trackpoint_cluster_id($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
CLUSTID $db_row "%d" 0 flag]
|
||||
set dbc_trackpoint_tool_angle($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
ANGLE $db_row "%$::double_precision_format" 0 flag]
|
||||
set dbc_trackpoint_radius($dbc_trackpoint_count) [ASC_ask_att_val \
|
||||
RAD $db_row "%$::double_precision_format" 0 flag]
|
||||
}
|
||||
|
||||
incr dbc_trackpoint_count
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
proc DBC_create_backup_data_file {} \
|
||||
{
|
||||
global dbc_event_error
|
||||
global dbc_part_units
|
||||
global asc_units
|
||||
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(mm)]
|
||||
} else \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(inch)]
|
||||
}
|
||||
|
||||
|
||||
set asc_backupname $base_filename
|
||||
append asc_backupname "_bak"
|
||||
|
||||
if [catch {file copy -force $base_filename $asc_backupname} ] \
|
||||
{
|
||||
set dbc_event_error "Can't create backup file $asc_backupname."
|
||||
return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
proc ASC_insert {} \
|
||||
{
|
||||
global asc_database_name
|
||||
global asc_file_name
|
||||
global asc_units
|
||||
global dbc_part_units
|
||||
global dbc_event_error
|
||||
global dbc_logname
|
||||
|
||||
global dbc_trackpoint_class
|
||||
global dbc_cutter_trackpoint_libref
|
||||
global dbc_trackpoint_count
|
||||
|
||||
global dbc_clsf_decimal_places
|
||||
global mom_clsf_decimal_places
|
||||
|
||||
global asc_cur_line
|
||||
global asc_record_type
|
||||
global asc_class
|
||||
global asc_record_libref
|
||||
|
||||
global num_formats_processed
|
||||
|
||||
global dbc_export_file_name
|
||||
|
||||
|
||||
if {$dbc_part_units == "metric"} \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(mm)]
|
||||
} else \
|
||||
{
|
||||
set base_filename [ASC_get_data_file_name $asc_units(inch)]
|
||||
}
|
||||
|
||||
|
||||
set asc_tempname $base_filename
|
||||
append asc_tempname "_tmp"
|
||||
|
||||
global dbc_ongoing_multitool_export_flag
|
||||
set create_backup_file 1
|
||||
if { [info exists dbc_ongoing_multitool_export_flag] } \
|
||||
{
|
||||
if { $dbc_ongoing_multitool_export_flag == 1 } \
|
||||
{
|
||||
set create_backup_file 0
|
||||
}
|
||||
}
|
||||
|
||||
# back up the existing version of the library
|
||||
if { $create_backup_file == 1 } \
|
||||
{
|
||||
set error_flag [DBC_create_backup_data_file]
|
||||
if {$error_flag == 1} \
|
||||
{
|
||||
return
|
||||
}
|
||||
}
|
||||
# open temp file and current library file
|
||||
if [catch {open $asc_tempname w} tmp_fileid] \
|
||||
{
|
||||
set dbc_event_error "Error opening $asc_tempname"
|
||||
return
|
||||
}
|
||||
|
||||
if [catch {open $base_filename r} input_fileid] \
|
||||
{
|
||||
set dbc_event_error "Error opening $base_filename"
|
||||
return
|
||||
}
|
||||
|
||||
# Cycle over all the records in the input file looking for the spot
|
||||
# to insert the input trackpoint set
|
||||
set trackpoints_output 0
|
||||
while {[gets $input_fileid asc_cur_line] >= 0} \
|
||||
{
|
||||
ASC_classify_line
|
||||
switch -- $asc_record_type \
|
||||
{
|
||||
"Comment"
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Revision"
|
||||
{
|
||||
# output a new revision line for the new entry and then the input record
|
||||
set daytime [clock seconds]
|
||||
set out_daytime [clock format $daytime -format "%a %b %d %Y %I:%M %p"]
|
||||
set cur_rev "# $dbc_logname $out_daytime"
|
||||
append cur_rev " Saving $dbc_cutter_trackpoint_libref"
|
||||
|
||||
puts $tmp_fileid $cur_rev
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Class"
|
||||
{
|
||||
# Save indicator for this class matching the input class
|
||||
set class_match [string compare $dbc_trackpoint_class $asc_class]
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Format"
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
"Data"
|
||||
{
|
||||
set libref_cmp [string compare $asc_record_libref $dbc_cutter_trackpoint_libref]
|
||||
|
||||
# If this data record isn't for the class we're trying to insert, just
|
||||
# pass it to the output file. Otherwise, compare the librefs and
|
||||
# determine if it needs to be output yet.
|
||||
if { $class_match != 0 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == -1 } \
|
||||
{
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
} elseif { $libref_cmp == 0 } \
|
||||
{
|
||||
if { $trackpoints_output == 0 } \
|
||||
{
|
||||
ASC_output_trackpoints $tmp_fileid
|
||||
incr trackpoints_output
|
||||
}
|
||||
} else \
|
||||
{
|
||||
if { $trackpoints_output == 0 } \
|
||||
{
|
||||
ASC_output_trackpoints $tmp_fileid
|
||||
incr trackpoints_output
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
"End Data"
|
||||
{
|
||||
# If this End Data record is for the class we're trying to insert,
|
||||
# check if the trackpoints have been output yet. If not,
|
||||
# output them now and then this record.
|
||||
if { $class_match == 0 } \
|
||||
{
|
||||
if { $trackpoints_output == 0 } \
|
||||
{
|
||||
ASC_output_trackpoints $tmp_fileid
|
||||
incr trackpoints_output
|
||||
}
|
||||
}
|
||||
puts $tmp_fileid $asc_cur_line
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Close the input and output files
|
||||
if [catch {close $tmp_fileid} ] \
|
||||
{
|
||||
set dbc_event_error "Error closing $asc_tempname"
|
||||
return
|
||||
}
|
||||
if [catch {close $input_fileid} ] \
|
||||
{
|
||||
set dbc_event_error "Error closing $base_filename"
|
||||
return
|
||||
}
|
||||
|
||||
# Rename the output file to the current file name, since we have already
|
||||
# copied the current library into a backup file.
|
||||
if [catch {file rename -force $asc_tempname $base_filename} ] \
|
||||
{
|
||||
global errorInfo
|
||||
set dbc_event_error "Can't update library file $base_filename."
|
||||
}
|
||||
|
||||
# Reinitialize the database to update the run-time data since this doesn't
|
||||
# automatically happen on subsequent access attempts.
|
||||
DBC_init_db
|
||||
|
||||
|
||||
# Set this here because init_db sets everything to ""
|
||||
set dbc_export_file_name $base_filename
|
||||
|
||||
|
||||
}
|
||||
|
||||
proc ASC_output_trackpoints { fileid } \
|
||||
{
|
||||
global dbc_cutter_trackpoint_libref
|
||||
global dbc_trackpoint_class
|
||||
global dbc_trackpoint_count
|
||||
|
||||
global dbc_trackpoint_name
|
||||
global dbc_trackpoint_seqno
|
||||
global dbc_trackpoint_adjust
|
||||
global dbc_trackpoint_adjust_status
|
||||
global dbc_trackpoint_cutcom
|
||||
global dbc_trackpoint_cutcom_status
|
||||
global dbc_trackpoint_diam
|
||||
global dbc_trackpoint_length
|
||||
global dbc_trackpoint_z_offset
|
||||
global dbc_trackpoint_zoff_status
|
||||
global dbc_trackpoint_x_offset
|
||||
global dbc_trackpoint_y_offset
|
||||
global dbc_trackpoint_radius_id
|
||||
global dbc_trackpoint_cluster_id
|
||||
global dbc_trackpoint_tool_angle
|
||||
global dbc_trackpoint_radius
|
||||
global dbc_trackpoint_def_type
|
||||
|
||||
switch -- $dbc_trackpoint_class \
|
||||
{
|
||||
"MILLING_DRILLING"
|
||||
{
|
||||
for {set trackpoint_count 0 } { $trackpoint_count < $dbc_trackpoint_count} {incr trackpoint_count} \
|
||||
{
|
||||
set data_line [format "DATA | %s | 1 | 0 | %s | %d | %d | %d | %d | %d | %9.5f | %9.5f | %9.5f | %d | %d" \
|
||||
$dbc_cutter_trackpoint_libref $dbc_trackpoint_name($trackpoint_count) \
|
||||
$dbc_trackpoint_seqno($trackpoint_count) \
|
||||
$dbc_trackpoint_adjust($trackpoint_count) $dbc_trackpoint_adjust_status($trackpoint_count) \
|
||||
$dbc_trackpoint_cutcom($trackpoint_count) $dbc_trackpoint_cutcom_status($trackpoint_count) \
|
||||
$dbc_trackpoint_diam($trackpoint_count) $dbc_trackpoint_length($trackpoint_count) \
|
||||
$dbc_trackpoint_z_offset($trackpoint_count) $dbc_trackpoint_zoff_status($trackpoint_count) \
|
||||
$dbc_trackpoint_def_type($trackpoint_count)]
|
||||
puts $fileid $data_line
|
||||
}
|
||||
}
|
||||
"TURNING"
|
||||
{
|
||||
for {set trackpoint_count 0 } { $trackpoint_count < $dbc_trackpoint_count} {incr trackpoint_count} \
|
||||
{
|
||||
set data_line [format "DATA | %s | 2 | 0 | %s | %d | %d | %d | %9.5f | %9.5f | %d | %d | %9.5f | %9.5f" \
|
||||
$dbc_cutter_trackpoint_libref $dbc_trackpoint_name($trackpoint_count) \
|
||||
$dbc_trackpoint_seqno($trackpoint_count) \
|
||||
$dbc_trackpoint_adjust($trackpoint_count) $dbc_trackpoint_cutcom($trackpoint_count) \
|
||||
$dbc_trackpoint_x_offset($trackpoint_count) $dbc_trackpoint_y_offset($trackpoint_count) \
|
||||
$dbc_trackpoint_radius_id($trackpoint_count) $dbc_trackpoint_cluster_id($trackpoint_count) \
|
||||
$dbc_trackpoint_tool_angle($trackpoint_count) $dbc_trackpoint_radius($trackpoint_count)]
|
||||
puts $fileid $data_line
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc ASC_classify_line { } \
|
||||
{
|
||||
global asc_cur_line
|
||||
global asc_class
|
||||
global asc_record_libref
|
||||
global asc_record_type
|
||||
|
||||
# First check if record is some form of comment
|
||||
if {[string match {#*} $asc_cur_line] == 1} \
|
||||
{
|
||||
# It does. Sort out what kind
|
||||
if {[string match #END_DATA $asc_cur_line] == 1} \
|
||||
{
|
||||
set asc_record_type "End Data"
|
||||
} elseif {[string match *CLASS* $asc_cur_line] == 1} \
|
||||
{
|
||||
# We have a Class specification. Extract the class
|
||||
set asc_record_type "Class"
|
||||
set asc_class [string trimright $asc_cur_line]
|
||||
set tmp_ix [string first CLASS $asc_class]
|
||||
set tmp_iy [string wordend $asc_class $tmp_ix]
|
||||
set asc_class [string range $asc_class $tmp_iy end]
|
||||
set asc_class [string trimleft $asc_class]
|
||||
} elseif {[string match *dbc_logname* $asc_cur_line] == 1} \
|
||||
{
|
||||
set asc_record_type "Revision"
|
||||
} else \
|
||||
{
|
||||
set asc_record_type "Comment"
|
||||
}
|
||||
} elseif {[string match {FORMAT*} $asc_cur_line] == 1 } \
|
||||
{
|
||||
set asc_record_type "Format"
|
||||
} elseif {[string match {DATA*} $asc_cur_line] ==1} \
|
||||
{
|
||||
# We have a DATA record.
|
||||
set asc_record_type "Data"
|
||||
|
||||
# Extract the libref from this data record
|
||||
set tmp_ix [string first | $asc_cur_line]
|
||||
incr tmp_ix
|
||||
set asc_record_libref [string range $asc_cur_line $tmp_ix end]
|
||||
set tmp_iy [string first | $asc_record_libref]
|
||||
incr tmp_iy -1
|
||||
set asc_record_libref [string range $asc_record_libref 0 $tmp_iy]
|
||||
set asc_record_libref [string trim $asc_record_libref]
|
||||
} else \
|
||||
{
|
||||
# This doesn't match any previous types, so it is probably a blank line.
|
||||
# Whatever it is, treat it as a comment and pass it through.
|
||||
set asc_record_type "Comment"
|
||||
}
|
||||
}
|
||||
|
||||
# To enable the new customization mechanism.
|
||||
# This should ALWAYS be the last line in the file.
|
||||
MOM_extend_for_customization UGII_CAM_CUSTOM_LIBRARY_TOOL_ASCII_DIR dbc_custom_trackpoint_ascii.tcl
|
||||
34
tool/english/assembly_database.dat
Normal file
34
tool/english/assembly_database.dat
Normal file
@@ -0,0 +1,34 @@
|
||||
# ASSEMBLY_DATABASE.DAT
|
||||
##########################################################################
|
||||
#
|
||||
# PURPOSE:
|
||||
#
|
||||
# This is the database file used for defining tool assembly.
|
||||
#
|
||||
#
|
||||
# The next line causes the on site revision history to be saved.
|
||||
# To prevent this, delete the next line.
|
||||
#
|
||||
# dbc_logname
|
||||
#
|
||||
##########################################################################
|
||||
# The data is organized using the following fields separated by |
|
||||
#
|
||||
# The following fields are defined for all records
|
||||
#
|
||||
# LIBRF - Unique Assembly Tool Identifier
|
||||
# DESCR - Description
|
||||
# TOOLREF - Tool Reference
|
||||
# TOOLT - Tool Type
|
||||
# TOOLST - Tool Subtype
|
||||
# HOLDREF - Holder Reference
|
||||
# SHANKREF - Shank Reference
|
||||
# ZMOUNT - Length of Holder Offset
|
||||
# TLNUM - Tool Number
|
||||
# ADJREG - Tool Length Adjust Register
|
||||
# CUTCOMREG - Tool CUTCOM Register
|
||||
#
|
||||
#--------------------------------------------------------------------------------
|
||||
FORMAT LIBRF DESCR TOOLREF TOOLT TOOLST HOLDREF SHANKREF ZMOUNT TLNUM ADJREG CUTCOMREG
|
||||
#--------------------------------------------------------------------------------
|
||||
DATA | EM_ASSEMBLY_DEMO_INCH | End Mill Inch Assembly | ugti0201_104 | MILLING | END_MILL_NON_INDEXABLE | HLDI001_00032 | | 1.50000 | | |
|
||||
294
tool/english/holder_database.dat
Normal file
294
tool/english/holder_database.dat
Normal file
@@ -0,0 +1,294 @@
|
||||
# HOLDER_ASCII.DAT
|
||||
##########################################################################
|
||||
#
|
||||
# PURPOSE:
|
||||
#
|
||||
# This is the database file used for defining multiple section tool
|
||||
# holders.
|
||||
#
|
||||
#
|
||||
# The next line causes the on site revision history to be saved.
|
||||
# To prevent this, delete the next line.
|
||||
# dbc_logname
|
||||
#
|
||||
##########################################################################
|
||||
# The data is organized using the following fields separated by |
|
||||
#
|
||||
# The following fields are defined for all records
|
||||
#
|
||||
# LIBRF - Unique holder identifier (library reference of the holder)
|
||||
# RTYPE - Record type
|
||||
# = 1 General holder record
|
||||
# = 2 Holder data record
|
||||
#
|
||||
# The following fields are defined for RTYPE = 1
|
||||
#
|
||||
# HTYPE - Holder type
|
||||
# = 1 Milling and Drilling Holder
|
||||
# = 2 Turning Holder
|
||||
# = 3 Soft Holder
|
||||
# = 4 Wedm Guide
|
||||
# STYPE - Holder subtype
|
||||
# For HTYPE = 1 or 4
|
||||
# = 0 All Milling and Drilling holders
|
||||
# For HTYPE = 2
|
||||
# = 0 Standard Turning Tool Holder
|
||||
# = 1 Grooving Tool Holder
|
||||
# = 2 Threading Tool Holder
|
||||
# For HTYPE = 3
|
||||
# = 0 All Soft Holders
|
||||
# SNUM - Section number - count of sections for this holder
|
||||
# MAXOFF - Maximum tool offset supported by this holder.
|
||||
# (Not currently implemented, but defined now for future
|
||||
# use.)
|
||||
# MINDIA - Minimum diameter of a tool which can be secured by the
|
||||
# holder -- 0.0 or blank indicates no minimum
|
||||
# MAXDIA - Maximum diameter of a tool which can be secured by the
|
||||
# holder -- 0.0 or blank indicates not defined.
|
||||
# DESCR - Holder description
|
||||
# MTS - Holder mounting style
|
||||
#
|
||||
# The following fields are defined for Milling and Drilling holders with RTYPE = 2
|
||||
#
|
||||
# LIBRF - Unique holder identifier (same as in RTYPE = 1 record)
|
||||
# SEQ - Sequence number of section (represents where this section is
|
||||
# in the overall holder set.
|
||||
# DIAM - Diameter of section
|
||||
# LENGTH - Length of section
|
||||
# TAPER - Taper angle of section in degree
|
||||
# CRAD - Corner radius of section
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
FORMAT LIBRF RTYPE HTYPE STYPE SNUM MAXOFF MINDIA MAXDIA DESCR MTS
|
||||
#-------------------------------------------------------------------------------
|
||||
DATA | HLDI001_00001 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Small weldon |
|
||||
DATA | HLDI001_00002 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Small weldon |
|
||||
DATA | HLDI001_00003 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Large weldon |
|
||||
DATA | HLDI001_00004 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Large weldon |
|
||||
DATA | HLDI001_00005 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Medium weldon |
|
||||
DATA | HLDI001_00006 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Medium weldon |
|
||||
DATA | HLDI001_00007 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Large weldon |
|
||||
DATA | HLDI001_00008 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Small weldon |
|
||||
DATA | HLDI001_00009 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Large weldon |
|
||||
DATA | HLDI001_00010 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Small compression |
|
||||
DATA | HLDI001_00011 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Small facemill adaptor |
|
||||
DATA | HLDI001_00012 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Small shrinkfit |
|
||||
DATA | HLDI001_00013 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Medium shrinkfit |
|
||||
DATA | HLDI001_00014 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Large shrinkfit |
|
||||
DATA | HLDI001_00015 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Extra large compression |
|
||||
DATA | HLDI001_00016 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Marge weldon |
|
||||
DATA | HLDI001_00017 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Morse taper |
|
||||
DATA | HLDI001_00018 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Morse taper |
|
||||
DATA | HLDI001_00019 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Morse taper |
|
||||
DATA | HLDI001_00020 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Small collet |
|
||||
DATA | HLDI001_00021 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Medium collet |
|
||||
DATA | HLDI001_00022 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Large collet |
|
||||
DATA | HLDI001_00023 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Large compression |
|
||||
DATA | HLDI001_00024 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Medium compression |
|
||||
DATA | HLDI001_00025 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Oversize compression |
|
||||
DATA | HLDI001_00026 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Morse taper |
|
||||
DATA | HLDI001_00027 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Short weldon |
|
||||
DATA | HLDI001_00028 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Short weldon |
|
||||
DATA | HLDI001_00029 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Small weldon |
|
||||
DATA | HLDI001_00030 | 1 | 1 | 0 | 3 | 0.00000 | 0.00000 | 0.00000 | Small weldon |
|
||||
DATA | HLDI001_00031 | 1 | 1 | 0 | 2 | 0.00000 | 0.00000 | 0.00000 | Large weldon |
|
||||
DATA | HLDI001_00032 | 1 | 1 | 0 | 16 | 0.00000 | 0.00000 | 0.00000 | BT40 Demo Hydraulic Chuck | BT40
|
||||
DATA | HLDI002_01001 | 1 | 2 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | Turn Standard square Holder with Adapter |
|
||||
DATA | HLDI002_01002 | 1 | 2 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | Turn Standard round Holder with Adapter |
|
||||
DATA | HLDI002_01003 | 1 | 2 | 1 | 0 | 0.00000 | 0.00000 | 0.00000 | Turn Groove square Holder with Adapter |
|
||||
DATA | HLDI002_01004 | 1 | 2 | 1 | 0 | 0.00000 | 0.00000 | 0.00000 | Turn Groove round Holder with Adapter |
|
||||
DATA | HLDI002_01005 | 1 | 2 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | Turn Standard square Holder |
|
||||
DATA | HLDI002_05003 | 1 | 2 | 2 | 0 | 0.00000 | 0.00000 | 0.00000 | Turn Thread square Holder |
|
||||
DATA | HLDI002_05004 | 1 | 2 | 2 | 0 | 0.00000 | 0.00000 | 0.00000 | Turn Thread round Holder |
|
||||
#END_DATA
|
||||
#-------------------------------------------------------------------------------
|
||||
# CLASS MILLING_DRILLING
|
||||
FORMAT LIBRF RTYPE SEQ DIAM LENGTH TAPER CRAD
|
||||
#-------------------------------------------------------------------------------
|
||||
DATA | HLDI001_00001 | 2 | 1 | 0.53000 | 0.32300 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00001 | 2 | 2 | 0.98000 | 0.89000 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00001 | 2 | 3 | 1.97000 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00002 | 2 | 1 | 0.50700 | 0.45500 | 20.00000 | 0.00000
|
||||
DATA | HLDI001_00002 | 2 | 2 | 0.82700 | 0.76100 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00002 | 2 | 3 | 3.25000 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00003 | 2 | 1 | 2.10000 | 0.32300 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00003 | 2 | 2 | 2.56000 | 2.07000 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00003 | 2 | 3 | 3.25000 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00004 | 2 | 1 | 2.16500 | 0.25000 | 53.00000 | 0.00000
|
||||
DATA | HLDI001_00004 | 2 | 2 | 2.83400 | 1.75000 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00004 | 2 | 3 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00005 | 2 | 1 | 1.41000 | 0.45500 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00005 | 2 | 2 | 2.04700 | 1.27300 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00005 | 2 | 3 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00006 | 2 | 1 | 0.83100 | 0.38000 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00006 | 2 | 2 | 1.37800 | 0.82500 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00006 | 2 | 3 | 1.96800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00007 | 2 | 1 | 2.57800 | 0.40700 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00007 | 2 | 2 | 3.14900 | 2.77700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00007 | 2 | 3 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00008 | 2 | 1 | 1.25000 | 0.45500 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00008 | 2 | 2 | 1.88900 | 1.27300 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00008 | 2 | 3 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00009 | 2 | 1 | 2.75500 | 0.56200 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00009 | 2 | 2 | 3.54300 | 3.21300 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00009 | 2 | 3 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00010 | 2 | 1 | 1.69300 | 2.00000 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00010 | 2 | 2 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00011 | 2 | 1 | 1.77600 | 0.75000 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00011 | 2 | 2 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00012 | 2 | 1 | 0.53150 | 0.32283 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00012 | 2 | 2 | 0.98425 | 0.89567 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00012 | 2 | 3 | 1.96850 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00013 | 2 | 1 | 0.64961 | 0.32283 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00013 | 2 | 2 | 1.10236 | 0.89370 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00013 | 2 | 3 | 1.96850 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00014 | 2 | 1 | 0.83071 | 0.39370 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00014 | 2 | 2 | 1.37795 | 0.82677 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00014 | 2 | 3 | 1.96850 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00015 | 2 | 1 | 1.12400 | 0.45500 | 30.00000 | 0.00000
|
||||
DATA | HLDI001_00015 | 2 | 2 | 1.65350 | 0.76378 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00015 | 2 | 3 | 1.96800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00016 | 2 | 1 | 1.40945 | 0.45669 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00016 | 2 | 2 | 2.04724 | 1.27559 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00016 | 2 | 3 | 2.52000 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00017 | 2 | 1 | 1.88900 | 2.98800 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00017 | 2 | 2 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00018 | 2 | 1 | 1.57500 | 2.39700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00018 | 2 | 2 | 1.96800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00019 | 2 | 1 | 0.98425 | 2.91300 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00019 | 2 | 2 | 2.48031 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00020 | 2 | 1 | 0.78700 | 1.21600 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00020 | 2 | 2 | 1.96800 | 1.21600 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00021 | 2 | 1 | 0.70800 | 1.13700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00021 | 2 | 2 | 2.50200 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00022 | 2 | 1 | 2.36000 | 2.00000 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00022 | 2 | 2 | 3.83800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00023 | 2 | 1 | 2.10630 | 0.32283 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00023 | 2 | 2 | 2.55906 | 2.07480 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00023 | 2 | 3 | 3.83858 | 0.62598 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00024 | 2 | 1 | 0.86600 | 1.61000 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00024 | 2 | 2 | 1.96800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00025 | 2 | 1 | 2.83400 | 2.79000 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00025 | 2 | 2 | 2.50000 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00026 | 2 | 1 | 1.25900 | 1.80700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00026 | 2 | 2 | 1.96800 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00027 | 2 | 1 | 0.83071 | 0.39370 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00027 | 2 | 2 | 1.37795 | 0.82677 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00027 | 2 | 3 | 2.51969 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00028 | 2 | 1 | 1.01575 | 0.45669 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00028 | 2 | 2 | 1.65354 | 0.76378 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00028 | 2 | 3 | 2.51969 | 0.62598 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00029 | 2 | 1 | 1.01575 | 0.45669 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00029 | 2 | 2 | 1.65354 | 0.76378 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00029 | 2 | 3 | 3.24803 | 0.62598 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00030 | 2 | 1 | 1.01575 | 0.45669 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00030 | 2 | 2 | 1.65354 | 1.27559 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00030 | 2 | 3 | 3.83858 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00031 | 2 | 1 | 2.50976 | 2.99213 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00031 | 2 | 2 | 3.83858 | 0.74700 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 1 | 1.01112 | 0.10236 | 30.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 2 | 1.12931 | 0.49573 | 7.50000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 3 | 1.25984 | 1.15387 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 4 | 1.25984 | 0.02960 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 5 | 1.30129 | 0.06316 | 70.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 6 | 1.64835 | 0.07399 | 35.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 7 | 1.75197 | 0.53011 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 8 | 1.75197 | 0.03150 | 45.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 9 | 2.48031 | 0.21124 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 10 | 2.48031 | 0.09978 | -60.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 11 | 2.13466 | 0.01969 | -50.66500 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 12 | 2.08661 | 0.15748 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 13 | 2.08661 | 0.01969 | 50.66500 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 14 | 2.13466 | 0.09978 | 60.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 15 | 2.48031 | 0.37659 | 0.00000 | 0.00000
|
||||
DATA | HLDI001_00032 | 2 | 16 | 1.77297 | 0.07874 | -8.29700 | 0.00000
|
||||
#END_DATA
|
||||
#-------------------------------------------------------------------------------
|
||||
# The following fields are defined for turning holders with RTYPE = 2
|
||||
# LIBRF - Unique holder identifier
|
||||
# HSTYLE - Standard Turning Tool Holder style
|
||||
# From A-Style to V-Style, the value is from 0 to 21
|
||||
# = 22, User Defined Style
|
||||
# GSTYLE - Groove Holder style
|
||||
# = 23 Groove-0
|
||||
# = 24 Groove-45
|
||||
# = 25 Groove-90
|
||||
# = 26 Groove-User-Defined
|
||||
# HHAND - Holder hand
|
||||
# = 0 Hand-Left
|
||||
# = 1 Hand-Neutral
|
||||
# = 2 Hand-Right
|
||||
# HLENGTH - Holder length
|
||||
# HWIDTH - Holder width
|
||||
# SHANKT - Shank type
|
||||
# = 0 Square-Shank
|
||||
# = 1 Round-Shank
|
||||
# SHANKW - Shank width
|
||||
# SHANKL - Shank line
|
||||
# HANGLE - Holder angle
|
||||
# INSERTX - Insert extension
|
||||
# SHANKH - Shank height
|
||||
# SDEFMODE - Standard Turning Shank Definition mode (Insert And Holder = 0 or Cutting Edge Angle = 1)
|
||||
# CEA - Standard Turning Cutting Edge Angle
|
||||
# ADAPTER - Has adapter (No = 0 or YES = 1)
|
||||
# ASTYLE - Adapter style (Axial = 0 or Radial = 1)
|
||||
# ALENGTH - Adapter length
|
||||
# AWIDTH - Adapter width
|
||||
# AHEIGHT - Adapter height
|
||||
# AZOFF - Adapter z-offset
|
||||
# ADIAM - Adapter diameter
|
||||
# ASTEPLEN - Adapter step length
|
||||
# ASTEPDIAM - Adapter step diameter
|
||||
# ATAPERLEN - Adapter taper length
|
||||
# ATAPERANG - Adapter taper angle
|
||||
# ABLCKLEN - Adapter block length
|
||||
# ABLCKWID - Adapter block width
|
||||
# ABLCKHGHT - Adapter block height
|
||||
# STYPE - Turning Subtype
|
||||
# = 0 TURNING_STD
|
||||
# = 1 GROOVE
|
||||
# = 2 THREAD
|
||||
#
|
||||
# CLASS TURNING_STD
|
||||
FORMAT LIBRF RTYPE HSTYLE HHAND HLENGTH HWIDTH SHANKT SHANKW SHANKL HANGLE SHANKH SDEFMODE CEA ADAPTER ASTYLE ALENGTH AWIDTH AHEIGHT AZOFF ADIAM ASTEPLEN ASTEPDIAM ATAPERLEN ATAPERANG ABLCKLEN ABLCKWID ABLCKHGHT STYPE
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
DATA | HLDI002_01001 | 2 | 11 | 0 | 5.90551 | 1.49606 | 0 | 1.18110 | 1.37795 | 90.00000 | 0.00000 | 0 | 0.00000 | 0 | 0 | 3.93701 | 3.14961 | 3.54331 | 1.18110 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0
|
||||
DATA | HLDI002_01002 | 2 | 16 | 0 | 11.81100 | 1.65354 | 1 | 1.37795 | 1.37795 | 0.00000 | 1.37795 | 0 | 0.00000 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0
|
||||
DATA | HLDI002_01005 | 2 | 22 | 0 | 5.90551 | 1.37795 | 0 | 0.98425 | 1.18110 | 90.00000 | 0.00000 | 1 | 100.00000 | 0 | 1 | 3.14961 | 3.93701 | 3.54331 | 1.18110 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0
|
||||
#END_DATA
|
||||
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# CLASS GROOVE
|
||||
FORMAT LIBRF RTYPE GSTYLE HHAND HLENGTH HWIDTH SHANKT SHANKW SHANKL HANGLE INSERTX SHANKH ADAPTER ASTYLE ALENGTH AWIDTH AHEIGHT AZOFF ADIAM ASTEPLEN ASTEPDIAM ATAPERLEN ATAPERANG ABLCKLEN ABLCKWID ABLCKHGHT
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
DATA | HLDI002_01003 | 2 | 23 | 0 | 4.72441 | 1.37795 | 0 | 1.18110 | 1.77165 | 90.00000 | 0.78740 | 1.37795 | 1 | 1 | 2.36220 | 2.75591 | 3.54331 | 1.18110 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | HLDI002_01004 | 2 | 23 | 0 | 4.72441 | 1.37795 | 1 | 1.18110 | 1.65354 | 270.00000 | 0.78740 | 0.00000 | 1 | 1 | 2.75591 | 0.00000 | 0.00000 | 0.00000 | 2.36220 | 0.00000 | 0.00000 | 0.00000 | 10.00000 | 3.14961 | 3.14961 | 3.14961
|
||||
#END_DATA
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
# CLASS THREAD
|
||||
FORMAT LIBRF RTYPE HHAND HLENGTH HWIDTH SHANKT SHANKW SHANKL HANGLE ADAPTER ASTYLE ALENGTH AWIDTH AHEIGHT AZOFF ADIAM ASTEPLEN ASTEPDIAM ATAPERLEN ATAPERANG ABLCKLEN ABLCKWID ABLCKHGHT
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#END_DATA
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# CLASS LASER
|
||||
FORMAT LIBRF RTYPE SEQ DIAM LENGTH TAPER CRAD
|
||||
#-------------------------------------------------------------------------------
|
||||
#END_DATA
|
||||
#
|
||||
#CLASS WEDM
|
||||
FORMAT LIBRF RTYPE SEQ DIAM LENGTH TAPER CRAD
|
||||
#-------------------------------------------------------------------------------
|
||||
#END_DATA
|
||||
#
|
||||
#CLASS FDM
|
||||
FORMAT LIBRF RTYPE SEQ DIAM LENGTH TAPER CRAD
|
||||
#-------------------------------------------------------------------------------
|
||||
#END_DATA
|
||||
#
|
||||
#CLASS ADDITIVE_TAPE
|
||||
FORMAT LIBRF RTYPE SEQ DIAM LENGTH TAPER CRAD
|
||||
#-------------------------------------------------------------------------------
|
||||
#END_DATA
|
||||
|
||||
|
||||
41
tool/english/multitool_database.dat
Normal file
41
tool/english/multitool_database.dat
Normal file
@@ -0,0 +1,41 @@
|
||||
# MULTITOOL_DATABASE.DAT
|
||||
##########################################################################
|
||||
#
|
||||
# PURPOSE:
|
||||
#
|
||||
# This is the database file used for defining multi-tools
|
||||
#
|
||||
#
|
||||
#
|
||||
# The next line causes the on site revision history to be saved.
|
||||
# To prevent this, delete the next line.
|
||||
# dbc_logname
|
||||
#
|
||||
##########################################################################
|
||||
# The data is organized using the following fields separated by |
|
||||
#
|
||||
# The following fields are defined for all records
|
||||
#
|
||||
#
|
||||
# LIBRF - Unique multi-tool set identifier (library reference of the set)
|
||||
# T - Type (Class identifier). Currently all 1 which means everything is multi-tool
|
||||
# STYPE - Subtype. Not currently used
|
||||
# SEQ - Sequence number used to order the multi-tools
|
||||
#
|
||||
#
|
||||
# The following fields are defined for multi-tools
|
||||
# CUTTERID - List of IDs to identify the cutters within the multi-tool
|
||||
# CUTTERLIBRF - List of librefs of objects in the tool_database.dat to identify
|
||||
# the individual cutters mounted to the multi-tool.
|
||||
# You can specify all kind of milling, drilling and turning cutters.
|
||||
# INDXNTCH - Index Notch, list of rotation angles around the multi-tool axis
|
||||
# to transform the corresponding cutter (insert) parallel to the lathe work plane
|
||||
# TURRETROT - Turret Rotation, list of incremental turet rotation angles
|
||||
# to transform the corresponding cutter (insert) parallel to the lathe work plane
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#CLASS MULTITOOL
|
||||
FORMAT LIBRF T STYPE SEQ CUTTERID CUTTERLIBRF
|
||||
#-------------------------------------------------------------------------------
|
||||
#END_DATA
|
||||
#-------------------------------------------------------------------------------
|
||||
122
tool/english/segmented_tool_database.dat
Normal file
122
tool/english/segmented_tool_database.dat
Normal file
@@ -0,0 +1,122 @@
|
||||
# SEGMENTED_TOOL_DATABASE.DAT
|
||||
##########################################################################
|
||||
#
|
||||
# PURPOSE:
|
||||
#
|
||||
# This is the database file used for defining multiple segment tools
|
||||
#
|
||||
#
|
||||
#
|
||||
# The next line causes the on site revision history to be saved.
|
||||
# To prevent this, delete the next line.
|
||||
# rief Thu Apr 09 2009 12:08 PM Saving ugti0251_010
|
||||
# rief Thu Apr 09 2009 12:09 PM Saving ugti0251_011
|
||||
# dbc_logname
|
||||
#
|
||||
#
|
||||
# 18sep2007 mjr add mill form tools
|
||||
# 09apr2009 mjr add back corner round mill form tools
|
||||
# 06Jan2012 Mark Rief 1880063 remove zero SL segments
|
||||
#
|
||||
##########################################################################
|
||||
# The data is organized using the following fields separated by |
|
||||
#
|
||||
# The following fields are defined for all records
|
||||
#
|
||||
# LIBRF - Unique trackpoint set identifier (library reference of the set)
|
||||
# TYPE - Type (Class identifier)
|
||||
# STYPE - Subtype of trackpoint. Not currently used
|
||||
# SEQ - Sequence number used to order the trackpoints
|
||||
#
|
||||
#
|
||||
# The following fields are defined for MILL_FORM tools
|
||||
#
|
||||
# LEN - Length of segment
|
||||
# ANGLE - Angle of segment
|
||||
# RAD - Radius of segment if circular, 0.0 for linear
|
||||
# SWEEP - Sweep angle for circular, 0.0 for linear
|
||||
#
|
||||
# The following fields are defined for STEP_DRILL
|
||||
#
|
||||
# DIAM - Diameter of segment
|
||||
# HEI - Height of segment
|
||||
# ANGLE - Angle of segment
|
||||
# RAD - Radius of segment if circular, 0.0 for linear
|
||||
#
|
||||
# The following fields are defined for TURN_FORM
|
||||
#
|
||||
# TP - Tracking Point
|
||||
# RADIUS - Nose radius
|
||||
# ANGLE - Nose angle
|
||||
# LENGTH - Edge length
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#CLASS MILL_FORM
|
||||
FORMAT LIBRF T STYPE SEQ LEN ANGLE RAD SWEEP
|
||||
#-------------------------------------------------------------------------------
|
||||
DATA | ugti0251_001 | 1 | 0 | 0 | 0.02344 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_001 | 1 | 0 | 1 | 0.00000 | 1.57080 | 0.06250 | -1.57080
|
||||
DATA | ugti0251_001 | 1 | 0 | 2 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_002 | 1 | 0 | 0 | 0.12500 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_002 | 1 | 0 | 1 | 0.00000 | 1.57080 | 0.12500 | -1.57080
|
||||
DATA | ugti0251_002 | 1 | 0 | 2 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_003 | 1 | 0 | 0 | 0.18750 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_003 | 1 | 0 | 1 | 0.00000 | 1.57080 | 0.25000 | -1.57080
|
||||
DATA | ugti0251_003 | 1 | 0 | 2 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_004 | 1 | 0 | 0 | 0.15625 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_004 | 1 | 0 | 1 | 0.00000 | 1.57080 | 0.37500 | -1.57080
|
||||
DATA | ugti0251_004 | 1 | 0 | 2 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_005 | 1 | 0 | 0 | 0.18750 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_005 | 1 | 0 | 1 | 0.00000 | 1.57080 | 0.50000 | -1.57080
|
||||
DATA | ugti0251_005 | 1 | 0 | 2 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_006 | 1 | 0 | 0 | 0.17675 | 0.78540 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_006 | 1 | 0 | 1 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_007 | 1 | 0 | 0 | 0.35350 | 0.78540 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_007 | 1 | 0 | 1 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_008 | 1 | 0 | 0 | 0.25000 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_008 | 1 | 0 | 1 | 0.35350 | 0.78540 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_008 | 1 | 0 | 2 | 0.35350 | 2.35619 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_008 | 1 | 0 | 3 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_009 | 1 | 0 | 0 | 0.50000 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_009 | 1 | 0 | 1 | 0.35350 | 0.78540 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_009 | 1 | 0 | 2 | 0.35350 | 2.35619 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_009 | 1 | 0 | 3 | 0.12500 | 3.14159 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_009 | 1 | 0 | 4 | 1.50000 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_010 | 1 | 0 | 0 | 0.15600 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_010 | 1 | 0 | 1 | 0.06200 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_010 | 1 | 0 | 2 | 0.01400 | 3.14159 | 0.06200 | -1.57080
|
||||
DATA | ugti0251_010 | 1 | 0 | 3 | 0.75100 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_010 | 1 | 0 | 4 | 0.10783 | 0.78540 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_010 | 1 | 0 | 5 | 1.42500 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_011 | 1 | 0 | 0 | 0.25000 | 0.00000 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_011 | 1 | 0 | 1 | 0.09300 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_011 | 1 | 0 | 2 | 0.01400 | 3.14159 | 0.12500 | -1.57080
|
||||
DATA | ugti0251_011 | 1 | 0 | 3 | 0.78200 | 1.57080 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_011 | 1 | 0 | 4 | 0.19660 | 0.78540 | 0.00000 | 0.00000
|
||||
DATA | ugti0251_011 | 1 | 0 | 5 | 1.91163 | 1.57080 | 0.00000 | 0.00000
|
||||
#END_DATA
|
||||
#-------------------------------------------------------------------------------
|
||||
#CLASS STEP_DRILL
|
||||
FORMAT LIBRF T STYPE SEQ DIAM HEI ANGLE RAD
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
DATA | ugti0304_016 | 1 | 1 | 0 | 0.50000 | 3.03508 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_017 | 1 | 1 | 0 | 0.50000 | 0.59060 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_017 | 1 | 1 | 1 | 0.56250 | 2.24769 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_020 | 1 | 1 | 0 | 0.25000 | 0.59060 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_020 | 1 | 1 | 1 | 0.50000 | 1.26164 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_023 | 1 | 1 | 0 | 0.25000 | 0.15750 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_023 | 1 | 1 | 1 | 0.53540 | 1.69474 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_024 | 1 | 1 | 0 | 0.50000 | 2.75590 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_024 | 1 | 1 | 1 | 1.29530 | 0.27918 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_025 | 1 | 1 | 0 | 0.62500 | 1.96850 | 0.00000 | 0.00000
|
||||
DATA | ugti0304_025 | 1 | 1 | 1 | 0.89170 | 2.09389 | 0.00000 | 0.00000
|
||||
#END_DATA
|
||||
#-------------------------------------------------------------------------------
|
||||
#CLASS TURN_FORM
|
||||
FORMAT LIBRF T STYPE SEQ TP RADIUS ANGLE LENGTH
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
#END_DATA
|
||||
|
||||
56
tool/english/shank_database.dat
Normal file
56
tool/english/shank_database.dat
Normal file
@@ -0,0 +1,56 @@
|
||||
# SHANK_ASCII.DAT
|
||||
##########################################################################
|
||||
#
|
||||
# PURPOSE:
|
||||
#
|
||||
# This is the database file used for defining multiple section tool
|
||||
# shanks.
|
||||
#
|
||||
#
|
||||
# The next line causes the on site revision history to be saved.
|
||||
# To prevent this, delete the next line.
|
||||
#
|
||||
# dbc_logname
|
||||
#
|
||||
##########################################################################
|
||||
# The data is organized using the following fields separated by |
|
||||
#
|
||||
# The following fields are defined for all records
|
||||
#
|
||||
# LIBRF - Unique holder identifier (library reference of the holder)
|
||||
# RTYPE - Record type
|
||||
# = 1 General shank record
|
||||
# = 2 Shank data record
|
||||
#
|
||||
# The following fields are defined for RTYPE = 1
|
||||
#
|
||||
# STYPE - Shank type
|
||||
# = 1 Milling and Drilling Holder
|
||||
# SNUM - Section number - count of sections for this holder
|
||||
# DESCR - Shank description
|
||||
#
|
||||
# The following fields are defined for Milling and Drilling holders with RTYPE = 2
|
||||
#
|
||||
# LIBRF - Unique shank identifier (same as in RTYPE = 1 record)
|
||||
# SEQ - Sequence number of section (represents where this section is
|
||||
# in the overall shank set.
|
||||
# DIAM - Diameter of section
|
||||
# LENGTH - Length of section
|
||||
# TAPER - Taper angle of section in degree
|
||||
# CRAD - Corner radius of section
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#CLASS MILLING_DRILLING
|
||||
FORMAT LIBRF RTYPE STYPE SNUM DESCR
|
||||
#-------------------------------------------------------------------------------
|
||||
DATA | SHKI001_00001 | 1 | 1 | 2 |
|
||||
#END_DATA
|
||||
#-------------------------------------------------------------------------------
|
||||
#CLASS MILLING_DRILLING
|
||||
FORMAT LIBRF RTYPE SEQ DIAM LENGTH TAPER CRAD
|
||||
#-------------------------------------------------------------------------------
|
||||
DATA | SHKI001_00001 | 2 | 1 | 0.45000 | 0.10000 | 14.03620 | 0.00000
|
||||
DATA | SHKI001_00001 | 2 | 2 | 0.50000 | 1.90000 | 0.00000 | 0.00000
|
||||
#END_DATA
|
||||
|
||||
4584
tool/english/tool_database.dat
Normal file
4584
tool/english/tool_database.dat
Normal file
File diff suppressed because it is too large
Load Diff
139
tool/english/trackpoint_database.dat
Normal file
139
tool/english/trackpoint_database.dat
Normal file
@@ -0,0 +1,139 @@
|
||||
# TRACKPOINT_DATABASE.DAT
|
||||
##########################################################################
|
||||
#
|
||||
# PURPOSE:
|
||||
#
|
||||
# This is the database file used for defining multiple tool
|
||||
# tracking points.
|
||||
#
|
||||
#
|
||||
#
|
||||
# The next line causes the on site revision history to be saved.
|
||||
# To prevent this, delete the next line.
|
||||
# dbc_logname
|
||||
#
|
||||
##########################################################################
|
||||
# The data is organized using the following fields separated by |
|
||||
#
|
||||
# The following fields are defined for all records
|
||||
#
|
||||
# LIBRF - Unique trackpoint set identifier (library reference of the set)
|
||||
# TYPE - Type (Class identifier)
|
||||
# STYPE - Subtype of trackpoint. Not currently used
|
||||
# NAME - Name given to the trackpoint by the user
|
||||
# SEQ - Sequence number used to order the trackpoints
|
||||
# ADJREG - Adjust register to be used with this trackpoint
|
||||
# CUTREG - Cutcom register to be used with this trackpoint
|
||||
#
|
||||
#
|
||||
# The following fields are defined for MILLING_DRILLING Tracking Points
|
||||
#
|
||||
# ADJSTAT - On/Off status of the Adjust register for this trackpoint
|
||||
# CUTSTAT - On/Off status of the Cutcom register for this trackpoint
|
||||
# DIAM - Distance of trackpoint from the tool centerline
|
||||
# DIST - Distance of trackpoint parallel to tool axis
|
||||
# ZOFF - Z Offset to be used with this trackpoint
|
||||
# ZOFFSTAT - On/Off status of the Z-Offset value
|
||||
# DEFTYPE - Define the tracking point position
|
||||
#
|
||||
# The following fields are defined for TURNING Tracking points
|
||||
#
|
||||
# XOFF - X Offset for this trackpoint
|
||||
# YOFF - Y Offset for this trackpoint
|
||||
# RADID - Radius ID Specifier for this trackpoint
|
||||
# CLUSTID - Cluster ID Specifier for this trackpoint
|
||||
# ANGLE - Angle value for this trackpoint
|
||||
# RAD - Radius for this trackpoint
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#CLASS MILLING_DRILLING
|
||||
FORMAT LIBRF T STYPE NAME SEQ ADJREG ADJSTAT CUTREG CUTSTAT DIAM DIST ZOFF ZOFFSTAT DEFTYPE
|
||||
#------------------------------------------------------------------------------------------
|
||||
DATA | TPI001_00001 | 1 | 0 | SHARP_CORNER | 1 | 0 | 0 | 0 | 0 | 0.25000 | 0.12500 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00001 | 1 | 0 | PILOT_DIA | 2 | 0 | 0 | 0 | 0 | 0.25000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00002 | 1 | 0 | sharp_corner | 1 | 0 | 0 | 0 | 0 | 0.12500 | 0.25000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00002 | 1 | 0 | TIP_DIA | 2 | 0 | 0 | 0 | 0 | 0.12500 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00003 | 1 | 0 | middle_.03 | 1 | 0 | 0 | 0 | 0 | 0.37500 | 0.10000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00003 | 1 | 0 | lower_corner | 2 | 0 | 0 | 0 | 0 | 0.25000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00004 | 1 | 0 | sharp_corner | 1 | 0 | 0 | 0 | 0 | 0.12500 | 0.25000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00004 | 1 | 0 | TIP_DIA | 2 | 0 | 0 | 0 | 0 | 0.12500 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00005 | 1 | 0 | SHARP_CORNER | 1 | 0 | 0 | 0 | 0 | 0.37500 | 0.25000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00005 | 1 | 0 | PILOT_DIA | 2 | 0 | 0 | 0 | 0 | 0.37500 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00006 | 1 | 0 | SHARP_CORNER | 1 | 0 | 0 | 0 | 0 | 0.31250 | 0.37500 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00006 | 1 | 0 | PILOT_DIA | 2 | 0 | 0 | 0 | 0 | 0.31250 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00007 | 1 | 0 | SHARP_CORNER | 1 | 0 | 0 | 0 | 0 | 0.37500 | 0.50000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00007 | 1 | 0 | PILOT_DIA | 2 | 0 | 0 | 0 | 0 | 0.37500 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00008 | 1 | 0 | ID_CORNER | 1 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00008 | 1 | 0 | MIDDLE | 2 | 0 | 0 | 0 | 0 | 0.12500 | 0.06250 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00008 | 1 | 0 | OD_CORNER | 3 | 0 | 0 | 0 | 0 | 0.25000 | 0.12500 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00009 | 1 | 0 | ID_CORNER | 1 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00009 | 1 | 0 | MIDDLE | 2 | 0 | 0 | 0 | 0 | 0.25000 | 0.12500 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00009 | 1 | 0 | OD_CORNER | 3 | 0 | 0 | 0 | 0 | 0.50000 | 0.25000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00010 | 1 | 0 | ID_CORNER | 1 | 0 | 0 | 0 | 0 | 0.50000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00010 | 1 | 0 | MIDDLE | 2 | 0 | 0 | 0 | 0 | 0.75000 | 0.12500 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00010 | 1 | 0 | OD_CORNER | 3 | 0 | 0 | 0 | 0 | 1.00000 | 0.25000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00010 | 1 | 0 | MIDDLE_TOP | 4 | 0 | 0 | 0 | 0 | 0.75000 | 0.37500 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00011 | 1 | 0 | ID_CORNER | 1 | 0 | 0 | 0 | 0 | 1.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00011 | 1 | 0 | MIDDLE | 2 | 0 | 0 | 0 | 0 | 1.25000 | 0.12500 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00011 | 1 | 0 | OD_CORNER | 3 | 0 | 0 | 0 | 0 | 1.50000 | 0.25000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00011 | 1 | 0 | MIDDLE_TOP | 4 | 0 | 0 | 0 | 0 | 1.25000 | 0.37500 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00012 | 1 | 0 | SHARP_CORNER | 1 | 0 | 0 | 0 | 0 | 0.04687 | 0.06250 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00012 | 1 | 0 | PILOT_DIA | 2 | 0 | 0 | 0 | 0 | 0.04687 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00013 | 1 | 0 | OD_TANGENT | 1 | 0 | 0 | 0 | 0 | 0.28400 | 0.06200 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00013 | 1 | 0 | ID_TANGENT | 2 | 0 | 0 | 0 | 0 | 0.16000 | 0.12400 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00013 | 1 | 0 | SHARP_CORNER | 3 | 0 | 0 | 0 | 0 | 0.16000 | 0.06200 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00014 | 1 | 0 | OD_TANGENT | 1 | 0 | 0 | 0 | 0 | 0.47200 | 0.09300 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00014 | 1 | 0 | ID_TANGENT | 2 | 0 | 0 | 0 | 0 | 0.22200 | 0.21800 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00014 | 1 | 0 | SHARP_CORNER | 3 | 0 | 0 | 0 | 0 | 0.22200 | 0.09300 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00015 | 1 | 0 | SYS_OD_Bottom | 1 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00015 | 1 | 0 | SYS_OD_Top | 2 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00015 | 1 | 0 | SYS_CL_Bottom | 3 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00015 | 1 | 0 | SYS_CL_Top | 4 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00016 | 1 | 0 | SYS_OD_Bottom | 1 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00016 | 1 | 0 | SYS_OD_Top | 2 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00016 | 1 | 0 | SYS_CL_Bottom | 3 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00016 | 1 | 0 | SYS_CL_Top | 4 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00017 | 1 | 0 | SYS_OD_Bottom | 1 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00017 | 1 | 0 | SYS_OD_Top | 2 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00017 | 1 | 0 | SYS_CL_Bottom | 3 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00017 | 1 | 0 | SYS_CL_Top | 4 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00018 | 1 | 0 | SYS_OD_Bottom | 1 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00018 | 1 | 0 | SYS_OD_Top | 2 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00018 | 1 | 0 | SYS_CL_Bottom | 3 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00018 | 1 | 0 | SYS_CL_Top | 4 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00019 | 1 | 0 | SYS_OD_Bottom | 1 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00019 | 1 | 0 | SYS_OD_Top | 2 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00019 | 1 | 0 | SYS_CL_Bottom | 3 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
DATA | TPI001_00019 | 1 | 0 | SYS_CL_Top | 4 | 0 | 0 | 0 | 0 | 0.00000 | 0.00000 | 0.00000 | 0 | 0
|
||||
#END_DATA
|
||||
#-------------------------------------------------------------------------------
|
||||
#CLASS TURNING
|
||||
FORMAT LIBRF T STYPE NAME SEQ ADJREG CUTREG XOFF YOFF RADID CLUSTID ANGLE RAD
|
||||
#-------------------------------------------------------------------------------
|
||||
DATA | TPI002_00001 | 2 | 0 | R1_P3_0 | 1 | 0 | 0 | -1.01575 | -2.72441 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00001 | 2 | 0 | R2_P4_0 | 2 | 0 | 0 | -0.85827 | -2.72441 | 1 | 4 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00002 | 2 | 0 | R1_P3_0 | 1 | 0 | 0 | -1.62402 | -2.72441 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00002 | 2 | 0 | R2_P4_0 | 2 | 0 | 0 | -1.46654 | -2.72441 | 1 | 4 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00003 | 2 | 0 | R1_P3_0 | 1 | 0 | 0 | -1.17327 | -2.82677 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00003 | 2 | 0 | R2_P4_0 | 2 | 0 | 0 | -0.85831 | -2.82677 | 1 | 4 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00004 | 2 | 0 | R1_P3_0 | 1 | 0 | 0 | -6.57972 | -0.51181 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00004 | 2 | 0 | R2_P4_0 | 2 | 0 | 0 | -6.49507 | -0.51181 | 1 | 4 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00005 | 2 | 0 | R1_P3_0 | 1 | 0 | 0 | -6.57972 | 0.51181 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00005 | 2 | 0 | R2_P4_0 | 2 | 0 | 0 | -6.49507 | 0.51181 | 1 | 4 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00006 | 2 | 0 | R1_P3_0 | 1 | 0 | 0 | -7.36417 | -0.92520 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00006 | 2 | 0 | R2_P4_0 | 2 | 0 | 0 | -7.20669 | -0.92520 | 1 | 4 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00007 | 2 | 0 | R2_P3_0 | 1 | 0 | 0 | 100.00000 | 100.00000 | 1 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_00007 | 2 | 0 | R1_P2_0 | 2 | 0 | 0 | 100.00000 | 100.25000 | 0 | 2 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01001 | 2 | 0 | R1_P3_1 | 1 | 1 | 1 | 0.00000 | 0.00000 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01002 | 2 | 0 | R1_P2_1 | 1 | 1 | 1 | 0.00000 | 0.00000 | 0 | 2 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01003 | 2 | 0 | R1_P3_1 | 1 | 1 | 1 | 0.00000 | 0.00000 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01003 | 2 | 0 | R2_P4_2 | 2 | 2 | 2 | 0.00000 | 0.00000 | 1 | 4 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01004 | 2 | 0 | R1_P1_1 | 1 | 1 | 1 | 0.00000 | 0.00000 | 0 | 1 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01004 | 2 | 0 | R2_P2_2 | 2 | 2 | 2 | 0.00000 | 0.00000 | 1 | 2 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01005 | 2 | 0 | R1_P4_1 | 1 | 1 | 1 | 0.00000 | 0.00000 | 0 | 4 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01006 | 2 | 0 | R1_P3_0 | 1 | 0 | 0 | 0.00000 | 0.00000 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01007 | 2 | 0 | R1_P3_0 | 1 | 0 | 0 | 0.00000 | 0.00000 | 0 | 3 | 0.00000 | 0.00000
|
||||
DATA | TPI002_01008 | 2 | 0 | R1_P2_0 | 1 | 0 | 0 | 0.00000 | 0.00000 | 0 | 2 | 0.00000 | 0.00000
|
||||
#END_DATA
|
||||
#-------------------------------------------------------------------------------
|
||||
BIN
tool/graphics/C6-CP-25BL-45065-11B/C6-CP-25BL-45065-11B.prt
Normal file
BIN
tool/graphics/C6-CP-25BL-45065-11B/C6-CP-25BL-45065-11B.prt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
tool/graphics/C6-CP-25BR-45065-11B/C6-CP-25BR-45065-11B.prt
Normal file
BIN
tool/graphics/C6-CP-25BR-45065-11B/C6-CP-25BR-45065-11B.prt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
tool/graphics/Fused_filament_2mm/Fused_filament_2mm.prt
Normal file
BIN
tool/graphics/Fused_filament_2mm/Fused_filament_2mm.prt
Normal file
Binary file not shown.
BIN
tool/graphics/OMP_PROBE_001/OMP_PROBE_001.prt
Normal file
BIN
tool/graphics/OMP_PROBE_001/OMP_PROBE_001.prt
Normal file
Binary file not shown.
BIN
tool/graphics/OMP_PROBE_001/PROBE-1.prt
Normal file
BIN
tool/graphics/OMP_PROBE_001/PROBE-1.prt
Normal file
Binary file not shown.
BIN
tool/graphics/OMP_PROBE_002/OMP_PROBE_002.prt
Normal file
BIN
tool/graphics/OMP_PROBE_002/OMP_PROBE_002.prt
Normal file
Binary file not shown.
BIN
tool/graphics/OMP_PROBE_002/PROBE-1.prt
Normal file
BIN
tool/graphics/OMP_PROBE_002/PROBE-1.prt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
tool/graphics/OMP_PROBEi_001/OMP_PROBEi_001.prt
Normal file
BIN
tool/graphics/OMP_PROBEi_001/OMP_PROBEi_001.prt
Normal file
Binary file not shown.
BIN
tool/graphics/OMP_PROBEi_001/PROBE-1.prt
Normal file
BIN
tool/graphics/OMP_PROBEi_001/PROBE-1.prt
Normal file
Binary file not shown.
BIN
tool/graphics/OMP_PROBEi_002/OMP_PROBEi_002.prt
Normal file
BIN
tool/graphics/OMP_PROBEi_002/OMP_PROBEi_002.prt
Normal file
Binary file not shown.
BIN
tool/graphics/OMP_PROBEi_002/PROBE-1.prt
Normal file
BIN
tool/graphics/OMP_PROBEi_002/PROBE-1.prt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
tool/graphics/Tape_Tool_6X1mm/Tape_Tool_6X1mm.prt
Normal file
BIN
tool/graphics/Tape_Tool_6X1mm/Tape_Tool_6X1mm.prt
Normal file
Binary file not shown.
BIN
tool/graphics/UGT0191_001/UGT0191_001.prt
Normal file
BIN
tool/graphics/UGT0191_001/UGT0191_001.prt
Normal file
Binary file not shown.
BIN
tool/graphics/UGT0191_001/ugt0191_001_holder_comp_1.prt
Normal file
BIN
tool/graphics/UGT0191_001/ugt0191_001_holder_comp_1.prt
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user