1
0

Initial commit

This commit is contained in:
2026-02-22 14:16:24 +01:00
commit 1692d191fa
3684 changed files with 10817616 additions and 0 deletions

View File

@@ -0,0 +1,162 @@
################################################################################
# This is the definition file for fixture 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
# 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 Type
{
DB_ID T
DB_ID_TYPE i
}
DB_ALIAS Description
{
DB_ID DESCR
DB_ID_TYPE s
DIALOG_NAME "Description"
RSET_NAME "Description"
}
# For Vises
DB_ALIAS JawWidth
{
DB_ID JAWWIDTH
DB_ID_TYPE d
DIALOG_NAME "Jaw Width"
RSET_NAME "Jaw Width"
}
DB_ALIAS MinJawHeight
{
DB_ID MINJAWHGHT
DB_ID_TYPE d
DIALOG_NAME "Min. Jaw Height"
RSET_NAME "Min. Jaw Height"
}
DB_ALIAS MaxJawHeight
{
DB_ID MAXJAWHGHT
DB_ID_TYPE d
DIALOG_NAME "Max. Jaw Height"
RSET_NAME "Max. Jaw Height"
}
DB_ALIAS MinClampWidth
{
DB_ID MINCLMPWIDTH
DB_ID_TYPE d
DIALOG_NAME "Min. Clamping Width"
RSET_NAME "Min. Clamping Width"
}
DB_ALIAS MaxClampWidth
{
DB_ID MAXCLMPWIDTH
DB_ID_TYPE d
DIALOG_NAME "Max. Clamping Width"
RSET_NAME "Max. Clamping Width"
}
# For Chucks
DB_ALIAS Diameter
{
DB_ID DIAMETER
DB_ID_TYPE d
DIALOG_NAME "Chuck Diameter"
RSET_NAME "Chuck Diameter"
}
DB_ALIAS MinClampDiameter
{
DB_ID MINCLMPDIA
DB_ID_TYPE d
DIALOG_NAME "Min. Clamping Diameter"
RSET_NAME "Min. Clamping Diameter"
}
DB_ALIAS MaxClampDiameter
{
DB_ID MAXCLMPDIA
DB_ID_TYPE d
DIALOG_NAME "Max. Clamping Diameter"
RSET_NAME "Max. Clamping Diameter"
}
#########################################################################
#########################################################################
LIBREF libref
#########################################################################
# The Class Hierarchy #
#########################################################################
CLASS Fixture
{
TYPE QRY
QUERY "[DB(Type)] != [0]"
DIALOG libref
RSET libref Type Description
CLASS Vise
{
TYPE QRY
QUERY "[DB(Type)] == [1]"
DIALOG libref Description JawWidth MinJawHeight MaxJawHeight MinClampWidth MaxClampWidth
RSET libref Description JawWidth MinJawHeight MaxJawHeight MinClampWidth MaxClampWidth
}
CLASS Chuck
{
TYPE QRY
QUERY "[DB(Type)] == [2]"
DIALOG libref Description Diameter MinClampDiameter MaxClampDiameter
RSET libref Description Diameter MinClampDiameter MaxClampDiameter
}
}

View File

@@ -0,0 +1,484 @@
###############################################################################
# dbc_fixture_ascii.tcl - DBC Event Handler for fixture database stored as ascii file
###############################################################################
##############################################################################
# REVISIONS
# Date Who Reason
# 09-Jul-2024 Dieter Krach MFEC-56430: Initial
# 07-Oct-2024 Dieter Krach MFEC-56432: Support export of fixtures
##############################################################################
#
proc ASC_m_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_m_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"
}
#
# fixture export procedures
#
set filename \
[ASC_m_create_filename "UGII_CAM_LIBRARY_FIXTURE_ASCII_DIR" "dbc_fixture_ascii_export.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 dbc_part_units
global asc_units
#
# 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
global dbc_rididity
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 dbc_rigidity 1.0
set asc_debug 0
# Set the unit for fixture search to the part unit
ASC_set_part_unit
# Create the filename for the fixture_database.dat
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 fixture_database.dat file."
set message "$message \n Neither of the environment variables"
set message "$message \n UGII_CAM_LIBRARY_FIXTURE_METRIC_DIR,"
set message "$message \n UGII_CAM_LIBRARY_FIXTURE_ENGLISH_DIR"
set message "$message \n is defined."
MOM_abort "\n $message"
}
# Ask the file sizes
set size_mm 0
set ret_val_mm 1
if { $asc_mm_file_name != "" } \
{
set ret_val_mm [catch {file size $asc_mm_file_name} size_mm]
}
set size_inch 0
set ret_val_inch 1
if { $asc_inch_file_name != "" } \
{
set ret_val_inch [catch {file size $asc_inch_file_name} size_inch]
}
if { $ret_val_mm == "1" && $ret_val_inch == "1" } \
{
set message "Error, can't read a fixture_database.dat file."
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"
}
# And load the file into memory
set append 0
if { $ret_val_mm == 0 } \
{
set ret_val [ASC_load_data_file $asc_mm_file_name $asc_units(mm) $append]
if { $ret_val == "1" } \
{
set message "Open error for UG/Library ASCII Data File: $asc_mm_file_name"
set message "$message \n $asc_mm_file_name"
MOM_abort "\n $message"
}
set append 1
}
if { $ret_val_inch == 0 } \
{
set ret_val [ASC_load_data_file $asc_inch_file_name $asc_units(inch) $append]
if { $ret_val == "1" } \
{
set message "Open error for UG/Library ASCII Data File: $asc_inch_file_name"
set message "$message \n $asc_inch_file_name"
MOM_abort "\n $message"
}
}
}
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_FIXTURE_METRIC_DIR
} \
else \
{
set env_var_name UGII_CAM_LIBRARY_FIXTURE_ENGLISH_DIR
}
set env_var [MOM_ask_env_var $env_var_name]
if { $env_var == "" } \
{
return ""
}
set fname ""
set fname [append fname $env_var "fixture_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 input
# ------------
global asc_debug
global asc_units
global dbc_libref
global dbc_retrieve_var_list
#
# global output
# -------------
# global dbc_holding_system
#
# Look for the desired libref
#
set found [ASC_array_search_fixture $dbc_libref db_row]
# fixture units
set units [ASC_ask_att_val _unitt $db_row "" $asc_units(mm) flag]
if { "$units" == "$asc_units(mm)" } \
{
set dbc_fixture_units 0
} \
else \
{
set dbc_fixture_units 1
}
#
# fixture description
global dbc_fixture_description
set dbc_fixture_description ""
#
# partfile name for fixture assembly
#
global dbc_fixture_part_name
set dbc_fixture_part_name ""
append dbc_fixture_part_name $dbc_libref ".prt"
#
# Ask the necessary attribute values
#
set dbc_fixture_description \
[ASC_ask_att_val DESCR $db_row "" unknown flag]
}
proc ASC_array_search_fixture { 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 message "Error retrieving fixture data from external library."
set message "$message \n Fixture 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_log_message "\n $message"
}
return $found
}
proc DBC_ask_library_values {} \
{
#
# global input
global dbc_libref
global dbc_db_ids_count
global dbc_db_ids
#
# global output
global dbc_db_ids_value
#
# Look for the desired libref
#
ASC_array_search_fixture $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 {} {
#---------------------------------------------
ASC_append_unit_to_query
ASC_execute_query
}
#---------------------------------------------
proc DBC_execute_query_for_count {} {
#---------------------------------------------
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
global asc_debug
set lhs "\$asc_database(\$db_row,_unitt)"
set subquery1 "($lhs == \"$asc_units(unknown)\")"
set subquery2 "($lhs == \"$dbc_search_units\")"
set subquery "($subquery1 || $subquery2)"
if { $asc_debug == 1 } \
{
puts $subquery
}
set dbc_query "$dbc_query && $subquery"
}
#------------------------------------------------------------------------
proc DBC_write { } {
#------------------------------------------------------------------------
global asc_database_name
set asc_database_name "fixture_database.dat"
ASC_write
}
#---------------------------------------------------------------------
proc ASC_output_header { fileid } {
#---------------------------------------------------------------------
global dbc_attr_count
global dbc_attr_aliases
global dbc_attr_id
global dbc_logname
set daytime [clock seconds]
set out_daytime [clock format $daytime -format "%a %b %d %Y %I:%M %p"]
set headerMessage "###############################################################################
# fixture_database.dat - database file for fixture database stored as ascii file
###############################################################################
#############################################################################
## Data file for the Machine fixtures
##
##
## REVISED:
## $dbc_logname $out_daytime
##
## The following key words for Attribute ids are defined
##
## LIBRF - unique record identifier
## T - fixture type - 1-Vice
## 2-Chuck
## DESCR - Short description ( Manufacturer, Product ID, etc.)
## MAXWIDTH - max clamping width for vices
## MINDIA - min clamping diameter for chucks
## MAXDIA - max clamping diameter for chucks
##
##############################################################################"
puts $fileid "$headerMessage"
# load the database structure
DBC_load_rset_data
# output FORMAT line
set format_line "FORMAT"
for {set i 0} {$i < $dbc_attr_count} {incr i} \
{
DBC_ask_attr_id $dbc_attr_aliases($i)
set format_line "$format_line $dbc_attr_id"
}
puts $fileid $format_line
puts $fileid "#--------------------------------------------------------------------------------"
}

View File

@@ -0,0 +1,578 @@
###############################################################################
# dbc_fixture_ascii_export.tcl - DBC Event Handler procs to support exporting fixtures
###############################################################################
##############################################################################
# REVISIONS
# Date Who Reason
# 07-Oct-2024 Dieter Krach Initial Release
##############################################################################
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_libref
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 new_fixture_record
global dbc_class
global dbc_export_file_name
MOM_ask_part_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_tempname $base_filename
append asc_tempname "_tmp"
set asc_backupname $base_filename
append asc_backupname "_bak"
# back up the existing version of the library
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"
close $tmp_fileid
return
}
# initialize processing flags
set class_match -1
set fixture_output 0
# build new fixture record
ASC_build_fixture_record
# Cycle over all the records in the input file looking for the spot
# to insert the input tool
while {[gets $input_fileid asc_cur_line] >= 0} \
{
ASC_analyze_line
switch -- $asc_record_type \
{
"Comment"
{
puts $tmp_fileid $asc_cur_line
}
"Class"
{
puts $tmp_fileid $asc_cur_line
# Compare this class to the class of tool we are inserting
set class_match [string compare $dbc_class $asc_class]
}
"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 } \
{
puts $tmp_fileid $new_fixture_record
set fixture_output 1
} else \
{
puts $tmp_fileid $asc_cur_line
}
}
"End Data"
{
# If we haven't output the tool record and we are processing the
# class of the input tool, do it now and then this rec
if { $fixture_output == 0 && $class_match == 0} \
{
puts $tmp_fileid $new_fixture_record
set fixture_output 1
}
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_analyze_line { } \
{
global asc_class
global asc_cur_line
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 } \
{
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]
} 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"
}
}
proc ASC_update { } \
{
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_clsf_decimal_places
global mom_clsf_decimal_places
global asc_cur_line
global asc_record_type
global asc_class
global asc_record_libref
global new_fixture_record
global dbc_class
global num_formats_processed
set dbc_class ""
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 class_match -1
set add_libref 0
# Cycle over all the records in the input file looking for the spot
# to insert the input tool
while {[gets $input_fileid asc_cur_line] >= 0} \
{
ASC_analyze_line
switch -- $asc_record_type \
{
"Comment"
{
puts $tmp_fileid $asc_cur_line
}
"Format"
{
puts $tmp_fileid $asc_cur_line
}
"Data"
{
puts $tmp_fileid $asc_cur_line
}
"End Data"
{
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 DBC_write { } \
{
ASC_write_local
}
proc ASC_write_local { } \
{
global asc_units
global dbc_part_units
global dbc_event_error
global dbc_logname
global dbc_libref
global dbc_class
global asc_cur_line
global asc_record_type
global asc_class
global asc_database_fmt_index
global dbc_export_file_name
global dbc_class
global num_formats_processed
MOM_ask_part_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_tempname $base_filename
append asc_tempname "_tmp"
set asc_backupname $base_filename
append asc_backupname "_bak"
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
}
# initialize processing flags
set class_match -1
set fixture_output 0
set saving_processd 0
set asc_database_fmt_index -1
# Cycle over all the records in the input file looking for the spot
# to insert the input tool
while {[gets $input_fileid asc_cur_line] >= 0} \
{
ASC_analyze_line
switch -- $asc_record_type \
{
"Comment"
{
puts $tmp_fileid $asc_cur_line
}
"Class"
{
puts $tmp_fileid $asc_cur_line
set class_match [string compare $dbc_class %asc_class]
}
"Format"
{
puts $tmp_fileid $asc_cur_line
incr asc_database_fmt_index
}
"Data"
{
if { $class_match != 0 } \
{
puts $tmp_fileid $asc_cur_line
} else \
{
if { $saving_processd != 1} \
{
# process saving query
set saving_processd 1
ASC_output_data $tmp_fileid
}
}
}
default
{
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_build_fixture_record { } \
{
global dbc_Type
# Call class specific proc to build the required tool record
# The case values must match the tool classes described in the .def file
switch -- $dbc_Type \
{
1
{
ASC_build_mill_fixture
}
2
{
ASC_build_turn_fixture
}
}
}
proc ASC_build_mill_fixture { } {
global new_fixture_record
global dbc_libref
global dbc_Type
global dbc_JawWidth
global dbc_MinJawHeight
global dbc_MaxJawHeight
global dbc_MinClampWidth
global dbc_MaxClampWidth
ASC_append_common_attributes
set tmp [format " | %.3f" $dbc_JawWidth]
append new_fixture_record $tmp
set tmp [format " | %.3f" $dbc_MinJawHeight]
append new_fixture_record $tmp
set tmp [format " | %.3f" $dbc_MaxJawHeight]
append new_fixture_record $tmp
set tmp [format " | %.3f" $dbc_MinClampWidth]
append new_fixture_record $tmp
set tmp [format " | %.3f" $dbc_MaxClampWidth]
append new_fixture_record $tmp
}
proc ASC_build_turn_fixture { } {
global new_fixture_record
global dbc_libref
global dbc_Type
global dbc_Diameter
global dbc_MinClampDiameter
global dbc_MaxClampDiameter
ASC_append_common_attributes
set tmp [format " | %.3f" $dbc_Diameter]
append new_fixture_record $tmp
set tmp [format " | %.3f" $dbc_MinClampDiameter]
append new_fixture_record $tmp
set tmp [format " | %.3f" $dbc_MaxClampDiameter]
append new_fixture_record $tmp
}
proc ASC_append_common_attributes { } {
global new_fixture_record
global dbc_libref
global dbc_Type
global dbc_Description
set new_fixture_record "DATA | $dbc_libref | $dbc_Type | $dbc_Description"
}

View File

@@ -0,0 +1,41 @@
###############################################################################
# fixture_database.dat - database file for fixture database stored as ascii file
###############################################################################
#############################################################################
## Data file for the Machine fixtures
##
##
## REVISED:
## $dbc_logname $out_daytime
##
## The following key words for Attribute ids are defined
##
## LIBRF - unique record identifier
## T - fixture type - 1-Vice
## 2-Chuck
## DESCR - Short description ( Product ID, etc.)
## JAWWIDTH - The width of the jaws of a vise
## MINJAWHGHT - The minimum height the jaws of a vise can hold
## MAXJAWHGHT - The maximum height the jaws of a vise can grip
## MINCMLPWIDTH - min clamping width for vises
## MAXCLMPWIDTH - max clamping width for vises
## DIAMETER - the diameter of the chuck's body
## MINCLMPDIA - min clamping diameter for chucks
## MAXCLMPDIA - max clamping diameter for chucks
##
##############################################################################"
##
##############################################################################
#CLASS VISE
FORMAT LIBRF T DESCR JAWWIDTH MINJAWHGHT MAXJAWHGHT MINCMLPWIDTH MAXCLMPWIDTH
#----------------------------------------------------------------------------------------------------------------------
DATA | Sim01Vise_in | 1 | Sim01Vise | 6.0 | 1.6 | 1.6 | 0.0 | 11.0
#END_DATA
#CLASS CHUCK
FORMAT LIBRF T DESCR DIAMETER MINCLMPDIA MAXCLMPDIA
#-------------------------------------------------------------------------------------
DATA | SimpleChuck_in | 2 | SimpleChuck | 8.0 | 2.0 | 10.5
#END_DATA

View File

@@ -0,0 +1,41 @@
###############################################################################
# fixture_database.dat - database file for fixture database stored as ascii file
###############################################################################
#############################################################################
## Data file for the Machine fixtures
##
##
## REVISED:
## $dbc_logname $out_daytime
##
## The following key words for Attribute ids are defined
##
## LIBRF - unique record identifier
## T - fixture type - 1-Vice
## 2-Chuck
## DESCR - Short description ( Product ID, etc.)
## JAWWIDTH - The width of the jaws of a vise
## MINJAWHGHT - The minimum height the jaws of a vise can hold
## MAXJAWHGHT - The maximum height the jaws of a vise can grip
## MINCMLPWIDTH - min clamping width for vises
## MAXCLMPWIDTH - max clamping width for vises
## DIAMETER - the diameter of the chuck's body
## MINCLMPDIA - min clamping diameter for chucks
## MAXCLMPDIA - max clamping diameter for chucks
##
##############################################################################"
##
##############################################################################
#CLASS VISE
FORMAT LIBRF T DESCR JAWWIDTH MINJAWHGHT MAXJAWHGHT MINCMLPWIDTH MAXCLMPWIDTH
#---------------------------------------------------------------------------------------------------------------------
DATA | Sim01Vise_mm | 1 | Sim01Vise | 152.42 | 40.9 | 40.9 | 0.0 | 280.0
#END_DATA
#CLASS CHUCK
FORMAT LIBRF T DESCR DIAMETER MINCLMPDIA MAXCLMPDIA
#-------------------------------------------------------------------------------------
DATA | SimpleChuck_mm | 2 | SimpleChuck | 200.0 | 50.0 | 270.0
#END_DATA