diff --git "a/PB16_1999_release/POSTBUILD/app/Postino-\320\277\320\260\321\200\320\260\320\274\320\265\321\202\321\200\321\213.exe" "b/PB16_1999_release/POSTBUILD/app/Postino-\320\277\320\260\321\200\320\260\320\274\320\265\321\202\321\200\321\213.exe" new file mode 100644 index 0000000..6aa6dda Binary files /dev/null and "b/PB16_1999_release/POSTBUILD/app/Postino-\320\277\320\260\321\200\320\260\320\274\320\265\321\202\321\200\321\213.exe" differ diff --git a/PB16_1999_release/POSTBUILD/app/Postino.exe b/PB16_1999_release/POSTBUILD/app/Postino.exe new file mode 100644 index 0000000..b659e81 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/app/Postino.exe differ diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_address.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_address.tcl new file mode 100644 index 0000000..6262deb --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_address.tcl @@ -0,0 +1,620 @@ +############################################################################## +# Description # +# This file contains all functions dealing with the ADDRESS Object. # +# The definition file is read and the respective ADDRESS Objects are # +# created. All actions on the format page of the UI is mapped into the # +# respective functions in this file through the interface file. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 07-Apr-1999 mnb Removed puts # +# 02-May-1999 mnb Added a procedure, which return the address code for # +# definition file. # +# 02-Jun-1999 mnb Code Integration # +# 14-Jun-1999 mnb Removed N from address list # +# 23-Jun-1999 mnb Better parser # +# 07-Sep-1999 mnb Changed address attributes # +# 21-Sep-1999 mnb Added Create, Cut & Paste address functions # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +#This procedure seggregates the lines valid for ADDRESS Object. +#The input to the function is the FILE Object and the ADDRESS OBJECT List. +#This function is called from the classes.tcl file. The Definition file is +#read and the lines containing ADDRESS are passed into the secondary parsing +#function. +#============================================================================= + +proc PB_adr_AdrInitParse {this OBJ_LIST FOBJ_LIST} { + upvar $OBJ_LIST obj_list + upvar $FOBJ_LIST fobj_list + set add_start 0 + set ret_code 0 + + array set address_arr $ParseFile::($this,address_list) + array set arr_size $ParseFile::($this,arr_size_list) + set file_name_list $ParseFile::($this,file_list) + + foreach f_name $file_name_list \ + { + set no_of_address $arr_size($f_name,address) + for {set count 0} {$count < $no_of_address} {incr count} \ + { + set open_flag 0 + set close_flag 0 + set add_start 0 + foreach line $address_arr($f_name,$count,data) \ + { + if {[string match "*ADDRESS*" $line]}\ + { + set temp_line $line + PB_com_RemoveBlanks temp_line + set add_start 1 + # Initialize the address attribute values. + PB_adr_InitAdrObj obj_attr + + set obj_attr(0) [lindex $temp_line 1] + set obj_attr(8) [lindex $temp_line 1] + } + + if { $add_start } \ + { + if { $open_flag == 0} \ + { + PB_mthd_CheckOpenBracesInLine line open_flag + } + + if { $close_flag == 0} \ + { + PB_mthd_CheckCloseBracesInLine line close_flag + } + + if { $open_flag } \ + { + # Removes all the blanks from a line + PB_com_RemoveBlanks line + + # Corresponding to each line the attributes are set. + switch -glob $line\ + { + *FORMAT* { + set obj_name [lindex $line 1] + + # The FORMAT Object id is found out from + # the format name. + PB_com_RetObjFrmName obj_name fobj_list \ + ret_code + set obj_attr(1) $ret_code + } + *FORCE* { + set obj_attr(2) [lindex $line 1] + set obj_attr(3) 1 + } + *MAX* { + set obj_attr(4) [lindex $line 1] +# Temp fix +# set obj_attr(5) 1 + set obj_attr(5) + } + *MIN* { + set obj_attr(6) [lindex $line 1] +# Temp fix +# set obj_attr(7) 1 + set obj_attr(7) + } + *LEADER* { + # Extracts leader from the line + PB_adr_ExtractLeader line leader + set obj_attr(8) $leader + } + *TRAILER* { + set obj_attr(9) [lindex $line 1] + set obj_attr(10) 1 + } + *INCREMENTAL* { + set obj_attr(11) [lindex $line 1] + } + } + } + + if { $close_flag } \ + { + # Creates the address object after validating the name. + PB_adr_CreateValidAdrObj obj_attr obj_list + set add_start 0 + set close_flag 0 + } + } + } + } + } +} + +#=============================================================================== +#This function takes the line as the input and extracts the leader from the line. +#The quotes are removed from the line string. All different combinations of the +#quotes are taken care in this function. +#=============================================================================== + +proc PB_adr_ExtractLeader {LINE LEADER} { + upvar $LINE line + upvar $LEADER leader + + #Testing for the left quote. + set leader_part [lindex $line 1] + set st_fst_test [string first \" $leader_part] + set st_start [expr $st_fst_test + 1] + + #If left quote is there + if {$st_fst_test != -1}\ + { + set st_lst_test [string last \" $leader_part] + set st_end [expr $st_lst_test - 1] + + #If the right quote is there. + if {$st_lst_test != -1}\ + { + set leader [string range $leader_part $st_start $st_end] + } else\ + { + #Only left quote is there. + set leader [string range $leader_part $st_start end] + } + } else\ + { + #Else set the leader + set leader $leader_part + } +} + +#=============================================================================== +#This function takes the object attributes as the input and initializes the +#attributes of the ADDRESS Object. +#=============================================================================== + +proc PB_adr_InitAdrObj {OBJ_ATTR} { +upvar $OBJ_ATTR obj_attr + + # Initialize the object attributes.The attributes are listed in the + # classes.tcl file. + set obj_attr(0) "" + set obj_attr(1) "" + set obj_attr(2) "" + set obj_attr(3) 1 + set obj_attr(4) "" + set obj_attr(5) "truncate" + set obj_attr(6) "" + set obj_attr(7) "truncate" + set obj_attr(8) "" + set obj_attr(9) "" + set obj_attr(10) 1 + set obj_attr(11) "" + set obj_attr(12) "" +} + +#=============================================================================== +#This procedure takes the format object lits and adress object list as input, +#creates the dummy TEXT Address, which will be used to display Text Strings. +#The ADDRESS Object is then appended into the address object list. +#=============================================================================== + +proc PB_adr_CreateTextAddObj {ADD_OBJ_LIST FMT_OBJ_LIST} { + upvar $ADD_OBJ_LIST add_obj_list + upvar $FMT_OBJ_LIST fmt_obj_list + + set add_name "Text" + # Returns the object id of Text address, if it exists + PB_com_RetObjFrmName add_name add_obj_list ret_code + if {$ret_code} { return } + + # Sets the format name used in the address as "String". + set fmt_name "String" + + # Returns the object id from object name + PB_com_RetObjFrmName fmt_name fmt_obj_list ret_code + if { $ret_code == 0 } \ + { + # Creates a new format by name String + set fmt_str_obj_attr(0) "String" + set fmt_str_obj_attr(1) "Text String" + set fmt_str_obj_attr(2) 0 + set fmt_str_obj_attr(3) 0 + set fmt_str_obj_attr(4) 0 + set fmt_str_obj_attr(5) 0 + set fmt_str_obj_attr(6) 0 + set fmt_str_obj_attr(7) 0 + PB_fmt_CreateFmtObj fmt_str_obj_attr fmt_obj_list + set ret_code [lindex $fmt_obj_list end] + } + + #Initialize the address attribute values. + PB_adr_InitAdrObj obj_attr + + #Sets the object name and format object. + set obj_attr(0) "Text" + set obj_attr(1) $ret_code + + #Creates the address object. + PB_adr_CreateAdrObj obj_attr add_obj_list + + set no_adds [llength $add_obj_list] + set object [lindex $add_obj_list [expr $no_adds - 1]] + + set mseq_attr(0) "" + set mseq_attr(1) 0 + set mseq_attr(2) "Text String" + set mseq_attr(3) $no_adds + + address::SetMseqAttr $object mseq_attr + address::DefaultMseqAttr $object mseq_attr +} + + +#=============================================================================== +#This procedure splits the address object list generated from the definition file +#into two seperate lists, the general address object list and the list file address +#object list. The address object list generated from the defenition file is passed +#into the function and list file object list is output, after removing the repective +#objects from the address object list, modifying it as general address object list. +#=============================================================================== + +proc PB_adr_SepBlkAndLFileAddLists {OBJ_LIST LF_OBJ_LIST} { + upvar $OBJ_LIST obj_list + upvar $LF_OBJ_LIST lf_obj_list + + foreach object $obj_list\ + { + set add_name $address::($object,add_name) + + #Segregating the List File Addresses + switch $add_name\ + { + LF_ENUM - LF_XABS - + LF_YABS - LF_ZABS - + LF_AAXIS - LF_BAXIS - + LF_FEED - + LF_TIME - + LF_SPEED { + lappend lf_obj_list $object + set obj_ind [lsearch $obj_list $object] + set obj_list [lreplace $obj_list $obj_ind $obj_ind] + } + } + } +} + + +#=============================================================================== +#This procedure creates a valid address object after checking the the name of the +#object. The updated object list is output from the function. +#=============================================================================== + +proc PB_adr_CreateValidAdrObj {OBJ_ATTR OBJ_LIST} { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + set ret_code 0 + + #Checking for the Occurance of an Address with the same name + PB_com_RetObjFrmName obj_attr(0) obj_list ret_code + + if {!$ret_code}\ + { + #Creates the address object. + PB_adr_CreateAdrObj obj_attr obj_list + } +} + +#=============================================================================== +#This function takes the object attributes and the latest ADDRESS object list +#as the input, creates the ADDRESS Object and returns the updated object list. +#=============================================================================== + +proc PB_adr_CreateAdrObj {OBJ_ATTR OBJ_LIST} { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + global post_object + + # Creates new object. + set object [new address] + + # Appends object id to the object list. + lappend obj_list $object + + # sets the latest value to the object created. + address::setvalue $object obj_attr + + # Sets the default value to the object. + address::DefaultValue $object obj_attr +# puts "The ADD object is created : $object" + + # Appends the address to the format object + set fmt_obj $obj_attr(1) + format::AddToAddressList $fmt_obj object + + # Sets the master sequence attributes + set addr_name $obj_attr(0) + array set mseq_word_param $Post::($post_object,msq_word_param) + if {[info exists mseq_word_param($addr_name)]} \ + { + set addr_mseq_param $mseq_word_param($addr_name) + set mseq_attr(0) [lindex $addr_mseq_param 0] + set mseq_attr(1) [lindex $addr_mseq_param 1] + set mseq_attr(2) [lindex $addr_mseq_param 2] + set seq_no [lsearch $Post::($post_object,msq_add_name) $addr_name] + set mseq_attr(3) $seq_no + } elseif {[string compare $addr_name "N"] == 0} \ + { + set mseq_attr(0) "" + set mseq_attr(1) 0 + set mseq_attr(2) "Sequence Number" + set seq_no [llength $Post::($post_object,msq_add_name)] + set mseq_attr(3) $seq_no + } else \ + { + set mseq_attr(0) "" + set mseq_attr(1) 0 + set mseq_attr(2) "" + set seq_no [llength $Post::($post_object,msq_add_name)] + set mseq_attr(3) $seq_no + } + address::SetMseqAttr $object mseq_attr + address::DefaultMseqAttr $object mseq_attr +} + +#=============================================================================== +proc PB_adr_GetAddressNameList { ADD_OBJ_LIST ADD_NAME_LIST} { +#=============================================================================== + upvar $ADD_OBJ_LIST add_obj_list + upvar $ADD_NAME_LIST add_name_list + + foreach add_obj $add_obj_list \ + { + lappend add_name_list $address::($add_obj,add_name) + } + + if {![info exists add_name_list]} \ + { + set add_name_list "" + } +} + +#=============================================================================== +proc PB_adr_SortAddresses { ADD_OBJ_LIST } { +#=============================================================================== + upvar $ADD_OBJ_LIST add_obj_list + + set no_elements [llength $add_obj_list] + for {set ii 0} {$ii < [expr $no_elements - 1]} {incr ii} \ + { + for {set jj [expr $ii + 1]} {$jj < $no_elements} {incr jj} \ + { + set addr_ii_obj [lindex $add_obj_list $ii] + set addr_ii_indx $address::($addr_ii_obj,seq_no) + + set addr_jj_obj [lindex $add_obj_list $jj] + set addr_jj_indx $address::($addr_jj_obj,seq_no) + if {$addr_jj_indx < $addr_ii_indx} \ + { + set add_obj_list [lreplace $add_obj_list $ii $ii $addr_jj_obj] + set add_obj_list [lreplace $add_obj_list $jj $jj $addr_ii_obj] + } + } + } +} + +#=============================================================================== +proc PB_adr_RetAddressObjList { ADDR_OBJ_LIST } { +#=============================================================================== + upvar $ADDR_OBJ_LIST addr_obj_list + global post_object + + set addr_obj_list $Post::($post_object,add_obj_list) +} + +#=============================================================================== +proc PB_adr_RetAddressNameList { ADDR_OBJ_LIST ADDR_NAME_LIST } { +#=============================================================================== + upvar $ADDR_OBJ_LIST addr_obj_list + upvar $ADDR_NAME_LIST addr_name_list + + set addr_name_list "" + foreach add_obj $addr_obj_list \ + { + lappend addr_name_list $address::($add_obj,add_name) + } +} + +#=============================================================================== +#This procedure is called from the UI APPLY button through the interface. +#The object list, name list, Object attributes and Object index is input +#to the function and the values are stored in the corresponding object +#and then the data is retrieved and dipalyed in the UI. +#=============================================================================== + +proc PB_adr_ApplyAdrObj {OBJ_LIST FOBJ_LIST OBJ_ATTR ADDR_OBJ} { + upvar $OBJ_LIST obj_list + upvar $FOBJ_LIST fobj_list + upvar $OBJ_ATTR obj_attr + upvar $ADDR_OBJ addr_obj + + # sets the format object + PB_com_RetObjFrmName obj_attr(1) fobj_list ret_code + set obj_attr(1) $ret_code + + # Gets the present attributes of address + address::readvalue $addr_obj pres_obj_attr + + # Sets the value of the object. + address::setvalue $addr_obj obj_attr + + if {$obj_attr(1) != $pres_obj_attr(1)} \ + { + format::DeleteFromAddressList $pres_obj_attr(1) addr_obj + format::AddToAddressList $obj_attr(1) addr_obj + } +} + +#=============================================================================== +#This procedure reads the default value of a ADDRESS Object. The Object list and the +#Object index is given as input and the default value is read and stored in the +#Object attribute. +#=============================================================================== + +proc PB_adr_DefAdrObjAttr {OBJ_LIST OBJ_ATTR OBJ_INDEX} { + upvar $OBJ_LIST obj_list + upvar $OBJ_ATTR obj_attr + upvar $OBJ_INDEX obj_index + + #Sets the Object from the list. + set object [lindex $obj_list $obj_index] + + #Reads the default value of the object and set it to the Object attribute. + set default_value $address::($object,def_value) + array set obj_attr $default_value + + #Sets the format name from the format object. + set obj_attr(1) $format::($obj_attr(1),for_name) +} + +#=============================================================================== +proc PB_adr_RetAddFrmAddAttr { OBJ_ATTR ADD_VALUE } { +#=============================================================================== + upvar $OBJ_ATTR obj_attr + upvar $ADD_VALUE add_value + + for {set jj 1} {$jj < 11} {incr jj}\ + { + switch $jj\ + { + 1 { + if {$obj_attr($jj) != ""} { + set for_name $format::($obj_attr($jj),for_name) + lappend add_value "FORMAT $for_name" + } + } + 2 { + if {$obj_attr($jj) != ""}\ + { + lappend add_value "FORCE $obj_attr($jj)" + } + } + 4 { + if {$obj_attr($jj) != ""}\ + { + lappend add_value "MAX $obj_attr($jj)" + } + } + 6 { + if {$obj_attr($jj) != ""}\ + { + lappend add_value "MIN $obj_attr($jj)" + } + } + 8 { + if {[string compare $obj_attr(0) $obj_attr($jj)]} \ + { + lappend add_value "LEADER \"$obj_attr($jj)\"" + } + } + 9 { + if {$obj_attr($jj) != ""}\ + { + lappend add_value "TRAILER \"$obj_attr($jj)\"" + } + } + } + } +} + +#=============================================================================== +# This function is called from the interface file, the callback from the +# "Create" button of the Address page. New ADDRESS Object is created taking +# the object attribute, object list name list and object index from the UI +# passed through the interface file. +#=============================================================================== + +proc PB_adr_CreateNewAdrObj { OBJ_LIST OBJ_ATTR OBJ_INDEX} { + upvar $OBJ_LIST obj_list + upvar $OBJ_ATTR obj_attr + upvar $OBJ_INDEX obj_index + + # The address object is created. Format object is retrieved from + # the format name + PB_adr_CreateAdrObj obj_attr obj_list + + #Sets the object index for the new object. if the index is null sets to zero. + if {$obj_index == ""}\ + { + set obj_index 0 + } else\ + { + incr obj_index + } + + # Finding the length of the object list. + set length [llength $obj_list] + + # The newely created object is removed from the list. + set RearrObj [lindex $obj_list [expr $length -1]] + + # The newely created object is removed and inserted in the + # correct object index. + set obj_list [lreplace $obj_list [expr $length - 1] [expr $length -1]] + set obj_list [linsert $obj_list $obj_index $RearrObj] + + # Sets master sequence parameters + # Add master sequence parameters here, to sequence the new address + set mseq_attr(0) "\$mom_usd_add_var" + set mseq_attr(1) 0 + set mseq_attr(2) "User Defined Address" + set mseq_attr(3) [llength $obj_list] + address::SetMseqAttr $RearrObj mseq_attr + address::DefaultMseqAttr $RearrObj mseq_attr +} + +#=============================================================================== +# This procedure reads value from the buffer object, creates a new ADDRESS +# Object and #stores the value in the new object, and returns the value to +# the UI. The Input to the procedure are object list, name list, object, +# object index and buffer object and the output from the procedure is the +# updated name and object list along with the display attributes for the new +# PASTE object. +#=============================================================================== +proc PB_adr_PasteAdrBuffObj { ADD_OBJ_LIST BUFF_OBJ_ATTR ADD_MSEQ_ATTR \ + OBJ_INDEX } { + upvar $ADD_OBJ_LIST add_obj_list + upvar $BUFF_OBJ_ATTR buff_obj_attr + upvar $ADD_MSEQ_ATTR add_mseq_attr + upvar $OBJ_INDEX obj_index + global post_object + + # Create new Address Object with the attributes read from the buffer object. + set fmt_obj_list $Post::($post_object,fmt_obj_list) + PB_com_RetObjFrmName buff_obj_attr(1) fmt_obj_list ret_code + set buff_obj_attr(1) $ret_code + PB_adr_CreateAdrObj buff_obj_attr add_obj_list + + # If the count is greater than or equal to one insert the PASTE Object + # after the current object + set count [llength $add_obj_list] + set Rearrange_I [expr $count - 1] + set LastElement [lindex $add_obj_list $Rearrange_I] + address::SetMseqAttr $LastElement add_mseq_attr + address::DefaultMseqAttr $LastElement add_mseq_attr + + if { $obj_index == ""} \ + { + set obj_index 0 + } elseif { $count > 1} \ + { + incr obj_index + set add_obj_list [lreplace $add_obj_list $Rearrange_I $Rearrange_I] + set add_obj_list [linsert $add_obj_list $obj_index $LastElement] + } +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_block.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_block.tcl new file mode 100644 index 0000000..7963912 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_block.tcl @@ -0,0 +1,800 @@ +############################################################################## +# Description # +# This is contains all the functions dealing with the BLOBK object. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 07-Apr-1999 mnb Removed puts # +# 05-May-1999 mnb Added a procedure, which returns block code for the # +# Definition file. # +# 02-Jun-1999 mnb Code Integration # +# 21-Jun-1999 mnb Added code to handle composite blocks # +# 23-Jun-1999 mnb Better parser # +# 02-Jul-1999 mnb Changed the listing file block name to comment_data # +# 07-Sep-1999 mnb Fixed MDFT & Post Builder Integration problems # +# 21-Sep-1999 mnb Added force output, as an attribute of block element # +# 13-Oct-1999 mnb Added a proceduer to retrun the block elements # +# modality. # +# # +# $HISTORY$ # +# # +############################################################################## + +#======================================================================= +proc PB_blk_BlkInitParse {this OBJ_LIST ADDOBJ_LIST POST_OBJ} { +#======================================================================= + upvar $OBJ_LIST obj_list + upvar $ADDOBJ_LIST addobj_list + upvar $POST_OBJ post_obj + set add_start 0 + set add_count 0 + set blk_elem_obj_list "" + + array set block_temp_arr $ParseFile::($this,block_temp_list) + array set arr_size $ParseFile::($this,arr_size_list) + set comp_blk_list $Post::($post_obj,comp_blk_list) + set file_name_list $ParseFile::($this,file_list) + + foreach f_name $file_name_list \ + { + set no_of_blocks $arr_size($f_name,block) + for {set count 0} {$count < $no_of_blocks} {incr count} \ + { + set blk_start 0 + set open_flag 0 + set close_flag 0 + foreach line $block_temp_arr($f_name,$count,data) \ + { + if {[string match "*BLOCK_TEMPLATE*" $line]} \ + { + set temp_line $line + PB_com_RemoveBlanks temp_line + + # Composite blocks are eliminated + set comp_flag [lsearch $comp_blk_list [lindex $temp_line 1]] + if {$comp_flag != -1} { break } + + set blk_start 1 + set blk_obj_attr(0) [lindex $temp_line 1] + } + + if {$blk_start} \ + { + if {$open_flag == 0} \ + { + PB_mthd_CheckOpenBracesInLine line open_flag + } + + if {$close_flag == 0} \ + { + PB_mthd_CheckCloseBracesInLine line close_flag + } + + if {$open_flag} \ + { + PB_com_RemoveBlanks line + PB_blk_CheckJoinBrace_left line + PB_blk_CheckJoinBrace_right line + if {$line != ""} \ + { + PB_blk_CreateBlkElems line blk_elem_obj_list blk_obj_attr \ + addobj_list + } + } + + if {$close_flag} \ + { + PB_blk_CreateBlock blk_obj_attr obj_list blk_elem_obj_list \ + post_obj + unset blk_elem_obj_list + set blk_start 0 + } + } + } + } + } +} + +#============================================================================= +proc PB_blk_CheckJoinBrace_left { LINE } { +#============================================================================= + upvar $LINE line + + set test [lsearch -exact $line "\{"] + if {$test == -1}\ + { + set case_id [lsearch -glob $line "*\{*"] + if {$case_id != -1} \ + { + set element [lindex $line $case_id] + set sub_case_id [string first "\{" $element] + set new_string [string range [expr $sub_case_id + 1] end] + set line [lreplace $line $case_id $case_id $new_string] + set line [lrange $line $case_id end] + } else \ + { + set line $line + } + } else\ + { + set line [lrange $line [expr $test + 1] end] + } +} + +#========================================================================== +proc PB_blk_CheckJoinBrace_right { LINE } { +#========================================================================== + upvar $LINE line + + set test [lsearch -exact $line "\}"] + + if {$test == -1}\ + { + set case_id [lsearch -glob $line "*\}*"] + if {$case_id != -1} \ + { + set element [lindex $line $case_id] + set sub_case_id [string first "\{" $element] + set new_string [string range 0 [expr $sub_case_id - 1]] + set line [lreplace $line $case_id $case_id $new_string] + set line [lrange $line $case_id end] + } else \ + { + set line $line + } + } else\ + { + set line [lrange $line 0 [expr $test - 1]] + } +} + +proc PB_blk_CreateBlkElems { LINE BLK_ELEM_OBJ_LIST BLK_OBJ_ATTR ADDOBJ_LIST} { + upvar $LINE line + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + upvar $BLK_OBJ_ATTR blk_obj_attr + upvar $ADDOBJ_LIST addobj_list + + set nofelements [llength $line] + + for {set ne 0} {$ne < $nofelements} {incr ne}\ + { + set split_var [lindex $line $ne] + PB_blk_SplitBlkTmplElem split_var blk_elem_obj_list \ + blk_obj_attr addobj_list + } +} + + +proc PB_blk_SplitBlkTmplElem {SplitVar BLK_ELEM_OBJ_LIST BLK_OBJ_ATTR \ + ADDOBJ_LIST} { + upvar $SplitVar split_var + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + upvar $BLK_OBJ_ATTR blk_obj_attr + upvar $ADDOBJ_LIST addobj_list + + PB_blk_BlkOptNowsCheck split_var blk_elem_obj_attr + + set trim_char [string first "\[" $split_var] + set trim_char1 [string first "\]" $split_var] + if {$trim_char != -1}\ + { + set text_flag 0 + set blk_elem_obj_attr(0) [string range $split_var 0 [expr $trim_char - 1]] + set blk_elem_obj_attr(1) [string range $split_var [expr $trim_char + 1] \ + [expr $trim_char1 - 1]] + } else\ + { + set blk_elem_obj_attr(0) "Text" + set split_var [string trimright $split_var \}] + set split_var [string trimright $split_var \"] + set split_var [string trimleft $split_var \"] + set blk_elem_obj_attr(1) $split_var + } + + PB_blk_BlkElemForceOpt blk_obj_attr(0) blk_elem_obj_attr + + switch $blk_elem_obj_attr(0)\ + { + LF_ENUM - LF_XABS - + LF_YABS - LF_ZABS - + LF_AAXIS - LF_BAXIS - + LF_FEED - + LF_SPEED { + PB_blk_RetLfileAddObjFromList blk_elem_obj_attr + } + default { + PB_com_RetObjFrmName blk_elem_obj_attr(0) addobj_list \ + ret_code + set blk_elem_obj_attr(0) $ret_code + + set addr_name $address::($blk_elem_obj_attr(0),add_name) + PB_blk_RetWordDescArr addr_name elem_word_desc \ + blk_elem_obj_attr(1) + set blk_elem_obj_attr(3) $elem_word_desc + } + } + + PB_blk_CreateBlkElemObj blk_elem_obj_attr new_elem_obj blk_obj_attr + lappend blk_elem_obj_list $new_elem_obj +} + +proc PB_blk_RetLfileAddObjFromList {BLK_ELEM_OBJ_ATTR} { + upvar $BLK_ELEM_OBJ_ATTR blk_elem_obj_attr + + global post_object + + set list_file_obj $Post::($post_object,list_obj_list) + set lfile_addobj_list $ListingFile::($list_file_obj,add_obj_list) + PB_com_RetObjFrmName blk_elem_obj_attr(0) lfile_addobj_list ret_code + set blk_elem_obj_attr(0) $ret_code + set blk_elem_obj_attr(2) "" + set blk_elem_obj_attr(3) "" + set blk_elem_obj_attr(4) 0 +} + +proc PB_blk_BlkElemForceOpt { BLOCK_NAME BLK_ELEM_OBJ_ATTR } { + upvar $BLOCK_NAME block_name + upvar $BLK_ELEM_OBJ_ATTR blk_elem_obj_attr + global post_object + + array set blk_mod_arr $Post::($post_object,blk_mod_list) + if { [info exists blk_mod_arr($block_name)] } \ + { + set mod_add_list $blk_mod_arr($block_name) + if { [lsearch $mod_add_list $blk_elem_obj_attr(0)] != -1} \ + { + set blk_elem_obj_attr(4) 1 + } else \ + { + set blk_elem_obj_attr(4) 0 + } + } else \ + { + set blk_elem_obj_attr(4) 0 + } +} + +proc PB_blk_BlkOptNowsCheck {SPLIT_VAR BLK_ELEM_OBJ_ATTR} { + upvar $SPLIT_VAR split_var + upvar $BLK_ELEM_OBJ_ATTR blk_elem_obj_attr + + if {([string first "]\\opt" $split_var] != -1) || \ + ([string first "]\\nows" $split_var] != -1)}\ + { + if {[string first "]\\opt" $split_var] != -1}\ + { + if {[regexp "nows" $split_var]}\ + { + set blk_elem_obj_attr(2) "both" + } else\ + { + set blk_elem_obj_attr(2) "opt" + } + } else\ + { + if {[string first "\\opt" $split_var] != -1}\ + { + set blk_elem_obj_attr(2) "both" + } else\ + { + set blk_elem_obj_attr(2) "nows" + } + } + } else\ + { + set blk_elem_obj_attr(2) "blank" + } +} + +proc PB_blk_CreateBlkElemObj {BLK_ELEM_OBJ_ATTR NEW_ELEM_OBJ BLK_OBJ_ATTR} { + upvar $BLK_ELEM_OBJ_ATTR blk_elem_obj_attr + upvar $NEW_ELEM_OBJ new_elem_obj + upvar $BLK_OBJ_ATTR blk_obj_attr + + set new_elem_obj [new block_element $blk_obj_attr(0)] + block_element::setvalue $new_elem_obj blk_elem_obj_attr + block_element::DefaultValue $new_elem_obj blk_elem_obj_attr +# puts "The Block Element is Created: $new_elem_obj " + + set add_obj $blk_elem_obj_attr(0) + address::AddToBlkElemList $add_obj new_elem_obj +} + +proc PB_blk_CreateBlock {BLK_OBJ_ATTR BLK_OBJ_LIST BLK_ELEM_OBJ_LIST \ + POST_OBJ} { + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + upvar $BLK_OBJ_ATTR blk_obj_attr + upvar $BLK_OBJ_LIST blk_obj_list + upvar $POST_OBJ post_obj + + set blk_obj_attr(1) [llength $blk_elem_obj_list] + set blk_obj_attr(2) $blk_elem_obj_list + if {[string compare $blk_obj_attr(0) "comment_data"] != 0}\ + { + PB_blk_CreateBlkObj blk_obj_attr object + lappend blk_obj_list $object +# puts "The BLOCK OBJECT IS CREATED : $object" + } else\ + { + PB_blk_CreateBlkObj blk_obj_attr object + PB_lfl_AttrFromDef object post_obj + } +} + +proc PB_blk_CreateBlkObj { BLK_OBJ_ATTR BLK_OBJ } { + upvar $BLK_OBJ_ATTR blk_obj_attr + upvar $BLK_OBJ blk_obj + + set blk_obj [new block] + block::setvalue $blk_obj blk_obj_attr + block::DefaultValue $blk_obj blk_obj_attr +} + +proc PB_blk_RetDisVars {OBJ_LIST NAME_LIST WORD_DESC_ARRAY POST_OBJ} { + upvar $OBJ_LIST obj_list + upvar $NAME_LIST name_list + upvar $WORD_DESC_ARRAY word_desc_array + upvar $POST_OBJ post_obj + + set ind 0 + + foreach object $obj_list\ + { + set name_list($ind) $block::($object,block_name) + incr ind + } + + set word_desc_temp_list $Post::($post_obj,word_desc_array) + array set word_desc_array $word_desc_temp_list +} + +proc PB_blk_AddNewBlkElem {BASE_ELEMENT INDEX WORD_MOM_VAR} { + upvar $BASE_ELEMENT base_element + upvar $INDEX index + upvar $WORD_MOM_VAR word_mom_var + + global post_object + + array set word_mom_var_list $Post::($post_object,word_mom_var) + + set word_mom_var [lindex $word_mom_var_list($base_element) $index] +} + +proc PB_blk_BlkGetNewElemObjAttr { BLK_ELEM_ADR_NAME BLK_ELEM_MOM_VAR\ + BLK_ELEM_OBJ_ATTR } { + upvar $BLK_ELEM_ADR_NAME blk_elem_adr_name + upvar $BLK_ELEM_MOM_VAR blk_elem_mom_var + upvar $BLK_ELEM_OBJ_ATTR blk_elem_obj_attr + + global post_object + set add_obj_list $Post::($post_object,add_obj_list) + + PB_com_RetObjFrmName blk_elem_adr_name add_obj_list blk_elem_add_obj + PB_blk_RetWordDescArr blk_elem_adr_name elem_word_desc blk_elem_mom_var + + set blk_elem_obj_attr(0) $blk_elem_add_obj + set blk_elem_obj_attr(1) $blk_elem_mom_var + set blk_elem_obj_attr(2) "blank" + set blk_elem_obj_attr(3) $elem_word_desc + set blk_elem_obj_attr(4) 0 +} + +proc PB_blk_AddNewBlkElemObj { BLK_ELEM_ADR_NAME BLK_ELEM_MOM_VAR\ + BLK_OBJ_ATTR NEW_ELEM_OBJ } { + upvar $BLK_ELEM_ADR_NAME blk_elem_adr_name + upvar $BLK_ELEM_MOM_VAR blk_elem_mom_var + upvar $BLK_OBJ_ATTR blk_obj_attr + upvar $NEW_ELEM_OBJ new_elem_obj + + PB_blk_BlkGetNewElemObjAttr blk_elem_adr_name blk_elem_mom_var \ + blk_elem_obj_attr + PB_blk_CreateBlkElemObj blk_elem_obj_attr new_elem_obj blk_obj_attr +} + +proc PB_blk_BlkApplyObjAttr {BLK_OBJECT BLK_OBJ_ATTR_IMG BLK_OBJ_ATTR_TEXT \ + BLK_OBJ_ATTR_ADR BLK_OBJ_ATTR_OBJ BLK_OBJ_ATTR_OPT_IMG \ + WORD_NAME_LIST} { + upvar $BLK_OBJECT blk_object + upvar $BLK_OBJ_ATTR_IMG blk_obj_attr_img + upvar $BLK_OBJ_ATTR_TEXT blk_obj_attr_text + upvar $BLK_OBJ_ATTR_ADR blk_obj_attr_adr + upvar $BLK_OBJ_ATTR_OBJ blk_obj_attr_obj + upvar $BLK_OBJ_ATTR_OPT_IMG blk_obj_attr_opt_img + upvar $WORD_NAME_LIST word_name_list + + set no_of_elems [array size blk_obj_attr_obj] + for {set cnt 0} {$cnt < $no_of_elems} {incr cnt}\ + { + set blk_elem_img_name $blk_obj_attr_img($cnt) + set blk_elem_app_text $blk_obj_attr_text($cnt) + set blk_elem_adr_name $blk_obj_attr_adr($cnt) + + PB_blk_BlkGetNewElemObjAttr blk_elem_img_name blk_elem_app_text \ + blk_elem_adr_name blk_elem_obj_attr \ + blk_elem_obj_list + + set blk_elem_obj_attr(3) $blk_obj_attr_opt_img($cnt) + block_element::setvalue $blk_obj_attr_obj($cnt) blk_elem_obj_attr + } + + if {$no_of_elems > 0}\ + { + set block_obj_attr(0) $block::($blk_object,block_name) + set block_obj_attr(1) $no_of_elems + set block_obj_attr(2) $blk_elem_obj_list + set block_obj_attr(3) $word_name_list + block::setvalue $blk_object block_obj_attr + } +} + +proc PB_blk_RetValidCboxBlkElemAddr {ELEM_ADDRESS BASE_ELEMENT_LIST} { + upvar $ELEM_ADDRESS elem_address + upvar $BASE_ELEMENT_LIST base_element_list + + global post_object + set add_obj_list $Post::($post_object,add_obj_list) + + switch $elem_address\ + { + K_cycle - K { + set addr_name "K_cycle" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_kcy_name $address::($add_obj,add_leader) + set addr_name "K" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_k_name $address::($add_obj,add_leader) + if {![string compare $first_kcy_name $first_k_name]}\ + { + switch $elem_address\ + { + K_cycle {lappend base_element K} + K {lappend base_element K_cycle} + } + } + } + dwell - + cycle_dwell - + P_cutcom { + set addr_name "dwell" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_dw_name $address::($add_obj,add_leader) + set addr_name "cycle_dwell" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_cd_name $address::($add_obj,add_leader) + set addr_name "P_cutcom" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_pcc_name $address::($add_obj,add_leader) + if {![string compare $first_dw_name $first_cd_name]}\ + { + switch $elem_address\ + { + dwell {lappend base_element cycle_dwell} + cycle_dwell {lappend base_element dwell} + } + } + + if {![string compare $first_dw_name $first_pcc_name]}\ + { + switch $elem_address\ + { + dwell {lappend base_element P_cutcom} + P_cutcom {lappend base_element dwell} + } + } + + if {![string compare $first_cd_name $first_pcc_name]}\ + { + switch $elem_address\ + { + cycle_dwell {lappend base_element P_cutcom} + P_cutcom {lappend base_element cycle_dwell} + } + } + } + + cycle_step1 - I { + set addr_name "cycle_step1" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_ics_name $address::($add_obj,add_leader) + set addr_name "I" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_i_name $address::($add_obj,add_leader) + if {![string compare $first_ics_name $first_i_name]}\ + { + switch $elem_address\ + { + cycle_step1 {lappend base_element I} + I {lappend base_element cycle_step1} + } + } + } + cycle_step - + Q_cutcom { + set addr_name "cycle_step" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_q_name $address::($add_obj,add_leader) + set addr_name "Q_cutcom" + PB_com_RetObjFrmName addr_name add_obj_list add_obj + set first_qcc_name $address::($add_obj,add_leader) + if {![string compare $first_q_name $first_qcc_name]}\ + { + switch $elem_address\ + { + cycle_step {lappend base_element Q_cutcom} + Q_cutcom {lappend base_element cycle_step} + } + } + } + } + + lappend base_element $elem_address + + if {[info exists base_element]}\ + { + set base_element_list $base_element + unset base_element + } +} + +proc PB_blk_CreateComboBoxElems {BLK_ELEM_OBJ_LIST POST_OBJ ADD_NAMES} { + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + upvar $POST_OBJ post_obj + upvar $ADD_NAMES add_name_list + + set add_name_list $Post::($post_obj,word_name_list) + + foreach element $blk_elem_obj_list\ + { + set add_obj $block_element::($element,elem_add_obj) + set add_name $address::($add_obj,add_name) + PB_blk_RetValidCboxBlkElemAddr add_name base_element_list + + if {[info exists base_element_list]}\ + { + foreach element $base_element_list\ + { + set test_flag [lsearch $add_name_list $element] + set add_name_list [lreplace $add_name_list $test_flag $test_flag] + } + } else\ + { + set add_name $address::($add_obj,add_name) + set test_flag [lsearch $add_name_list $add_name] + if {$test_flag != -1}\ + { + set add_name_list [lreplace $add_name_list $test_flag $test_flag] + } + } + } +} + +proc PB_blk_BlkDisParams {BLK_OBJECT WORD_NAME_LIST BAL_WORD_DESC_ARR} { + upvar $BLK_OBJECT blk_object + upvar $WORD_NAME_LIST word_name_list + upvar $BAL_WORD_DESC_ARR bal_word_desc_arr + + set blk_elem_obj $block::($blk_object,elem_addr_list) + + set ind 0 + foreach object $blk_elem_obj\ + { + set blk_obj_attr_text($ind) $block_element::($object,elem_append_text) + set blk_obj_attr_mom($ind) $block_element::($object,elem_mom_variable) + set blk_elem_add_obj $block_element::($object,elem_add_obj) + set blk_obj_attr_adr($ind) $address::($blk_elem_add_obj,add_name) + incr ind + } + + PB_blk_RetWordDescArr blk_obj_attr_adr bal_word_desc_arr blk_obj_attr_mom + set word_name_list $block::($blk_object,addr_names) + PB_blk_SortComboBoxElems word_name_list +} + +proc PB_blk_BlkDefObjAttr {BLK_OBJECT BLK_OBJ_ATTR_IMG BLK_OBJ_ATTR_TEXT BLK_OBJ_ATTR_ADR \ + BLK_OBJ_ATTR_OPT_IMG BLK_ELEM_OBJ_ARRAY WORD_NAME_LIST BAL_WORD_DESC_ARR} { + upvar $BLK_OBJECT blk_object + upvar $BLK_OBJ_ATTR_IMG blk_obj_attr_img + upvar $BlK_OBJ_ATTR_TEXT blk_obj_attr_text + upvar $BLK_OBJ_ATTR_ADR blk_obj_attr_adr + upvar $BLK_OBJ_ATTR_OPT_IMG blk_obj_attr_opt_img + upvar $BLK_ELEM_OBJ_ARRAY blk_elem_obj_array + upvar $WORD_NAME_LIST word_name_list + upvar $BAL_WORD_DESC_ARR bal_word_desc_arr + + set ind 0 + set def_blk_attr_list $block::($blk_object,def_value) + array set def_blk_attr_arr $def_blk_attr_list + + if {[array exists blk_obj_attr_img] != 0}\ + { + unset blk_obj_attr_img + unset blk_obj_attr_text + unset blk_obj_attr_adr + unset blk_obj_attr_opt_img + unset blk_elem_obj_array + } + + foreach object $def_blk_attr_arr(2)\ + { + set def_value_list $block_element::($object,def_value) + array set def_value_array $def_value_list + set blk_obj_attr_img($ind) $def_value_array(0) + set blk_obj_attr_text($ind) $def_value_array(4) + set blk_obj_attr_mom($ind) $def_value_array(2) + set blk_elem_add_obj $def_value_array(1) + set blk_obj_attr_adr($ind) $address::($blk_elem_add_obj,add_name) + set blk_obj_attr_opt_img($ind) $def_value_array(3) + set blk_elem_obj_array($ind) $object + incr ind + } + + PB_blk_RetWordDescArr blk_obj_attr_adr bal_word_desc_arr blk_obj_attr_mom + set word_name_list $def_blk_attr_arr(3) + PB_blk_SortComboBoxElems word_name_list +} + +proc PB_blk_RetWordDescArr {BLK_ELEM_ADDR ELEM_WORD_DESC BLK_ELEM_MOM_VAR} { + upvar $BLK_ELEM_ADDR elem_word_add + upvar $ELEM_WORD_DESC elem_word_desc + upvar $BLK_ELEM_MOM_VAR blk_elem_mom_var + global post_object + + if { [string match user_* $elem_word_add]} \ + { + set elem_word_desc "User Defined Address" + return + } elseif { $blk_elem_mom_var == "" } \ + { + set elem_word_desc "User Defined Expression" + } + + set add_obj_list $Post::($post_object,add_obj_list) + array set word_desc_array $Post::($post_object,word_desc_array) + array set word_mom_var_arr $Post::($post_object,word_mom_var) + array set mom_sys_var_arr $Post::($post_object,mom_sys_var_list) + set word_mom_test [lsearch $word_mom_var_arr($elem_word_add) \ + $blk_elem_mom_var] + if {$word_mom_test != -1}\ + { + set elem_word_desc [lindex $word_desc_array($elem_word_add) \ + $word_mom_test] + } else\ + { + switch $elem_word_add\ + { + Text { + set elem_word_desc "Text String" + } + } + } +} + +proc PB_blk_SortComboBoxElems {WORD_NAME_LIST} { + upvar $WORD_NAME_LIST word_name_list + + set word_name_list [lsort $word_name_list] + set new_list "" + foreach word_name $word_name_list\ + { + if {[string match "G*" $word_name]} \ + { + lappend new_list $word_name + set word_name_list [lreplace $word_name_list \ + [lsearch $word_name_list $word_name] \ + [lsearch $word_name_list $word_name]] + } elseif {[string match "M*" $word_name]} \ + { + lappend new_list $word_name + set word_name_list [lreplace $word_name_list \ + [lsearch $word_name_list $word_name] \ + [lsearch $word_name_list $word_name]] + } + } + set word_name_list [join [lappend new_list $word_name_list]] +} + +proc PB_blk_GetBlockNames { BLK_OBJ_LIST BLK_NAME_LIST } { + upvar $BLK_OBJ_LIST blk_obj_list + upvar $BLK_NAME_LIST blk_name_list + + foreach blk_obj $blk_obj_list \ + { + lappend blk_name_list $block::($blk_obj,block_name) + } + + if { ![info exists blk_name_list] } \ + { + set blk_name_list "" + } +} + +proc PB_blk_CreateBlkFromBlkObj { BLK_OBJ_LIST ACT_BLK_OBJ OBJ_INDEX } { + upvar $BLK_OBJ_LIST blk_obj_list + upvar $ACT_BLK_OBJ act_blk_obj + upvar $OBJ_INDEX obj_index + + block::readvalue $act_blk_obj act_blk_obj_attr + PB_blk_GetBlockNames blk_obj_list blk_name_list + PB_com_SetDefaultName blk_name_list act_blk_obj_attr + + foreach act_blk_elem $act_blk_obj_attr(2) \ + { + block_element::readvalue $act_blk_elem act_blk_elem_attr + PB_blk_CreateBlkElemObj act_blk_elem_attr new_elem_obj \ + act_blk_obj_attr + lappend new_blk_elem_list $new_elem_obj + } + + if {[info exists new_blk_elem_list]} \ + { + set act_blk_obj_attr(2) $new_blk_elem_list + } + + PB_blk_CreateBlkObj act_blk_obj_attr new_blk_obj + set blk_obj_list [linsert $blk_obj_list $obj_index $new_blk_obj] +} + +#=========================================================================== +proc PB_blk_RetBlkFrmBlkAttr { BLK_OBJ_ATTR BLK_VALUE } { +#=========================================================================== + upvar $BLK_OBJ_ATTR blk_obj_attr + upvar $BLK_VALUE blk_value + + set blk_elem_obj_list $blk_obj_attr(2) + # Applys the master sequence to row block elements + UI_PB_com_ApplyMastSeqBlockElem blk_elem_obj_list + + set blk_value "" + foreach block_elem $blk_elem_obj_list\ + { + set add_obj $block_element::($block_elem,elem_add_obj) + set add_name $address::($add_obj,add_name) + set elem_mom_var $block_element::($block_elem,elem_mom_variable) + set elem_opt_var $block_element::($block_elem,elem_opt_nows_var) + + switch $elem_opt_var\ + { + blank { + append temp_cmp_var $add_name \[ $elem_mom_var \] + } + nows - + opt { + append temp_cmp_var $add_name \ + \[ $elem_mom_var \] \\ $elem_opt_var + } + both { + append temp_cmp_var $add_name \ + \[ $elem_mom_var \] \\opt\\nows + } + default { + append temp_cmp_var $add_name \ + \[ $elem_mom_var \] + } + } + lappend blk_value $temp_cmp_var + unset temp_cmp_var + } +} + +#=========================================================================== +proc PB_blk_BlockModality { BLK_OBJ MOD_ADD_LIST } { +#=========================================================================== + upvar $BLK_OBJ blk_obj + upvar $MOD_ADD_LIST mod_add_list + + set mod_add_list "" + block::readvalue $blk_obj blk_obj_attr + foreach blk_elem_obj $blk_obj_attr(2) \ + { + block_element::readvalue $blk_elem_obj blk_elem_obj_attr + if { $blk_elem_obj_attr(4) } \ + { + set add_name $address::($blk_elem_obj_attr(0),add_name) + lappend mod_add_list $add_name + } + unset blk_elem_obj_attr + } + unset blk_obj_attr +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_class.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_class.tcl new file mode 100644 index 0000000..e23eb17 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_class.tcl @@ -0,0 +1,1083 @@ +############################################################################## +# Description # +# This fiel contains all the functions dealing with FORMAT objects # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 03-May-1999 mnb Added event element class # +# 20-May-1999 mnb Added few new procedures to classes # +# 02-Jun-1999 mnb Code Integration # +# 11-Jun-1999 mnb Added new procedures to the class ParseFile # +# 14-Jun-1999 mnb Eliminated N from combobox list # +# 29-Jun-1999 mnb Added a new attribute for text element # +# 07-Sep-1999 mnb Added a new attribute to group_member .. to store # +# the data type of the widget # +# 21-Sep-1999 mnb Force Output is an attribute of block element object # +# 27-Sep-1999 mnb Stores definition & Tcl file names of a post as Post # +# object attributes # +# 13-Oct-1999 mnb Added new methods to Class Post, to store directory # +# and tcl,def & pui file names # +# # +# $HISTORY$ # +# # +############################################################################## + +class format { + proc format {this} { + set format::($this,for_name) "DEFAULT" + set format::($this,fmt_addr_list) "" + } + proc ~format {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set format::($this,for_name) $obj_attr(0) + set format::($this,for_dtype) $obj_attr(1) + set format::($this,for_leadplus) $obj_attr(2) + set format::($this,for_leadzero) $obj_attr(3) + set format::($this,for_trailzero) $obj_attr(4) + set format::($this,for_valfpart) $obj_attr(5) + set format::($this,for_outdecimal) $obj_attr(6) + set format::($this,for_valspart) $obj_attr(7) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $format::($this,for_name) + set obj_attr(1) $format::($this,for_dtype) + set obj_attr(2) $format::($this,for_leadplus) + set obj_attr(3) $format::($this,for_leadzero) + set obj_attr(4) $format::($this,for_trailzero) + set obj_attr(5) $format::($this,for_valfpart) + set obj_attr(6) $format::($this,for_outdecimal) + set obj_attr(7) $format::($this,for_valspart) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set format::($this,def_value) $def_value + } + + proc AddToAddressList {this ADDR_OBJ} { + upvar $ADDR_OBJ addr_obj + + lappend format::($this,fmt_addr_list) $addr_obj + } + + proc DeleteFromAddressList {this ADDR_OBJ} { + upvar $ADDR_OBJ addr_obj + + set index [lsearch $format::($this,fmt_addr_list) \ + $addr_obj] + if {$index != -1} \ + { + set format::($this,fmt_addr_list) \ + [lreplace $format::($this,fmt_addr_list) $index $index] + } + } +} + +class address { + proc address {this} { + set address::($this,add_name) "DEFAULT" + set address::($this,obj_attr_cnt) 12 + set address::($this,blk_elem_list) "" + } + + proc ~address {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set address::($this,add_name) $obj_attr(0) + set address::($this,add_format) $obj_attr(1) + set address::($this,add_force) $obj_attr(2) + set address::($this,add_force_status) $obj_attr(3) + set address::($this,add_max) $obj_attr(4) + set address::($this,add_max_status) $obj_attr(5) + set address::($this,add_min) $obj_attr(6) + set address::($this,add_min_status) $obj_attr(7) + set address::($this,add_leader) $obj_attr(8) + set address::($this,add_trailer) $obj_attr(9) + set address::($this,add_trailer_status) $obj_attr(10) + set address::($this,add_incremental) $obj_attr(11) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $address::($this,add_name) + set obj_attr(1) $address::($this,add_format) + set obj_attr(2) $address::($this,add_force) + set obj_attr(3) $address::($this,add_force_status) + set obj_attr(4) $address::($this,add_max) + set obj_attr(5) $address::($this,add_max_status) + set obj_attr(6) $address::($this,add_min) + set obj_attr(7) $address::($this,add_min_status) + set obj_attr(8) $address::($this,add_leader) + set obj_attr(9) $address::($this,add_trailer) + set obj_attr(10) $address::($this,add_trailer_status) + set obj_attr(11) $address::($this,add_incremental) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set address::($this,def_value) $def_value + } + + proc SetMseqAttr { this MSEQ_ATTR } { + upvar $MSEQ_ATTR mseq_attr + + set address::($this,rep_mom_var) $mseq_attr(0) + set address::($this,word_status) $mseq_attr(1) + set address::($this,word_desc) $mseq_attr(2) + set address::($this,seq_no) $mseq_attr(3) + } + + proc readMseqAttr { this MSEQ_ATTR } { + upvar $MSEQ_ATTR mseq_attr + + set mseq_attr(0) $address::($this,rep_mom_var) + set mseq_attr(1) $address::($this,word_status) + set mseq_attr(2) $address::($this,word_desc) + set mseq_attr(3) $address::($this,seq_no) + } + + proc DefaultMseqAttr {this MSEQ_ATTR} { + upvar $MSEQ_ATTR mseq_attr + + set def_value [array get mseq_attr] + set address::($this,def_mseq_attr) $def_value + } + + proc RestoreMseqAttr {this} { + + address::readMseqAttr $this mseq_attr + set rest_value [array get mseq_attr] + set address::($this,rest_mseq_attr) $rest_value + } + + proc AddToBlkElemList {this BLK_ELEM_OBJ} { + upvar $BLK_ELEM_OBJ blk_elem_obj + + lappend address::($this,blk_elem_list) $blk_elem_obj + } + + proc DeleteFromBlkElemList {this BLK_ELEM_OBJ} { + upvar $BLK_ELEM_OBJ blk_elem_obj + + set index [lsearch $address::($this,blk_elem_list) \ + $blk_elem_obj] + if {$index != -1} \ + { + set address::($this,blk_elem_list) \ + [lreplace $address::($this,blk_elem_list) $index $index] + } + } +} + +class Post { + proc Post {this post_name} { + set Post::($this,post_name) $post_name + } + + proc ~Post {this} {} + + proc SetPostFiles { this PUI_DIR POST_FILES } { + upvar $PUI_DIR pui_dir + upvar $POST_FILES post_files + + set Post::($this,pui_dir) $pui_dir + set Post::($this,def_file) $post_files(def_file) + set Post::($this,tcl_file) $post_files(tcl_file) + } + + proc ReadPostFiles { this PUI_DIR DEF_FILE TCL_FILE } { + upvar $PUI_DIR pui_dir + upvar $DEF_FILE def_file + upvar $TCL_FILE tcl_file + + set pui_dir $Post::($this,pui_dir) + set def_file $Post::($this,def_file) + set tcl_file $Post::($this,tcl_file) + } + + proc SetPostOutputFiles { this DIR PUI_FILE DEF_FILE TCL_FILE } { + upvar $DIR dir + upvar $PUI_FILE pui_file + upvar $DEF_FILE def_file + upvar $TCL_FILE tcl_file + + set Post::($this,output_dir) $dir + set Post::($this,out_pui_file) $pui_file + set Post::($this,out_def_file) $def_file + set Post::($this,out_tcl_file) $tcl_file + } + + proc ReadPostOutputFiles { this DIR PUI_FILE DEF_FILE TCL_FILE } { + upvar $DIR dir + upvar $PUI_FILE pui_file + upvar $DEF_FILE def_file + upvar $TCL_FILE tcl_file + + set dir $Post::($this,output_dir) + set pui_file $Post::($this,out_pui_file) + set def_file $Post::($this,out_def_file) + set tcl_file $Post::($this,out_tcl_file) + } + + proc InitG-Codes {this G_CODES G_CODES_DESC} { + upvar $G_CODES g_codes + upvar $G_CODES_DESC g_codes_desc + + + set temp_g_codes [array get g_codes] + set temp_g_codes_desc [array get g_codes_desc] + + set Post::($this,g_codes) $temp_g_codes + set Post::($this,g_codes_desc) $temp_g_codes_desc + } + + proc InitM-Codes {this M_CODES M_CODES_DESC} { + upvar $M_CODES m_codes + upvar $M_CODES_DESC m_codes_desc + + + set temp_m_codes [array get m_codes] + set temp_m_codes_desc [array get m_codes_desc] + + set Post::($this,m_codes) $temp_m_codes + set Post::($this,m_codes_desc) $temp_m_codes_desc + } + + proc InitMasterSequence { this MSQ_ADD_NAME MSQ_WORD_PARAM } { + upvar $MSQ_ADD_NAME msq_add_name + upvar $MSQ_WORD_PARAM msq_word_param + + set temp_msq_word_param [array get msq_word_param] + set Post::($this,msq_word_param) $temp_msq_word_param + set Post::($this,msq_add_name) $msq_add_name + } + + proc SetDefMasterSequence {this ADD_OBJ_LIST} { + upvar $ADD_OBJ_LIST add_obj_list + + set Post::($this,def_mast_seq) $add_obj_list + } + + proc MachineTool {this machine_tool} { + upvar $machine_tool mtool + set Post::($this,machine_tool) $mtool + } + + proc ListFileObject {this list_obj_list} { + upvar $list_obj_list obj_list + set Post::($this,list_obj_list) $obj_list + } + + proc SetObjListasAttr {this OBJ_LIST} { + upvar $OBJ_LIST obj_list + + set object [lindex $obj_list 0] + set ClassName [string trim [classof $object] ::] + switch $ClassName\ + { + format {set Post::($this,fmt_obj_list) $obj_list} + address {set Post::($this,add_obj_list) $obj_list} + block {set Post::($this,blk_obj_list) $obj_list} + } + } + + proc WordAddNamesSubNamesDesc {this} { + + set msq_add_name $Post::($this,msq_add_name) + set Post::($this,word_name_list) $msq_add_name + + PB_com_WordSubNamesDesc this word_subnames_desc_array word_mom_var \ + mom_sys_arr + + set word_subnames_desc_list [array get word_subnames_desc_array] + set word_mom_var_list [array get word_mom_var] + set mom_sys_var_list [array get mom_sys_arr] + set Post::($this,word_desc_array) $word_subnames_desc_list + set Post::($this,word_mom_var) $word_mom_var_list + set Post::($this,mom_sys_var_list) $mom_sys_var_list + } +} + +class block_element { + proc block_element {this block_name} { + set block_element::($this,parent_name) $block_name + set block_element::($this,owner) "NONE" + set block_element::($this,force) 0 + } + + proc ~block_element {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set block_element::($this,elem_add_obj) $obj_attr(0) + set block_element::($this,elem_mom_variable) $obj_attr(1) + set block_element::($this,elem_opt_nows_var) $obj_attr(2) + set block_element::($this,elem_desc) $obj_attr(3) + set block_element::($this,force) $obj_attr(4) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $block_element::($this,elem_add_obj) + set obj_attr(1) $block_element::($this,elem_mom_variable) + set obj_attr(2) $block_element::($this,elem_opt_nows_var) + set obj_attr(3) $block_element::($this,elem_desc) + set obj_attr(4) $block_element::($this,force) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set block_element::($this,def_value) $def_value + } + + proc RestoreValue {this} { + block_element::readvalue $this obj_attr + set block_element::($this,rest_value) [array get obj_attr] + } +} + +class block { + proc block {this} { + set block::($this,block_name) "DEFAULT" + set block::($this,blk_owner) "NONE" + set block::($this,evt_addr_list) "" + } + + proc ~block {this} { + set count [llength $block::($this,elem_addr_list)] + foreach element $block::($this,elem_addr_list)\ + { + delete $element + } + } + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set block::($this,block_name) $obj_attr(0) + set block::($this,block_nof_elements) $obj_attr(1) + set block::($this,elem_addr_list) $obj_attr(2) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $block::($this,block_name) + set obj_attr(1) $block::($this,block_nof_elements) + set obj_attr(2) $block::($this,elem_addr_list) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set block::($this,def_value) $def_value + } + + proc RestoreValue {this} { + + block::readvalue $this obj_attr + set block::($this,rest_value) [array get obj_attr] + } + + proc AddToEventList {this EVENT_OBJ} { + upvar $EVENT_OBJ event_obj + + lappend block::($this,evt_addr_list) $event_obj + } + + proc DeleteFromEventList {this EVENT_OBJ} { + upvar $EVENT_OBJ event_obj + + set index [lsearch $block::($this,evt_addr_list) \ + $event_obj] + if {$index != -1} \ + { + set block::($this,evt_addr_list) \ + [lreplace $block::($this,evt_addr_list) $index $index] + } + } +} + +class event_element { + proc event_element {this} { + set event_element($this,evt_elem_name) "DEFAULT" + } + + proc ~event_element {this} { } + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set event_element::($this,evt_elem_name) $obj_attr(0) + set event_element::($this,block_obj) $obj_attr(1) + set event_element::($this,type) $obj_attr(2) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $event_element::($this,evt_elem_name) + set obj_attr(1) $event_element::($this,block_obj) + set obj_attr(2) $event_element::($this,type) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set event_element::($this,def_value) $def_value + } + + proc RestoreValue {this} { + + event_element::readvalue $this obj_attr + set event_element::($this,rest_value) [array get obj_attr] + } +} + +class event { + proc event {this} { + set event::($this,event_name) "DEFAULT" + set event::($this,event_open) 0 + } + + proc ~event {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set event::($this,event_name) $obj_attr(0) + set event::($this,block_nof_rows) $obj_attr(1) + set event::($this,evt_elem_list) $obj_attr(2) + set event::($this,evt_itm_obj_list) $obj_attr(3) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + set obj_attr(0) $event::($this,event_name) + set obj_attr(1) $event::($this,block_nof_rows) + set obj_attr(2) $event::($this,evt_elem_list) + set obj_attr(3) $event::($this,evt_itm_obj_list) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + set def_value [array get obj_attr] + set event::($this,def_value) $def_value + } + + proc RestoreValue {this} { + event::readvalue $this obj_attr + set event::($this,rest_value) [array get obj_attr] + } +} + +class sequence { + proc sequence {this} { + set sequence::($this,seq_name) "DEFAULT" + } + + proc ~sequence {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set sequence::($this,seq_name) $obj_attr(0) + set sequence::($this,evt_obj_list) $obj_attr(1) + set sequence::($this,comb_elem_list) $obj_attr(2) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $sequence::($this,seq_name) + set obj_attr(1) $sequence::($this,evt_obj_list) + set obj_attr(2) $sequence::($this,comb_elem_list) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set sequence::($this,def_value) $def_value + } + + proc RestoreValue {this} { + sequence::readvalue $this obj_attr + set sequence::($this,rest_value) [array get obj_attr] + } +} + +class item { + proc item {this} { + set item::($this,item_name) "DEFAULT" + } + + proc ~item {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set item::($this,label) $obj_attr(0) + set item::($this,nof_grps) $obj_attr(1) + set item::($this,grp_align) $obj_attr(2) + set item::($this,grp_obj_list) $obj_attr(3) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $item::($this,label) + set obj_attr(1) $item::($this,nof_grps) + set obj_attr(2) $item::($this,grp_align) + set obj_attr(3) $item::($this,grp_obj_list) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set item::($this,def_value) $def_value + } + + proc RestoreValue {this} { + item::readvalue $this obj_attr + set item::($this,rest_value) [array get obj_attr] + } +} + +class item_group { + proc item_group {this} { + set item_group::($this,elem_name) "DEFAULT" + } + + proc ~item_group {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set item_group::($this,name) $obj_attr(0) + set item_group::($this,nof_elems) $obj_attr(1) + set item_group::($this,elem_align) $obj_attr(2) + set item_group::($this,mem_obj_list) $obj_attr(3) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $item_group::($this,name) + set obj_attr(1) $item_group::($this,nof_elems) + set obj_attr(2) $item_group::($this,elem_align) + set obj_attr(3) $item_group::($this,mem_obj_list) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set item_group::($this,def_value) $def_value + } + + proc RestoreValue {this} { + item_group::readvalue $this obj_attr + set item_group::($this,rest_value) [array get obj_attr] + } +} + +class group_member { + proc group_member {this} { + set group_member::($this,elem_name) "DEFAULT" + } + + proc ~group_member {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set group_member::($this,label) $obj_attr(0) + set group_member::($this,widget_type) $obj_attr(1) + set group_member::($this,data_type) $obj_attr(2) + set group_member::($this,mom_var) $obj_attr(3) + set group_member::($this,callback) $obj_attr(4) + set group_member::($this,opt_list) $obj_attr(5) + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set obj_attr(0) $group_member::($this,label) + set obj_attr(1) $group_member::($this,widget_type) + set obj_attr(2) $group_member::($this,data_type) + set obj_attr(3) $group_member::($this,mom_var) + set obj_attr(4) $group_member::($this,callback) + set obj_attr(5) $group_member::($this,opt_list) + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set group_member::($this,def_value) $def_value + } + + proc RestoreValue {this} { + group_member::readvalue $this obj_attr + set group_member::($this,rest_value) [array get obj_attr] + } +} + +class ListingFile { + + proc ListingFile {this} { + + set def_values {1 listfile.lpt 1 1 1 0 0 1 0 0 40 \ + 30 0 0 0 0 0 0 0} + set arr_names {listfile fname x y z 4axis 5axis feed \ + speed head lines column oper tool start_path \ + tool_chng end_path oper_time setup_time} + set ind 0 + foreach name $arr_names\ + { + set ListingFile::($this,$name) [lindex $def_values $ind] + incr ind + } + set ListingFile::($this,arr_names) $arr_names + } + + proc ~ListingFile {this} {} + + proc setvalue_from_pui {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set arr_names [array names obj_attr] + foreach name $arr_names\ + { + set ListingFile::($this,$name) $obj_attr($name) + } + } + + proc readvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set arr_names $ListingFile::($this,arr_names) + foreach name $arr_names\ + { + set obj_attr($name) $ListingFile::($this,$name) + } + } + + #Setting the address objects list as listing file attribute + proc SetLfileAddObjList {post_obj LF_ADD_OBJ_LIST} { + upvar $LF_ADD_OBJ_LIST lf_add_obj_list + + set lfile_obj $Post::($post_obj,list_obj_list) + set ListingFile::($lfile_obj,add_obj_list) $lf_add_obj_list + } + + # Sets the listing block + proc SetLfileBlockObj { lfile_obj LF_BLK_OBJ } { + upvar $LF_BLK_OBJ lf_blk_obj + + set ListingFile::($lfile_obj,block_obj) $lf_blk_obj + } + + proc DefaultValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set def_value [array get obj_attr] + set ListingFile::($this,def_value) $def_value + set ListingFile::($this,restore_value) $def_value + } + + proc RestoreValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set restore_value [array get obj_attr] + set ListingFile::($this,restore_value) $restore_value + } +} + +class MachineToolElement { + + proc MachineToolElement {this} {} + + proc ~MachineToolElement {this} {} + + proc GeneralParameters {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set arr_names [array names obj_attr] + foreach name $arr_names\ + { + set MachineToolElement::($this,$name) $obj_attr($name) + } + } + + proc 4AxisParameters {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + set arr_names [array names obj_attr] + foreach name $arr_names\ + { + set MachineToolElement::($this,$name\_4) $obj_attr($name) + } + } + + proc 5AxisParameters {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + set arr_names [array names obj_attr] + foreach name $arr_names\ + { + set MachineToolElement::($this,$name\_5) $obj_attr($name) + } + } + + proc DefaultValue {this OBJ_ATTR IDENTIFIER} { + upvar $OBJ_ATTR obj_attr + upvar $IDENTIFIER identifier + + switch $identifier\ + { + 3-Axis { + set def_value [array get obj_attr] + set MachineToolElement::($this,3axis_def_value) \ + $def_value + } + 4-Axis { + set def_value [array get obj_attr] + set MachineToolElement::($this,4axis_def_value) \ + $def_value + } + 5-Axis { + set def_value [array get obj_attr] + set MachineToolElement::($this,5axis_def_value) \ + $def_value + } + } + } +} + +class param { + + proc param {this} { + set param::($this,param_name) "DEFAULT" + } + + proc ~param {this} {} + + proc CreateObject {TYPE} { + upvar $TYPE type + + switch $type\ + { + i { + set object [new integer] + } + d { + set object [new double] + } + o { + set object [new option] + } + b { + set object [new boolean] + } + s { + set object [new string] + } + p { + set object [new point] + } + } + + return $object + } + + proc ObjectSetValue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set ClassName [string trim [classof $this] ::] + switch $ClassName\ + { + param::integer { + param::integer::setvalue $this obj_attr + } + param::double { + param::double::setvalue $this obj_attr + } + param::option { + param::option::setvalue $this obj_attr + } + param::boolean { + param::boolean::setvalue $this obj_attr + } + param::string { + param::string::setvalue $this obj_attr + } + param::point { + param::point::setvalue $this obj_attr + } + } + } + + class integer { + proc integer {this} { + set param::integer::($this,name) "INTEGER" + } + proc ~integer {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set param::integer::($this,name) $obj_attr(0) + set param::integer::($this,type) $obj_attr(1) + set param::integer::($this,def_value) $obj_attr(2) + set param::integer::($this,toggle) $obj_attr(3) + set param::integer::($this,ui_label) $obj_attr(4) + } + } + + class double { + proc double {this} { + set param::double::($this,name) "DOUBLE" + } + + proc ~double {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set param::double::($this,name) $obj_attr(0) + set param::double::($this,type) $obj_attr(1) + set param::double::($this,def_value) $obj_attr(2) + set param::double::($this,toggle) $obj_attr(3) + set param::double::($this,ui_label) $obj_attr(4) + } + } + + class option { + proc option {this} { + set param::option::($this,name) "OPTION" + } + + proc ~option {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set param::option::($this,name) $obj_attr(0) + set param::option::($this,type) $obj_attr(1) + set param::option::($this,def_value) $obj_attr(2) + set param::option::($this,options) $obj_attr(3) + set param::option::($this,ui_label) $obj_attr(4) + } + } + + class boolean { + proc boolean {this} { + set param::boolean::($this,name) "BOOLEAN" + } + + proc ~boolean {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set param::boolean::($this,name) $obj_attr(0) + set param::boolean::($this,type) $obj_attr(1) + set param::boolean::($this,def_value) $obj_attr(2) + set param::boolean::($this,ui_label) $obj_attr(3) + } + } + + class string { + proc string {this} { + set param::string::($this,name) "STRING" + } + + proc ~string {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set param::string::($this,name) $obj_attr(0) + set param::string::($this,type) $obj_attr(1) + set param::string::($this,toggle) $obj_attr(2) + set param::string::($this,ui_label) $obj_attr(3) + } + } + + class point { + proc point {this} { + set param::point::($this,name) "STRING" + } + + proc ~point {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set param::point::($this,name) $obj_attr(0) + set param::point::($this,type) $obj_attr(1) + set param::point::($this,ui_label) $obj_attr(2) + } + } +} + +class ude_event { + proc ude_event {this} { + set ude_event::($this,name) "DEFAULT" + } + + proc ~ude_event {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set ude_event::($this,name) $obj_attr(0) + set ude_event::($this,post_event) $obj_attr(1) + set ude_event::($this,ui_label) $obj_attr(2) + set ude_event::($this,category) $obj_attr(3) + set ude_event::($this,param_obj_list) $obj_attr(4) + } +} + +class ude { + proc ude {this} { + set ude::($this,name) "DEFAULT" + } + + proc ~ude {this} {} + + proc setvalue {this OBJ_ATTR} { + upvar $OBJ_ATTR obj_attr + + set ude::($this,name) $obj_attr(0) + set ude::($this,event_obj_list) $obj_attr(1) + } +} + +class File { + + proc File {this FPointer} { + set File::($this,FilePointer) $FPointer + } + + proc ~File {this} {} + + proc OpenFileRead {this FName} { + set File::($this,FileName) $FName + set FPointer $File::($this,FilePointer) + + if [catch {open $FName r} $FPointer]\ + { + puts stdout "Can't Open File $FName for Reading" + exit + } + set evalvar "set evelinvar $$FPointer" + set FpointerAddress [eval $evalvar] + set File::($this,FilePointer) $FpointerAddress + } + + proc OpenFileWrite {this FName} { + set File::($this,FileName) $FName + set FPointer $File::($this,FilePointer) + + if [catch {open $FName w} $FPointer]\ + { + puts stdout "Can't Open File $FName for Reading" + exit + } + set evalvar "set evelinvar $$FPointer" + set FpointerAddress [eval $evalvar] + set File::($this,FilePointer) $FpointerAddress + } + + proc ResetFilePointer {this} { + seek $File::($this,FilePointer) 0 + } + + proc CloseFile {this} { + close $File::($this,FilePointer) + } +} + +class ParseFile { + + proc ParseFile {this FPointer} File {$FPointer} {} + proc ~ParseFile {this} {} + + proc ParseDefFile {this file_name} { + + PB_mthd_DefFileInitParse $this $file_name + } + + proc ParseWordSep {this} { + + PB_mach_GetWordSep $this + } + + proc ParseEndOfLine {this} { + + PB_mach_GetEndOfLine $this + } + + proc ParseSequence {this} { + + PB_mach_GetSequenceParams $this + } + + proc ParseFormat {this OBJ_LIST} { + upvar $OBJ_LIST obj_list + + PB_fmt_FmtInitParse $this obj_list + } + + proc ParseAddress {this OBJ_LIST LF_OBJ_LIST FOBJ_LIST} { + upvar $OBJ_LIST obj_list + upvar $FOBJ_LIST fobj_list + upvar $LF_OBJ_LIST lf_obj_list + + PB_adr_AdrInitParse $this obj_list fobj_list + PB_adr_SepBlkAndLFileAddLists obj_list lf_obj_list + PB_adr_CreateTextAddObj obj_list fobj_list + } + + proc ParseBlockTemp {this OBJ_LIST ADDOBJ_LIST POST_OBJ} { + upvar $OBJ_LIST obj_list + upvar $ADDOBJ_LIST addobj_list + upvar $POST_OBJ post_obj + + PB_blk_BlkInitParse $this obj_list addobj_list post_obj + } + + proc ParsePuiFile {this POST_OBJ} { + upvar $POST_OBJ post_obj + PB_pui_ReadPuiCreateObjs this post_obj + } + + proc ParseUdeFile {this POST_OBJ} { + upvar $POST_OBJ post_obj + PB_ude_UdeInitParse $this post_obj + } +} + diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_common.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_common.tcl new file mode 100644 index 0000000..6055f03 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_common.tcl @@ -0,0 +1,492 @@ +############################################################################## +# Description # +# This file contains all the common functions dealing with the POST # +# BUILDER Objects. This file contains some main functions which define data # +# for the new BLOCK ELEMENT Object. All the baloon description for block # +# elements are also done within that function. There are procedures that # +# deal with the POST Object also in this file. # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 05-May-1999 mnb Removed redundant procedures # +# 02-Jun-1999 mnb Code Integration # +# 10-Jun-1999 mnb Added procedures to parse Word Seperator, End of Line # +# and Sequence Number statements of Definition file # +# 07-Sep-1999 mnb Modified MapMOMVariable proceduer to handle expressions# +# 21-Sep-1999 mnb Removed Duplicate proceduers # +# 13-Oct-1999 mnb Gets the machin type & axisoptiosn from the kinematci # +# variable mom_kin_machine_type # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +#This procedure takes the name list and the object attribute as the input +#and sets a name defalut name for the new object to be created. It will cycle +#through the name list and the valid name with "_number" will be set, where +#number is the incremental index number. Eg:"_1", "_2", "_3" etc. +#============================================================================= + +proc PB_com_SetDefaultName {NAME_LIST OBJ_ATTR} { + upvar $NAME_LIST name_list + upvar $OBJ_ATTR obj_attr + + #Sets the count, and initializez the index and flags. + set count [llength $name_list] + set dindex 1 + set dflag 0 + set match_flag 0 + set obj_name $obj_attr(0) + + #If name list count is zero set the name as DEFAULT else add the index. + if { $count == 0}\ + { + set obj_attr(0) DEFAULT + } else\ + { + # Procedure call for finding out the correct index. + set dindex 0 + PB_com_ValidateName name_list obj_attr(0) dindex + if {$dindex} \ + { + append name $obj_attr(0) _ $dindex + set obj_attr(0) $name + unset name + } + } +# puts "After Processing the valus is : $obj_attr(0)" +} + + +#============================================================================= +#This is a recursive function which finds the correct index to be appended to +#to the DEFAULT string. This procedure takes the name list and the default +#name as the input and sets the default name to the correct value. +#============================================================================= + +proc PB_com_ValidateName {NAME_LIST DEF_NAME DINDEX} { + upvar $NAME_LIST name_list + upvar $DEF_NAME def_name + upvar $DINDEX inx + + #Sets the count from the name list. + set count [llength $name_list] + + #Checks the index of name in the list and if it matches the index in the + #name list, the index is incremented else the first index value is set. + #Eg: if DEFAULT_3 is there in the name list, and DEFAULT_1 and DEFAULT_2 + #doesn't exist then DEFAULT_1 will be set for the new object. + if {$inx} \ + { + append act_name $def_name _ $inx + } else \ + { + set act_name $def_name + } + + for {set i 0} {$i < $count} {incr i}\ + { + set fmt_name [lindex $name_list $i] + if { [string compare $act_name $fmt_name] == 0}\ + { + incr inx + PB_com_ValidateName name_list def_name inx + } else\ + { + continue + } + } +} + +#============================================================================= +#This procedure takes the line as the input and removes the blanks from the +#line and the line without blanks are output. +#============================================================================= + +proc PB_com_RemoveBlanks {line} { + upvar $line line_wob + + #Splits the line and sets the index of the first blank. + set line_wob [split $line_wob] + set blank_index [lsearch $line_wob \0] + + #Cycles through the list abd removes the blank. + while { $blank_index >= 0}\ + { + set line_wob [lreplace $line_wob $blank_index $blank_index] + set blank_index [lsearch $line_wob \0] + } +} + +#============================================================================= +#This procedure takes the block naem with underscores as input, removes the +#underscores and converts the first letter of each word to upper case. +#eg: "example_template_name will get converted to "Example Template Name". +#============================================================================= + +proc PB_com_GetModEvtBlkName {INP_NAME} { + upvar $INP_NAME inp_name + + set temp_name [split $inp_name ""] + set first_chr [string toupper [lindex $temp_name 0]] + set temp_name [lreplace $temp_name 0 0 $first_chr] + set und_sc_ind [lsearch $temp_name "_"] + + while { $und_sc_ind >= 0}\ + { + set temp_name [lreplace $temp_name $und_sc_ind $und_sc_ind " "] + set next_chr [string toupper [lindex $temp_name [expr $und_sc_ind + 1]]] + set temp_name [lreplace $temp_name [expr $und_sc_ind + 1] \ + [expr $und_sc_ind + 1] $next_chr] + set und_sc_ind [lsearch $temp_name "_"] + } + + set inp_name [join $temp_name ""] +} + +#============================================================================= +#This is a common function which takes the object name, object list as input +#and outputs the object id for the object name. This functiion works for +#object types format, address, block, event and sequence. +#============================================================================= + +proc PB_com_RetObjFrmName {OBJ_NAME OBJ_LIST RET_CODE} { +upvar $OBJ_NAME obj_name +upvar $OBJ_LIST obj_list +upvar $RET_CODE ret_code + + #If object list exists get the object id for the object name. + if {[info exists obj_list] != 0}\ + { + #Cycles through the object list. + foreach object $obj_list\ + { + #Sets the class name. + set ClassName [string trim [classof $object] ::] + + #Depending on th eclass name the object names are found. + switch $ClassName\ + { + format {set CheckName $format::($object,for_name)} + address {set CheckName $address::($object,add_name)} + block {set CheckName $block::($object,block_name)} + event {set CheckName $event::($object,event_name)} + sequence {set CheckName $sequence::($object,seq_name)} + } + + #If object is found the id is returned else error code (0) is returned. + if { [string compare $obj_name $CheckName] == 0 }\ + { + set ret_code $object + break + } else\ + { + set ret_code 0 + } + } + } +} + +#======================================================================= +proc PB_com_WordSubNamesDesc {POST_OBJECT WORD_SUBNAMES_DESC_ARRAY \ + WORD_MOM_VAR MOM_SYS_ARR} { +#======================================================================= + upvar $POST_OBJECT post_object + upvar $WORD_SUBNAMES_DESC_ARRAY word_subnames_desc_array + upvar $WORD_MOM_VAR word_mom_var + upvar $MOM_SYS_ARR mom_sys_arr + + array set add_name_arr $Post::($post_object,add_name_list) + array set add_mom_var_arr $Post::($post_object,add_mom_var_list) + + set no_adds [array size add_name_arr] + + for {set count 0} {$count < $no_adds} {incr count} \ + { + set add_name $add_name_arr($count) + foreach line $add_mom_var_arr($count) \ + { + set mom_sys_arr([lindex $line 0]) [lindex $line 1] + lappend word_mom_var($add_name) [lindex $line 0] + lappend word_subnames_desc_array($add_name) [lindex $line 2] + } + } +} + +#============================================================================= +#This procedure sets the appended text for the addresses having multi +#character leaders. If the addresses have multi characeter leaders, then the +#image name will be blank and the leader plus the appended text together will +#be the appended text. Here the leaders are seperated from the appended text +#and made as the actual appended text for list searching. +#============================================================================= + +proc PB_com_GetAppTxtForMultiCharLdrs {APP_TEXT ADD_NAME ACT_APP_TEXT} { + upvar $APP_TEXT app_text + upvar $ADD_NAME add_name + upvar $ACT_APP_TEXT act_app_text + + global post_object + + #Sets the appended text and the address object list. + set act_app_text $app_text + set add_obj_list $Post::($post_object,add_obj_list) + + #Returns address object from address name. + PB_com_RetObjFrmName add_name add_obj_list ret_code + + #If a valid id is returned, remove leader from the appended text. + if {$ret_code != 0}\ + { + set add_leader $address::($ret_code,add_leader) + set add_srch [string first $add_leader $app_text] + if {$add_srch != -1}\ + { + set str_len [string length $add_leader] + set act_app_text [string range $app_text $str_len end] + } + } +} + +#============================================================================= +#This procedure sets the image name and appended text for image names that +#doesn't belong from A-Z. For these cases the image names is set as blank and +#the image name and appended text are appended as the actual appended text. +#============================================================================= + +proc PB_com_ValidateImgName {WORD_IMG_NAME WORD_APP_TEXT} { + upvar $WORD_IMG_NAME word_img_name + upvar $WORD_APP_TEXT word_app_text + + #Checks the image name and sets the image name and appended text if it is + #not from A-Z. + switch $word_img_name\ + { + A - B - C - D - E - + F - G - H - I - J - + K - L - M - N - O - + P - Q - R - S - T - + U - V - W - X - Y - + Z {} + default { + #Appends the image name and appended text. + append temp_app_text $word_img_name $word_app_text + + #Sets the appended text and image name. + set word_app_text $temp_app_text + set word_img_name blank + + #Unsets the appended text. + unset temp_app_text + } + } +} + +#============================================================================= +#This procedure takes the PUI file name and PUI file id as input and creates +# post object, parses the pui file and stores all the attributes in the +#post object. +#============================================================================= + +proc PB_com_ReadPuiFile {PuiFileName PuiFileID POST_OBJ} { + upvar $PuiFileName FileName + upvar $PuiFileID FileId + upvar $POST_OBJ post_obj + + #Creates the post object + set post_obj [new Post $FileName] + + #Creates the PUI File Object. + set pui_file_obj [new ParseFile $FileId] + + #Invokes procedure for opening a file. + File::OpenFileRead $pui_file_obj $FileName + + #Parses the PUI File. + ParseFile::ParsePuiFile $pui_file_obj post_obj +} + +#============================================================================= +#This procedure takes the cdl file name, cdl file id and the post object as +#the input and parses the ude file, stores all the attributes in the objects +#and finally the ude object is stored in the post object. +#============================================================================= + +proc PB_com_ReadUdeFile {CDL_FILE_NAME CDL_FILE_ID POST_OBJ} { + upvar $CDL_FILE_NAME cdl_file_name + upvar $CDL_FILE_ID cdl_file_id + upvar $POST_OBJ post_obj + + #Creates the UDE File Object. + set ude_file_obj [new ParseFile $cdl_file_id] + + #Invokes procedure for opening a file. + File::OpenFileRead $ude_file_obj $cdl_file_name + + #Parses the UDE File. + ParseFile::ParseUdeFile $ude_file_obj post_obj +} + +#============================================================================= +#This procedure takes the definition file name, definition file id and the +#post object as the input, parses the definition file, creates the format, +#address and block objects and stores all th eobject list as post object +#attributes. +#============================================================================= + +proc PB_com_ReadDfltDefFile {DefFileName FILEID POST_OBJ} { + upvar $DefFileName FileName + upvar $FILEID FileId + upvar $POST_OBJ post_obj + + global ListObjectList + global ListObjectAttr + + set FObjIndex 0 + set AObjIndex 0 + set BObjIndex 0 + + # Creates the definition file object. + set pobj [new ParseFile $FileId] + set Post::($post_obj,def_parse_obj) $pobj + + # Parses the Definition file + ParseFile::ParseDefFile $pobj $FileName + + # Parses the Word Seperator portion + ParseFile::ParseWordSep $pobj + + # Parses the End of line portion + ParseFile::ParseEndOfLine $pobj + + # Parses the Sequence portion + ParseFile::ParseSequence $pobj + + # Parses the format portion of the definition file. + ParseFile::ParseFormat $pobj FormatObjList + + # Parse Addresses from the Definition File, Create Valid Address + # objects and then seggregate the addresses used for blocks + # and that for the listing file. The block address object list + # and the listing file address object list are then set as + # post object attributes. + + ParseFile::ParseAddress $pobj AddObjList LfileAddObjList FormatObjList + PB_adr_SortAddresses AddObjList + + # Stores the format object list as post object attribuite. + Post::SetObjListasAttr $post_obj FormatObjList + + # Stores the address object list as post object attribute + Post::SetObjListasAttr $post_obj AddObjList + ListingFile::SetLfileAddObjList $post_obj LfileAddObjList + + # Creates the data for all the block elements. + Post::WordAddNamesSubNamesDesc $post_obj + + # Sets the master sequence. + Post::SetDefMasterSequence $post_obj AddObjList + + # Parses the block template portion of the definition file and stores the + # block object list as the post object attribute. + ParseFile::ParseBlockTemp $pobj BlockObjList AddObjList post_obj + Post::SetObjListasAttr $post_obj BlockObjList + + # Returns the display variables for the Block page. + PB_blk_RetDisVars BlockObjList BlockNameList WordDescArray post_obj + + # Returns the display variables for the List File page. + set ListObjectList $Post::($post_obj,list_obj_list) + PB_lfl_RetDisVars ListObjectList ListObjectAttr +} + +#============================================================================= +proc PB_com_MapMOMVariable { ADD_OBJ BLK_ELEM_MOM_VAR MOM_VAR_VALUE } { +#============================================================================= + upvar $ADD_OBJ add_obj + upvar $BLK_ELEM_MOM_VAR blk_elem_mom_var + upvar $MOM_VAR_VALUE mom_var_value + + set add_name $address::($add_obj,add_name) + + if {[string compare $add_name "Text"] == 0} \ + { + set mom_var_value $blk_elem_mom_var + } else \ + { + global post_object + array set mom_sys_var_arr $Post::($post_object,mom_sys_var_list) + set mom_var_names [array names mom_sys_var_arr] + set var_index [lsearch $mom_var_names $blk_elem_mom_var] + if { $var_index != -1 } \ + { + set mom_var_value $mom_sys_var_arr($blk_elem_mom_var) + } else \ + { + set mom_var_value "" + } + } +} + +#============================================================================ +proc PB_com_GetMachAxisType { KINEMATIC_VARIABLES MACH_TYPE AXISOPTION } { +#============================================================================ + upvar $KINEMATIC_VARIABLES kinematic_variables + upvar $MACH_TYPE mach_type + upvar $AXISOPTION axisoption + + switch $kinematic_variables(mom_kin_machine_type) \ + { + "3_axis_mill" { + set mach_type "Mill" + set axisoption "3" + } + + "4_axis_head" { + set mach_type "Mill" + set axisoption "4H" + } + + "4_axis_table" { + set mach_type "Mill" + set axisoption "4T" + } + + "5_axis_dual_table" { + set mach_type "Mill" + set axisoption "5TT" + } + + "5_axis_dual_head" { + set mach_type "Mill" + set axisoption "5HH" + } + + "5_axis_head_table" { + set mach_type "Mill" + set axisoption "5HT" + + } + + "lathe" { + set mach_type "Lathe" + set axisoption "2H" + } + + "2_axis_wedm" { + set mach_type "Wire EDM" + set axisoption "2" + } + + "4_axis_wedm" { + set mach_type "Wire EDM" + set axisoption "4" + } + "mill_turn" { + set mach_type "Mill/Turn" + set axisoption "3axis" + } + } +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_event.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_event.tcl new file mode 100644 index 0000000..27d1496 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_event.tcl @@ -0,0 +1,1042 @@ +############################################################################## +# Description # +# This file contains all functions dealing with the EVENT Object. # +# The attributes for creating the EVENT object are obtained after parsing # +# the PUI file an the Definition File. The data from PUI file is stored # +# along with the Post object and used for creating the EVENT Object. # +# # +# Revisions # +# # +# Date Who Reason # +# 15-feb-1999 bmp Initial # +# 07-Apr-1999 mnb Removed puts # +# 05-May-1999 mnb Added procedure, which create post blocks for cycles # +# 02-Jun-1999 mnb Code Integration # +# 07-Jun-1999 mnb Event ui data is attached only to the tool path events # +# 25-Jun-1999 mnb Apply Master Sequence while outputting blocks to # +# Definition file # +# 06-Jul-1999 mnb Implemented work plane change for rapid event # +# 13-Oct-1999 mnb Added procedure to return the event dialog variables. # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +#The input to the function are the Post Object, Event list name and the Event +#block list name. The attributes are stored in the Post object with the +#corresponding name. For each of the events the id of the block objects are +#found and along with other attributes the events are created. +#============================================================================= +proc PB_evt_CreateSeqEvents {POST_OBJ EVT_OBJ_LIST EVT_LIST_NAME \ + EVT_BLK_LIST_NAME SEQ_NAME } { + upvar $POST_OBJ post_obj + upvar $EVT_OBJ_LIST evt_obj_list + upvar $EVT_LIST_NAME evt_list_name + upvar $EVT_BLK_LIST_NAME evt_blk_list_name + upvar $SEQ_NAME sequence_name + + # Sets the event name array and event block names array. + array set evt_name_arr $Post::($post_obj,$evt_list_name) + array set evt_blk_arr $Post::($post_obj,$evt_blk_list_name) + + # Sets the array size (No of Events). + set arr_sz [array size evt_name_arr] + + # Gets the common event and shared events + set cycle_com_evt [lindex $Post::($post_obj,cyl_com_evt) 0] + set cycle_shared_evts [lindex $Post::($post_obj,cyl_evt_sh_com_evt) 0] + + # For each of the event names, create EVENT Object. + for {set sz 0} {$sz < $arr_sz} {incr sz}\ + { + # Sets the block name array for the event. + set evt_blk_list $evt_blk_arr($sz) + + # Returns the event element objects of an event. + if {[lsearch $cycle_shared_evts $evt_name_arr($sz)] != -1 } \ + { + PB_evt_RetCycleEventElements evt_blk_list post_obj evt_name_arr($sz) \ + evt_list_name evt_blk_list_name + } else \ + { + PB_evt_RetEventElements evt_blk_list post_obj evt_name_arr($sz) \ + sequence_name + } + + # Sets the attributes of the Event. + set evt_obj_attr(0) $evt_name_arr($sz) + set evt_obj_attr(1) [llength $evt_blk_list] + set evt_obj_attr(2) $evt_blk_list + + # Returns the item object list for creating the UI for the EVENT. + if {[string compare $sequence_name "tpth_ctrl"] == 0 || \ + [string compare $sequence_name "tpth_mot"] == 0 || \ + [string compare $sequence_name "tpth_cycle"] == 0 } \ + { + PB_evt_RetUIItemObjList item_obj_list evt_name_arr($sz) post_obj + } else \ + { + set item_obj_list "" + } + + # Sets the item object list as the attribute of the event. + set evt_obj_attr(3) $item_obj_list + + # Returns the UDE event object list. + PB_evt_RetUdeEvtObj post_obj ude_evt_obj_list + + # Creates the Event Object. + PB_evt_CreateEvtObj evt_obj_attr evt_obj_list + + # Adds the event obj to the block object + set event_obj [lindex $evt_obj_list $sz] + foreach row_elem $evt_blk_list \ + { + foreach evt_elem $row_elem \ + { + set blk_obj $event_element::($evt_elem,block_obj) + block::AddToEventList $blk_obj event_obj + } + } + } +} + +#=============================================================================== +# This function returns the event nc output, event nc text width and +# event nc text height +#============================================================================== +proc PB_evt_RetNcOutputAttr { EVT_ELEM_LIST EVT_NC_OUTPUT EVT_NC_WIDTH \ + EVT_NC_HEIGHT } { +#============================================================================== + upvar $EVT_ELEM_LIST evt_elem_list + upvar $EVT_NC_OUTPUT evt_nc_output + upvar $EVT_NC_WIDTH evt_nc_width + upvar $EVT_NC_HEIGHT evt_nc_height + + set evt_nc_width 0 + set evt_nc_height 0 + + foreach row_elem_list $evt_elem_list \ + { + set blk_nc_width 0 + set evt_nc_height [expr $evt_nc_height + \ + [font metrics {Helvetica 10} -linespace]] + foreach elem_obj $row_elem_list \ + { + set block_obj $event_element::($elem_obj,block_obj) + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + lappend row_blk_elem_list $blk_elem_obj + } + } + # Applys the master sequence to row block elements + UI_PB_com_ApplyMastSeqBlockElem row_blk_elem_list + + # Gets the block nc output + PB_com_CreateBlkNcCode row_blk_elem_list blk_nc_output + unset row_blk_elem_list + + set blk_nc_width [expr $blk_nc_width + \ + [font measure {Helvetica 10} $blk_nc_output)]] + append evt_nc_output $blk_nc_output "\n" + unset blk_nc_output + + if {$blk_nc_width > $evt_nc_width} \ + { + set evt_nc_width $blk_nc_width + } + } +} + +#=============================================================================== +#This function takes the object attributes and the updated EVENT object list +#as the input, creates the EVENT Object and returns the updated object list. +#=============================================================================== + +proc PB_evt_CreateEvtObj {OBJ_ATTR OBJ_LIST} { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [new event] + + #Appends object id to the object list. + lappend obj_list $object + + #sets the latest value to the object created. + event::setvalue $object obj_attr + event::DefaultValue $object obj_attr + +# puts "The event Object is created : $object" +} + +proc PB_evt_RetUdeEvtObj {POST_OBJ UDE_EVT_OBJ_LIST} { + upvar $POST_OBJ post_obj + upvar $UDE_EVT_OBJ_LIST ude_evt_obj_list +} + +#=============================================================================== +#This function takes the input as the Event name and the Post Object, checks +#whether a UI Data is defined for the Event, creates the members, groups and the +#items which builds the UI of the event and returns the Item Object List. +#=============================================================================== + +proc PB_evt_RetUIItemObjList {ITEM_OBJ_LIST EVENT_NAME POST_OBJ} { + upvar $ITEM_OBJ_LIST item_obj_list + upvar $EVENT_NAME event_name + upvar $POST_OBJ post_obj + + #Sets the UI Event name and Event item group member array from the PUI data. + array set ui_evt_name_arr $Post::($post_obj,ui_evt_name_lis) + array set ui_evt_itm_grp_mem_arr $Post::($post_obj,ui_evt_itm_grp_mem_lis) + + #Checks whether UI Item data is defined for the EVENT Name in Question. + for {set ix 0} {$ix < [array size ui_evt_name_arr]} {incr ix}\ + { + if {[string compare $ui_evt_name_arr($ix) $event_name] == 0}\ + { + #If the names match, ITEM, GROUP and MEMBERS are created. + PB_evt_CreateEvtUIItemGrpMemObj item_obj_list ui_evt_itm_grp_mem_arr($ix) + break + } else\ + { + #Else sets the item object list as null. + set item_obj_list "" + } + } +} + +#=============================================================================== +#This function takes the item, group and member attributes and for each item +#the groups and the group members are created and the item object list is +#output from the function. +#=============================================================================== + +proc PB_evt_CreateEvtUIItemGrpMemObj {ITEM_OBJ_LIST UI_EVT_ITM_GRP_MEM_ATTR} { + upvar $ITEM_OBJ_LIST item_obj_list + upvar $UI_EVT_ITM_GRP_MEM_ATTR ui_evt_itm_grp_mem_attr + + #For each of the item in the attribute list from PUI. + foreach item $ui_evt_itm_grp_mem_attr\ + { + #Takes the first element from the list and splits as the item + #attribute list and the rest of the list elemnts as item groups. + set item_attr_list [lindex $item 0] + set item_grp_list [lrange $item 1 end] + + #Initialize the group object list and the item object index as zero. + set grp_obj_list "" + set itm_ind 0 + + #For each of the group in the item group list, group and the + #respective members are created. + foreach group $item_grp_list\ + { + #Splits the first element of the list using : as the delimeter + #and stores as the group attr list and the rest as member attr list. + set grp_attr_list [lindex $group 0] + set grp_mem_list [lrange $group 1 end] + + #Initialize the group object list and the group object index as zero. + set mem_obj_list "" + set grp_ind 0 + + #For each member of the Group member list, create members. + foreach member $grp_mem_list\ + { + #Splits the member attributes and stores as a list. + set mem_attr_list $member + + #Initialize member index to zero. + set mem_ind 0 + + #Convert attribute list into attribute array. + foreach mem_attr $mem_attr_list\ + { + set mem_obj_attr($mem_ind) $mem_attr + incr mem_ind + } + + #Create UI Member taking the object attribute as the input, and + #the updated object list is output from the procedure. + PB_evt_CreateUIMember mem_obj_attr mem_obj_list + } + + #For each group attribute list create groups. + foreach grp_attr $grp_attr_list\ + { + set grp_obj_attr($grp_ind) $grp_attr + incr grp_ind + } + + #Sets the member object list as the group attribute. + set grp_obj_attr($grp_ind) $mem_obj_list + + #Create UI Group taking the object attribute as the input, and + #the updated object list is output from the procedure. + PB_evt_CreateUIGroup grp_obj_attr grp_obj_list + } + + #Convert attribute list into attribute array. + foreach item_attr $item_attr_list\ + { + set item_obj_attr($itm_ind) $item_attr + incr itm_ind + } + + #Sets the group object list as the group attribute. + set item_obj_attr($itm_ind) $grp_obj_list + + #Create UI Item taking the object attribute as the input, and + #the updated object list is output from the procedure. + PB_evt_CreateUIItem item_obj_attr item_obj_list + } + +} + +#=============================================================================== +#This function takes the object attributes and the updated ITEM object list +#as the input, creates the ITEM Object and returns the updated object list. +#=============================================================================== + +proc PB_evt_CreateUIItem {OBJ_ATTR OBJ_LIST} { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [new item] + + #Appends object id to the object list. + lappend obj_list $object + + #Sets the default value to the object. + item::setvalue $object obj_attr + item::DefaultValue $object obj_attr + +# puts "The ITEM Object is created = $object" +} + +#=============================================================================== +#This function takes the object attributes and the updated GROUP object list +#as the input, creates the GROUP Object and returns the updated object list. +#=============================================================================== + +proc PB_evt_CreateUIGroup {OBJ_ATTR OBJ_LIST} { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [new item_group] + + #Appends object id to the object list. + lappend obj_list $object + + #Sets the default value to the object. + item_group::setvalue $object obj_attr + item_group::DefaultValue $object obj_attr + +# puts "The GROUP Object is created = $object" +} + +#=============================================================================== +#This function takes the object attributes and the updated MEMBER object list +#as the input, creates the MEMBER Object and returns the updated object list. +#=============================================================================== + +proc PB_evt_CreateUIMember {OBJ_ATTR OBJ_LIST} { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [new group_member] + + #Appends object id to the object list. + lappend obj_list $object + + #Sets the default value to the object. + group_member::setvalue $object obj_attr + group_member::DefaultValue $object obj_attr + +# puts "The GROUP MEMBER Object is created = $object" +} + +#============================================================================== +# This procedure creates a event element. The inputs to the procedure +# are the attributes of the object. The output is a event element object +#============================================================================== +proc PB_evt_CreateEventElement { EVT_ELEM_OBJ EVT_OBJ_ATTR } { + upvar $EVT_ELEM_OBJ evt_elem_obj + upvar $EVT_OBJ_ATTR evt_obj_attr + + set evt_elem_obj [new event_element] + event_element::setvalue $evt_elem_obj evt_obj_attr + event_element::DefaultValue $evt_elem_obj evt_obj_attr +} + +#============================================================================ +proc PB_evt_CheckCycleRefWord { BLOCK_OBJ } { +#============================================================================ + upvar $BLOCK_OBJ block_obj + + if {[string compare $block::($block_obj,blk_owner) "post"] == 0} \ + { + return 0 + } + + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + set blk_elem_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + if {[string match "\$mom_sys_cycle*" $blk_elem_mom_var]} \ + { + return 1 + } + } + return 0 +} + +#============================================================================== +# This procedure takes the block names list of an cycle event (Created From PUI) +# and retrieves the object id of that block and creates the event element for +# each block object and creates the same type of list as the object names are +# replaced by the object id's +#=============================================================================== + +proc PB_evt_RetCycleEventElements { EVT_BLK_LIST POST_OBJ EVENT_NAME \ + EVT_LIST_NAME EVT_BLK_LIST_NAME } { + upvar $EVT_BLK_LIST evt_blk_list + upvar $POST_OBJ post_obj + upvar $EVENT_NAME event_name + upvar $EVT_LIST_NAME evt_list_name + upvar $EVT_BLK_LIST_NAME evt_blk_list_name + + # Sets the block object list (From PUI). + set blk_obj_list $Post::($post_obj,blk_obj_list) + + # Gets the cycle common event + set cycle_com_evt [lindex $Post::($post_obj,cyl_com_evt) 0] + + # Gets the event blk lists + set evt_name_arr $Post::($post_obj,$evt_list_name) + array set evt_blk_arr $Post::($post_obj,$evt_blk_list_name) + + # Gets the index of the common event + set com_evt_indx [expr [lsearch $evt_name_arr $cycle_com_evt] - 1] + + # Gets the common event blocks + set com_evt_blk_list $evt_blk_arr($com_evt_indx) + + # Retrieves the Object id from the object names and creates object + # id the list. + foreach com_blk $com_evt_blk_list \ + { + PB_com_RetObjFrmName com_blk blk_obj_list com_blk_obj + block::readvalue $com_blk_obj com_blk_obj_attr + set com_ret [PB_evt_CheckCycleRefWord com_blk_obj] + if {$com_ret == 0} \ + { + set new_blk_elem_list "" + foreach com_blk_elem_obj $com_blk_obj_attr(2) \ + { + block_element::readvalue $com_blk_elem_obj com_blk_elem_attr + PB_blk_CreateBlkElemObj com_blk_elem_attr new_elem_obj \ + com_blk_obj_attr + lappend new_blk_elem_list $new_elem_obj + set block_element::($new_elem_obj,owner) $cycle_com_evt + unset com_blk_elem_attr + } + set com_blk_obj_attr(2) $new_blk_elem_list + PB_blk_CreateBlkObj com_blk_obj_attr new_blk_obj + set block::($new_blk_obj,blk_owner) $cycle_com_evt + + set evt_obj_attr(0) $com_blk + set evt_obj_attr(1) $new_blk_obj + set evt_obj_attr(2) "normal" + PB_evt_CreateEventElement evt_elem_obj evt_obj_attr + lappend evt_elem_obj_list $evt_elem_obj + unset evt_obj_attr + } else \ + { + foreach blk_name $evt_blk_list\ + { + PB_com_RetObjFrmName blk_name blk_obj_list blk_obj + set com_ret [PB_evt_CheckCycleRefWord blk_obj] + PB_evt_SetOwnerShipForBlkElem blk_obj event_name + set evt_obj_attr(0) $blk_name + set evt_obj_attr(1) $blk_obj + set evt_obj_attr(2) "normal" + PB_evt_CreateEventElement evt_elem_obj evt_obj_attr + lappend evt_elem_obj_list $evt_elem_obj + unset evt_obj_attr + } + } + unset com_blk_obj_attr + } + + if {[info exists evt_elem_obj_list]} \ + { + set evt_blk_list $evt_elem_obj_list + unset evt_elem_obj_list + } else \ + { + set evt_blk_list "" + } +} + +#============================================================================== +#This procedure takes the block names list of an event (Created From PUI) and +#retrieves the object id of that block and creates the same type of list as the +#object names are replaced by the object id's +#=============================================================================== + +proc PB_evt_RetEventElements {EVT_BLK_LIST POST_OBJ EVENT_NAME SEQUENCE_NAME} { + upvar $EVT_BLK_LIST evt_blk_list + upvar $POST_OBJ post_obj + upvar $EVENT_NAME event_name + upvar $SEQUENCE_NAME sequence_name + + # Sets the block object list (From PUI). + set blk_obj_list $Post::($post_obj,blk_obj_list) + + # Retrieves the Object id from the object names and creates object + # id the list. + foreach blk_row $evt_blk_list\ + { + foreach row_elem $blk_row\ + { + PB_com_RetObjFrmName row_elem blk_obj_list blk_obj + if {[string compare $sequence_name "tpth_ctrl"] == 0 || \ + [string compare $sequence_name "tpth_mot"] == 0 || \ + [string compare $sequence_name "tpth_cycle"] == 0 } \ + { + PB_evt_SetOwnerShipForBlkElem blk_obj event_name + } + + set evt_obj_attr(0) $row_elem + set evt_obj_attr(1) $blk_obj + set evt_obj_attr(2) "normal" + PB_evt_CreateEventElement evt_elem_obj evt_obj_attr + unset evt_obj_attr + lappend row_elem_list $evt_elem_obj + } + + if {[info exists row_elem_list]}\ + { + lappend row_list $row_elem_list + unset row_elem_list + } + } + + # Sets the event block name list as event block object list. + if {[info exists row_list]}\ + { + set evt_blk_list $row_list + unset row_list + } else\ + { + # If there are no blocks, sets the list as null. + set evt_blk_list "" + } + + if {[string compare $event_name "Cycle Set"] == 0} \ + { + # Creates the Rapid block + PB_evt_CreateRapidToBlock evt_blk_list + + # Creates the Retract block + PB_evt_CreateRetractToBlock evt_blk_list + + # Creates the Cycle plane control block + PB_evt_CreateCyclePlaneBlock evt_blk_list + + # Creates the Cycle Start Block + PB_evt_CreateCycleStartBlock evt_blk_list + + # Stores the post blocks in the post object + PB_evt_StorePostBlocks evt_blk_list + } elseif { [string compare $event_name "Rapid Move"] == 0} \ + { + # Work Plane change implementation + PB_evt_RapidWrkPlaneChange evt_blk_list + } +} + +#============================================================================ +proc PB_evt_RapidWrkPlaneChange { EVT_BLK_LIST } { +#============================================================================ + upvar $EVT_BLK_LIST evt_blk_list + + foreach event_row $evt_blk_list \ + { + foreach evt_elem_obj $event_row \ + { + set blk_obj $event_element::($evt_elem_obj,block_obj) + set block_name $block::($blk_obj,block_name) + if {[string compare $block_name "rapid_traverse"] == 0 || \ + [string compare $block_name "rapid_spindle"] == 0} \ + { + foreach blk_elem_obj $block::($blk_obj,elem_addr_list) \ + { + set add_obj $block_element::($blk_elem_obj,elem_add_obj) + switch $address::($add_obj,add_name) \ + { + "X" - + "Y" - + "Z" { + set block_element::($blk_elem_obj,owner) "post" + } + } + } + } + } + } +} + +#============================================================================ +proc PB_evt_StorePostBlocks { EVT_ELEM_LIST } { +#============================================================================ + upvar $EVT_ELEM_LIST evt_elem_list + global post_object + + if {[info exists Post::($post_object,post_blk_list)]} \ + { + unset Post::($post_object,post_blk_list) + } + + foreach evt_elem_obj $evt_elem_list \ + { + set block_obj $event_element::($evt_elem_obj,block_obj) + if { ![string compare $block::($block_obj,blk_owner) "post"]} \ + { + lappend post_blk_list $block_obj + } + } + + if {[info exists post_blk_list]} \ + { + set Post::($post_object,post_blk_list) $post_blk_list + } +} + +#============================================================================ +proc PB_evt_CreateRapidToBlock { EVT_ELEM_LIST } { +#============================================================================ + upvar $EVT_ELEM_LIST evt_elem_list + global post_object + + set post_blk_name "rapidto" + array set mom_sys_var $Post::($post_object,mom_sys_var_list) + switch $mom_sys_var(\$cycle_rapto_opt) \ + { + "None" { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "R" { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr {"R"} + set add_rep_blk_var {"$mom_cycle_rapid_to_pos(2)"} + } + + "G00_X_Y_&_R" { + set elem_address {{"G_motion" "X" "Y"}} + set elem_mom_var {{"$mom_sys_rapid_code" "$mom_pos(0)" \ + "$mom_pos(1)"}} + set add_rep_blk_addr {"R"} + set add_rep_blk_var {"$mom_cycle_rapid_to_pos(2)"} + } + + "G00_X_Y_Z" { + set elem_address {{"G_motion" "X" "Y"} {"Z"}} + set elem_mom_var {{"$mom_sys_rapid_code" "$mom_pos(0)" \ + "$mom_pos(1)"} {"$mom_pos(2)"}} + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + default { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + } + + # Creates new post objects based upon the selected option + PB_evt_CreatePostBlock post_blk_name elem_address elem_mom_var \ + new_elem_list + + if {[info exists new_elem_list]} \ + { + foreach evt_elem_obj $evt_elem_list \ + { + lappend new_elem_list $evt_elem_obj + } + unset evt_elem_list + set evt_elem_list $new_elem_list + } + + # Adds the new post element to the representive block + PB_evt_AddPostElementToBlock evt_elem_list add_rep_blk_addr \ + add_rep_blk_var +} + +#============================================================================ +proc PB_evt_CreatePostBlock { BLOCK_NAME ELEM_ADDRESS ELEM_MOM_VAR \ + EVT_ELEM_LIST } { +#============================================================================ + upvar $BLOCK_NAME block_name + upvar $ELEM_ADDRESS elem_address + upvar $ELEM_MOM_VAR elem_mom_var + upvar $EVT_ELEM_LIST evt_elem_list + + if {$elem_address != ""} \ + { + set no_blks [llength $elem_address] + for {set ii 0} {$ii < $no_blks} {incr ii} \ + { + set blk_obj [new block] + set blk_elem_adds [lindex $elem_address $ii] + set blk_elem_vars [lindex $elem_mom_var $ii] + set no_of_elems [llength $blk_elem_adds] + if {$ii != 0} \ + { + append blk_obj_attr(0) "post_" $block_name _ $ii + } else \ + { + set blk_obj_attr(0) "post_$block_name" + } + for {set jj 0} {$jj < $no_of_elems} {incr jj} \ + { + set add_name [lindex $blk_elem_adds $jj] + set mom_var [lindex $blk_elem_vars $jj] + PB_blk_AddNewBlkElemObj add_name mom_var blk_obj_attr \ + new_elem_obj + lappend blk_elem_obj_list $new_elem_obj + set block_element::($new_elem_obj,owner) "post" + } + set blk_obj_attr(1) [llength $blk_elem_obj_list] + set blk_obj_attr(2) $blk_elem_obj_list + block::setvalue $blk_obj blk_obj_attr + set block::($blk_obj,blk_owner) "post" + unset blk_obj_attr + unset blk_elem_obj_list + set evt_elem_obj_attr(0) "post_rapid_$ii" + set evt_elem_obj_attr(1) $blk_obj + set evt_elem_obj_attr(2) "normal" + set evt_elem_obj [new event_element] + event_element::setvalue $evt_elem_obj evt_elem_obj_attr + unset evt_elem_obj_attr + lappend evt_elem_list $evt_elem_obj + } + } +} + +#============================================================================ +proc PB_evt_AddPostElementToBlock { EVT_ELEM_LIST ADD_REP_BLK_ADDR \ + ADD_REP_BLK_VAR } { +#============================================================================ + upvar $EVT_ELEM_LIST evt_elem_list + upvar $ADD_REP_BLK_ADDR add_rep_blk_addr + upvar $ADD_REP_BLK_VAR add_rep_blk_var + + if {$add_rep_blk_addr != ""} \ + { + foreach evt_elem_obj $evt_elem_list \ + { + set cyc_block_obj $event_element::($evt_elem_obj,block_obj) + set ret [PB_evt_CheckCycleRefWord cyc_block_obj] + if {$ret == 1} { break } + } + + block::readvalue $cyc_block_obj cyc_blk_obj_attr + set no_of_elems [llength $add_rep_blk_addr] + for {set jj 0} {$jj < $no_of_elems} {incr jj} \ + { + set blk_elem_add [lindex $add_rep_blk_addr $jj] + set blk_elem_var [lindex $add_rep_blk_var $jj] + PB_blk_AddNewBlkElemObj blk_elem_add blk_elem_var cyc_blk_obj_attr \ + new_elem_obj + set block_element::($new_elem_obj,owner) "post" + lappend block::($cyc_block_obj,elem_addr_list) $new_elem_obj + } + unset cyc_blk_obj_attr + } +} + +#============================================================================ +proc PB_evt_CreateRetractToBlock { EVT_ELEM_LIST } { +#============================================================================ + upvar $EVT_ELEM_LIST evt_elem_list + global post_object + + set post_blk_name "retracto" + array set mom_sys_var $Post::($post_object,mom_sys_var_list) + switch $mom_sys_var(\$cycle_recto_opt) \ + { + "None" { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "K" { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr {"K_cycle"} + set add_rep_blk_var {"$mom_cycle_retract_to"} + } + + "G98/G99" { + set elem_address {{"G_return"}} + set elem_mom_var {{"$mom_sys_canned_cyc_ret_plane"}} + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "Rapid_Z_Move" { + set elem_address {{"G_motion" "Z"}} + set elem_mom_var {{"$mom_sys_rapid_code" "$mom_cycle_retract_to"}} + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "Cycle_Off_then_Rapid_Z_Move" { + set elem_address {{"G_motion"} {"G_motion" "Z"}} + set elem_mom_var {{"$mom_sys_cycle_off"} \ + {"$mom_sys_rapid_code" "$mom_cycle_retract_to"}} + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + default { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + } + + # Creates new post objects based upon the selected option + PB_evt_CreatePostBlock post_blk_name elem_address elem_mom_var \ + new_elem_list + + if {[info exists new_elem_list]} \ + { + foreach evt_elem_obj $new_elem_list \ + { + lappend evt_elem_list $evt_elem_obj + } + } + + # Adds the new post element to the representive block + PB_evt_AddPostElementToBlock evt_elem_list add_rep_blk_addr \ + add_rep_blk_var +} + +#============================================================================ +proc PB_evt_CreateCycleStartBlock { EVT_ELEM_LIST } { +#============================================================================ + upvar $EVT_ELEM_LIST evt_elem_list + global post_object + + set post_blk_name "startblk" + array set mom_sys_var $Post::($post_object,mom_sys_var_list) + switch $mom_sys_var(\$cycle_start_blk) \ + { + 0 { + set elem_address "" + set elem_mom_var "" + } + + 1 { + set elem_address {{"G_motion" "X" "Y" "Z"}} + set elem_mom_var {{"$mom_sys_cycle_start_code" "$mom_pos(0)" \ + "$mom_pos(1)" "$mom_pos(2)"}} + } + } + + # Creates new post objects based upon the selected option + PB_evt_CreatePostBlock post_blk_name elem_address elem_mom_var \ + new_elem_list + + if {[info exists new_elem_list]} \ + { + foreach evt_elem_obj $new_elem_list \ + { + lappend evt_elem_list $evt_elem_obj + } + } +} + +#============================================================================ +proc PB_evt_CreateCyclePlaneBlock { EVT_ELEM_LIST } { +#============================================================================ + upvar $EVT_ELEM_LIST evt_elem_list + global post_object + + array set mom_sys_var $Post::($post_object,mom_sys_var_list) + switch $mom_sys_var(\$cycle_plane_control_opt) \ + { + "None" { + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "G17_/_G18_/_G19" { + set add_rep_blk_addr {"G_plane"} + set add_rep_blk_var {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)"} + } + + "G81_/_G181_/_G281" { + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "R_/_R'_R''" { + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + default { + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + } + + # Adds the new post element to the representive block + PB_evt_AddPostElementToBlock evt_elem_list add_rep_blk_addr \ + add_rep_blk_var +} + +#=============================================================================== +#This procedure sets the ownership for each block element. The ownership can be +#set only when a block is referenced by and event. The owner of the block +#will be the respective event. +#=============================================================================== + +proc PB_evt_SetOwnerShipForBlkElem {BLK_OBJ EVENT_NAME} { + upvar $BLK_OBJ blk_obj + upvar $EVENT_NAME event_name + global post_object + + set common_evt [lindex $Post::($post_object,cyl_com_evt) 0] + set shared_evt_list [lindex $Post::($post_object,cyl_evt_sh_com_evt) 0] + + # Sets the block element object list. + set blk_elem_obj_list $block::($blk_obj,elem_addr_list) + set block::($blk_obj,blk_owner) $event_name + + # For each of the block element the ownership is set as the event name. + if {[lsearch $shared_evt_list $event_name] != -1} \ + { + set cycle_evt_list $Post::($post_object,tpth_cycle_evt_list) + array set cycle_evt_blks $Post::($post_object,tpth_cycle_evt_blk_list) + set indx [lindex $cycle_evt_list [expr [lsearch $cycle_evt_list \ + $common_evt] - 1]] + set com_evt_blks $cycle_evt_blks($indx) + set blk_obj_list $Post::($post_object,blk_obj_list) + foreach com_evt_blk_obj $com_evt_blks \ + { + PB_com_RetObjFrmName com_evt_blk_obj blk_obj_list com_blk_obj + set com_ret [PB_evt_CheckCycleRefWord com_blk_obj] + if {$com_ret == 1} {break} + } + + set blk_ret [PB_evt_CheckCycleRefWord blk_obj] + if {$blk_ret == 1} \ + { + foreach blk_elem $blk_elem_obj_list\ + { + set ret [PB_evt_CheckElemInBlock com_blk_obj blk_elem] + if {$ret == 1} \ + { + set block_element::($blk_elem,owner) $common_evt + } else \ + { + if {[string match "\$mom_sys_cycle*" \ + $block_element::($blk_elem,elem_mom_variable)]}\ + { + set block_element::($blk_elem,owner) "post" + } else \ + { + set block_element::($blk_elem,owner) $event_name + } + } + } + } else \ + { + foreach blk_elem $blk_elem_obj_list\ + { + set block_element::($blk_elem,owner) $event_name + } + } + } else \ + { + foreach blk_elem $blk_elem_obj_list\ + { + if {[string compare $block_element::($blk_elem,elem_mom_variable) \ + "\$mom_sys_cycle_reps_code"] == 0} \ + { + set block_element::($blk_elem,owner) "post" + } else \ + { + set block_element::($blk_elem,owner) $event_name + } + } + } +} + +#================================================================ +proc PB_evt_CheckElemInBlock {BLK_OBJ ELEM_OBJ} { +#================================================================ + upvar $BLK_OBJ blk_obj + upvar $ELEM_OBJ elem_obj + + set elem_addr_obj $block_element::($elem_obj,elem_add_obj) + set elem_mom_var $block_element::($elem_obj,elem_mom_variable) + + foreach blk_elem_obj $block::($blk_obj,elem_addr_list)\ + { + set blk_elem_add_obj $block_element::($blk_elem_obj,elem_add_obj) + set blk_elem_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + if {$blk_elem_add_obj == $elem_addr_obj && \ + [string compare $elem_mom_var $blk_elem_mom_var] == 0}\ + { + return 1 + } + } + return 0 +} + +#========================================================================= +proc PB_evt_RetEventVars { EVENT_OBJ EVT_VARS } { +#========================================================================= + upvar $EVENT_OBJ event_obj + upvar $EVT_VARS evt_vars + + event::readvalue $event_obj evt_obj_attr + set evt_vars "" + foreach item_obj $evt_obj_attr(3) \ + { + item::readvalue $item_obj item_obj_attr + foreach grp_obj $item_obj_attr(3) \ + { + item_group::readvalue $grp_obj grp_obj_attr + foreach mem_obj $grp_obj_attr(3) \ + { + group_member::readvalue $mem_obj mem_obj_attr + if { $mem_obj_attr(3) != "null" } \ + { + lappend evt_vars $mem_obj_attr(3) + } + unset mem_obj_attr + } + unset grp_obj_attr + } + unset item_obj_attr + } + unset evt_obj_attr +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_file.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_file.tcl new file mode 100644 index 0000000..25e6dff --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_file.tcl @@ -0,0 +1,1230 @@ +############################################################################## +# Description # +# This file contains all the api functions, which wiil be used for # +# getting the data of the database objects. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 07-Apr-1999 mnb Added env. variable # +# 10-Apr-1999 gsl Encapsulated main procedure into PB_Start. # +# 05-May-1999 mnb Added a procedure, to output tcl def and pui files # +# 02-Jun-1999 mnb Code Integration # +# 16-Jun-1999 mnb stores mom_sys_arr in post object # +# 23-Jun-1999 mnb Corrected format # +# 08-Jul-1999 mnb Added a procedure to create new blk element from # +# Current blk element # +# 07-Sep-1999 mnb Added proceduers to update the database # +# 21-Sep-1999 mnb Added APIs for creating, Cutting & Deleting an address # +# object from database # +# 13-Oct-1999 mnb Added few more API's # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## +global env + +if {[catch {package require stooop 3.0}]} { + # in case stooop package is not installed + source $env(PB_HOME)/tcl/exe/stooop.tcl +} + +namespace import stooop::* + +source $env(PB_DIR)/dbase/pb_class.tcl +source $env(PB_DIR)/dbase/pb_method.tcl +source $env(PB_DIR)/dbase/pb_common.tcl +source $env(PB_DIR)/dbase/pb_format.tcl +source $env(PB_DIR)/dbase/pb_address.tcl +source $env(PB_DIR)/dbase/pb_block.tcl +source $env(PB_DIR)/dbase/pb_list.tcl +source $env(PB_DIR)/dbase/pb_pui_parser.tcl +source $env(PB_DIR)/dbase/pb_machine.tcl +source $env(PB_DIR)/dbase/pb_event.tcl +source $env(PB_DIR)/dbase/pb_sequence.tcl +source $env(PB_DIR)/dbase/pb_ude.tcl +source $env(PB_DIR)/dbase/pb_output.tcl + +#===================================================================== +proc PB_int_FormatCreateObject { ACT_FMT_OBJ FormatObjAttr OBJ_INDEX} { +#===================================================================== + upvar $ACT_FMT_OBJ act_fmt_obj + upvar $FormatObjAttr obj_attr + upvar $OBJ_INDEX obj_index + global post_object + + PB_fmt_RetFormatObjs fmt_obj_list + set obj_index [lsearch $fmt_obj_list $act_fmt_obj] + + PB_fmt_GetFmtNameList fmt_obj_list fmt_name_list + PB_com_SetDefaultName fmt_name_list obj_attr + PB_fmt_CreateNewFmtObj fmt_obj_list obj_attr obj_index + set Post::($post_object,fmt_obj_list) $fmt_obj_list +} + +#================================================================== +proc PB_int_BlockCreateObject { ACT_BLK_OBJ OBJ_INDEX } { +#================================================================== + upvar $ACT_BLK_OBJ act_blk_obj + upvar $OBJ_INDEX obj_index + global post_object + + set blk_obj_list $Post::($post_object,blk_obj_list) + set obj_index [lsearch $blk_obj_list $act_blk_obj] + + # Sets the object index for the new object. if the index is null, + # sets to zero. + if {$obj_index == ""}\ + { + set obj_index 0 + } else\ + { + incr obj_index + } + + PB_blk_CreateBlkFromBlkObj blk_obj_list act_blk_obj obj_index + set Post::($post_object,blk_obj_list) $blk_obj_list +} + +#================================================================== +proc PB_int_CreateNewEventElement { BLOCK_OBJ ELEM_TYPE EVT_ELEM_OBJ } { +#================================================================== + upvar $BLOCK_OBJ block_obj + upvar $ELEM_TYPE elem_type + upvar $EVT_ELEM_OBJ evt_elem_obj + + set elem_obj_attr(0) $block::($block_obj,block_name) + set elem_obj_attr(1) $block_obj + set elem_obj_attr(2) $elem_type + + PB_evt_CreateEventElement evt_elem_obj elem_obj_attr + unset elem_obj_attr +} + +#================================================================== +proc PB_int_CreateNewBlock { BLOCK_NAME BLK_ELEM_LIST BLK_OWNER \ + BLK_OBJ } { +#================================================================== + upvar $BLOCK_NAME block_name + upvar $BLK_ELEM_LIST blk_elem_list + upvar $BLK_OWNER blk_owner + upvar $BLK_OBJ blk_obj + global post_object + + set blk_obj_attr(0) $block_name + set blk_obj_attr(1) [llength $blk_elem_list] + set blk_obj_attr(2) $blk_elem_list + + PB_blk_CreateBlkObj blk_obj_attr blk_obj + unset blk_obj_attr + + set block::($blk_obj,blk_owner) $blk_owner + lappend Post::($post_object,blk_obj_list) $blk_obj +} + +#============================================================== +proc PB_int_RemoveBlkObjFrmList { BLOCK_OBJ } { +#============================================================== + upvar $BLOCK_OBJ block_obj + global post_object + set index [lsearch $Post::($post_object,blk_obj_list) $block_obj] + + if {$index != -1} \ + { + set Post::($post_object,blk_obj_list) \ + [lreplace $Post::($post_object,blk_obj_list) $index $index] + } +} + +#================================================================== +proc PB_int_GetAllBlockNames { BLOCK_NAME_LIST } { +#================================================================== + upvar $BLOCK_NAME_LIST block_name_list + global post_object + + set blk_obj_list $Post::($post_object,blk_obj_list) + PB_blk_GetBlockNames blk_obj_list block_name_list +} + +#================================================================== +proc PB_int_DisplayFormatValue {FMT_NAME ADD_NAME INP_VALUE DIS_VALUE} { +#================================================================== + upvar $FMT_NAME fmt_name + upvar $ADD_NAME add_name + upvar $INP_VALUE inp_value + upvar $DIS_VALUE dis_value + + global post_object + + set add_obj_list $Post::($post_object,add_obj_list) + PB_com_RetObjFrmName add_name add_obj_list add_obj + set add_rep_mom_var $address::($add_obj,rep_mom_var) + PB_com_MapMOMVariable add_obj add_rep_mom_var app_text + + set fmt_obj_list $Post::($post_object,fmt_obj_list) + PB_com_RetObjFrmName fmt_name fmt_obj_list fmt_obj + + format::readvalue $fmt_obj for_obj_attr + PB_int_ReturnInputValue app_text for_obj_attr(1) inp_value + PB_fmt_RetFmtOptVal for_obj_attr inp_value dis_value +} + +#============================================================= +proc PB_int_ApplyFormatAppText { ADD_OBJ APP_TEXT } { +#============================================================= + upvar $ADD_OBJ add_obj + upvar $APP_TEXT app_text + global post_object + + if {[string length $app_text] > 0 && \ + [tixGetInt -nocomplain $app_text] != 0 || $app_text == 0} \ + { + set fmt_obj $address::($add_obj,add_format) + format::readvalue $fmt_obj fmt_obj_attr + PB_fmt_RetFmtOptVal fmt_obj_attr app_text dis_value + set app_text $dis_value + } +} + +#============================================================= +proc PB_int_FormatCutObject { ACTIVE_FMT_OBJ OBJ_INDEX } { +#============================================================= + upvar $ACTIVE_FMT_OBJ active_fmt_obj + upvar $OBJ_INDEX obj_index + global post_object + + set fmt_obj_list $Post::($post_object,fmt_obj_list) + set fmt_obj_list [lreplace $fmt_obj_list $obj_index $obj_index] + set Post::($post_object,fmt_obj_list) $fmt_obj_list + + if { $obj_index == [llength $fmt_obj_list]} \ + { + incr obj_index -1 + } +} + +#=================================================================== +proc PB_int_BlockCutObject { ACTIVE_BLK_OBJ OBJ_INDEX } { +#=================================================================== + upvar $ACTIVE_BLK_OBJ active_blk_obj + upvar $OBJ_INDEX obj_index + global post_object + + set blk_obj_list $Post::($post_object,blk_obj_list) + set blk_obj_list [lreplace $blk_obj_list $obj_index $obj_index] + set Post::($post_object,blk_obj_list) $blk_obj_list + + if { $obj_index == [llength $blk_obj_list]} \ + { + incr obj_index -1 + } +} + +#=================================================================== +proc PB_int_BlockPasteObject { BUFF_BLK_OBJ OBJ_INDEX } { +#=================================================================== + upvar $BUFF_BLK_OBJ buff_blk_obj + upvar $OBJ_INDEX obj_index + global post_object + + set blk_obj_list $Post::($post_object,blk_obj_list) + set count [llength $blk_obj_list] + if { $count } \ + { + set block_name $block::($buff_blk_obj,block_name) + PB_com_RetObjFrmName block_name blk_obj_list ret_code + if {$ret_code}\ + { + # PoP-Up Message + tk_messageBox -type ok -icon error\ + -message "Object Name Exists...Paste Invalid" + return + } + } + + # Sets the object index for the new object. if the index is null, + # sets to zero. + if {$obj_index == ""}\ + { + set obj_index 0 + } else\ + { + incr obj_index + } + + PB_blk_CreateBlkFromBlkObj blk_obj_list buff_blk_obj obj_index + set Post::($post_object,blk_obj_list) $blk_obj_list +} + +#=================================================================== +proc PB_int_FormatPasteObject { BUFF_OBJ_ATTR OBJ_INDEX } { +#=================================================================== + upvar $BUFF_OBJ_ATTR buff_obj_attr + upvar $OBJ_INDEX obj_index + global paOption + global post_object + + set fmt_obj_list $Post::($post_object,fmt_obj_list) + set count [llength $fmt_obj_list] + if { $count }\ + { + PB_com_RetObjFrmName buff_obj_attr(0) fmt_obj_list ret_code + if {$ret_code}\ + { + # PoP-Up Message + tk_messageBox -type ok -icon error\ + -message "Object Name Exists...Paste Invalid" + return + } + } + PB_fmt_PasteFmtBuffObj fmt_obj_list buff_obj_attr obj_index + set Post::($post_object,fmt_obj_list) $fmt_obj_list +} + +#=============================================================================== +proc PB_int_AddrSummaryAttr { ADD_NAME_LIST ADD_APP_TEXT ADD_DESC_ARR } { +#=============================================================================== + upvar $ADD_NAME_LIST add_name_list + upvar $ADD_APP_TEXT add_app_text + upvar $ADD_DESC_ARR add_desc_arr + global post_object + + set add_obj_list $Post::($post_object,add_obj_list) + set index 0 + + set add_name_list "" + foreach add_obj $add_obj_list \ + { + address::readvalue $add_obj add_obj_attr + set add_name $add_obj_attr(0) + lappend add_name_list $add_name + set add_rep_mom_var $address::($add_obj,rep_mom_var) + PB_com_MapMOMVariable add_obj add_rep_mom_var app_text + PB_int_GetElemDisplayAttr add_name app_text dis_attr + set add_app_text($add_name) $dis_attr(1) + set add_desc_arr($index) $address::($add_obj,word_desc) + incr index + } +} + +#=============================================================================== +proc PB_int_RetDefKinVars { DEF_MOM_KIN_VAR } { +#=============================================================================== + upvar $DEF_MOM_KIN_VAR def_mom_kin_var + global post_object + + array set def_mom_kin_var $Post::($post_object,def_mom_kin_var_list) +} + +#=============================================================================== +proc PB_int_RetDefAddrFmtArrys { DEF_GPB_FMT_VAR DEF_GPB_ADDR_VAR } { +#=============================================================================== + upvar $DEF_GPB_FMT_VAR def_gpb_fmt_var + upvar $DEF_GPB_ADDR_VAR def_gpb_addr_var + global post_object + + array set def_gpb_fmt_var $Post::($post_object,def_gpb_fmt_var) + array set def_gpb_addr_var $Post::($post_object,def_gpb_addr_var) +} + +#=============================================================================== +# Defines all the global variabels required for the ui stuff +#=============================================================================== +proc PB_int_DefineUIGlobVar { } { +#=============================================================================== + global post_object + global gpb_fmt_var + global gpb_addr_var + global mom_sys_arr + global mom_kin_var + global mach_type + global axisoption + + set add_obj_list $Post::($post_object,add_obj_list) + + foreach add_obj $add_obj_list \ + { + address::readvalue $add_obj add_obj_attr + set add_name $add_obj_attr(0) + set addr_fmt_obj $add_obj_attr(1) + set addr_fmt_name $format::($addr_fmt_obj,for_name) + + # Address attributes + set gpb_addr_var($add_name,name) $add_obj_attr(0) + set gpb_addr_var($add_name,fmt_name) $addr_fmt_name + set gpb_addr_var($add_name,modal) $add_obj_attr(2) + set gpb_addr_var($add_name,modl_status) $add_obj_attr(3) + set gpb_addr_var($add_name,add_max) $add_obj_attr(4) + set gpb_addr_var($add_name,max_status) $add_obj_attr(5) + set gpb_addr_var($add_name,add_min) $add_obj_attr(6) + set gpb_addr_var($add_name,min_status) $add_obj_attr(7) + set gpb_addr_var($add_name,leader_name) $add_obj_attr(8) + set gpb_addr_var($add_name,trailer) $add_obj_attr(9) + set gpb_addr_var($add_name,trail_status) $add_obj_attr(10) + set gpb_addr_var($add_name,incremental) $add_obj_attr(11) + unset add_obj_attr + } + + set fmt_obj_list $Post::($post_object,fmt_obj_list) + foreach fmt_obj $fmt_obj_list \ + { + format::readvalue $fmt_obj fmt_obj_attr + + set fmt_name $fmt_obj_attr(0) + # Format Attributes + set gpb_fmt_var($fmt_name,name) $fmt_obj_attr(0) + set gpb_fmt_var($fmt_name,dtype) $fmt_obj_attr(1) + set gpb_fmt_var($fmt_name,plus_status) $fmt_obj_attr(2) + set gpb_fmt_var($fmt_name,lead_zero) $fmt_obj_attr(3) + set gpb_fmt_var($fmt_name,trailzero) $fmt_obj_attr(4) + set gpb_fmt_var($fmt_name,integer) $fmt_obj_attr(5) + set gpb_fmt_var($fmt_name,decimal) $fmt_obj_attr(6) + set gpb_fmt_var($fmt_name,fraction) $fmt_obj_attr(7) + unset fmt_obj_attr + } + + #Sets the defaults of address and formats + set Post::($post_object,def_gpb_fmt_var) [array get gpb_fmt_var] + set Post::($post_object,def_gpb_addr_var) [array get gpb_addr_var] + + #Sets the mom sys variables list. + array set mom_sys_arr $Post::($post_object,mom_sys_var_list) + + # Sets the Sequece number variables + array set seq_params $Post::($post_object,sequence_param) + set mom_sys_arr(seqnum_block) $seq_params(block) + set mom_sys_arr(seqnum_start) $seq_params(start) + set mom_sys_arr(seqnum_incr) $seq_params(increment) + set mom_sys_arr(seqnum_freq) $seq_params(frequency) + + # Sets the WordSeq + set mom_sys_arr(Word_Seperator) $Post::($post_object,word_sep) + + # Sets the End of Line + set mom_sys_arr(End_of_Block) $Post::($post_object,end_of_line) + + # Sets the varaibles for other options in the Others Page. + # It is hardcoded, it has to be changed. + set mom_sys_arr(Decimal_Point) "." + set mom_sys_arr(Comment_Start) "" + set mom_sys_arr(Comment_End) "" + set Post::($post_object,mom_sys_var_list) [array get mom_sys_arr] + set Post::($post_object,def_mom_sys_var_list) [array get mom_sys_arr] + + # gets the kinematic variables + PB_mach_RetMachineToolAttr mom_kin_var + + # Gets the machine type & Axis + PB_com_GetMachAxisType mom_kin_var mach_type axisoption +} + +#=============================================================================== +proc PB_int_GCodePageAttributes { G_CODES_DESC G_CODES_VAR } { +#=============================================================================== + upvar $G_CODES_DESC g_codes_desc + upvar $G_CODES_VAR g_codes_var + global post_object + + array set g_codes_mom_var $Post::($post_object,g_codes) + array set g_codes_desc $Post::($post_object,g_codes_desc) + + #Sets the mom sys variables list. + array set mom_sys_var_arr $Post::($post_object,mom_sys_var_list) + + set arr_size [array size g_codes_mom_var] + + # The code for each g code is set + for {set count 0} {$count < $arr_size} {incr count}\ + { + set g_codes_var($count) $g_codes_mom_var($count) + } +} + +#=============================================================================== +proc PB_int_MCodePageAttributes { M_CODES_DESC M_CODES_VAR } { +#=============================================================================== + upvar $M_CODES_DESC m_codes_desc + upvar $M_CODES_VAR m_codes_var + global post_object + + array set m_codes_mom_var $Post::($post_object,m_codes) + array set m_codes_desc $Post::($post_object,m_codes_desc) + + + set arr_size [array size m_codes_mom_var] + + # The code for each g code is set + for {set count 0} {$count < $arr_size} {incr count}\ + { + set m_codes_var($count) $m_codes_mom_var($count) + } +} + +#============================================================== +proc PB_int_AddApplyObject { ADDR_OBJ ADDR_OBJ_ATTR } { +#============================================================== + upvar $ADDR_OBJ addr_obj + upvar $ADDR_OBJ_ATTR addr_obj_attr + global post_object + + set add_obj_list $Post::($post_object,add_obj_list) + set fmt_obj_list $Post::($post_object,fmt_obj_list) + + PB_adr_ApplyAdrObj add_obj_list fmt_obj_list addr_obj_attr addr_obj +} + +#================================================================== +proc PB_int_AddCreateObject { ACT_ADDR_OBJ OBJ_ATTR OBJ_INDEX } { +#================================================================== + upvar $ACT_ADDR_OBJ act_addr_obj + upvar $OBJ_ATTR obj_attr + upvar $OBJ_INDEX obj_index + global post_object + + array set word_mom_var_arr $Post::($post_object,word_mom_var) + array set word_desc_arr $Post::($post_object,word_desc_array) + + PB_adr_RetAddressObjList add_obj_list + set obj_index [lsearch $add_obj_list $act_addr_obj] + + PB_adr_GetAddressNameList add_obj_list add_name_list + set prev_add_name $obj_attr(0) + set obj_attr(0) "user_def" + PB_com_SetDefaultName add_name_list obj_attr + PB_adr_CreateNewAdrObj add_obj_list obj_attr obj_index + set word_mom_var_arr($obj_attr(0)) $word_mom_var_arr($prev_add_name) + set word_desc_arr($obj_attr(0)) $word_desc_arr($prev_add_name) + + # Updates the database + set Post::($post_object,add_obj_list) $add_obj_list + set Post::($post_object,word_mom_var) [array get word_mom_var_arr] + set Post::($post_object,word_desc_array) [array get word_desc_arr] +} + +#=============================================================================== +proc PB_int_CreateNewAddress { ADD_NAME FORMAT_NAME ADD_OBJ } { +#=============================================================================== + upvar $ADD_NAME add_name + upvar $FORMAT_NAME format_name + upvar $ADD_OBJ add_obj + global post_object + + PB_adr_InitAdrObj add_obj_attr + set add_obj_attr(0) $add_name + + # Sets the default address name + PB_adr_RetAddressObjList add_obj_list + PB_adr_GetAddressNameList add_obj_list add_name_list + PB_com_SetDefaultName add_name_list add_obj_attr + + # Gets the format object + PB_fmt_RetFormatObjs fmt_obj_list + PB_com_RetObjFrmName format_name fmt_obj_list fmt_obj + set add_obj_attr(1) $fmt_obj + + PB_adr_CreateAdrObj add_obj_attr add_obj + + # Add master sequence parameters here, to sequence the new address + set mseq_attr(0) "\$mom_usd_add_var" + set mseq_attr(1) 0 + set mseq_attr(2) "User Defined Address" + set mseq_attr(3) [llength $add_obj_list] + address::SetMseqAttr $add_obj mseq_attr + address::DefaultMseqAttr $add_obj mseq_attr + + set add_obj_list $Post::($post_object,add_obj_list) + lappend add_obj_list $add_obj + set Post::($post_object,add_obj_list) $add_obj_list + set add_name $add_obj_attr(0) +} + +#=========================================================================== +proc PB_int_UpdateAddVariablesAttr { WORD_DESC_ARR BASE_ADDR } { +#=========================================================================== + upvar $WORD_DESC_ARR word_desc_arr + upvar $BASE_ADDR base_addr + global post_object + + array set word_mom_var_list $Post::($post_object,word_mom_var) + set word_mom_var_list($base_addr) "" + set Post::($post_object,word_mom_var) [array get word_mom_var_list] + set Post::($post_object,word_desc_array) [array get word_desc_arr] +} + +#============================================================================ +proc PB_int_AddCutObject { ACTIVE_ADD_OBJ OBJ_INDEX ADD_MOM_VAR \ + ADD_VAR_DESC ADD_MSEQ_ATTR } { +#============================================================================ + upvar $ACTIVE_ADD_OBJ active_add_obj + upvar $OBJ_INDEX obj_index + upvar $ADD_MOM_VAR add_mom_var + upvar $ADD_VAR_DESC add_var_desc + upvar $ADD_MSEQ_ATTR add_mseq_attr + global post_object + + array set word_mom_var_arr $Post::($post_object,word_mom_var) + array set word_desc_arr $Post::($post_object,word_desc_array) + + set add_name $address::($active_add_obj,add_name) + address::readMseqAttr $active_add_obj add_mseq_attr + + # Deletes the address object from the format addr_list + PB_int_RemoveAddObjFromList active_add_obj + + set add_mom_var $word_mom_var_arr($add_name) + set add_var_desc $word_desc_arr($add_name) + unset word_mom_var_arr($add_name) + unset word_desc_arr($add_name) + set Post::($post_object,word_mom_var) [array get word_mom_var_arr] + set Post::($post_object,word_desc_array) [array get word_desc_arr] + + PB_adr_RetAddressObjList add_obj_list + if { $obj_index == [llength $add_obj_list]} \ + { + incr obj_index -1 + } +} + +#========================================================================== +proc PB_int_AddPasteObject { BUFF_OBJ_ATTR OBJ_INDEX ADD_MOM_VAR \ + ADD_VAR_DESC ADD_MSEQ_ATTR } { +#========================================================================== + upvar $BUFF_OBJ_ATTR buff_obj_attr + upvar $OBJ_INDEX obj_index + upvar $ADD_MOM_VAR add_mom_var + upvar $ADD_VAR_DESC add_var_desc + upvar $ADD_MSEQ_ATTR add_mseq_attr + global post_object + + set add_obj_list $Post::($post_object,add_obj_list) + set count [llength $add_obj_list] + + if { $count }\ + { + PB_com_RetObjFrmName buff_obj_attr(0) add_obj_list ret_code + if {$ret_code}\ + { + # PoP-Up Message + tk_messageBox -type ok -icon error\ + -message "Object Name Exists...Paste Invalid" + return + } + } + + PB_adr_PasteAdrBuffObj add_obj_list buff_obj_attr add_mseq_attr \ + obj_index + array set word_mom_var_arr $Post::($post_object,word_mom_var) + array set word_desc_arr $Post::($post_object,word_desc_array) + set word_mom_var_arr($buff_obj_attr(0)) $add_mom_var + set word_desc_arr($buff_obj_attr(0)) $add_var_desc + + # Updates the database + set Post::($post_object,add_obj_list) $add_obj_list + set Post::($post_object,word_mom_var) [array get word_mom_var_arr] + set Post::($post_object,word_desc_array) [array get word_desc_arr] +} + +#========================================================================= +proc PB_int_GetWordVarDesc { WORD_DESC_ARRAY } { +#========================================================================= + upvar $WORD_DESC_ARRAY word_desc_array + global post_object + + array set word_desc_array $Post::($post_object,word_desc_array) +} + +#============================================================== +proc ApplyListObjAttr {ListObjectAttr ListObjectList} { +#============================================================== + upvar $ListObjectAttr obj_attr + upvar $ListObjectList obj_list + + set object [lindex $obj_list 0] + ListingFile::RestoreValue $object obj_attr + ListingFile::setvalue_from_pui $object obj_attr +# PB_lfl_WritebackPui obj_list +} + +#============================================================== +proc DefListObjAttr {ListObjectList ListObjectAttr} { +#============================================================== + upvar $ListObjectList object + upvar $ListObjectAttr obj_attr + + PB_lfl_DefLfileParams object obj_attr +} + +#============================================================== +proc RestoreListObjAttr {ListObjectList ListObjectAttr} { +#============================================================== + upvar $ListObjectList object + upvar $ListObjectAttr obj_attr + + PB_lfl_ResLfileParams object obj_attr +} + +#===================================================================== +proc PB_int_CreateBlkElemFromElemObj { BLK_ELEM_OBJ NEW_ELEM_OBJ \ + BLK_OBJ_ATTR } { +#===================================================================== + upvar $BLK_ELEM_OBJ blk_elem_obj + upvar $NEW_ELEM_OBJ new_elem_obj + upvar $BLK_OBJ_ATTR blk_obj_attr + + block_element::readvalue $blk_elem_obj blk_elem_obj_attr + PB_blk_CreateBlkElemObj blk_elem_obj_attr new_elem_obj blk_obj_attr +} + +#============================================================== +proc PB_int_AddNewBlockElemObj {BLK_ELEM_ADR_NAME BLK_ELEM_MOM_VAR \ + BLOCK_OBJ NEW_BLK_ELEM_OBJ } { +#============================================================== + upvar $BLK_ELEM_ADR_NAME blk_elem_adr_name + upvar $BLK_ELEM_MOM_VAR blk_elem_mom_var + upvar $BLOCK_OBJ block_obj + upvar $NEW_BLK_ELEM_OBJ new_blk_elem_obj + + set blk_obj_attr(0) $block::($block_obj,block_name) + PB_blk_AddNewBlkElemObj blk_elem_adr_name blk_elem_mom_var\ + blk_obj_attr new_blk_elem_obj +} + + +#============================================================== +proc PB_int_GetAddrListFormat { FMT_NAME ADDR_LIST } { +#============================================================== + upvar $FMT_NAME fmt_name + upvar $ADDR_LIST addr_list + global post_object + + set fmt_obj_list $Post::($post_object,fmt_obj_list) + PB_com_RetObjFrmName fmt_name fmt_obj_list fmt_obj + + set addr_obj_list $format::($fmt_obj,fmt_addr_list) + + foreach add_obj $addr_obj_list \ + { + lappend addr_list $address::($add_obj,add_name) + } +} + +#============================================================== +proc PB_int_GetAdsFmtValue {ADD_NAME ADS_FMT_ATTR DIS_ATTR} { +#============================================================== + upvar $ADD_NAME add_name + upvar $ADS_FMT_ATTR ads_fmt_attr + upvar $DIS_ATTR dis_attr + global post_object + + if {[info exists dis_attr]}\ + { + unset dis_attr + } + + set add_obj_list $Post::($post_object,add_obj_list) + PB_com_RetObjFrmName add_name add_obj_list add_obj + + set add_rep_mom_var $address::($add_obj,rep_mom_var) + PB_com_MapMOMVariable add_obj add_rep_mom_var app_text + + PB_int_ReturnInputValue app_text ads_fmt_attr(1) inp_value + PB_fmt_RetFmtOptVal ads_fmt_attr inp_value value + set dis_attr $value +} + +#============================================================== +proc PB_int_GetElemDisplayAttr {ADD_NAME APP_TEXT DIS_ATTR} { +#============================================================== + upvar $ADD_NAME add_name + upvar $APP_TEXT app_text + upvar $DIS_ATTR dis_attr + + global post_object + if {[info exists dis_attr]}\ + { + unset dis_attr + } + + set add_obj_list $Post::($post_object,add_obj_list) + PB_com_RetObjFrmName add_name add_obj_list add_obj + + set dis_attr(0) $address::($add_obj,add_leader) + set trailer_status $address::($add_obj,add_trailer_status) + if {$trailer_status}\ + { + set dis_attr(2) $address::($add_obj,add_trailer) + } else\ + { + set dis_attr(2) "" + } + + set format_obj $address::($add_obj,add_format) + format::readvalue $format_obj for_obj_attr + + PB_int_ReturnInputValue app_text for_obj_attr(1) inp_value + PB_fmt_RetFmtOptVal for_obj_attr inp_value value + set dis_attr(1) $value +} + +#============================================================== +proc PB_int_GetFormat { FMT_OBJ_ATTR FMT_VALUE } { +#============================================================== + upvar $FMT_OBJ_ATTR fmt_obj_attr + upvar $FMT_VALUE fmt_value + + if {[string compare $fmt_obj_attr(1) "Integer"] == 0} \ + { + set inp_value 1 + } elseif {[string compare $fmt_obj_attr(1) "Real Number"] == 0} \ + { + set inp_value 1.234 + } else \ + { + set inp_value "" + } + + PB_fmt_RetFmtOptVal fmt_obj_attr inp_value fmt_value +} + +#============================================================== +proc PB_int_ReturnInputValue {APP_TEXT FMT_DTYPE INP_VALUE} { +#============================================================== + upvar $APP_TEXT app_text + upvar $FMT_DTYPE fmt_dtype + upvar $INP_VALUE inp_value + + set inp_value "" + if {[string compare $app_text ""] == 0} \ + { + switch $fmt_dtype \ + { + "Real Number" { + set inp_value 1.234 + } + + "Integer" { + set inp_value 1 + } + + "Text String" { + set inp_value "" + } + } + } else \ + { + set is_number [tixGetInt -nocomplain $app_text] + if {$is_number} \ + { + set inp_value $app_text + } else \ + { + switch $fmt_dtype \ + { + "Real Number" { + set inp_value 1.234 + } + + "Integer" { + set inp_value 1 + } + "Text String" { + set inp_value $app_text + } + } + } + } +} + +#============================================================== +proc PB_int_GetGroupWordAddress {IMAGE_NAME IMAGE_TEXT} { +#============================================================== + global post_object + + set word_image_name_list $Post::($post_object,word_img_name) + set word_app_text_list $Post::($post_object,word_app_text) + + array set word_image_array $word_image_name_list + array set word_app_text_array $word_app_text_list + set add_list [array names word_image_array] + + foreach address $add_list\ + { + set img_sub_list $word_image_array($address) + set elem_check [lsearch $img_sub_list $IMAGE_NAME] + + if {$elem_check != -1}\ + { + set app_text_sub_list $word_app_text_array($address) + set text_elem_check [lsearch $app_text_sub_list $IMAGE_TEXT)] + if {$text_elem_check != -1}\ + { + set IMAGE_TEXT [lindex $word_app_text_array($address) 0] + } + } + } + append temp_app_img_name $IMAGE_NAME $IMAGE_TEXT + return $temp_app_img_name +} + +#============================================================== +proc PB_int_GetNewBlockElement {BASE_ELEMENT INDEX WORD_MOM_VAR} { +#============================================================== + upvar $BASE_ELEMENT base_element + upvar $INDEX index + upvar $WORD_MOM_VAR word_mom_var + + PB_blk_AddNewBlkElem base_element index word_mom_var +} + +#============================================================== +proc PB_int_GetBlockElementAddr {ELEM_ADDRESS BASE_ELEMENT_LIST } { +#============================================================== + upvar $ELEM_ADDRESS elem_address + upvar $BASE_ELEMENT_LIST base_element_list + + PB_blk_RetValidCboxBlkElemAddr elem_address base_element_list +} + +#============================================================== +proc PB_int_RetSequenceObjs { SEQ_OBJ_LIST } { +#============================================================== + upvar $SEQ_OBJ_LIST seq_obj_list + global post_object + + set seq_obj_list $Post::($post_object,seq_obj_list) +} + +#============================================================== +proc PB_int_RetEvtCombElems { COMB_BOX_ELEMS } { +#============================================================== + upvar $COMB_BOX_ELEMS comb_box_elems + global post_object + + set comb_box_elems $Post::($post_object,word_name_list) +} + +#============================================================== +proc PB_int_DbaseRetSeqEvtBlkObj {EVT_OBJ_LIST INDEX} { +#============================================================== + upvar $EVT_OBJ_LIST evt_obj_list + upvar $INDEX index + + global post_object + set seq_obj [lindex $Post::($post_object,seq_obj_list) $index] + PB_seq_RetSeqEvtBlkObj seq_obj evt_obj_list +} + +#============================================================== +proc PB_int_DbaseRetSeqCombElems { COMB_ELEM_LIST } { +#============================================================== + upvar $COMB_ELEM_LIST comb_elem_list + + global post_object + set blk_obj_list $Post::($post_object,blk_obj_list) + PB_seq_RetSeqCombElems blk_obj_list comb_elem_list +} + +#============================================================== +proc PB_int_RetBlkObjList { BLK_OBJ_LIST } { +#============================================================== + upvar $BLK_OBJ_LIST blk_obj_list + + #sets the post object. + global post_object + + #sets the block object list. + set blk_obj_list $Post::($post_object,blk_obj_list) +} + +#============================================================== +proc PB_int_GetNewEventElement { EVENT_OBJ BLK_NAME ELEM_TYPE ELEM_OBJ } { +#============================================================== + upvar $EVENT_OBJ event_obj + upvar $BLK_NAME blk_name + upvar $ELEM_TYPE elem_type + upvar $ELEM_OBJ elem_obj + + #sets the post object. + global post_object + + #sets the block object list. + set blk_obj_list $Post::($post_object,blk_obj_list) + + #Returns object from name. + PB_com_RetObjFrmName blk_name blk_obj_list block_obj + + set evt_elem_attr(0) $blk_name + set evt_elem_attr(1) $block_obj + set evt_elem_attr(2) $elem_type + + PB_evt_CreateEventElement elem_obj evt_elem_attr + block::AddToEventList $block_obj event_obj +} + +#=============================================================== +proc PB_int_RetMOMVarAsscAddress { ADDRESS_NAME ADD_MOM_VAR_LIST } { +#=============================================================== + upvar $ADDRESS_NAME address_name + upvar $ADD_MOM_VAR_LIST add_mom_var_list + + global post_object + + array set word_mom_var_list $Post::($post_object,word_mom_var) + + if { [info exists word_mom_var_list($address_name)] } \ + { + set add_mom_var_list $word_mom_var_list($address_name) + } else \ + { + set add_mom_var_list "" + } +} + +#================================================================= +proc PB_int_RetAddressObjList { ADDR_OBJ_LIST } { +#================================================================= + upvar $ADDR_OBJ_LIST addr_obj_list + + PB_adr_RetAddressObjList addr_obj_list +} + +#================================================================= +proc PB_int_RetAddrObjFromName { ADDR_NAME ADDR_OBJ } { +#================================================================= + upvar $ADDR_NAME addr_name + upvar $ADDR_OBJ addr_obj + + PB_adr_RetAddressObjList addr_obj_list + PB_com_RetObjFrmName addr_name addr_obj_list addr_obj +} + +#===================================================== +proc PB_int_RetAddrNameList { ADDR_NAME_LIST } { +#===================================================== + upvar $ADDR_NAME_LIST addr_name_list + + PB_adr_RetAddressObjList addr_obj_list + PB_adr_RetAddressNameList addr_obj_list addr_name_list +} + +#===================================================== +proc PB_int_RemoveAddObjFromList { ADD_OBJ } { +#===================================================== + upvar $ADD_OBJ add_obj + global post_object + + PB_adr_RetAddressObjList addr_obj_list + + set add_index [lsearch $addr_obj_list $add_obj] + if { $add_index != -1 } \ + { + set add_fmt_obj $address::($add_obj,add_format) + format::DeleteFromAddressList $add_fmt_obj add_obj + set addr_obj_list [lreplace $addr_obj_list $add_index $add_index] + set Post::($post_object,add_obj_list) $addr_obj_list + } +} + +#===================================================== +proc PB_int_RetFormatObjList { FMT_OBJ_LIST } { +#===================================================== + upvar $FMT_OBJ_LIST fmt_obj_list + + PB_fmt_RetFormatObjs fmt_obj_list +} + +#====================================================================== +proc PB_int_RetFmtNameList { FMT_NAME_LIST } { +#====================================================================== + upvar $FMT_NAME_LIST fmt_name_list + + PB_fmt_RetFormatObjs fmt_obj_list + PB_fmt_GetFmtNameList fmt_obj_list fmt_name_list +} + +#====================================================================== +proc PB_int_RetFmtObjFromName { FMT_NAME FMT_OBJ } { +#====================================================================== + upvar $FMT_NAME fmt_name + upvar $FMT_OBJ fmt_obj + + PB_fmt_RetFormatObjs fmt_obj_list + PB_com_RetObjFrmName fmt_name fmt_obj_list fmt_obj +} + +#====================================================================== +proc PB_int_RetDefKinVarValues { KIN_VAR_LIST KIN_VAR_VALUE } { +#====================================================================== + upvar $KIN_VAR_LIST kin_var_list + upvar $KIN_VAR_VALUE kin_var_value + + global post_object + + array set def_kin_var $Post::($post_object,def_mom_kin_var_list) + foreach kin_var $kin_var_list \ + { + set kin_var_value($kin_var) $def_kin_var($kin_var) + } +} + +#====================================================================== +proc PB_int_RetDefMOMVarValues { MOM_VAR_ARR MOM_VAR_VALUE } { +#====================================================================== + upvar $MOM_VAR_ARR mom_var_arr + upvar $MOM_VAR_VALUE mom_var_value + global post_object + + array set def_mom_var $Post::($post_object,def_mom_sys_var_list) + set no_mom_var [array size mom_var_arr] + for {set count 0} { $count < $no_mom_var } { incr count } \ + { + set mom_var $mom_var_arr($count) + set mom_var_value($mom_var) $def_mom_var($mom_var) + } +} + +#====================================================================== +proc PB_int_UpdateMOMVar { MOM_SYS_VAR } { +#====================================================================== + upvar $MOM_SYS_VAR mom_sys_var + global post_object + + set Post::($post_object,mom_sys_var_list) \ + [array get mom_sys_var] +} + + +#======================================================================== +proc PB_int_UpdateKinVar { MOM_KIN_VAR } { +#======================================================================== + upvar $MOM_KIN_VAR mom_kin_var + global post_object + + set Post::($post_object,mom_kin_var_list) \ + [array get mom_kin_var] +} + +#======================================================================== +proc PB_int_RetCycleComAndSharedEvts { CYCLE_COM_EVT CYCLE_SHARED_EVTS } { +#======================================================================== + upvar $CYCLE_COM_EVT cycle_com_evt + upvar $CYCLE_SHARED_EVTS cycle_shared_evts + global post_object + + set cycle_com_evt [lindex $Post::($post_object,cyl_com_evt) 0] + set cycle_shared_evts [lindex $Post::($post_object,cyl_evt_sh_com_evt) 0] +} + +#=================================================================== +proc PB_int_CreateCyclePostBlks { EVENT_OBJ } { +#=================================================================== + upvar $EVENT_OBJ event_obj + global post_object + + set evt_elem_list $event::($event_obj,evt_elem_list) + + # Creates the Rapid block + PB_evt_CreateRapidToBlock evt_elem_list + + # Creates the Retract block + PB_evt_CreateRetractToBlock evt_elem_list + + # Creates the Cycle plane control block + PB_evt_CreateCyclePlaneBlock evt_elem_list + + # Creates the Cycle Start Block + PB_evt_CreateCycleStartBlock evt_elem_list + + # Stores the post blocks in the post object + PB_evt_StorePostBlocks evt_elem_list + + set event::($event_obj,evt_elem_list) $evt_elem_list +} + +#============================================================================== +proc PB_int_ReadPostFiles { DIR DEF_FILE TCL_FILE } { +#============================================================================== + upvar $DIR dir + upvar $DEF_FILE def_file + upvar $TCL_FILE tcl_file + global post_object + + Post::ReadPostFiles $post_object dir def_file tcl_file +} + +#============================================================================== +proc PB_int_SetPostOutputFiles { DIR PUI_FILE DEF_FILE TCL_FILE } { +#============================================================================== + upvar $DIR dir + upvar $PUI_FILE pui_file + upvar $DEF_FILE def_file + upvar $TCL_FILE tcl_file + global post_object + + Post::SetPostOutputFiles $post_object dir pui_file def_file \ + tcl_file +} + +#============================================================================== +proc PB_int_ReadPostOutputFiles { DIR PUI_FILE DEF_FILE TCL_FILE } { +#============================================================================== + upvar $DIR dir + upvar $PUI_FILE pui_file + upvar $DEF_FILE def_file + upvar $TCL_FILE tcl_file + global post_object + + Post::ReadPostOutputFiles $post_object dir pui_file def_file \ + tcl_file +} + +#=================================================================== +proc PB_Start { pui_file_name args } { +#=================================================================== + global post_object + global env + +# set cdl_file_name "$env(PB_HOME)/pblib/ude.def" + set def_file_id FP1 + set pui_file_id FP2 + set cdl_file_id FP3 + + # Read All Defaults File Create Objects and Display in the UI + PB_com_ReadPuiFile pui_file_name pui_file_id post_object +# PB_com_ReadUdeFile cdl_file_name cdl_file_id post_object + + # Gets the definition file & Tcl file name + Post::ReadPostFiles $post_object dir def_file tcl_file + + set def_file [file join $dir $def_file] + PB_com_ReadDfltDefFile def_file def_file_id post_object + PB_seq_CreateSequences post_object + + # Defines all the global variables for the ui + PB_int_DefineUIGlobVar +} + +#==================================================================== +proc PB_CreateDefTclFiles { args } { +#==================================================================== + global post_object + if {![info exists post_object]} { return } + + set def_parse_obj $Post::($post_object,def_parse_obj) + Post::ReadPostOutputFiles $post_object dir pui_file def_file tcl_file + + set pui_file [file join $dir $pui_file] + set def_file [file join $dir $def_file] + set tcl_file [file join $dir $tcl_file] + + # Outputs Definition file + PB_PB2DEF_main def_parse_obj def_file + + # Outputs Event Handler (TCL) + PB_PB2TCL_main tcl_file + + # Outputs Post Builder PUI file + PB_pui_WritePuiFile pui_file +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_format.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_format.tcl new file mode 100644 index 0000000..832cfb3 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_format.tcl @@ -0,0 +1,634 @@ +############################################################################## +# Description # +# This file contains all functions dealing with the FORMAT Object. # +# The definition file is read and the respective FORMAT Objects are # +# created. All actions on the format page of the UI is mapped into the # +# respective functions in this file through the interface file. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 07-Apr-1999 mnb Removed puts # +# 04-May-1999 mnb Added procedures, which returns the format code for # +# Definition file. # +# 02-Jun-1999 mnb Code Integration # +# 16-Jun-1999 mnb Corrected the format # +# 28-Jun-1999 mnb Made changes to format output # +# 07-Sep-1999 mnb Parses the & format and outputs the format in & format # +# 13-Oct-1999 mnb Phase 20 Integration # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +#The input to the function is the FILE Object and the FORMAT OBJECT List. +#This function is called from the classes.tcl file. The Definition file is +#read and the lines containing FORMAT are passed into the secondary parsing +#function. +#============================================================================= + +proc PB_fmt_FmtInitParse {this OBJ_LIST} { + upvar $OBJ_LIST obj_list + + array set format_arr $ParseFile::($this,format_list) + array set arr_size $ParseFile::($this,arr_size_list) + set file_name_list $ParseFile::($this,file_list) + + foreach f_name $file_name_list \ + { + set no_of_formats $arr_size($f_name,format) + for {set count 0} {$count < $no_of_formats} {incr count} \ + { + set format_data [lindex $format_arr($f_name,$count,data) 0] + PB_com_RemoveBlanks format_data + set format_text $format_arr($f_name,$count,text) + PB_fmt_FmtSecParse format_data obj_list + } + } +} + +#=============================================================================== +#This function takes the line containing FORMAT as the input and the two portions +#of the line are split into the format name and the format value. The format value +#is then again split into respective attributes needed for the creation of the +#FORMAT object and the OBJECT List is returned. +#=============================================================================== + +proc PB_fmt_FmtSecParse {FMT_LINE OBJ_LIST} { + upvar $FMT_LINE fmt_line + upvar $OBJ_LIST obj_list + + set ret_code 0 + + # Sets the first and second portion of the line as object attributes. + set obj_attr(0) [lindex $fmt_line 1] + set obj_attr(1) [lindex $fmt_line 2] + + # Returns the object id from object name. + PB_com_RetObjFrmName obj_attr(0) obj_list ret_code + + # Checks the return code whether the object with the same name exists or not. + if {!$ret_code}\ + { + # The value portion of the line is split into the respective + # attributes of the FORMAT Object. + if { [string first % $obj_attr(1)] != -1 } \ + { + PB_fmt_SplitPercFormat obj_attr + } elseif { [string first & $obj_attr(1)] != -1 } \ + { + PB_fmt_SplitAmperSignFormat obj_attr + } + + # The FORMAT Object is created passing the object attributes. + # The obj_list is the return list from the function which stores + # the "id" of the object created. + PB_fmt_CreateFmtObj obj_attr obj_list + } +} + +#============================================================================== +#This function takes the object attributes and the updated FORMAT object list +#as the input, creates the FORMAT Object and returns the updated object list. +#============================================================================== + +proc PB_fmt_CreateFmtObj { OBJ_ATTR OBJ_LIST } { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + # Creates new object. + set object [new format] + + # Appends object id to the object list. + lappend obj_list $object + + # sets the latest value to the object created. + format::setvalue $object obj_attr + + # Sets the default value to the object. + format::DefaultValue $object obj_attr +# puts "The object is Created: $object " +} + +#============================================================================== +proc PB_fmt_SplitAmperSignFormat { OBJ_ATTR } { +#============================================================================== + upvar $OBJ_ATTR obj_attr + + # Splits each charater and stores it as a list. + set attr_list [split $obj_attr(1) {}] + + # Sets default value for the object attributes + set obj_attr(2) 0 + set obj_attr(3) 0 + set obj_attr(4) 0 + set obj_attr(5) "" + set obj_attr(6) 0 + set obj_attr(7) "" + + set count 1 + foreach elem $attr_list \ + { + if { [string compare $elem " "] == 0 || \ + [string compare $elem &] == 0 || \ + [string compare $elem \"] == 0 } \ + { + continue + } + + switch -- $count \ + { + 1 { + switch -- $elem \ + { + _ { set obj_attr(2) 0 } + + { set obj_attr(2) 1 } + - { set obj_attr(2) 3 } + } + } + + 2 { + switch -- $elem \ + { + _ { set obj_attr(3) 0 } + 0 { set obj_attr(3) 1 } + } + } + + 3 { + switch -- $elem \ + { + _ { set obj_attr(5) 0 } + default { set obj_attr(5) $elem } + } + } + + 4 { + switch -- $elem \ + { + _ { set obj_attr(6) 0 } + . { set obj_attr(6) 1 } + } + } + + 5 { + switch -- $elem \ + { + _ { set obj_attr(7) 0 } + default { set obj_attr(7) $elem } + } + } + + 6 { + switch -- $elem \ + { + _ { set obj_attr(4) 0 } + 0 { set obj_attr(4) 1 } + } + } + } + incr count + } + + if { $obj_attr(6) == 1 } \ + { + set obj_attr(1) "Real Number" + set obj_attr(5) [expr $obj_attr(5) - $obj_attr(7)] + } elseif { $obj_attr(7) > 0 } \ + { + set obj_attr(1) "Real Number" + set obj_attr(5) [expr $obj_attr(5) - $obj_attr(7)] + } elseif { $obj_attr(6) == 0 && $obj_attr(7) == 0 && \ + $obj_attr(5) > 0 } \ + { + set obj_attr(1) "Integer" + } else \ + { + set obj_attr(1) "Text String" + } + +} + +#============================================================================== +#This function takes the value portion of the lines containing FORMAT +#from the definition file and each character is the mapped to the +#appropriate attribute of the FORMAT object. +#=============================================================================== +proc PB_fmt_SplitPercFormat { OBJ_ATTR } { +#=============================================================================== + upvar $OBJ_ATTR obj_attr + set count 1 + + # Splits each charater and stores it as a list. + set attr_list [split $obj_attr(1) {}] + + # Sets default value for the object attributes + set obj_attr(2) 0 + set obj_attr(3) 0 + set obj_attr(4) 0 + set obj_attr(5) "" + set obj_attr(6) 0 + set obj_attr(7) "" + + # Maps value for each attribute of the FORMAT Object. Each element of the + # attribute list is mapped to the respective attribute of the FORMAT Object + # defined in the classes.tcl file. + + foreach attr $attr_list\ + { + switch -- $attr\ + { + . { set obj_attr(6) 1 } + f { set obj_attr(1) "Real Number" } + d { set obj_attr(1) Integer } + s { set obj_attr(1) "Text String" } + + { set obj_attr(2) 1 } + - { set obj_attr(2) 3 } + 0 { if {!$obj_attr(6) && ![string compare $obj_attr(5) ""]}\ + { + set obj_attr(3) 1 + } elseif {!$obj_attr(6)}\ + { + append obj_attr(5) $attr + } elseif {$obj_attr(6)}\ + { + set obj_attr(7) $attr + } + } + \" {} + % {} + default { if {$count == 1 && !$obj_attr(6)}\ + { + append obj_attr(5) $attr + incr count + } elseif {!$obj_attr(6)}\ + { + append obj_attr(5) $attr + } else\ + { + set obj_attr(7) $attr + if {$obj_attr(5) == ""}\ + { + set obj_attr(5) [expr 8 - $obj_attr(7)] + } else\ + { + set obj_attr(5) [expr $obj_attr(5) - $obj_attr(7)] + } + } + } + } + } +} + +#=============================================================================== +#This function is called from the interface file, the callback from the "Create" button +#of the Format page. New FORMAT Object is created taking the object attribute, object list +#name list and object index from the UI passed through the interface file. +#=============================================================================== + +proc PB_fmt_CreateNewFmtObj { OBJ_LIST OBJ_ATTR OBJ_INDEX} { + upvar $OBJ_LIST obj_list + upvar $OBJ_ATTR obj_attr + upvar $OBJ_INDEX obj_index + + #The FORMAT Object is created passing the object attributes. The obj_list + #is the return list from the function which stores the "id" of the object + #created. + PB_fmt_CreateFmtObj obj_attr obj_list + + #Sets the object index for the new object. if the index is null, sets to zero. + if {$obj_index == ""}\ + { + set obj_index 0 + } else\ + { + incr obj_index + } + + #Finding the length of the object list. + set length [llength $obj_list] + + #The newely created object is removed from the list. + set RearrObj [lindex $obj_list [expr $length -1]] + + #The newely created object is removed and inserted in the + #correct object index. + set obj_list [lreplace $obj_list [expr $length - 1] [expr $length -1]] + set obj_list [linsert $obj_list $obj_index $RearrObj] +} + +#=============================================================================== +#This procedure reads value from the buffer object, creates a new FORMAT Object and +#stores the value in the new object, and returns the value to the UI. The Input to +#the procedure are object list, name list, object, object index and buffer object and +#the output from the procedure is the updated name and object list along with the +#display attributes for the new PASTE object. +#=============================================================================== + +proc PB_fmt_PasteFmtBuffObj {OBJ_LIST BUFF_OBJ_ATTR OBJ_INDEX} { + upvar $OBJ_LIST fmt_obj_list + upvar $BUFF_OBJ_ATTR buff_obj_attr + upvar $OBJ_INDEX obj_index + + # Create new FORMAT Object with the attributes read from the buffer object. + PB_fmt_CreateFmtObj buff_obj_attr fmt_obj_list + + # If the count is greater than or equal to one insert the PASTE Object + # after the current object + set count [llength $fmt_obj_list] + if { $obj_index == ""} \ + { + set obj_index 0 + } elseif { $count > 1} \ + { + incr obj_index + set Rearrange_I [expr [llength $fmt_obj_list] - 1] + set LastElement [lindex $fmt_obj_list $Rearrange_I] + set fmt_obj_list [lreplace $fmt_obj_list $Rearrange_I $Rearrange_I] + set fmt_obj_list [linsert $fmt_obj_list $obj_index $LastElement] + } +} + +#============================================================================== +#This function returns the format string given the object attribute as the input. +#Corresponding to each of the format attribute the values are mapped and the final +#string is output from the procedure. +#=============================================================================== + +proc PB_fmt_RetFmtFrmAttr {OBJ_ATTR VALUE} { + upvar $OBJ_ATTR obj_attr + upvar $VALUE nvar + + #Sets the %string as it is at the beginning of all the format strings. + set nvar "\"&" + + #For each of the attributes the values are mapped to the corresponding value. + for {set i 0} {$i < 9} {incr i}\ + { + switch $i\ + { + 0 {} + 1 { + switch $obj_attr($i)\ + { + "Real Number" {set dt f} + "Integer" {set dt d} + "Text String" {set nvar \"%s\" ; return} + } + } + 2 { if {$obj_attr($i)}\ + { + if {$obj_attr($i) == 3}\ + { + append nvar - + } else\ + { + append nvar + + } + } else \ + { + append nvar _ + } + } + 3 { if {$obj_attr($i)}\ + { + append nvar 0 + } else \ + { + append nvar _ + } + } + 4 {} + 5 { + if {[string compare $dt "f"] == 0} \ + { + set temp_fpart [expr $obj_attr(5) + $obj_attr(7)] + append nvar $temp_fpart + } elseif {$obj_attr($i) != 0} \ + { + append nvar $obj_attr($i) + } + } + 6 { if {$obj_attr($i)}\ + { + append nvar "." + } else \ + { + append nvar _ + } + } + 7 { + if {[string compare $dt "f"] == 0} \ + { + append nvar $obj_attr($i) + } else \ + { + append nvar _ + } + } + 8 { + if {$obj_attr(4) || [string compare $dt "d"] == 0} \ + { + append nvar 0 + } else \ + { + append nvar _ + } + append nvar \" + } + default {} + } + } +} + +#=============================================================================== +#This procdure takes the input as the object attribute and the input value, calculates +#the OUTPUT value by applying the format to the input value. +#=============================================================================== + +proc PB_fmt_RetFmtOptVal {OBJ_ATTR INP_VALUE DIS_VALUE} { + upvar $OBJ_ATTR obj_attr + upvar $INP_VALUE inp_value + upvar $DIS_VALUE dis_value + + #Sets the display value to null initially. + set dis_value "" + if { $inp_value == "" } { return } + + #Initialize the negative flag to zero. + set neg_flag 0 + + #Finds the position of the decimal place. + set dec_pt [string first "." $inp_value] + + #If input value is there split the input value into first and second part. + if {$dec_pt != -1}\ + { + set fpart [string range $inp_value 0 [expr $dec_pt - 1]] + set spart [string range $inp_value [expr $dec_pt + 1] end] + } else\ + { + #Else initialize the second part to null. + set fpart $inp_value + set spart "" + } + + #Check whether the input value contains negative sign. + if {[string match -* $fpart]}\ + { + #Set the first part and negative flag. + set len [string length $fpart] + set fpart [string range $fpart 1 $len] + set neg_flag 1 + } + + #For each of the attributes map into the corresponding output. + #The data type is identified, + and - signs appended, Leading zeros + #and trailing zeros are appended to the value. + for {set i 1} {$i < 8} {incr i}\ + { + switch $i\ + { + 1 { switch $obj_attr($i)\ + { + "Text String" { set dis_value $inp_value + break + } + } + } + 2 { switch $obj_attr($i)\ + { + 1 { append dis_value + } + default { if {$neg_flag}\ + { + append dis_value - + } + } + } + } + 3 { switch $obj_attr($i)\ + { + 1 {set lz 0} + 0 {set lz 1} + } + } + 4 { switch $obj_attr($i)\ + { + 1 {set tz 0} + 0 {set tz 1} + } + } + 5 { switch $obj_attr($i)\ + { + "" {} + default { + set length [string length $fpart] + if {$length > $obj_attr($i)} \ + { + set end_no [expr $obj_attr($i) - 1] + set fpart [string range $fpart 0 $end_no] + } + + if {$lz == 0}\ + { + set length [string length $fpart] + set num_zero \ + [expr $obj_attr($i) - $length] + if { $num_zero >= 0}\ + { + for {set j 0} {$j < $num_zero} \ + {incr j}\ + { + append dis_value 0 + } + append dis_value $fpart + } + } else\ + { + append dis_value $fpart + } + } + } + } + 6 { switch $obj_attr($i)\ + { + 1 { + append dis_value . + } + 0 {} + } + } + 7 { switch $obj_attr($i)\ + { + "" { + if {![string compare $obj_attr(5) ""]}\ + { + set dis_value $fpart + } + } + default { + set length [string length $spart] + if {$length > $obj_attr($i)} \ + { + set end_no [expr $obj_attr($i) - 1] + set spart [string range $spart 0 $end_no] + } + + if {$tz == 0}\ + { + append dis_value $spart + set length [string length $spart] + set num_zero \ + [expr $obj_attr($i) - $length] + if { $num_zero >= 0}\ + { + for {set k 0} {$k < $num_zero} \ + {incr k}\ + { + append dis_value 0 + } + } + } elseif {$tz == 1} \ + { + append dis_value $spart + } + } + } + } + + default {} + } + } +} + +#============================================================================= +# Returns all the format objects +#============================================================================= +proc PB_fmt_RetFormatObjs { FMT_OBJ_LIST } { +#============================================================================= + upvar $FMT_OBJ_LIST fmt_obj_list + global post_object + + set fmt_obj_list $Post::($post_object,fmt_obj_list) +} + +#============================================================================= +# Returns the format names list +#============================================================================= +proc PB_fmt_GetFmtNameList { FMT_OBJ_LIST FMT_NAME_LIST } { +#============================================================================= + upvar $FMT_OBJ_LIST fmt_obj_list + upvar $FMT_NAME_LIST fmt_name_list + + foreach fmt_obj $fmt_obj_list \ + { + lappend fmt_name_list $format::($fmt_obj,for_name) + } + + if {![info exists fmt_name_list]} \ + { + set fmt_name_list "" + } +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_list.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_list.tcl new file mode 100644 index 0000000..6bf1726 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_list.tcl @@ -0,0 +1,127 @@ +############################################################################## +# Description # +# This file contains all functions dealing with the LISTFILE Object. # +# The definition file is read and the respective LISTFILE Objects are # +# created. All actions on the listfile page of the UI is mapped into the # +# respective functions in this file through the interface file. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 07-Apr-1999 mnb Removed puts # +# 02-Jun-1999 mnb Code Integration # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +#This procedure takes the list file block element object list and post object +#list as the input and the list file attributes are set according to the +#address names stored in the block element. The list file object is stored as +#the post object attribute. +#============================================================================= + +proc PB_lfl_AttrFromDef { BLK_OBJ POST_OBJ} { + upvar $BLK_OBJ blk_obj + upvar $POST_OBJ post_obj + + #Sets the list file object from post object. + set list_file_obj $Post::($post_obj,list_obj_list) + + #List file addresses are seperated from other addresses. + set blk_elem_obj_list $block::($blk_obj,elem_addr_list) + + foreach object $blk_elem_obj_list\ + { + #sets the address object from the block element object. + set add_obj $block_element::($object,elem_add_obj) + + #sets the address name. + set add_obj_name $address::($add_obj,add_name) + + #According to the address names the list file attributes are set. + switch $add_obj_name\ + { + LF_XABS {set ListingFile::($list_file_obj,x) 1} + LF_YABS {set ListingFile::($list_file_obj,y) 1} + LF_ZABS {set ListingFile::($list_file_obj,z) 1} + LF_AAXIS {set ListingFile::($list_file_obj,4axis) 1} + LF_BAXIS {set ListingFile::($list_file_obj,5axis) 1} + LF_FEED {set ListingFile::($list_file_obj,feed) 1} + LF_SPEED {set ListingFile::($list_file_obj,speed) 1} + } + } + + #The list file attributes are read and stored as the default value. + ListingFile::readvalue $list_file_obj obj_attr + ListingFile::DefaultValue $list_file_obj obj_attr + ListingFile::SetLfileBlockObj $list_file_obj blk_obj +} + +#=============================================================================== +#This function takes the object attributes and the updated LIST FILE object list +#as the input, creates the LIST FILE Object and returns the updated object list. +#We are creating only one list file object and the list will be having only one +#element. +#=============================================================================== + +proc PB_lfl_CreateLfileObj { OBJ_ATTR OBJ_LIST } { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [new ListingFile] + + #Appends object id to the object list. + lappend obj_list $object + + #sets the latest value to the object created. + ListingFile::setvalue_from_pui $object obj_attr + + #Sets the default value to the object. + ListingFile::readvalue $object obj_attr + ListingFile::DefaultValue $object obj_attr +# puts "The object is Created: $object " +} + + +#================================================================================= +#This procedure will take the LIST FILE Object as the input and returns the +#Default value stored in the object as the output. +#================================================================================= + +proc PB_lfl_DefLfileParams { OBJECT OBJ_ATTR } { + upvar $OBJECT object + upvar $OBJ_ATTR obj_attr + + #Sets the default value. + array set obj_attr $ListingFile::($object,def_value) +} + +#================================================================================= +#This procedure will take the LIST FILE Object as the input and returns the +#Restore value stored in the object as the output. +#================================================================================= + +proc PB_lfl_ResLfileParams { OBJECT OBJ_ATTR } { + upvar $OBJECT object + upvar $OBJ_ATTR obj_attr + + #Sets the resotre value. + array set obj_attr $ListingFile::($object,restore_value) +} + +#================================================================================= +#This procedure will take the LIST FILE Object as the input and returns the +#Restore value stored in the object as the output. +#================================================================================= + +proc PB_lfl_RetDisVars { OBJECT OBJ_ATTR } { + upvar $OBJECT object + upvar $OBJ_ATTR obj_attr + + #Reads and sets the latest value in the attribute array. + ListingFile::readvalue $object obj_attr +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_machine.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_machine.tcl new file mode 100644 index 0000000..5d38773 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_machine.tcl @@ -0,0 +1,91 @@ +############################################################################## +# Description # +# This file contains all functions dealing with the MACHINE TOOL Object. # +# The PUI File is read and the attributes are read and stored in the machine # +# tool object. All actions on the machine tool page of the UI is mapped into # +# the respective functions in this file through the interface file. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 02-Jun-1999 mnb Code Integration # +# 11-Jun-1999 mnb Added Parsing procedures for WordSeperator,End of Line # +# and Sequence Number # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +# This function returns all the kinematic variables defined in the pui +# file. +#============================================================================= + +#============================================================================= +proc PB_mach_RetMachineToolAttr { MOM_KIN_VAR_ARR } { +#============================================================================= + upvar $MOM_KIN_VAR_ARR mom_kin_var_arr + global post_object + + set mom_kin_var_list $Post::($post_object,mom_kin_var_list) + array set mom_kin_var_arr $mom_kin_var_list + + set Post::($post_object,def_mom_kin_var_list) $mom_kin_var_list + +} + +#============================================================================= +proc PB_mach_GetWordSep { file_obj } { +#============================================================================= + global post_object + + array set wordsep_arr $ParseFile::($file_obj,word_sep_list) + set file_name_list $ParseFile::($file_obj,file_list) + set file_name [lindex $file_name_list 0] + + set line [lindex $wordsep_arr($file_name,0,data) 0] + set temp_list [split $line \"] + set word_sep [lindex $temp_list 1] + + set Post::($post_object,word_sep) $word_sep + set Post::($post_object,def_word_sep) $word_sep +} + +#============================================================================= +proc PB_mach_GetEndOfLine { file_obj } { +#============================================================================= + global post_object + + array set endline_arr $ParseFile::($file_obj,end_line_list) + set file_name_list $ParseFile::($file_obj,file_list) + set file_name [lindex $file_name_list 0] + + set line [lindex $endline_arr($file_name,0,data) 0] + set temp_list [split $line \"] + set end_of_line [lindex $temp_list 1] + + set Post::($post_object,end_of_line) $end_of_line + set Post::($post_object,def_end_of_line) $end_of_line +} + +#============================================================================= +proc PB_mach_GetSequenceParams { file_obj } { +#============================================================================= + global post_object + + array set seqparam_arr $ParseFile::($file_obj,sequence_list) + set file_name_list $ParseFile::($file_obj,file_list) + set file_name [lindex $file_name_list 0] + + set line [lindex $seqparam_arr($file_name,0,data) 0] + PB_com_RemoveBlanks line + + set seq_param(block) [lindex $line 1] + set seq_param(start) [lindex $line 2] + set seq_param(increment) [lindex $line 3] + set seq_param(frequency) [lindex $line 4] + + set Post::($post_object,sequence_param) [array get seq_param] + set Post::($post_object,def_sequence_param) [array get seq_param] +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_mdfa.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_mdfa.tcl new file mode 100644 index 0000000..89a9632 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_mdfa.tcl @@ -0,0 +1,534 @@ +############################################################################## +# Description # +# This file contains all functions dealing with the MDFA. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 02-Jun-1999 mnb Code Integration # +# 07-Sep-1999 mnb Integrated MDFT with Post Builder # +# 21-Sep-1999 mnb Updates the Database # +# 13-Oct-1999 mnb Incorporated the changes of database # +# 26-Oct-1999 gsl Added use of UI_PB_com_CreateTransientWindow. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## +global env + +source $env(PB_DIR)/mdfa/main.tcl + +#=========================================================================== +# API for the Formats +#============================================================================ +proc PB_mdfc_CreateFormatObject { MDFA_FMT_OBJ_ATTR MDFA_FMT_LIST } { +#============================================================================ + upvar $MDFA_FMT_OBJ_ATTR mdfa_fmt_obj_attr + upvar $MDFA_FMT_LIST mdfa_fmt_list + + PB_fmt_CreateFmtObj mdfa_fmt_obj_attr mdfa_fmt_list +# puts "Format object is created [lrange $mdfa_fmt_list end end]" +} + +#=========================================================================== +# API for the Address +#=========================================================================== +proc PB_mdfc_CreateAddrObject { MDFA_ADD_OBJ_ATTR MDFA_FMT_LIST \ + MDFA_ADD_LIST } { +#=========================================================================== + upvar $MDFA_ADD_OBJ_ATTR mdfa_add_obj_attr + upvar $MDFA_FMT_LIST mdfa_fmt_list + upvar $MDFA_ADD_LIST mdfa_add_list + + PB_com_RetObjFrmName mdfa_add_obj_attr(1) mdfa_fmt_list ret_code + set mdfa_add_obj_attr(1) $ret_code + + PB_adr_CreateValidAdrObj mdfa_add_obj_attr mdfa_add_list +# puts "Address object created [lrange $mdfa_add_list end end]" +} + +#=========================================================================== +# API for the blocks +#=========================================================================== +proc PB_mdfa_CreateBlockObj { BLK_NAME BLK_ADD_LIST BLK_MOM_VAR \ + BLK_OPT_VAL MDFA_BLK_LIST MDFA_ADD_LIST} { +#=========================================================================== + upvar $BLK_NAME blk_name + upvar $BLK_ADD_LIST blk_add_list + upvar $BLK_MOM_VAR blk_mom_var + upvar $BLK_OPT_VAL blk_opt_val + upvar $MDFA_BLK_LIST mdfa_blk_list + upvar $MDFA_ADD_LIST mdfa_add_list + global post_object + + set blk_obj_attr(0) $blk_name + set no_blk_elems [llength $blk_add_list] + set blk_elem_list "" + + for {set count 0} {$count < $no_blk_elems} {incr count} \ + { + set blk_elem_obj_attr(0) [lindex $blk_add_list $count] + set blk_elem_obj_attr(1) [lindex $blk_mom_var $count] + set blk_elem_obj_attr(2) [lindex $blk_opt_val $count] + switch $blk_elem_obj_attr(2) \ + { + 0 { set blk_elem_obj_attr(2) "blank" } + 1 { set blk_elem_obj_attr(2) "opt" } + 2 { set blk_elem_obj_attr(2) "nows" } + 3 { set blk_elem_obj_attr(2) "both" } + default { set blk_elem_obj_attr(2) "blank" } + } + + switch $blk_elem_obj_attr(0)\ + { + "LF_ENUM" - "LF_XABS" - + "LF_YABS" - "LF_ZABS" - + "LF_AAXIS" - "LF_BAXIS" - + "LF_FEED" - + "LF_TIME" - + "LF_SPEED" { + PB_blk_RetLfileAddObjFromList blk_elem_obj_attr + set blk_elem_obj_attr(3) "" + set blk_elem_obj_attr(4) 0 + } + default { + PB_com_RetObjFrmName blk_elem_obj_attr(0) mdfa_add_list \ + ret_code + set blk_elem_obj_attr(0) $ret_code + + set addr_name $address::($blk_elem_obj_attr(0),add_name) + PB_blk_RetWordDescArr addr_name elem_word_desc \ + blk_elem_obj_attr(1) + set blk_elem_obj_attr(3) $elem_word_desc + set blk_elem_obj_attr(4) 0 + } + } + + PB_blk_CreateBlkElemObj blk_elem_obj_attr new_elem_obj blk_obj_attr + lappend blk_elem_list $new_elem_obj + unset blk_elem_obj_attr + } + + set blk_obj_attr(1) [llength $blk_elem_list] + set blk_obj_attr(2) $blk_elem_list + PB_blk_CreateBlkObj blk_obj_attr new_blk_obj + if { [string compare $blk_obj_attr(0) "comment_data"] != 0} \ + { + lappend mdfa_blk_list $new_blk_obj + } else \ + { + PB_lfl_AttrFromDef new_blk_obj post_object + } +# puts "BLOCK OBJ is Created $blk_obj_attr(0) $new_blk_obj" + unset blk_obj_attr +} + +############################################################################# +# MDFA IMPORT +############################################################################# + +#============================================================================ +proc PB_mdfa_ImportMdfa { } { +#============================================================================ + global paOption + global gPB + + set win $gPB(top_window).mdfa + + if { [winfo exists $win] } \ + { + $win popup + } else \ + { + tixFileSelectDialog $win -command "PB_mdfa_ParseMdfa $win" + + UI_PB_com_CreateTransientWindow $win "Import MDFA" "540x450+250+250" \ + "" "PB_mdfa_ImportDestroy $win" + $win popup + + # Sets the file box attributes + set file_box [$win subwidget fsbox] + $file_box config -pattern "*.mdfa" + set top_filter_ent [[$file_box subwidget filter] subwidget entry] + bind $top_filter_ent "PB_mdfa_ImportDlgFilter $win" + + # Sets the Action Button box attributes + set but_box [$win subwidget btns] + $but_box config -bg $paOption(butt_bg) -relief sunken + + destroy [$but_box subwidget help] + + #--------------------------------------------------------------------------- + # We need to re-claim the active window status, because a "destroy" command + # has been issued. That causes the current window to lose its active status. + #--------------------------------------------------------------------------- + UI_PB_com_ClaimActiveWindow $win + + [$but_box subwidget apply] config -width 10 -command "PB_mdfa_ImportDlgFilter $win" + [$but_box subwidget cancel] config -width 10 -command "PB_mdfa_ImportCancel_CB $win" + [$but_box subwidget ok] config -width 10 + } + + # Greyed out all saving options + UI_PB_GreyOutAllFileOpts +} + +#========================================================================= +proc PB_mdfa_ImportDlgFilter { dlg_id } { +#========================================================================= + set file_box [$dlg_id subwidget fsbox] + $file_box config -pattern "*.mdfa" + + # Updates the file listing box + UI_PB_UpdateFileListBox $dlg_id +} + +#========================================================================= +proc PB_mdfa_ImportDestroy { win } { +#========================================================================= + # Activates the open, new file opetions + UI_PB_EnableFileOptions +} + +#========================================================================= +proc PB_mdfa_ImportCancel_CB { win } { +#========================================================================= + $win popdown + + # Actives the file options + UI_PB_EnableFileOptions +} + +#========================================================================= +proc PB_mdfa_ParseMdfa { win mdfa_file_name } { +#========================================================================= + if { [string compare $mdfa_file_name ""] == 0 } \ + { + tk_messageBox -type ok -icon question \ + -message "File is not selected" + $win popup +return + } + + set extension [file extension $mdfa_file_name] + if { [string compare $extension ".mdfa"] != 0 } \ + { + tk_messageBox -type ok -icon warning \ + -message "Selected file is not a mdfa. Pick a mdfa file" + $win popup +return + } + + if [catch {open $mdfa_file_name r} mdfa_file] \ + { + tk_messageBox -type ok -icon error \ + -message "File \"$mdfa_file_name\" doesn't exists" + $win popup + } else \ + { + MDFT_translator $mdfa_file + PB_mdfa_CreateMdfaPost $mdfa_file_name + tkwait variable mdfa_file_name + + # Activates save, close & Save As options + UI_PB_ActivateOpenFileOpts + + # Unclaim active window status and release the grab + UI_PB_com_UnclaimActiveWindow $win + + global gPB + set gPB(session) NEW + } +} + +#============================================================================ +proc PB_mdfa_CreateMdfaFormats { FORMAT_VAR_DATA MDFA_FMT_LIST } { +#============================================================================ + upvar $FORMAT_VAR_DATA format_var_data + upvar $MDFA_FMT_LIST mdfa_fmt_list + + set final_indx [array size format_var_data] + set no_of_fmts [expr $final_indx/8] + + for {set count 0} {$count < $no_of_fmts } {incr count}\ + { + for {set no_attr 0} {$no_attr < 8 } {incr no_attr}\ + { + set fmt_obj_attr($no_attr) $format_var_data($count,$no_attr) + } + PB_mdfc_CreateFormatObject fmt_obj_attr mdfa_fmt_list + } +} + +#============================================================================ +proc PB_mdfa_CreateMdfaAddresses { ADDRESSES_NAMES ADDRESSES_VAR_DATA \ + MDFA_FMT_LIST MDFA_ADDR_LIST \ + MDFA_LFADDR_LIST } { +#============================================================================ + upvar $ADDRESSES_NAMES address_names + upvar $ADDRESSES_VAR_DATA addresses_var_data + upvar $MDFA_FMT_LIST mdfa_fmt_list + upvar $MDFA_ADDR_LIST mdfa_addr_list + upvar $MDFA_LFADDR_LIST mdfa_lfaddr_list + + set no_of_addr [array size address_names] + + for {set count 0} {$count < $no_of_addr } {incr count}\ + { + set add_name $address_names($count) + for {set no_of_attr 0} { $no_of_attr < 12 } { incr no_of_attr} \ + { + set addr_obj_attr($no_of_attr) $addresses_var_data($add_name,$no_of_attr) + } + PB_mdfc_CreateAddrObject addr_obj_attr mdfa_fmt_list mdfa_addr_list + unset addr_obj_attr + } + + PB_adr_SepBlkAndLFileAddLists mdfa_addr_list mdfa_lfaddr_list + PB_adr_CreateTextAddObj mdfa_addr_list mdfa_fmt_list +} + +#============================================================================ +proc PB_mdfa_CreateMdfaBlocks { BLOCK_NAMES BLOCK_TEMPLATE_DATA \ + MDFA_BLK_LIST MDFA_ADDR_LIST } { +#============================================================================ + upvar $BLOCK_NAMES block_names + upvar $BLOCK_TEMPLATE_DATA block_template_data + upvar $MDFA_BLK_LIST mdfa_blk_list + upvar $MDFA_ADDR_LIST mdfa_addr_list + + set no_of_blks [array size block_names] + for {set count 0} {$count < $no_of_blks} {incr count} \ + { + set blk_name $block_names($count) + set blk_add_list $block_template_data($blk_name,add_list) + set blk_mom_var $block_template_data($blk_name,var_list) + set blk_opt_val $block_template_data($blk_name,opt_list) + PB_mdfa_CreateBlockObj blk_name blk_add_list blk_mom_var \ + blk_opt_val mdfa_blk_list mdfa_addr_list + } +} + +#============================================================================ +proc PB_mdfa_OverwriteEventData { POST_OBJECT EVENT_NAMES \ + EVENT_TEMPLATE_DATA } { +#============================================================================ + global $POST_OBJECT post_object + global $EVENT_NAMES event_names + global $EVENT_TEMPLATE_DATA event_template_data + + set seq_list {prog_start oper_start tpth_ctrl tpth_mot \ + tpth_cycle oper_end prog_end} + + set mdfa_event_names [array names event_template_data] + foreach sequence $seq_list \ + { + append seq_evt_nam $sequence "_evt_list" + append seq_evt_blk_nam $sequence "_evt_blk_list" + + array set seq_evt_arr $Post::($post_object,$seq_evt_nam) + array set seq_evt_blk_arr $Post::($post_object,$seq_evt_blk_nam) + + set no_evts [array size seq_evt_arr] + for {set count 0} {$count < $no_evts} {incr count} \ + { + set event_name_list [split $seq_evt_arr($count)] + foreach elem $event_name_list \ + { + set new_elem [string tolower $elem] + lappend new_event_name $new_elem + } + set new_event_name [linsert $new_event_name 0 "MOM"] + set event_name [join $new_event_name _] + unset new_event_name + set exist_flag [lsearch $mdfa_event_names $event_name] + + if { $exist_flag == -1} \ + { + set seq_evt_blk_arr($count) "" + } else \ + { + set seq_evt_blk_arr($count) \ + $event_template_data($event_name) + } + } + set Post::($post_object,$seq_evt_nam) [array get seq_evt_arr] + set Post::($post_object,$seq_evt_blk_nam) [array get seq_evt_blk_arr] + unset seq_evt_nam seq_evt_blk_nam + unset seq_evt_arr seq_evt_blk_arr + } + set Post::($post_object,cyl_com_evt) "" + set Post::($post_object,cyl_evt_sh_com_evt) "" +} + +#============================================================================ +proc PB_mdfa_OverwriteKinVariables { KINEMATIC_VARIABLES } { +#============================================================================ + upvar $KINEMATIC_VARIABLES kinematic_variables + global mom_kin_var + global post_object + + foreach element [lsort [ array names kinematic_variables]]\ + { + set mom_kin_var($element) $kinematic_variables($element) + } + + set Post::($post_object,mom_kin_var_list) [array get mom_kin_var] + set Post::($post_object,def_mom_kin_var_list) [array get mom_kin_var] +} + +#============================================================================ +proc PB_mdfa_OverwriteSysVariables { SYSTEM_VAR_DATA } { +#============================================================================ + upvar $SYSTEM_VAR_DATA system_var_data + global mom_sys_arr + global post_object + + foreach element [lsort [ array names System_var_data]]\ + { + set mdfa_sys_var \$$element + set mom_sys_arr($mdfa_sys_var) $system_var_data($element) + } + set Post::($post_object,mom_sys_var_list) [array get mom_sys_arr] + set Post::($post_object,def_mom_sys_var_list) [array get mom_sys_arr] +} + +#============================================================================ +proc PB_mdfa_MiscProc { POST_OBJECT MDFA_FILE } { +#============================================================================ + upvar $POST_OBJECT post_object + upvar $MDFA_FILE mdfa_file + + # Listing File Objects +# set listfile_obj [new ListingFile] +# set Post::($post_object,list_obj_list) $listfile_obj +# set ListingFile::($listfile_obj,add_obj_list) "" +# set ListingFile::($listfile_obj,block_obj) "" + + set FileId FP1 + set parser_obj [new ParseFile $FileId] + set Post::($post_object,def_parse_obj) $parser_obj + set ParseFile::($parser_obj,file_list) $mdfa_file + set bef_com_data($mdfa_file) "" + set aft_com_data($mdfa_file) "" + set ParseFile::($parser_obj,bef_com_data_list) [array get bef_com_data] + set ParseFile::($parser_obj,aft_com_data_list) [array get aft_com_data] +} + +#============================================================================ +proc PB_mdfa_CreateMdfaPost { mdfa_file_name } { +#============================================================================ + global env + global post_object + global mach_type axisoption + + # MDFA variables + global Format_var_data + global Addresses_name + global Addresses_var_data + global block_names + global block_template_data + global event_names + global event_template_data + global obj_attr_kinematic_variables + global obj_attr_fly_variables + global System_var_data + global Word_Separator_var_data + global EOL_var_data + global Sequence_var_data + global ListObjectAttr + global ListObjectList + set pui_file_id FP2 + + # Gets Machine type and the axis type + PB_com_GetMachAxisType obj_attr_kinematic_variables \ + mach_type axisoption + set output_unit $obj_attr_kinematic_variables(mom_kin_output_unit) + set file_name pb_${mach_type}_${axisoption}_Generic_${output_unit} + + # Parses the default pui file based upon the machine type + set pui_file_name "$env(PB_HOME)/pblib/$file_name.pui" + PB_com_ReadPuiFile pui_file_name pui_file_id post_object + + # Word seperator + set Post::($post_object,word_sep) $Word_Separator_var_data + + # End of Block + set Post::($post_object,end_of_line) $EOL_var_data + + # Sequence Number block data + set Post::($post_object,sequence_param) [array get Sequence_var_data] + + # Creates MDFA format objects + PB_mdfa_CreateMdfaFormats Format_var_data mdfa_fmt_list + + # Creates MDFA Address objects + PB_mdfa_CreateMdfaAddresses Addresses_name Addresses_var_data \ + mdfa_fmt_list mdfa_addr_list mdfa_lfile_list + PB_adr_SortAddresses mdfa_addr_list + + # Stores the format object list as post object attribuite. + Post::SetObjListasAttr $post_object mdfa_fmt_list + + # Stores the address object list as post object attribuite. + Post::SetObjListasAttr $post_object mdfa_addr_list + ListingFile::SetLfileAddObjList $post_object mdfa_lfile_list + + # Creates the data for all the block elements. + Post::WordAddNamesSubNamesDesc $post_object + + # Sets the master sequence. + Post::SetDefMasterSequence $post_object mdfa_addr_list + + # Create mdfa block templates and store it in the post + # object + PB_mdfa_CreateMdfaBlocks block_names block_template_data \ + mdfa_blk_list mdfa_addr_list + Post::SetObjListasAttr $post_object mdfa_blk_list + + # Returns the display variables for the Block page. + PB_blk_RetDisVars mdfa_blk_list BlockNameList WordDescArray \ + post_object + + # Returns the display variables for the List File page. + set ListObjectList $Post::($post_object,list_obj_list) + PB_lfl_RetDisVars ListObjectList ListObjectAttr + + # Creates mdfa events & sequence + PB_mdfa_OverwriteEventData post_object event_names event_template_data + PB_seq_CreateSequences post_object + + # Temperary fix for listing file data + PB_mdfa_MiscProc post_object mdfa_file_name + + # Defines all the global variables for the ui + PB_int_DefineUIGlobVar + + # Overwrites the data of mom_sys_variables and kinematic + # variables + PB_mdfa_OverwriteSysVariables System_var_data + PB_mdfa_OverwriteKinVariables obj_attr_kinematic_variables + + # Sets the post output files + set dir [file dirname $mdfa_file_name] + if { $dir == "." } \ + { + set dir [pwd] + } + set file_name [file tail $mdfa_file_name] + set file_name [file rootname $file_name] + set pui_file $file_name.pui + set def_file $file_name.def + set tcl_file $file_name.tcl + PB_int_SetPostOutputFiles dir pui_file def_file tcl_file + + # Activates save, close & Save As options and deactivates + # open & close + UI_PB_ActivateOpenFileOpts + + UI_PB_main_window + update + AcceptMachineToolSelection +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_method.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_method.tcl new file mode 100644 index 0000000..fdca3ec --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_method.tcl @@ -0,0 +1,303 @@ +############################################################################## +# Description # +# This file contains the methods of all the classes. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 02-May-1999 mnb Added procedures, to parse a included files # +# 20-May-1999 mnb Improved parser # +# 02-Jun-1999 mnb Code Integration # +# 29-Jun-1999 mnb Better Parser # +# 07-Sep-1999 mnb Modified parser to handle both % and & formats # +# 13-Oct-1999 mnb Added def,tcl names to pui file # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================ +proc PB_mthd_ParseADefFile { SOURCE_FILE BEF_COM_DATA WORD_SEP_ARR \ + END_LINE_ARR SEQUENCE_ARR FORMAT_ARR \ + ADDRESS_ARR BLOCK_ARR AFT_COM_DATA ARR_SIZE} { +#============================================================================ + upvar $SOURCE_FILE source_file + upvar $BEF_COM_DATA bef_com_data + upvar $WORD_SEP_ARR word_sep_arr + upvar $END_LINE_ARR end_line_arr + upvar $SEQUENCE_ARR sequence_arr + upvar $FORMAT_ARR format_arr + upvar $ADDRESS_ARR address_arr + upvar $BLOCK_ARR block_arr + upvar $AFT_COM_DATA aft_com_data + upvar $ARR_SIZE arr_size + + set keyword_status 0 + set format_open_brace 0 + + set word_sep_index 0 + set end_line_index 0 + set seq_index 0 + set fmt_index 0 + set add_index 0 + set blk_index 0 + set formatting_flag 0 + + set FilePointer [open $source_file r] + set file_list [split $source_file //] + set file_name [lindex $file_list [expr [llength $file_list] -1]] + + while { [gets $FilePointer line] >= 0 } \ + { + if { [string match "*FORMATTING*" $line] == 1} \ + { + PB_mthd_StoreCommentData bef_com_data key_para file_name + set formatting_flag 1 + unset key_para + continue + } elseif { [string match "*INCLUDE*" $line] == 1} \ + { + set temp_line $line + PB_com_RemoveBlanks temp_line + foreach inc_file_name [lindex $temp_line 1] \ + { + PB_mthd_ParseADefFile inc_file_name bef_com_data word_sep_arr \ + end_line_arr sequence_arr format_arr \ + address_arr block_arr aft_com_data \ + arr_size + foreach inc_f_name $inc_file_name \ + { + lappend source_file $inc_f_name + } + } + } + + # Checks for Formatting key word + if {$formatting_flag} \ + { + if {!$keyword_status} \ + { + PB_mthd_CheckFormattingKeyWord line keyword_status + if {$keyword_status} \ + { + if {[info exists key_para]} \ + { + set text $key_para + unset key_para + } else \ + { + set text "" + } + } + } + + if {$keyword_status} \ + { + switch $keyword_status \ + { + 1 { + lappend key_para $line + PB_mthd_StoreKeyWordData key_para text word_sep_arr \ + word_sep_index file_name + unset key_para + unset text + set keyword_status 0 + } + + 2 { + lappend key_para $line + PB_mthd_StoreKeyWordData key_para text end_line_arr \ + end_line_index file_name + set keyword_status 0 + unset key_para + unset text + } + + 3 { + lappend key_para $line + PB_mthd_StoreKeyWordData key_para text sequence_arr \ + seq_index file_name + set keyword_status 0 + unset key_para + unset text + } + + 4 { + lappend key_para $line + PB_mthd_StoreKeyWordData key_para text format_arr \ + fmt_index file_name + incr fmt_index + set keyword_status 0 + unset key_para + unset text + } + + 5 { + PB_mthd_CheckOpenBracesInLine line open_flag + PB_mthd_CheckCloseBracesInLine line close_flag + lappend key_para $line + if {$close_flag} \ + { + PB_mthd_StoreKeyWordData key_para text address_arr \ + add_index file_name + incr add_index + set keyword_status 0 + unset key_para + unset text + } + } + + 6 { + PB_mthd_CheckOpenBracesInLine line open_flag + PB_mthd_CheckCloseBracesInLine line close_flag + lappend key_para $line + if {$close_flag} \ + { + PB_mthd_StoreKeyWordData key_para text block_arr \ + blk_index file_name + incr blk_index + set keyword_status 0 + unset key_para + unset text + } + } + } + } elseif {[string match "*\{*" $line]} \ + { + set format_open_brace 1 + continue + } elseif { [string match "*\}*" $line]} \ + { + set format_open_brace 0 + set formatting_flag 0 + if {[info exists key_para]} \ + { + unset key_para + } + continue + } + continue + } + lappend key_para $line + } + + PB_mthd_StoreCommentData aft_com_data key_para file_name + + set arr_size($file_name,format) $fmt_index + set arr_size($file_name,address) $add_index + set arr_size($file_name,block) $blk_index + close $FilePointer +} + +#============================================================================== +proc PB_mthd_StoreCommentData { ARR_VAR KEY_PARA FILE_NAME } { +#============================================================================== + upvar $ARR_VAR arr_var + upvar $KEY_PARA key_para + upvar $FILE_NAME file_name + + if {[info exists key_para]} \ + { + set arr_var($file_name) $key_para + } else \ + { + set arr_var($file_name) "" + } +} + +#============================================================================== +proc PB_mthd_CheckFormattingKeyWord { LINE KEYWORD_STATUS } { +#============================================================================== + upvar $LINE line + upvar $KEYWORD_STATUS keyword_status + + # Ignores the comments + if { [string match "*#*" $line] == 1 } { return } + + # Checks for the Key words inside the Formatting + if { [string match "*WORD_SEPARATOR*" $line] == 1} \ + { + set keyword_status 1 + } elseif { [string match "*END_OF_LINE*" $line] == 1 } \ + { + set keyword_status 2 + } elseif { [string match "*SEQUENCE*" $line] == 1} \ + { + set keyword_status 3 + } elseif { [string match "*FORMAT*" $line] == 1 }\ + { + set keyword_status 4 + } elseif { [string match "*ADDRESS*" $line] } \ + { + set keyword_status 5 + } elseif { [string match "*BLOCK_TEMPLATE*" $line]} \ + { + set keyword_status 6 + } +} + +#============================================================================== +proc PB_mthd_CheckOpenBracesInLine { LINE OPEN_FLAG } { +#============================================================================== + upvar $LINE line + upvar $OPEN_FLAG open_flag + set open_flag 0 + + if {[string match "*\{*" $line] == 1} \ + { + set open_flag 1 + } +} + +#============================================================================== +proc PB_mthd_CheckCloseBracesInLine { LINE CLOSE_FLAG } { +#============================================================================== + upvar $LINE line + upvar $CLOSE_FLAG close_flag + set close_flag 0 + + if {[string match "*\}*" $line] == 1} \ + { + set close_flag 1 + } +} + +#=========================================================================== +proc PB_mthd_StoreKeyWordData { KEY_PARA TEXT ARR_VAR INDEX FILE_NAME } { +#=========================================================================== + upvar $KEY_PARA key_para + upvar $TEXT text + upvar $ARR_VAR arr_var + upvar $INDEX index + upvar $FILE_NAME file_name + + set arr_var($file_name,$index,text) $text + set arr_var($file_name,$index,data) $key_para +} + +#======================================================================== +proc PB_mthd_DefFileInitParse { parse_obj file_name } { +#======================================================================== + PB_mthd_ParseADefFile file_name bef_com_data word_sep_arr end_line_arr \ + sequence_arr format_arr address_arr block_arr \ + aft_com_data arr_size + + foreach name $file_name \ + { + set file_list [split $name //] + set f_name [lindex $file_list [expr [llength $file_list] -1]] + lappend trunc_file_name $f_name + } + + set ParseFile::($parse_obj,bef_com_data_list) [array get bef_com_data] + set ParseFile::($parse_obj,word_sep_list) [array get word_sep_arr] + set ParseFile::($parse_obj,end_line_list) [array get end_line_arr] + set ParseFile::($parse_obj,sequence_list) [array get sequence_arr] + set ParseFile::($parse_obj,format_list) [array get format_arr] + set ParseFile::($parse_obj,address_list) [array get address_arr] + set ParseFile::($parse_obj,block_temp_list) [array get block_arr] + set ParseFile::($parse_obj,aft_com_data_list) [array get aft_com_data] + set ParseFile::($parse_obj,arr_size_list) [array get arr_size] + set ParseFile::($parse_obj,file_list) $trunc_file_name +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_output.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_output.tcl new file mode 100644 index 0000000..247c445 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_output.tcl @@ -0,0 +1,1317 @@ +############################################################################### +# # +# DESCRIPTION # +# create the def and event handler files from the post builder data base. # +# # +# REVISIONS # +# # +# REV DATE WHO PR REASON # +# 00 30Mar1999 MKG Initial # +# 01 14May1999 mnb Integrated with post builder # +# 02 20May1999 mnb Added event procedures # +# 03 02Jun1999 mnb Code Integration # +# 04 14Jun1999 mnb Added procedures to output WordSeperator, # +# End of Line and Sequence Number # +# 05 16Jun1999 mnb Changed Tcl output file name # +# 06 29Jun1999 mnb Added Composite Blocks # +# 07 30Jun1999 mnb Added ugpost_base.tcl procedures # +# 08 07Sep1999 mnb Changed % to & format # +# 09 13Oct1999 mnb Added API's for getting block element # +# modality & Event variables # # # +# $HISTORY$ # +############################################################################### + +#=========================================================================== +# API'S FOR CODE GENERATION +#=========================================================================== + +#=========================================================================== +# This proceduer returns the word Seperator +# +# Inputs : word seperator +# +# Output : Formatted word seperator +# +#=========================================================================== +proc PB_output_GetWordSeperator { word_sep WSP_OUTPUT } { +#=========================================================================== + upvar $WSP_OUTPUT wsp_output + + set wsp_output "WORD_SEPARATOR \"$word_sep\"" +} + +#=========================================================================== +# This proceduer returns the End of Line +# +# Inputs : end of line character +# +# Outputs : Formatted end of line +# +#=========================================================================== +proc PB_output_GetEndOfLine { end_of_line ENDLINE_OUTPUT } { +#=========================================================================== + upvar $ENDLINE_OUTPUT endline_output + + set endline_output "END_OF_LINE \"$end_of_line\"" +} + +#=========================================================================== +# This proceduer returns the sequence +# +# Inputs : An array which contains sequence block, +# start value, increment & frequencey. +# +# Outputs : Formatted Sequence +# +#=========================================================================== +proc PB_output_GetSequenceNumber { SEQ_PARAM SEQUENCE_OUTPUT } { +#=========================================================================== + upvar $SEQ_PARAM seq_param + upvar $SEQUENCE_OUTPUT sequence_output + + set sequence_output "SEQUENCE $seq_param(0) $seq_param(1) \ + $seq_param(2) $seq_param(3)" +} + +#=========================================================================== +# This proceduer returns the format name list and its format +# +# Inputs : Format Object list +# +# Outputs : Format Name list +# Format i.e & or % format +# +#=========================================================================== +proc PB_output_GetFmtObjAttr {FMT_OBJ_LIST FMT_NAME_ARR FMT_VAL_ARR} { +#=========================================================================== + upvar $FMT_OBJ_LIST fmt_obj_list + upvar $FMT_NAME_ARR fmt_name_arr + upvar $FMT_VAL_ARR fmt_val_arr + + set ind 0 + + foreach fmt_obj $fmt_obj_list\ + { + # Gets the format name + set fmt_name_arr($ind) $format::($fmt_obj,for_name) + format::readvalue $fmt_obj fmt_obj_attr + + # Gets the format + PB_fmt_RetFmtFrmAttr fmt_obj_attr for_value + set fmt_val_arr($ind) $for_value + incr ind + } +} + +#=========================================================================== +# This proceduer returns address names and the formatted address +# +# Inputs : Address object list +# +# Outputs : The address names are stored in the array adr_name_arr +# The formatted address in adr_val_arr +# +#=========================================================================== +proc PB_output_GetAdrObjAttr {ADD_OBJ_LIST ADR_NAME_ARR ADR_VAL_ARR} { +#=========================================================================== + upvar $ADD_OBJ_LIST add_obj_list + upvar $ADR_NAME_ARR adr_name_arr + upvar $ADR_VAL_ARR adr_val_arr + + set ind 0 + foreach adr_obj $add_obj_list\ + { + # Stores the address name in the array + set adr_name_arr($ind) $address::($adr_obj,add_name) + + # Gets the address object attributes + address::readvalue $adr_obj adr_obj_attr + + # Gets the formatted address + PB_adr_RetAddFrmAddAttr adr_obj_attr val_list + + set adr_val_arr($ind) $val_list + unset val_list + incr ind + } +} + +#=========================================================================== +# This proceduer returns the block name arr and the block templates +# +# Inputs : Block Object list +# +# Outputs : The names of block are stored in blk_name_arr +# The block templates are stored in blk_value_arr +# +#=========================================================================== +proc PB_output_GetBlkObjAttr {BLK_OBJ_LIST BLK_NAME_ARR BLK_VALUE_ARR} { +#=========================================================================== + upvar $BLK_OBJ_LIST blk_obj_list + upvar $BLK_NAME_ARR blk_name_arr + upvar $BLK_VALUE_ARR blk_value_arr + + set indx 0 + foreach block_obj $blk_obj_list\ + { + # Gets the block name + set blk_name_arr($indx) $block::($block_obj,block_name) + + # Gets the block object attributes + block::readvalue $block_obj blk_obj_attr + + # Gets the block template details + PB_blk_RetBlkFrmBlkAttr blk_obj_attr blk_value_list + + # Stores the template in the array + set blk_value_arr($indx) $blk_value_list + + unset blk_value_list + incr indx + } +} + +#=========================================================================== +# This proceduer returns all the composite blocks +#=========================================================================== +proc PB_output_GetCompositeBlks { COMP_BLK_LIST } { +#=========================================================================== + upvar $COMP_BLK_LIST comp_blk_list + global post_object + + set seq_obj_list $Post::($post_object,seq_obj_list) + lappend in_sequence [lindex $seq_obj_list 0] [lindex $seq_obj_list 1] \ + [lindex $seq_obj_list 5] [lindex $seq_obj_list 6] + + foreach seq_obj $in_sequence \ + { + set evt_obj_list $sequence::($seq_obj,evt_obj_list) + foreach evt_obj $evt_obj_list \ + { + set evt_elem_list $event::($evt_obj,evt_elem_list) + foreach evt_elem_row $evt_elem_list \ + { + set no_of_rowelem [llength $evt_elem_row] + if {$no_of_rowelem > 1} \ + { + set temp_event_name $event::($evt_obj,event_name) + set temp_event_name [string tolower $temp_event_name] + set temp_evt_name [join [split $temp_event_name " "] _ ] + set blk_obj_attr(0) $temp_evt_name + PB_int_GetAllBlockNames blk_name_list + PB_com_SetDefaultName blk_name_list blk_obj_attr + set comp_blk_elem "" + foreach evt_elem_obj $evt_elem_row \ + { + set block_obj $event_element::($evt_elem_obj,block_obj) + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + lappend comp_blk_elem $blk_elem_obj + } + } + UI_PB_com_ApplyMastSeqBlockElem comp_blk_elem + set blk_obj_attr(1) [llength $comp_blk_elem] + set blk_obj_attr(2) $comp_blk_elem + PB_blk_CreateBlkObj blk_obj_attr comp_blk_obj + lappend comp_blk_list $comp_blk_obj + # Sets the first event element name as the composite blocks + # name. It is not good.... something has to be done here. + set first_elem_obj [lindex $evt_elem_row 0] + set event_element::($first_elem_obj,evt_elem_name) \ + $blk_obj_attr(0) + } + } + } + } +} + +#=========================================================================== +proc PB_output_GetMomSysVars {MOM_SYS_NAME_ARR MOM_SYS_VAL_ARR} { +#=========================================================================== + upvar $MOM_SYS_NAME_ARR mom_sys_name_arr + upvar $MOM_SYS_VAL_ARR mom_sys_val_arr + + global post_object + + array set mom_sys_var_arr $Post::($post_object,mom_sys_var_list) + array set mom_sys_g_codes $Post::($post_object,g_codes) + array set mom_sys_m_codes $Post::($post_object,m_codes) + + # Gets all G-codes + set no_of_g_codes [array size mom_sys_g_codes] + set ind 0 + for {set count 0} { $count < $no_of_g_codes } {incr count} \ + { + set mom_sys_var $mom_sys_g_codes($count) + set mom_sys_name_arr($ind) [string trimleft $mom_sys_var \$] + set mom_sys_val_arr($ind) $mom_sys_var_arr($mom_sys_var) + incr ind + } + + # Gets all M-codes + set no_of_m_codes [array size mom_sys_m_codes] + for {set count 0} { $count < $no_of_m_codes } {incr count} \ + { + set mom_sys_var $mom_sys_m_codes($count) + set mom_sys_name_arr($ind) [string trimleft $mom_sys_var \$] + set mom_sys_val_arr($ind) $mom_sys_var_arr($mom_sys_var) + incr ind + } +} + +#=========================================================================== +proc PB_output_GetMomKinVars { KIN_NAME_ARR KIN_VAL_ARR } { +#=========================================================================== + upvar $KIN_NAME_ARR kin_name_arr + upvar $KIN_VAL_ARR kin_val_arr + + global post_object + set ind 0 + + array set mom_kin_var_arr $Post::($post_object,mom_kin_var_list) + set mom_kin_name_list [array names mom_kin_var_arr] + + foreach mom_kin_var $mom_kin_name_list\ + { + set kin_name_arr($ind) [string trimleft $mom_kin_var \$] + set kin_val_arr($ind) $mom_kin_var_arr($mom_kin_var) + incr ind + } +} + +#========================================================================= +# This proceduer returns the address of the block, whcih are to be +# forced before outputting the block. +# +# Outputs : A list of address, which are to be forced are stored +# in the array, with the block name as the index +# +#========================================================================= +proc PB_output_RetBlksModality { BLK_MOD_ARR } { +#========================================================================= + upvar $BLK_MOD_ARR blk_mod_arr + global post_object + + # Gets the blocks object list from the post object + set blk_obj_list $Post::($post_object,blk_obj_list) + + foreach blk_obj $blk_obj_list \ + { + # Returns the list of addresses to be forced + PB_blk_BlockModality blk_obj blk_mod_adds + + set block_name $block::($blk_obj,block_name) + set blk_mod_arr($block_name) $blk_mod_adds + } +} + +#========================================================================= +# This proceduer returns the event ui variables and their values +# +# Outputs : A list of ui event variables +# Value of the variable +# +#========================================================================= +proc PB_output_GetEventsVariables {EVENT_VAR_ARR EVENT_VALUE_ARR } { +#========================================================================= + upvar $EVENT_VAR_ARR event_var_arr + upvar $EVENT_VALUE_ARR event_value_arr + global post_object + + # mom_sys_arr + array set mom_sys_arr $Post::($post_object,mom_sys_var_list) + + # Gets all the sequence objects + set seq_obj_list $Post::($post_object,seq_obj_list) + + lappend out_sequence [lindex $seq_obj_list 2] [lindex $seq_obj_list 3] \ + [lindex $seq_obj_list 4] + unset seq_obj_list + + # Gets the mom variables of all the events + foreach seq_list $out_sequence \ + { + foreach seq_obj $seq_list \ + { + # Gets events of a sequence + set evt_obj_list $sequence::($seq_obj,evt_obj_list) + foreach evt_obj $evt_obj_list \ + { + # Gets the variables of an event + PB_evt_RetEventVars evt_obj evt_vars + + # Gets event name + set event_name $event::($evt_obj,event_name) + + # Stores the variables in the array, with event name + # as the index + set event_var_arr($event_name) $evt_vars + + # Stores the values of all the variables + foreach var $evt_vars \ + { + set event_value_arr($var) $mom_sys_arr($var) + } + } + } + } +} + +#========================================================================= +# This proceduer returns the event names and the list of the blocks +# that go with each event. +# +# Outputs : Event Name +# Event Blocks list +# +#========================================================================= +proc PB_output_GetEvtObjAttr { EVT_NAME_ARR EVT_BLK_ARR } { +#========================================================================= + upvar $EVT_NAME_ARR evt_name_list + upvar $EVT_BLK_ARR evt_blk_arr + + global post_object + + # Gets all the sequence objects + set seq_obj_list $Post::($post_object,seq_obj_list) + + lappend in_sequence [lindex $seq_obj_list 0] [lindex $seq_obj_list 1] \ + [lindex $seq_obj_list 5] [lindex $seq_obj_list 6] + + lappend out_sequence [lindex $seq_obj_list 2] [lindex $seq_obj_list 3] \ + [lindex $seq_obj_list 4] + unset seq_obj_list + lappend seq_obj_list $in_sequence $out_sequence + + set evt_name_list "" + foreach seq_list $seq_obj_list \ + { + foreach seq_obj $seq_list \ + { + # Gets events of a sequence + set evt_obj_list $sequence::($seq_obj,evt_obj_list) + foreach evt_obj $evt_obj_list \ + { + set evt_blk_name_list "" + set temp_event_name $event::($evt_obj,event_name) + set temp_event_name [string tolower $temp_event_name] + set temp_evt_name [join [split $temp_event_name " "] _ ] + append event_name MOM_ $temp_evt_name + + if { [lsearch $evt_name_list $event_name] == -1 } \ + { + lappend evt_name_list $event_name + } + + set evt_elem_list $event::($evt_obj,evt_elem_list) + foreach evt_elem_row $evt_elem_list \ + { + if { [llength $evt_elem_row] > 1} \ + { + set first_elem_obj [lindex $evt_elem_row 0] + lappend evt_blk_name_list \ + $event_element::($first_elem_obj,evt_elem_name) + } else \ + { + foreach evt_elem_obj $evt_elem_row \ + { + set block_obj $event_element::($evt_elem_obj,block_obj) + lappend evt_blk_name_list $block::($block_obj,block_name) + } + } + } + lappend evt_blk_arr($event_name) $evt_blk_name_list + unset event_name + } + } + } + PB_output_EliminatePbEvents evt_name_list evt_blk_arr +} + +#========================================================================= +# This proceduer removes the Post Builder events from the arrays +#========================================================================= +proc PB_output_EliminatePbEvents { EVT_NAME_LIST EVT_BLK_ARR } { +#========================================================================= + upvar $EVT_NAME_LIST evt_name_list + upvar $EVT_BLK_ARR evt_blk_arr + + # Post Builder events + set pb_events { "MOM_inch_/_metric_mode" "MOM_feedrate" \ + "MOM_cycle_set" } + + foreach event_name $pb_events \ + { + set evt_flag [lsearch $evt_name_list $event_name] + if { $evt_flag != -1 } \ + { + set evt_name_list [lreplace $evt_name_list $evt_flag \ + $evt_flag] + unset evt_blk_arr($event_name) + } + } +} + +#========================================================================= +# CODE GENERATION PROCEDURES +#========================================================================= + +#========================================================================= +# DEF file writing modules +#========================================================================= + +#========================================================================= +proc PB_PB2DEF_write_formats { FILE_ID FMT_NAME_ARR FMT_VAL_ARR } { +#========================================================================= + upvar $FILE_ID file_id + upvar $FMT_NAME_ARR fmt_name_arr + upvar $FMT_VAL_ARR fmt_val_arr + + puts $file_id "################ FORMAT DECLARATIONS #################" + set idxlist [array names fmt_name_arr] + foreach idx $idxlist \ + { + puts $file_id " FORMAT $fmt_name_arr($idx) $fmt_val_arr($idx)" + } +} + +#======================================================================== +proc PB_PB2DEF_write_addresses { FILE_ID ADR_NAME_ARR ADR_VAL_ARR } { +#======================================================================== + upvar $FILE_ID file_id + upvar $ADR_NAME_ARR adr_name_arr + upvar $ADR_VAL_ARR adr_val_arr + + puts $file_id "################ ADDRESS DECLARATIONS ################" + set idxlist [array names adr_name_arr] + + foreach idx $idxlist \ + { + puts $file_id " ADDRESS $adr_name_arr($idx) " + puts $file_id " \{" + set ii [llength $adr_val_arr($idx)] + for {set jj 0} {$jj < $ii} {incr jj} \ + { + puts $file_id " [lindex $adr_val_arr($idx) $jj]" + } + puts $file_id " \}\n" + } +} + +#======================================================================== +proc PB_PB2DEF_write_block_templates { FILE_ID BLK_NAME_ARR BLK_VAL_ARR } { +#======================================================================== + upvar $FILE_ID file_id + upvar $BLK_NAME_ARR blk_name_arr + upvar $BLK_VAL_ARR blk_val_arr + + puts $file_id "############ BLOCK TEMPLATE DECLARATIONS #############" + set idxlist [array names blk_name_arr] + + foreach idx $idxlist \ + { + puts $file_id " BLOCK_TEMPLATE $blk_name_arr($idx) " + puts $file_id " \{" + set ii [llength $blk_val_arr($idx)] + for {set jj 0} {$jj < $ii} {incr jj} \ + { + puts $file_id " [lindex $blk_val_arr($idx) $jj]" + } + puts $file_id " \}\n" + } +} + +#============================================================================ +proc PB_PB2DEF_main { PARSER_OBJ OUTPUT_DEF_FILE } { +#============================================================================ + upvar $PARSER_OBJ parser_obj + upvar $OUTPUT_DEF_FILE def_file + global post_object + + # Block, Address and Format object list + set fmt_obj_list $Post::($post_object,fmt_obj_list) + set add_obj_list $Post::($post_object,add_obj_list) + set blk_obj_list $Post::($post_object,blk_obj_list) + array set mom_sys_var $Post::($post_object,mom_sys_var_list) + array set mom_kin_var_arr $Post::($post_object,mom_kin_var_list) + + # Listing File Objects + set listfile_obj $Post::($post_object,list_obj_list) + set list_addr_obj_list $ListingFile::($listfile_obj,add_obj_list) + set list_blk_obj $ListingFile::($listfile_obj,block_obj) + + set file_list $ParseFile::($parser_obj,file_list) + array set bef_com_data $ParseFile::($parser_obj,bef_com_data_list) + array set aft_com_data $ParseFile::($parser_obj,aft_com_data_list) + + set file_name [lindex $file_list 0] + set before_formatting $bef_com_data($file_name) + set after_formatting $aft_com_data($file_name) + + set deff_id [open $def_file w+] + + foreach line $before_formatting \ + { + puts $deff_id $line + } + if { [llength $before_formatting] == 0 } \ + { + puts $deff_id "MACHINE $mom_kin_var_arr(mom_kin_machine_type)" + } + puts $deff_id " " + + puts $deff_id "FORMATTING" + puts $deff_id "\{" + + # Outputs the word seperator + PB_output_GetWordSeperator $mom_sys_var(Word_Seperator) word_sep + puts $deff_id " $word_sep" + + # Outputs the End of Block + PB_output_GetEndOfLine $mom_sys_var(End_of_Block) endof_line + puts $deff_id " $endof_line" + + # Outputs the Sequence Number + set seq_param_arr(0) $mom_sys_var(seqnum_block) + set seq_param_arr(1) $mom_sys_var(seqnum_start) + set seq_param_arr(2) $mom_sys_var(seqnum_incr) + set seq_param_arr(3) $mom_sys_var(seqnum_freq) + PB_output_GetSequenceNumber seq_param_arr sequence_num + puts $deff_id " $sequence_num" + puts $deff_id "" + + # Outputs the formats + PB_output_GetFmtObjAttr fmt_obj_list fmt_name_arr fmt_val_arr + PB_PB2DEF_write_formats deff_id fmt_name_arr fmt_val_arr + unset fmt_name_arr fmt_val_arr + puts $deff_id "" + + # Outputs the Address + PB_output_GetAdrObjAttr add_obj_list adr_name_arr adr_val_arr + PB_PB2DEF_write_addresses deff_id adr_name_arr adr_val_arr + unset adr_name_arr adr_val_arr + puts $deff_id "" + + # Outputs the Listing File Address + PB_output_GetAdrObjAttr list_addr_obj_list adr_name_arr adr_val_arr + PB_PB2DEF_write_addresses deff_id adr_name_arr adr_val_arr + if {[info exists adr_name_arr]} \ + { + unset adr_name_arr adr_val_arr + } + puts $deff_id "" + + # Outputs the Blocks + PB_output_GetBlkObjAttr blk_obj_list blk_name_arr blk_val_arr + PB_PB2DEF_write_block_templates deff_id blk_name_arr blk_val_arr + unset blk_name_arr blk_val_arr + + # Outputs the Composite Blocks + PB_output_GetCompositeBlks comp_blk_list + + if {[info exists comp_blk_list]} \ + { + PB_output_GetBlkObjAttr comp_blk_list blk_name_arr blk_val_arr + PB_PB2DEF_write_block_templates deff_id blk_name_arr blk_val_arr + unset blk_name_arr blk_val_arr + } + + # Outputs the Post Block + if {[info exists Post::($post_object,post_blk_list)]} \ + { + set post_blk_list $Post::($post_object,post_blk_list) + PB_output_GetBlkObjAttr post_blk_list blk_name_arr blk_val_arr + PB_PB2DEF_write_block_templates deff_id blk_name_arr blk_val_arr + unset blk_name_arr blk_val_arr + } + + # Outputs the Listing Block + PB_output_GetBlkObjAttr list_blk_obj blk_name_arr blk_val_arr + PB_PB2DEF_write_block_templates deff_id blk_name_arr blk_val_arr + if {[info exists blk_name_arr]} \ + { + unset blk_name_arr blk_val_arr + } + puts $deff_id "\}" + + foreach line $after_formatting \ + { + puts $deff_id $line + } + close $deff_id +} + +#========================================================================= +# TCL file writing modules +#========================================================================= +#============================================================================ +proc PB_PB2TCL_write_sys_var_arr { TCLF_ID } { +#============================================================================ + upvar $TCLF_ID tclf_id + + # Gets all the sys variables + PB_output_GetMomSysVars sys_name_arr sys_val_arr + + puts $tclf_id "########## SYSTEM VARIABLE DECLARATIONS ##############" + set idxlist [array names sys_name_arr] + foreach idx $idxlist \ + { + puts $tclf_id " set $sys_name_arr($idx) $sys_val_arr($idx)" + } +} + +#============================================================================ +proc PB_PB2TCL_write_kin_var_arr { TCLF_ID } { +#============================================================================ + upvar $TCLF_ID tclf_id + + PB_output_GetMomKinVars kin_name_arr kin_val_arr + puts $tclf_id "####### KINEMATIC VARIABLE DECLARATIONS ##############" + + set idxlist [array names kin_name_arr] + foreach idx $idxlist \ + { + puts $tclf_id " set $kin_name_arr($idx) $kin_val_arr($idx)" + } +} + +#========================================================================== +proc MY_PB_output_GetMomFlyVars {fly_name_arr fly_val_arr} { +#========================================================================== + upvar $fly_name_arr name $fly_val_arr val + + set name(0) "mom_fly_G_codes_per_block" + set val(0) 1 + set name(1) "mom_fly_M_codes_per_block" + set val(1) 1 + set name(2) "mom_fly_use_rapid_at_max_fpm" + set val(2) TRUE + set name(3) "mom_fly_work_plane_change" + set val(3) TRUE + set name(4) "mom_fly_spindle_axis" + set val(4) Z + set name(5) "mom_fly_cutcom_off_before_change" + set val(5) TRUE +} + +#====================================================================== +proc PB2TCL_read_fly_var {fly_name} { +#====================================================================== +# get fly variables; hardcoded in MY_PB_output_GetMomFlyVars + set fly_val "" + + MY_PB_output_GetMomFlyVars fly_name_arr fly_val_arr + set idxlist [array names fly_name_arr] + foreach idx $idxlist \ + { + if {$fly_name_arr($idx) == "$fly_name"} \ + { + set fly_val "$fly_val_arr($idx)" + break + } + } + return $fly_val +} + +#===================================================================== +proc PB_output_CycleSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + puts $tclf_id "#=============================================================" + puts $tclf_id "proc CYCLE_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global cycle_name mom_spindle_axis" + + switch [PB2TCL_read_fly_var mom_fly_spindle_axis] \ + { + + "X" {set spindle_axis 0} + "Y" {set spindle_axis 1} + default {set spindle_axis 2} + } + puts $tclf_id " if \{ \[info exists mom_spindle_axis \] == 0\} \{" + puts $tclf_id " set mom_spindle_axis $spindle_axis" + puts $tclf_id " \}" + puts $tclf_id " MOM_force once G_motion X Y Z R" + puts $tclf_id " if \{ \[string first DWELL \$cycle_name\] != -1 \} \{" + puts $tclf_id " MOM_force once cycle_dwell \}" + puts $tclf_id " if \{ \[string first NODRAG \$cycle_name\] != -1 \} \{" + puts $tclf_id " MOM_force once cycle_nodrag \}" + puts $tclf_id " if \{ \[string first DEEP \$cycle_name\]!= -1 \} \{" + puts $tclf_id " MOM_force once cycle_step \}" + puts $tclf_id " if \{ \[string first BREAK_CHIP \$cycle_name\] \ + != -1 \} \{" + puts $tclf_id " MOM_force once cycle_step" + puts $tclf_id " \}" + puts $tclf_id "\n\}" +} + +#===================================================================== +proc PB_output_CircleSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "\n" + puts $tclf_id "#=============================================================" + puts $tclf_id "proc CIRCLE_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global mom_pos_arc_plane" + puts $tclf_id " MOM_suppress off I J K" + puts $tclf_id " switch \$mom_pos_arc_plane \{" + puts $tclf_id " XY \{ MOM_suppress always K \}" + puts $tclf_id " YZ \{ MOM_suppress always I \}" + puts $tclf_id " ZX \{ MOM_suppress always J \}" + puts $tclf_id " \}" + puts $tclf_id "\}" + +} + +#===================================================================== +proc PB_output_CoolantSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "\n" + puts $tclf_id "#=============================================================" + puts $tclf_id "proc COOLANT_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global mom_coolant_status mom_coolant_mode" + puts $tclf_id " if \{ \$mom_coolant_status != \"OFF\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " set mom_coolant_status ON " + puts $tclf_id " \}" + puts $tclf_id " if \{ \$mom_coolant_status == \"ON\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " if \{ \$mom_coolant_mode != \"\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " set mom_coolant_status \$mom_coolant_mode " + puts $tclf_id " \}" + puts $tclf_id " \}" + puts $tclf_id "\}" +} + +#===================================================================== +proc PB_output_CutcomSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "\n" + puts $tclf_id "#=============================================================" + puts $tclf_id "proc CUTCOM_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global mom_cutcom_status mom_cutcom_mode" + puts $tclf_id " if \{ \$mom_cutcom_status != \"OFF\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " set mom_cutcom_status ON" + puts $tclf_id " \} " + puts $tclf_id " if \{ \$mom_cutcom_status == \"ON\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " if \{ \$mom_cutcom_mode != \"\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " set mom_cutcom_status \$mom_cutcom_mode" + puts $tclf_id " \}" + puts $tclf_id " \}" + puts $tclf_id "\}" +} + +#===================================================================== +proc PB_output_SpindleSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "\n" + puts $tclf_id "#=============================================================" + puts $tclf_id "proc SPINDLE_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global mom_spindle_status mom_spindle_mode" + puts $tclf_id " if \{ \$mom_spindle_status != \"OFF\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " set mom_spindle_status ON" + puts $tclf_id " \}" + + puts $tclf_id " if \{ \$mom_spindle_status == \"ON\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " if \{ \$mom_spindle_mode != \"\" \} \\" + puts $tclf_id " \{" + puts $tclf_id " set mom_spindle_status \$mom_spindle_mode" + puts $tclf_id " \}" + puts $tclf_id " \}" + puts $tclf_id "\}" +} + +#===================================================================== +proc PB_output_OpskipSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "\n" + puts $tclf_id "#=============================================================" + puts $tclf_id "proc OPSKIP_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global mom_opskip_status mom_sys_opskip_code" + puts $tclf_id " switch \$mom_opskip_status \\" + puts $tclf_id " \{" + puts $tclf_id " ON \{ " + puts $tclf_id " MOM_set_line_leader always \ + \$mom_sys_opskip_code" + puts $tclf_id " \}" + puts $tclf_id " default \{" + puts $tclf_id " MOM_set_line_leader off \ + \$mom_sys_opskip_code" + puts $tclf_id " \}" + puts $tclf_id " \}" + puts $tclf_id "\}" +} + +#===================================================================== +proc PB_output_RapidSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "\n" + puts $tclf_id "#=============================================================" + puts $tclf_id "proc RAPID_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global mom_spindle_axis " + puts $tclf_id " global mom_pos mom_last_z_pos " + puts $tclf_id " global spindle_first" + + if {[PB2TCL_read_fly_var mom_fly_work_plane_change] == "TRUE"} \ + { + switch [PB2TCL_read_fly_var mom_fly_spindle_axis] \ + { + "X" {set spindle_axis 0} + "Y" {set spindle_axis 1} + default {set spindle_axis 2} + } + puts $tclf_id " if \{ \[info exists mom_spindle_axis\] == 0\} \\" + puts $tclf_id " \{" + puts $tclf_id " set mom_spindle_axis $spindle_axis" + puts $tclf_id " \}" + puts $tclf_id " if \{ \$mom_pos(\$mom_spindle_axis) > \ + \$mom_last_z_pos\}\\" + puts $tclf_id " \{" + puts $tclf_id " set spindle_first TRUE" + puts $tclf_id " \} else \\" + puts $tclf_id " \{" + puts $tclf_id " set spindle_first FALSE" + puts $tclf_id " \}" + } else { + puts $tclf_id " set spindle_first NONE" + } + puts $tclf_id "\}" +} + +#===================================================================== +proc PB_output_SeqnoSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "\n" + puts $tclf_id "#=============================================================" + puts $tclf_id "proc SEQNO_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global mom_sequence_mode mom_sequence_number" + puts $tclf_id " global mom_sequence_increment mom_sequence_frequency" + + puts $tclf_id " if \{ \[info exists mom_sequence_mode\] \} \\" + puts $tclf_id " \{" + puts $tclf_id " switch \$mom_sequence_mode \\" + puts $tclf_id " \{" + puts $tclf_id " OFF \{" + puts $tclf_id " MOM_set_seq_off" + puts $tclf_id " \}" + puts $tclf_id " ON \{" + puts $tclf_id " MOM_set_seq_on" + puts $tclf_id " \}" + puts $tclf_id " default \{" + puts $tclf_id " MOM_output_literal \"error: \ + mom_sequence_mode unknown\" " + puts $tclf_id " \}" + puts $tclf_id " \}" + puts $tclf_id " \} else \\" + puts $tclf_id " \{" + puts $tclf_id " MOM_reset_sequence \$mom_sequence_number \\" + puts $tclf_id " \$mom_sequence_increment \$mom_sequence_frequency" + puts $tclf_id " \}" + puts $tclf_id "\}" +} + +#===================================================================== +proc PB_output_ModeSet { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "\n" + puts $tclf_id "#=============================================================" + puts $tclf_id "proc MODES_set \{ \} \{" + puts $tclf_id "#=============================================================" + puts $tclf_id " global mom_output_mode" + puts $tclf_id " switch \$mom_output_mode \\" + puts $tclf_id " \{ " + puts $tclf_id " ABSOLUTE \{" + puts $tclf_id " set isincr OFF" + puts $tclf_id " \}" + puts $tclf_id " default \{" + puts $tclf_id " set isincr ON" + puts $tclf_id " \}" + puts $tclf_id " \}" + puts $tclf_id " MOM_incremental \$isincr X Y Z" + puts $tclf_id "\}" +} + +#===================================================================== +proc PB_PB2TCL_write_tcl_procs { TCLF_ID } { +#===================================================================== + upvar $TCLF_ID tclf_id + + puts $tclf_id "############## EVENT HANDLING SECTION ################" + + # outputs all the general procedures + PB_output_CycleSet tclf_id + PB_output_CircleSet tclf_id + PB_output_CoolantSet tclf_id + PB_output_CutcomSet tclf_id + PB_output_SpindleSet tclf_id + PB_output_OpskipSet tclf_id + PB_output_RapidSet tclf_id + PB_output_SeqnoSet tclf_id + PB_output_ModeSet tclf_id + + # get event attributes for writing event procs; + # hardcoded in MY_PB_output_GetEvtObjAttr" + PB_output_GetEvtObjAttr evt_name_list evt_blk_arr + + # Gets event variables & modality of block addresses + PB_output_RetBlksModality blk_mod_arr + PB_output_GetEventsVariables event_var_arr event_value_arr + + foreach event_name $evt_name_list \ + { + PB_output_GetEventProcData event_name evt_blk_arr($event_name) \ + event_output + PB_PB2TCL_write_event_procs tclf_id event_output + unset event_output + } +} + +#=============================================================================== +proc PB_PB2TCL_write_event_procs { TCLF_ID EVENT_OUTPUT } { +#=============================================================================== + upvar $TCLF_ID tclf_id + upvar $EVENT_OUTPUT event_output + + foreach line $event_output \ + { + puts $tclf_id "$line" + } +} + +#=============================================================================== +proc PB_output_DefaultDataAEvent { EVT_NAME EVENT_OUTPUT } { +#=============================================================================== + upvar $EVENT_OUTPUT event_output + upvar $EVT_NAME evt_name + + switch $evt_name \ + { + MOM_drill_text - + MOM_drill - + MOM_drill_dwell - + MOM_drill_counter_sink - + MOM_drill_csink_dwell - + MOM_drill_deep - + MOM_drill_break_chip - + MOM_tap - + MOM_bore - + MOM_bore_dwell - + MOM_bore_drag - + MOM_bore_no_drag - + MOM_bore_back - + MOM_bore_manual - + MOM_bore_manual_dwell { lappend event_output " global cycle_name" + append event_move $evt_name _move + set cycle_name [string toupper \ + [string trimleft $evt_name MOM_]] + lappend event_output " set cycle_name $cycle_name" + lappend event_output " CYCLE_set" + lappend event_output "\}" + lappend event_output "\n" + lappend event_output "#=============================================================" + lappend event_output "proc $event_move \{ \} \{" + lappend event_output "#=============================================================" + unset event_move + } + MOM_circular_move { + lappend event_output " CIRCLE_set" + } + MOM_initial_move { lappend event_output " global mom_feed_rate " + lappend event_output " global mom_feed_rate_per_rev" + lappend event_output " global mom_kin_max_fpm" + lappend event_output " global mom_motion_type " + lappend event_output " global in_sequence " + lappend event_output " set in_sequence none" + lappend event_output " MOM_force once G_motion X Y Z" + } + MOM_linear_move { lappend event_output " global mom_feed_rate " + lappend event_output " global mom_feed_rate_per_rev" + lappend event_output " global mom_kin_max_fpm" + if {[PB2TCL_read_fly_var \ + mom_fly_use_rapid_at_max_fpm] == "TRUE"} \ + { + lappend event_output " if \{ \$mom_feed_rate >= \ + \$mom_kin_max_fpm \} \\" + lappend event_output " \{" + lappend event_output " MOM_rapid_move " + lappend event_output " return" + lappend event_output " \}" + } + } + MOM_coolant_on - + MOM_cutcom_on - + MOM_spindle_rpm - + MOM_spindle_css { lappend event_output " global in_sequence" + switch $evt_name { + MOM_spindle_rpm - + MOM_spindle_css {lappend event_output " \ + SPINDLE_set"} + } + } + MOM_tool_change { + lappend event_output " global in_sequence" + } + MOM_opskip {lappend event_output " OPSKIP_set"} + MOM_rapid_move {lappend event_output " global spindle_first" + lappend event_output " RAPID_set" + } + MOM_sequence_number {lappend event_output " SEQNO_set"} + MOM_set_modes {lappend event_output " MODES_set"} + MOM_start_of_program {lappend event_output " global in_sequence" + lappend event_output " global mom_logname" + lappend event_output " global mom_date" + lappend event_output " set in_sequence \ + start_of_program" + lappend event_output "#*** The following procedure \ + opens the warning and listing files" + lappend event_output " OPEN_files" + lappend event_output "#*** The following procedure \ + lists the header information in commentary dat" + lappend event_output " LIST_FILE_HEADER" + lappend event_output " MOM_output_literal \ + \"(############################################)\"" + lappend event_output " MOM_output_literal \"(# Created By : \ + \$mom_logname) \"" + lappend event_output " MOM_output_literal \"(# Creation Date: \ + \$mom_date)\"" + lappend event_output " MOM_output_literal \ + \"(############################################)\"" + } + MOM_start_of_path {lappend event_output " global in_sequence " + lappend event_output " set in_sequence start_of_path" + } + } + + switch $evt_name \ + { + MOM_coolant_on - + MOM_coolant_off { + lappend event_output " COOLANT_set" + } + MOM_cutcom_on { + if {[PB2TCL_read_fly_var \ + mom_fly_cutcom_off_before_change] == "TRUE"} { + lappend event_output " global mom_cutcom_status" + lappend event_output " if \{ \$mom_cutcom_status != \"SAME\"\} \\" + lappend event_output " \{" + lappend event_output " global mom_sys_cutcom_code" + lappend event_output " MOM_output_literal \ + \$mom_sys_cutcom_code(OFF) " + lappend event_output " \}" + } + lappend event_output " CUTCOM_set" + } + } +} + +#=============================================================================== +proc PB_output_BlockOfAEvent { EVT_NAME STMT EVENT_OUTPUT jj } { +#=============================================================================== + upvar $EVT_NAME evt_name + upvar $STMT stmt + upvar $EVENT_OUTPUT event_output + + # 1=uppercase found: a proc name, else block template name + set isupper [regexp {^[A-Z]+} $stmt] ; + switch $isupper \ + { + 1 {" $stmt"} + default \ + { + switch $evt_name \ + { + MOM_coolant_on - + MOM_cutcom_on - + MOM_spindle_rpm - + MOM_tool_change - + MOM_spindle_css { + switch $jj \ + { + 0 {lappend event_output " if \{ \$in_sequence \ + != \"none\" \} \{ \ + MOM_do_template $stmt \}"} + 1 {lappend event_output " if \{ \$in_sequence \ + == \"none\" \} \{\ + MOM_do_template $stmt \}"} + } + } + MOM_rapid_move { + # set template($icnt) $stmt + # incr icnt + } + MOM_start_of_program { + + if {$stmt == "literal4"} {lappend event_output " \ + MOM_suppress once N"} + lappend event_output " MOM_do_template $stmt" + } + MOM_initial_move { + if {$stmt == "spindle_start"} { + lappend event_output " MOM_force once G_motion \ + X Y Z G M_spin M_cool S T H"} + lappend event_output " MOM_do_template $stmt" + } + default {lappend event_output " MOM_do_template $stmt"} + } + } + } +} + +#=============================================================================== +proc PB_output_GetEventProcData { EVT_NAME EVT_VAL EVENT_OUTPUT } { +#=============================================================================== + upvar $EVT_NAME evt_name + upvar $EVT_VAL evt_val + upvar $EVENT_OUTPUT event_output + + lappend event_output "\n" + lappend event_output "#=============================================================" + lappend event_output "proc $evt_name \{ \} \{" + lappend event_output "#=============================================================" + + # Outputs the default data of a event + PB_output_DefaultDataAEvent evt_name event_output + + set no_of_lists [llength $evt_val] + for {set jj 0} {$jj < $no_of_lists} {incr jj} \ + { + set sublist [lindex $evt_val $jj] + set ii [llength $sublist] + set stmt [lindex $sublist 0] + + if {$stmt == "MOM_force" || $stmt == "MOM_suppress"} \ + { + lappend event_output " $sublist" + } else \ + { + for {set kk 0} {$kk < $ii} {incr kk} \ + { + set stmt [lindex $sublist $kk] + PB_output_BlockOfAEvent evt_name stmt event_output $jj + } + } + } + + switch $evt_name \ + { + MOM_rapid_move { + set blk_name_list [lindex $evt_val 0] + if {[llength $blk_name_list] == 1} \ + { + lappend event_output " MOM_do_template \ + [lindex $blk_name_list 0]" + } else { + lappend event_output " if \{ \$spindle_first == \ + \"TRUE\" \} \\" + lappend event_output " \{" + lappend event_output " MOM_do_template \ + [lindex $blk_name_list 0]" + lappend event_output " MOM_do_template \ + [lindex $blk_name_list 1]" + lappend event_output " \} elseif \{ \ + \$spindle_first == \"FALSE\"\}\\" + lappend event_output " \{" + lappend event_output " MOM_do_template \ + [lindex $blk_name_list 0]" + lappend event_output " MOM_do_template \ + [lindex $blk_name_list 1]" + lappend event_output " \} else \\" + lappend event_output " \{ " + lappend event_output " MOM_do_template\ + [lindex $blk_name_list 0]" + lappend event_output " \}" + } + } + MOM_initial_move { + if {[PB2TCL_read_fly_var mom_fly_use_rapid_at_max_fpm] \ + == "TRUE"} { + lappend event_output " if \{ \$mom_feed_rate >= \ + \$mom_kin_max_fpm \} \\" + lappend event_output " \{" + lappend event_output " MOM_rapid_move" + lappend event_output " return" + lappend event_output " \}" + } + lappend event_output " if \{ \$mom_motion_type == \ + \"RAPID\" \} \\" + lappend event_output " \{" + lappend event_output " MOM_rapid_move " + lappend event_output " \} else \\" + lappend event_output " \{" + lappend event_output " MOM_linear_move " + lappend event_output " \}" + } + MOM_end_of_program { + lappend event_output "#**** The following procedure \ + lists the tool list with time in commentary data" + lappend event_output " LIST_FILE_TRAILER" + lappend event_output "#**** The following procedure \ + closes the warning and listing files" + lappend event_output " CLOSE_files" + } + } + lappend event_output "\}" +} + +#============================================================================ +proc PB_PB2TCL_main { OUTPUT_TCL_FILE } { +#============================================================================ + upvar $OUTPUT_TCL_FILE tcl_file + global log_data + + set tclf_id [open $tcl_file w] + + puts $tclf_id "############ TCL FILE ######################################" + puts $tclf_id "# USER AND DATE STAMP" + puts $tclf_id "############################################################" + puts $tclf_id "" + puts $tclf_id " set cam_post_dir \[MOM_ask_env_var UGII_CAM_POST_DIR\]" + puts $tclf_id "# source \${cam_post_dir}mom_debug.tcl" + puts $tclf_id "# source \${cam_post_dir}mom_review.tcl" + puts $tclf_id "# MOM_set_debug_mode ON" + puts $tclf_id " source \${cam_post_dir}ugpost_base.tcl" + puts $tclf_id "" + + PB_PB2TCL_write_sys_var_arr tclf_id + + puts $tclf_id "" + + PB_PB2TCL_write_kin_var_arr tclf_id + + puts $tclf_id "" + + puts $tclf_id "" + + PB_PB2TCL_write_tcl_procs tclf_id + + close $tclf_id +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_proc_parser.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_proc_parser.tcl new file mode 100644 index 0000000..c4f10c5 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_proc_parser.tcl @@ -0,0 +1,60 @@ +############################################################################## +# Description # +# This file contains all functions dealing with parsing a TCL file # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 naveen Initial # +# 07-jun-1999 mnb Added Event Handler parser proceduers # +# 28-jun-1999 mnb Tcl file is opened in read mode only # +# 13-Oct-1999 mnb Phase 20 Integration. # +# # +# $HISTORY$ # +# # +############################################################################## + +#=============================================================================== +proc PB_pps_ParseTclFile { EVENT_PROC_DATA } { +#=============================================================================== + upvar $EVENT_PROC_DATA event_proc_data + global post_object + global env + + Post::ReadPostFiles $post_object dir def_file tcl_file + set tcl_file_name $dir/$tcl_file + set tcl_fid [open $tcl_file_name r] + + set proc_strt 0 + while { [gets $tcl_fid line] >= 0 }\ + { + if { [string match "*proc*" $line] == 1 && \ + [string match "*MOM*" $line] == 1 } \ + { + set proc_strt 1 + set temp_line $line + PB_com_RemoveBlanks temp_line + + set event_name [lindex $temp_line 1] + unset temp_line + lappend proc_data $prev_line + + } elseif { $proc_strt == 1 && \ + [string compare "\}" $line] == 0} \ + { + set proc_strt 2 + lappend proc_data $line + } + + if { $proc_strt == 1} \ + { + lappend proc_data $line + } elseif { $proc_strt == 2} \ + { + set event_proc_data($event_name) $proc_data + unset proc_data + set proc_strt 0 + } + set prev_line $line + } +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_pui_parser.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_pui_parser.tcl new file mode 100644 index 0000000..d46e9a6 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_pui_parser.tcl @@ -0,0 +1,1088 @@ +############################################################################## +# Description # +# This file contains the procedure which parses the PUI file and # +# creates and stores the data in the appropriate object. Each section of # +# the PUI file is marked and the data lying between the markers are stored # +# into the appropriate objects. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 03-May-1999 mnb Improved Parser # +# 02-Jun-1999 mnb Code Integration # +# 14-Jun-1999 mnb Made Correction to pui output # +# 29-Jun-1999 mnb Added Composite blocks # +# 07-Sep-1999 mnb Changed event ui data format stored in the pui file # +# 21-Sep-1999 mnb Added Modality attributes to pui file # +# 13-Oct-1999 mnb Reads & Writes the def & tcl file names from pui file. # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +#There is only one procedure inthis file. This procedure contains switch +#statements accoring to the markers set inside the PUI file. For each of the +#condition, varibles are initialized for the start and end of the markers. +#The FILE object and the POST objects are given as the input and after the +#parsing is done the valus are stored as attributes of POST object or passed +#into other procedures for storing them in the appropriate object. +#============================================================================= + +#============================================================================= +proc PB_pui_ReadPuiCreateObjs {OBJECT POST_OBJ} { +#============================================================================= + upvar $OBJECT object + upvar $POST_OBJ post_obj + + #Initializes the value for variables set for each markers in the PUI file. + set event_handler 0 + set list_file_start 0 + set kinematic_var_start 0 + set master_sequence_start 0 + set gcode_start 0 + set mcode_start 0 + set glob_sequence_start 0 + set evt_ui_start 0 + set mom_sys_var_start 0 + set comp_blk_start 0 + set blk_mod_start 0 + + set cycle_evt_start 0 + set cycle_com_evt_start 0 + set cycle_share_evt_start 0 + + set sequence_start 0 + set sequence_word_status_start 0 + + set prog_start_seq 0 + set oper_start_seq 0 + set tool_path_seq 0 + set tpth_ctrl_seq 0 + set tpth_mot_seq 0 + set tpth_cycle_seq 0 + set oper_end_seq 0 + set prog_end_seq 0 + set index 0 + + #Reads the PUI file and sets the start variable corresponding to each marker. + while { [gets $File::($object,FilePointer) line] >= 0 }\ + { + set line_length [string length $line] + set last_char_test [string index $line [expr $line_length - 1]] + + if {[string compare $last_char_test \\] == 0}\ + { + set line_with_space [string range $line 0 [expr $line_length - 2]] + append temp_line [string trimleft $line_with_space " "] + continue + } elseif {[info exists temp_line]}\ + { + append temp_line [string trimleft $line " "] + set line $temp_line + unset temp_line + } + + switch $line\ + { + "## POST EVENT HANDLER START" { + set event_handler 1 + continue + } + "## POST EVENT HANDLER END" { + set event_handler 0 + set pui_file_name $File::($object,FileName) + set pui_dir [file dirname $pui_file_name] + Post::SetPostFiles $post_obj pui_dir post_files + unset post_files + continue + } + + "## LISTING FILE START" { + set list_file_start 1 + continue + } + "## LISTING FILE END" { + set list_file_start 0 + PB_lfl_CreateLfileObj obj_attr obj_list + Post::ListFileObject $post_obj obj_list + unset obj_attr + continue + } + "## KINEMATIC VARIABLES START" { + set kinematic_var_start 1 + continue + } + "## KINEMATIC VARIABLES END" { + set kinematic_var_start 0 + set Post::($post_obj,mom_kin_var_list) \ + [array get mom_kin_var] + set Post::($post_obj,def_mom_kin_var_list) \ + [array get mom_kin_var] + continue + } + "## GCODES START" { + set gcode_start 1 + set gcd_ind 0 + continue + } + "## GCODES END" { + set gcode_start 0 + + #Initializes the g_codes + Post::InitG-Codes $post_obj g_codes g_codes_desc + continue + } + "## MCODES START" { + set mcode_start 1 + set mcd_ind 0 + continue + } + "## MCODES END" { + set mcode_start 0 + + #Initializes the m_codes + Post::InitM-Codes $post_obj m_codes m_codes_desc + + continue + } + "## MASTER SEQUENCE START" { + set master_sequence_start 1 + set msq_indx 0 + continue + } + "## MASTER SEQUENCE END" { + set master_sequence_start 0 + + #Calls method inside the POST class for + #initializing master sequence. + Post::InitMasterSequence $post_obj msq_add_name \ + msq_word_param + + continue + } + "## CYCLE EVENT START" { + set cycle_evt_start 1 + continue + } + "## CYCLE EVENT END" { + set cycle_evt_start 0 + continue + } + "## BLOCK MODALITY START" { + set blk_mod_start 1 + continue + } + "## BLOCK MODALITY END" { + if {[info exists blk_mod_arr]} \ + { + set Post::($post_obj,blk_mod_list) \ + [array get blk_mod_arr] + } else \ + { + set Post::($post_obj,blk_mod_list) "" + } + set blk_mod_start 0 + continue + } + "## COMPOSITE BLOCKS START" { + set comp_blk_start 1 + continue + } + "## COMPOSITE BLOCKS END" { + set comp_blk_start 0 + continue + } + "## SEQUENCE START" { + set glob_sequence_start 1 + continue + } + "## SEQUENCE END" { + set glob_sequence_start 0 + continue + } + "## EVENTS USER INTERFACE START" { + set evt_ui_start 1 + set inx 0 + continue + } + "## EVENTS USER INTERFACE END" { + set evt_ui_start 0 + set Post::($post_obj,ui_evt_name_lis) \ + [array get ui_evt_name_arr] + set Post::($post_obj,ui_evt_itm_grp_mem_lis) \ + [array get ui_evt_itm_grp_mem_arr] + continue + } + "## MOM SYS VARIABLES START" { + set mom_sys_var_start 1 + set add_mom_indx 0 + continue + } + "## MOM SYS VARIABLES END" { + set mom_sys_var_start 0 + set Post::($post_obj,add_name_list) \ + [array get add_name_list] + set Post::($post_obj,add_mom_var_list) \ + [array get add_mom_var_list] + set add_mom_indx 0 + continue + } + } + + # Case for Event Handlers + if { $event_handler} \ + { + PB_com_RemoveBlanks line + set file_type [lindex $line 0] + set file_name [lindex $line 1] + + switch $file_type \ + { + def_file { set post_files(def_file) $file_name } + tcl_file { set post_files(tcl_file) $file_name } + } + } + + #Case for List File attributes setting. + if {$list_file_start}\ + { + PB_com_RemoveBlanks line + set Name [lindex $line 0] + set Value [lindex $line 1] + switch $Name\ + { + Listfileflag {set obj_attr(listfile) $Value} + Listfilename {set obj_attr(fname) $Value} + Listfileflag_head {set obj_attr(head) $Value} + Listfilelines {set obj_attr(lines) $Value} + Listfilecolumn {set obj_attr(column) $Value} + Listfileflag_oper {set obj_attr(oper) $Value} + Listfileflag_tool {set obj_attr(tool) $Value} + Listfileflag_start_path {set obj_attr(start_path) $Value} + Listfileflag_tool_chng {set obj_attr(tool_chng) $Value} + Listfileflag_end_path {set obj_attr(end_path) $Value} + Listfileflag_oper_time {set obj_attr(oper_time) $Value} + Listfileflag_setup_time {set obj_attr(setup_time) $Value} + } + } + + #Case for kinematic variables for MACHINE TOOL. + if {$kinematic_var_start}\ + { + #Sets mom sys variables. + set mom_kin_var([lindex $line 0]) [lindex $line 1] + } + + #Case for G-Codes attributes + if {$gcode_start}\ + { + set g_codes($gcd_ind) [lindex $line 0] + set g_codes_desc($gcd_ind) [lindex $line 1] + incr gcd_ind + } + + #Case for M-Codes attributes + if {$mcode_start}\ + { + set m_codes($mcd_ind) [lindex $line 0] + set m_codes_desc($mcd_ind) [lindex $line 1] + incr mcd_ind + } + + #Case for MASTER SEQUENCE attributes. + if {$master_sequence_start}\ + { + lappend msq_add_name [lindex $line 0] + lappend msq_param [lindex $line 1] [lindex $line 2] [lindex $line 3] + set msq_word_param([lindex $line 0]) $msq_param + unset msq_param + incr msq_indx + } + + # Case for Blocks Modality + if {$blk_mod_start}\ + { + set blk_mod_arr([lindex $line 0]) [lindex $line 1] + } + + # Case for Composite Blocks + if {$comp_blk_start} \ + { + set Post::($post_obj,comp_blk_list) $line + } + + # Case for Cycle Events + if {$cycle_evt_start} \ + { + # Cases for common block and cycle block which share the + # the common blocks. + switch $line \ + { + "#Cycle Common Block Start" { + set cycle_com_evt_start 1 + continue + } + "#Cycle Common Block End" { + set cycle_com_evt_start 0 + set Post::($post_obj,cyl_com_evt) \ + $cycle_common_evt + continue + } + "#Cycle Block Share Common Block Start" { + set cycle_share_evt_start 1 + continue + } + "#Cycle Block Share Common Block End" { + set cycle_share_evt_start 0 + set Post::($post_obj,cyl_evt_sh_com_evt) \ + $cycle_shared_evts + continue + } + } + + if {$cycle_com_evt_start} \ + { + set cycle_common_evt $line + } + + if {$cycle_share_evt_start} \ + { + set cycle_shared_evts $line + } + } + + #Case for SEQUENCE OBJECT attributes. + if {$glob_sequence_start}\ + { + #Cases for program start, operation start, tool path, operation end + #and program end sequences. + switch $line\ + { + "#Program Start Sequence Start" { + set prog_start_seq 1 + continue + } + "#Program Start Sequence End" { + set prog_start_seq 0 + + #Sets events for program start sequence + #as post object attribute. + set Post::($post_obj,prog_start_evt_list) \ + [array get evt_name_arr] + + #Sets blocks of events for program start + #sequence as post object attribute. + set Post::($post_obj,prog_start_evt_blk_list) \ + [array get evt_blk_arr] + + unset evt_name_arr + unset evt_blk_arr + continue + } + "#Operation Start Sequence Start" { + set oper_start_seq 1 + set index 0 + continue + } + "#Operation Start Sequence End" { + set oper_start_seq 0 + + #Sets events for operation start sequence + #as post object attribute. + set Post::($post_obj,oper_start_evt_list) \ + [array get evt_name_arr] + + #Sets blocks of events for operation start + #sequence as post object attribute. + set Post::($post_obj,oper_start_evt_blk_list) \ + [array get evt_blk_arr] + + unset evt_name_arr + unset evt_blk_arr + continue + } + "##Tool Path Start" { + set tool_path_seq 1 + continue + } + "##Tool Path End" { + set tool_path_seq 0 + continue + } + "#Operation End Sequence Start" { + set oper_end_seq 1 + set index 0 + continue + } + "#Operation End Sequence End" { + set oper_end_seq 0 + + #Sets events for operation end sequence + #as post object attribute. + set Post::($post_obj,oper_end_evt_list) \ + [array get evt_name_arr] + + #Sets blocks of events for operation end + #sequence as post object attribute. + set Post::($post_obj,oper_end_evt_blk_list) \ + [array get evt_blk_arr] + + unset evt_name_arr + unset evt_blk_arr + continue + } + "#Program End Sequence Start" { + set prog_end_seq 1 + set index 0 + continue + } + "#Program End Sequence End" { + set prog_end_seq 0 + + #Sets events for program end sequence + #as post object attribute. + set Post::($post_obj,prog_end_evt_list) \ + [array get evt_name_arr] + + #Sets blocks of events for program end + #sequence as post object attribute. + set Post::($post_obj,prog_end_evt_blk_list) \ + [array get evt_blk_arr] + + unset evt_name_arr + unset evt_blk_arr + continue + } + } + + #Start setting SEQUENCES. + if {$prog_start_seq}\ + { + #Sets Program Start Sequences. + set evt_name_arr($index) [lindex $line 0] + set evt_blk_arr($index) [lindex $line 1] + incr index + } elseif {$oper_start_seq}\ + { + #Sets Operation Start Sequences. + set evt_name_arr($index) [lindex $line 0] + set evt_blk_arr($index) [lindex $line 1] + incr index + } elseif {$tool_path_seq}\ + { + #Case for Tool Path control functions, motions and cycles. + switch $line\ + { + "#Control Functions Start" { + set tpth_ctrl_seq 1 + set index 0 + continue + } + "#Control Functions End" { + set tpth_ctrl_seq 0 + + #Sets control events for tool path sequence + #as post object attribute. + set Post::($post_obj,tpth_ctrl_evt_list) \ + [array get evt_name_arr] + + #Sets control events blocks for tool path + #sequence as post object attribute. + set Post::($post_obj,tpth_ctrl_evt_blk_list) \ + [array get evt_blk_arr] + + unset evt_name_arr + unset evt_blk_arr + continue + } + "#Motions Start" { + set tpth_mot_seq 1 + set index 0 + continue + } + "#Motions End" { + set tpth_mot_seq 0 + + #Sets motion events for tool path sequence + #as post object attribute. + set Post::($post_obj,tpth_mot_evt_list) \ + [array get evt_name_arr] + + #Sets motion events blocks for tool path + #sequence as post object attribute. + set Post::($post_obj,tpth_mot_evt_blk_list) \ + [array get evt_blk_arr] + + unset evt_name_arr + unset evt_blk_arr + continue + } + "#Cycles Start" { + set tpth_cycle_seq 1 + set index 0 + continue + } + "#Cycles End" { + set tpth_cycle_seq 0 + + #Sets cylce events for tool path sequence + #as post object attribute. + set Post::($post_obj,tpth_cycle_evt_list) \ + [array get evt_name_arr] + + #Sets cylce events blocks for tool path + #sequence as post object attribute. + set Post::($post_obj,tpth_cycle_evt_blk_list) \ + [array get evt_blk_arr] + + unset evt_name_arr + unset evt_blk_arr + continue + } + } + + #Start seting Tool Path SEQUENCES. + if {$tpth_ctrl_seq}\ + { + #Sets Tool Path Control function Sequences. + set evt_name_arr($index) [lindex $line 0] + set evt_blk_arr($index) [lindex $line 1] + incr index + } elseif {$tpth_mot_seq}\ + { + #Sets Tool Path Motion Sequences. + set evt_name_arr($index) [lindex $line 0] + set evt_blk_arr($index) [lindex $line 1] + incr index + } elseif {$tpth_cycle_seq}\ + { + #Sets Tool Path Cycle Sequences. + set evt_name_arr($index) [lindex $line 0] + set evt_blk_arr($index) [lindex $line 1] + incr index + } + + } elseif {$oper_end_seq}\ + { + #Sets Operation End Sequences + set evt_name_arr($index) [lindex $line 0] + set evt_blk_arr($index) [lindex $line 1] + incr index + } elseif {$prog_end_seq}\ + { + #Sets Program End Sequences + set evt_name_arr($index) [lindex $line 0] + set evt_blk_arr($index) [lindex $line 1] + incr index + } + } + + #Case for events User Interface creation. + if {$evt_ui_start}\ + { + set ui_evt_name_arr($inx) [lindex $line 0] + set ui_evt_itm_grp_mem_arr($inx) [lrange $line 1 end] + incr inx + } + + #Case for MOM SYS VARIABLES. + if {$mom_sys_var_start}\ + { + # Sets mom sys variables of all addresses. + set add_name_list($add_mom_indx) [lindex $line 0] + set add_mom_var_list($add_mom_indx) [lrange $line 1 end] + incr add_mom_indx + } + } +} + +#============================================================================= +proc PB_pui_WritePuiFile { OUTPUT_PUI_FILE } { +#============================================================================= + upvar $OUTPUT_PUI_FILE pui_file + global post_object + + set puifid [open "$pui_file" w] + + puts $puifid "#########################################################################" + puts $puifid "# #" + puts $puifid "# This is the POST UI FILE used to read and write the parameters #" + puts $puifid "# associated with a spedific post processor. #" + puts $puifid "# #" + puts $puifid "# WARNING: The Syntax of the file should not be changed!!! #" + puts $puifid "# #" + puts $puifid "#########################################################################" + puts $puifid "\n" + + # Post File Names + Post::ReadPostOutputFiles $post_object dir out_pui_file def_file tcl_file + + puts $puifid "## POST EVENT HANDLER START" + puts $puifid "def_file $def_file" + puts $puifid "tcl_file $tcl_file" + puts $puifid "## POST EVENT HANDLER END" + puts $puifid "\n" + + # Listing file data + set listfile_obj $Post::($post_object,list_obj_list) + PB_pui_WriteListingFileData puifid listfile_obj + + # Kinematic variables + array set mom_kin_var $Post::($post_object,mom_kin_var_list) + PB_pui_WriteKinematicVariables puifid mom_kin_var + + # G-codes + array set g_codes $Post::($post_object,g_codes) + array set g_codes_desc $Post::($post_object,g_codes_desc) + puts $puifid "## GCODES START" + PB_pui_WriteGMCodes puifid g_codes g_codes_desc + puts $puifid "## GCODES END\n" + + # M-codes + array set m_codes $Post::($post_object,m_codes) + array set m_codes_desc $Post::($post_object,m_codes_desc) + puts $puifid "## MCODES START" + PB_pui_WriteGMCodes puifid m_codes m_codes_desc + puts $puifid "## MCODES END\n" + + # Master Sequence + set add_obj_list $Post::($post_object,add_obj_list) + PB_pui_WriteMasterSeqData puifid add_obj_list + + # Common cycle events & cycle shared events + set cyl_com_evt $Post::($post_object,cyl_com_evt) + set cyl_sh_com_evt $Post::($post_object,cyl_evt_sh_com_evt) + PB_pui_WriteCycleComSharedEvts puifid cyl_com_evt cyl_sh_com_evt + + # Block Element Modality + set blk_obj_list $Post::($post_object,blk_obj_list) + PB_pui_WriteBlockModality puifid blk_obj_list + + # Composite blocks + PB_pui_WriteCompositeBlks puifid + + # Sequence events + set seq_obj_list $Post::($post_object,seq_obj_list) + PB_pui_WriteSeqEvents puifid seq_obj_list + + # Events user interface + PB_pui_WriteEventUIData puifid seq_obj_list + + # Mom sys variables of all address + array set add_name_list $Post::($post_object,add_name_list) + array set word_desc_arr $Post::($post_object,word_desc_array) + array set word_mom_var $Post::($post_object,word_mom_var) + array set mom_var_arr $Post::($post_object,mom_sys_var_list) + + PB_pui_WriteMOMVariables puifid add_name_list word_desc_arr \ + word_mom_var mom_var_arr + close $puifid +} + +#======================================================================== +proc PB_pui_WriteListingFileData { PUIFID LISTFILE_OBJ } { +#======================================================================== + upvar $PUIFID puifid + upvar $LISTFILE_OBJ listfile_obj + + ListingFile::readvalue $listfile_obj obj_attr + set arr_names [array names obj_attr] + + puts $puifid "## LISTING FILE START" + foreach var_name $arr_names \ + { + switch $var_name\ + { + "listfile" {puts $puifid "[format "%-30s %s" Listfileflag \ + $obj_attr(listfile)]"} + "fname" {puts $puifid "[format "%-30s %s" Listfilename \ + $obj_attr(fname)]"} + "head" {puts $puifid "[format "%-30s %s" Listfileflag_head \ + $obj_attr(head)]"} + "lines" {puts $puifid "[format "%-30s %s" Listfilelines \ + $obj_attr(lines)]"} + "column" {puts $puifid "[format "%-30s %s" Listfilecolumn \ + $obj_attr(column)]"} + "oper" {puts $puifid "[format "%-30s %s" Listfileflag_oper \ + $obj_attr(oper)]"} + "tool" {puts $puifid "[format "%-30s %s" Listfileflag_tool \ + $obj_attr(tool)]"} + "start_path" {puts $puifid "[format "%-30s %s" Listfileflag_start_path \ + $obj_attr(start_path)]"} + "tool_chng" {puts $puifid "[format "%-30s %s" Listfileflag_tool_chng \ + $obj_attr(tool_chng)]"} + "end_path" {puts $puifid "[format "%-30s %s" Listfileflag_end_path \ + $obj_attr(end_path)]"} + "oper_time" {puts $puifid "[format "%-30s %s" Listfileflag_oper_time \ + $obj_attr(oper_time)]"} + "setup_time" {puts $puifid "[format "%-30s %s" Listfileflag_setup_time \ + $obj_attr(setup_time)]"} + } + } + puts $puifid "## LISTING FILE END\n" +} + +#======================================================================== +proc PB_pui_WriteKinematicVariables { PUIFID MOM_KIN_VAR } { +#======================================================================== + upvar $PUIFID puifid + upvar $MOM_KIN_VAR mom_kin_var + + set arr_names [array names mom_kin_var] + + puts $puifid "## KINEMATIC VARIABLES START" + foreach kin_var $arr_names \ + { + puts $puifid "[format "%-40s %s" $kin_var $mom_kin_var($kin_var)]" + } + puts $puifid "## KINEMATIC VARIABLES END\n" +} + +#======================================================================== +proc PB_pui_WriteGMCodes { PUIFID CODE_VAR CODE_DESC } { +#======================================================================== + upvar $PUIFID puifid + upvar $CODE_VAR code_var + upvar $CODE_DESC code_desc + + set no_of_codes [array size code_var] + + for {set count 0} {$count < $no_of_codes} {incr count} \ + { + puts $puifid "[format "%-40s %s" \"$code_var($count)\" \ + \"$code_desc($count)\"]" + } +} + +#======================================================================== +proc PB_pui_WriteMasterSeqData { PUIFID ADD_OBJ_LIST } { +#======================================================================== + upvar $PUIFID puifid + upvar $ADD_OBJ_LIST add_obj_list + + puts $puifid "## MASTER SEQUENCE START" + foreach add_obj $add_obj_list \ + { + set add_name $address::($add_obj,add_name) + address::readMseqAttr $add_obj mseq_attr + puts $puifid "[format "%-15s %s %d %s" $add_name \ + \"$mseq_attr(0)\" $mseq_attr(1) \"$mseq_attr(2)\"]" + unset mseq_attr + } + puts $puifid "## MASTER SEQUENCE END\n" +} + +#======================================================================== +proc PB_pui_WriteCycleComSharedEvts { PUIFID CYL_COM_EVT CYL_SH_COM_EVT } { +#======================================================================== + upvar $PUIFID puifid + upvar $CYL_COM_EVT cyl_com_evt + upvar $CYL_SH_COM_EVT cyl_sh_com_evt + + puts $puifid "## CYCLE EVENT START" + + puts $puifid "#Cycle Common Block Start" + foreach evt_name $cyl_com_evt \ + { + puts $puifid "\{$evt_name\}" + } + puts $puifid "#Cycle Common Block End\n" + + puts $puifid "#Cycle Block Share Common Block Start" + puts $puifid "\{ \\" + foreach evt_name [lindex $cyl_sh_com_evt 0] \ + { + puts $puifid " \{$evt_name\} \\" + } + puts $puifid "\}" + puts $puifid "#Cycle Block Share Common Block End" + + puts $puifid "## CYCLE EVENT END\n" +} + +#======================================================================== +proc PB_pui_WriteBlockModality { PUIFID BLK_OBJ_LIST } { +#======================================================================== + upvar $PUIFID puifid + upvar $BLK_OBJ_LIST blk_obj_list + + puts $puifid "## BLOCK MODALITY START" + foreach blk_obj $blk_obj_list \ + { + block::readvalue $blk_obj blk_obj_attr + set blk_mod_add_list "" + foreach blk_elem_obj $blk_obj_attr(2) \ + { + block_element::readvalue $blk_elem_obj blk_elem_obj_attr + if { $blk_elem_obj_attr(4) } \ + { + lappend blk_mod_add_list $address::($blk_elem_obj_attr(0),add_name) + } + unset blk_elem_obj_attr + } + if { $blk_mod_add_list != "" } \ + { + puts $puifid "[format "%-30s" \{$blk_obj_attr(0)\}] \{$blk_mod_add_list\}" + } + unset blk_obj_attr blk_mod_add_list + } + puts $puifid "## BLOCK MODALITY END\n" +} + +#======================================================================== +proc PB_pui_WriteCompositeBlks { PUIFID } { +#======================================================================== + upvar $PUIFID puifid + + PB_output_GetCompositeBlks comp_blk_list + + puts $puifid "## COMPOSITE BLOCKS START" + + if { [info exists comp_blk_list] } \ + { + foreach blk_obj $comp_blk_list \ + { + lappend comp_blk_name_list $block::($blk_obj,block_name) + } + puts $puifid "\{$comp_blk_name_list\}" + } else \ + { + puts $puifid "\{\}" + } + puts $puifid "## COMPOSITE BLOCKS END\n" +} + +#======================================================================== +proc PB_pui_WriteSeqEvents { PUIFID SEQ_OBJ_LIST } { +#======================================================================== + upvar $PUIFID puifid + upvar $SEQ_OBJ_LIST seq_obj_list + + set no_seqs [llength $seq_obj_list] + puts $puifid "## SEQUENCE START" + for {set count 0} {$count < $no_seqs} {incr count} \ + { + PB_pui_WriteSeqHeader puifid count + set seq_obj [lindex $seq_obj_list $count] + PB_pui_WriteEventAndBlks puifid seq_obj + PB_pui_WriteSeqFooter puifid count + } + puts $puifid "## SEQUENCE END\n" +} +#======================================================================== +proc PB_pui_WriteSeqHeader { PUIFID INDEX } { +#======================================================================== + upvar $PUIFID puifid + upvar $INDEX index + + switch $index \ + { + 0 { + puts $puifid "#Program Start Sequence Start" + } + 1 { + puts $puifid "#Operation Start Sequence Start" + } + 2 { + puts $puifid "##Tool Path Start" + puts $puifid "#Control Functions Start" + } + 3 { + puts $puifid "#Motions Start" + } + 4 { + puts $puifid "#Cycles Start" + } + 5 { + puts $puifid "#Operation End Sequence Start" + } + 6 { + puts $puifid "#Program End Sequence Start" + } + } +} + +#======================================================================== +proc PB_pui_WriteEventAndBlks { PUIFID SEQ_OBJ } { +#======================================================================== + upvar $PUIFID puifid + upvar $SEQ_OBJ seq_obj + + set seq_events_list $sequence::($seq_obj,evt_obj_list) + + foreach evt_obj $seq_events_list \ + { + set evt_blk_list "" + set event_name $event::($evt_obj,event_name) + set evt_elem_list $event::($evt_obj,evt_elem_list) + foreach row_elem_list $evt_elem_list \ + { + foreach elem_obj $row_elem_list \ + { + set blk_obj $event_element::($elem_obj,block_obj) + lappend row_blk_list $block::($blk_obj,block_name) + } + + if {[info exists row_blk_list]} \ + { + lappend evt_blk_list $row_blk_list + unset row_blk_list + } + } + puts $puifid "[format "%-25s %s" \{$event_name\} \{$evt_blk_list\}]" + } +} + +#======================================================================== +proc PB_pui_WriteSeqFooter { PUIFID INDEX } { +#======================================================================== + upvar $PUIFID puifid + upvar $INDEX index + + switch $index \ + { + 0 { + puts $puifid "#Program Start Sequence End\n" + } + 1 { + puts $puifid "#Operation Start Sequence End\n" + } + 2 { + puts $puifid "#Control Functions End\n" + } + 3 { + puts $puifid "#Motions End\n" + } + 4 { + puts $puifid "#Cycles End" + puts $puifid "##Tool Path End\n" + } + 5 { + puts $puifid "#Operation End Sequence End\n" + } + 6 { + puts $puifid "#Program End Sequence End" + } + } +} + +#======================================================================== +proc PB_pui_WriteEventUIData { PUIFID SEQ_OBJ_LIST } { +#======================================================================== + upvar $PUIFID puifid + upvar $SEQ_OBJ_LIST seq_obj_list + + puts $puifid "## EVENTS USER INTERFACE START" + foreach seq_obj $seq_obj_list \ + { + set seq_events_list $sequence::($seq_obj,evt_obj_list) + foreach evt_obj $seq_events_list \ + { + set evt_item_obj_list $event::($evt_obj,evt_itm_obj_list) + if {[string compare $evt_item_obj_list ""] == 0} \ + { + continue + } + + puts $puifid "\{$event::($evt_obj,event_name)\} \\" + set no_items [llength $evt_item_obj_list] + set item_no 1 + foreach item_obj $evt_item_obj_list \ + { + item::readvalue $item_obj item_obj_attr + puts $puifid " \{\{\"$item_obj_attr(0)\" $item_obj_attr(1) \ + $item_obj_attr(2)\} \\" + set grp_no 1 + foreach grp_obj $item_obj_attr(3) \ + { + item_group::readvalue $grp_obj grp_obj_attr + puts $puifid " \{\{\"$grp_obj_attr(0)\" $grp_obj_attr(1) \ + $grp_obj_attr(2)\} \\" + + set mem_no 1 + foreach mem_obj $grp_obj_attr(3) \ + { + group_member::readvalue $mem_obj mem_obj_attr + if {[llength $mem_obj_attr(5)] > 1} \ + { + append tmp_3mem_out "\{$mem_obj_attr(5)\}" + } else \ + { + append tmp_3mem_out "$mem_obj_attr(5)" + } + set mem_output " \{\"$mem_obj_attr(0)\" $mem_obj_attr(1) \ + $mem_obj_attr(2) $mem_obj_attr(3) $mem_obj_attr(4) $tmp_3mem_out\}" + unset tmp_3mem_out + + if {$mem_no == $grp_obj_attr(1)} \ + { + append temp_mem_output $mem_output "\}" + set mem_output $temp_mem_output + unset temp_mem_output + } + + if {$mem_no == $grp_obj_attr(1) && \ + $grp_no == $item_obj_attr(1)} \ + { + append temp_mem_output $mem_output "\}" + set mem_output $temp_mem_output + unset temp_mem_output + } + + if {$mem_no == $grp_obj_attr(1) && $item_no == $no_items \ + && $grp_no == $item_obj_attr(1)} \ + { + puts $puifid " $mem_output" + } else \ + { + puts $puifid " $mem_output \\" + } + incr mem_no + unset mem_obj_attr + } + incr grp_no + unset grp_obj_attr + } + incr item_no + unset item_obj_attr + } + } + } + puts $puifid "## EVENTS USER INTERFACE END\n" +} + + +#======================================================================== +proc PB_pui_WriteMOMVariables { PUIFID ADD_NAME_LIST WORD_DESC_ARR \ + WORD_MOM_VAR MOM_VAR_ARR } { +#======================================================================== + upvar $PUIFID puifid + upvar $ADD_NAME_LIST add_name_list + upvar $WORD_DESC_ARR word_desc_arr + upvar $WORD_MOM_VAR word_mom_var + upvar $MOM_VAR_ARR mom_var_arr + + set no_of_adds [array size add_name_list] + puts $puifid "## MOM SYS VARIABLES START" + for {set add_no 0} {$add_no < $no_of_adds} {incr add_no} \ + { + puts $puifid "\{$add_name_list($add_no)\} \\" + set no_mom_var [llength $word_mom_var($add_name_list($add_no))] + for {set count 0} {$count < $no_mom_var} {incr count} \ + { + set mom_var [lindex $word_mom_var($add_name_list($add_no)) $count] + set var_value $mom_var_arr($mom_var) + set var_desc [lindex $word_desc_arr($add_name_list($add_no)) $count] + if {$count < [expr $no_mom_var -1]} \ + { + puts $puifid " \{\"$mom_var\" \"$var_value\" \"$var_desc\"\} \\" + } else \ + { + puts $puifid " \{\"$mom_var\" \"$var_value\" \"$var_desc\"\}" + } + } + } + puts $puifid "## MOM SYS VARIABLES END" +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_sequence.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_sequence.tcl new file mode 100644 index 0000000..7e9a4a2 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_sequence.tcl @@ -0,0 +1,135 @@ +############################################################################## +# Description # +# This file contains all functions dealing with the SEQUENCE Object. # +# There are five sequences, events for each of the sequences are created # +# from the data defined in the PUI file. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 02-Jun-1999 mnb Code Integration # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +#The input to the function is the post object. The data read from the PUI +#file is read and sequences are created. After the sequences are created the +#corresponding events for each of the sequences are made. These events carry +#the information regarding the specific blocks of the events. +#============================================================================= + +proc PB_seq_CreateSequences {POST_OBJ} { + upvar $POST_OBJ post_obj + + #Initialize the sequence object list. + set seq_obj_list "" + + #sets the extension for event list and event block list (Name fixed in PUI). + set evt_list_ext "_evt_list" + set evt_blk_list_ext "_evt_blk_list" + + #sets the sequence index. + set ind 0 + + #sets the sequence name list first part. + set seq_name_list {prog_start oper_start tpth_ctrl \ + tpth_mot tpth_cycle oper_end prog_end} + + #sets the sequence names. + set seq_names {"Program Start Sequence" "Operation Start Sequence" \ + "Machine Control" "Motions" "Cycles" \ + "Operation End Sequence" "Program End Sequence"} + + #Creates Sequence events for each of the sequence. + foreach sequence $seq_name_list\ + { + #Initialize the event object list. + set evt_obj_list "" + + #sets the event list name and event block list name (Name set in PUI). + set evt_list_name $sequence$evt_list_ext + set evt_blk_list_name $sequence$evt_blk_list_ext + + #Creates sequence events. + PB_evt_CreateSeqEvents post_obj evt_obj_list evt_list_name \ + evt_blk_list_name sequence + + # returns the combo box elements of a sequence + PB_seq_RetSeqCombElems comb_elem_list + + #sets the sequence object attributes. + set seq_obj_attr(0) [lindex $seq_names $ind] + set seq_obj_attr(1) $evt_obj_list + set seq_obj_attr(2) $comb_elem_list + + #Creates the sequence object. + PB_seq_CreateSeqObj seq_obj_attr seq_obj_list + incr ind + } + + #Sets the sequence object list as post object attribute. + set Post::($post_obj,seq_obj_list) $seq_obj_list + +} + +#=============================================================================== +#This function takes the object attributes and the updated SEQUENCE object list +#as the input, creates the SEQUENCE Object and returns the updated object list. +#=============================================================================== + +proc PB_seq_CreateSeqObj {OBJ_ATTR OBJ_LIST} { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [new sequence] + + #Appends object id to the object list. + lappend obj_list $object + + #sets the latest value to the object created. + sequence::setvalue $object obj_attr + sequence::DefaultValue $object obj_attr +} + +#=============================================================================== +#This function takes the sequence object and the block object list as input +#and outputs the event object list. +#=============================================================================== + +proc PB_seq_RetSeqEvtBlkObj { SEQ_OBJ EVT_OBJ_LIST } { + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ_LIST evt_obj_list + + #Sets the event object list from the sequence object. + set evt_obj_list $sequence::($seq_obj,evt_obj_list) +} + +#=============================================================================== +#This function takes block object list as input and outputs the combo +#box element list. +#=============================================================================== + +proc PB_seq_RetSeqCombElems { COMB_ELEM_LIST } { + upvar $COMB_ELEM_LIST comb_elem_list + global post_object + + #Unsets the list if already exists. + if {[info exists comb_elem_list]}\ + { + unset comb_elem_list + } + + set blk_obj_list $Post::($post_object,blk_obj_list) + + #Creates combo box element list. + foreach blk_obj $blk_obj_list\ + { + set blk_name $block::($blk_obj,block_name) + PB_com_GetModEvtBlkName blk_name + lappend comb_elem_list $blk_name + } +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_ude.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_ude.tcl new file mode 100644 index 0000000..e9b1a41 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_ude.tcl @@ -0,0 +1,496 @@ +############################################################################## +# Description # +# This file contains all functions dealing with the FORMAT Object. # +# The definition file is read and the respective FORMAT Objects are # +# created. All actions on the format page of the UI is mapped into the # +# respective functions in this file through the interface file. # +# # +# Revisions # +# # +# Date Who Reason # +# 22-feb-1999 bmp Initial # +# 07-Apr-1999 mnb Removed puts # +# 02-Jun-1999 mnb Code Integration # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +#The input to the function is the FILE Object and the POST OBJECT. +#This function is called from the classes.tcl file. The ude.def file is +#read and the data is passed to the function which creates the UDE PARAM +#and UDE EVENT Objects and finally the UDE Object. +#============================================================================= + +proc PB_ude_UdeInitParse {this POST_OBJ} { + upvar $POST_OBJ post_obj + set event_start_flag 0 + set param_start_flag 0 + set event_create_flag 0 + set param_create_flag 0 + set param_attr "" + set event_attr "" + set param_obj_list "" + set event_obj_list "" + set ude_obj_list "" + + #Read the UDE.DEF file and create PARAM, UDE EVENT and UDE Objects. + while { [gets $File::($this,FilePointer) line] >= 0 }\ + { + #Remove the left side spaces from the line. + set line [string trimleft $line " "] + + #Checks whether the line is a comment or a null line. + set comnt_check [string index $line 0] + + if {[string compare $comnt_check #] == 0||[string compare $comnt_check ""] == 0}\ + { + continue + } else\ + { + #If the line is continued to the next line using a slash the subsequent + #lines are appended to the main line and then only passed to the parsing + #function. + + #sets the length of the line and checks the last character for slash. + set line_length [string length $line] + set last_char_test [string index $line [expr $line_length - 1]] + + #If the line is continued to the next line, the original line is appended. + if {[string compare $last_char_test \\] == 0}\ + { + set line_wo_sl [string range $line 0 [expr $line_length - 2]] + append temp_line $line_wo_sl + continue + } elseif {[info exists temp_line]}\ + { + append temp_line $line + set line $temp_line + unset temp_line + } + + #Calling the UDE secondary parsing function which finds the attribute + #of UDE Events, Params and finally creates the UDE Object. + PB_ude_UdeSecParse line event_start_flag param_start_flag \ + event_create_flag param_create_flag \ + event_attr param_attr param_obj_list \ + event_obj_list + } + } + + PB_ude_CreateLastParamEvtObj param_attr param_obj_list event_attr \ + event_obj_list ude_obj_list + set Post::($post_obj,ude_obj) $ude_obj_list +# puts "The TOTAL UDE EVENTS AREATED ARE = [llength $ude::($ude_obj_list,event_obj_list)]" +} + +#================================================================================== +#This function takes the line and all the flags initialised for condition checking +#flags as input and the attribute list and object list are output from the +#procedure. The objects lists and the attribute lists are initialized outside the +#procedure and these lists are referenced inside the subsequent procedures called. +#================================================================================== + +proc PB_ude_UdeSecParse {LINE EVENT_START_FLAG PARAM_START_FLAG \ + EVENT_CREATE_FLAG PARAM_CREATE_FLAG \ + EVENT_ATTR PARAM_ATTR PARAM_OBJ_LIST \ + EVENT_OBJ_LIST} { + upvar $LINE line + upvar $EVENT_START_FLAG event_start_flag + upvar $PARAM_START_FLAG param_start_flag + upvar $EVENT_CREATE_FLAG event_create_flag + upvar $PARAM_CREATE_FLAG param_create_flag + upvar $EVENT_ATTR event_attr + upvar $PARAM_ATTR param_attr + upvar $PARAM_OBJ_LIST param_obj_list + upvar $EVENT_OBJ_LIST event_obj_list + + + #Sets the event start flag and checks the event create flag if the line + #contains the "EVENT" string. + switch -glob $line\ + { + EVENT* { + #sets the event start flag active. + set event_start_flag 1 + + #Creates the UDE EVENT Object if flag is set. + if {$event_create_flag}\ + { + #Creates the PARAM Object if flag is set. + if {$param_create_flag}\ + { + #Call for setting the PARAM Object attribute and creating + #the PARAM Object. + PB_ude_CreateParamObjAttr param_attr param_obj_list + + #unsets the PARAM Object attribute list. + unset param_attr + + #sets the param create flag inactive. + set param_create_flag 0 + } + + #Call for setting the UDE EVENT Object attribute and creating + #the UDE EVENT Object. + PB_ude_CreateEventObjAttr event_attr param_obj_list event_obj_list + + #unsets the UDE EVENT Object attribute list. + unset event_attr + + #sets the param start flag and event create flag inactive. + set param_start_flag 0 + set event_create_flag 0 + } + } + } + + #If the event start flag is active set event create flag active. + if {$event_start_flag}\ + { + #sets the event create flag active. + set event_create_flag 1 + + #If param start flag is inactive start appending event attribute list. + if {!$param_start_flag}\ + { + switch -glob $line\ + { + EVENT* { + lappend event_attr $line + } + POST_EVENT* { + lappend event_attr $line + } + UI_LABEL* { + lappend event_attr $line + } + CATEGORY* { + lappend event_attr $line + } + } + } + + #Sets the param start flag and checks the param create flag if the line + #contains the "PARAM" string. + switch -glob $line\ + { + PARAM* { + #sets the param start flag active. + set param_start_flag 1 + + #If the param create flag is active call the function to + #intitialise the param object attribute and create param object. + if {$param_create_flag}\ + { + PB_ude_CreateParamObjAttr param_attr param_obj_list + unset param_attr + set param_create_flag 0 + } + + #Start appending the param attribute list. + lappend param_attr $line + } + } + + #Ifparam start flag is active start appending the param attribute list. + if {$param_start_flag}\ + { + switch -glob $line\ + { + + TYPE* { + lappend param_attr $line + } + DEFVAL* { + lappend param_attr $line + } + OPTIONS* { + lappend param_attr $line + } + UI_LABEL* { + lappend param_attr $line + } + TOGGLE* { + lappend param_attr $line + } + } + + #set the param create flag active. + set param_create_flag 1 + } + } +} + +#================================================================================= +#This function creates the ude event attribute array for the creation of the UDE +#EVENT object. The ude event attribute list and the param object list are input +#to the function and the updated object list is output from the function after +#creating the UDE EVENT Object. +#================================================================================= + +proc PB_ude_CreateEventObjAttr {ATTR_LIST PARAM_OBJ_LIST EVENT_OBJ_LIST} { + upvar $ATTR_LIST attr_list + upvar $PARAM_OBJ_LIST param_obj_list + upvar $EVENT_OBJ_LIST event_obj_list + + #Checks for the POST_EVENT, UI_LABEL, CATEGORY attributes. + set pevt_srch [lsearch $attr_list POST_EVENT*] + set lbl_srch [lsearch $attr_list UI_LABEL*] + set cat_srch [lsearch $attr_list CATEGORY*] + + #If the attributes are missing the values are initialised for the + #attributes and appended to the attribute list. + if {$pevt_srch == -1}\ + { + lappend attr_list {POST_EVENT ""} + } + + if {$lbl_srch == -1}\ + { + lappend attr_list {UI_LABEL ""} + } + + if {$cat_srch == -1}\ + { + lappend attr_list {CATEGORY ""} + } + + #The attribute list is converted into the attribute array for the creation of + #the UDE EVENT Object. + foreach attr $attr_list\ + { + switch -glob $attr\ + { + EVENT* { + set event_obj_attr(0) [lindex $attr 1] + } + POST_EVENT* { + set event_obj_attr(1) [lindex $attr 1] + } + UI_LABEL* { + set event_obj_attr(2) [lindex $attr 1] + } + CATEGORY* { + set event_obj_attr(3) [lrange $attr 1 end] + } + } + } + + #Sets the param object list as the ude event object attribute and unsets it. + set event_obj_attr(4) $param_obj_list + unset param_obj_list + + #Function call for the creation of UDE EVENT Object. + PB_ude_CreateEventObj event_obj_attr event_obj_list +} + +#================================================================================= +#This function creates the param attribute array for the creation of the PARAM +#object. The param attribute list is input to the function and the updated object +#list is output from the function after creating the PARAM Object. +#================================================================================= + +proc PB_ude_CreateParamObjAttr {ATTR_LIST PARAM_OBJ_LIST} { + upvar $ATTR_LIST attr_list + upvar $PARAM_OBJ_LIST param_obj_list + + #Modifies the PARAM Object attribute list by adding the missing attributes. + PB_ude_InitParamAttr attr_list + + #List elements are converted into attribute array element. + #The attribute array index is dependent on the object definition + #in the classes.tcl file. + foreach attr $attr_list\ + { + switch -glob $attr\ + { + PARAM* { + set param_obj_attr(0) [lindex $attr 1] + } + TYPE* { + set param_obj_attr(1) [lindex $attr 1] + } + DEFVAL* { + set param_obj_attr(2) [lindex $attr 1] + } + OPTIONS* { + set param_obj_attr(3) [string trimleft $attr "OPTIONS "] + } + TOGGLE* { + if {![string compare $param_obj_attr(1) s]}\ + { + set param_obj_attr(2) [lindex $attr 1] + } else\ + { + set param_obj_attr(3) [lindex $attr 1] + } + } + UI_LABEL* { + if {[string compare $param_obj_attr(1) s] == 0 || \ + [string compare $param_obj_attr(1) b] == 0}\ + { + set param_obj_attr(3) [lindex $attr 1] + } elseif {[string compare $param_obj_attr(1) p] == 0}\ + { + set param_obj_attr(2) [lindex $attr 1] + } else\ + { + set param_obj_attr(4) [lindex $attr 1] + } + } + } + } + + #Function call to create the UDE PARAM Object + PB_ude_CreateParamObj param_obj_attr param_obj_list +} + +#================================================================================= +#This function modifies the attribute list of the PARAM Object. From the input +#list the missing attribute elements are added and the values initialized for the +#missing attributes. +#================================================================================= + +proc PB_ude_InitParamAttr {ATTR_LIST} { + upvar $ATTR_LIST attr_list + + #Checking for the attribute TYPE and finds the data type of the object. + set test [lsearch $attr_list TYPE*] + set type_elem [lindex $attr_list $test] + set dtype [lindex $type_elem 1] + + #Depending upon the data type the mising elements are found and the added to + #the list. Null values are initialised for the missing attributes. The atributes + #of the object depends on the defiition in the classes.tcl file. + switch $dtype\ + { + i - d - \ + o - b { + set dval_srch [lsearch $attr_list DEFVAL*] + + if {$dval_srch == -1}\ + { + lappend attr_list {DEFVAL ""} + } + + switch $dtype\ + { + i - d { + set tog_srch [lsearch $attr_list TOGGLE*] + if {$tog_srch == -1}\ + { + lappend attr_list {TOGGLE ""} + } + } + } + } + s { + set tog_srch [lsearch $attr_list TOGGLE*] + if {$tog_srch == -1}\ + { + lappend attr_list {TOGGLE ""} + } + } + + } + + #Finding the UI_LABEL attribute. This is common for all data types. + set lbl_srch [lsearch $attr_list UI_LABEL*] + + if {$lbl_srch == -1}\ + { + lappend attr_list {UI_LABEL ""} + } +} + +#================================================================================= +#This function takes the param attributes and event attributes and calls the +#param and event create function. After that the UDE Object is created. +# The updated object list is output from this function. This function is +#called to create the last param and event object and the UDE Object at the +#end of the parsing. +#================================================================================= + +proc PB_ude_CreateLastParamEvtObj {PARAM_ATTR PARAM_OBJ_LIST EVENT_ATTR \ + EVENT_OBJ_LIST UDE_OBJ_LIST} { + upvar $PARAM_ATTR param_attr + upvar $PARAM_OBJ_LIST param_obj_list + upvar $EVENT_ATTR event_attr + upvar $EVENT_OBJ_LIST event_obj_list + upvar $UDE_OBJ_LIST ude_obj_list + + #Calls the param object create function + PB_ude_CreateParamObjAttr param_attr param_obj_list + + #Calls the ude event object create function + PB_ude_CreateEventObjAttr event_attr param_obj_list event_obj_list + + #Sets the attributes of UDE Object + set ude_obj_attr(0) DEFALUT + set ude_obj_attr(1) $event_obj_list + + #Function call to create the UDE Object + PB_ude_CreateUdeObject ude_obj_attr ude_obj_list +} + +#================================================================================= +#This function takes the object attributes and the updated PARAM object list +#as the input, creates the PARAM Object and returns the updated object list. +#================================================================================= + +proc PB_ude_CreateParamObj { OBJ_ATTR OBJ_LIST } { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [param::CreateObject obj_attr(1)] + + #Appends object id to the object list. + lappend obj_list $object + + #sets the latest value to the object created. + param::ObjectSetValue $object obj_attr +# puts "The UDE PARAM object is Created: $object " +} + +#================================================================================= +#This function takes the object attributes and the updated UDE EVENT object list +#as the input, creates the UDE EVENT Object and returns the updated object list. +#================================================================================= + +proc PB_ude_CreateEventObj { OBJ_ATTR OBJ_LIST } { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [new ude_event] + + #Appends object id to the object list. + lappend obj_list $object + + #sets the latest value to the object created. + ude_event::setvalue $object obj_attr +# puts "The UDE EVENT object is Created: $object " +} + +#================================================================================= +#This function takes the object attributes and the updated UDE object list +#as the input, creates the UDE Object and returns the updated object list. +#================================================================================= + +proc PB_ude_CreateUdeObject { OBJ_ATTR OBJ_LIST } { + upvar $OBJ_ATTR obj_attr + upvar $OBJ_LIST obj_list + + #Creates new object. + set object [new ude] + + #Appends object id to the object list. + lappend obj_list $object + + #sets the latest value to the object created. + ude::setvalue $object obj_attr +# puts "The UDE object is Created: $object " +} diff --git a/PB16_1999_release/POSTBUILD/app/dbase/pb_var_parser.tcl b/PB16_1999_release/POSTBUILD/app/dbase/pb_var_parser.tcl new file mode 100644 index 0000000..9f91144 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/dbase/pb_var_parser.tcl @@ -0,0 +1,14 @@ +############################################################################## +# Description # +# This file contains all functions dealing with parsing a TCL file # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 naveen Initial # +# # +# $HISTORY$ # +# # +############################################################################## + + diff --git a/PB16_1999_release/POSTBUILD/app/post_builder.exe b/PB16_1999_release/POSTBUILD/app/post_builder.exe new file mode 100644 index 0000000..c2e7719 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/app/post_builder.exe differ diff --git "a/PB16_1999_release/POSTBUILD/app/post_builder_\320\270\321\201\321\205\320\276\320\264\320\275\321\213\320\271_with_license.exe" "b/PB16_1999_release/POSTBUILD/app/post_builder_\320\270\321\201\321\205\320\276\320\264\320\275\321\213\320\271_with_license.exe" new file mode 100644 index 0000000..f60d900 Binary files /dev/null and "b/PB16_1999_release/POSTBUILD/app/post_builder_\320\270\321\201\321\205\320\276\320\264\320\275\321\213\320\271_with_license.exe" differ diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_address.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_address.tcl new file mode 100644 index 0000000..422c612 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_address.tcl @@ -0,0 +1,1674 @@ +#============================================================================= +# UI_PB_ADDRESS.TCL +#============================================================================= +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Address page.. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 gsl & mnb Initial # +# 07-Apr-1999 mnb Selection of Address from tree is corrected # +# 04-May-1999 gsl Added more attributes # +# 02-Jun-1999 mnb Code Integration # +# 14-Jun-1999 mnb Changed UI_PB_addr_ActivateAddrParams arguments # +# 29-Jun-1999 gsl Removed Help from options # +# 07-Sep-1999 mnb Editting Format & New toplevel format page # +# 21-Sep-1999 mnb Can create, cut & paste the address in the tree # +# 18-Oct-1999 gsl Minor changes # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================= +# This is the main procedure of the Address page. This procedure is called +# when the address tab in the post builder is selected for the first time. +# It creates all the widgets required to display the attributes of an +# attributes. +# +# Inputs : post builder Book id +# Address Page object +# +# Outputs : Address page with all required widgets +# +#============================================================================= +proc UI_PB_Def_Address {book_id addr_page_obj} { +#============================================================================= + global tixOption + global paOption + global add_dis_attr + global AddObjAttr + + set add_dis_attr(0) 0 + set add_dis_attr(1) 0 + set add_dis_attr(2) 0 + + # Gets the address page id from book id + set Page::($addr_page_obj,page_id) [$book_id subwidget \ + $Page::($addr_page_obj,page_name)] + + # Creates a pane + Page::CreatePane $addr_page_obj + + # Add create, cut and paste buttons to left pane + UI_PB_addr_AddCompLeftPane addr_page_obj + + # Create a tree frame in the left frame + Page::CreateTree $addr_page_obj + + # Creates the tree elements + UI_PB_addr_CreateTreeElements addr_page_obj + + # Divides the main frame into three frames + UI_PB_addr_CreateAddrFrames addr_page_obj + + # Creates leader, format and trailer buttons + UI_PB_addr_CreateLeadFmtTrailButtons addr_page_obj + + # Sets the attributes of the active address + UI_PB_addr_AddDisplayParams $addr_page_obj 0 + + # Creates the parameters of Address in the middle frame + UI_PB_addr_CreateMiddleFrameParam addr_page_obj + + # Creates action buttons + UI_PB_addr_CreateActionButtons addr_page_obj + + # Activate the address ui items based upon the value that is set + UI_PB_addr_ActivateAddrParams $addr_page_obj +} + +#============================================================================= +# This procedure creates the tree elements i.e it displays the address +# in the left side window. +# +# Inputs : Address page object +# +# Outputs : Displays Address in the left window +# +#============================================================================= +proc UI_PB_addr_CreateTreeElements { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global paOption + + # Gets the tree widget id + set tree $Page::($page_obj,tree) + set h [$tree subwidget hlist] + $h config -bg $paOption(tree_bg) + + $tree config \ + -command "UI_PB_addr_AddrItemSelec $page_obj" \ + -browsecmd "UI_PB_addr_AddrItemSelec $page_obj" +} + +#============================================================================= +# This procedure adds the Buttons Create, Paste & Cut above the tree +# Widget. +# +# Inputs : Address Page object +# +# Outputs : Creates, Create, Paste,Cut Buttons +# +#============================================================================= +proc UI_PB_addr_AddCompLeftPane { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global paOption + + # Buttons + # Gets the left pane widget id + set left_pane $Page::($page_obj,left_pane_id) + + # Creates new frame in left pane + set but [frame $left_pane.f] + pack $but -side top -fill x -padx 7 + + # Creates the buttons on the new frame + set new [button $but.new -text "Create" -bg $paOption(app_butt_bg) \ + -command "UI_PB_addr_CreateAddress $page_obj"] + set del [button $but.del -text "Cut" -bg $paOption(app_butt_bg) \ + -command "UI_PB_addr_CutAddress $page_obj"] + set pas [button $but.pas -text "Paste" -bg $paOption(app_butt_bg) \ + -command "UI_PB_addr_PasteAddress $page_obj"] + + pack $new $del $pas -side left -fill x -expand yes +} + +#============================================================================= +# This procedure gets the address objects from the database and displays +# the address names in the tree widget as tree elements. It makes the +# address corresponding to the input index as active tree element. +# +# Inputs : Address page object +# Index of address selected from tree +# +# Outputs : Creates Tree elements +# +#============================================================================= +proc UI_PB_addr_DisplayNameList { PAGE_OBJ OBJ_INDEX } { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $OBJ_INDEX obj_index + global paOption + global gPB + + # Gets tre widget ids + set tree $Page::($page_obj,tree) + set h [$tree subwidget hlist] + + # Gets the icon of an address + set file [tix getimage pb_address] + + # Deletes all current tree elements + $h delete all + $h add 0 -itemtype imagetext -text "" -image $paOption(folder) \ + -state disabled + + # Database calls .. returns the address object list + PB_int_RetAddressObjList addr_obj_list + + # Displays the address names as tree elements + set style $gPB(font_style_normal) + set count [llength $addr_obj_list] + for {set ix 0} {$ix < $count} {incr ix}\ + { + set addr_obj [lindex $addr_obj_list $ix] + set addr_name $address::($addr_obj,add_name) + $h add 0.$ix -itemtype imagetext -text $addr_name -image $file -style $style + } + + # Makes the address corresponding to the index as active + # Tree element. + if {$obj_index >= 0} \ + { + $h selection set 0.$obj_index + } else \ + { + $h selection set 0.0 + } + $tree autosetmode +} + +#============================================================================= +# This procedure creates a new address +#============================================================================= +proc UI_PB_addr_CreateAddress { page_obj } { +#============================================================================= + global ADDRESSOBJATTR + + UI_PB_addr_ApplyCurrentAddrData page_obj + set act_addr_obj $Page::($page_obj,act_addr_obj) + + # Database call to create a new address object + PB_int_AddCreateObject act_addr_obj ADDRESSOBJATTR obj_index + + # Makes newly created address as active address + set add_name $ADDRESSOBJATTR(0) + set ADDRESSOBJATTR(1) $format::($ADDRESSOBJATTR(1),for_name) + + # Sets the attributes of new address in the global variable + UI_PB_addr_UpdateAddrAttr ADDRESSOBJATTR $add_name + + # Updates the attributes of the address page + UI_PB_addr_DisplayNameList page_obj obj_index + UI_PB_addr_AddDisplayParams $page_obj $obj_index + UI_PB_addr_ActivateAddrParams $page_obj +} + +#============================================================================= +proc UI_PB_addr_CutAddress { page_obj } { +#============================================================================= + global ADDRESSOBJATTR + + # Gets the tree widget id from the page object + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + + # Gets the index of the selected format + set ent [$HLIST info selection] + set obj_index [string range $ent 2 [string length $ent]] + + set act_add_obj $Page::($page_obj,act_addr_obj) + + # An error message is popued up, if the format is used by an address + if {$address::($act_add_obj,blk_elem_list) != ""} \ + { + set address_name $address::($act_add_obj,add_name) + tk_messageBox -type ok -icon error\ + -message "Address \"$address_name\" is used by the Block Elements. \ + Address cannot be deleted" + return + } + + # Selected address object is deleted from the database + PB_int_AddCutObject act_add_obj obj_index add_mom_var add_var_desc \ + add_mseq_attr + + # Stores the address attributes as buffer for pasting + set Page::($page_obj,add_buff_obj_attr) [array get ADDRESSOBJATTR] + set Page::($page_obj,add_buff_mom_var) $add_mom_var + set Page::($page_obj,add_buff_var_desc) $add_var_desc + set Page::($page_obj,add_buff_mseq_attr) [array get add_mseq_attr] + + # Unsets the address attributes in the global variable + set add_name $ADDRESSOBJATTR(0) + UI_PB_addr_UnsetAddrAttr $add_name + + # Updates the address page attributes + UI_PB_addr_DisplayNameList page_obj obj_index + UI_PB_addr_AddDisplayParams $page_obj $obj_index + UI_PB_addr_ActivateAddrParams $page_obj +} + +#============================================================================= +proc UI_PB_addr_PasteAddress { page_obj } { +#============================================================================= + + # gets the tree widget id from page object + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set obj_index [string range $ent 2 [string length $ent]] + + # if there is no format object in the buffer, it just does nothing + if {![info exists Page::($page_obj,add_buff_obj_attr)]} \ + { + return + } + array set add_buff_obj_attr $Page::($page_obj,add_buff_obj_attr) + set add_mom_var $Page::($page_obj,add_buff_mom_var) + set add_var_desc $Page::($page_obj,add_buff_var_desc) + array set add_mseq_attr $Page::($page_obj,add_buff_mseq_attr) + + # Data base call, which adds the buffer format object to the database + set temp_index $obj_index + PB_int_AddPasteObject add_buff_obj_attr obj_index add_mom_var add_var_desc \ + add_mseq_attr + unset Page::($page_obj,add_buff_obj_attr) + unset Page::($page_obj,add_buff_mom_var) + unset Page::($page_obj,add_buff_var_desc) + unset Page::($page_obj,add_buff_mseq_attr) + + if {$temp_index != $obj_index } \ + { + # Sets the attributes of new address in the global variable + set add_name $add_buff_obj_attr(0) + set add_buff_obj_attr(1) $format::($add_buff_obj_attr(1),for_name) + UI_PB_addr_UpdateAddrAttr add_buff_obj_attr $add_name + + # Updates the address page attributes + UI_PB_addr_DisplayNameList page_obj obj_index + UI_PB_addr_AddDisplayParams $page_obj $obj_index + UI_PB_addr_ActivateAddrParams $page_obj + } +} + +#============================================================================= +# This procedure Creates a popup menu and binds it to the leader widget. +# When the third mouse button is clicked on the leader widget, it popups +# this popup menu. +# +# Inputs : Address Page object +# +# Outputs : Popup menu +# +#============================================================================= +proc UI_PB_addr_CreateLeaderPopup { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global AddObjAttr + global add_dis_attr + + # Gets the middle frame id + set f $Page::($page_obj,middle_frame) + + # Creates the popup menu and binds it to the lead widget + set menu [menu $f.pop] + bind $f.lea_val <1> "focus %W" + bind $f.lea_val <3> "tk_popup $menu %X %Y" + + # Options displayed in the popup menu + set options_list {A B C D E F G H I J K L M N O \ + P Q R S T U V W X Y Z None} + + # Adds the options to the popup menu + set bind_widget $f.lea_val + set callback "UI_PB_addr_SelectLeader" + UI_PB_addr_SetPopupOptions page_obj menu options_list callback \ + bind_widget +} + +#============================================================================= +# This procedure creates all the frames required for the address page, +# to display the address attributes. +# +# Inputs : Address Page Object +# +# Outputs : Top frame ( To display format ) +# Middle Frame ( to display address attribute ) +# Bottom Frame ( For Action buttons ) +# +#============================================================================= +proc UI_PB_addr_CreateAddrFrames { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + + # Canvas frame is the main frame + set canvas_frame $Page::($page_obj,canvas_frame) + + # Creates the tixbutton frame + set top_frame [tixButtonBox $canvas_frame.top \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg gray85] + set Page::($page_obj,top_frame) $top_frame + + # Creates a middle frame + set middle_frame [frame $canvas_frame.mid] + set Page::($page_obj,middle_frame) $middle_frame + + # Creates bottom frame + set bottom_frame [frame $canvas_frame.bot] + set Page::($page_obj,bottom_frame) $bottom_frame + + pack $top_frame -side top -fill x -padx 3 -pady 3 + pack $middle_frame -side top -pady 10 -fill both + pack $bottom_frame -side bottom -fill x +} + +#============================================================================= +# This procedure creates the options of a combobox .. basically it creates +# a list of formats as combobox elements. +# +# Inputs : Address Page Object +# +# Outputs : Combobox Elements +# +#============================================================================= +proc UI_PB_addr_CreateComboAttr { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global Format_Name + + # Deletes the existing options list + set fmt_frm [$Page::($page_obj,middle_frame).fmt subwidget frame] + set fmt_sel $fmt_frm.fmt_sel + set lbx [$fmt_sel subwidget listbox] + $lbx delete 0 end + + # Recreates the options list + + # Database call ... returns the format object list + PB_int_RetFormatObjList fmt_obj_list + + set name_arr_size [llength $fmt_obj_list] + for {set ind 0} {$ind < $name_arr_size} {incr ind}\ + { + set fmt_obj [lindex $fmt_obj_list $ind] + set fmt_name $format::($fmt_obj,for_name) + $fmt_sel insert end $fmt_name + } +} + +#============================================================================= +# This procedure creates the widgets required to display address parameters +# in the middle frame. +# +# Inputs : Address Page Object +# +# Outputs : Middle frame widgets +# +#============================================================================= +proc UI_PB_addr_CreateMiddleFrameParam { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global add_dis_attr + global tixOption + global paOption + global ADDRESSOBJATTR + global gPB_help_tips + global Format_Name + + # Gets the middle frame widget id + set f $Page::($page_obj,middle_frame) + + # Blank Line + label $f.blk -text " " + + + # LEADER Widget + label $f.lea -text Leader \ + -font $tixOption(bold_font) + entry $f.lea_val -textvariable "ADDRESSOBJATTR(8)" \ + -cursor hand2 \ + -width 5 -borderwidth 4 \ + -highlightcolor lightYellow \ + -background royalBlue \ + -foreground yellow \ + -selectbackground lightYellow \ + -selectforeground black + bind $f.lea_val "+UI_PB_addr__ApplyLeader $page_obj " + + # Creates the leader popup menu + UI_PB_addr_CreateLeaderPopup page_obj + + # FORMAT Widget + tixLabelFrame $f.fmt -label "Format" + set fmt_frm [$f.fmt subwidget frame] + + button $fmt_frm.but -text " Edit " -font $tixOption(bold_font) \ + -command "UI_PB_addr_EditFormat $page_obj" + pack $fmt_frm.but -side left -padx 10 -pady 5 + + set fmt_sel [tixComboBox $fmt_frm.fmt_sel \ + -dropdown yes \ + -editable false \ + -variable Format_Name \ + -command "UI_PB_addr_SelectFormat $page_obj" \ + -selectmode immediate \ + -grab local \ + -listwidth 45 \ + -options { + listbox.height 4 + listbox.anchor w + entry.width 12 + }] + + pack $fmt_frm.fmt_sel -side right -padx 10 -pady 5 + [$fmt_sel subwidget entry] config -bg lightBlue -cursor "" + global lbx + set lbx [$fmt_sel subwidget listbox] + + # Creates combo options list + UI_PB_addr_CreateComboAttr page_obj + tixSetSilent $fmt_sel $ADDRESSOBJATTR(1) + + # Maximum Widget + tixLabelFrame $f.max -label "Maximum" + set max [$f.max subwidget frame] + + global var_max_val + tixLabelEntry $max.val \ + -label "Value" \ + -options { + label.width 18 + label.anchor w + entry.width 12 + entry.anchor e + entry.textVariable ADDRESSOBJATTR(4) + } + + if {![info exists ADDRESSOBJATTR(4)] || $ADDRESSOBJATTR(4) == ""} { + set ADDRESSOBJATTR(4) 999999999.9999 + } + + set m_opts {truncate warn abort} + + set m_opt_labels(truncate) "Truncate Value" + set m_opt_labels(warn) "Warn User" + set m_opt_labels(abort) "Abort Process" + + tixOptionMenu $max.err \ + -label "Violation Handling" \ + -variable ADDRESSOBJATTR(5) \ + -options { + label.width 18 + label.anchor w + menubutton.width 12 + } + + foreach opt $m_opts { + $max.err add command $opt -label $m_opt_labels($opt) + } + + pack $max.val -side top -fill x -padx 10 -pady 4 + pack $max.err -side bottom -fill x -padx 10 -pady 2 + + # MINIMUM Widget + tixLabelFrame $f.min -label "Minimum" + set min [$f.min subwidget frame] + + global var_min_val + tixLabelEntry $min.val \ + -label "Value" \ + -options { + label.width 18 + label.anchor w + entry.width 12 + entry.anchor e + entry.textVariable ADDRESSOBJATTR(6) + } + + if {![info exists ADDRESSOBJATTR(6)] || $ADDRESSOBJATTR(6) == ""} { + set ADDRESSOBJATTR(6) -999999999.9999 + } + + tixOptionMenu $min.err \ + -label "Violation Handling" \ + -variable ADDRESSOBJATTR(7) \ + -options { + label.width 18 + label.anchor w + menubutton.width 12 + } + + foreach opt $m_opts { + $min.err add command $opt -label $m_opt_labels($opt) + } + + pack $min.val -side top -fill x -padx 10 -pady 4 + pack $min.err -side bottom -fill x -padx 10 -pady 2 + + + # FORCE Widget + set opts {off once always} + set opt_labels(off) "Off" + set opt_labels(once) "Once" + set opt_labels(always) "Always" + + tixOptionMenu $f.mod \ + -label "Modality Override" \ + -variable ADDRESSOBJATTR(2) \ + -options { + label.width 22 + label.anchor w + menubutton.width 8 + } + + foreach opt $opts { + $f.mod add command $opt -label $opt_labels($opt) + } + + if {![info exists ADDRESSOBJATTR(2)] || $ADDRESSOBJATTR(2) == ""} { + set ADDRESSOBJATTR(2) $opt_labels(once) + } + + # TRAILER + label $f.tra -text "Trailer " \ + -font $tixOption(bold_font) + + entry $f.tra_val -textvariable ADDRESSOBJATTR(9) \ + -cursor hand2 \ + -width 5 -borderwidth 4 \ + -highlightcolor lightYellow \ + -background royalBlue \ + -foreground yellow \ + -selectbackground lightYellow \ + -selectforeground black + bind $f.tra_val "+UI_PB_addr__ApplyTrailer $page_obj " + + # Force this guy to be active. + set ADDRESSOBJATTR(10) 1 + UI_PB_addr_SetCheckButPopStatus $page_obj ADDRESSOBJATTR(10) + + + # + set menu [menu $f.pop1] + bind $f.tra_val <1> "focus %W" + bind $f.tra_val <3> "tk_popup $menu %X %Y" + + set bind_widget $f.tra_val + set options_list {A B C D E F G H I J K L M N O \ + P Q R S T U V W X Y Z None} + + set callback "UI_PB_addr_SelectTrailer" + UI_PB_addr_SetPopupOptions page_obj menu options_list callback \ + bind_widget + + # Packs all the widgets in terms of row and columns + grid $f.blk - + grid $f.lea -row 1 -col 0 -padx 5 -pady 3 -sticky w + grid $f.lea_val -row 1 -col 1 -padx 5 -pady 3 -sticky nse + grid $f.fmt - -padx 1 -pady 3 -sticky ew + grid $f.tra -row 3 -col 0 -padx 5 -pady 3 -sticky w + grid $f.tra_val -row 3 -col 1 -padx 5 -pady 3 -sticky nse + grid $f.mod - -padx 5 -pady 3 -sticky ew + grid $f.max - -padx 1 -pady 3 -sticky ew + grid $f.min - -padx 1 -pady 1 -sticky ew +} + +#============================================================================= +# This is a callback function, attached to Edit button of format. It gets +# format object of the format selected in the combobox and brings up the +# format Page .. with selected format attributes. +# +# Inputs : Address Page Object +# +# Outputs : Format Page +# +#============================================================================= +proc UI_PB_addr_EditFormat { page_obj } { +#============================================================================= + global Format_Name + + set canvas_frame $Page::($page_obj,canvas_frame) + + # Gets the format object of the format + PB_int_RetFmtObjFromName Format_Name fmt_obj + + # Brings up the format page + UI_PB_fmt_CreateFmtPage $fmt_obj $canvas_frame +} + +#============================================================================= +# This proceudre sets the status of the widget passed, based upon the +# value of the state. +# +# Inputs : Widget id +# state value +# +# Outputs : The widget is either disabled or enabled +# +#============================================================================= +proc UI_PB_addr_SetCheckButtonState {widget STATE} { +#============================================================================= + upvar $STATE state + switch $state\ + { + 0 {$widget config -state disabled} + 1 {$widget config -state normal} + } +} + +#============================================================================= +# This procedures creates the action buttons of address page and attaches +# callbacks to those action buttons. +# +# Inputs : Address Page Object +# +# Outputs : Action buttons with callbacks +# +#============================================================================= +proc UI_PB_addr_CreateActionButtons { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global paOption + + set bottom_frame $Page::($page_obj,bottom_frame) + + # Buttons + set bb [tixButtonBox $bottom_frame.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + # Defualt button + $bb add def -text Default -width 10 -underline 0 -command \ + "UI_PB_addr_AddDefaultCallBack $page_obj" + + # Restore Button + $bb add app -text Restore -underline 0 -width 10 -command \ + "UI_PB_addr_AddRestoreCallBack $page_obj" + pack $bb -fill x -padx 3 -pady 3 +} + +#============================================================================= +# This procedure creates the buttons to display leader, format and the +# trailing characters of an address. These buttons are created in the +# top frame. +# +# Inputs : Address Page object +# +# Outputs : Leader,format,trailing buttons. +# +#============================================================================= +proc UI_PB_addr_CreateLeadFmtTrailButtons { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global tixOption + global paOption + + # Gets the id of top frame + set top_frame $Page::($page_obj,top_frame) + global forget_flag + + # Create leader, format & trailing buttons + button $top_frame.ldr -text "" -cursor "" \ + -font $tixOption(bold_font) \ + -bg darkSeaGreen3 -relief flat \ + -state disabled -disabledforeground lightYellow + button $top_frame.fmt -text "" -cursor "" \ + -font $tixOption(bold_font) \ + -bg darkSeaGreen3 -relief flat \ + -state disabled -disabledforeground lightYellow + button $top_frame.trl -text "" -cursor "" \ + -font $tixOption(bold_font) \ + -bg darkSeaGreen3 -relief flat \ + -state disabled -disabledforeground lightYellow + + grid $top_frame.ldr -row 1 -column 1 -pady 10 + grid $top_frame.fmt -row 1 -column 2 -pady 10 + grid $top_frame.trl -row 1 -column 3 -pady 10 + + set forget_flag 0 + $top_frame.ldr configure -activebackground darkSeaGreen3 + $top_frame.fmt configure -activebackground darkSeaGreen3 + $top_frame.trl configure -activebackground darkSeaGreen3 +} + +#============================================================================= +# This procedure creates balloon, for combobox elements +#============================================================================= +proc Browse_Cmd {LBX FORMATNAMELIST x y} { +#============================================================================= + upvar $LBX lbx + upvar $FORMATNAMELIST FormatNameList + global gPB_help_tips + global old_ind + global balloon_on + + # Identify list item @ cursor + set ind [$lbx index @$x,$y] + + set wh [winfo height $lbx] + set ww [winfo width $lbx] + + if {![info exists balloon_on]} { + set balloon_on 0 + } + + if {$gPB_help_tips(state)} \ + { + # Display balloon when cursor is within the listbox window. + if {$x >= 0 && $x <= $ww && $y >= 0 && $y <= $wh} \ + { + set px [winfo pointerx $lbx] + set py [winfo pointery $lbx] + + # Redisplay balloon when cursor moves into new list item. + if [info exists old_ind] \ + { + if {$ind != $old_ind} \ + { + PB_reset_balloon $lbx $px $py $ind + set balloon_on 1 + } + } + + # Display balloon when cursor moves back into listbox. + if {$balloon_on == 0} \ + { + PB_reset_balloon $lbx $px $py $ind + set balloon_on 1 + } + + # Suppress balloon when cursor moves out of listbox. + } else \ + { + PB_cancel_balloon + set balloon_on 0 + } + } + + set old_ind $ind +} + +#============================================================================= +# This proceduer writes back the address data to the database. +# +# Inputs : Address Page Object +# +# Outputs : Writes the address attributes to database +# +#============================================================================= +proc UI_PB_addr_ApplyCurrentAddrData { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global ADDRESSOBJATTR + global Format_Name + + if {[info exist Page::($page_obj,act_addr_obj)]} \ + { + set act_addr_obj $Page::($page_obj,act_addr_obj) + set ADDRESSOBJATTR(1) $Format_Name + + set addr_name $ADDRESSOBJATTR(0) + UI_PB_addr_UpdateAddrAttr ADDRESSOBJATTR $addr_name + PB_int_AddApplyObject act_addr_obj ADDRESSOBJATTR + } +} + +#============================================================================= +# This proceduer calls the proceduer to update database & unsets some +# address page object attributes. +# +# Inputs : Address Page Object +# +# Outputs : Writes the address attributes to database +# +#============================================================================= +proc UI_PB_addr_AddressApply { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + + if {[info exist Page::($page_obj,act_addr_obj)]} \ + { + # Calls the apply proceduer + UI_PB_addr_ApplyCurrentAddrData page_obj + unset Page::($page_obj,act_addr_obj) + unset Page::($page_obj,act_addr_name) + } +} + +#============================================================================= +# This proceduer is a callback function, attached to the Defualt button. +# It gets the default data of an selected address from the database and +# displays them. +# +# Inputs : Address page object +# +# Outputs : Displays Default data of an address +# +#============================================================================= +proc UI_PB_addr_AddDefaultCallBack { page_obj } { +#============================================================================= + global ADDRESSOBJATTR + + # Gets active address object + set act_addr_obj $Page::($page_obj,act_addr_obj) + + # gets the default attributes of the address object + array set def_addr_obj_attr $address::($act_addr_obj,def_value) + set fmt_obj $def_addr_obj_attr(1) + set def_addr_obj_attr(1) $format::($fmt_obj,for_name) + + # Updates the Address page widgets + set cur_addr_name $def_addr_obj_attr(0) + UI_PB_addr_UpdateAddrAttr def_addr_obj_attr $cur_addr_name + UI_PB_addr_SetAddressAttr $page_obj + UI_PB_addr_ActivateAddrParams $page_obj +} + +#============================================================================= +# This proceduer is called, when the Restore button of the Address page +# is selected. It restores back the data of an active address. +# +# Inputs : Address page Object +# +# Outputs : Restores the address data. +# +#============================================================================= +proc UI_PB_addr_AddRestoreCallBack { page_obj } { +#============================================================================= + array set rest_addressobjattr $Page::($page_obj,rest_addressobjattr) + + set cur_addr_name $rest_addressobjattr(0) + UI_PB_addr_UpdateAddrAttr rest_addressobjattr $cur_addr_name + UI_PB_addr_SetAddressAttr $page_obj + UI_PB_addr_ActivateAddrParams $page_obj +} + +#============================================================================= +# This is a callback proceduer attached to combobox. For a selected +# format, it gets the formatted value and displays on the format +# button in the top frame. +# +# Inputs : Address page object +# +# Outputs : New formatted value +# +#============================================================================= +proc UI_PB_addr_SelectFormat {page_obj args} { +#============================================================================= + global ADDRESSOBJATTR + global add_dis_attr + global Format_Name + + set ADDRESSOBJATTR(1) $Format_Name + + # Gets the formatted value of selected format + PB_int_DisplayFormatValue ADDRESSOBJATTR(1) ADDRESSOBJATTR(0) \ + add_dis_attr(1) fmt_disp + set add_dis_attr(1) $fmt_disp + + # Displays the new formatted value on the format button + UI_PB_addr__ConfigureAddrFormat page_obj +} + +#============================================================================= +# This proceduer creates the popup options. +# +# Inputs : Address Page Object +# Menu widget id +# A list of Options +# Callback proceduer +# bind widget id +# +# Ouputs : Popup options menu +# +#============================================================================= +proc UI_PB_addr_SetPopupOptions {PAGE_OBJ MENU OPTIONS_LIST \ + CALLBACK BIND_WIDGET} { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $MENU menu1 + upvar $OPTIONS_LIST options_list + upvar $CALLBACK callback + upvar $BIND_WIDGET bind_widget + + set count 1 + foreach ELEMENT $options_list \ + { + if {$ELEMENT == "Help"} \ + { + $menu1 add command -label $ELEMENT + + } elseif {$ELEMENT == "None"} \ + { + $menu1 add command -label $ELEMENT -command \ + "$callback $page_obj $bind_widget \"\"" + } else \ + { + if {$count == 1} \ + { + $menu1 add command -label $ELEMENT -columnbreak 1 -command \ + "$callback $page_obj $bind_widget $ELEMENT" + } else \ + { + $menu1 add command -label $ELEMENT -command \ + "$callback $page_obj $bind_widget $ELEMENT" + } + } + + if {$count == 9} \ + { + set count 0 + } + incr count + } +} + +#============================================================================= +# This is a callback proceduer attached to the leader popup menu. This +# proceduer updates the text of the leader button. +# +# Inputs : Address Page Object +# Entry Widget id +# New Leader +# +# Outputs : Updates the entry & Leader button +# +#============================================================================= +proc UI_PB_addr_SelectLeader {page_obj b str} { +#============================================================================= + global ADDRESSOBJATTR + global add_dis_attr + + # Updates the entry + UI_PB_addr__UpdateEntry $b $str + set ADDRESSOBJATTR(8) $str + + # Updates the text of Leader button in top frame + set add_dis_attr(0) $ADDRESSOBJATTR(8) + UI_PB_addr__ConfigureAddrLeader page_obj + $b selection range 0 end +} + +#============================================================================= +# It updates the leader entry. +# +# Inputs : Entry widget id +# New String +# +# Outputs : Updates the contents of the entry +# +#============================================================================= +proc UI_PB_addr__UpdateEntry {e str} { +#============================================================================= + $e delete 0 end + $e insert 0 $str +} + +#============================================================================= +# This is a callback proceduer attached to the Trailer popup menu. This +# proceduer updates the text of the Trailer button. +# +# Inputs : Address Page Object +# Entry Widget id +# New Trailer +# +# Outputs : Updates the trailer entry & trailer button +# +#============================================================================= +proc UI_PB_addr_SelectTrailer {page_obj b str} { +#============================================================================= + global ADDRESSOBJATTR + global add_dis_attr + + # Updates the entry + UI_PB_addr__UpdateEntry $b $str + set ADDRESSOBJATTR(9) $str + + # Updates the trailer button + set add_dis_attr(2) $ADDRESSOBJATTR(9) + UI_PB_addr__ConfigureAddrTrailer page_obj + $b selection range 0 end +} + +#============================================================================= +# It is a callback proceduer, attached to the leader entry. It update +# the leader of an address. +# +# Inputs : Address Page Object +# +# Outputs : Updates the address parameters +# +#============================================================================= +proc UI_PB_addr__ApplyLeader {page_obj} { +#============================================================================= + global add_dis_attr + global ADDRESSOBJATTR + + set f $Page::($page_obj,middle_frame) + set ADDRESSOBJATTR(8) [ $f.lea_val get ] + + set add_dis_attr(0) $ADDRESSOBJATTR(8) + UI_PB_addr__ConfigureAddrLeader page_obj + $f.lea_val selection range 0 end +} + +#============================================================================= +# It is a callback proceduer, attached to the Trailer entry. It update +# the trailer of an address. +# +# Inputs : Address Page Object +# +# Outputs : Updates the address parameters +# +#============================================================================= +proc UI_PB_addr__ApplyTrailer {page_obj} { +#============================================================================= + global add_dis_attr + global ADDRESSOBJATTR + + set f $Page::($page_obj,middle_frame) + set ADDRESSOBJATTR(9) [ $f.tra_val get ] + + set add_dis_attr(2) $ADDRESSOBJATTR(9) + UI_PB_addr__ConfigureAddrTrailer page_obj + $f.tra_val selection range 0 end +} + +#============================================================================= +# It is a callback proceduer attached to the tree elements. It displays the +# attributes of the selecte address from the tree. +# +# Inputs : Address page object +# +# Outputs : Displays the attributes of selected address +# +#============================================================================= +proc UI_PB_addr_AddrItemSelec { page_obj args } { +#============================================================================= + + # Gets the tree widget & selected index + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set index [string range $ent 2 [string length $ent]] + + if {[string compare $index ""] == 0}\ + { + set index 0 + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.0 + $HLIST anchor set 0.0 + } + + # Applys the attributes of the previous address + UI_PB_addr_AddressApply page_obj + + # Displays the attributes of selected address + UI_PB_addr_AddDisplayParams $page_obj $index + UI_PB_addr_ActivateAddrParams $page_obj +} + +#============================================================================= +# This procedure gets the address object corresponding to the selected +# index and displays the attributes of the address in the address page. +# It also stores the attributes as the restore data. +# +# Inputs : Address page object +# Selected index +# +# Outputs : Displays Address attributes +# +#============================================================================= +proc UI_PB_addr_AddDisplayParams { page_obj index} { +#============================================================================= + global ADDRESSOBJATTR + + # Returns the address object list + PB_int_RetAddressObjList addr_obj_list + + if {$index >= 0} \ + { + set addr_obj [lindex $addr_obj_list $index] + set Page::($page_obj,act_addr_obj) $addr_obj + set Page::($page_obj,act_addr_name) $address::($addr_obj,add_name) + + # Sets the global variable + UI_PB_addr_SetAddressAttr $page_obj + + # Restores the data of an address + if {[info exists Page::($page_obj,rest_addressobjattr)]} \ + { + unset Page::($page_obj,rest_addressobjattr) + } + set Page::($page_obj,rest_addressobjattr) [array get ADDRESSOBJATTR] + } +} + +#============================================================================= +# This procedure activates the widgets of an address page, based upon the +# selected address parameters. +# +# Inputs : Address page object +# +# Outputs : Activates valid address page widgets +# +#============================================================================= +proc UI_PB_addr_ActivateAddrParams { page_obj } { +#============================================================================= + global ADDRESSOBJATTR + global add_dis_attr + + set middle_frame $Page::($page_obj,middle_frame) + UI_PB_addr_SetCheckButtonState $middle_frame.mod ADDRESSOBJATTR(3) + UI_PB_addr_SetCheckButtonState $middle_frame.min_val ADDRESSOBJATTR(7) + UI_PB_addr_SetCheckButtonState $middle_frame.max_val ADDRESSOBJATTR(5) + UI_PB_addr__UpdateEntry $middle_frame.lea_val $ADDRESSOBJATTR(8) + UI_PB_addr__UpdateEntry $middle_frame.tra_val $ADDRESSOBJATTR(9) + + set add_obj $Page::($page_obj,act_addr_obj) + set addr_name $address::($add_obj,add_name) + set addr_glob_var $address::($add_obj,rep_mom_var) + PB_com_MapMOMVariable add_obj addr_glob_var blk_elem_text + PB_int_GetElemDisplayAttr addr_name blk_elem_text add_dis_attr + UI_PB_addr__ConfigureAddrAttributes page_obj + UI_PB_addr_SetCheckButPopStatus $page_obj ADDRESSOBJATTR(10) +} + +#============================================================================= +# Sets the globla variables of address page +#============================================================================= +proc UI_PB_addr_SetAddressAttr { page_obj } { +#============================================================================= + global gpb_addr_var + global ADDRESSOBJATTR + global Format_Name + + set add_name $Page::($page_obj,act_addr_name) + set ADDRESSOBJATTR(0) $gpb_addr_var($add_name,name) + set ADDRESSOBJATTR(1) $gpb_addr_var($add_name,fmt_name) + set ADDRESSOBJATTR(2) $gpb_addr_var($add_name,modal) + set ADDRESSOBJATTR(3) $gpb_addr_var($add_name,modl_status) + set ADDRESSOBJATTR(4) $gpb_addr_var($add_name,add_max) + set ADDRESSOBJATTR(5) $gpb_addr_var($add_name,max_status) + set ADDRESSOBJATTR(6) $gpb_addr_var($add_name,add_min) + set ADDRESSOBJATTR(7) $gpb_addr_var($add_name,min_status) + set ADDRESSOBJATTR(8) $gpb_addr_var($add_name,leader_name) + set ADDRESSOBJATTR(9) $gpb_addr_var($add_name,trailer) + set ADDRESSOBJATTR(10) $gpb_addr_var($add_name,trail_status) + set ADDRESSOBJATTR(11) $gpb_addr_var($add_name,incremental) + + set Format_Name $ADDRESSOBJATTR(1) +} + +#============================================================================= +# Updates the global variables of the address summary page. +# +# Inputs : Address Attributes +# Address name +# +# Outputs : Updates the global variable of add sum page +# +#============================================================================= +proc UI_PB_addr_UpdateAddrAttr { TEMP_ADDOBJATTR add_name } { +#============================================================================= + upvar $TEMP_ADDOBJATTR temp_addobjattr + + # Address summary page global variable + global gpb_addr_var + + set gpb_addr_var($add_name,name) $temp_addobjattr(0) + set gpb_addr_var($add_name,fmt_name) $temp_addobjattr(1) + set gpb_addr_var($add_name,modal) $temp_addobjattr(2) + set gpb_addr_var($add_name,modl_status) $temp_addobjattr(3) + set gpb_addr_var($add_name,add_max) $temp_addobjattr(4) + set gpb_addr_var($add_name,max_status) $temp_addobjattr(5) + set gpb_addr_var($add_name,add_min) $temp_addobjattr(6) + set gpb_addr_var($add_name,min_status) $temp_addobjattr(7) + set gpb_addr_var($add_name,leader_name) $temp_addobjattr(8) + set gpb_addr_var($add_name,trailer) $temp_addobjattr(9) + set gpb_addr_var($add_name,trail_status) $temp_addobjattr(10) + set gpb_addr_var($add_name,incremental) $temp_addobjattr(11) +} + +#============================================================================= +# Updates the global variables of the address summary page. +# +# Inputs : Address Attributes +# Address name +# +# Outputs : Updates the global variable of add sum page +# +#============================================================================= +proc UI_PB_addr_UnsetAddrAttr { add_name } { +#============================================================================= + # Address summary page global variable + global gpb_addr_var + + unset gpb_addr_var($add_name,name) + unset gpb_addr_var($add_name,fmt_name) + unset gpb_addr_var($add_name,modal) + unset gpb_addr_var($add_name,modl_status) + unset gpb_addr_var($add_name,add_max) + unset gpb_addr_var($add_name,max_status) + unset gpb_addr_var($add_name,add_min) + unset gpb_addr_var($add_name,min_status) + unset gpb_addr_var($add_name,leader_name) + unset gpb_addr_var($add_name,trailer) + unset gpb_addr_var($add_name,trail_status) + unset gpb_addr_var($add_name,incremental) +} + +#============================================================================= +# This procedure attaches the popup menu if the stat is 1 and disables +# the popup menu if the state is 0 +# +# Inputs : Address page object +# state value +# +# Outputs : popup menu +# +#============================================================================= +proc UI_PB_addr_SetCheckButPopStatus {page_obj STATE} { +#============================================================================= + upvar $STATE state + global add_dis_attr + global forget_flag + + set middle_frame $Page::($page_obj,middle_frame) + + if {!$state}\ + { + $middle_frame.tra_val configure -state disabled -cursor "" + bind $middle_frame.tra_val <3> "" + set forget_flag 1 + } else\ + { + $middle_frame.tra_val configure -state normal -cursor hand2 + bind $middle_frame.tra_val <1> "focus %W" + bind $middle_frame.tra_val <3> "tk_popup $middle_frame.pop1 %X %Y" + set forget_flag 0 + } + UI_PB_addr__ConfigureAddrAttributes page_obj +} + +#============================================================================= +# This proceduer configures the text of the leader button in the top frame +# +# Inputs : Address page object +# +# Outputs : configures the text leader button +# +#============================================================================= +proc UI_PB_addr__ConfigureAddrLeader { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global add_dis_attr + + set top_frame $Page::($page_obj,top_frame) + + $top_frame.ldr configure -text $add_dis_attr(0) + + if {[string compare $add_dis_attr(0) ""]} \ + { + grid $top_frame.ldr -row 1 -column 1 -pady 10 + } else \ + { + grid forget $top_frame.ldr + } +} + +#============================================================================= +# This proceduer configures the text of the format button in the top frame +# +# Inputs : Address page object +# +# Outputs : configures the text format button +# +#============================================================================= +proc UI_PB_addr__ConfigureAddrFormat { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global add_dis_attr + + set top_frame $Page::($page_obj,top_frame) + + $top_frame.fmt configure -text $add_dis_attr(1) +} + +#============================================================================= +# This proceduer configures the text of the trailer button in the top frame +# +# Inputs : Address page object +# +# Outputs : configures the text trailer button +# +#============================================================================= +proc UI_PB_addr__ConfigureAddrTrailer { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global add_dis_attr + global forget_flag + + set top_frame $Page::($page_obj,top_frame) + + $top_frame.trl configure -text $add_dis_attr(2) + + if {[string compare $add_dis_attr(2) ""]} \ + { + if {$forget_flag == 0} \ + { + grid $top_frame.trl -row 1 -column 3 -pady 10 + } else \ + { + grid forget $top_frame.trl + } + } else \ + { + grid forget $top_frame.trl + } +} + +#============================================================================= +# This proceduer calls the leader, format and trailer configuration +# procedures. +# +# Inputs : Address page object +# +# Outputs : Configures the text of leader, format & +# trailer buttons. +# +#============================================================================= +proc UI_PB_addr__ConfigureAddrAttributes { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + + UI_PB_addr__ConfigureAddrLeader page_obj + UI_PB_addr__ConfigureAddrFormat page_obj + UI_PB_addr__ConfigureAddrTrailer page_obj +} + +#============================================================================= +proc UI_PB_addr_TabAddressCreate { addr_page_obj } { +#============================================================================= + set tree $Page::($addr_page_obj,tree) + set HLIST [$tree subwidget hlist] + + set ent [$HLIST info selection] + set index [string range $ent 2 [string length $ent]] + if {[string compare $index ""] == 0} \ + { + set index 0 + } + + # Displays the addresses in the tree widget. + UI_PB_addr_DisplayNameList addr_page_obj index + + # Updates the address page attributes + UI_PB_addr_AddrItemSelec $addr_page_obj + UI_PB_addr_CreateComboAttr addr_page_obj +} + +#============================================================================== +# This procedure creates the format page on a new top level +# +# Inputs : Address object +# Top level frame +# +# Outputs : Address page +# +#============================================================================== +proc UI_PB_addr_CreateAddressPage { win add_obj NEW_ADD_PAGE } { +#============================================================================== + upvar $NEW_ADD_PAGE new_add_page + + global ADDRESSOBJATTR + global Format_Name + global paOption + global add_dis_attr + + set add_dis_attr(0) 0 + set add_dis_attr(1) 0 + set add_dis_attr(2) 0 + + address::readvalue $add_obj ADDRESSOBJATTR + format::readvalue $ADDRESSOBJATTR(1) fmt_obj_attr + set ADDRESSOBJATTR(1) $fmt_obj_attr(0) + set pname $ADDRESSOBJATTR(0) + + set Format_Name $ADDRESSOBJATTR(1) + + set new_add_page [new Page $pname $pname] + toplevel $win + UI_PB_com_CreateTransientWindow $win "ADDRESS : $ADDRESSOBJATTR(0)" {} "" "" + + # Grabs the window +### grab set $win + + set Page::($new_add_page,canvas_frame) $win + set Page::($new_add_page,act_addr_obj) $add_obj + set Page::($new_add_page,act_addr_name) $ADDRESSOBJATTR(0) + set Page::($new_add_page,rest_addressobjattr) [array get ADDRESSOBJATTR] + + # Divides the main frame into three frames + UI_PB_addr_CreateAddrFrames new_add_page + + # Creates leader, format and trailer buttons + UI_PB_addr_CreateLeadFmtTrailButtons new_add_page + + # Creates the parameters of Address in the middle frame + UI_PB_addr_CreateMiddleFrameParam new_add_page + + # Activate the address ui items based upon the value that is set + UI_PB_addr_ActivateAddrParams $new_add_page +} + +#============================================================================== +proc UI_PB_add_EditAddActions { win BLK_PAGE_OBJ NEW_ADD_PAGE BLK_ELEM_OBJ} { +#============================================================================== + upvar $BLK_PAGE_OBJ blk_page_obj + upvar $NEW_ADD_PAGE new_add_page + upvar $BLK_ELEM_OBJ blk_elem_obj + global paOption + + # Creates the Action buttons + set ff $Page::($new_add_page,bottom_frame) + set box1_frm [frame $ff.box1] + set box2_frm [frame $ff.box2] + + tixForm $box1_frm -top 0 -left 3 -right %50 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 3 -right %100 + + set bb1 [tixButtonBox $box1_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + set bb2 [tixButtonBox $box2_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + $bb1 add def -text Default -width 10 -underline 0 -command \ + "UI_PB_addr_AddDefaultCallBack $new_add_page" + $bb1 add rest -text Restore -underline 0 -width 10 -command \ + "UI_PB_addr_AddRestoreCallBack $new_add_page" + + $bb2 add canc -text Cancel -underline 0 -width 10 -command \ + "UI_PB_add_EditCancelCallBack $new_add_page $win" + $bb2 add ok -text Ok -width 10 -underline 0 -command \ + "UI_PB_add_EditOkCallBack $blk_page_obj $new_add_page $win \ + $blk_elem_obj" + pack $bb1 -fill x + pack $bb2 -fill x +} + +#============================================================================= +# It is a OK Callback proceduer. It updates the attributes of an address +# and destroys the top level. +# +# Inputs : Address page object +# window id +# +# Outputs : updates the address attributes & destroys the toplevel +# +#============================================================================= +proc UI_PB_add_EditOkCallBack { blk_page_obj add_page_obj win blk_elem_obj } { +#============================================================================= + global elem_text_var + + # Updates the mom varaible of the element + set block_element::($blk_elem_obj,elem_mom_variable) $elem_text_var + + # Updates the address attributes + UI_PB_addr_ApplyCurrentAddrData add_page_obj + set add_obj $block_element::($blk_elem_obj,elem_add_obj) + set base_addr $address::($add_obj,add_name) + UI_PB_blk_ReplaceIcon blk_page_obj $base_addr $blk_elem_obj + + # Configures the element buttons + UI_PB_blk_ConfigureLeader blk_page_obj blk_elem_obj + +### grab release $win + tixDestroy $win + + # Unset the new format page data +} + +#============================================================================= +# It is Cancel Callback procedure. It destroys the toplevel. +# +# Inputs : Address page object +# window id +# +# Outputs : Destroys the toplevel +# +#============================================================================= +proc UI_PB_add_EditCancelCallBack { add_page_obj win } { +#============================================================================= + +### grab release $win + tixDestroy $win + + # Unset the new format page data +} + +#============================================================================== +proc UI_PB_add_NewAddActions { win blk_page_obj event_obj evt_elem_obj \ + NEW_ADD_PAGE BLK_ELEM_OBJ page_name } { +#============================================================================== + upvar $NEW_ADD_PAGE new_add_page + upvar $BLK_ELEM_OBJ blk_elem_obj + global paOption + + # Creates the Action buttons + set ff $Page::($new_add_page,bottom_frame) + set box1_frm [frame $ff.box1] + set box2_frm [frame $ff.box2] + + tixForm $box1_frm -top 0 -left 3 -right %50 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 3 -right %100 + + set bb1 [tixButtonBox $box1_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + set bb2 [tixButtonBox $box2_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + $bb1 add def -text Default -width 10 -underline 0 -command \ + "UI_PB_addr_AddDefaultCallBack $new_add_page" + $bb1 add rest -text Restore -underline 0 -width 10 -command \ + "UI_PB_addr_AddRestoreCallBack $new_add_page" + + if { $page_name == "block" } \ + { + $bb2 add canc -text Cancel -underline 0 -width 10 -command \ + "UI_PB_add_NewBlkCancelCallBack $blk_page_obj $new_add_page $win \ + $blk_elem_obj" + } elseif { $page_name == "event" } \ + { + $bb2 add canc -text Cancel -underline 0 -width 10 -command \ + "UI_PB_add_NewEvtCancelCallBack $blk_page_obj $event_obj \ + $evt_elem_obj $new_add_page $win $blk_elem_obj" + } + + $bb2 add ok -text Ok -width 10 -underline 0 -command \ + "UI_PB_add_NewOkCallBack $blk_page_obj $new_add_page $win \ + $blk_elem_obj" + pack $bb1 -fill x + pack $bb2 -fill x +} + +#============================================================================= +proc UI_PB_add_NewBlkCancelCallBack { blk_page_obj add_page_obj win \ + blk_elem_obj } { +#============================================================================= + + set add_obj $block_element::($blk_elem_obj,elem_add_obj) + PB_int_RemoveAddObjFromList add_obj + + set Page::($blk_page_obj,source_elem_obj) $blk_elem_obj + UI_PB_blk_UpdateCells blk_page_obj + +### grab release $win + tixDestroy $win + +} + +#============================================================================= +proc UI_PB_add_NewEvtCancelCallBack { blk_page_obj event_obj evt_elem_obj \ + new_add_page win blk_elem_obj } { +#============================================================================= + set add_obj $block_element::($blk_elem_obj,elem_add_obj) + PB_int_RemoveAddObjFromList add_obj + + set Page::($blk_page_obj,source_blk_elem_obj) $blk_elem_obj + set Page::($blk_page_obj,source_evt_elem_obj) $evt_elem_obj + + UI_PB_tpth_PutBlockElemTrash blk_page_obj event_obj + +### grab release $win + tixDestroy $win +} + +#============================================================================= +proc UI_PB_add_NewOkCallBack { blk_page_obj add_page_obj win blk_elem_obj } { +#============================================================================= + global elem_text_var + + # Updates the address attributes + UI_PB_addr_ApplyCurrentAddrData add_page_obj + + # Database call returns the descrptions of all mom variables + PB_int_GetWordVarDesc WordDescArray + + # Replaces the icon + set block_element::($blk_elem_obj,elem_mom_variable) $elem_text_var + set addr_obj $block_element::($blk_elem_obj,elem_add_obj) + set base_addr $address::($addr_obj,add_name) + set WordDescArray($base_addr) "" + PB_int_UpdateAddVariablesAttr WordDescArray base_addr + + UI_PB_blk_ReplaceIcon blk_page_obj $base_addr $blk_elem_obj + + # Configures the element buttons + UI_PB_blk_ConfigureLeader blk_page_obj blk_elem_obj + +### grab release $win + tixDestroy $win +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_addrseq.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_addrseq.tcl new file mode 100644 index 0000000..824e08a --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_addrseq.tcl @@ -0,0 +1,1148 @@ +#========================================================================= +# UI_PB_ADDRSEQ.TCL +#========================================================================= +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Address Sequence page.. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-Feb-1999 mnb Initial # +# 10-Mar-1999 gsl Used real balloon mechanism for Master Sequence. # +# 10-Mar-1999 gsl Revised popup mechanism for Master Sequence. # +# 02-Jun-1999 mnb Code Integration # +# 10-Jun-1999 mnb Removed address N from master sequence # +# 07-Sep-1999 mnb Added comments +# 21-Sep-1999 mnb New Address created in Block/Address page can be # +# sequenced. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#========================================================================= +# Main procedure of the Word Sequencing Page . This procedure is called +# when the word Sequence page is selected for the first time. It basically +# creates the widgets required for sequenceing the addresses. +# +# Inputs : Post Builder Book id +# Master Sequence page object +# +# Outputs : Widgets of Master sequence page +# +#========================================================================= +proc UI_PB_ProgTpth_WordSeq {book_id mseq_page} { +#========================================================================= + global paOption + + # Gets the master sequence page id + set Page::($mseq_page,page_id) [$book_id subwidget \ + $Page::($mseq_page,page_name)] + + # Sets the master sequence page attributes + UI_PB_mseq_SetPageAttributes mseq_page + + # Creates top and bottom canvas of master sequence + UI_PB_mseq_CreateMastSeqCanvas mseq_page + + # Creates attributes of the box ( Default & Restore buttons) + $Page::($mseq_page,box) config -bg $paOption(butt_bg) + $Page::($mseq_page,box) add def -text Default \ + -command "UI_PB_mseq_DefaultCallBack $mseq_page" -width 10 + $Page::($mseq_page,box) add rst -text Restore \ + -command "UI_PB_mseq_RestoreCallBack $mseq_page" -width 10 + + # Bind popup menu to Mseq components + set bot_canvas $Page::($mseq_page,bot_canvas) + set menu [menu $bot_canvas.pop] + $menu config -bg $paOption(popup) -tearoff 0 + set Page::($mseq_page,menu) $menu + bind $bot_canvas <3> "UI_PB_mseq_PopupSetOptions $mseq_page %X %Y" +} + +#======================================================================== +# This proceduer gets the address object list from database, sorts them +# according to the master sequence and displays them in the master seq +# Page. It also makes a copy of the address data as restore data. +# +# Inputs : Master Seq page object +# +# Outputs : Displays addresses acctoding to their sequence +# +#======================================================================== +proc UI_PB_mseq_CreateMastSeqElements { PAGE_OBJ } { +#======================================================================== + upvar $PAGE_OBJ page_obj + + # Creates the master sequence elements + PB_int_RetAddressObjList add_obj_list + foreach addr_obj $add_obj_list \ + { + address::RestoreMseqAttr $addr_obj + } + + # Sorts the addresses according to their master sequence + UI_PB_mseq_SortAddresses add_obj_list + + # Displays the address as the icons in the mseq page + UI_PB_mseq_CreateComponents page_obj add_obj_list +} + +#========================================================================= +# This procedure sets the master sequence page attributes. +# +# Inputs : Mseq page object +# +# Outputs : page attributes +# +#========================================================================= +proc UI_PB_mseq_SetPageAttributes { PAGE_OBJ } { +#========================================================================= + upvar $PAGE_OBJ page_obj + + set Page::($page_obj,in_focus_cell_obj) 0 + set Page::($page_obj,out_focus_cell_obj) 0 + set Page::($page_obj,in_focus_divi_obj) 0 + set Page::($page_obj,out_focus_divi_obj) 0 + set Page::($page_obj,drag_sensitivity) 3 + set Page::($page_obj,x_icon) 0 + set Page::($page_obj,cell_color) 0 + set Page::($page_obj,divi_color) 0 +} + +#========================================================================= +# This procedure creates the canvas and active & inactive widgets. +# +# Inputs : Mseq page object +# +# Outputs : Canvas, active & inactive widgets +# +#========================================================================= +proc UI_PB_mseq_CreateMastSeqCanvas { PAGE_OBJ } { +#========================================================================= + upvar $PAGE_OBJ page_obj + global paOption + + set page_id $Page::($page_obj,page_id) + + # top & botttom Canvas dimensions + set top_canvas_dim(0) 100 + set top_canvas_dim(1) 100 + set bot_canvas_dim(0) 1000 + set bot_canvas_dim(1) 1000 + + set fy [frame $page_id.f] + pack $fy -fill both -expand yes + + set canvas_frame [frame $fy.f] + pack $canvas_frame -expand yes -fill both + set Page::($page_obj,canvas_frame) $canvas_frame + Page::CreateCanvas $page_obj top_canvas_dim bot_canvas_dim + + set top_canvas $Page::($page_obj,top_canvas) + set frm1 [frame $top_canvas.fm1] + set frm2 [frame $top_canvas.fm2] + + pack $frm1 $frm2 -side left -padx 130 -pady 20 -fill both -expand yes + + # Widgets in the tp canvas + label $frm1.bit1 -height 1 -width 2 -background pink -relief sunken -bd 2 + label $frm1.l1 -text " Output - Active " + label $frm2.l2 -text " Output - Suppressed " + label $frm2.bit2 -height 1 -width 2 -background #c0c0ff -relief raised -bd 2 + + pack $frm1.l1 $frm1.bit1 -side right -padx 4 -pady 8 + pack $frm2.bit2 $frm2.l2 -side left -padx 4 -pady 8 +} + +#=============================================================================== +# This procedure adds the options to the popup menu. It activates the +# popup options only when the cursor is on the address icons. +# +# Inputs : Mseq Page Object +# +# Outputs : popup options +# +#=============================================================================== +proc UI_PB_mseq_PopupSetOptions { page_obj x y } { +#=============================================================================== + if {![info exists Page::($page_obj,popup_flag)]} \ + { + set Page::($page_obj,popup_flag) 0 + } + + set popup_flag $Page::($page_obj,popup_flag) + set menu $Page::($page_obj,menu) + + if {$popup_flag == 0} \ + { + $menu delete 0 end + $menu add command -label "New" -state normal \ + -command "UI_PB_mseq_CreateUDIcon" + $menu add command -label "Edit" -state disabled + $menu add sep + $menu add command -label "Delete" -state disabled + $menu add sep + $menu add command -label "Activate All" -state normal \ + -command "UI_PB_mseq_ActivateAllIcons $page_obj" + + } else { ;# On element + + $menu delete 0 end + $menu add command -label "New" -state normal \ + -command "UI_PB_mseq_CreateUDIcon" + $menu add command -label "Edit" -state normal \ + -command "" + $menu add sep + $menu add command -label "Delete" -command "" + $menu add sep + $menu add command -label "Activate All" -state normal \ + -command "UI_PB_mseq_ActivateAllIcons $page_obj" + + set Page::($page_obj,popup_flag) 0 + } + + # Utilize end_drag callback to swap addresses when needed. + if [info exists Page::($page_obj,being_dragged)] \ + { + if {$Page::($page_obj,being_dragged) == \ + $Page::($page_obj,drag_sensitivity)} \ + { + UI_PB_mseq_ItemEndDrag $page_obj + } + } + + # Position popup menu per longest label + paddings + set fnt [lindex [$menu config -font] end] + set dx [font measure $fnt "Activate All"] + tk_popup $menu [expr $x + $dx/2 + 15] [expr $y + 13] 0 +} + +#=============================================================================== +# It is a callback procedure attached to the third mouse button & bind to the +# address icon. +#=============================================================================== +proc UI_PB_mseq_PopupMenu { page_obj } { +#=============================================================================== + + set Page::($page_obj,popup_flag) 1 +} + +#=============================================================================== +# This procedure pops up the under construction message, when the create +# option is selected from the popup menu. +#=============================================================================== +proc UI_PB_mseq_CreateUDIcon {} { +#=============================================================================== + +#PoP-Up Message + tk_messageBox -type ok -icon error\ + -message "Under construction" + +} + +#=============================================================================== +# This is a callback procedure attached to the popup menu option "Activate All" +# It bascially activates all the icons .. by sunkening the icons +# +# Inputs : Mseq Page Object +# +# Outputs : Activates all the addresses +# +#=============================================================================== +proc UI_PB_mseq_ActivateAllIcons { page_obj } { +#=============================================================================== + foreach elem_obj $Page::($page_obj,mseq_addr_list) \ + { + if {$address::($elem_obj,word_status)} \ + { + $address::($elem_obj,icon_id) configure \ + -relief sunken -background pink + set address::($elem_obj,word_status) 0 + } + } +} + +#============================================================================== +# This proceduer stores the master sequence index of the address in the +# address object. +# +# Inputs : Mseq page object +# +# Outputs : master sequence index is stored as an attribute +# of address object. +# +#============================================================================== +proc UI_PB_mseq_ApplyMastSeq { PAGE_OBJ } { +#============================================================================== + upvar $PAGE_OBJ page_obj + + if { [info exists Page::($page_obj,mseq_addr_list)]} \ + { + set index 0 + foreach addr_obj $Page::($page_obj,mseq_addr_list) \ + { + set address::($addr_obj,seq_no) $index + incr index + } + } +} + +#============================================================================== +# This proceduer deletes all the widgets of the master sequence bot canvas. +#============================================================================== +proc UI_PB_mseq_DeleteMastSeqElems { PAGE_OBJ } { +#============================================================================== + upvar $PAGE_OBJ page_obj + set bot_canvas $Page::($page_obj,bot_canvas) + + # Deletes the icon, divided line & rectangle behind the icon + foreach elem_obj $Page::($page_obj,mseq_addr_list) \ + { + $bot_canvas delete $address::($elem_obj,image_id) + $bot_canvas delete $address::($elem_obj,divi_id) + $bot_canvas delete $address::($elem_obj,rect_id) + } + + # Deletes the divided lines at the end of the row + foreach divi_id $Page::($page_obj,divi_id) \ + { + $bot_canvas delete $divi_id + } + unset Page::($page_obj,mseq_addr_list) +} + +#============================================================================== +# This is a callback procedure attached to the restore action button of +# word sequence page. It bascially restores the master sequence. +# +#============================================================================== +proc UI_PB_mseq_RestoreCallBack { page_obj } { +#=============================================================================== + UI_PB_mseq_DeleteMastSeqElems page_obj + + # Gets the address object list from the data base + PB_adr_RetAddressObjList add_obj_list + + # sets the restore data as the current data of an address + foreach addr_obj $add_obj_list \ + { + array set add_mseq_attr $address::($addr_obj,rest_mseq_attr) + address::SetMseqAttr $addr_obj add_mseq_attr + unset add_mseq_attr + } + + # Sorts the address according to the restore sequence + UI_PB_mseq_SortAddresses add_obj_list + + # Displays all the addresses in the page + UI_PB_mseq_CreateComponents page_obj add_obj_list +} + +#=============================================================================== +# This is a callback proceduer attached to the Defualt action button of the +# Word Sequence page. It basically brings up the default master sequence. +#=============================================================================== +proc UI_PB_mseq_DefaultCallBack { page_obj } { +#=============================================================================== + + # Deletes the master sequence widgets + UI_PB_mseq_DeleteMastSeqElems page_obj + + # Gets the address object list from data base + PB_adr_RetAddressObjList add_obj_list + + # Sets default data as the current data + foreach addr_obj $add_obj_list \ + { + array set add_mseq_attr $address::($addr_obj,def_mseq_attr) + address::SetMseqAttr $addr_obj add_mseq_attr + unset add_mseq_attr + } + + # Sorts the address according to the default sequence + UI_PB_mseq_SortAddresses add_obj_list + + # Displays the addresses as icons in the page + UI_PB_mseq_CreateComponents page_obj add_obj_list +} + +#=============================================================================== +# This proceduer displays each address as an icon in the mseq page. +# It uses the leader of an address to get the image name and the +# representive mom variable for the text that goes with the icon. +#=============================================================================== +proc UI_PB_mseq_CreateComponents { PAGE_OBJ ADD_OBJ_LIST } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $ADD_OBJ_LIST add_obj_list + global tixOption + + set bot_canvas $Page::($page_obj,bot_canvas) + set h_cell 30 ;# cell height + set w_cell 52 ;# cell width + set w_divi 4 ;# divider width + set x_orig 100 ;# upper-left corner of 1st cell + set y_orig 75 + set cell_color paleturquoise + set divi_color turquoise + set no_rowelem 12 + + #Create several compound images in the canvas + set total_elems [llength $add_obj_list] + + set rows [expr $total_elems / $no_rowelem] + if { [expr $total_elems % $no_rowelem] } \ + { + incr rows + } + + #---------------------------------------- + # Create rectangular cells to hold icons + #---------------------------------------- + set x0 $x_orig + set y0 $y_orig + set yc [expr $y0 + [expr $h_cell / 2]] + set count 0 + + for {set no 0} {$no < $rows} {incr no} \ + { + set ii 0 + while {$ii < $no_rowelem && $count < $total_elems} \ + { + set addr_obj [lindex $add_obj_list $count] + address::readMseqAttr $addr_obj addr_mseq_attr + lappend mseq_addr_list $addr_obj + + #-------------- + # Divider cell + #-------------- + set y1 [expr $y0 + $h_cell] + set x1 [expr $x0 + $w_divi] + + lappend corner $x0 $y0 $x1 $y1 + set address::($addr_obj,divi_dim) $corner + unset corner + + set address::($addr_obj,divi_id) [UI_PB_com_CreateRectangle \ + $bot_canvas $x0 $y0 $x1 $y1 $divi_color $divi_color] + #-------------- + # Holding cell + #-------------- + set x0 $x1 + set x1 [expr $x0 + $w_cell] + + lappend corner $x0 $y0 $x1 $y1 + set address::($addr_obj,rect_dim) $corner + unset corner + + set address::($addr_obj,rect_id) [UI_PB_com_CreateRectangle \ + $bot_canvas $x0 $y0 $x1 $y1 $cell_color $divi_color] + + # Place icons into cell + set xc [expr [expr $x0 + $x1] / 2] + + # Creates a image + UI_PB_com_RetImageAppdText addr_obj addr_mseq_attr(0) \ + temp_image_name addr_app_text + + set image_id [UI_PB_blk_CreateIcon $bot_canvas $temp_image_name \ + $addr_app_text] + set icon_id [$bot_canvas create image $xc $yc \ + -image $image_id -tag movable] + unset temp_image_name + unset addr_app_text + + set address::($addr_obj,image_id) $icon_id + set address::($addr_obj,icon_id) $image_id + set address::($addr_obj,xc) $xc + set address::($addr_obj,yc) $yc + + if { $address::($addr_obj,word_status) == 0} \ + { + $image_id configure -relief sunken -background pink + } else \ + { + $image_id configure -relief raised -background #c0c0ff + } + set x0 $x1 + incr count + incr ii + } + + #-------------- + # Last divider + #-------------- + if { $ii != 0} \ + { + set x1 [expr $x0 + $w_divi] + lappend corner $x0 $y0 $x1 $y1 + lappend divi_dim $corner + unset corner + + lappend divi_id [UI_PB_com_CreateRectangle $bot_canvas $x0 $y0 \ + $x1 $y1 $divi_color $divi_color] + set x0 $x_orig + set y0 [expr $y0 + $h_cell + 70] + set yc [expr $y0 + [expr $h_cell / 2]] + } + if { $count == $total_elems } { break } + } + + set Page::($page_obj,divi_dim) $divi_dim + set Page::($page_obj,divi_id) $divi_id + unset divi_dim + unset divi_id + + if {[info exist mseq_addr_list]} \ + { + set Page::($page_obj,mseq_addr_list) $mseq_addr_list + unset mseq_addr_list + } + + # Binds the elements of master sequence with mouse actions + UI_PB_mseq_BindProcs page_obj +} + +#=============================================================================== +# This proceduer binds all the mouse buttons with the callbacks. These +# proceduers are triggered when the cursor is in the bottom canvas only. +#=============================================================================== +proc UI_PB_mseq_BindProcs { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + #--------------------- + # Bind icons to mouse + #--------------------- + $bot_canvas bind movable <1> "UI_PB_mseq_ItemStartDrag $page_obj %x %y" + + $bot_canvas bind movable "UI_PB_mseq_ItemDrag $page_obj %x %y" + + $bot_canvas bind movable "UI_PB_mseq_ItemEndDrag $page_obj" + + $bot_canvas bind movable <3> "UI_PB_mseq_PopupMenu $page_obj" + + $bot_canvas bind movable "UI_PB_mseq_ItemFocusOn $page_obj %x %y" + + $bot_canvas bind movable "UI_PB_mseq_ItemFocusOff $page_obj" +} + +#========================================================================== +proc UI_PB_mseq_HighLightDividers { page_obj x y } { +#========================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + set focus_addrelem 0 + set check_type "divi_dim" + + UI_PB_mseq_GetBlkElemObjFromCursorPos page_obj focus_addrelem \ + $check_type $x $y + + set Page::($page_obj,in_focus_divi_obj) $focus_addrelem + + if { $Page::($page_obj,in_focus_divi_obj) } \ + { + set Page::($page_obj,add_act) "insert" + } + + if { $Page::($page_obj,in_focus_divi_obj) != \ + $Page::($page_obj,out_focus_divi_obj) } \ + { + UI_PB_mseq_UnHighLightCellDividers page_obj + + if { !$Page::($page_obj,in_focus_divi_obj) } { return } + + set cell_highlight_color navyblue + set in_focus_obj $Page::($page_obj,in_focus_divi_obj) + + set Page::($page_obj,divi_color) [lindex [$bot_canvas itemconfigure \ + $address::($in_focus_obj,divi_id) -fill] end] + $bot_canvas itemconfigure $address::($in_focus_obj,divi_id) \ + -fill $cell_highlight_color + set Page::($page_obj,out_focus_divi_obj) \ + $Page::($page_obj,in_focus_divi_obj) + } + +} + +#========================================================================== +proc UI_PB_mseq_GetBlkElemObjFromCursorPos { PAGE_OBJ ADDR_ELEM_OBJ \ + check_type x y } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $ADDR_ELEM_OBJ addr_elem_obj + set h_cell 40 + + #---------------------- + # Locate in-focus cell + #---------------------- + foreach addr_obj $Page::($page_obj,mseq_addr_list) \ + { + set corner $address::($addr_obj,$check_type) + if {$x >= [lindex $corner 0] && $x < [lindex $corner 2] && \ + $y >= [expr [lindex $corner 1] - $h_cell] && \ + $y < [expr [lindex $corner 3] + $h_cell]} \ + { + set addr_elem_obj $addr_obj + break + } + } +} + +#========================================================================== +proc UI_PB_mseq_UnHighLightCellDividers { PAGE_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + set bot_canvas $Page::($page_obj,bot_canvas) + + if { $Page::($page_obj,out_focus_cell_obj) } \ + { + set addr_obj $Page::($page_obj,out_focus_cell_obj) + $bot_canvas itemconfigure $address::($addr_obj,rect_id) \ + -fill $Page::($page_obj,cell_color) + set Page::($page_obj,out_focus_cell_obj) 0 + } + + if { $Page::($page_obj,out_focus_divi_obj) } \ + { + set addr_obj $Page::($page_obj,out_focus_divi_obj) + $bot_canvas itemconfigure $address::($addr_obj,divi_id) \ + -fill $Page::($page_obj,divi_color) + set Page::($page_obj,out_focus_divi_obj) 0 + } + + if { [info exists Page::($page_obj,balloon)] == 1} \ + { + $bot_canvas delete $Page::($page_obj,balloon) + $bot_canvas delete $Page::($page_obj,ball_text) + } +} + +#========================================================================== +proc UI_PB_mseq_ItemFocusOn { page_obj x y} { +#========================================================================== + global paOption + global gPB_help_tips + + set bot_canvas $Page::($page_obj,bot_canvas) + set x [$bot_canvas canvasx $x] + set y [$bot_canvas canvasy $y] + set focus_addrelem 0 + + set check_type "rect_dim" + UI_PB_mseq_GetBlkElemObjFromCursorPos page_obj focus_addrelem \ + $check_type $x $y + + set Page::($page_obj,in_focus_cell_obj) $focus_addrelem + if { $Page::($page_obj,in_focus_cell_obj) } \ + { + set Page::($page_obj,add_act) "swap" + } + + #--------------------------------------- + # Restore balloon to the dragged cell's + # when no other cell is in-focus. + #--------------------------------------- + if {$gPB_help_tips(state)} \ + { + if {!$Page::($page_obj,in_focus_cell_obj)} \ + { + global dragged_balloon + if [info exists dragged_balloon] \ + { + PB_init_balloons -color $paOption(balloon) + set gPB_help_tips($bot_canvas) $dragged_balloon + } + } + } + + #----------------------------- + # Highlight new in-focus cell + #----------------------------- + if { $Page::($page_obj,in_focus_cell_obj) != \ + $Page::($page_obj,out_focus_cell_obj) } \ + { + UI_PB_mseq_UnHighLightCellDividers page_obj + + if {$gPB_help_tips(state)} \ + { + PB_init_balloons -color $paOption(balloon) + } + + # Change balloon background if the in-focus cell isn't the one being dragged. + if {$gPB_help_tips(state)} \ + { + global dragged_cell + if [info exists dragged_cell] \ + { + if {$Page::($page_obj,in_focus_cell_obj) != $dragged_cell} \ + { + PB_init_balloons -color white + } + } + } + + # No cell's in-focus, nothing else to do... + if {!$Page::($page_obj,in_focus_cell_obj)} { return } + + set cell_highlight_color navyblue + set in_focus_obj $Page::($page_obj,in_focus_cell_obj) + + set Page::($page_obj,cell_color) [lindex [$bot_canvas itemconfigure \ + $address::($in_focus_obj,rect_id) -fill] end] + $bot_canvas itemconfigure $address::($in_focus_obj,rect_id) \ + -fill $cell_highlight_color + + if {$gPB_help_tips(state)} \ + { + UI_PB_mseq_CreateBalloon page_obj + } + set Page::($page_obj,out_focus_cell_obj) \ + $Page::($page_obj,in_focus_cell_obj) + } +} + +#========================================================================== +proc UI_PB_mseq_CreateBalloon { PAGE_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + + set c $Page::($page_obj,bot_canvas) + set in_focus_obj $Page::($page_obj,in_focus_cell_obj) + set desc $address::($in_focus_obj,word_desc) + set add_leader $address::($in_focus_obj,add_leader) + + set add_rep_mom_var $address::($in_focus_obj,rep_mom_var) + PB_com_MapMOMVariable in_focus_obj add_rep_mom_var elem_app_text + PB_int_ApplyFormatAppText in_focus_obj elem_app_text + + append word_desc $add_leader $elem_app_text - $desc + global gPB_help_tips + set gPB_help_tips($c) $word_desc + unset word_desc +} + +#============================================================================== +proc UI_PB_mseq_ItemFocusOff { page_obj } { +#=============================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + + # Restore cell color + if { $Page::($page_obj,out_focus_cell_obj) } \ + { + set out_focus_obj $Page::($page_obj,out_focus_cell_obj) + $bot_canvas itemconfigure $address::($out_focus_obj,rect_id) \ + -fill $Page::($page_obj,cell_color) + if { [info exists Page::($page_obj,balloon)] == 1} \ + { + $bot_canvas delete $Page::($page_obj,balloon) + $bot_canvas delete $Page::($page_obj,ball_text) + } + } + + # Delete balloon + global gPB_help_tips + if {$gPB_help_tips(state)} \ + { + if [info exists gPB_help_tips($bot_canvas)] { + unset gPB_help_tips($bot_canvas) + } + PB_cancel_balloon + } + + set Page::($page_obj,in_focus_cell_obj) 0 + set Page::($page_obj,out_focus_cell_obj) 0 +} + +#=============================================================================== +proc UI_PB_mseq_ItemStartDrag { page_obj x y} { +#=============================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + set Page::($page_obj,being_dragged) 0 + + # Highlight current icon + $bot_canvas raise current + set Page::($page_obj,x_icon) [$bot_canvas find withtag current] + + set origin_x [$bot_canvas canvasx $x] + set origin_y [$bot_canvas canvasy $y] + + set Page::($page_obj,last_x) $origin_x + set Page::($page_obj,last_y) $origin_y + + # Highlight in-focus cell + UI_PB_mseq_ItemFocusOn $page_obj $x $y + + # Remember what's being dragged. + global gPB_help_tips + global dragged_balloon dragged_cell + if {$gPB_help_tips(state)} \ + { + set dragged_balloon $gPB_help_tips($bot_canvas) + set dragged_cell $Page::($page_obj,in_focus_cell_obj) + } +} + +#=========================================================================== +proc UI_PB_mseq_ItemDrag { page_obj x y} { +#=========================================================================== + if {$Page::($page_obj,being_dragged) < $Page::($page_obj,drag_sensitivity)} \ + { + incr Page::($page_obj,being_dragged) + } + + set bot_canvas $Page::($page_obj,bot_canvas) + set xc [$bot_canvas canvasx $x] + set yc [$bot_canvas canvasy $y] + + # Translate element + $bot_canvas move current [expr $xc - $Page::($page_obj,last_x)] \ + [expr $yc - $Page::($page_obj,last_y)] + + set Page::($page_obj,last_x) $xc + set Page::($page_obj,last_y) $yc + + # Highlight in-focus cell + UI_PB_mseq_ItemFocusOn $page_obj $x $y + UI_PB_mseq_HighLightDividers $page_obj $x $y + + # Draw a connecting line from current object to in-focus cell + UI_PB_mseq_DrawConnectLine page_obj + + # To cover the connecting line + if { $Page::($page_obj,in_focus_cell_obj) } \ + { + set in_focus_obj $Page::($page_obj,in_focus_cell_obj) + $bot_canvas raise $address::($in_focus_obj,rect_id) + } + + # To cover the connecting line + if { $Page::($page_obj,in_focus_divi_obj) } \ + { + set in_focus_obj $Page::($page_obj,in_focus_divi_obj) + $bot_canvas raise $address::($in_focus_obj,divi_id) + } + $bot_canvas raise movable +} + +#=============================================================================== +proc UI_PB_mseq_DrawConnectLine { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Make sure there's a cell in-focus. + if {$Page::($page_obj,in_focus_cell_obj) || \ + $Page::($page_obj,in_focus_divi_obj)} \ + { + set vtx {} + if { $Page::($page_obj,in_focus_cell_obj)} \ + { + set in_focus_obj $Page::($page_obj,in_focus_cell_obj) + set coords [$bot_canvas coords $address::($in_focus_obj,rect_id)] + } else \ + { + set in_focus_obj $Page::($page_obj,in_focus_divi_obj) + set coords [$bot_canvas coords $address::($in_focus_obj,divi_id)] + } + + # Center of cell + set x0 [lindex $coords 0] + set y0 [lindex $coords 1] + set x1 [lindex $coords 2] + set y1 [lindex $coords 3] + lappend vtx [expr [expr $x0 + $x1] / 2] [expr [expr $y0 + $y1] / 2] + + # Center of icon in action + set coords [$bot_canvas coords current] + set x1 [expr [lindex $coords 0] + 1] + set y1 [lindex $coords 1] + lappend vtx $x1 $y1 + set x1 [expr $x1 - 2] + lappend vtx $x1 $y1 + + # Draw line + if {[$bot_canvas gettags connect_line] == "connect_line"} { + + eval {$bot_canvas coords connect_line} $vtx + + } else { + + eval {$bot_canvas create poly} $vtx {-fill $paOption(focus) \ + -outline $paOption(focus) \ + -tag connect_line} + } + } else { + + if {[$bot_canvas gettags connect_line] == "connect_line"} \ + { + $bot_canvas delete connect_line + } + } +} + +#=============================================================================== +proc UI_PB_mseq_ItemEndDrag { page_obj } { +#=============================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + + UI_PB_mseq_UnHighLightCellDividers page_obj + + # Delete connecting line + $bot_canvas delete connect_line + + # Find source cell number & id + foreach addr_obj $Page::($page_obj,mseq_addr_list) \ + { + if {$address::($addr_obj,image_id) == $Page::($page_obj,x_icon)} \ + { + set Page::($page_obj,source_elem_obj) $addr_obj + break; + } + } + + if {$Page::($page_obj,being_dragged) < $Page::($page_obj,drag_sensitivity)} \ + { + set im [$bot_canvas itemconfigure current -image] + set relief_status [[lindex $im end] cget -relief] + + switch $relief_status \ + { + raised { + [lindex $im end] configure -relief sunken \ + -background pink + set address::($addr_obj,word_status) 0 + } + + sunken { + [lindex $im end] configure -relief raised \ + -background #c0c0ff + set address::($addr_obj,word_status) 1 + } + } + } + + if {![string compare $Page::($page_obj,add_act) "swap"] } \ + { + UI_PB_mseq_SwapCells page_obj + } elseif { ![string compare $Page::($page_obj,add_act) "insert"] } \ + { + UI_PB_mseq_InsertCell page_obj + } else \ + { + UI_PB_mseq_ReturnCell page_obj + } + + set Page::($page_obj,add_act) 0 + set Page::($page_obj,x_icon) 0 + set Page::($page_obj,in_focus_cell_obj) 0 + set Page::($page_obj,out_focus_cell_obj) 0 + set Page::($page_obj,in_focus_divi_obj) 0 + set Page::($page_obj,out_focus_divi_obj) 0 + + # Cleanup balloon stuff + global gPB_help_tips + + if {$gPB_help_tips(state)} \ + { + if [info exists gPB_help_tips($bot_canvas)] { + unset gPB_help_tips($bot_canvas) + } + PB_cancel_balloon + + global dragged_balloon dragged_cell + if [info exists dragged_balloon] {unset dragged_balloon} + if [info exists dragged_cell] {unset dragged_cell} + } + set Page::($page_obj,being_dragged) 0 +} + +#=============================================================================== +proc UI_PB_mseq_ReturnCell { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + set bot_canvas $Page::($page_obj,bot_canvas) + set source_elem_obj $Page::($page_obj,source_elem_obj) + + $bot_canvas coords $address::($source_elem_obj,image_id) \ + $address::($source_elem_obj,xc) $address::($source_elem_obj,yc) +} + +#=============================================================================== +proc UI_PB_mseq_SwapCells { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + set bot_canvas $Page::($page_obj,bot_canvas) + + set source_elem_obj $Page::($page_obj,source_elem_obj) + set target_elem_obj $Page::($page_obj,in_focus_cell_obj) + + if {!$target_elem_obj}\ + { + set target_elem_obj $source_elem_obj + } + + # Relocate icons to new positions + $bot_canvas coords $address::($source_elem_obj,image_id) \ + $address::($target_elem_obj,xc) $address::($target_elem_obj,yc) + $bot_canvas coords $address::($target_elem_obj,image_id) \ + $address::($source_elem_obj,xc) $address::($source_elem_obj,yc) + + # Exchange data + # center of the icon + set x $address::($source_elem_obj,xc) + set y $address::($source_elem_obj,yc) + set address::($source_elem_obj,xc) $address::($target_elem_obj,xc) + set address::($source_elem_obj,yc) $address::($target_elem_obj,yc) + set address::($target_elem_obj,xc) $x + set address::($target_elem_obj,yc) $y + + # Corners of cell and divider + set rect_corner $address::($source_elem_obj,rect_dim) + set divi_corner $address::($source_elem_obj,divi_dim) + set address::($source_elem_obj,rect_dim) \ + $address::($target_elem_obj,rect_dim) + set address::($source_elem_obj,divi_dim) \ + $address::($target_elem_obj,divi_dim) + set address::($target_elem_obj,rect_dim) $rect_corner + set address::($target_elem_obj,divi_dim) $divi_corner + + # rect and divider ids + set rect_id $address::($source_elem_obj,rect_id) + set divi_id $address::($source_elem_obj,divi_id) + set address::($source_elem_obj,rect_id) $address::($target_elem_obj,rect_id) + set address::($source_elem_obj,divi_id) $address::($target_elem_obj,divi_id) + set address::($target_elem_obj,rect_id) $rect_id + set address::($target_elem_obj,divi_id) $divi_id + + set temp_elem_obj_list $Page::($page_obj,mseq_addr_list) + unset Page::($page_obj,mseq_addr_list) + + set source_index [lsearch $temp_elem_obj_list $source_elem_obj] + set target_index [lsearch $temp_elem_obj_list $target_elem_obj] + + set temp_elem_obj_list [lreplace $temp_elem_obj_list $source_index \ + $source_index $target_elem_obj] + set temp_elem_obj_list [lreplace $temp_elem_obj_list $target_index \ + $target_index $source_elem_obj] + set Page::($page_obj,mseq_addr_list) $temp_elem_obj_list + unset temp_elem_obj_list +} + +#============================================================================= +proc UI_PB_mseq_InsertCell { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + set bot_canvas $Page::($page_obj,bot_canvas) + + set mseq_addr_list $Page::($page_obj,mseq_addr_list) + set source_elem_obj $Page::($page_obj,source_elem_obj) + set target_elem_obj $Page::($page_obj,in_focus_divi_obj) + + if {$target_elem_obj == 0} { set target_elem_obj $source_elem_obj } + + set source_cell_num [lsearch $mseq_addr_list $source_elem_obj] + set target_cell_num [lsearch $mseq_addr_list $target_elem_obj] + + # if the source cell num is less than target then interchange the + # object ids + if {$target_cell_num > $source_cell_num} \ + { + set expression { set test [expr $ii > $source_cell_num ] } + incr target_cell_num -1 + set inc_num -1 + } else \ + { + set expression { set test [expr $ii < $source_cell_num ] } + set inc_num 1 + } + + # Sets all the attributes of source elem to temp variables + set source_xc $address::($source_elem_obj,xc) + set source_yc $address::($source_elem_obj,yc) + set source_rect_dim $address::($source_elem_obj,rect_dim) + set source_divi_dim $address::($source_elem_obj,divi_dim) + set source_rect_id $address::($source_elem_obj,rect_id) + set source_divi_id $address::($source_elem_obj,divi_id) + + set temp_elem_obj $source_elem_obj + for {set ii $target_cell_num} { [eval $expression] } {incr ii $inc_num} \ + { + set elem_obj [lindex $mseq_addr_list $ii] + $bot_canvas coords $address::($temp_elem_obj,image_id) \ + $address::($elem_obj,xc) $address::($elem_obj,yc) + set address::($temp_elem_obj,xc) $address::($elem_obj,xc) + set address::($temp_elem_obj,yc) $address::($elem_obj,yc) + set address::($temp_elem_obj,rect_dim) $address::($elem_obj,rect_dim) + set address::($temp_elem_obj,divi_dim) $address::($elem_obj,divi_dim) + set address::($temp_elem_obj,rect_id) $address::($elem_obj,rect_id) + set address::($temp_elem_obj,divi_id) $address::($elem_obj,divi_id) + + set mseq_addr_list [lreplace $mseq_addr_list $ii $ii $temp_elem_obj] + set temp_elem_obj $elem_obj + } + + set address::($temp_elem_obj,xc) $source_xc + set address::($temp_elem_obj,yc) $source_yc + set address::($temp_elem_obj,rect_dim) $source_rect_dim + set address::($temp_elem_obj,divi_dim) $source_divi_dim + set address::($temp_elem_obj,rect_id) $source_rect_id + set address::($temp_elem_obj,divi_id) $source_divi_id + $bot_canvas coords $address::($temp_elem_obj,image_id) \ + $source_xc $source_yc + set mseq_addr_list [lreplace $mseq_addr_list $source_cell_num \ + $source_cell_num $temp_elem_obj] + + unset Page::($page_obj,mseq_addr_list) + set Page::($page_obj,mseq_addr_list) $mseq_addr_list + unset mseq_addr_list +} + +#=============================================================================== +# This proceduer sorts the addresses according to the master sequence. +# The sequence number is stored as an attribute of an address object. +# +# Inputs : Address object list +# +# Outputs : Sorted address object list +# +#=============================================================================== +proc UI_PB_mseq_SortAddresses { ADD_OBJ_LIST } { +#=============================================================================== + upvar $ADD_OBJ_LIST add_obj_list + + foreach add_obj $add_obj_list \ + { + if {[string compare $address::($add_obj,rep_mom_var) ""]} \ + { + lappend new_add_list $add_obj + } + } + + set add_obj_list $new_add_list + set no_elements [llength $add_obj_list] + for {set ii 0} {$ii < [expr $no_elements - 1]} {incr ii} \ + { + for {set jj [expr $ii + 1]} {$jj < $no_elements} {incr jj} \ + { + set addr_ii_obj [lindex $add_obj_list $ii] + set addr_ii_indx $address::($addr_ii_obj,seq_no) + + set addr_jj_obj [lindex $add_obj_list $jj] + set addr_jj_indx $address::($addr_jj_obj,seq_no) + if {$addr_jj_indx < $addr_ii_indx} \ + { + set add_obj_list [lreplace $add_obj_list $ii $ii $addr_jj_obj] + set add_obj_list [lreplace $add_obj_list $jj $jj $addr_ii_obj] + } + } + } +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_addrsum.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_addrsum.tcl new file mode 100644 index 0000000..3fc1472 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_addrsum.tcl @@ -0,0 +1,1396 @@ +#============================================================================= +# UI_PB_ADDRSUM.TCL +#============================================================================= +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Address Summary page. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-Apr-1999 mnb Attached callbacks to action buttons # +# 26-Apr-1999 gsl Applied tixGrid. # +# 26-May-1999 gsl Attached popup menu to left mouse button for # +# Leader & Trailer. # +# 02-Jun-1999 mnb Code Integration # +# 09-Jun-1999 mnb Update Address, Format objects & Attached callbacks# +# to action buttons # +# 14-Jun-1999 gsl Associated balloons with Address names # +# 15-Jun-1999 mnb Attached callbacks to update the format # +# 15-Jun-1999 mnb Set selectmode to immediate for tixcontrol # +# 16-Jun-1999 mnb Updates format value # +# 01-Jul-1999 mnb Added new line option to End of Block # +# 07-Jul-1999 mnb Enables the entry when the option is set to text # +# 07-Sep-1999 mnb Added Address Data Type widget & Changes the # +# the status of widgets based upon the data type # +# 21-Sep-1999 mnb Adds & Deletes the addresses from the grid, based # +# upon the addition and creation of address in # +# Block/Address page. # +# 16-Nov-1999 gsl Revised UI_PB_ads_UpdateGridRows & # +# UI_PB_ads_TabAddrsumCreate to prevent tixGrid from # +# crash. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#***************************************************************************** +proc UI_PB_ProgTpth_AddSum {book_id page_obj} { +#***************************************************************************** + global paOption + + set Page::($page_obj,page_id) [$book_id subwidget \ + $Page::($page_obj,page_name)] + set page_id $Page::($page_obj,page_id) + + set top_frm [frame $page_id.top] + set mid_frm [frame $page_id.mid] + set bot_frm [frame $page_id.bot] + + pack $top_frm -side top -fill both -expand yes + pack $mid_frm -side top -fill both -expand yes -pady 5 + pack $bot_frm -side bottom -fill both -expand yes + + # Creates scroller window in top frame + tixScrolledGrid $top_frm.scr -bd 0 -scrollbar auto + [$top_frm.scr subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$top_frm.scr subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + + pack $top_frm.scr -padx 3 -pady 0 + set grid [$top_frm.scr subwidget grid] + + global gPB + set gPB(tix_grid) $grid + + $grid config -relief sunken -bd 3 \ + -formatcmd "SimpleFormat $grid" \ + -state disabled \ + -height 10 -width 9 + + # Set the size of the columns + # + $grid size col default -size auto -pad0 5 -pad1 5 + $grid size row default -size auto -pad0 3 -pad1 4 + + UI_PB_ads__CreateAdrAttributes page_obj $grid + UI_PB_ads__CreateSpecCharButton page_obj $mid_frm + UI_PB_ads__CreateActionButtons $bot_frm page_obj + + # Flag + set Page::($page_obj,addsum_flag) 0 +} + +#----------------------------------------------------------------------------- +proc SimpleFormat {w area x1 y1 x2 y2} { +#----------------------------------------------------------------------------- +# +# This command is called whenever the background of the grid needs to +# be reformatted. The x1, y1, x2, y2 specifies the four corners of the area +# that needs to be reformatted. +# +# area: +# x-margin: the horizontal margin +# y-margin: the vertical margin +# s-margin: the overlap area of the x- and y-margins +# main: The rest +# +#----------------------------------------------------------------------------- + global margin + global paOption + + set bg(s-margin) royalBlue + set bg(x-margin) $paOption(title_bg) + set bg(y-margin) $paOption(table_bg) + set bg(main) gray20 + + case $area { + main { + # The "grid" format is consecutive boxes without 3d borders + # + $w format grid $x1 $y1 $x2 $y2 -anchor se + } + {x-margin} { + $w format border $x1 $y1 $x2 $y2 \ + -fill 1 -relief raised -bd 2 -bg $bg($area) + } + {y-margin} { + $w format border $x1 $y1 $x2 $y2 \ + -fill 1 -relief raised -bd 2 -bg $bg($area) + } + {s-margin} { + $w format border $x1 $y1 $x2 $y2 \ + -fill 1 -relief raised -bd 2 -bg $bg($area) + } + } +} + +#============================================================================= +proc UI_PB_ads__CreateAdrAttributes { PAGE_OBJ grid } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global paOption tixOption + global addr_app_text + global gpb_addr_var + global gpb_fmt_var + + set title_col(0) "Address" + set title_col(1) "Leader" + set title_col(2) "Data Type" + set title_col(3) "Plus (+)" + set title_col(4) "Lead Zero" + set title_col(5) "Integer" + set title_col(6) "Decimal (.)" + set title_col(7) "Fraction" + set title_col(8) "Trail Zero" + set title_col(9) "Modality Override" + set title_col(10) "Minimum" + set title_col(11) "Maximum" + set title_col(12) "Trailer" + + set no_col 13 + + # Add column titles + # + set style [tixDisplayStyle text -refwindow $grid \ + -fg $paOption(title_fg) \ + -anchor c -font $tixOption(bold_font)] + + $grid set 0 0 -itemtype text -text $title_col(0) \ + -style [tixDisplayStyle text -refwindow $grid \ + -fg yellow -anchor c -font $tixOption(bold_font)] + + for {set col 1} {$col < $no_col} {incr col} { + $grid set $col 0 -itemtype text -text $title_col($col) -style $style + } + + PB_int_AddrSummaryAttr addsum_add_name_list addr_app_text add_desc_arr + set no_addr [llength $addsum_add_name_list] + set cur_addsum_list "" + for {set count 0} {$count < $no_addr} {incr count} \ + { + set add_name [lindex $addsum_add_name_list $count] + set add_desc $add_desc_arr($count) + + UI_PB_ads__CreateFirstColAttr $grid [expr $count + 1] $add_name $add_desc + UI_PB_ads__CreateSecColAttr $page_obj $grid [expr $count + 1] $add_name + lappend cur_addsum_list $add_name + } + set Page::($page_obj,cur_addsum_list) $cur_addsum_list + set Page::($page_obj,total_no_rows) [expr $count + 1] +} + +#============================================================================= +proc UI_PB_ads__CreateFirstColAttr { grid no_row add_name add_desc } { +#============================================================================= + global paOption tixOption + global addr_app_text + global gpb_addr_var + + + set name_frm $grid.name_$add_name + if { ![winfo exists $name_frm] } { + set name_frm [frame $grid.name_$add_name -bg lightSkyBlue] + set addn [button $name_frm.name -text $add_name \ + -font $tixOption(bold_font) \ + -width 10 -anchor w \ + -relief flat -bd 0 \ + -background $paOption(table_bg) \ + -highlightbackground $paOption(table_bg) \ + -state disabled \ + -disabledforeground blue \ + -cursor ""] + + bind $addn "+%W config -highlightbackground cyan" + bind $addn "+%W config -highlightbackground $paOption(table_bg)" + + pack $addn -side right -anchor e -padx 3 + PB_enable_balloon $addn + global gPB_help_tips + set gPB_help_tips($addn) $add_desc + } + $grid set 0 $no_row -itemtype window -window $name_frm + + set add_frm $grid.add_$add_name + if { ![winfo exists $add_frm] } { + set add_frm [frame $grid.add_$add_name] + + set but [entry $add_frm.but \ + -textvariable gpb_addr_var($add_name,leader_name) \ + -cursor hand2 \ + -width 5 -borderwidth 4 \ + -highlightcolor lightYellow \ + -background royalBlue \ + -foreground yellow \ + -selectbackground lightYellow \ + -selectforeground black] + + bind $but " CB__AttachPopupMenu page_obj $add_frm $add_name LEADER " + + set ent [entry $add_frm.ent -textvariable addr_app_text($add_name) \ + -state disabled -relief solid -width 6 -borderwidth 1 \ + -justify left -bg lightBlue] + pack $but -side left -anchor ne -padx 2 + pack $ent -side right -anchor nw -padx 2 -pady 5 + } + $grid set 1 $no_row -itemtype window -window $add_frm +} + +#----------------------------------------------------------------------------- +proc CB__AttachPopupMenu {PAGE_OBJ w add_name attr} { +#----------------------------------------------------------------------------- + upvar $PAGE_OBJ page_obj + + if {![winfo exists $w.pop]} \ + { + set menu [menu $w.pop -tearoff 0] + bind $w.but <1> "focus %W" + bind $w.but <3> "focus %W" + bind $w.but <3> "+tk_popup $menu %X %Y" + + UI_PB_ads__SetPopupOptions page_obj menu $w $add_name $attr + } +} + +#----------------------------------------------------------------------------- +proc getAttrType {attr} { +#----------------------------------------------------------------------------- + if {$attr == "LEADER"} \ + { + set type leader_name + } elseif {$attr == "TRAILER"} \ + { + set type trailer + } else \ + { + set answer [tk_messageBox -message \ + "Attribute type should be LEADER or TRAILER! \n(proc getAttrType)" \ + -type ok -icon error] + + set type leader_name + } + +return $type +} + +#============================================================================= +proc UI_PB_ads__SetPopupOptions {PAGE_OBJ MENU add_frm add_name attr} { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $MENU menu + global gpb_addr_var + + + set type [getAttrType $attr] + + set options_list {A B C D E F G H I J K L M N O \ + P Q R S T U V W X Y Z None} + + set count 1 + foreach ELEMENT $options_list \ + { + if {$ELEMENT == "None"} \ + { + set elmt "\"\"" + $menu add command -label $ELEMENT -command \ + "setLeaderTrailer $add_frm $add_name $type $elmt" + } elseif {$ELEMENT == "Help"} \ + { + $menu add command -label $ELEMENT + } else \ + { + if {$count == 1} \ + { + $menu add command -label $ELEMENT -columnbreak 1 -command \ + "setLeaderTrailer $add_frm $add_name $type $ELEMENT" + } else \ + { + $menu add command -label $ELEMENT -command \ + "setLeaderTrailer $add_frm $add_name $type $ELEMENT" + } + } + + if {$count == 9} \ + { + set count 0 + } + incr count + } +} + +#----------------------------------------------------------------------------- +proc setLeaderTrailer {add_frm add_name type elmt } { +#----------------------------------------------------------------------------- + global gpb_addr_var + global add_dis_attr + global AddObjAttr + + if {$type == "leader_name"} \ + { + set add_dis_attr(0) $elmt + } else \ + { + set add_dis_attr(2) $elmt + } + + set gpb_addr_var($add_name,$type) $elmt + $add_frm.but selection range 0 end +} + +#============================================================================= +proc UI_PB_ads__RadDataCallBack { grid row_no data_type format_name } { +#============================================================================= + global gPB + set grid $gPB(tix_grid) + + PB_int_GetAddrListFormat format_name fmt_addr_list + foreach add_name $fmt_addr_list \ + { + UI_PB_ads__DisableDataAttr $grid $add_name $data_type $format_name + } +} + +#============================================================================= +proc UI_PB_ads__DisableDataAttr { grid add_name data_type fmt_name } { +#============================================================================= + global gpb_fmt_var + + switch $data_type \ + { + "Int" { + $grid.plus_$add_name.ch config -state normal + $grid.lez_$add_name.ch config -state normal + $grid.int_$add_name.con config -state normal + $grid.dec_$add_name.ch config -state disabled + $grid.fra_$add_name.con config -state disabled + $grid.trz_$add_name.ch config -state disabled + $grid.min_$add_name.ent config -state normal + $grid.max_$add_name.ent config -state normal + update idletasks + } + + "Real" { + $grid.plus_$add_name.ch config -state normal + $grid.lez_$add_name.ch config -state normal + $grid.int_$add_name.con config -state normal + $grid.dec_$add_name.ch config -state normal + $grid.fra_$add_name.con config -state normal + $grid.trz_$add_name.ch config -state normal + $grid.min_$add_name.ent config -state normal + $grid.max_$add_name.ent config -state normal + update idletasks + } + + "Text" { + $grid.plus_$add_name.ch config -state disabled + $grid.lez_$add_name.ch config -state disabled + $grid.int_$add_name.con config -state disabled + $grid.dec_$add_name.ch config -state disabled + $grid.fra_$add_name.con config -state disabled + $grid.trz_$add_name.ch config -state disabled + $grid.min_$add_name.ent config -state disabled + $grid.max_$add_name.ent config -state disabled + update idletasks + } + } +} + +#============================================================================= +proc UI_PB_ads__CreateSecColAttr { page_obj grid no_row add_name } { +#============================================================================= + global gpb_addr_var + global gpb_fmt_var + global paOption + + set temp_var $gpb_addr_var($add_name,modal) + set fmt_name $gpb_addr_var($add_name,fmt_name) + + # Data Type widget + set dat_frm $grid.dat_$add_name + if { ![winfo exists $dat_frm] } { + set dat_frm [frame $grid.dat_$add_name] + radiobutton $dat_frm.int -text Int -variable \ + gpb_fmt_var($fmt_name,dtype) -value Integer \ + -command "UI_PB_ads__RadDataCallBack $grid $no_row Int $fmt_name" + radiobutton $dat_frm.flt -text Real -variable \ + gpb_fmt_var($fmt_name,dtype) -value "Real Number" \ + -command "UI_PB_ads__RadDataCallBack $grid $no_row Real $fmt_name" + radiobutton $dat_frm.text -text Text -variable \ + gpb_fmt_var($fmt_name,dtype) -value "Text String" \ + -command "UI_PB_ads__RadDataCallBack $grid $no_row Text $fmt_name" + + pack $dat_frm.int -side left -anchor ne + pack $dat_frm.flt -side left -anchor ne + pack $dat_frm.text -side right -anchor nw + } + $grid set 2 $no_row -itemtype window -window $dat_frm + + # Plus Widget + set pls_frm $grid.plus_$add_name + if { ![winfo exists $pls_frm] } { + set pls_frm [frame $grid.plus_$add_name] + set plus [checkbutton $pls_frm.ch \ + -command "UI_PB_UpdateAllAddFmt $page_obj $fmt_name" \ + -variable gpb_fmt_var($fmt_name,plus_status)] + pack $plus -anchor n + } + $grid set 3 $no_row -itemtype window -window $pls_frm + + # Leading zeros widget + set lez_frm $grid.lez_$add_name + if { ![winfo exists $lez_frm] } { + set lez_frm [frame $grid.lez_$add_name] + set lead_zero [checkbutton $lez_frm.ch \ + -command "UI_PB_UpdateAllAddFmt $page_obj $fmt_name" \ + -variable gpb_fmt_var($fmt_name,lead_zero)] + pack $lead_zero -anchor n + } + $grid set 4 $no_row -itemtype window -window $lez_frm + + # Integer widget + set int_frm $grid.int_$add_name + if { ![winfo exists $int_frm] } { + set int_frm [frame $grid.int_$add_name] + set var 0 + UI_PB_ads__CreateIntControl $page_obj $int_frm con $fmt_name $add_name \ + [expr $no_row - 1] + } + $grid set 5 $no_row -itemtype window -window $int_frm + + # Decimal widget + set dec_frm $grid.dec_$add_name + if { ![winfo exists $dec_frm] } { + set dec_frm [frame $grid.dec_$add_name] + set dec_pt [checkbutton $dec_frm.ch \ + -command "UI_PB_UpdateAllAddFmt $page_obj $fmt_name" \ + -variable gpb_fmt_var($fmt_name,decimal)] + pack $dec_pt -anchor n + } + $grid set 6 $no_row -itemtype window -window $dec_frm + + # Fraction widget + set fra_frm $grid.fra_$add_name + if { ![winfo exists $fra_frm] } { + set fra_frm [frame $grid.fra_$add_name] + set var 0 + UI_PB_ads__CreateFracControl $page_obj $fra_frm con $fmt_name $add_name \ + [expr $no_row - 1] + } + $grid set 7 $no_row -itemtype window -window $fra_frm + + # Trailing Zeros + set trz_frm $grid.trz_$add_name + if { ![winfo exists $trz_frm] } { + set trz_frm [frame $grid.trz_$add_name] + set trail_zero [checkbutton $trz_frm.ch \ + -command "UI_PB_UpdateAllAddFmt $page_obj $fmt_name" \ + -variable gpb_fmt_var($fmt_name,trailzero)] + pack $trail_zero -anchor n + } + $grid set 8 $no_row -itemtype window -window $trz_frm + + # Modality widget + set mod_frm $grid.modl_$add_name + if { ![winfo exists $mod_frm] } { + set mod_frm [frame $grid.modl_$add_name] + tixOptionMenu $mod_frm.opt \ + -variable gpb_addr_var($add_name,modal) \ + -options { menubutton.width 6 } + foreach opt {always once off} { + $mod_frm.opt add command $opt -label $opt + } + $mod_frm.opt config -value $temp_var + tixForm $mod_frm.opt -top 3 -left %10 -right %95 + } + $grid set 9 $no_row -itemtype window -window $mod_frm + + # Minimum widget + set min_frm $grid.min_$add_name + if { ![winfo exists $min_frm] } { + set min_frm [frame $grid.min_$add_name] + entry $min_frm.ent -width 8 -relief sunken \ + -textvariable gpb_addr_var($add_name,add_min) + + tixForm $min_frm.ent -top 3 -left %10 -right %95 + bind $min_frm.ent "UI_PB_com_ValidateDataOfEntry %W %K f" + bind $min_frm.ent { %W config -state normal } + } + $grid set 10 $no_row -itemtype window -window $min_frm + + # Maximum Widget + set max_frm $grid.max_$add_name + if { ![winfo exists $max_frm] } { + set max_frm [frame $grid.max_$add_name] + entry $max_frm.ent -width 8 -relief sunken \ + -textvariable gpb_addr_var($add_name,add_max) + + tixForm $max_frm.ent -top 3 -left %10 -right %95 + bind $max_frm.ent "UI_PB_com_ValidateDataOfEntry %W %K f" + bind $max_frm.ent { %W config -state normal } + } + $grid set 11 $no_row -itemtype window -window $max_frm + + # Trailing Characters + set tra_frm $grid.trail_$add_name + if { ![winfo exists $tra_frm] } { + set tra_frm [frame $grid.trail_$add_name] + set but [entry $tra_frm.but \ + -textvariable gpb_addr_var($add_name,trailer) \ + -cursor hand2 \ + -width 5 -borderwidth 4 \ + -highlightcolor lightYellow \ + -background royalBlue \ + -foreground yellow \ + -selectbackground lightYellow \ + -selectforeground black] + bind $but " CB__AttachPopupMenu page_obj $tra_frm $add_name \ + TRAILER " + tixForm $but -top 3 -left 5 + } + $grid set 12 $no_row -itemtype window -window $tra_frm +} + +#============================================================================= +proc UI_PB_ads__CreateFracControl { page_obj inp_frm ext fmt_name add_name \ + no_row} { +#============================================================================= + global gpb_fmt_var + + tixControl $inp_frm.$ext -integer true \ + -command "UI_PB_UpdateFmtDisplay $page_obj $add_name $fmt_name \ + $no_row" \ + -selectmode immediate \ + -variable gpb_fmt_var($fmt_name,fraction) \ + -options { + entry.width 3 + label.anchor e + } + $inp_frm.$ext.frame config -relief sunken -bd 1 + $inp_frm.$ext.frame.entry config -relief flat + + grid $inp_frm.$ext -padx 5 -pady 4 +} + +#============================================================================= +proc UI_PB_ads__CreateIntControl { page_obj inp_frm ext fmt_name add_name \ + no_row} { +#============================================================================= + global gpb_fmt_var + + tixControl $inp_frm.$ext -integer true \ + -command "UI_PB_UpdateFmtDisplay $page_obj $add_name $fmt_name \ + $no_row" \ + -selectmode immediate \ + -variable gpb_fmt_var($fmt_name,integer) \ + -options { + entry.width 3 + label.anchor e + } + $inp_frm.$ext.frame config -relief sunken -bd 1 + $inp_frm.$ext.frame.entry config -relief flat + + grid $inp_frm.$ext -padx 5 -pady 4 + + pack $inp_frm.$ext.frame.entry -side right + pack $inp_frm.$ext.frame.incr -side top + pack $inp_frm.$ext.frame.decr -side bottom +} + +#============================================================================= +proc UI_PB_UpdateAllAddFmt { page_obj fmt_name args } { +#============================================================================= + set addr_name_list $Page::($page_obj,cur_addsum_list) + + PB_int_GetAddrListFormat fmt_name fmt_addr_list + + if {[info exists fmt_addr_list]} \ + { + foreach add_name $fmt_addr_list \ + { + set temp_index [lsearch $addr_name_list $add_name] + if {$temp_index != -1} \ + { + UI_PB_UpdateFmtDisplay $page_obj $add_name $fmt_name + } + } + } +} + +#============================================================================= +proc UI_PB_UpdateFmtDisplay { page_obj add_name fmt_name args } { +#============================================================================= + global gpb_fmt_var + global gpb_addr_var + global addr_app_text + + if {$gpb_fmt_var($fmt_name,decimal) == 1} \ + { + set fmt_obj_attr(1) "Real Number" + } elseif {$gpb_fmt_var($fmt_name,decimal) == 0 && \ + $gpb_fmt_var($fmt_name,integer) == 0} \ + { + set fmt_obj_attr(1) "Text String" + } elseif {$gpb_fmt_var($fmt_name,decimal) == 0} \ + { + set fmt_obj_attr(1) "Integer" + } + + set fmt_obj_attr(2) $gpb_fmt_var($fmt_name,plus_status) + set fmt_obj_attr(3) $gpb_fmt_var($fmt_name,lead_zero) + set fmt_obj_attr(4) $gpb_fmt_var($fmt_name,trailzero) + set fmt_obj_attr(5) $gpb_fmt_var($fmt_name,integer) + set fmt_obj_attr(6) $gpb_fmt_var($fmt_name,decimal) + set fmt_obj_attr(7) $gpb_fmt_var($fmt_name,fraction) + + set addr_name_list $Page::($page_obj,cur_addsum_list) + if { [lsearch $addr_name_list $add_name] != -1 } \ + { + PB_int_GetAdsFmtValue add_name fmt_obj_attr dis_attr + set addr_app_text($add_name) $dis_attr + } +} + +#============================================================================= +proc UI_PB_ads__CreateSpecCharButton { PAGE_OBJ mid_frm } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global paOption + + set bb [tixButtonBox $mid_frm.bb -orientation horizontal] + $bb config -relief flat -bg navyBlue -padx 7 -pady 6 + $bb add spec -text "Other Data Elements" + pack $bb -side bottom + + [$bb subwidget spec] config -padx 10 -command \ + "UI_PB_ads__CreateSpecialCharsWin $page_obj" +} + +#============================================================================= +proc UI_PB_ads__CreateSpecialCharsWin { page_obj } { +#============================================================================= + global paOption tixOption + global gPB + + set w [toplevel $gPB(active_window).spec] + + UI_PB_com_CreateTransientWindow $w "Other Data Elements" "+500+300" "" "" + + set page_frm [frame $w.f1 -relief sunken -bd 1] + pack $page_frm -fill both -expand yes -padx 6 -pady 5 + UI_PB_ads_CreateSpecialChars page_obj $page_frm + + set frame [frame $w.f2] + pack $frame -side bottom -fill x -padx 3 -pady 4 + + set box1_frm [frame $frame.box1] + set box2_frm [frame $frame.box2] + + tixForm $box1_frm -top 0 -left 3 -right %60 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 3 -right %100 + + set box1 [tixButtonBox $box1_frm.resapp \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + + set box2 [tixButtonBox $box2_frm.okcan \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + pack $box1 -fill x + pack $box2 -fill x + + # Box1 attributes + $box1 add def -text Default -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_ads_SpecDefaultCallBack" + + $box1 add rest -text Restore -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_ads_SpecRestCallBack $page_obj" + + $box1 add app -text Apply -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_ads_SpecApplyCallBack" + + # Box2 attributes + $box2 add canc -text Cancel -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "tixDestroy $w" + + $box2 add ok -text OK -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_ads_SpecOkCallBack $w" +} + +#============================================================================ +proc UI_PB_ads_SpecOkCallBack { w } { +#============================================================================ + + UI_PB_ads_SpecApplyCallBack + tixDestroy $w +} + +#============================================================================ +proc UI_PB_ads_SpecDefaultCallBack { } { +#============================================================================ + global mom_sys_arr + global special_char + set mom_var_list {0 "seqnum_start" 1 "seqnum_incr" 2 "seqnum_freq" \ + 3 "Word_Seperator" 4 "Decimal_Point" 5 "End_of_Block" \ + 6 "Comment_Start" 7 "Comment_End"} + + array set mom_var_arr $mom_var_list + PB_int_RetDefMOMVarValues mom_var_arr mom_var_value + + for {set count 0} {$count < 8} {incr count} \ + { + set var $mom_var_arr($count) + set mom_sys_arr($var) $mom_var_value($var) + } + + for {set count 3} {$count < 8} {incr count} \ + { + set option_lab $mom_var_arr($count) + UI_PB_ads__GetValuesforSpecOptions option_lab opt_value + set special_char($option_lab,label) $opt_value + set special_char($option_lab,char) $mom_sys_arr($option_lab) + } +} + +#============================================================================ +proc UI_PB_ads_SpecRestCallBack { page_obj } { +#============================================================================ + global mom_sys_arr + global special_char + set mom_var_list {"seqnum_start" "seqnum_incr" "seqnum_freq" \ + "Word_Seperator" "Decimal_Point" "End_of_Block" \ + "Comment_Start" "Comment_End"} + + array set rest_mom_value $Page::($page_obj,rest_spec_momvar) + foreach var $mom_var_list \ + { + set mom_sys_arr($var) $rest_mom_value($var) + } + + for {set count 3} {$count < 8} {incr count} \ + { + set option_lab [lindex $mom_var_list $count] + UI_PB_ads__GetValuesforSpecOptions option_lab opt_value + set special_char($option_lab,label) $opt_value + set special_char($option_lab,char) $mom_sys_arr($option_lab) + } +} + +#============================================================================ +proc UI_PB_ads_SpecApplyCallBack { } { +#============================================================================ + global mom_sys_arr + global special_char + set mom_var_list {"seqnum_start" "seqnum_incr" "seqnum_freq" \ + "Word_Seperator" "Decimal_Point" "End_of_Block" \ + "Comment_Start" "Comment_End"} + + for {set count 3} {$count < 8} {incr count} \ + { + set var [lindex $mom_var_list $count] + set mom_sys_arr($var) $special_char($var,char) + } + PB_int_UpdateMOMVar mom_sys_arr +} + +#***************************************************************************** +proc UI_PB_ads_CreateSpecialChars { PAGE_OBJ page_frm } { +#***************************************************************************** + upvar $PAGE_OBJ page_obj + global paOption tixOption + global mom_sys_arr + global gPB_gcode_no + global gPB_mcode_no + + set f [frame $page_frm.f] + pack $f -side top -pady 40 + + # Creates the frames + tixLabelFrame $f.top -label "Sequence Number" + tixLabelFrame $f.bot -label "Special Characters" + tixLabelFrame $f.gmcd -label "G & M Codes Output Per Block" + + tixForm $f.bot -top 10 -pady 5 \ + -left %50 -padx 10 + tixForm $f.gmcd -top $f.bot -pady 5 \ + -right $f.bot -padx 10 + tixForm $f.top -top 10 -pady 5 -bottom &$f.bot \ + -left &$f.gmcd -right $f.bot -padx 10 + #---------------- + # Sequence Number + #---------------- + set top_frm [$f.top subwidget frame] + + # Sequence Number suppression + set seqst_frm [frame $top_frm.status] + pack $seqst_frm -side top -fill x -expand yes -padx 10 + + checkbutton $seqst_frm.chk -text "Suppress Sequence Number Output" \ + -variable mom_sys_arr(SeqNo_output) -font $tixOption(font) \ + -relief flat -bd 2 -anchor c + pack $seqst_frm.chk -pady 10 -side left + + # Sequence Number Start + set start_frm [frame $top_frm.start] + pack $start_frm -side top -fill x -expand yes -padx 10 -pady 5 + + set start_left [frame $start_frm.left] + set start_right [frame $start_frm.right] + + pack $start_left -side left + pack $start_right -side right + + set lab_start [label $start_left.lbl -anchor w -text "Start" \ + -font $tixOption(font)] + pack $lab_start -side left -fill both + + set label "" + + Page::CreateIntControl seqnum_start $start_right int $label + + # Sequence Number Increment + set incr_frm [frame $top_frm.incr] + pack $incr_frm -side top -fill x -expand yes -padx 10 -pady 5 + + set incr_left [frame $incr_frm.left] + set incr_right [frame $incr_frm.right] + + pack $incr_left -side left + pack $incr_right -side right + + set lab_incr [label $incr_left.lbl -anchor w -text "Increment" \ + -font $tixOption(font)] + pack $lab_incr -side left -fill both + + Page::CreateIntControl seqnum_incr $incr_right int $label + + # Sequence Number Frequency + set freq_frm [frame $top_frm.freq] + pack $freq_frm -side top -fill x -expand yes -padx 10 -pady 5 + + set freq_left [frame $freq_frm.left] + set freq_right [frame $freq_frm.right] + + pack $freq_left -side left + pack $freq_right -side right + + set lab_freq [label $freq_left.lbl -anchor w -text "Frequency" \ + -font $tixOption(font)] + pack $lab_freq -side left -fill both + + Page::CreateIntControl seqnum_freq $freq_right int $label + + #------------------- + # Special Characters + #------------------- + set spc_frm [$f.bot subwidget frame] + + set option_1 {"None" "Space" "Decimal (.)" "Comma (,)" "Semicolon (;)" \ + "Colon (:)" "Text" } + + set option_2 {"None" "Left Parenthesis" "Right Parenthesis" \ + "Pound Sign (\#)" "Asterisk (*)" "Comma (,)" \ + "Semicolon (;)" "Colon (:)" "Slash (/)" \ + "Text" } + + set label_list {"Word_Seperator" "Decimal_Point" "End_of_Block" \ + "Comment_Start" "Comment_End"} + set count 0 + foreach label $label_list \ + { + if {$count < 2} \ + { + set options $option_1 + } elseif {$count == 2} \ + { + set options $option_1 + lappend options "New Line (\\012)" + } else \ + { + set options $option_2 + } + + UI_PB_ads__GetValuesforSpecOptions label default + UI_PB_ads__CreateSpecAttr $spc_frm $label $options $count $default + incr count + unset options + } + + #======================= + # G & M Codes Per Block + #======================= + set gmcd_frm [$f.gmcd subwidget frame] + + set gcd_frm [frame $gmcd_frm.gcd] + set mcd_frm [frame $gmcd_frm.mcd] + pack $gcd_frm -side top -fill both -padx 10 -pady 5 + pack $mcd_frm -side top -fill both -padx 10 -pady 5 + + set gPB_gcode_no 0 + set gPB_mcode_no 0 + if { $mom_sys_arr(\$mom_sys_gcodes_per_block) != "None" } \ + { + set gPB_gcode_no 1 + } + + if { $mom_sys_arr(\$mom_sys_mcodes_per_block) != "None" } \ + { + set gPB_mcode_no 1 + } + + checkbutton $gcd_frm.chk -variable gPB_gcode_no -relief flat -bd 2 \ + -anchor w -command "UI_PB_ads__SetStatusGMButton gcd $gcd_frm.int" + pack $gcd_frm.chk -side left + Page::CreateIntControl \$mom_sys_gcodes_per_block $gcd_frm int \ + "Number of G-Codes" + checkbutton $mcd_frm.chk -variable gPB_mcode_no -relief flat -bd 2 \ + -anchor w -command "UI_PB_ads__SetStatusGMButton mcd $mcd_frm.int" + pack $mcd_frm.chk -side left + Page::CreateIntControl \$mom_sys_mcodes_per_block $mcd_frm int \ + "Number of M-Codes" + UI_PB_ads__SetStatusGMButton gcd $gcd_frm.int + UI_PB_ads__SetStatusGMButton mcd $mcd_frm.int +} + +#============================================================================= +proc UI_PB_ads__SetStatusGMButton { type widget_id } { +#============================================================================= + global gPB_gcode_no + global gPB_mcode_no + global mom_sys_arr + + switch $type \ + { + "gcd" { + if { $gPB_gcode_no } \ + { + $widget_id config -state normal + } else \ + { + set mom_sys_arr(\$mom_sys_gcodes_per_block) "None" + $widget_id config -state disabled + } + } + + "mcd" { + if { $gPB_mcode_no } \ + { + $widget_id config -state normal + } else \ + { + set mom_sys_arr(\$mom_sys_mcodes_per_block) "None" + $widget_id config -state disabled + } + } + } +} + +#============================================================================= +proc UI_PB_ads__CreateSpecAttr { spc_frm label options count default} { +#============================================================================= + global special_char + global tixOption + + set special_char($label,label) $default + + set frame [frame $spc_frm.$count] + pack $frame -side top -fill both -padx 5 + + set temp_lab [split $label "_"] + set disp_lab [join $temp_lab " "] + set lbl [label $frame.lbl -text $disp_lab -anchor w \ + -font $tixOption(font)] + pack $lbl -side left -padx 5 -pady 2 + + set ent [entry $frame.ent -textvariable special_char($label,char) \ + -font $tixOption(bold_font) -bg lightBlue \ + -relief sunken -width 4] + set opt_menu [tixOptionMenu $frame.opt -variable special_char($label,label) \ + -command "UI_PB_ads__SetSpecChar $spc_frm $count $label" \ + -options { menubutton.width 14 + menubutton.height 1 + }] + UI_PB_ads__SetSpecChar $spc_frm $count $label + + foreach opt $options \ + { + $opt_menu add command $opt -label $opt + } + pack $opt_menu $ent -side right -fill x -padx 5 -pady 2 + $opt_menu config -value $default +} + +#============================================================================= +proc UI_PB_ads__GetValuesforSpecOptions { OPTION_LAB OPT_VALUE } { +#============================================================================= + upvar $OPTION_LAB option_lab + upvar $OPT_VALUE opt_value + + global mom_sys_arr + if {[string compare $mom_sys_arr($option_lab) " "] == 0} \ + { + set opt_value "Space" + } elseif {[string compare $mom_sys_arr($option_lab) ""] == 0} \ + { + set opt_value "None" + } else \ + { + switch $mom_sys_arr($option_lab) \ + { + "." {set opt_value "Decimal (.)"} + "," {set opt_value "Comma (,)"} + ";" {set opt_value "Semicolon (;)"} + ":" {set opt_value "Colon (:)"} + "(" {set opt_value "Left Parenthesis"} + ")" {set opt_value "Right Parenthesis"} + "\#" {set opt_value "Pound Sign (\#)"} + "*" {set opt_value "Asterisk (*)"} + "/" {set opt_value "Slash (/)"} + "\\012" {set opt_value "New Line (\\012)"} + default { + set opt_value "Text" + set special_char($option_lab,char) $mom_sys_arr($option_lab) + } + } + } +} + +#============================================================================= +proc UI_PB_ads__SetSpecChar { frame count option_lab args } { +#============================================================================= + global special_char + global mom_sys_arr + + switch $special_char($option_lab,label) \ + { + None { + set special_char($option_lab,char) "" + $frame.$count.ent config -state disabled + } + + Space { + set special_char($option_lab,char) " " + $frame.$count.ent config -state disabled + } + + "Decimal (.)" { + set special_char($option_lab,char) "." + $frame.$count.ent config -state disabled + } + + "Comma (,)" { + set special_char($option_lab,char) "," + $frame.$count.ent config -state disabled + } + + "Semicolon (;)" { + set special_char($option_lab,char) ";" + $frame.$count.ent config -state disabled + } + + "Colon (:)" { + set special_char($option_lab,char) ":" + $frame.$count.ent config -state disabled + } + + "Text" { + set special_char($option_lab,char) \ + $mom_sys_arr($option_lab) + $frame.$count.ent config -state normal + } + + "Left Parenthesis" { + set special_char($option_lab,char) "(" + $frame.$count.ent config -state disabled + } + + "Right Parenthesis" { + set special_char($option_lab,char) ")" + $frame.$count.ent config -state disabled + } + + "Pound Sign (\#)" { + set special_char($option_lab,char) "\#" + $frame.$count.ent config -state disabled + } + + "Asterisk (*)" { + set special_char($option_lab,char) "*" + $frame.$count.ent config -state disabled + } + + "Slash (/)" { + set special_char($option_lab,char) "/" + $frame.$count.ent config -state disabled + } + + "New Line (\\012)" { + set special_char($option_lab,char) "\\012" + $frame.$count.ent config -state disabled + } + } +} + +#============================================================================= +proc UI_PB_ads__CreateActionButtons { act_frm PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global paOption + + set box [tixButtonBox $act_frm.act \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + + pack $box -side bottom -fill x -padx 3 -pady 3 + + $box add def -text Default -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_ads__DefaultCallBack $page_obj" + $box add res -text Restore -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_ads__RestoreCallBack $page_obj" +} + +#============================================================================= +proc UI_PB_ads_UpdateDataWidgets { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global gpb_fmt_var gpb_addr_var + global gPB + + set grid $gPB(tix_grid) + + set add_name_list $Page::($page_obj,cur_addsum_list) + foreach add_name $add_name_list \ + { + set fmt_name $gpb_addr_var($add_name,fmt_name) + set data_type $gpb_fmt_var($fmt_name,dtype) + switch $data_type \ + { + "Integer" { set data_type "Int" } + "Real Number" { set data_type "Real" } + "Text String" { set data_type "Text" } + } + UI_PB_ads__DisableDataAttr $grid $add_name $data_type $fmt_name + } +} + +#============================================================================= +proc UI_PB_ads_UpdateAddrSumPage { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global gpb_fmt_var + global gpb_addr_var + global mom_sys_arr + + set Page::($page_obj,rest_gpb_fmt_var) [array get gpb_fmt_var] + set Page::($page_obj,rest_gpb_addr_var) [array get gpb_addr_var] + + # Restores the values of these mom variables + set mom_var_list {"seqnum_start" "seqnum_incr" "seqnum_freq" \ + "Word_Seperator" "Decimal_Point" "End_of_Block" \ + "Comment_Start" "Comment_End"} + + foreach var $mom_var_list \ + { + set rest_spec_momvar($var) $mom_sys_arr($var) + } + set Page::($page_obj,rest_spec_momvar) [array get rest_spec_momvar] + + PB_int_RetFormatObjList fmt_obj_list + foreach fmt_obj $fmt_obj_list \ + { + set fmt_name $format::($fmt_obj,for_name) + UI_PB_UpdateAllAddFmt $page_obj $fmt_name + } + + # Updates the data widgets + UI_PB_ads_UpdateDataWidgets page_obj +} + +#============================================================================= +proc UI_PB_ads__DefaultCallBack { page_obj } { +#============================================================================= + global gpb_fmt_var gpb_addr_var + + PB_int_RetDefAddrFmtArrys gpb_fmt_var gpb_addr_var + + # Updates the data widgets + UI_PB_ads_UpdateDataWidgets page_obj +} + +#============================================================================= +proc UI_PB_ads__RestoreCallBack { page_obj } { +#============================================================================= + global gpb_fmt_var + global gpb_addr_var + + array set gpb_fmt_var $Page::($page_obj,rest_gpb_fmt_var) + array set gpb_addr_var $Page::($page_obj,rest_gpb_addr_var) + + # Updates the data widgets + UI_PB_ads_UpdateDataWidgets +} + +#============================================================================= +proc UI_PB_ads_UpdateAddressObjects { } { +#============================================================================= + global gpb_addr_var + global gpb_fmt_var + + PB_int_RetAddressObjList add_obj_list + foreach add_obj $add_obj_list \ + { + address::readvalue $add_obj add_obj_attr + set add_name $add_obj_attr(0) + + # Address attributes + set add_obj_attr(2) $gpb_addr_var($add_name,modal) + set add_obj_attr(3) $gpb_addr_var($add_name,modl_status) + set add_obj_attr(4) $gpb_addr_var($add_name,add_max) + set add_obj_attr(5) $gpb_addr_var($add_name,max_status) + set add_obj_attr(6) $gpb_addr_var($add_name,add_min) + set add_obj_attr(7) $gpb_addr_var($add_name,min_status) + set add_obj_attr(8) $gpb_addr_var($add_name,leader_name) + set add_obj_attr(9) $gpb_addr_var($add_name,trailer) + set add_obj_attr(10) $gpb_addr_var($add_name,trail_status) + set add_obj_attr(11) gpb_addr_var($add_name,incremental) + address::setvalue $add_obj add_obj_attr + unset add_obj_attr + } + + PB_int_RetFormatObjList fmt_obj_list + foreach fmt_obj $fmt_obj_list \ + { + format::readvalue $fmt_obj fmt_obj_attr + set fmt_name $fmt_obj_attr(0) + + set fmt_obj_attr(1) $gpb_fmt_var($fmt_name,dtype) + set fmt_obj_attr(2) $gpb_fmt_var($fmt_name,plus_status) + set fmt_obj_attr(3) $gpb_fmt_var($fmt_name,lead_zero) + set fmt_obj_attr(4) $gpb_fmt_var($fmt_name,trailzero) + set fmt_obj_attr(5) $gpb_fmt_var($fmt_name,integer) + set fmt_obj_attr(6) $gpb_fmt_var($fmt_name,decimal) + set fmt_obj_attr(7) $gpb_fmt_var($fmt_name,fraction) + format::setvalue $fmt_obj fmt_obj_attr + unset fmt_obj_attr + } +} + +#=============================================================================== +proc UI_PB_ads_TabAddrsumCreate { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global gPB + + set grid $gPB(tix_grid) + set prev_addsum_list $Page::($page_obj,cur_addsum_list) + set prev_no_adds [llength $prev_addsum_list] + + PB_int_RetAddrNameList addr_name_list + + + # Cover the window during the construction of scrolled grid. + set page_id $Page::($page_obj,page_id) + set top $page_id.top + set tf $top.f + if { ![winfo exists $tf] } { + set tf [frame $top.f] + } + place $tf -x 0 -y 0 -relwidth 1 -relheight 1 + raise $tf + update + + # Deletes the address in the address summary page, which are deleted by user + set act_addsum_list "" + set count 1 + set no_of_deletes 0 + foreach add_name $prev_addsum_list \ + { + set index [lsearch $addr_name_list $add_name] + if { $index == -1 }\ + { + set act_row_no [expr $count - $no_of_deletes] + UI_PB_ads_UpdateGridRows $grid $act_row_no $add_name $prev_no_adds + incr prev_no_adds -1 + incr no_of_deletes + } else \ + { + lappend act_addsum_list $add_name + } + incr count + } + + + # Uncover the scrolled grid window. + place forget $tf + update + + + # Additions of new address elements to the address summary page + set new_add_list "" + foreach add_name $addr_name_list \ + { + if { [lsearch $prev_addsum_list $add_name] == -1 } \ + { + incr prev_no_adds + PB_int_RetAddrObjFromName add_name add_obj + set add_desc $address::($add_obj,word_desc) + UI_PB_ads__CreateFirstColAttr $grid $prev_no_adds $add_name $add_desc + UI_PB_ads__CreateSecColAttr $page_obj $grid $prev_no_adds $add_name + lappend new_add_list $add_name + } + } + + # appends all the new address to current addsummary list + foreach new_add $new_add_list \ + { + lappend act_addsum_list $new_add + } + + set Page::($page_obj,cur_addsum_list) $act_addsum_list + + # Updates the address summary widget status based upon the + # address attributes + UI_PB_ads_UpdateAddrSumPage page_obj +} + +#============================================================================== +proc UI_PB_ads_UpdateGridRows { grid row_no add_name total_no_rows } { +#=============================================================================== + + # Make entire grid table invisible + # -- Somehow this keeps the grid alive!!! + $grid config -height 1 + update idletasks + + # Delete the row + $grid delete row $row_no $row_no + + # Move up the rest of the table + if { $row_no < $total_no_rows } \ + { + set move_row [expr $row_no + 1] + $grid move row $move_row $total_no_rows -1 + } + + # Reveal grid table + if { $total_no_rows > 9 } { + $grid config -height 10 + } else { + $grid config -height $total_no_rows + } + update idletasks +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_advisor.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_advisor.tcl new file mode 100644 index 0000000..60e0294 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_advisor.tcl @@ -0,0 +1,292 @@ +#=============================================================================== +# UI_PB_ADVISOR.TCL +#=============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Advisor page.. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 gsl Initial # +# 07-Apr-1999 mnb Changed bitmap names # +# 02-Jun-1999 mnb Code Integration # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#=============================================================================== +proc UI_PB_Advisor {book_id adv_page_obj } { +#=============================================================================== + + AddNbPage [$book_id subwidget $Page::($adv_page_obj,page_name)] 0 +} + +#=============================================================================== +proc AddNbPage {w n} { +#=============================================================================== + global tixOption + global paOption + + set pane [tixPanedWindow $w.pane -orient horizontal] + pack $pane -expand yes -fill both + + set f1 [$pane add 1 -expand 1 -size 275] + set f2 [$pane add 3 -expand 3 -size 625] + $f1 config -relief flat + $f2 config -relief flat + + # Left pane: the Tree: + # + if { $n == 1 } { + set but [frame $f1.f] + set new [button $but.new -text "Create" \ + -bg $paOption(app_butt_bg)] + set del [button $but.del -text "Delete" \ + -bg $paOption(app_butt_bg)] + pack $new $del -side left -fill x -expand yes + } + + set tree [tixCheckList $f1.slb \ + -options { + relief sunken + hlist.indicator 1 + hlist.indent 20 + hlist.drawbranch 1 + hlist.selectMode single + hlist.width 40 + hlist.separator "." + hlist.wideselect false + }] +# +# set "hlist.indent 14" when XPM images are used in ChkList.tcl. +# + + # Attributes in the "-option" block can not be set using variables ($...). + # + [$tree subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$tree subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + if { $n == 1 } { + pack $but -side top -fill x -padx 7 + } + pack $tree -side top -fill both -expand yes -padx 5 + + # Right pane: the Text + # + set stext [tixScrolledText $f2.stext] + [$stext subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$stext subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + + + + set win [$stext subwidget text] + + label $win.title -font -*-times-bold-r-normal-*-24-*-*-*-*-*-*-*\ + -bd 0 -width 30 -anchor c \ + -text "Welcome to UG Post Builder version 0.0" + + message $win.msg -font -*-helvetica-bold-r-normal-*-18-*-*-*-*-*-*-*\ + -bd 0 -width 450 -anchor n \ + -text "Hello! I am the Post Advisor. I will assist you to walk through\ +every step for composing a Post-Processor that can be used in the UG Post. \ +When you follow my guideline and complete a step,\ +the check box next to that step will be marked. \ +You can skip to the step that you need assistance or wish to examine its parameters. \ +The Post Builder will supply default settings, with respect to the machine-tool/controller that you have selected, to any unchecked step. \ +You may also go directly to the component panels to modify the parameters, \ +then come back here to complete the remaining session, as you desire. \ +Good luck and have fun using the Post Builder!" + + + pack $win.title -expand yes -fill both + pack $win.msg -expand yes -fill both + + set f3 [frame $f2.f3] + + # Maneuver buttons box + # + set b_arr [tix getimage pb_b_arrow] + set f_arr [tix getimage pb_f_arrow] + + set bb [tixButtonBox $f3.bb -orientation horizontal] + $bb config -relief sunken -border 2 -bg $paOption(butt_bg) + + $bb add def -text Default -underline 0 -width 10 + + $bb add back + set b_img [image create compound -window [$bb subwidget back]] + $b_img add image -image $b_arr + [$bb subwidget back] config -image $b_img \ + -width 90 ;# -width for image in pixels + $bb add cont + set f_img [image create compound -window [$bb subwidget cont]] + $f_img add image -image $f_arr + [$bb subwidget cont] config -image $f_img -width 90 + + $bb add rej -text Cancel -underline 0 -width 10 + $bb add ok -text Done -underline 1 -width 10 + + pack $bb -side bottom -fill x + + pack $f3 -side bottom -fill x -padx 7 + pack $stext -side top -fill both -expand yes -padx 7 -pady 2 + + + # + # Set up the text subwidget + + set text [$stext subwidget text] + bind $text <1> "focus %W" + bind $text "%W yview scroll -1 unit" + bind $text "%W yview scroll 1 unit" + bind $text "%W xview scroll -1 unit" + bind $text "%W xview scroll 1 unit" + bind $text {focus [tk_focusNext %W]; break} + + bindtags $text "$text Text [winfo toplevel $text] all" + + $text config -bg [$tree subwidget hlist cget -bg] \ + -state disabled -font $tixOption(fixed_font) -wrap none + + set h [$tree subwidget hlist] + $h config -separator "." -width 30 -drawbranch 1 \ + -wideselect false + $h config -bg $paOption(tree_bg) + +## set style [tixDisplayStyle imagetext -refwindow $h +## -bg $paOption(tree_bg) -padx 4 -font $tixOption(bold_font)] + global gPB + set style $gPB(font_style_bold) + set style1 $gPB(font_style_normal) + + uplevel #0 set TRANSPARENT_GIF_COLOR [$h cget -bg] + + set folder $paOption(folder) + + set t 0 + $h add $t -itemtype imagetext -text "Machine Tool" -image $folder \ + -style $style -state disabled + $h add $t.0 -itemtype imagetext -text "Home Position" \ + -style $style1 + $h add $t.1 -itemtype imagetext -text "Resolution" \ + -style $style1 + $h add $t.2 -itemtype imagetext -text "Maximal Feed" \ + -style $style1 + $h add $t.3 -itemtype imagetext -text "Axes Limits" \ + -style $style1 + $h add $t.4 -itemtype imagetext -text "Offsets" \ + -style $style1 + $h add $t.5 -itemtype imagetext -text "Primary Ratation Head" \ + -style $style1 + $h add $t.6 -itemtype imagetext -text "Secondary Ratation Head" \ + -style $style1 + $h add $t.7 -itemtype imagetext -text "Miscellaneous" \ + -style $style1 + + $tree setstatus $t none + $tree setstatus $t.0 off + $tree setstatus $t.1 off + $tree setstatus $t.2 off + $tree setstatus $t.3 off + $tree setstatus $t.4 off + $tree setstatus $t.5 off + $tree setstatus $t.6 off + $tree setstatus $t.7 off + + set t [expr $t + 1] + $h add $t -itemtype imagetext -text "N/C Data" -image $folder \ + -style $style -state disabled + $h add $t.0 -itemtype imagetext -text "Data Format" \ + -style $style1 + $h add $t.1 -itemtype imagetext -text "Sequence Number" \ + -style $style1 + $h add $t.2 -itemtype imagetext -text "G Codes" \ + -style $style1 + $h add $t.3 -itemtype imagetext -text "M Codes" \ + -style $style1 + $h add $t.4 -itemtype imagetext -text "Absolute/Incremental" \ + -style $style1 + $h add $t.5 -itemtype imagetext -text "Inch/Metric Part Unit" \ + -style $style1 + + $tree setstatus $t none + $tree setstatus $t.0 off + $tree setstatus $t.1 off + $tree setstatus $t.2 off + $tree setstatus $t.3 off + $tree setstatus $t.4 off + $tree setstatus $t.5 off + + set t [expr $t + 1] + $h add $t -itemtype imagetext -text "Program" -image $folder \ + -style $style -state disabled + $h add $t.0 -itemtype imagetext -text "Start of Program" \ + -style $style1 + $h add $t.1 -itemtype imagetext -text "Start of Group" \ + -style $style1 + $h add $t.2 -itemtype imagetext -text "Start of Path" \ + -style $style1 + $h add $t.3 -itemtype imagetext -text "First Tool" \ + -style $style1 + $h add $t.4 -itemtype imagetext -text "Tool Change" \ + -style $style1 + + $tree setstatus $t none + $tree setstatus $t.0 off + $tree setstatus $t.1 off + $tree setstatus $t.2 off + $tree setstatus $t.3 off + $tree setstatus $t.4 off + + $h add $t.5 -itemtype imagetext -text "Motion" \ + -style $style + $h add $t.5.0 -itemtype imagetext -text "Initial Move" \ + -style $style1 + $h add $t.5.1 -itemtype imagetext -text "Linear Move" \ + -style $style1 + $h add $t.5.2 -itemtype imagetext -text "Circular Move" \ + -style $style1 + $h add $t.5.3 -itemtype imagetext -text "Drill Move" \ + -style $style1 + $h add $t.5.4 -itemtype imagetext -text "Tap Move" \ + -style $style1 + + $tree setstatus $t.5 off + $tree setstatus $t.5.0 off + $tree setstatus $t.5.1 off + $tree setstatus $t.5.2 off + $tree setstatus $t.5.3 off + $tree setstatus $t.5.4 off + + $h add $t.6 -itemtype imagetext -text "Cycle" \ + -style $style + $h add $t.6.0 -itemtype imagetext -text "Tap Cycle" \ + -style $style1 + $h add $t.6.1 -itemtype imagetext -text "Cycle Off" \ + -style $style1 + + $tree setstatus $t.6 off + $tree setstatus $t.6.0 off + $tree setstatus $t.6.1 off + + $h add $t.7 -itemtype imagetext -text "End of Path" \ + -style $style1 + $h add $t.8 -itemtype imagetext -text "End of Group" \ + -style $style1 + $h add $t.9 -itemtype imagetext -text "End of Program" \ + -style $style1 + + $tree setstatus $t.7 off + $tree setstatus $t.8 off + $tree setstatus $t.9 off + + $tree autosetmode +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_balloon.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_balloon.tcl new file mode 100644 index 0000000..15891b5 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_balloon.tcl @@ -0,0 +1,305 @@ +#=============================================================================== +# UI_PB_BALLOON.TCL +#=============================================================================== +################################################################################ +# Description # +# This file contains all functions dealing with the creation of # +# Ballon. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 gsl Initial # +# 02-Jun-1999 mnb Code Integration # +# 04-Jun-1999 gsl Reposition balloon w.r.t. screen size # +# 15-Jun-1999 mnb Removed puts # +# 28-Jun-1999 gsl Removed use of gPB_help_tips($name_to_bind\_enabled) # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +################################################################################ + +# Tcl Library to provide balloon help. +# balloon help bindings are automatically added to all buttons and +# menus by init_balloon call. +# you have only to provide descriptions for buttons or menu items by +# setting elements of global gPB_help_tips array, indexed by button path or +# menu path,item to something useful. +# if you want to have balloon helps for any other widget you can +# do so by enable_balloon widget_path_or_class +# or enable_balloon_selective widget_path_or_class Tcl_Script +# +# You can toggle balloon help globally on and off by setting variable +# gPB_use_balloons to true or false +################################################################################ +## +## +## BALLOON.TCL +## +## Help balloon Tcl library +## Copyright(c) by Victor B Wagner, 1997 +## +## Usage: +## +## 1. init balloon help system by calling init_balloons in startup part +## of yor Tcl application +## +## 2. Whenever you want particular widget to show help balloon, +## set an element of global array widget with index of widget name +## to desired text. This is almost all. +## +## for example: +## +## button .mywin.ok -text Ok -command do_it +## set help_tips(.mywin.ok) {Perform desired action} +## +## 3. For menu widget you can would have separate balloons for each item. +## Help_tips indices are formed of menu name and item number,separated by +## comma. +## +## for example +## +## menu .menu.file.m +## .menu.file.m add command -text Open -command open_file +## set help_tips(.menu.file.m,1) {Open an existing file} +## +## 4. You can toggle displaying of balloons on and off globally by setting +## global variable gPB_use_balloons to 1 (on) or 0 (off). +## Note: it is automatically turned on by init_balloons procedure. +## +## 5. Balloons for other widgets. +## comand enable_balloon allows to add balloons to widgets other than +## buttons and menus. +## +## It accepts following parameters: +## +## +## enable_balloon name_to_bind ?script? +## +## where name_to_bind can be any name, acceptable by bind, i.e +## either name of INDIVIDUAL WIDGET or WIDGET CLASS, and +## script is tcl function, which returns additional index for part of +## widget. If you omit it, you'll have same help text anywhere in widget. +## This script could contain any % substitutuins, acceptable by bind command. +## +## For menu widget I'm using "%W index active" +## +## Further custimization: +## +## init_balloons accept three options +## -delay value +## delay between last mouse event and instant, when balloon appear. +## delay must be specified in milliseconds as for after command +## -width pixels +## width of balloon, specified in units, suitable for -wraplength option +## of label widget +## +## -color color +## background color of ballon. Any form, acceptable by Tk +## +## +## GETOPT procedure +## +## getopt array ?option value ...? +## +## parses list of options. All options and values can be a separate arguments, +## or form a single list, so if you procedure is declared as. +## +## myproc {param args} +## +## call +## +## getopt arglist $args +## +## would be correct. +## array should contain an element for each allowed option, probably +## initiliazed by its default value. +## +## Indices of array shouldn't have a leading dash. +## +## getopt parses list of options and replaces default values by supplied ones. +## +## array could be local variable +## +## +################################################################################ + +set gPB_help_tips(font) {helvetica 9} +set gPB_help_tips(screen) 1280 +set gPB_help_tips(width) 150 +set gPB_help_tips(color) #ffff60 +set gPB_help_tips(delay) 500 +set gPB_help_tips(state) 1 + + +#=============================================================================== +proc PB_init_balloons {args} { +#=============================================================================== + global gPB_help_tips gPB_use_balloons + + getopt gPB_help_tips $args + set gPB_use_balloons $gPB_help_tips(state) + +# It may not be all that desirable to enable the balloon +# for the entire class of widgets. This may hamper the performance. +# It should be done on the selective basis. +# +# PB_set_balloons + + PB_enable_balloon Canvas +} + + +#=============================================================================== +proc PB_set_balloons {} { +#=============================================================================== + PB_enable_balloon Button + PB_enable_balloon Menubutton + PB_enable_balloon Menu "%W index active" + PB_enable_balloon tixNoteBookFrame + PB_enable_balloon Canvas + PB_enable_balloon Listbox "%W index @%x,%y" +} + + +#=============================================================================== +proc PB_enable_balloon {name_to_bind {script {}}} { +#=============================================================================== + global gPB_help_tips + + if ![llength $script] { + bind $name_to_bind "+schedule_balloon %W %X %Y" + bind $name_to_bind "+PB_reset_balloon %W %X %Y" + } else { + bind $name_to_bind "+schedule_balloon %W %X %Y \[$script\]" + bind $name_to_bind "+PB_reset_balloon %W %X %Y \[$script\]" + } + + bind $name_to_bind <1> "+PB_cancel_balloon" + bind $name_to_bind "+PB_cancel_balloon" + bind $name_to_bind "+PB_wait_balloon" + bind $name_to_bind "+PB_cancel_balloon" + bind $name_to_bind "+PB_wait_balloon" +} + + +#=============================================================================== +proc PB_wait_balloon {} { +#=============================================================================== + if [winfo exists .balloon_help] { + tkwait variable .balloon_help + } +} + +#=============================================================================== +proc PB_reset_balloon {window x y {item {}}} { +#=============================================================================== + PB_cancel_balloon + schedule_balloon $window $x $y $item +} + + +#=============================================================================== +proc PB_cancel_balloon {} { +#=============================================================================== + global balloon_after_ID + global balloon_exists + + if [info exists balloon_after_ID] { + after cancel $balloon_after_ID + unset balloon_after_ID + } + + if [winfo exists .balloon_help] { + destroy .balloon_help + } +} + + +#=============================================================================== +proc schedule_balloon {window x y {item {}}} { +#=============================================================================== + global gPB_use_balloons gPB_help_tips balloon_after_ID + + if !$gPB_use_balloons return + + if [string length $item] { + set index "$window,$item" + } else {set index $window} + + if [info exists gPB_help_tips($index)] { + set balloon_after_ID [after $gPB_help_tips(delay) \ + "create_balloon \"$gPB_help_tips($index)\" $x $y"] + } +} + + +#=============================================================================== +proc create_balloon {text x y} { +#=============================================================================== + global balloon_after_ID gPB_help_tips + + if {![winfo exists .balloon_help]} \ + { + toplevel .balloon_help -relief flat \ + -bg black -bd 1 + wm overrideredirect .balloon_help true + wm positionfrom .balloon_help program + + # Compute balloon width to adjust its position + set bw [font measure $gPB_help_tips(font) " $text"] + if {$bw > $gPB_help_tips(width)} { + set bw $gPB_help_tips(width) + } + + # Position Balloon w.r.t. scrren size + set bx [expr $x + 10 + $bw] + + if {$bx > $gPB_help_tips(screen)} { + set bx [expr $x - 10 - $bw] + } else { + set bx [expr $x + 10] + } + + label .balloon_help.lead -text " " -bg orange + label .balloon_help.tip -text "$text" -wraplength $gPB_help_tips(width) \ + -bg $gPB_help_tips(color) -font $gPB_help_tips(font) \ + -bd 1 -justify left + + pack .balloon_help.lead -side left -fill y + pack .balloon_help.tip -side left -fill y + + wm geometry .balloon_help "+$bx+[expr $y+5]" + } +} + + +################################################################################ +# Simple tk-like option parser +# usage getopt arrname args +# where arrname - array which have entries for all possible options +# without leading dash (possible empty) +# +#=============================================================================== +proc getopt {arrname args} { +#=============================================================================== + if {[llength $args]==1} {eval set args $args} + if {![llength $args]} return + if {[llength $args]%2!=0} {error "Odd count of opt. arguments"} + array set tmp $args + foreach i [uplevel array names $arrname] { + if [info exists tmp(-$i)] { + uplevel set "$arrname\($i\)" $tmp(-$i) + unset tmp(-$i) + } + } + set wrong_list [array names tmp] + if [llength $wrong_list] { + set msg "Unknown option(s) $wrong_list. Must be one of:" + foreach i [uplevel array names $arrname] { + append msg " -$i" + } + error $msg + } +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_block.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_block.tcl new file mode 100644 index 0000000..094ae66 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_block.tcl @@ -0,0 +1,3022 @@ +#============================================================================== +# UI_PB_BLOCK.TCL +#============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Block page. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 02-Jun-1999 mnb Code Integration # +# 04-Jun-1999 mnb Added pb_ to the imaged names # +# 14-Jun-1999 gsl Clean up balloon when a block element is trashed. # +# 16-Jun-1999 mnb Updates the Combobox, when block page is selected # +# 28-Jun-1999 mnb Text can be added multiple times to a block # +# 29-Jun-1999 mnb Changed text background color # +# 01-Jul-1999 mnb Text can be positioned at any position in a block # +# 06-Jul-1999 mnb Brings up a text entry dialog, when a text address # +# is added to a block. # +# 07-Sep-1999 mnb Editting Block Element Address & New toplevel # +# Block Page # +# 21-Sep-1999 mnb Added Modality attribute to block element # +# 18-Oct-1999 gsl Minor changes # +# 22-Oct-1999 gsl Added "Delete" option to the popup menu. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#=============================================================================== +proc UI_PB_Def_Block {book_id blk_page_obj} { +#=============================================================================== + global tixOption + global paOption + +# Widget ids + global popupvar + set blk_elm_attr(0) 0 + set blk_elm_attr(1) 0 + set blk_elm_attr(2) 0 + + set Page::($blk_page_obj,page_id) [$book_id subwidget \ + $Page::($blk_page_obj,page_name)] + +# Sets the block page attributes + UI_PB_blk_SetPageAttributes blk_page_obj + +# Creates the pane for page block + Page::CreatePane $blk_page_obj + +# Adds the buttons create cut and paste to the left pane + UI_PB_blk_AddComponentsLeftPane blk_page_obj + +# Creates the Tree + Page::CreateTree $blk_page_obj + UI_PB_blk_CreateTreeElements blk_page_obj + +# Creates the top and bottom canvases + set top_canvas_dim(0) 80 + set top_canvas_dim(1) 400 + set bot_canvas_dim(0) 2000 + set bot_canvas_dim(1) 1000 + Page::CreateCanvas $blk_page_obj top_canvas_dim \ + bot_canvas_dim + UI_PB_blk_AddTopFrameItems blk_page_obj + UI_PB_blk_AddActionButtons blk_page_obj + + # Adds the Add and Trash buttons to the top canvas + set Page::($blk_page_obj,add_name) " Add Word " + Page::CreateAddTrashinCanvas $blk_page_obj + Page::CreateMenu $blk_page_obj + + #Binds the Add button + UI_PB_blk_AddBindProcs blk_page_obj + set top_canvas $Page::($blk_page_obj,top_canvas) + $top_canvas bind add_movable \ + "UI_PB_blk_ItemDrag1 $blk_page_obj \ + %x %y" + $top_canvas bind add_movable \ + "UI_PB_blk_ItemEndDrag1 $blk_page_obj \ + %x %y" + # PopupMenu bind call + UI_PB_blk_CreatePopupMenu blk_page_obj + set Page::($blk_page_obj,blk_WordNameList) "" +} + +#=============================================================== +proc UI_PB_blk_SetPageAttributes { PAGE_OBJ } { +#=============================================================== + upvar $PAGE_OBJ page_obj + + set Page::($page_obj,block_popup_flag) 0 + set Page::($page_obj,trl_flag) 0 + set Page::($page_obj,lead_flag) 0 + set Page::($page_obj,fmt_flag) 0 + set Page::($page_obj,h_cell) 30 ;# cell height + set Page::($page_obj,w_cell) 62 ;# cell width + set Page::($page_obj,w_divi) 4 ;# divider width + set Page::($page_obj,rect_region) 80 ;# Block rectangle region + set Page::($page_obj,x_orig) 60 ;# upper-left corner of 1st cell + set Page::($page_obj,y_orig) 120 + set Page::($page_obj,add_flag) 0 +} + +#======================================================================== +proc UI_PB_blk_AddComponentsLeftPane {PAGE_OBJ} { +#======================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + # Left pane + set left_pane $Page::($page_obj,left_pane_id) + + # Buttons + set but [frame $left_pane.f] + set new [button $but.new -text "Create" \ + -command "UI_PB_blk_CreateABlock $page_obj" \ + -bg $paOption(app_butt_bg)] + set del [button $but.del -text "Cut" \ + -command "UI_PB_blk_CutABlock $page_obj" \ + -bg $paOption(app_butt_bg)] + set pas [button $but.pas -text "Paste" \ + -command "UI_PB_blk_PasteABlock $page_obj" \ + -bg $paOption(app_butt_bg)] + pack $new $del $pas -side left -fill x -expand yes + + pack $but -side top -fill x -padx 7 +} + +#================================================================ +proc UI_PB_blk_CreateABlock { page_obj } { +#================================================================ + set active_blk_obj $Page::($page_obj,active_blk_obj) + + # Creates a new block + PB_int_BlockCreateObject active_blk_obj obj_index + + UI_PB_blk_DisplayNameList page_obj obj_index + UI_PB_blk_BlkItemSelection $page_obj +} + +#================================================================ +proc UI_PB_blk_CutABlock { page_obj } { +#================================================================ + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set obj_index [string range $ent 2 [string length $ent]] + + set active_blk_obj $Page::($page_obj,active_blk_obj) + + # Checks if the block is reffered by an event. + if {$block::($active_blk_obj,evt_addr_list) != ""} \ + { + set block_name $block::($active_blk_obj,block_name) + tk_messageBox -type ok -icon error\ + -message "Block \"$block_name\" is used by an Event. \ + Block cannot be deleted" + } else \ + { + # Cuts the block object + PB_int_BlockCutObject active_blk_obj obj_index + set Page::($page_obj,buff_blk_obj) $active_blk_obj + + UI_PB_blk_DisplayNameList page_obj obj_index + UI_PB_blk_BlkItemSelection $page_obj + } +} + +#================================================================ +proc UI_PB_blk_PasteABlock { page_obj } { +#================================================================ + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set obj_index [string range $ent 2 [string length $ent]] + + if {![info exists Page::($page_obj,buff_blk_obj)]} \ + { + return + } + + set buff_blk_obj $Page::($page_obj,buff_blk_obj) + set temp_index $obj_index + PB_int_BlockPasteObject buff_blk_obj obj_index + + if { $temp_index != $obj_index } \ + { + UI_PB_blk_DisplayNameList page_obj obj_index + UI_PB_blk_BlkItemSelection $page_obj + } +} + +#================================================================ +proc UI_PB_blk_CreateTreeElements {PAGE_OBJ} { +#================================================================ + upvar $PAGE_OBJ page_obj + global paOption + + set tree $Page::($page_obj,tree) + + set h [$tree subwidget hlist] + $h config -bg $paOption(tree_bg) + + uplevel #0 set TRANSPARENT_GIF_COLOR [$h cget -bg] + + $tree config \ + -command "UI_PB_blk_BlkItemSelection $page_obj" \ + -browsecmd "UI_PB_blk_BlkItemSelection $page_obj" +} + +#=============================================================================== +proc UI_PB_blk_DisplayNameList { PAGE_OBJ OBJ_INDEX } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $OBJ_INDEX obj_index + global paOption + + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + + $HLIST delete all + $HLIST add 0 -itemtype imagetext -text "" -image $paOption(folder) -state disabled + set file [tix getimage pb_block_s] + + PB_int_RetBlkObjList blk_obj_list + set no_fmt [llength $blk_obj_list] + global gPB + set style $gPB(font_style_normal) + for {set count 0} {$count < $no_fmt} {incr count}\ + { + set blk_obj [lindex $blk_obj_list $count] + set blk_name $block::($blk_obj,block_name) + $HLIST add 0.$count -itemtype imagetext -text $blk_name -image $file \ + -style $style + } + + if { $obj_index >= $no_fmt } \ + { + set obj_index [expr $no_fmt - 1] + $HLIST selection set 0.$obj_index + } elseif {$obj_index >= 0}\ + { + $HLIST selection set 0.$obj_index + } else\ + { + $HLIST selection set 0 + } + $tree autosetmode +} + +#=============================================================================== +proc UI_PB_blk_BlkItemSelection { page_obj args } { +#=============================================================================== + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set index [string range $ent 2 [string length $ent]] + + if {[string compare $index ""] == 0} \ + { + set index 0 + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.0 + $HLIST anchor set 0.0 + } + + # Database call returns the block object list + PB_int_RetBlkObjList blk_obj_list + set block_obj [lindex $blk_obj_list $index] + + if {[info exists Page::($page_obj,active_blk_obj)]} \ + { + if {$block_obj == $Page::($page_obj,active_blk_obj)} \ + { + return + } + } + + # Deletes all the existing cells and icons + if {[info exists Page::($page_obj,active_blk_obj)]} \ + { + set active_blk $Page::($page_obj,active_blk_obj) + UI_PB_blk_DeleteCellsIcons page_obj active_blk + unset block::($active_blk,rest_value) + foreach blk_elem_obj $block::($active_blk,elem_addr_list) \ + { + unset block_element::($blk_elem_obj,rest_value) + } + UI_PB_blk_BlkApplyCallBack $page_obj + } + + # Displays block attributes in the block page + UI_PB_blk_DisplayBlockAttr page_obj block_obj +} + +#============================================================================= +proc UI_PB_blk_DisplayBlockAttr { PAGE_OBJ BLOCK_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $BLOCK_OBJ block_obj + + # Attributes of Page are set here + set Page::($page_obj,in_focus_elem) 0 + set Page::($page_obj,out_focus_elem) 0 + set Page::($page_obj,active_blk_elem) 0 + set Page::($page_obj,trash_flag) 0 + + # Restores the block data (makes a copy of the existing block data) + block::RestoreValue $block_obj + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + block_element::RestoreValue $blk_elem_obj + } + + # Gets the sorted list of the block elements according to + # the master sequence + UI_PB_blk_GetBlkAttrSort page_obj block_obj + + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + set active_blk_elem_obj \ + [lindex $block::($block_obj,active_blk_elem_list) 0] + if { $active_blk_elem_obj == "" } \ + { + set active_blk_elem_obj 0 + } + } else \ + { + set active_blk_elem_obj 0 + } + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + + # proc is called to create the block cells + set block_owner $block::($block_obj,blk_owner) + UI_PB_blk_CreateBlockCells page_obj block_obj active_blk_elem_obj \ + block_owner + UI_PB_blk_ConfigureLeader page_obj active_blk_elem_obj + + # Block Elements binding procedures + UI_PB_blk_IconBindProcs page_obj +} + +#=============================================================================== +proc UI_PB_blk_GetBlkAttrSort {PAGE_OBJ BLOCK_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $BLOCK_OBJ block_obj + + # checks the status of the each block element in the master list + # and returns a list of active block elements + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + unset block::($block_obj,active_blk_elem_list) + } + + # Creates the active blk element list based upon the status of + # each block element in the master sequence. + if {[info exists block::($block_obj,elem_addr_list)]} \ + { + set active_blk_elem_list $block::($block_obj,elem_addr_list) + UI_PB_com_ApplyMastSeqBlockElem active_blk_elem_list + set block::($block_obj,active_blk_elem_list) $active_blk_elem_list + } +} + +#================================================================= +proc UI_PB_blk_DeleteCellsIcons {PAGE_OBJ BLOCK_OBJ} { +#================================================================= + upvar $PAGE_OBJ page_obj + upvar $BLOCK_OBJ block_obj + + set c $Page::($page_obj,bot_canvas) + + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + # Deletes all the cells and icons + foreach blk_elem_obj $block::($block_obj,active_blk_elem_list) \ + { + $c delete $block_element::($blk_elem_obj,rect) + $c delete $block_element::($blk_elem_obj,div_id) + $c delete $block_element::($blk_elem_obj,icon_id) + } + } + + if {[info exists block::($block_obj,div_id)]} \ + { + $c delete $block::($block_obj,div_id) + } + + if {[info exists block::($block_obj,rect)]} \ + { + $c delete $block::($block_obj,rect) + } +} + +#==================================================================== +proc UI_PB_blk_CreateBlockImages { PAGE_OBJ BLOCK_OBJ } { +#==================================================================== + upvar $PAGE_OBJ page_obj + upvar $BLOCK_OBJ block_obj + + if {![info exists block::($block_obj,active_blk_elem_list)]} \ + { + return + } + + set bot_canvas $Page::($page_obj,bot_canvas) + foreach blk_elem_obj $block::($block_obj,active_blk_elem_list) \ + { + set blk_elem_addr $block_element::($blk_elem_obj,elem_add_obj) + set addr_leader $address::($blk_elem_addr,add_leader) + set blk_elem_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + + UI_PB_com_RetImageAppdText blk_elem_addr blk_elem_mom_var \ + img_name blk_elem_text + + set blk_elem_img [UI_PB_blk_CreateIcon $bot_canvas $img_name \ + $blk_elem_text] + set block_element::($blk_elem_obj,blk_img) $blk_elem_img + } +} + +#============================================================================= +proc UI_PB_blk_AddTopFrameItems {PAGE_OBJ} { +#============================================================================= + upvar $PAGE_OBJ page_obj + + global tixOption + global paOption + + set blk_elm_attr(0) 0 + set blk_elm_attr(1) 0 + set blk_elm_attr(2) 0 + #------------------------- + # Address + #------------------------- + set canvas_frame $Page::($page_obj,canvas_frame) + set frm [tixButtonBox $canvas_frame.act \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg gray85] + + pack $frm -side bottom -fill x -padx 3 -pady 3 + + button $frm.adr -text "$blk_elm_attr(0)" -cursor "" \ + -font $tixOption(bold_font) -bg darkSeaGreen3 -relief flat \ + -state disabled -disabledforeground lightYellow + button $frm.fmt -text "$blk_elm_attr(1)" -cursor "" \ + -font $tixOption(bold_font) -bg darkSeaGreen3 -relief flat \ + -state disabled -disabledforeground lightYellow + button $frm.trl -text "$blk_elm_attr(2)" -cursor "" \ + -font $tixOption(bold_font) -bg darkSeaGreen3 -relief flat \ + -state disabled -disabledforeground lightYellow + + # Suppress the hilightcolor + $frm.adr configure -activebackground darkSeaGreen3 + $frm.fmt configure -activebackground darkSeaGreen3 + $frm.trl configure -activebackground darkSeaGreen3 + + grid $frm.adr -row 1 -column 1 -pady 10 + grid $frm.fmt -row 1 -column 2 -pady 10 + grid $frm.trl -row 1 -column 3 -pady 10 + + set Page::($page_obj,fmt) $frm.fmt + set Page::($page_obj,addr) $frm.adr + set Page::($page_obj,trailer) $frm.trl +} + +#============================================================================= +proc UI_PB_blk_AddActionButtons { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global paOption + + #----------------------- + # Create action buttons + #----------------------- + set box $Page::($page_obj,box) + $box config -bg $paOption(butt_bg) + $box add def -text Default -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_DefaultCallBack $page_obj" + + $box add apl -text Restore -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_RestoreCallBack $page_obj" +} + +#=========================================================================== +proc UI_PB_blk_AddBindProcs {PAGE_OBJ} { +#=========================================================================== + upvar $PAGE_OBJ page_obj + + set top_canvas $Page::($page_obj,top_canvas) + + $top_canvas bind add_movable <1> \ + "UI_PB_blk_ItemStartDrag1 $page_obj \ + %x %y" + + $top_canvas bind add_movable \ + "UI_PB_blk_ItemFocusOn1 $page_obj \ + %x %y" + + $top_canvas bind add_movable \ + "UI_PB_blk_ItemFocusOff1 $page_obj" +} + +#============================================================================ +proc UI_PB_blk_CreatePopupMenu {PAGE_OBJ} { +#============================================================================ + upvar $PAGE_OBJ page_obj + global tixOption + global paOption + global popupvar + + set bot_canvas $Page::($page_obj,bot_canvas) + option add *Menu.tearOff 0 + + set blockpopup [menu $bot_canvas.pop] + set Page::($page_obj,blockpopup) $blockpopup + set Page::($page_obj,block_popup_flag) 0 + + bind $bot_canvas <3> "UI_PB_blk_CanvasPopupMenu $page_obj popupvar %X %Y" +} + +#========================================================================== +proc UI_PB_blk_BlkApplyCallBack {page_obj} { +#========================================================================== + set WordNameList $Page::($page_obj,blk_WordNameList) + set block_obj $Page::($page_obj,active_blk_obj) + + if {![info exists block::($block_obj,active_blk_elem_list)]} \ + { + return + } + + set blk_obj_attr(0) $block::($block_obj,block_name) + set blk_obj_attr(1) [llength $block::($block_obj,active_blk_elem_list)] + set blk_obj_attr(2) $block::($block_obj,active_blk_elem_list) + set blk_obj_attr(3) $WordNameList + + # sets the run time data to the block + block::setvalue $block_obj blk_obj_attr +} + +#========================================================================== +proc UI_PB_blk_RestoreCallBack { page_obj } { +#========================================================================== + set block_obj $Page::($page_obj,active_blk_obj) + + # Deletes all the existing cells and icons + UI_PB_blk_DeleteCellsIcons page_obj block_obj + + # Sets the block data to default values + array set blk_obj_attr $block::($block_obj,rest_value) + block::setvalue $block_obj blk_obj_attr + unset blk_obj_attr + + # Sets the restore data of the block as run time data. + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + array set blk_elem_obj_attr $block_element::($blk_elem_obj,rest_value) + block_element::setvalue $blk_elem_obj blk_elem_obj_attr + unset blk_elem_obj_attr + } + + # Gets the active block elements list and sorts list of the block elements + # according to the master sequence + UI_PB_blk_GetBlkAttrSort page_obj block_obj + + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + set active_blk_elem_obj \ + [lindex $block::($block_obj,active_blk_elem_list) 0] + } else \ + { + set active_blk_elem_obj 0 + } + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + + # This procedure is called to create the block and itscells + set block_owner $block::($block_obj,blk_owner) + UI_PB_blk_CreateBlockCells page_obj block_obj active_blk_elem_obj \ + block_owner + UI_PB_blk_ConfigureLeader page_obj active_blk_elem_obj + + # Block Elements binding procedures + UI_PB_blk_IconBindProcs page_obj +} + +#========================================================================== +proc UI_PB_blk_DefaultCallBack {page_obj} { +#========================================================================== + set block_obj $Page::($page_obj,active_blk_obj) + + # Deletes all the existing cells and icons + UI_PB_blk_DeleteCellsIcons page_obj block_obj + + # Sets the block data to default values + array set blk_obj_attr $block::($block_obj,def_value) + block::setvalue $block_obj blk_obj_attr + unset blk_obj_attr + + # Sets the default data of the block elements as the run time data + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + array set blk_elem_obj_attr $block_element::($blk_elem_obj,def_value) + block_element::setvalue $blk_elem_obj blk_elem_obj_attr + unset blk_elem_obj_attr + } + + # Gets the sorted list of the block elements according to + # the master sequence + UI_PB_blk_GetBlkAttrSort page_obj block_obj + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + set active_blk_elem_obj \ + [lindex $block::($block_obj,active_blk_elem_list) 0] + } else \ + { + set active_blk_elem_obj 0 + } + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + + # This procedure is called to create the block and itscells + set block_owner $block::($block_obj,blk_owner) + UI_PB_blk_CreateBlockCells page_obj block_obj active_blk_elem_obj \ + block_owner + UI_PB_blk_ConfigureLeader page_obj active_blk_elem_obj + + # Block Elements binding procedures + UI_PB_blk_IconBindProcs page_obj +} + +#========================================================================== +proc UI_PB_blk_CanvasPopupMenu {page_obj POPUPVAR x y} { +#========================================================================== + upvar $POPUPVAR popupvar + + set blockpopup $Page::($page_obj,blockpopup) + if { $Page::($page_obj,block_popup_flag) == 0} \ + { +### set popupvar(0) 0 +### set popupvar(1) 0 +### set popupvar(2) 0 +### $blockpopup delete 0 end +### $blockpopup add command -label "Edit Word" -state disabled +### $blockpopup add cascade -label "Change Element" -menu $blockpopup.change \ +### -state disabled +### $blockpopup add checkbutton -label "Optional" \ +### -variable popupvar(1) -state disabled +### $blockpopup add checkbutton -label "No Word Seperator" \ +### -variable popupvar(0) -state disabled +### $blockpopup add checkbutton -label "Force Output" \ +### -variable popupvar(2) -state disabled + } else \ + { + set Page::($page_obj,block_popup_flag) 0 + + # Position popup menu + tk_popup $blockpopup $x $y + } +} + +#============================================================================= +proc UI_PB_blk_CombSelection { page_obj base_addr index} { +#============================================================================= + global tixOption + + # Database call returns the descrptions of all mom variables + PB_int_GetWordVarDesc WordDescArray + +## + set add_leader "" + + if { [string compare $base_addr "New_Address"] == 0} \ + { + set mom_var "" + set new_word_mom_var "" + set app_text "" + } else \ + { + PB_int_RetAddrObjFromName base_addr add_obj + +## set add_leader $address::($add_obj,add_leader) + if {[string compare $address::($add_obj,add_name) "Text"] == 0} \ + { + set mom_var "" + set new_word_mom_var "" + } else \ + { +## + set add_leader $address::($add_obj,add_leader) + + PB_int_RetMOMVarAsscAddress base_addr word_mom_var_list + set mom_var [lindex $word_mom_var_list $index] + PB_int_GetNewBlockElement base_addr index new_word_mom_var + } + PB_com_MapMOMVariable add_obj mom_var app_text + PB_int_ApplyFormatAppText add_obj app_text + } + + set desc "" + set word_desc [lindex $WordDescArray($base_addr) $index] + if { $word_desc == "" } \ + { + set word_desc "User Defined Expression" + } + + append desc $base_addr " (" $add_leader $app_text - $word_desc " )" + set comb_var $desc + set Page::($page_obj,comb_var) $desc + + set Page::($page_obj,new_elem_mom_var) $new_word_mom_var + set Page::($page_obj,sel_base_addr) $base_addr + + if {[info exists Page::($page_obj,comb_text)]} \ + { + $Page::($page_obj,top_canvas) delete \ + $Page::($page_obj,comb_text) + } + set Page::($page_obj,comb_text) [$Page::($page_obj,top_canvas) \ + create text $Page::($page_obj,entry_cx) \ + $Page::($page_obj,entry_cy) \ + -text $comb_var -font $tixOption(font)] +} + +#============================================================================= +proc UI_PB_blk_GetActiveAddresses { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + + set temp_wordnamelist "" + + # Database call returns the address object list + PB_int_RetAddressObjList add_obj_list + + foreach addr_obj $add_obj_list \ + { + if { $addr_obj } \ + { + if { $address::($addr_obj,word_status) == 0} \ + { + set addr_name $address::($addr_obj,add_name) + if { [string compare $addr_name Text] != 0 && \ + [string compare $addr_name N] != 0} \ + { + lappend temp_wordnamelist $addr_name + } + } + } + } + set Page::($page_obj,blk_WordNameList) $temp_wordnamelist +} + +#============================================================================= +proc UI_PB_blk_CreateMenuElement { PAGE_OBJ comb_widget element_index \ + NO_OF_ADDR} { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $NO_OF_ADDR no_of_addr + + set word [lindex $Page::($page_obj,blk_WordNameList) $element_index] + PB_int_RetAddrObjFromName word add_obj + set add_leader $address::($add_obj,add_leader) + + # Database call returns the descrptions of all mom variables + PB_int_GetWordVarDesc WordDescArray + + if { [info exists WordDescArray($word)] } \ + { + set list_len [llength $WordDescArray($word)] + PB_int_RetMOMVarAsscAddress word word_mom_var_list + } else \ + { + set list_len 0 + } + + if { $list_len == 0} \ + { + set index 0 + $comb_widget add command -label $word \ + -command "UI_PB_blk_CombSelection $page_obj $word $index" + } else \ + { + $comb_widget add cascade -label $word -menu $comb_widget.m$no_of_addr + catch {destroy $comb_widget.m$no_of_addr} + menu $comb_widget.m$no_of_addr + for {set count 0} {$count < $list_len} {incr count} \ + { + set mom_var [lindex $word_mom_var_list $count] + set desc [lindex $WordDescArray($word) $count] + + PB_com_MapMOMVariable add_obj mom_var app_text + PB_int_ApplyFormatAppText add_obj app_text + + append sublabel $add_leader $app_text - $desc + $comb_widget.m$no_of_addr add command -label $sublabel \ + -command "UI_PB_blk_CombSelection $page_obj $word $count" + unset sublabel + } + append sublabel $add_leader - "User Defined Expression" + $comb_widget.m$no_of_addr add command -label $sublabel \ + -command "UI_PB_blk_CombSelection $page_obj $word $count" + unset sublabel + incr no_of_addr + } +} + +#============================================================================= +proc UI_PB_blk_CreateMenuOptions { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + + set comb_widget $Page::($page_obj,comb_widget) + $comb_widget delete 0 end + + UI_PB_blk_GetActiveAddresses page_obj + + set basewords_length [llength $Page::($page_obj,blk_WordNameList)] + + if {$basewords_length > 20} \ + { + set no_options 20 + } else \ + { + set no_options $basewords_length + } + + # Adds new address option + $comb_widget add command -label "New Word" \ + -command "UI_PB_blk_CombSelection $page_obj New_Address 0" + $comb_widget add command -label "Text" \ + -command "UI_PB_blk_CombSelection $page_obj Text 0" + $comb_widget add separator + + set no_of_addr 0 + for {set ii 0} {$ii < $no_options} {incr ii} \ + { + UI_PB_blk_CreateMenuElement page_obj $comb_widget $ii no_of_addr + } + + if {$no_options < $basewords_length} \ + { + set no_of_addr 0 + $comb_widget add cascade -label More -menu $comb_widget.more + catch {destroy $comb_widget.more} + menu $comb_widget.more + set comb_widget $comb_widget.more + + for {set jj $no_options} {$jj < $basewords_length} {incr jj} \ + { + UI_PB_blk_CreateMenuElement page_obj $comb_widget $jj no_of_addr + } + } + + set comb_label_desc [lindex $Page::($page_obj,blk_WordNameList) 0] + UI_PB_blk_CombSelection $page_obj $comb_label_desc 0 +} + +#============================================================================= +proc UI_PB_blk_CreateBlockCells { PAGE_OBJ BLOCK_OBJ ACTIVE_BLK_ELEM_OBJ \ + BLOCK_OWNER } { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $BLOCK_OBJ block_obj + upvar $ACTIVE_BLK_ELEM_OBJ active_blk_elem_obj + upvar $BLOCK_OWNER block_owner + global paOption + + set cell_color paleturquoise + set divi_color turquoise + set main_cell_color $paOption(can_bg) + + set c $Page::($page_obj,bot_canvas) + set Page::($page_obj,active_blk_obj) $block_obj + + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + set no_of_elements [llength $block::($block_obj,active_blk_elem_list)] + } else \ + { + set no_of_elements 0 + } + + set h_cell $Page::($page_obj,h_cell) ;# cell height + set w_cell $Page::($page_obj,w_cell) ;# cell width + set w_divi $Page::($page_obj,w_divi) ;# divider width + set x_orig $Page::($page_obj,x_orig) ;# upper-left corner of 1st cell + set y_orig $Page::($page_obj,y_orig) + + # Create several compound images in the canvas + set n_comp $no_of_elements + + #---------------------------------------- + # Create rectangular cells to hold icons + #---------------------------------------- + set x0 $x_orig + set y0 $y_orig + set x1 [expr $x0 + [expr [expr $w_divi + $w_cell] * $n_comp] + \ + $w_divi + [expr 2 * $w_divi]] + set y1 [expr $y0 + $h_cell + [expr 2 * $w_divi]] + + set block::($block_obj,rect) [UI_PB_com_CreateRectangle $c $x0 $y0 $x1 $y1 \ + $main_cell_color $main_cell_color] + set block::($block_obj,blk_h) $y1 + set block::($block_obj,blk_w) $x1 + $c lower $block::($block_obj,rect) + + set block::($block_obj,rect_x0) $x0 + set block::($block_obj,rect_y0) $y0 + set block::($block_obj,rect_x1) $x1 + set block::($block_obj,rect_y1) $y1 + + set x0 [expr $x_orig + $w_divi] + set y0 [expr $y_orig + $w_divi] + set yc [expr $y0 + [expr $h_cell / 2]] + + for {set i 0} {$i < $n_comp} {incr i 1} { + + #-------------- + # Divider cell + #-------------- + set blk_elem_obj [lindex $block::($block_obj,active_blk_elem_list) $i] + set j [expr 2 * $i] + set y1 [expr $y0 + $h_cell] + set x1 [expr $x0 + $w_divi] + + set block_element::($blk_elem_obj,div_corn_x0) $x0 + set block_element::($blk_elem_obj,div_corn_y0) $y0 + set block_element::($blk_elem_obj,div_corn_x1) $x1 + set block_element::($blk_elem_obj,div_corn_y1) $y1 + + set block_element::($blk_elem_obj,div_id) [UI_PB_com_CreateRectangle $c \ + $x0 $y0 $x1 $y1 $divi_color $divi_color ] + + #-------------- + # Holding cell + #-------------- + set k [expr $j + 1] + set x0 $x1 + set x1 [expr $x0 + $w_cell] + + set block_element::($blk_elem_obj,rect_corn_x0) $x0 + set block_element::($blk_elem_obj,rect_corn_y0) $y0 + set block_element::($blk_elem_obj,rect_corn_x1) $x1 + set block_element::($blk_elem_obj,rect_corn_y1) $y1 + + set block_element::($blk_elem_obj,rect) [UI_PB_com_CreateRectangle $c \ + $x0 $y0 $x1 $y1 $cell_color $divi_color] + + # Place icons into cell + set xc [expr [expr $x0 + $x1] / 2] + append opt_img pb_ $block_element::($blk_elem_obj,elem_opt_nows_var) + if { $block_element::($blk_elem_obj,force) } \ + { + append opt_img _f + } + set name_addr [tix getimage $opt_img] + unset opt_img + $block_element::($blk_elem_obj,blk_img) add image -image $name_addr + set blk_elem_owner $block_element::($blk_elem_obj,owner) + set blk_elem_add_obj $block_element::($blk_elem_obj,elem_add_obj) + set address_name $address::($blk_elem_add_obj,add_name) + + if {[string compare $blk_elem_owner $block_owner] == 0} \ + { + set icon_id [$c create image $xc $yc \ + -image $block_element::($blk_elem_obj,blk_img) -tag movable] + } else \ + { + set icon_id [$c create image $xc $yc \ + -image $block_element::($blk_elem_obj,blk_img) -tag nonmovable] + set im [$c itemconfigure $icon_id -image] + [lindex $im end] configure -relief flat + } + + if {[string compare $address_name "Text"] == 0} \ + { + set im [$c itemconfigure $icon_id -image] + [lindex $im end] configure -bg $paOption(text) + } + + set block_element::($blk_elem_obj,icon_id) $icon_id + set block_element::($blk_elem_obj,xc) $xc + set block_element::($blk_elem_obj,yc) $yc + + set x0 $x1 + } + + #-------------- + # Last divider + #-------------- + if {[info exists k] == 1} \ + { + set k [expr $k + 1] + } else \ + { + set k 0 + } + + set x1 [expr $x0 + $w_divi] + set y1 [expr $y0 + $h_cell] + + set block::($block_obj,div_corn_x0) $x0 + set block::($block_obj,div_corn_y0) $y0 + set block::($block_obj,div_corn_x1) $x1 + set block::($block_obj,div_corn_y1) $y1 + + set block::($block_obj,div_id) [UI_PB_com_CreateRectangle $c $x0 $y0 \ + $x1 $y1 $divi_color $divi_color] + + if {$active_blk_elem_obj != 0} \ + { + set im [$c itemconfigure $block_element::($active_blk_elem_obj,icon_id) \ + -image] + [lindex $im end] configure -relief sunken -bg pink + set Page::($page_obj,active_blk_elem) $active_blk_elem_obj + } +} + +#========================================================================== +proc UI_PB_blk_IconBindProcs {PAGE_OBJ} { +#========================================================================== + upvar $PAGE_OBJ page_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + #--------------------- + # Bind block element icons to mouse + #--------------------- + $bot_canvas bind movable <1> "UI_PB_blk_StartDragAddr $page_obj \ + %x %y" + + $bot_canvas bind movable "UI_PB_blk_DragAddr $page_obj \ + %x %y" + + $bot_canvas bind movable "UI_PB_blk_AddrFocusOn $page_obj \ + %x %y" + + $bot_canvas bind movable "UI_PB_blk_AddrFocusOff $page_obj" + + $bot_canvas bind movable "UI_PB_blk_EndDragAddr \ + $page_obj" + + $bot_canvas bind movable <3> "UI_PB_blk_BindRightButton $page_obj \ + %x %y" + + $bot_canvas bind nonmovable <1> "UI_PB_blk_StartDragAddr $page_obj \ + %x %y" + + $bot_canvas bind nonmovable "UI_PB_blk_AddrFocusOn $page_obj \ + %x %y" + + $bot_canvas bind nonmovable "UI_PB_blk_AddrFocusOff $page_obj" +} + +#========================================================================== +proc UI_PB_blk_ConfigureLeader { PAGE_OBJ ACTIVE_BLK_ELEM } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $ACTIVE_BLK_ELEM active_blk_elem_obj + + if {![info exist Page::($page_obj,trailer)]} { return } + + if {$active_blk_elem_obj} \ + { + set addr_obj $block_element::($active_blk_elem_obj,elem_add_obj) + set addr_name $address::($addr_obj,add_name) + set blk_elem_mom_var \ + $block_element::($active_blk_elem_obj,elem_mom_variable) + PB_com_MapMOMVariable addr_obj blk_elem_mom_var blk_elem_text + PB_int_ApplyFormatAppText addr_obj blk_elem_text + PB_int_GetElemDisplayAttr addr_name blk_elem_text blk_elm_attr + } else { + set blk_elm_attr(0) "" + set blk_elm_attr(1) "" + set blk_elm_attr(2) "" + } + + # Packs and unpacks the leader button based upon the value that is + # set to blk_elem_attr(0) + if {[string compare $blk_elm_attr(0) ""]} \ + { + if {$Page::($page_obj,lead_flag) == 1} \ + { + grid $Page::($page_obj,addr) -row 1 -column 1 -pady 10 + $Page::($page_obj,addr) configure -text $blk_elm_attr(0) + set Page::($page_obj,lead_flag) 0 + } else \ + { + $Page::($page_obj,addr) configure -text $blk_elm_attr(0) + } + } else \ + { + if {$Page::($page_obj,lead_flag) == 0} \ + { + grid forget $Page::($page_obj,addr) + set Page::($page_obj,lead_flag) 1 + } + } + + # Packs and unpacks the format button based upon the value that is + # set to blk_elem_attr(1) + if {[string compare $blk_elm_attr(1) ""]} \ + { + if {$Page::($page_obj,fmt_flag) == 1} \ + { + grid $Page::($page_obj,fmt) -row 1 -column 2 -pady 10 + $Page::($page_obj,fmt) configure -text $blk_elm_attr(1) + set Page::($page_obj,fmt_flag) 0 + } else \ + { + $Page::($page_obj,fmt) configure -text $blk_elm_attr(1) + } + } else \ + { + if {$Page::($page_obj,fmt_flag) == 0} \ + { + grid forget $Page::($page_obj,fmt) + set Page::($page_obj,fmt_flag) 1 + } + } + + # Packs and unpacks the trailer button based upon the value that is + # set to blk_elem_attr(2) + if {[string compare $blk_elm_attr(2) ""]} \ + { + if {$Page::($page_obj,trl_flag) == 1} \ + { + grid $Page::($page_obj,trailer) -row 1 -column 3 -pady 10 + $Page::($page_obj,trailer) configure -text $blk_elm_attr(2) + set Page::($page_obj,trl_flag) 0 + } else \ + { + $Page::($page_obj,trailer) configure -text $blk_elm_attr(2) + } + } else \ + { + if {$Page::($page_obj,trl_flag) == 0} \ + { + grid forget $Page::($page_obj,trailer) + set Page::($page_obj,trl_flag) 1 + } + } +} + +#========================================================================== +proc UI_PB_blk_BindRightButton {page_obj x y} { +#========================================================================== + set block_obj $Page::($page_obj,active_blk_obj) + set active_blk_elem $block::($block_obj,active_blk_elem) + + UI_PB_blk_BlockPopupMenu page_obj active_blk_elem $x $y + + # Utilize end_drag CB to return block element to position. + if { [info exists Page::($page_obj,being_dragged)] && + $Page::($page_obj,being_dragged) } \ + { + UI_PB_blk_EndDragAddr $page_obj + } +} + +#========================================================================= +proc UI_PB_blk_BlockPopupMenu { PAGE_OBJ ACTIVE_BLK_ELEM x y } { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $ACTIVE_BLK_ELEM active_blk_elem + global paOption + global popupvar + + set bot_canvas $Page::($page_obj,bot_canvas) + set xx [$bot_canvas canvasx $x] + set yy [$bot_canvas canvasy $y] + + # Database call returns the descrptions of all mom variables + PB_int_GetWordVarDesc WordDescArray + + set addr_obj $block_element::($active_blk_elem,elem_add_obj) + set base_addr $address::($addr_obj,add_name) + set add_leader $address::($addr_obj,add_leader) + set list_length [llength $WordDescArray($base_addr)] + set blockpopup $Page::($page_obj,blockpopup) + set canvas_frame $Page::($page_obj,canvas_frame) + + if {$list_length >= 1} \ + { + UI_PB_blk_GetOptionImageName \ + $block_element::($active_blk_elem,elem_opt_nows_var) popupvar + set popupvar(2) $block_element::($active_blk_elem,force) + $blockpopup delete 0 end + $blockpopup add command -label "Edit" -state normal \ + -command "UI_PB_blk_EditAddress $page_obj $active_blk_elem" + $blockpopup add cascade -label "Change Element" -menu $blockpopup.change \ + -state normal + $blockpopup add checkbutton -label "Optional" \ + -variable popupvar(1) -state normal \ + -command "UI_PB_blk_AddNowsOpt $page_obj popupvar \ + $base_addr $active_blk_elem" + + $blockpopup add checkbutton -label "No Word Seperator" \ + -variable popupvar(0) -state normal \ + -command "UI_PB_blk_AddNowsOpt $page_obj popupvar \ + $base_addr $active_blk_elem" + + $blockpopup add checkbutton -label "Force Output" \ + -variable popupvar(2) -state normal \ + -command "UI_PB_blk_AddForceOpt $page_obj popupvar \ + $base_addr $active_blk_elem" + $blockpopup add sep + $blockpopup add command -label "Delete" + + catch {destroy $blockpopup.change} + menu $blockpopup.change + + PB_int_RetMOMVarAsscAddress base_addr word_mom_var_list + set mom_var_length [llength $word_mom_var_list] + set momvar_found_flag 0 + for {set count 0} {$count < $mom_var_length} {incr count} \ + { + set subdesc [lindex $WordDescArray($base_addr) $count] + if {[regexp -- $subdesc $block_element::($active_blk_elem,elem_desc)] \ + == 0} \ + { + set mom_var [lindex $word_mom_var_list $count] + + PB_com_MapMOMVariable addr_obj mom_var app_text + PB_int_ApplyFormatAppText addr_obj app_text + append sublabel $add_leader $app_text - $subdesc + + $blockpopup.change add command -label $sublabel \ + -command "UI_PB_blk_PopupSelection $page_obj \ + $base_addr $count $active_blk_elem" + unset sublabel + } else \ + { + set momvar_found_flag 1 + } + } + + if { $momvar_found_flag } \ + { + $blockpopup.change add command -label "User Defined Expression" \ + -command "UI_PB_blk_PopupSelection $page_obj \ + $base_addr $count $active_blk_elem" + } + } else { +#################### +### What is this ??? +#################### + UI_PB_blk_GetOptionImageName \ + $block_element::($active_blk_elem,elem_opt_nows_var) popupvar + set popupvar(2) $block_element::($active_blk_elem,force) + $blockpopup delete 0 end + $blockpopup add command -label "Edit Word" -state normal \ + -command "UI_PB_blk_EditAddress $page_obj $active_blk_elem" + $blockpopup add cascade -label "Change Element" -menu $blockpopup.change \ + -state disabled + $blockpopup add checkbutton -label "Optional" \ + -variable popupvar(1) -state normal \ + -command "UI_PB_blk_AddNowsOpt $page_obj popupvar \ + $base_addr $active_blk_elem" + + $blockpopup add checkbutton -label "No Word Seperator" \ + -variable popupvar(0) -state normal \ + -command "UI_PB_blk_AddNowsOpt $page_obj popupvar \ + $base_addr $active_blk_elem" + + $blockpopup add checkbutton -label "Force Output" \ + -variable popupvar(2) -state normal \ + -command "UI_PB_blk_AddForceOpt $page_obj popupvar \ + $base_addr $active_blk_elem" + } + set Page::($page_obj,block_popup_flag) 1 +} + +#========================================================================== +proc UI_PB_blk_EditAddress { blk_page_obj active_blk_elem } { +#========================================================================== + global elem_text_var + set canvas_frame $Page::($blk_page_obj,canvas_frame) + set win $canvas_frame.addr + + set add_obj $block_element::($active_blk_elem,elem_add_obj) + UI_PB_addr_CreateAddressPage $win $add_obj new_add_page + + # Creates Expression parameters + set expr_frm [frame $win.expr] + pack $expr_frm -side top + + set elem_text_var $block_element::($active_blk_elem,elem_mom_variable) + label $expr_frm.lab -text Expression -anchor w + entry $expr_frm.ent -textvariable elem_text_var -width 25 -relief sunken + + # Changes the status of the expression entry, based upon the option + # selected. The entry is enabled, if a user defined expression is select + # else it is disabled. + if { [string match User* $block_element::($active_blk_elem,elem_desc)] }\ + { + $expr_frm.ent config -state normal -bg white + } else \ + { + $expr_frm.ent config -state disabled -bg lightBlue + } + + pack $expr_frm.lab -side left -pady 10 + pack $expr_frm.ent -side right -pady 10 -padx 10 + focus $expr_frm.ent + + UI_PB_add_EditAddActions $win blk_page_obj new_add_page active_blk_elem +} + +#========================================================================== +proc UI_PB_blk_NewAddress { BLK_PAGE_OBJ EVENT_OBJ EVT_ELEM_OBJ NEW_ELEM_OBJ \ + page_name } { +#========================================================================== + upvar $BLK_PAGE_OBJ blk_page_obj + upvar $EVENT_OBJ event_obj + upvar $EVT_ELEM_OBJ evt_elem_obj + upvar $NEW_ELEM_OBJ new_elem_obj + global elem_text_var + set canvas_frame $Page::($blk_page_obj,canvas_frame) + + # new address dialog + set win $canvas_frame.addr + set new_add_obj $block_element::($new_elem_obj,elem_add_obj) + UI_PB_addr_CreateAddressPage $win $new_add_obj new_add_page + + set expr_frm [frame $win.expr] + pack $expr_frm -side top -pady 10 + + set elem_text_var "" + label $expr_frm.lab -text Expression -anchor w + entry $expr_frm.ent -textvariable elem_text_var -width 24 -relief sunken + + pack $expr_frm.lab -side left -fill both -padx 10 -pady 10 + pack $expr_frm.ent -side right -fill both -padx 5 -pady 10 + focus $expr_frm.ent + + UI_PB_add_NewAddActions $win $blk_page_obj $event_obj $evt_elem_obj \ + new_add_page new_elem_obj $page_name +} + +#========================================================================== +proc UI_PB_blk_GetOptionImageName {optimagname POPUPVAR} { +#========================================================================== + upvar $POPUPVAR popupvar + + switch $optimagname \ + { + "both" { + set popupvar(0) 1 + set popupvar(1) 1 + } + "nows" { + set popupvar(0) 1 + set popupvar(1) 0 + } + "opt" { + set popupvar(0) 0 + set popupvar(1) 1 + } + "blank" { + set popupvar(0) 0 + set popupvar(1) 0 + } + } +} + +#========================================================================== +proc UI_PB_blk_AddForceOpt { page_obj POPUPVAR base_addr active_blk_elem } { +#========================================================================== + upvar $POPUPVAR popupvar + + set block_element::($active_blk_elem,force) $popupvar(2) + UI_PB_blk_ReplaceIcon page_obj $base_addr $active_blk_elem +} + +#========================================================================== +proc UI_PB_blk_AddNowsOpt {page_obj POPUPVAR base_addr active_blk_elem } { +#========================================================================== + upvar $POPUPVAR popupvar + + if {$popupvar(0) == 1 && $popupvar(1) == 1} \ + { + set block_element::($active_blk_elem,elem_opt_nows_var) both + + } elseif {$popupvar(0) == 0 && $popupvar(1) == 1} \ + { + set block_element::($active_blk_elem,elem_opt_nows_var) opt + + } elseif {$popupvar(0) == 1 && $popupvar(1) == 0} \ + { + set block_element::($active_blk_elem,elem_opt_nows_var) nows + + } else \ + { + set block_element::($active_blk_elem,elem_opt_nows_var) blank + } + + UI_PB_blk_ReplaceIcon page_obj $base_addr $active_blk_elem +} + +#========================================================================== +proc UI_PB_blk_PopupSelection {page_obj base_addr sel_index blk_elem_obj} { +#========================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + + # Database call returns the descrptions of all mom variables + PB_int_GetWordVarDesc WordDescArray + + PB_int_GetNewBlockElement base_addr sel_index word_mom_var + + if { $word_mom_var == "" } \ + { + set word_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + + UI_PB_com_CreateTextEntry page_obj blk_elem_obj Expression + tkwait window $bot_canvas.txtent + + if { [string compare $block_element::($blk_elem_obj,elem_mom_variable) \ + "000"] == 0 } \ + { + set block_element::($blk_elem_obj,elem_mom_variable) $word_mom_var + return + } + set block_element::($blk_elem_obj,elem_desc) "User Defined Expression" + } else \ + { + set sel_subdesc [lindex $WordDescArray($base_addr) $sel_index] + set block_element::($blk_elem_obj,elem_mom_variable) $word_mom_var + set block_element::($blk_elem_obj,elem_desc) $sel_subdesc + } + + UI_PB_blk_ReplaceIcon page_obj $base_addr $blk_elem_obj + UI_PB_blk_ConfigureLeader page_obj blk_elem_obj +} + +#========================================================================== +proc UI_PB_blk_ReplaceIcon {PAGE_OBJ base_addr blk_elem_obj} { +#========================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + + set blk_elem_addr $block_element::($blk_elem_obj,elem_add_obj) + set addr_leader $address::($blk_elem_addr,add_leader) + set blk_elem_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + + UI_PB_com_RetImageAppdText blk_elem_addr blk_elem_mom_var \ + img_name blk_elem_text + + set img_id [UI_PB_blk_CreateIcon $bot_canvas $img_name $blk_elem_text] + set xc [expr [expr $block_element::($blk_elem_obj,rect_corn_x0) + \ + $block_element::($blk_elem_obj,rect_corn_x1)] / 2] + set yc [expr [expr $block_element::($blk_elem_obj,rect_corn_y0) + \ + $block_element::($blk_elem_obj,rect_corn_y1)] / 2] + + append opt_img pb_ $block_element::($blk_elem_obj,elem_opt_nows_var) + if { $block_element::($blk_elem_obj,force) } \ + { + append opt_img _f + } + $img_id add image -image [tix getimage $opt_img] + unset opt_img + + set icon_id [$bot_canvas create image $xc $yc -image $img_id -tag movable] + + set exist_icon_id $block_element::($blk_elem_obj,icon_id) + set im [lindex [$bot_canvas itemconfigure $exist_icon_id -image] end] + set relief_status [lindex [$im configure -relief] end] + $bot_canvas delete $exist_icon_id + + set block_element::($blk_elem_obj,icon_id) $icon_id + set blk_elem_add_obj $block_element::($blk_elem_obj,elem_add_obj) + set address_name $address::($blk_elem_add_obj,add_name) + + $img_id configure -relief $relief_status + if {$relief_status == "sunken"} \ + { + $img_id configure -bg pink + set Page::($page_obj,active_blk_elem) $blk_elem_obj + } elseif {[string compare $address_name "Text"] == 0} \ + { + $img_id configure -bg $paOption(text) + } +} + +#========================================================================== +proc UI_PB_blk_AddrFocusOn {page_obj x y} { +#========================================================================== + global gPB_help_tips + + set c $Page::($page_obj,bot_canvas) + set block_obj $Page::($page_obj,active_blk_obj) + set active_blk_elem_list $block::($block_obj,active_blk_elem_list) + + set x [$c canvasx $x] + set y [$c canvasy $y] + + #---------------------- + # Locate in-focus cell + #---------------------- + foreach blk_elem_obj $active_blk_elem_list \ + { + if {$x >= $block_element::($blk_elem_obj,rect_corn_x0) && \ + $x < $block_element::($blk_elem_obj,rect_corn_x1)} \ + { + set Page::($page_obj,in_focus_elem) $blk_elem_obj + + # Change cursor + $c config -cursor hand2 + break + } + } + + #----------------------------- + # Highlight new in-focus cell + #----------------------------- + if {$Page::($page_obj,in_focus_elem) != \ + $Page::($page_obj,out_focus_elem)} \ + { + if { $Page::($page_obj,out_focus_elem) } \ + { + set out_focus_elem $Page::($page_obj,out_focus_elem) + $c itemconfigure $block_element::($out_focus_elem,rect) \ + -fill $Page::($page_obj,x_color) + } + + set cell_highlight_color navyblue + set in_focus_elem $Page::($page_obj,in_focus_elem) + set Page::($page_obj,x_color) [lindex [$c itemconfigure \ + $block_element::($in_focus_elem,rect) -fill] end] + + $c itemconfigure $block_element::($in_focus_elem,rect) \ + -fill $cell_highlight_color + + set Page::($page_obj,out_focus_elem) $Page::($page_obj,in_focus_elem) + + if { $Page::($page_obj,in_focus_elem) } \ + { + if {$gPB_help_tips(state)} \ + { + global item_focus_on + + if {![info exists item_focus_on]} \ + { + set item_focus_on 0 + } + if {$item_focus_on == 0} \ + { + UI_PB_blk_CreateBalloon page_obj + set item_focus_on 1 + } + } + set block::($block_obj,active_blk_elem) $in_focus_elem + } + } +} + +#========================================================================== +proc UI_PB_blk_CreateBalloon { PAGE_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + + set c $Page::($page_obj,bot_canvas) + set in_focus_elem $Page::($page_obj,in_focus_elem) + + set add_obj $block_element::($in_focus_elem,elem_add_obj) + set add_leader $address::($add_obj,add_leader) + + set blk_elem_mom_var $block_element::($in_focus_elem,elem_mom_variable) + PB_com_MapMOMVariable add_obj blk_elem_mom_var blk_elem_text + PB_int_ApplyFormatAppText add_obj blk_elem_text + + set elem_desc $block_element::($in_focus_elem,elem_desc) + append desc $add_leader $blk_elem_text - $elem_desc + + global gPB_help_tips + set gPB_help_tips($c) $desc +} + +#========================================================================== +proc UI_PB_blk_AddrFocusOff {page_obj} { +#========================================================================== + # Restore cell color + set c $Page::($page_obj,bot_canvas) + + if { $Page::($page_obj,out_focus_elem) } \ + { + set out_focus_elem $Page::($page_obj,out_focus_elem) + $c itemconfigure $block_element::($out_focus_elem,rect) \ + -fill $Page::($page_obj,x_color) + } + + set Page::($page_obj,in_focus_elem) 0 + set Page::($page_obj,out_focus_elem) 0 + + # Restore cursor + $c config -cursor "" + + # Clean up balloon + UI_PB_blk_DeleteBalloon page_obj +} + +#========================================================================== +proc UI_PB_blk_DeleteBalloon { PAGE_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + global gPB_help_tips + + set c $Page::($page_obj,bot_canvas) + + if {$gPB_help_tips(state)} \ + { + if [info exists gPB_help_tips($c)] { + unset gPB_help_tips($c) + } + PB_cancel_balloon + global item_focus_on + set item_focus_on 0 + } +} + +#========================================================================== +proc UI_PB_blk_StartDragAddr {page_obj x y} { +#========================================================================== + global paOption + set Page::($page_obj,being_dragged) 1 + set c $Page::($page_obj,bot_canvas) + set block_obj $Page::($page_obj,active_blk_obj) + + # Unhighlight previously selected icon + if {$Page::($page_obj,active_blk_elem)} \ + { + set active_blk_elem $Page::($page_obj,active_blk_elem) + set icon_id $block_element::($active_blk_elem,icon_id) + set im [$c itemconfigure $icon_id -image] + set icon_tag [lindex [$c itemconfigure $icon_id -tags] end] + if {[string compare $icon_tag "nonmovable"] == 0} \ + { + [lindex $im end] configure -relief flat -background #c0c0ff + } else \ + { + [lindex $im end] configure -relief raised -background #c0c0ff + } + + set blk_elem_add_obj $block_element::($active_blk_elem,elem_add_obj) + set address_name $address::($blk_elem_add_obj,add_name) + if {[string compare $address_name "Text"] == 0} \ + { + [lindex $im end] configure -background $paOption(text) + } + } + + # Highlight current icon + $c raise current + set im [$c itemconfigure current -image] + set cur_img_tag [lindex [lindex [$c itemconfigure current -tags] end] 0] + [lindex $im end] configure -relief sunken -background pink + + set xx [$c canvasx $x] + set yy [$c canvasy $y] + + set active_blk_elem_list $block::($block_obj,active_blk_elem_list) + foreach blk_elem_obj $active_blk_elem_list \ + { + if {$xx >= $block_element::($blk_elem_obj,rect_corn_x0) && \ + $xx < $block_element::($blk_elem_obj,rect_corn_x1)} \ + { + set focus_blk $blk_elem_obj + set Page::($page_obj,source_elem_obj) $focus_blk + set Page::($page_obj,active_blk_elem) $focus_blk + break; + } + } + + UI_PB_blk_ConfigureLeader page_obj focus_blk + + if {[string compare $cur_img_tag "movable"] == 0} \ + { + set origin_xb [$c canvasx $x] + set origin_yb [$c canvasy $y] + set Page::($page_obj,last_xb) $origin_xb + set Page::($page_obj,last_yb) $origin_yb + + # Create corresponding icon in component panel + set panel_hi $Page::($page_obj,panel_hi) + + # Fine adjustment in next 2 lines is needed to line up icons nicely. + # This may have something to do with the -bd & -relief in canvas. + set dx 1 + set dy [expr $panel_hi + 2] + + set blk_elem_addr $block_element::($blk_elem_obj,elem_add_obj) + set addr_leader $address::($blk_elem_addr,add_leader) + set blk_elem_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + + UI_PB_com_RetImageAppdText blk_elem_addr blk_elem_mom_var \ + image_name blk_elem_text + + set origin_xt [expr [expr $block_element::($focus_blk,rect_corn_x0) + \ + $block_element::($focus_blk,rect_corn_x1)] / 2] + set origin_yt [expr [expr $block_element::($focus_blk,rect_corn_y0) + \ + $block_element::($focus_blk,rect_corn_y1)] / 2] + + set diff_x [expr $xx - $origin_xt] + set diff_y [expr $yy - $origin_yt] + + set top_canvas $Page::($page_obj,top_canvas) + set img_addr [UI_PB_blk_CreateIcon $top_canvas $image_name \ + $blk_elem_text] + + append opt_img pb_ $block_element::($focus_blk,elem_opt_nows_var) + $img_addr add image -image [tix getimage $opt_img] + unset opt_img + + set icon_top [$top_canvas create image \ + [expr $x - $dx - $diff_x] [expr $y + $dy - $diff_y] \ + -image $img_addr -tag new_comp] + set Page::($page_obj,icon_top) $icon_top + + set last_xt [expr $x - $dx] + set last_yt [expr $y + $dy] + + set Page::($page_obj,last_xt) $last_xt + set Page::($page_obj,last_yt) $last_yt + + set im [$top_canvas itemconfigure $icon_top -image] + [lindex $im end] configure -relief sunken -background pink + + $c bind movable "" + $c bind movable "" + + # Change cursor + UI_PB_com_ChangeCursor $c + } +} + +#============================================================================ +proc UI_PB_blk_DragAddr {page_obj x y} { +#============================================================================ + set c $Page::($page_obj,bot_canvas) + set panel_hi $Page::($page_obj,panel_hi) + + set xc [$c canvasx $x] + set yc [$c canvasy $y] + + # Translate element + $c move current [expr $xc - $Page::($page_obj,last_xb)] \ + [expr $yc - $Page::($page_obj,last_yb)] + + set dx 1 + set dy [expr $panel_hi + 2] + + set top_canvas $Page::($page_obj,top_canvas) + set xp [$top_canvas canvasx $x] + set yp [$top_canvas canvasy $y] + + $top_canvas move $Page::($page_obj,icon_top) \ + [expr $xp - $Page::($page_obj,last_xt) - $dx] \ + [expr $yp - $Page::($page_obj,last_yt) + $dy] + + set Page::($page_obj,last_xb) $xc + set Page::($page_obj,last_yb) $yc + set Page::($page_obj,last_xt) [expr $xp - $dx] + set Page::($page_obj,last_yt) [expr $yp + $dy] + + # Highlight the trash cell + UI_PB_blk_TrashFocusOn $page_obj $x $y + + set focus_blk_elem $Page::($page_obj,source_elem_obj) + set addr_obj $block_element::($focus_blk_elem,elem_add_obj) + set add_name $address::($addr_obj,add_name) + + if {[string compare $add_name "Text"] == 0} \ + { + UI_PB_blk_HighLightCellDividers $page_obj $xc $yc + } +} + +#============================================================================ +proc UI_PB_blk_TrashFocusOn {page_obj x y} { +#============================================================================ + global paOption + + set panel_hi $Page::($page_obj,panel_hi) + + # Highlight current icon + set trash_cell $Page::($page_obj,trash) + + if {$x > [lindex $trash_cell 1] && $x < [lindex $trash_cell 2] && \ + $y > [lindex $trash_cell 3] && $y < [lindex $trash_cell 4]} \ + { + [lindex $trash_cell 0] configure -background $paOption(focus) + UI_PB_blk_TrashConnectLine page_obj + set Page::($page_obj,trash_flag) 1 + + } else \ + { + [lindex $trash_cell 0] configure -background $paOption(app_butt_bg) + set top_canvas $Page::($page_obj,top_canvas) + $top_canvas delete connect_line + set Page::($page_obj,trash_flag) 0 + } +} + +#============================================================================ +proc UI_PB_blk_EndDragAddr {page_obj} { +#============================================================================ + global paOption + + set Page::($page_obj,being_dragged) 0 + set c $Page::($page_obj,bot_canvas) + set target_cell_num 0 + set source_cell_num 0 + + set block_obj $Page::($page_obj,active_blk_obj) + # Find source cell number id + if {$Page::($page_obj,add_flag) == 2} \ + { + set prev_act_elem $Page::($page_obj,insert_elem) + $c itemconfigure $block_element::($prev_act_elem,div_id) \ + -fill $Page::($page_obj,div_col) -outline $Page::($page_obj,div_col) + $c delete connect_line + } elseif {$Page::($page_obj,add_flag) == 3} \ + { + $c itemconfigure $block::($block_obj,div_id) \ + -fill $Page::($page_obj,div_col) -outline $Page::($page_obj,div_col) + $c delete connect_line + } + + # Trash can in focus, dispose element. + if { $Page::($page_obj,trash_flag) == 1 } \ + { + UI_PB_blk_UpdateCells page_obj + + [lindex $Page::($page_obj,trash) 0] configure \ + -background $paOption(app_butt_bg) + set Page::($page_obj,trash_flag) 0 + + # Drop for Text address elements + } elseif {$Page::($page_obj,add_flag)} \ + { + UI_PB_blk_ChangeTextPosition page_obj + set Page::($page_obj,add_flag) 0 + } else \ + { + set source_elem_obj $Page::($page_obj,source_elem_obj) + UI_PB_blk_ReturnAddr page_obj source_elem_obj + } + + # Clean up balloon + UI_PB_blk_DeleteBalloon page_obj + + # Deletes the icon that has been created in the top canvas + $Page::($page_obj,top_canvas) delete $Page::($page_obj,icon_top) + + # Delete connecting line + $Page::($page_obj,top_canvas) delete connect_line + + # Rebind callbacks + $c bind movable "UI_PB_blk_AddrFocusOn $page_obj \ + %x %y" + $c bind movable "UI_PB_blk_AddrFocusOff $page_obj" + + # Adjust cursor + $c config -cursor "" + + set last_xb $Page::($page_obj,last_xb) + set last_yb $Page::($page_obj,last_yb) + + UI_PB_blk_AddrFocusOn $page_obj $last_xb $last_yb +} + +#============================================================================ +proc UI_PB_blk_ChangeTextPosition { PAGE_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + + set c $Page::($page_obj,bot_canvas) + set block_obj $Page::($page_obj,active_blk_obj) + set source_elem_obj $Page::($page_obj,source_elem_obj) + + # Deletes all the existing cells and icons + UI_PB_blk_DeleteCellsIcons page_obj block_obj + + set block_elem_obj_list $block::($block_obj,active_blk_elem_list) + set cur_indx [lsearch $block_elem_obj_list $source_elem_obj] + set block_elem_obj_list [lreplace $block_elem_obj_list \ + $cur_indx $cur_indx] + + if {$Page::($page_obj,add_flag) == 1 || \ + $Page::($page_obj,add_flag) == 3} \ + { + lappend block_elem_obj_list $source_elem_obj + } else \ + { + set insert_blk_elem $Page::($page_obj,insert_elem) + set insert_indx [lsearch $block_elem_obj_list $insert_blk_elem] + set block_elem_obj_list [linsert $block_elem_obj_list \ + $insert_indx $source_elem_obj] + } + + set block::($block_obj,active_blk_elem_list) $block_elem_obj_list + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + + # proc is called to create the block cells + set block_owner $block::($block_obj,blk_owner) + UI_PB_blk_CreateBlockCells page_obj block_obj source_elem_obj \ + block_owner + + # Block Elements binding procedures + UI_PB_blk_IconBindProcs page_obj + + UI_PB_blk_ConfigureLeader page_obj source_elem_obj +} + +#============================================================================ +proc UI_PB_blk_UpdateCells {PAGE_OBJ} { +#============================================================================ + upvar $PAGE_OBJ page_obj + + set c $Page::($page_obj,bot_canvas) + set block_obj $Page::($page_obj,active_blk_obj) + + set source_elem_obj $Page::($page_obj,source_elem_obj) + set source_cell_num [lsearch $block::($block_obj,active_blk_elem_list) \ + $source_elem_obj] + + # gets the address object + set addr_obj $block_element::($source_elem_obj,elem_add_obj) + address::DeleteFromBlkElemList $addr_obj source_elem_obj + + # Deletes the source icon + $c delete $block_element::($source_elem_obj,icon_id) + set block_obj $Page::($page_obj,active_blk_obj) + + UI_PB_blk_UpdateBlkElements page_obj block_obj source_cell_num + + if {$source_cell_num >= 0} \ + { + set active_blk_elem [lindex $block::($block_obj,active_blk_elem_list) \ + $source_cell_num] + UI_PB_blk_ConfigureLeader page_obj active_blk_elem + } else \ + { + set active_blk_elem 0 + UI_PB_blk_ConfigureLeader page_obj active_blk_elem + } +} + +#=============================================================================== +proc UI_PB_blk_UpdateBlkElements { PAGE_OBJ BLOCK_OBJ SOURCE_CELL_NUM} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $BLOCK_OBJ block_obj + upvar $SOURCE_CELL_NUM source_cell_num + + set bot_canvas $Page::($page_obj,bot_canvas) + set source_elem_obj $Page::($page_obj,source_elem_obj) + + # Deletes all the existing cells and icons + UI_PB_blk_DeleteCellsIcons page_obj block_obj + + set block::($block_obj,active_blk_elem_list) \ + [lreplace $block::($block_obj,active_blk_elem_list) \ + $source_cell_num $source_cell_num] + # Block Element Activation + set no_of_elements [llength $block::($block_obj,active_blk_elem_list)] + if {$source_cell_num >= $no_of_elements} \ + { + set source_cell_num [expr $source_cell_num - 1] + } + + if {$source_cell_num >= 0} \ + { + set active_blk_elem [lindex $block::($block_obj,active_blk_elem_list) \ + $source_cell_num] + } else { + set active_blk_elem 0 + } + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + + set block_owner $block::($block_obj,blk_owner) + UI_PB_blk_CreateBlockCells page_obj block_obj active_blk_elem \ + block_owner +} + +#=========================================================================== +proc UI_PB_blk_DeleteRect {PAGE_OBJ} { +#=========================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + set x_orig $Page::($page_obj,x_orig) + set y_orig $Page::($page_obj,y_orig) + set h_cell $Page::($page_obj,h_cell) + set w_cell $Page::($page_obj,w_cell) + set w_divi $Page::($page_obj,w_divi) + set cell_box_width 4 + set main_cell_color $paOption(can_bg) + + set c $Page::($page_obj,bot_canvas) + + set block_obj $Page::($page_obj,active_blk_obj) + $c delete $block::($block_obj,rect) + + set no_icons [llength $block::($block_obj,active_blk_elem_list)] + + set x0 [expr $x_orig] + set y0 [expr $y_orig] + + set x1 [expr $x0 + [expr [expr [expr $w_cell + $w_divi] * \ + $no_icons] + $w_divi + 8]] + set y1 [expr $y0 + $h_cell + 8] + + set block::($block_obj,rect) [$c create rect $x0 $y0 $x1 $y1 \ + -fill $main_cell_color -outline $main_cell_color \ + -tag stationary] + $c lower $block::($block_obj,rect) + + set block::($block_obj,rect_x0) $x0 + set block::($block_obj,rect_y0) $y0 + set block::($block_obj,rect_x1) $x1 + set block::($block_obj,rect_y1) $y1 +} + +#============================================================================== +proc UI_PB_blk_AddTextElement { PAGE_OBJ NEW_ELEM_OBJ text_label } { +#============================================================================== + upvar $PAGE_OBJ page_obj + upvar $NEW_ELEM_OBJ new_elem_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + set sel_base_addr $Page::($page_obj,sel_base_addr) + set block_obj $Page::($page_obj,active_blk_obj) + set block_owner $block::($block_obj,blk_owner) + + # popup text window, if text element is added + UI_PB_com_CreateTextEntry page_obj new_elem_obj $text_label + tkwait window $bot_canvas.txtent + if {[string compare $block_element::($new_elem_obj,elem_mom_variable) \ + "000"] != 0} \ + { + UI_PB_blk_ReplaceIcon page_obj $sel_base_addr $new_elem_obj + UI_PB_blk_ConfigureLeader page_obj new_elem_obj + } else \ + { + UI_PB_blk_DeleteCellsIcons page_obj block_obj + + set block_elem_obj_list $block::($block_obj,active_blk_elem_list) + set new_index [lsearch $block_elem_obj_list $new_elem_obj] + set block_elem_obj_list [lreplace $block_elem_obj_list \ + $new_index $new_index] + set block::($block_obj,active_blk_elem_list) $block_elem_obj_list + set no_elems [llength $block_elem_obj_list] + if { $no_elems == 0} \ + { + set active_elem 0 + } elseif { $new_index >= 0 && $new_index < $no_elems} \ + { + set active_elem [lindex $block_elem_obj_list $new_index] + } elseif { $new_index == $no_elems} \ + { + set active_elem [lindex $block_elem_obj_list \ + [expr $new_index - 1]] + } + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + UI_PB_blk_CreateBlockCells page_obj block_obj active_elem \ + block_owner + UI_PB_blk_ConfigureLeader page_obj active_elem + } +} + +#============================================================================== +proc UI_PB_blk_AddCell {PAGE_OBJ} { +#============================================================================== + upvar $PAGE_OBJ page_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + set block_obj $Page::($page_obj,active_blk_obj) + + set new_elem_mom_var $Page::($page_obj,new_elem_mom_var) + set sel_base_addr $Page::($page_obj,sel_base_addr) + + # Checks the existance of the block element in the block template + # if the block element exists it gives out a error message and returns + set blk_elem_flag [UI_PB_com_CheckElemBlkTemplate block_obj \ + sel_base_addr] + if {$blk_elem_flag} \ + { + UI_PB_com_DisplyErrorMssg sel_base_addr + return + } + + # Deletes all the existing cells and icons + UI_PB_blk_DeleteCellsIcons page_obj block_obj + + # Creates new address + if { [string compare $sel_base_addr "New_Address"] == 0 } \ + { + set sel_base_addr "user_def" + set fmt_name "String" + PB_int_CreateNewAddress sel_base_addr fmt_name new_add_obj + } + + # Gets the data of the new block element from the database + # New block element is added to the block object. + PB_int_AddNewBlockElemObj sel_base_addr new_elem_mom_var \ + block_obj new_elem_obj + set block_element::($new_elem_obj,owner) $block::($block_obj,blk_owner) + + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + set block_elem_obj_list $block::($block_obj,active_blk_elem_list) + } + + if {$Page::($page_obj,add_flag) == 1 || \ + $Page::($page_obj,add_flag) == 3} \ + { + lappend block_elem_obj_list $new_elem_obj + } else \ + { + set insert_blk_elem $Page::($page_obj,insert_elem) + set insert_indx [lsearch $block_elem_obj_list $insert_blk_elem] + set block_elem_obj_list [linsert $block_elem_obj_list \ + $insert_indx $new_elem_obj] + } + + # Sorts the block elements of a Block template + UI_PB_com_SortBlockElements block_elem_obj_list + set block::($block_obj,active_blk_elem_list) $block_elem_obj_list + unset block_elem_obj_list + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + + # proc is called to create the block cells + set block_owner $block::($block_obj,blk_owner) + UI_PB_blk_CreateBlockCells page_obj block_obj new_elem_obj \ + block_owner + + # Block Elements binding procedures + UI_PB_blk_IconBindProcs page_obj + + UI_PB_blk_ConfigureLeader page_obj new_elem_obj + + if {[string compare $Page::($page_obj,sel_base_addr) "Text"] == 0} \ + { + # Called only for text elements + UI_PB_blk_AddTextElement page_obj new_elem_obj Text + } elseif { [string compare $Page::($page_obj,sel_base_addr) \ + "New_Address"] == 0 } \ + { + # Brings up New address dialog + set event_obj 0 + set evt_elem_obj 0 + UI_PB_blk_NewAddress page_obj event_obj evt_elem_obj \ + new_elem_obj block + } elseif { [string match "*User Defined*" \ + $block_element::($new_elem_obj,elem_desc)] } \ + { + # Called for adding an expression + UI_PB_blk_AddTextElement page_obj new_elem_obj Expression + } +} + +#============================================================================== +proc UI_PB_blk_TrashConnectLine { PAGE_OBJ } { +#============================================================================== + global paOption + upvar $PAGE_OBJ page_obj + + set vtx {} + set panel_hi $Page::($page_obj,panel_hi) + + # Center of cell + set x0 [lindex $Page::($page_obj,trash) 1] + set x1 [lindex $Page::($page_obj,trash) 2] + set y0 [lindex $Page::($page_obj,trash) 3] + set y1 [lindex $Page::($page_obj,trash) 4] + + set x11 [expr [expr $x0 + $x1] / 2] + set y11 [expr [expr [expr $y0 + $y1] / 2] + $panel_hi] + lappend vtx $x11 $y11 + + # Center of icon in action + set top_canvas $Page::($page_obj,top_canvas) + set coords [$top_canvas coords new_comp] + set x1 [expr [lindex $coords 0] + 1] + set y1 [lindex $coords 1] + + lappend vtx $x1 $y1 + lappend vtx [expr $x1 - 2] $y1 + + # Draw line + if {[$top_canvas gettags connect_line] == "connect_line"} \ + { + eval {$top_canvas coords connect_line} $vtx + } else \ + { + eval {$top_canvas create poly} $vtx {-fill $paOption(focus) \ + -width 1 -outline $paOption(focus) \ + -tag connect_line} + } + + $top_canvas lower connect_line +} + +#============================================================================= +proc UI_PB_blk_ItemFocusOn1 {page_obj x y} { +#============================================================================= + global paOption + set top_canvas $Page::($page_obj,top_canvas) + + # Highlight current icon + set im [$top_canvas itemconfigure current -image] + if [string compare $im ""] \ + { + [lindex $im end] configure -background $paOption(focus) + } + + # Change cursor + $top_canvas config -cursor hand2 + + set Page::($page_obj,add_button_focus_on) 1 +} + +#============================================================================= +proc UI_PB_blk_ItemFocusOff1 {page_obj} { +#============================================================================= + global paOption + + set top_canvas $Page::($page_obj,top_canvas) + + if {$Page::($page_obj,add_button_focus_on)} \ + { + # Unhighlight current icon + set im [$top_canvas itemconfigure current -image] + [lindex $im end] configure -background $paOption(app_butt_bg) + + # Restore cursor + $top_canvas config -cursor "" + + set Page::($page_obj,add_button_focus_on) 0 + } +} + +#============================================================================= +proc UI_PB_blk_ItemStartDrag1 {page_obj x y} { +#============================================================================= + global paOption + + set c $Page::($page_obj,bot_canvas) + set Page::($page_obj,add_cell_flag) 0 + + $c raise current + + set origin_xt [$c canvasx $x] + set origin_yt [$c canvasy $y] + + set Page::($page_obj,last_xt) $origin_xt + set Page::($page_obj,last_yt) $origin_yt + + # Depress Add button + $Page::($page_obj,add) configure -bg $paOption(focus) -relief sunken + + # Create icons on all canvases @ cursor + UI_PB_blk_DrawIconInAllCanvas $page_obj $x $y + + # Change cursor + UI_PB_com_ChangeCursor $Page::($page_obj,top_canvas) +} + +#============================================================================== +proc UI_PB_blk_DrawIconInAllCanvas {page_obj x y } { +#============================================================================== + set panel_hi $Page::($page_obj,panel_hi) + set top_canvas $Page::($page_obj,top_canvas) + set bot_canvas $Page::($page_obj,bot_canvas) + set new_elem_mom_var $Page::($page_obj,new_elem_mom_var) + set new_elem_addr $Page::($page_obj,sel_base_addr) + + if { [string compare $new_elem_addr "New_Address"] == 0} \ + { + set image_name "pb_blank_addr" + set app_text "" + set no_chars 5 + UI_PB_com_TrimOrFillAppText app_text no_chars + } else \ + { + PB_int_RetAddrObjFromName new_elem_addr add_obj + UI_PB_com_RetImageAppdText add_obj new_elem_mom_var \ + image_name app_text + } + + # Next lines are needed for coords mapping to be correct in + # canvas that displays the block. + set dx 0 + set dy [expr $panel_hi + 2] + set xc [$bot_canvas canvasx [expr $x + $dx]] + set yc [$bot_canvas canvasy [expr $y - $dy]] + set cmp2 [UI_PB_blk_CreateIcon $bot_canvas $image_name $app_text] + $cmp2 add image -image [tix getimage pb_blank] + set icon_bot [$bot_canvas create image $xc $yc \ + -image $cmp2 -tag movable] + set Page::($page_obj,icon_bot) $icon_bot + $cmp2 configure -relief sunken -background pink + + # Draw icon in component panel + set xc [$top_canvas canvasx $x] + set yc [$top_canvas canvasy $y] + set cmp1 [UI_PB_blk_CreateIcon $top_canvas $image_name $app_text] + $cmp1 add image -image [tix getimage pb_blank] + set icon_top [$top_canvas create image $xc $yc \ + -image $cmp1 -tag new_comp] + + $cmp1 configure -relief sunken -background pink + set Page::($page_obj,icon_top) $icon_top + + # Since it's already in the callback func attached to the "add_movable" + # tag, the func will not be executed for the newly created items. + # We have to tweak the state of focus to avoid the FocusOff1 CB, + # that will reset the cursor, being executed automatically, + # because the "Add" button has been obstructed by the new button. + + set Page::($page_obj,add_button_focus_on) 0 +} + +#============================================================================== +proc UI_PB_blk_ItemDrag1 {page_obj x y} { +#============================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + set top_canvas $Page::($page_obj,top_canvas) + set panel_hi $Page::($page_obj,panel_hi) + set sel_addr $Page::($page_obj,sel_base_addr) + + # Icon in the component panel does not need to be + # manipulated when it goes too far out of the panel. + set xx [$top_canvas canvasx $x] + set yy [$top_canvas canvasy $y] + $top_canvas coords $Page::($page_obj,icon_top) $xx $yy + + set dx 1 + set dy [expr $panel_hi + 2] + set xx [$bot_canvas canvasx [expr $x + $dx]] + set yy [$bot_canvas canvasy [expr $y - $dy]] + $bot_canvas coords $Page::($page_obj,icon_bot) $xx $yy + + if { [string compare $sel_addr "Text"] != 0 } \ + { + UI_PB_blk_HighlightRect $page_obj $xx $yy + } else \ + { + UI_PB_blk_HighLightCellDividers $page_obj $xx $yy + } +} + +#============================================================================== +proc UI_PB_blk_HighLightCellDividers { page_obj xx yy } { +#============================================================================== + global paOption + + set high_color $paOption(focus) + set bot_canvas $Page::($page_obj,bot_canvas) + set block_obj $Page::($page_obj,active_blk_obj) + set rect_region $Page::($page_obj,rect_region) + + if {$Page::($page_obj,add_flag) == 2} \ + { + set prev_act_elem $Page::($page_obj,insert_elem) + $bot_canvas itemconfigure $block_element::($prev_act_elem,div_id) \ + -fill $Page::($page_obj,div_col) -outline $Page::($page_obj,div_col) + } elseif {$Page::($page_obj,add_flag) == 3} \ + { + $bot_canvas itemconfigure $block::($block_obj,div_id) \ + -fill $Page::($page_obj,div_col) -outline $Page::($page_obj,div_col) + } + + set Page::($page_obj,add_flag) 0 + + foreach blk_elem_obj $block::($block_obj,active_blk_elem_list) \ + { + if { $yy > [expr $block_element::($blk_elem_obj,div_corn_y0) - \ + $rect_region] && \ + $yy < [expr $block_element::($blk_elem_obj,div_corn_y1) + \ + $rect_region] && \ + $xx > [expr $block_element::($blk_elem_obj,div_corn_x0) - 10] && \ + $xx < [expr $block_element::($blk_elem_obj,div_corn_x1) + 10]} \ + { + set Page::($page_obj,div_col) [lindex [$bot_canvas itemconfigure \ + $block_element::($blk_elem_obj,div_id) -fill] end] + $bot_canvas itemconfigure $block_element::($blk_elem_obj,div_id) \ + -fill $high_color -outline $high_color + set Page::($page_obj,active_blk_obj) $block_obj + set Page::($page_obj,insert_elem) $blk_elem_obj + set rect_coord(0) $block_element::($blk_elem_obj,div_corn_x0) + set rect_coord(1) $block_element::($blk_elem_obj,div_corn_y0) + set rect_coord(2) $block_element::($blk_elem_obj,div_corn_x1) + set rect_coord(3) $block_element::($blk_elem_obj,div_corn_y1) + UI_PB_blk_BlockConnectLine page_obj rect_coord + set Page::($page_obj,add_flag) 2 + break + } else \ + { + $bot_canvas delete connect_line + set Page::($page_obj,add_flag) 0 + } + } + + if {!$Page::($page_obj,add_flag)} \ + { + if { $yy > [expr $block::($block_obj,div_corn_y0) - \ + $rect_region] && \ + $yy < [expr $block::($block_obj,div_corn_y1) + \ + $rect_region] && \ + $xx > [expr $block::($block_obj,div_corn_x0) - 10] && \ + $xx < [expr $block::($block_obj,div_corn_x1) + 10]} \ + { + set Page::($page_obj,div_col) [lindex [$bot_canvas itemconfigure \ + $block::($block_obj,div_id) -fill] end] + $bot_canvas itemconfigure $block::($block_obj,div_id) \ + -fill $high_color -outline $high_color + set Page::($page_obj,active_blk_obj) $block_obj + set rect_coord(0) $block::($block_obj,div_corn_x0) + set rect_coord(1) $block::($block_obj,div_corn_y0) + set rect_coord(2) $block::($block_obj,div_corn_x1) + set rect_coord(3) $block::($block_obj,div_corn_y1) + UI_PB_blk_BlockConnectLine page_obj rect_coord + set Page::($page_obj,add_flag) 3 + } else \ + { + $bot_canvas delete connect_line + set Page::($page_obj,add_flag) 0 + } + } +} + +#============================================================================== +proc UI_PB_blk_HighlightRect {page_obj x y} { +#============================================================================== + global paOption + + set high_color $paOption(focus) + set bot_canvas $Page::($page_obj,bot_canvas) + set block_obj $Page::($page_obj,active_blk_obj) + + if {[info exists Page::($page_obj,rect_col)] == 1} \ + { + $bot_canvas itemconfigure $block::($block_obj,rect) \ + -fill $Page::($page_obj,rect_col) + } + + if {$x > [expr $block::($block_obj,rect_x0) - \ + [expr $Page::($page_obj,rect_region) / 1.5]] && \ + $x < [expr $block::($block_obj,rect_x1) + \ + $Page::($page_obj,rect_region)] && \ + $y > [expr $block::($block_obj,rect_y0) - \ + $Page::($page_obj,rect_region)] && \ + $y < [expr $block::($block_obj,rect_y1) + \ + $Page::($page_obj,rect_region)] } \ + { + set Page::($page_obj,rect_col) [lindex [$bot_canvas itemconfigure \ + $block::($block_obj,rect) -fill] end] + $bot_canvas itemconfigure $block::($block_obj,rect) -fill $high_color + set Page::($page_obj,active_blk_obj) $block_obj + set rect_coord(0) $block::($block_obj,rect_x0) + set rect_coord(1) $block::($block_obj,rect_y0) + set rect_coord(2) $block::($block_obj,rect_x1) + set rect_coord(3) $block::($block_obj,rect_y1) + UI_PB_blk_BlockConnectLine page_obj rect_coord + set Page::($page_obj,add_flag) 1 + } else \ + { + $bot_canvas delete connect_line + set Page::($page_obj,add_flag) 0 + } +} + +#============================================================================== +proc UI_PB_blk_BlockConnectLine {PAGE_OBJ RECT_COORD} { +#============================================================================== + upvar $PAGE_OBJ page_obj + upvar $RECT_COORD rect_coord + global paOption + + set panel_hi $Page::($page_obj,panel_hi) + + set vtx {} + set top_canvas $Page::($page_obj,top_canvas) + set bot_canvas $Page::($page_obj,bot_canvas) + + # Center of Block + set x0 $rect_coord(0) + set y0 $rect_coord(1) + set x1 $rect_coord(2) + set y1 $rect_coord(3) + set x11 [expr [expr $x0 + $x1] / 2] + set y11 [expr [expr $y0 + $y1] / 2] + lappend vtx $x11 $y11 + + set new_originx [$top_canvas canvasx 0] + + # Center of icon in action + set coords [$top_canvas coords $Page::($page_obj,icon_top)] + set x1 [expr [lindex $coords 0] - $new_originx] + set y1 [lindex $coords 1] + set y1 [expr $y1 - $panel_hi] + set x1 [$bot_canvas canvasx $x1] + set x1 [expr $x1 + 1] + set y1 [$bot_canvas canvasy $y1] + lappend vtx $x1 $y1 + set x1 [expr $x1 - 2] + lappend vtx $x1 $y1 + + + # Draw line + if {[$bot_canvas gettags connect_line] == "connect_line"} \ + { + eval {$bot_canvas coords connect_line} $vtx + } else \ + { + eval {$bot_canvas create poly} $vtx {-fill $paOption(focus) \ + -width 1 -outline $paOption(focus) \ + -tag connect_line} + $bot_canvas lower connect_line + } +} + +#============================================================================== +proc UI_PB_blk_ItemEndDrag1 {page_obj x1 y1} { +#============================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + set top_canvas $Page::($page_obj,top_canvas) + + set block_obj $Page::($page_obj,active_blk_obj) + + if {[info exists Page::($page_obj,rect_col)] == 1} \ + { + $bot_canvas itemconfigure $block::($block_obj,rect) \ + -fill $Page::($page_obj,rect_col) + } + + if {$Page::($page_obj,add_flag) == 2} \ + { + set prev_act_elem $Page::($page_obj,insert_elem) + $bot_canvas itemconfigure $block_element::($prev_act_elem,div_id) \ + -fill $Page::($page_obj,div_col) -outline $Page::($page_obj,div_col) + } elseif {$Page::($page_obj,add_flag) == 3} \ + { + $bot_canvas itemconfigure $block::($block_obj,div_id) \ + -fill $Page::($page_obj,div_col) -outline $Page::($page_obj,div_col) + } + + # Cleanup ghost icons + if {$Page::($page_obj,icon_bot)} \ + { + $bot_canvas delete $Page::($page_obj,icon_bot) + set Page::($page_obj,icon_bot) 0 + if {$Page::($page_obj,add_flag)} \ + { + $bot_canvas delete connect_line + UI_PB_blk_AddCell page_obj + set Page::($page_obj,add_flag) 0 + } + } + + if {$Page::($page_obj,icon_top)} \ + { + $top_canvas delete $Page::($page_obj,icon_top) + set Page::($page_obj,icon_top) 0 + } + + $Page::($page_obj,add) configure -relief raised \ + -background #c0c0ff + + # Restore cursor and focus + $top_canvas config -cursor "" + UI_PB_blk_ItemFocusOn1 $page_obj $x1 $y1 +} + +#============================================================================== +proc UI_PB_blk_ReturnAddr {PAGE_OBJ SOURCE_BLK_ELEM} { +#============================================================================== + upvar $PAGE_OBJ page_obj + upvar $SOURCE_BLK_ELEM source_blk_elem + + set c $Page::($page_obj,bot_canvas) + + set icon_id $block_element::($Page::($page_obj,active_blk_elem),icon_id) + $c coords $icon_id $block_element::($source_blk_elem,xc) \ + $block_element::($source_blk_elem,yc) +} + +#============================================================================= +proc UI_PB_blk_TabBlockDelete { blk_page_obj } { +#============================================================================= + # Deletes all the existing cells and icons + if {[info exists Page::($blk_page_obj,active_blk_obj)]} \ + { + set active_blk $Page::($blk_page_obj,active_blk_obj) + UI_PB_blk_DeleteCellsIcons blk_page_obj active_blk + + # updates the active block + UI_PB_blk_BlkApplyCallBack $blk_page_obj + + unset block::($active_blk,active_blk_elem_list) + unset Page::($blk_page_obj,active_blk_obj) + } +} + +#============================================================================= +proc UI_PB_blk_TabBlockCreate { blk_page_obj } { +#============================================================================= + set tree $Page::($blk_page_obj,tree) + set HLIST [$tree subwidget hlist] + + set ent [$HLIST info selection] + set index [string range $ent 2 [string length $ent]] + if {[string compare $index ""] == 0} \ + { + set index 0 + } + + # Recreates the block tree + UI_PB_blk_DisplayNameList blk_page_obj index + + # Creates combobox elements + UI_PB_blk_CreateMenuOptions blk_page_obj + + UI_PB_blk_BlkItemSelection $blk_page_obj +} + +#============================================================================== +proc UI_PB_blk_CreateBlockPage { BLOCK_OBJ FRAME NEW_BLK_PAGE } { +#============================================================================== + upvar $BLOCK_OBJ block_obj + upvar $FRAME frame + upvar $NEW_BLK_PAGE new_blk_page + global popupvar + global paOption + + block::readvalue $block_obj blk_obj_attr + set pname $blk_obj_attr(0) + set new_blk_page [new Page $pname $pname] + + set win [toplevel $frame.$blk_obj_attr(0)] + + UI_PB_com_CreateTransientWindow $win "BLOCK : $blk_obj_attr(0)" \ + "700x600+200+200" "" "" + # Sets Page parameters + set Page::($new_blk_page,canvas_frame) $win + + # Sets the block page attributes + UI_PB_blk_SetPageAttributes new_blk_page + + # Creates a frame for action buttons + set act_frm [frame $win.actbut] + pack $act_frm -side bottom -fill x -padx 1 -pady 3 + + # Creates the top and bottom canvases + set top_canvas_dim(0) 80 + set top_canvas_dim(1) 400 + set bot_canvas_dim(0) 2000 + set bot_canvas_dim(1) 1000 + Page::CreateCanvas $new_blk_page top_canvas_dim bot_canvas_dim + + # Adds items to the top canvas + UI_PB_blk_AddTopFrameItems new_blk_page + + # Adds the Add and Trash buttons to the top canvas + set Page::($new_blk_page,add_name) " Add Word " + Page::CreateAddTrashinCanvas $new_blk_page + Page::CreateMenu $new_blk_page + + # Binds the Add button + UI_PB_blk_AddBindProcs new_blk_page + set top_canvas $Page::($new_blk_page,top_canvas) + $top_canvas bind add_movable \ + "UI_PB_blk_ItemDrag1 $new_blk_page %x %y" + $top_canvas bind add_movable \ + "UI_PB_blk_ItemEndDrag1 $new_blk_page %x %y" + # PopupMenu bind call + UI_PB_blk_CreatePopupMenu new_blk_page + + # Database call for getting the Event items and ude flag + PB_int_RetEvtCombElems comb_box_elems + set Page::($new_blk_page,blk_WordNameList) $comb_box_elems + + # Creates combobox elements + UI_PB_blk_CreateMenuOptions new_blk_page + + # Adds Action buttons + set box_frm $Page::($new_blk_page,box) + pack forget $box_frm + set Page::($new_blk_page,box) $act_frm + + # Displays block attributes in the block page + UI_PB_blk_DisplayBlockAttr new_blk_page block_obj +} + +#=============================================================================== +proc UI_PB_blk_EditBlkActionButtons { NEW_BLK_PAGE SEQ_PAGE_OBJ SEQ_OBJ \ + ELEMENT_OBJ } { +#=============================================================================== + upvar $NEW_BLK_PAGE new_blk_page + upvar $SEQ_PAGE_OBJ seq_page_obj + upvar $SEQ_OBJ seq_obj + upvar $ELEMENT_OBJ element_obj + global paOption + + set act_frm $Page::($new_blk_page,box) + + set box1_frm [frame $act_frm.box1] + set box2_frm [frame $act_frm.box2] + + tixForm $box1_frm -top 0 -left 1 -right %50 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 1 -right %100 + + set box1 [tixButtonBox $box1_frm.bb -orientation horizontal \ + -bd 2 -relief sunken -bg $paOption(butt_bg)] + + set box2 [tixButtonBox $box2_frm.bb -orientation horizontal \ + -bd 2 -relief sunken -bg $paOption(butt_bg)] + + $box1 add def -text Default -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_DefaultCallBack $new_blk_page" + $box1 add apl -text Restore -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_RestoreCallBack $new_blk_page" + + $box2 add canc -text Cancel -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_EditCancel_CB $new_blk_page $seq_page_obj \ + $seq_obj $element_obj" + $box2 add ok -text Ok -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_EditOk_CB $new_blk_page $seq_page_obj \ + $seq_obj $element_obj" + + pack $box1 -fill x + pack $box2 -fill x +} + +#============================================================================== +proc UI_PB_blk_EditOk_CB { page_obj seq_page_obj seq_obj elem_obj } { +#============================================================================== + + UI_PB_blk_BlkApplyCallBack $page_obj + + set bot_canvas $Page::($seq_page_obj,bot_canvas) + set blk_img_id $event_element::($elem_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $blk_img_id -image] end] + $img config -relief raised -bg lightSkyBlue + + # Binds the Leave + $bot_canvas bind blk_movable \ + "UI_PB_evt_BlockFocusOff $seq_page_obj $seq_obj" + +# grab release $Page::($page_obj,canvas_frame) + destroy $Page::($page_obj,canvas_frame) +} + +#============================================================================== +proc UI_PB_blk_EditCancel_CB { page_obj seq_page_obj seq_obj elem_obj } { +#============================================================================== + set block_obj $event_element::($elem_obj,block_obj) + set bot_canvas $Page::($seq_page_obj,bot_canvas) + set blk_img_id $event_element::($elem_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $blk_img_id -image] end] + + $img config -relief raised -bg lightSkyBlue + + # Changes block data to restore data or previous apply + array set blk_obj_attr $block::($block_obj,rest_value) + block::setvalue $block_obj blk_obj_attr + unset blk_obj_attr + + # Changes data back to restore data or previous apply + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + array set blk_elem_obj_attr $block_element::($blk_elem_obj,rest_value) + block_element::setvalue $blk_elem_obj blk_elem_obj_attr + unset blk_elem_obj_attr + } + + # Binds the Leave + $bot_canvas bind blk_movable \ + "UI_PB_evt_BlockFocusOff $seq_page_obj $seq_obj" + +# grab release $Page::($page_obj,canvas_frame) + destroy $Page::($page_obj,canvas_frame) +} + +#=============================================================================== +proc UI_PB_blk_NewBlkActionButtons { NEW_BLK_PAGE SEQ_PAGE_OBJ SEQ_OBJ \ + EVT_OBJ ELEM_OBJ } { +#=============================================================================== + upvar $NEW_BLK_PAGE new_blk_page + upvar $SEQ_PAGE_OBJ seq_page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + upvar $ELEM_OBJ elem_obj + global paOption + + set act_frm $Page::($new_blk_page,box) + + set box1_frm [frame $act_frm.box1] + set box2_frm [frame $act_frm.box2] + + tixForm $box1_frm -top 0 -left 1 -right %50 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 1 -right %100 + + set box1 [tixButtonBox $box1_frm.bb -orientation horizontal \ + -bd 2 -relief sunken -bg $paOption(butt_bg)] + + set box2 [tixButtonBox $box2_frm.bb -orientation horizontal \ + -bd 2 -relief sunken -bg $paOption(butt_bg)] + + $box1 add def -text Default -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_DefaultCallBack $new_blk_page" + $box1 add apl -text Restore -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_RestoreCallBack $new_blk_page" + + $box2 add canc -text Cancel -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_blk_NewBlkCancel_CB $new_blk_page $seq_page_obj\ + $seq_obj $evt_obj $elem_obj" + $box2 add ok -text Ok -width 10 -bg $paOption(app_butt_bg)\ + -command "UI_PB_blk_NewBlkOk_CB $new_blk_page $seq_page_obj\ + $seq_obj $evt_obj $elem_obj" + pack $box1 -fill x + pack $box2 -fill x +} + +#============================================================================== +proc UI_PB_blk_NewBlkOk_CB { page_obj seq_page_obj seq_obj \ + evt_obj elem_obj} { +#============================================================================== + global tixOption + + # Applys the block data + UI_PB_blk_BlkApplyCallBack $page_obj + set block_obj $Page::($page_obj,active_blk_obj) + block::readvalue $block_obj blk_obj_attr + block::DefaultValue $block_obj blk_obj_attr + unset blk_obj_attr + + # Replaces the underscores in the string with space + set elem_text $block::($block_obj,block_name) + set bot_canvas $Page::($seq_page_obj,bot_canvas) + set t_shift $Page::($seq_page_obj,glob_text_shift) + set elem_xc $event_element::($elem_obj,xc) + set elem_yc $event_element::($elem_obj,yc) + + PB_com_GetModEvtBlkName elem_text + # Deletes the rectangle + $bot_canvas delete $event_element::($elem_obj,text_id) + set index [lsearch $sequence::($seq_obj,texticon_ids) \ + $event_element::($elem_obj,text_id)] + set elem_icon_id [lindex $sequence::($seq_obj,texticon_ids) \ + [expr $index + 1]] + set sequence::($seq_obj,texticon_ids) \ + [lreplace $sequence::($seq_obj,texticon_ids) $index \ + [expr $index + 1]] + + set elem_text_id [$bot_canvas create text [expr $elem_xc + $t_shift] \ + $elem_yc -text $elem_text -font $tixOption(bold_font) \ + -tag blk_movable] + set event_element::($elem_obj,text_id) $elem_text_id + lappend sequence::($seq_obj,texticon_ids) $elem_text_id $elem_icon_id + +# grab release $Page::($page_obj,canvas_frame) + destroy $Page::($page_obj,canvas_frame) + + set blk_img_id $event_element::($elem_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $blk_img_id -image] end] + $img config -relief raised -bg lightSkyBlue + +} + +#============================================================================== +proc UI_PB_blk_NewBlkCancel_CB { page_obj seq_page_obj seq_obj \ + evt_obj elem_obj } { +#============================================================================== + + set sequence::($seq_obj,drag_evt_obj) $evt_obj + set sequence::($seq_obj,drag_blk_obj) $elem_obj + + UI_PB_evt_PutBlkInTrash seq_page_obj seq_obj + + # Deletes the block object + set block_obj $event_element::($elem_obj,block_obj) + PB_int_RemoveBlkObjFrmList block_obj + + unset sequence::($seq_obj,drag_blk_obj) + unset sequence::($seq_obj,drag_evt_obj) + +# grab release $Page::($page_obj,canvas_frame) + destroy $Page::($page_obj,canvas_frame) +} + +#============================================================================== +proc UI_PB_blk_ModalityDialog { SEQ_PAGE_OBJ SEQ_OBJ ELEM_OBJ CANVAS_FRAME } { +#============================================================================== + upvar $SEQ_PAGE_OBJ seq_page_obj + upvar $SEQ_OBJ seq_obj + upvar $ELEM_OBJ elem_obj + upvar $CANVAS_FRAME canvas_frame + global blk_modality + global paOption + global tixOption + + set block_obj $event_element::($elem_obj,block_obj) + block::readvalue $block_obj blk_obj_attr + + set win [toplevel $canvas_frame.mod] + UI_PB_com_CreateTransientWindow $win "Force Output Once" "" "" "" + +# wm title $win " Force Output" + +# # Grabs the window +# grab set $win + + + set top_frm [frame $win.top -relief ridge -bd 2] + pack $top_frm -side top -fill both + set bot_frm [frame $win.bot] + pack $bot_frm -side bottom -fill x + + set box1 [tixButtonBox $bot_frm.bb -orientation horizontal \ + -bd 2 -relief sunken -bg $paOption(butt_bg)] + pack $box1 -fill x + + $box1 add can -text Cancel -width 10 -bg $paOption(app_butt_bg)\ + -command "UI_PB_blk_ModalityCancel_CB $win $seq_page_obj $seq_obj \ + $elem_obj" + $box1 add ok -text Ok -width 10 -bg $paOption(app_butt_bg)\ + -command "UI_PB_blk_ModalityOk_CB $win $seq_page_obj $seq_obj \ + $elem_obj blk_modality" + set count 0 + foreach blk_elem_obj $blk_obj_attr(2) \ + { + block_element::readvalue $blk_elem_obj blk_elem_obj_attr + set blk_modality($count) $block_element::($blk_elem_obj,force) + + set add_obj $blk_elem_obj_attr(0) + address::readvalue $add_obj add_obj_attr + + PB_com_MapMOMVariable add_obj blk_elem_obj_attr(1) app_text + PB_int_ApplyFormatAppText add_obj app_text + + set inp_frm [frame $top_frm.$count -relief solid -bd 2] + pack $inp_frm -side top -padx 5 -pady 5 -fill both + append label $add_obj_attr(8) $app_text + + checkbutton $inp_frm.chk -text $label -variable blk_modality($count) \ + -font $tixOption(bold_font) -relief flat -bd 2 -anchor w + pack $inp_frm.chk -side left -padx 15 + unset label blk_elem_obj_attr add_obj_attr + incr count + } +} + +#=============================================================================== +proc UI_PB_blk_ModalityCancel_CB { win seq_page_obj seq_obj elem_obj} { +#=============================================================================== +# grab release $win + destroy $win + + set bot_canvas $Page::($seq_page_obj,bot_canvas) + set evt_img_id $event_element::($elem_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $evt_img_id -image] end] + $img config -relief raised -bg lightSkyBlue + + # Binds the Leave + $bot_canvas bind blk_movable \ + "UI_PB_evt_BlockFocusOff $seq_page_obj $seq_obj" +} + +#=============================================================================== +proc UI_PB_blk_ModalityOk_CB { win seq_page_obj seq_obj elem_obj \ + BLK_MODALITY } { +#=============================================================================== + upvar $BLK_MODALITY blk_modality + + set block_obj $event_element::($elem_obj,block_obj) + block::readvalue $block_obj blk_obj_attr + + set count 0 + foreach blk_elem_obj $blk_obj_attr(2) \ + { + set block_element::($blk_elem_obj,force) $blk_modality($count) + incr count + } + +# grab release $win + destroy $win + + set bot_canvas $Page::($seq_page_obj,bot_canvas) + set evt_img_id $event_element::($elem_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $evt_img_id -image] end] + $img config -relief raised -bg lightSkyBlue + + # Binds the Leave + $bot_canvas bind blk_movable \ + "UI_PB_evt_BlockFocusOff $seq_page_obj $seq_obj" +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_class.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_class.tcl new file mode 100644 index 0000000..b509ce5 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_class.tcl @@ -0,0 +1,181 @@ +#============================================================================== +# UI_PB_CLASS.TCL +#============================================================================== +############################################################################## +# Description # +# This file contains the ui classes. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 02-Jun-1999 mnb Code Integration # +# 29-Jun-1999 mnb Added grab attributes # +# 07-Sep-1999 mnb Added few new page methods # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +class Book { + proc Book {this BOOK_ID} { + upvar $BOOK_ID book_id + set Book::($this,book_id) $book_id + } + + proc ~Book {this} {} + + proc CreatePage {this page_name plabel pg_image \ + first_cb second_cb} \ + { + global paOption + set book_id $Book::($this,book_id) + set new_page [new Page $page_name $plabel] + set img_id [image create compound -window [$book_id subwidget nbframe] -pady 0 \ + -background $paOption(focus) -showbackground 0] + if { [string compare $pg_image ""] != 0} \ + { + set pg_img_id [tix getimage $pg_image] + $img_id add image -image $pg_img_id + $img_id add space -width 5 + } + + $img_id add text -text $plabel + $book_id add $page_name -createcmd "$first_cb $book_id $new_page" \ + -wraplength 200 -image $img_id -raisecmd "$second_cb $book_id \ + $img_id $this" + lappend Book::($this,page_obj_list) $new_page + } + + proc CreateTopLvlPage {this page_name} { + set new_page [new Page $page_name "npage"] + set Book::($this,top_lvl_evt_page) $new_page + + set book_id $Book::($this,book_id) + set page_id [frame $book_id.frm -width 900 -height 700] + set Page::($new_page,page_id) $page_id + } + + proc RetPageObj {this page_name} { + set page_obj_list $Book::($this,page_obj_list) + + foreach object $page_obj_list\ + { + set pname $Page::($object,page_name) + if {[string compare $pname $page_name] == 0}\ + { + return $object + } + } + } +} + +class Page { + proc Page {this pname plabel} { + set Page::($this,page_name) $pname + set Page::($this,page_label) $plabel + } + + proc ~Page {this} {} + + proc CreateFrame {inp_frm frm_ext} { + set frame_id [UI_PB_mthd_CreateFrame $inp_frm $frm_ext] + return $frame_id + } + + proc CreateLabel {inp_frm ext label} { + UI_PB_mthd_CreateLabel $inp_frm $ext $label + } + + proc CreateLblFrame {inp_frm ext label} { + UI_PB_mthd_CreateLblFrame $inp_frm $ext $label + } + + proc CreateIntControl {var inp_frm ext label} { + + UI_PB_mthd_CreateIntControl $var $inp_frm $ext $label + } + + proc CreateFloatControl {val1 val2 inp_frm ext label} { + + UI_PB_mthd_CreateFloatControl $val1 $val2 $inp_frm $ext $label + } + + proc CreateLblEntry {data_type var inp_frm ext label} { + + UI_PB_mthd_CreateLblEntry $data_type $var $inp_frm $ext $label + + } + + proc CreateCheckButton {var inp_frm ext label} { + + UI_PB_mthd_CreateCheckButton $var $inp_frm $ext $label + } + + proc CreateButton { inp_frm ext label} { + + UI_PB_mthd_CreateButton $inp_frm $ext $label + + } + + proc CreateRadioButton { var inp_frm ext label} { + + UI_PB_mthd_CreateRadioButton $var $inp_frm $ext $label + + } + + proc CreateEntry { var inp_frm ext } { + + UI_PB_mthd_CreateEntry $var $inp_frm $ext + + } + + proc CreateOptionalMenu { var inp_frm ext optional_list label} { + + UI_PB_mthd_CreateOptionalMenu $var $inp_frm $ext $optional_list \ + $label + } + + + proc CreatePane {this} { + + UI_PB_mthd_CreatePane $this + } + + proc CreateCheckList {this} { + + UI_PB_mthd_CreateCheckList $this + + } + + proc CreateTree {this} { + + UI_PB_mthd_CreateTree $this + + } + proc CreateCanvas {this TOP_CANVAS_DIM BOT_CANVAS_DIM} { + upvar $TOP_CANVAS_DIM top_canvas_dim + upvar $BOT_CANVAS_DIM bot_canvas_dim + + UI_PB_mthd_CreateCanvas $this top_canvas_dim bot_canvas_dim + } + + proc CreateAddTrashinCanvas {this} \ + { + + UI_PB_mthd_CreateAddTrashinCanvas $this + } + + proc CreateMenu { this } \ + { + UI_PB_mthd_CreateMenu $this + } + + proc AddComponents {this} { + + set page_name $Page::($this,page_name) + + UI_PB_evt_$page_name this + } +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_common.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_common.tcl new file mode 100644 index 0000000..06645d5 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_common.tcl @@ -0,0 +1,1282 @@ +#============================================================================== +# UI_PB_COMMON.TCL +#============================================================================== +############################################################################### +# Description # +# This file contains all the common functions. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-Apr-1999 mnb Removed puts # +# 02-Jun-1999 mnb Code Integration # +# 04-Jun-1999 mnb Added pb_ to image names # +# 28-Jun-1999 mnb Text can be placed at any position in a block # +# 30-Jun-1999 mnb Added a procedure to create text window # +# 07-Sep-1999 mnb Added Validity functions for the entry widget. # +# 21-Sep-1999 mnb Changed the Text Dialog proc to handle event # +# 21-Oct-1999 gsl Added CreateTransientWindow, ClaimActiveWindow, # +# DismissActiveWindow & GrabWindow. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################### + +#============================================================================== +proc UI_PB_com_CreateTransientWindow { w title geom \ + win_close_cb pre_destroy_cb \ + args } { +#============================================================================== + global gPB + + + #----------------------------------------------- + # Cleanup arguments by removing unwanted blanks + #----------------------------------------------- + set geom [string trim $geom " "] + set win_close_cb [string trim $win_close_cb " "] + set pre_destroy_cb [string trim $pre_destroy_cb " "] + + #------------------------------------- + # Validate existence of parent window + #------------------------------------- + set pw [winfo parent $w] + if { $pw == "" } { +return [tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "Transient window requires parent window defined."] + } else { + wm transient $w $pw + } + + #------------------------------- + # Hide window before completion + #------------------------------- + wm withdraw $w + + #----------- + # Set title + #----------- + wm title $w $title + + #------------------------------------------------- + # Callback to be executed when window is d. + #------------------------------------------------- + if { $win_close_cb != "" } { + wm protocol $w WM_DELETE_WINDOW "$win_close_cb" + } + + #---------------------------------------------------- + # Callback to be executed when window is ed. + #---------------------------------------------------- + if { $pre_destroy_cb != "" } { + bind $w "$pre_destroy_cb" + } + bind $w "+UI_PB_com_DismissActiveWindow $w" + bind $w "+UI_PB_com_DeleteFromTopLevelList $w" + + #-------------------------------------------------------------------- + # Memorize current grab to be restored when this window is dismissed. + #-------------------------------------------------------------------- + set gPB(prev_window_grab) [grab current] + + #--------------------- + # Set window geometry + #--------------------- + if { $geom != "" } { + # + # Specified... + # + wm geometry $w $geom + + } else { + # + # Not specified, shift it from current active window. + # + set aw [UI_PB_com_AskActiveWindow] + set xc [expr [winfo rootx $aw] + 20] + set yc [expr [winfo rooty $aw] - 60] + + wm geometry $w +$xc+$yc + } + + #---------------- + # Display window + #---------------- + wm deiconify $w + focus $w + + #--------------------- + # Track active window + #--------------------- + UI_PB_com_ClaimActiveWindow $w + + #------------------------------------ + # Parse additional arguments, if any. + #------------------------------------ + if {[llength $args] == 0} { + + UI_PB_com_DisableMainWindow + + } else { + + if { [lindex $args 0] != 0 } { + UI_PB_com_DisableMainWindow + } + } + +## if {[llength $args] > 0} { +## +## if { [lindex $args 0] != 0 } { +## UI_PB_com_DisableMainWindow +## } +## } + + #------------------------------------ + # Add to toplevel To-Be-Deleted list + #------------------------------------ + UI_PB_com_AddToTopLevelList $w + +## "wm withdraw" callback causes File Selection dialog +## to withdraw upon realization. +## bind $w "+wm withdraw $w" +} + +#============================================================================== +proc UI_PB_com_AddToTopLevelList { w args } { +#============================================================================== + global gPB + + if { $w != "$gPB(top_window).new" && \ + $w != "$gPB(top_window).open" && \ + [lsearch $gPB(toplevel_list) $w] < 0 } { + + set gPB(toplevel_list) [linsert $gPB(toplevel_list) end $w] + } +} + +#============================================================================== +proc UI_PB_com_DeleteFromTopLevelList { w args } { +#============================================================================== + global gPB + + set wi [lsearch $gPB(toplevel_list) $w] + + if { $wi >= 0 } { + + set gPB(toplevel_list) [lreplace $gPB(toplevel_list) $wi $wi] + } +} + +#============================================================================== +proc UI_PB_com_DeleteTopLevelWindows { args } { +#============================================================================== + global gPB + + set w [lindex $gPB(toplevel_list) end] + + while { $w != "" } { + + wm withdraw $w + tixDestroy $w + + set w [lindex $gPB(toplevel_list) end] + } + + set gPB(toplevel_list) {} + set gPB(main_window) "" + unset gPB(book) +} + +#============================================================================== +proc UI_PB_com_ClaimActiveWindow { win args } { +#============================================================================== + global gPB + + set wi [lsearch -exact $gPB(active_window_list) $win] + + if { $wi < 0 } { + # + # Window not in the active list.. Add it to the list. + # + set gPB(active_window_list) [linsert $gPB(active_window_list) end $win] + + } elseif { $wi == [expr [llength $gPB(active_window_list)] - 1] } { + # + # Window already active... Do nothing. + # + + } else { + # + # Window in the list but not active... Move it to the end of list. + # + set gPB(active_window_list) [lreplace $gPB(active_window_list) $wi $wi] + set gPB(active_window_list) [linsert $gPB(active_window_list) end $win] + } + + set gPB(active_window) $win +} + +#============================================================================== +proc UI_PB_com_AskActiveWindow { args } { +#============================================================================== + global gPB + + if { $gPB(active_window) == 0 || $gPB(active_window) == "" } { +return $gPB(top_window) + } else { +return $gPB(active_window) + } +} + +#============================================================================== +proc UI_PB_com_DisableMainWindow { args } { +#============================================================================== + global gPB + global paOption tixOption + global machTree machData + + #************************************** + # Main window is not yet created. Bail! + #************************************** + if { ![info exists gPB(book)] } { +return + } + + #*************************** + # Not yet disabled... Do it. + #*************************** + if { $gPB(main_window_disabled) == 0 && \ + $gPB(active_window) != $gPB(main_window) && \ + $gPB(active_window) != $gPB(top_window) } \ + { + set gPB(main_window_disabled) 1 + + set pb_book_id $Book::($gPB(book),book_id) + + #******************************************************************* + # Save away the Button-1 callback and attach a message dialog to it. + #******************************************************************* + set gPB(pb_book_b1_cb) [bind [$pb_book_id subwidget nbframe] <1>] + + bind [$pb_book_id subwidget nbframe] <1> \ + "tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message \"You have to close all sub-windows to enable this tab.\"" + + $pb_book_id pageconfig mac -state disabled + $pb_book_id pageconfig pro -state disabled + $pb_book_id pageconfig def -state disabled + $pb_book_id pageconfig lis -state disabled + $pb_book_id pageconfig pre -state disabled + $pb_book_id pageconfig adv -state disabled + + set pb_book_page_list $Book::($gPB(book),page_obj_list) + + set current_book_tab $Book::($gPB(book),current_tab) + + #********** + # Chapters + #********** + set chap [lindex $pb_book_page_list $current_book_tab] + + #*************************************** + # Disable sub-tabs, if the chapter is... + # = 1 : Program & Tool Path + # = 2 : N/C Data Definitions + # = 4 : Files Preview + #*************************************** + if { $current_book_tab == 1 || \ + $current_book_tab == 2 || \ + $current_book_tab == 4 } { + + #********** + # Sections + #********** + set sect $Page::($chap,book_obj) + set sect_id $Book::($sect,book_id) + + #*********************** + # Get tabbed pages info + #*********************** + set page_tab $Book::($sect,current_tab) + set page_obj [lindex $Book::($sect,page_obj_list) $page_tab] + + } + + #*************************** + # Retrieve some font styles + #*************************** + set sty_n $gPB(font_style_normal) + set sty_b $gPB(font_style_bold) + set sty_ng $gPB(font_style_normal_gray) + set sty_bg $gPB(font_style_bold_gray) + + + switch $current_book_tab \ + { + 0 { ;# Machine Tool + + UI_PB_mach_DisableWindow + } + + 1 { ;# Program & Tool Path + + UI_PB_prog_DisableWindow chap + } + + 2 { ;# N/C Data Definitions + + UI_PB_def_DisableWindow chap + } + + 3 { ;# Listing File + } + + 4 { ;# Files Preview + + # Save away the Button-1 callback and attach a message dialog to it. + # + set gPB($sect_id,b1_cb) [bind [$sect_id subwidget nbframe] <1>] + + bind [$sect_id subwidget nbframe] <1> \ + "tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error\ + -message \"You have to close all sub-windows to enable this tab.\"" + + $sect_id pageconfig eve -state disabled + $sect_id pageconfig def -state disabled + + set t $Page::($page_obj,tree) + set h [$t subwidget hlist] + + # Disable tree items on tabbed pages + switch $page_tab \ + { + 0 { ;# Events + + # Disable everything first, then enable the selected item. + } + 1 { ;# Definitions + + # Disable everything first, then enable the selected item. + } + } + } + + 5 { ;# Post Advisor + } + } + } +} + +#============================================================================== +proc UI_PB_com_EnableMainWindow { args } { +#============================================================================== + global gPB + + # More than main window still open... Leave it disabled. + # + if { [llength $gPB(toplevel_list)] > 1 } { +return + } + + if { $gPB(main_window_disabled) } \ + { + set pb_book_id $Book::($gPB(book),book_id) + + # Restore Button-1 callback for the book + bind [$pb_book_id subwidget nbframe] <1> $gPB(pb_book_b1_cb) + + $pb_book_id pageconfig mac -state normal + $pb_book_id pageconfig pro -state normal + $pb_book_id pageconfig def -state normal + $pb_book_id pageconfig lis -state normal + $pb_book_id pageconfig pre -state normal + $pb_book_id pageconfig adv -state normal + + set pb_book_page_list $Book::($gPB(book),page_obj_list) + + set current_book_tab $Book::($gPB(book),current_tab) + + set gPB(main_window_disabled) 0 + + # Enable chapter's tabs, if any... + # + if { $current_book_tab == 1 || \ + $current_book_tab == 2 || \ + $current_book_tab == 4 } { + + set chap [lindex $pb_book_page_list $current_book_tab] + set sect $Page::($chap,book_obj) + set sect_id $Book::($sect,book_id) + + # Restore Button-1 callback for the chapter + bind [$sect_id subwidget nbframe] <1> $gPB($sect_id,b1_cb) + + } + + #*************************** + # Retrieve some font styles + #*************************** + set sty_n $gPB(font_style_normal) + set sty_b $gPB(font_style_bold) + set sty_ng $gPB(font_style_normal_gray) + set sty_bg $gPB(font_style_bold_gray) + + + switch $current_book_tab \ + { + 0 { ;# Machine Tool + + UI_PB_mach_EnableWindow + } + + 1 { ;# Program & Tool Path + + UI_PB_prog_EnableWindow chap + } + + 2 { ;# N/C Data Definitions + + UI_PB_def_EnableWindow chap + +#### $sect_id pageconfig blk -state normal +#### $sect_id pageconfig adr -state normal +#### $sect_id pageconfig fmt -state normal +#### $sect_id pageconfig ele -state normal + } + + 3 { ;# Listing File + } + + 4 { ;# Code Preview + + $sect_id pageconfig eve -state normal + $sect_id pageconfig def -state normal + } + + 5 { ;# Post Advisor + } + } + } +} + +#============================================================================== +proc UI_PB_com_DismissActiveWindow { win args } { +#============================================================================== + global gPB + + #------------------------ + # Leave top window alone + #------------------------ + if { $win != $gPB(top_window) } { + + set wi [lsearch $gPB(active_window_list) $win] + + # Unclaim active window status + if { $wi > -1 } { + set gPB(active_window_list) [lreplace $gPB(active_window_list) $wi $wi] + set gPB(active_window) [lindex $gPB(active_window_list) end] + } + + # Release window grab + set cwg [grab current] + + if { $cwg != $win } { + grab release $cwg + + # Restore previous window grab + if { $gPB(prev_window_grab) != "" && \ + [winfo exists $gPB(prev_window_grab)] } { + grab $gPB(prev_window_grab) + } + } + } + + # Enable main window when needed. + UI_PB_com_EnableMainWindow + + # Set focus onto avtive window + focus [UI_PB_com_AskActiveWindow] +} + +#============================================================================== +proc UI_PB_com_RetImageAppdText { ADDR_OBJ ELEM_MOM_VAR IMG_NAME \ + WORD_APP_TEXT} { +#============================================================================== + upvar $ADDR_OBJ addr_obj + upvar $ELEM_MOM_VAR elem_mom_var + upvar $IMG_NAME image_name + upvar $WORD_APP_TEXT word_app_text + + set WORD_LEADER $address::($addr_obj,add_leader) + set WORD_LEADER [string trim $WORD_LEADER] + PB_com_MapMOMVariable addr_obj elem_mom_var word_app_text + PB_int_ApplyFormatAppText addr_obj word_app_text + + set leader_len [string length $WORD_LEADER] + if { $leader_len > 1} \ + { + set no_chars 5 + set image_name "blank" + append temp_app_text $WORD_LEADER $word_app_text + UI_PB_com_TrimOrFillAppText temp_app_text no_chars + set word_app_text $temp_app_text + unset temp_app_text + } elseif { $leader_len == 0} \ + { + set no_chars 5 + set image_name "blank" + UI_PB_com_TrimOrFillAppText word_app_text no_chars + } else \ + { + set no_chars 3 + set image_name $WORD_LEADER + UI_PB_com_TrimOrFillAppText word_app_text no_chars + } + + append temp_image_name "pb_" $image_name "_addr" + set image_name $temp_image_name + unset temp_image_name +} + +#========================================================================== +proc UI_PB_blk_CreateIcon { canvas bitmap label } { +#========================================================================== + global tixOption + set fixed_font -*-courier-medium-r-*-*-12-*-*-*-*-*-*-* + + set comp [image create compound -window $canvas \ + -bd 1 \ + -background #c0c0ff \ + -borderwidth 2 \ + -relief raised \ + -showbackground 1] + + set image_addr [tix getimage $bitmap] + $comp add image -image $image_addr + # Using fixed font to keep all buttons in same size + $comp add text -text $label -font $fixed_font -anchor w + + return $comp +} + +#========================================================================== +proc UI_PB_com_TrimOrFillAppText { APP_TEXT NO_CHARS } { +#========================================================================== + upvar $APP_TEXT app_text + upvar $NO_CHARS no_chars + + set app_text_len [string length $app_text] + + if {$app_text_len < $no_chars}\ + { + append temp_var $app_text + for {set x $app_text_len} {$x < $no_chars} {incr x}\ + { + append temp_var " " + } + set app_text $temp_var + unset temp_var + } elseif {$app_text_len > $no_chars}\ + { + set app_text [string range $app_text 0 [expr $no_chars - 1]] + } +} + +#============================================================================== +proc UI_PB_com_ChangeCursor { canvas_id } { +#============================================================================== + global tcl_platform + + if {$tcl_platform(platform) == "unix"} \ + { + # Change cursor + global env + set cur "$env(PB_HOME)/images/pb_hand.xbm" + set msk "$env(PB_HOME)/images/pb_hand.mask" + $canvas_id config -cursor "@$cur $msk black white" + } +} + +#============================================================================== +proc UI_PB_com_FormatString { string } { +#============================================================================== + + set actual_width [font measure {Helvetica 10} $string] + + set blank_width [font measure {Helvetica 10} " "] + + set font_width 100 + if {$font_width > $actual_width} \ + { + set diff_width [expr $font_width - $actual_width] + set no_of_blanks [expr $diff_width / $blank_width] + for {set count 0} {$count < $no_of_blanks} {incr count} \ + { + append string " " + } + } + return $string +} + +#============================================================================= +proc UI_PB_com_ReturnBlockName { EVENT_OBJ BLOCK_NAME } { +#============================================================================= + upvar $EVENT_OBJ event_obj + upvar $BLOCK_NAME block_name + + set event_name $event::($event_obj,event_name) + set temp_event_name [split $event_name] + set event_name [join $temp_event_name _ ] + set event_name [string tolower $event_name] + + # Validates the block name + set obj_attr(0) $event_name + PB_int_GetAllBlockNames blk_name_list + PB_com_SetDefaultName blk_name_list obj_attr + set block_name $obj_attr(0) +} + +#============================================================================== +proc UI_PB_com_CreateBlkNcCode { BLK_ELEM_OBJ_LIST BLK_NC_CODE} { +#============================================================================== + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + upvar $BLK_NC_CODE blk_nc_code + + foreach blk_elem $blk_elem_obj_list\ + { + set add_obj $block_element::($blk_elem,elem_add_obj) + set add_leader $address::($add_obj,add_leader) + set blk_elem_mom_var $block_element::($blk_elem,elem_mom_variable) + PB_com_MapMOMVariable add_obj blk_elem_mom_var app_text + PB_int_ApplyFormatAppText add_obj app_text + set app_image_name ${add_leader}${app_text} + lappend blk_nc_code $app_image_name + unset app_image_name + } +} + +#============================================================================== +proc UI_PB_com_RetActiveBlkElems { BLK_ELEM_OBJ_LIST } { +#============================================================================== + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + + foreach blk_elem_obj $blk_elem_obj_list \ + { + set add_obj $block_element::($blk_elem_obj,elem_add_obj) + if { $address::($add_obj,word_status) == 0} \ + { + lappend temp_blk_elem_list $blk_elem_obj + } + } + + if {[info exists temp_blk_elem_list]}\ + { + set blk_elem_obj_list $temp_blk_elem_list + unset temp_blk_elem_list + } else \ + { + set blk_elem_obj_list "" + } +} + +#============================================================================== +proc UI_PB_com_RetTextPosAttr {BLK_ELEM_OBJ_LIST TEXT_LDTR_ARR} { +#============================================================================== + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + upvar $TEXT_LDTR_ARR text_ldtr_arr + + set index 0 + foreach blk_elem_obj $blk_elem_obj_list \ + { + set add_obj $block_element::($blk_elem_obj,elem_add_obj) + if {[string compare $address::($add_obj,add_name) "Text"] == 0} \ + { + if { $index == 0} \ + { + set text_ldtr_arr($blk_elem_obj,leading) "" + } else \ + { + set text_ldtr_arr($blk_elem_obj,leading) \ + [lindex $blk_elem_obj_list [expr $index - 1]] + } + + if { [llength $blk_elem_obj_list] == [expr $index + 1] } \ + { + set text_ldtr_arr($blk_elem_obj,trailing) "" + } else \ + { + set text_ldtr_arr($blk_elem_obj,trailing) \ + [lindex $blk_elem_obj_list [expr $index + 1]] + } + + } + incr index + } +} + +#============================================================================== +proc UI_PB_com_SeperateTextElements {BLK_ELEM_OBJ_LIST TEXT_ELEM_LIST} { +#============================================================================== + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + upvar $TEXT_ELEM_LIST text_elem_list + + set no_elems [llength $blk_elem_obj_list] + + for {set count 0} {$count < $no_elems} {incr count} \ + { + set blk_elem_obj [lindex $blk_elem_obj_list $count] + set add_obj $block_element::($blk_elem_obj,elem_add_obj) + if {[string compare $address::($add_obj,add_name) "Text"] != 0} \ + { + lappend temp_blk_elem_list $blk_elem_obj + } else \ + { + lappend text_elem_list $blk_elem_obj + } + } + + if {[info exists temp_blk_elem_list]} \ + { + set blk_elem_obj_list $temp_blk_elem_list + } else \ + { + set blk_elem_obj_list "" + } +} + +#============================================================================== +proc UI_PB_com_AddTextElements { BLK_ELEM_OBJ_LIST TEXT_ELEM_LIST \ + TEXT_LDTR_ARR } { +#============================================================================== + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + upvar $TEXT_ELEM_LIST text_elem_list + upvar $TEXT_LDTR_ARR text_ldtr_arr + + if {[info exists text_ldtr_arr]} \ + { + foreach text_obj $text_elem_list \ + { + set leading_obj $text_ldtr_arr($text_obj,leading) + set trailing_obj $text_ldtr_arr($text_obj,trailing) + if {$leading_obj != ""} \ + { + set lead_res [lsearch $blk_elem_obj_list $leading_obj] + if {$lead_res != -1} \ + { + set blk_elem_obj_list [linsert $blk_elem_obj_list \ + [expr $lead_res + 1] $text_obj] + } + } else \ + { + if {$trailing_obj != ""} \ + { + set trail_res [lsearch $blk_elem_obj_list $trailing_obj] + if {$trail_res != -1} \ + { + set blk_elem_obj_list [linsert $blk_elem_obj_list \ + $trail_res $text_obj] + } else \ + { + set blk_elem_obj_list [linsert $blk_elem_obj_list 0 $text_obj] + } + } else \ + { + set blk_elem_obj_list [linsert $blk_elem_obj_list 0 $text_obj] + } + } + } + } +} + +#============================================================================== +proc UI_PB_com_SortBlockElements {BLK_ELEM_OBJ_LIST} { +#============================================================================== + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + + # Returns the text address leading and trailing elements + UI_PB_com_RetTextPosAttr blk_elem_obj_list text_ldtr_arr + + # Seperates text elements + UI_PB_com_SeperateTextElements blk_elem_obj_list text_elem_list + + set no_elements [llength $blk_elem_obj_list] + for {set ii 0} {$ii < [expr $no_elements - 1]} {incr ii} \ + { + for {set jj [expr $ii + 1]} {$jj < $no_elements} {incr jj} \ + { + set blk_ii_obj [lindex $blk_elem_obj_list $ii] + set add_ii_obj $block_element::($blk_ii_obj,elem_add_obj) + set add_ii_index $address::($add_ii_obj,seq_no) + + set blk_jj_obj [lindex $blk_elem_obj_list $jj] + set add_jj_obj $block_element::($blk_jj_obj,elem_add_obj) + set add_jj_index $address::($add_jj_obj,seq_no) + if {$add_jj_index < $add_ii_index} \ + { + set blk_elem_obj_list [lreplace $blk_elem_obj_list $ii $ii \ + $blk_jj_obj] + + set blk_elem_obj_list [lreplace $blk_elem_obj_list $jj $jj \ + $blk_ii_obj] + } + } + } + + # Adds the text elements to the block element list + UI_PB_com_AddTextElements blk_elem_obj_list text_elem_list \ + text_ldtr_arr +} + +#============================================================================== +proc UI_PB_com_ApplyMastSeqBlockElem { BLK_ELEM_OBJ_LIST } { +#============================================================================== + upvar $BLK_ELEM_OBJ_LIST blk_elem_obj_list + + UI_PB_com_RetActiveBlkElems blk_elem_obj_list + UI_PB_com_SortBlockElements blk_elem_obj_list +} + +#============================================================================== +proc UI_PB_com_ReturnEventNcOutAttr { EVENT_OBJ EVT_NC_WIDTH \ + EVT_NC_HEIGHT EVT_NC_OUTPUT} { +#============================================================================== + upvar $EVENT_OBJ event_obj + upvar $EVT_NC_WIDTH evt_nc_width + upvar $EVT_NC_HEIGHT evt_nc_height + upvar $EVT_NC_OUTPUT evt_nc_output + + set evt_nc_width 0 + set evt_nc_height 0 + + foreach row_elem_obj $event::($event_obj,evt_elem_list) \ + { + foreach elem_obj $row_elem_obj \ + { + set block_obj $event_element::($elem_obj,block_obj) + foreach blk_elem $block::($block_obj,elem_addr_list) \ + { + lappend row_blk_elem_list $blk_elem + } + } + + if {[info exists row_blk_elem_list]} \ + { + UI_PB_com_ApplyMastSeqBlockElem row_blk_elem_list + if {[info exist row_blk_nc_output]} \ + { + unset row_blk_nc_output + } + UI_PB_com_CreateBlkNcCode row_blk_elem_list row_blk_nc_output + + if {[info exists row_blk_elem_list]} \ + { + unset row_blk_elem_list + } + + if {[info exists row_blk_nc_output]} \ + { + set blk_nc_width [font measure {Helvetica 10} \ + $row_blk_nc_output] + set evt_nc_height [expr $evt_nc_height + \ + [font metrics {Helvetica 10} -linespace]] + if {$blk_nc_width > $evt_nc_width} \ + { + set evt_nc_width $blk_nc_width + } + append temp_evt_nc_output $row_blk_nc_output "\n" + unset row_blk_nc_output + } + } + } + + if {[info exists temp_evt_nc_output]} \ + { + set evt_nc_output $temp_evt_nc_output + unset temp_evt_nc_output + } +} + +#============================================================================== +proc UI_PB_com_CreateRectangle { canvas x1 y1 x2 y2 \ + fill_color outline_color} { +#=============================================================================== + set cell_box_width 0 + set rect_id [$canvas create rect \ + $x1 $y1 $x2 $y2 -outline $outline_color \ + -width $cell_box_width -fill $fill_color -tag stationary] + return $rect_id +} + +#============================================================================== +proc CB_nb_def {w tab_img book_obj} { +#============================================================================== + # Unhighlight previously selected tab + if {$Book::($book_obj,x_def_tab_img) != 0} \ + { + $Book::($book_obj,x_def_tab_img) config -showbackground 0 + } + + # Highlight currently selected tab + $tab_img config -showbackground 1 + + # Remember this tab + set Book::($book_obj,x_def_tab_img) $tab_img +} + +#=============================================================================== +proc UI_PB_com_CreateRowAttr { column_frm row_no label mom_var data_type } { +#=============================================================================== + global tixOption + global mom_sys_arr + set row_frm [frame $column_frm.$row_no] + set bgc lightSkyBlue + $row_frm config -relief solid -bd 1 -bg $bgc + pack $row_frm -side top -fill x -expand yes + + Page::CreateLblEntry $data_type $mom_var $row_frm int $label + $row_frm.int config -bg $bgc -font $tixOption(bold_font) +} + +#=============================================================================== +proc UI_PB_com_CheckElemBlkTemplate { BLOCK_OBJ NEW_BLK_ELEM_ADDR } { +#=============================================================================== + upvar $BLOCK_OBJ block_obj + upvar $NEW_BLK_ELEM_ADDR new_blk_elem_addr + + set blk_elem_flag 0 + + if {[string compare $new_blk_elem_addr "Text"] == 0} \ + { + return $blk_elem_flag + } + + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + # Returns the addresses + PB_int_GetBlockElementAddr new_blk_elem_addr base_addr_list + + foreach blk_elem_obj $block::($block_obj,active_blk_elem_list) \ + { + set blk_elem_addr_obj $block_element::($blk_elem_obj,elem_add_obj) + set blk_elem_addr $address::($blk_elem_addr_obj,add_name) + foreach address_name $base_addr_list \ + { + if {[string compare $address_name $blk_elem_addr] == 0}\ + { + set blk_elem_flag 1 + return $blk_elem_flag + } + } + } + } + return $blk_elem_flag +} + +#========================================================================= +proc UI_PB_com_DisplyErrorMssg { ELEM_ADDR_NAME } { +#========================================================================= + upvar $ELEM_ADDR_NAME elem_addr_name + + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "An element of the selected Address exists \ + in the Block Template" +} + +#========================================================================= +proc UI_PB_com_CreateTextEntry { PAGE_OBJ NEW_ELEM_OBJ label_name} { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $NEW_ELEM_OBJ new_elem_obj + global paOption + global elem_text_var + global text_dial_respose + set text_dial_respose 0 + + set bot_canvas $Page::($page_obj,bot_canvas) + set elem_text_var $block_element::($new_elem_obj,elem_mom_variable) + + + set win [toplevel $bot_canvas.txtent] +## wm title $win " $label_name Entry " + + UI_PB_com_CreateTransientWindow $win "$label_name Entry" "" "" "" + + # grabs the window +## grab set $win + + + + + set text_frm [frame $win.frame] + + set box [tixButtonBox $win.box \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg yellow] + pack $text_frm -side top -fill both -expand yes + pack $box -side bottom -fill x -padx 3 -pady 3 + + label $text_frm.lab -text $label_name -anchor w + + entry $text_frm.ent -textvariable elem_text_var -width 40 -relief sunken + + pack $text_frm.lab -side left -fill both -padx 10 -pady 10 + pack $text_frm.ent -side right -fill both -padx 10 -pady 10 + + focus $text_frm.ent + $text_frm.ent select range 0 end + + # Adds the action buttons + $box config -bg $paOption(butt_bg) + $box add can -text Cancel -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_com_CancelTextElem $win $page_obj $new_elem_obj" + $box add ok -text Ok -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_com_UpdateTextElem $win $page_obj $new_elem_obj" + + bind $text_frm.ent "UI_PB_com_UpdateTextElem $win $page_obj \ + $new_elem_obj" +} + +#========================================================================= +proc UI_PB_com_CancelTextElem { win page_obj elem_obj } { +#========================================================================= + global text_dial_respose + + if { $text_dial_respose == 0 } \ + { + set block_element::($elem_obj,elem_mom_variable) "000" + set text_dial_respose "cancel" + } + + destroy $win +} + +#========================================================================= +proc UI_PB_com_UpdateTextElem { win page_obj elem_obj } { +#========================================================================= + global elem_text_var + global text_dial_respose + + set block_element::($elem_obj,elem_mom_variable) $elem_text_var + set text_dial_respose "ok" + + destroy $win +} + +#========================================================================= +proc UI_PB_com_RetIntFromVal { value } { +#========================================================================= + set int_val [tixGetInt -nocomplain $value] + + if { $int_val } \ + { + return $int_val + } else \ + { + return 0 + } +} + +#========================================================================= +proc UI_PB_com_RetFloatFromVal { value } { +#========================================================================= + set int_val [tixGetInt -nocomplain $value] + + if { $int_val } \ + { + if { [string first "." $value] } \ + { + return $value + } else \ + { + return $int_val + } + } else \ + { + return 0.0 + } +} + +#========================================================================= +proc UI_PB_com_RetValByDataType { value data_type } { +#========================================================================= + + switch $data_type \ + { + "i" { + set int_val [UI_PB_com_RetIntFromVal $value] + return $int_val + } + + "f" { + set float_val [UI_PB_com_RetFloatFromVal $value] + return $float_val + } + + "s" { + return $value + } + } +} + +#========================================================================= +proc UI_PB_com_RetAddrOfMOMSysVar { MOM_VAR } { +#========================================================================= + upvar $MOM_VAR mom_var + + PB_adr_RetAddressObjList add_obj_list + + set mom_var_add 0 + foreach add_obj $add_obj_list \ + { + address::readvalue $add_obj add_obj_attr + PB_int_RetMOMVarAsscAddress add_obj_attr(0) add_mom_var_list + if { [lsearch $add_mom_var_list $mom_var] != -1 } \ + { + set mom_var_add $add_obj + break + } + } + return $mom_var_add +} + +#========================================================================= +proc UI_PB_com_RetSysVarDataType { MOM_VAR } { +#========================================================================= + upvar $MOM_VAR mom_var + + set add_obj [UI_PB_com_RetAddrOfMOMSysVar mom_var] + + if { $add_obj } \ + { + address::readvalue $add_obj add_obj_attr + format::readvalue $add_obj_attr(1) fmt_obj_attr + + switch $fmt_obj_attr(1) \ + { + "Integer" { + set data_type i + } + + "Real Number" { + set data_type f + } + + "Text String" { + set data_type s + } + } + } else \ + { + set data_type s + } + return $data_type +} + +#========================================================================= +proc UI_PB_com_CheckDuplicatChar { widget key_type } { +#========================================================================= + set entry_val [$widget get] + + switch $key_type \ + { + "plus" { + if { [$widget select present] } \ + { + set sel_f [$widget index sel.first] + set sel_s [$widget index sel.last] + if { $sel_f == 0 || $sel_s == 0} \ + { + return 1 + } + } elseif { [$widget index insert] == 0 && \ + [string first "+" $entry_val] == -1 && + [string first "-" $entry_val] == -1} \ + { + return 1 + } else \ + { + return 0 + } + } + + "minus" { + if { [$widget select present] } \ + { + set sel_f [$widget index sel.first] + set sel_s [$widget index sel.last] + if { $sel_f == 0 || $sel_s == 0} \ + { + return 1 + } + } elseif { [$widget index insert] == 0 && \ + [string first "+" $entry_val] == -1 && + [string first "-" $entry_val] == -1} \ + { + return 1 + } else \ + { + return 0 + } + } + + "period" { + set flag [string first "." $entry_val] + if {$flag != -1} \ + { + return 0 + } else \ + { + return 1 + } + } + + default { + return 1 + } + } +} + +#========================================================================= +# This procedure validates the data of an entry, based upon the data type. +# i - Integer, f - float, and s - string +# If the input key doesn't match the data type, it disables the entry .. +# upon pressing the key and enables it after release the key .. +#========================================================================= +proc UI_PB_com_ValidateDataOfEntry { widget key data_type } { +#========================================================================= + set disable_flag 0 + switch $data_type \ + { + "i" { + if { $key >= 0 && $key <= 9 || $key == "plus" || \ + $key == "minus" || $key == "BackSpace" || \ + $key == "Tab" || $key == "Shift_R"} \ + { + set disable_flag [UI_PB_com_CheckDuplicatChar $widget $key] + } + } + + "f" { + if { $key >= 0 && $key <= 9 || $key == "period" || \ + $key == "plus" || $key == "minus" || \ + $key == "BackSpace" || $key == "Tab" || $key == "Shift_R"} \ + { + set disable_flag [UI_PB_com_CheckDuplicatChar $widget $key] + } + } + + "s" { + set disable_flag 1 + } + + } + + if { !$disable_flag } \ + { + $widget config -state disabled + } +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_context_help.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_context_help.tcl new file mode 100644 index 0000000..59df58e --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_context_help.tcl @@ -0,0 +1,173 @@ +#=============================================================================== +# UI_PB_CONTEXT_HELP.TCL +#=============================================================================== +################################################################################ +# Description # +# This file attempts to perform context sensitive help service. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-Oct-1999 gsl Initial (Cloned from ui_pb_balloon.tcl) # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +################################################################################ + +# You can toggle Context Sensitive Help globally on and off by setting variable +# gPB_context_help to true or false. +################################################################################ +################################################################################ + +set gPB_chelp(font) {helvetica 9} +set gPB_chelp(screen) 1280 +set gPB_chelp(width) 200 +set gPB_chelp(color) #ffff60 +set gPB_chelp(state) 1 + + +#=============================================================================== +proc UI_PB_init_chelp {args} { +#=============================================================================== + global gPB_help_tips gPB_use_balloons + + getopt gPB_help_tips $args + set gPB_use_balloons $gPB_help_tips(state) + + PB_enable_balloon Canvas +} + + +#=============================================================================== +proc PB_set_chelp {} { +#=============================================================================== + PB_enable_balloon Button + PB_enable_balloon Menubutton + PB_enable_balloon Menu "%W index active" + PB_enable_balloon tixNoteBookFrame + PB_enable_balloon Canvas + PB_enable_balloon Listbox "%W index @%x,%y" +} + + +#=============================================================================== +proc PB_enable_chelp {name_to_bind {script {}}} { +#=============================================================================== + global gPB_help_tips + +## if ![llength $script] { +## bind $name_to_bind "+schedule_balloon %W %X %Y" +## bind $name_to_bind "+PB_reset_balloon %W %X %Y" +## } else { +## bind $name_to_bind "+schedule_balloon %W %X %Y \[$script\]" +## bind $name_to_bind "+PB_reset_balloon %W %X %Y \[$script\]" +## } +## +## bind $name_to_bind <1> "+PB_cancel_balloon" +## bind $name_to_bind "+PB_cancel_balloon" +## bind $name_to_bind "+PB_wait_balloon" +## bind $name_to_bind "+PB_cancel_balloon" +## bind $name_to_bind "+PB_wait_balloon" + + + if ![llength $script] { + bind $name_to_bind <1> "+schedule_balloon %W %X %Y" + bind $name_to_bind "+PB_reset_balloon %W %X %Y" + } else { + bind $name_to_bind <1> "+schedule_balloon %W %X %Y \[$script\]" + bind $name_to_bind "+PB_reset_balloon %W %X %Y \[$script\]" + } + + bind $name_to_bind "+PB_wait_balloon" + bind $name_to_bind "+PB_cancel_balloon" + bind $name_to_bind "+PB_wait_balloon" +} + + +#=============================================================================== +proc PB_wait_chelp {} { +#=============================================================================== + if [winfo exists .balloon_help] { + tkwait variable .balloon_help + } +} + +#=============================================================================== +proc PB_reset_chelp {window x y {item {}}} { +#=============================================================================== + PB_cancel_balloon + schedule_balloon $window $x $y $item +} + + +#=============================================================================== +proc PB_cancel_chelp {} { +#=============================================================================== + global balloon_after_ID + global balloon_exists + + if [info exists balloon_after_ID] { + after cancel $balloon_after_ID + unset balloon_after_ID + } + + if [winfo exists .balloon_help] { + destroy .balloon_help + } +} + + +#=============================================================================== +proc schedule_chelp {widget x y} { +#=============================================================================== + global gPB + + if !$gPB(use_info) return + + if [info exists gPB(c_help,title,$widget)] { + create_balloon \"$gPB(c_help,title,$widget)\" \"$gPB(c_help,text,$widget)\" $x $y + } +} + + +#=============================================================================== +proc PB_context_help {title text x y} { +#=============================================================================== + global gPB + + if {![winfo exists .context_help]} \ + { + toplevel .context_help -relief raised \ + -bg black -bd 3 + wm overrideredirect .context_help true + wm positionfrom .context_help program + + + # Compute balloon width to adjust its position + set bw [font measure $gPB(c_help,font) " $text"] + if {$bw > $gPB(c_help,width)} { + set bw $gPB(c_help,width) + } + + # Position window w.r.t. screen size + set bx [expr $x + 10 + $bw] + + if {$bx > $gPB(c_help,screen)} { + set bx [expr $x - 10 - $bw] + } else { + set bx [expr $x + 10] + } + + label .context_help.title -text "$title" -bg royalBlue -fg lightYellow \ + -justify left + label .context_help.text -text "$text" -wraplength $gPB(c_help,width) \ + -bg cyan -font $gPB(c_help,font) -justify left + + pack .context_help.title -side top -fill x + pack .context_help.text n -side bot -fill x + + wm geometry .context_help "+$bx+[expr $y+5]" + } +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_definition.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_definition.tcl new file mode 100644 index 0000000..4104ce4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_definition.tcl @@ -0,0 +1,241 @@ +#============================================================================== +# UI_PB_DEFINITION.TCL +#============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Definition Book. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 02-Jun-1999 mnb Code Integration # +# 14-Jun-1999 mnb Attached procedure to Other's page Tab # +# 21-Sep-1999 mnb Changed Address Tab Procedure, to recreate the # +# Address page tree elements. # +# 03-Nov-1999 gsl Added UI_PB_def_DisableWindow & # +# UI_PB_def_EnableWindow. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================== +proc UI_PB_def_DisableWindow { CHAP } { +#============================================================================== + upvar $CHAP chap + global gPB + + #********** + # Sections + #********** + set sect $Page::($chap,book_obj) + set sect_id $Book::($sect,book_id) + + #******************************************************************* + # Save away the Button-1 callback and attach a message dialog to it. + #******************************************************************* + set gPB($sect_id,b1_cb) [bind [$sect_id subwidget nbframe] <1>] + + bind [$sect_id subwidget nbframe] <1> \ + "tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error\ + -message \"You have to close all sub-windows to enable this tab.\"" + + #*********************** + # Get tabbed pages info + #*********************** + set page_tab $Book::($sect,current_tab) + set page_obj [lindex $Book::($sect,page_obj_list) $page_tab] + + #*************************** + # Retrieve some font styles + #*************************** + set sty_n $gPB(font_style_normal) + set sty_b $gPB(font_style_bold) + set sty_ng $gPB(font_style_normal_gray) + set sty_bg $gPB(font_style_bold_gray) + + # Disable notebook tabs + $sect_id pageconfig blk -state disabled + $sect_id pageconfig adr -state disabled + $sect_id pageconfig fmt -state disabled + $sect_id pageconfig ele -state disabled + + # Disable tree items on tabbed pages + switch $page_tab \ + { + 0 { ;# BLOCK + + set t $Page::($page_obj,tree) + set h [$t subwidget hlist] + + # Disable everything first, then enable the selected item. + } + 1 { ;# ADDRESS + + set t $Page::($page_obj,tree) + set h [$t subwidget hlist] + + # Disable everything first, then enable the selected item. + } + 2 { ;# FORMAT + + set t $Page::($page_obj,tree) + set h [$t subwidget hlist] + + # Disable everything first, then enable the selected item. + } + } +} + +#============================================================================== +proc UI_PB_def_EnableWindow { CHAP } { +#============================================================================== + upvar $CHAP chap + global gPB + + #********** + # Sections + #********** + set sect $Page::($chap,book_obj) + set sect_id $Book::($sect,book_id) + + #******************************************* + # Restore Button-1 callback for the chapter + #******************************************* + bind [$sect_id subwidget nbframe] <1> $gPB($sect_id,b1_cb) + + #*********************** + # Get tabbed pages info + #*********************** + set page_tab $Book::($sect,current_tab) + set page_obj [lindex $Book::($sect,page_obj_list) $page_tab] + + #*************************** + # Retrieve some font styles + #*************************** + set sty_n $gPB(font_style_normal) + set sty_b $gPB(font_style_bold) + set sty_ng $gPB(font_style_normal_gray) + set sty_bg $gPB(font_style_bold_gray) + + $sect_id pageconfig blk -state normal + $sect_id pageconfig adr -state normal + $sect_id pageconfig fmt -state normal + $sect_id pageconfig ele -state normal +} + +#============================================================================== +proc UI_PB_Def {book_id def_page_obj} { +#============================================================================== + global paOption + set f [$book_id subwidget $Page::($def_page_obj,page_name)] + + set w [tixNoteBook $f.nb -ipadx 5 -ipady 5] + [$w subwidget nbframe] config -tabpady 0 + + set def_book [new Book w] + set Page::($def_page_obj,book_obj) $def_book + Book::CreatePage $def_book blk "BLOCK" "" UI_PB_Def_Block \ + UI_PB_Def_BlockTab + Book::CreatePage $def_book adr "ADDRESS" "" UI_PB_Def_Address \ + UI_PB_Def_AddressTab + Book::CreatePage $def_book fmt "FORMAT" "" UI_PB_Def_Format \ + UI_PB_Def_FormatTab + Book::CreatePage $def_book ele "Other Data Elements" "" \ + UI_PB_Def_OtherElements UI_PB_Def_OthElemTab + + pack $f.nb -expand yes -fill both + set Book::($def_book,x_def_tab_img) 0 + set Book::($def_book,current_tab) -1 +} + +#============================================================================= +proc UI_PB_Def_BlockTab { book_id page_img book_obj} { +#============================================================================= + CB_nb_def $book_id $page_img $book_obj + UI_PB_Def_UpdatePrevTabElems book_obj + set Book::($book_obj,current_tab) 0 + UI_PB_Def_CreateTabAttr book_obj +} + +#============================================================================= +proc UI_PB_Def_AddressTab { book_id page_img book_obj} { +#============================================================================= + CB_nb_def $book_id $page_img $book_obj + UI_PB_Def_UpdatePrevTabElems book_obj + set Book::($book_obj,current_tab) 1 + UI_PB_Def_CreateTabAttr book_obj +} + +#============================================================================= +proc UI_PB_Def_FormatTab { book_id page_img book_obj} { +#============================================================================= + CB_nb_def $book_id $page_img $book_obj + UI_PB_Def_UpdatePrevTabElems book_obj + set Book::($book_obj,current_tab) 2 + UI_PB_Def_CreateTabAttr book_obj +} + +#============================================================================= +proc UI_PB_Def_OthElemTab { book_id page_img book_obj} { +#============================================================================= + CB_nb_def $book_id $page_img $book_obj + UI_PB_Def_UpdatePrevTabElems book_obj + set Book::($book_obj,current_tab) 3 + UI_PB_Def_CreateTabAttr book_obj +} + +#============================================================================= +proc UI_PB_Def_CreateTabAttr { BOOK_OBJ } { +#============================================================================= + upvar $BOOK_OBJ book_obj + + switch -exact -- $Book::($book_obj,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 0] + UI_PB_blk_TabBlockCreate $page_obj + } + 1 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 1] + UI_PB_addr_TabAddressCreate $page_obj + } + 2 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 2] + UI_PB_fmt_FormatItemSelec $page_obj + } + 3 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 3] + UI_PB_oth_UpdateOtherPage page_obj + } + } +} + +#============================================================================= +proc UI_PB_Def_UpdatePrevTabElems { BOOK_OBJ } { +#============================================================================= + upvar $BOOK_OBJ book_obj + + switch -exact -- $Book::($book_obj,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 0] + UI_PB_blk_TabBlockDelete $page_obj + } + 1 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 1] + UI_PB_addr_AddressApply page_obj + } + 2 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 2] + UI_PB_fmt_ApplyFormat page_obj + } + 3 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 3] + UI_PB_oth_ApplyOtherAttr + } + } +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_file.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_file.tcl new file mode 100644 index 0000000..d0c5745 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_file.tcl @@ -0,0 +1,1039 @@ +################################################################################ +# ************** # +# ui_pb_file.tcl # +# ************** # +# File handling utilities. # +#------------------------------------------------------------------------------# +# # +# Copyright (c) 1999, Unigraphics Solutions Inc. # +# # +# See the file "license.terms" for information on usage and redistribution # +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. # +# # +# # +# Description # +# This file contains all functions dealing with selecting the pui file # +# and event handlers based upon the type of machine. # +# # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 bmp Initial # +# 02-Jun-1999 mnb Code Integration # +# 04-Jun-1999 gsl Rename procedures and propagate changes accordingly. # +# 07-Sep-1999 mnb Integrated for Phase18 # +# 21-Sep-1999 mnb Removed Sequence No & Changed Output Unit # +# 18-Oct-1999 gsl Minor changes # +# 22-Oct-1999 gsl Added use of UI_PB_com_CreateTransientWinow. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +################################################################################ + +#=============================================================================== +proc UI_PB_OpenPost { } { +#=============================================================================== + global tixOption + global paOption + global gPB + + + set win $gPB(top_window).open + + if { [winfo exists $win] } \ + { + $win popup + UI_PB_com_ClaimActiveWindow $win + } else \ + { + tixFileSelectDialog $win -command "PB_UI_EditPost $win" + UI_PB_com_CreateTransientWindow $win "Edit Post" "500x400+200+200" \ + "" "UI_PB_OpenDestroy $win" + $win popup + + # Sets the file box attributes + set file_box [$win subwidget fsbox] + $file_box config -pattern "*.pui" + set top_filter_ent [[$file_box subwidget filter] subwidget entry] + bind $top_filter_ent "UI_PB_OpenDlgFilter $win" + + # Sets the Action Button box attributes + set but_box [$win subwidget btns] + $but_box config -bg $paOption(butt_bg) -relief sunken + tixDestroy [$but_box subwidget help] + + # Re-claim the active window status, due to tixDestroy above. + UI_PB_com_ClaimActiveWindow $win + + # Apply filter before dispalying dialog + UI_PB_OpenDlgFilter $win + + [$but_box subwidget cancel] config -width 10 -command "UI_PB_OpenCancel_CB $win" + [$but_box subwidget apply] config -width 10 -command "UI_PB_OpenDlgFilter $win" + [$but_box subwidget ok] config -width 10 + } + + # Activate save, close & Save As options and + # deactivate open & close + UI_PB_GreyOutAllFileOpts +} + +#=============================================================================== +proc UI_PB_OpenDestroy { win } { +#=============================================================================== + # Activates the open, new file opetions + UI_PB_EnableFileOptions +} + +#=============================================================================== +proc UI_PB_OpenCancel_CB { dialog_id } { +#=============================================================================== + $dialog_id popdown + + # Active file options + UI_PB_EnableFileOptions +} + +#=============================================================================== +proc UI_PB_OpenDlgFilter { dlg_id } { +#=============================================================================== + set file_box [$dlg_id subwidget fsbox] + $file_box config -pattern "*.pui" + + # Updates the file listing box + UI_PB_UpdateFileListBox $dlg_id +} + +#=============================================================================== +proc PB_UI_EditPost { dlg_id file_name } { +#=============================================================================== + global gPB + + + set top_win $gPB(top_window) + + if { ![file exists $file_name] } \ + { + tk_messageBox -parent $top_win -type ok -icon question \ + -message "Select a valid Post Builder Session file." + $dlg_id popup +return + } else \ + { + set extension [file extension $file_name] + if { [string compare $extension ".pui"] != 0 } \ + { + tk_messageBox -parent $top_win -type ok -icon warning \ + -message "Select a valid Post Builder Session file." + $dlg_id popup +return + } + } + + PB_Start $file_name + + # Sets the post output files + set pui_file [file tail $file_name] + PB_int_ReadPostFiles dir def_file tcl_file + PB_int_SetPostOutputFiles dir pui_file def_file tcl_file + + # Hide Open Post dialog + UI_PB_com_DismissActiveWindow $dlg_id + $dlg_id popdown + + # Create main window + if [catch { UI_PB_main_window } result] { +return tk_messageBox -parent $gPB(top_window) -type ok -icon error \ + -message "Incorrect contents in Post Builder Session file." + } + update + + UI_PB_ActivateOpenFileOpts + AcceptMachineToolSelection + + set gPB(session) EDIT +} + +#=============================================================================== +proc UI_PB_SavePost { args } { +#=============================================================================== + global gPB + + if { $gPB(session) == "NEW" } \ + { + UI_PB_SavePostAs + tkwait variable gPB(session) + } else \ + { + UI_PB_save_a_post + } +} + +#=============================================================================== +proc UI_PB_SavePostAs { args } { +#=============================================================================== + global tixOption + global paOption + global gPB + global gpb_file_ext + global gpb_pui_file + global gpb_def_file + global gpb_tcl_file + + + PB_int_ReadPostOutputFiles cur_dir gpb_pui_file gpb_def_file \ + gpb_tcl_file + + set win $gPB(main_window).save_as + + if { [winfo exists $win] } \ + { + $win popup + UI_PB_com_ClaimActiveWindow $win + set file_box [$win subwidget fsbox] + $file_box config -directory $cur_dir + } else \ + { + set gpb_file_ext "pui" + tixFileSelectDialog $win -command "UI_PB_SavePbFiles $win" + + UI_PB_com_CreateTransientWindow $win "Save As" "540x450+150+230" \ + "" "" + $win popup + + # Sets the file box attributes + set file_box [$win subwidget fsbox] + $file_box config -directory $cur_dir + $file_box config -pattern "*.pui" + set top_filter_ent [[$file_box subwidget filter] subwidget entry] + bind $top_filter_ent "UI_PB_SaveAsSetPattern $win" + + # Binds the listing box browse + set file_scrlistbox [$file_box subwidget filelist] + $file_scrlistbox config -browsecmd "UI_PB_AssignFileName $win" + $file_scrlistbox config -command "" + + # Unpacks the selection ComboBox + pack forget [$file_box subwidget selection] + pack forget $file_box.f3 + + # Creates the frames for pui, tcl & def files + set frm [frame $file_box.ptd -relief solid -bd 1 -bg lightSkyBlue] + pack $frm -fill both -padx 12 -pady 10 + + # pui file + radiobutton $frm.rad1 -text "Post Builder Session" \ + -bg lightSkyBlue -highlightthickness 0 \ + -variable gpb_file_ext -font $tixOption(bold_font) \ + -value pui -command "UI_PB_SaveAsRad_CB $win pui" + entry $frm.ent1 -width 30 -relief sunken -bd 1 \ + -textvariable gpb_pui_file + grid $frm.rad1 -row 0 -column 0 -padx 5 -pady 5 -sticky nw + grid $frm.ent1 -row 0 -column 1 -padx 5 -pady 5 -sticky e + + # def file + radiobutton $frm.rad2 -text "N/C Data Definition" \ + -bg lightSkyBlue -highlightthickness 0 \ + -variable gpb_file_ext -font $tixOption(bold_font) \ + -value def -command "UI_PB_SaveAsRad_CB $win def" + entry $frm.ent2 -width 30 -relief sunken -bd 1 \ + -textvariable gpb_def_file + grid $frm.rad2 -row 1 -column 0 -padx 5 -pady 5 -sticky nw + grid $frm.ent2 -row 1 -column 1 -padx 5 -pady 5 -sticky e + + # tcl file + radiobutton $frm.rad3 -text "Event Handlers" \ + -bg lightSkyBlue -highlightthickness 0 \ + -variable gpb_file_ext -font $tixOption(bold_font) \ + -value tcl -command "UI_PB_SaveAsRad_CB $win tcl" + entry $frm.ent3 -width 30 -relief sunken -bd 1 \ + -textvariable gpb_tcl_file + grid $frm.rad3 -row 2 -column 0 -padx 5 -pady 5 -sticky nw + grid $frm.ent3 -row 2 -column 1 -padx 5 -pady 5 -sticky e + + # Sets the Action Button box attributes + set but_box [$win subwidget btns] + $but_box config -bg $paOption(butt_bg) -relief sunken + tixDestroy [$but_box subwidget help] + + # Re-claim the active window status, due to tixDestroy above. + UI_PB_com_ClaimActiveWindow $win + + # Apply filter before displaying the dialog + UI_PB_SaveAsDlgFilter $win + + [$but_box subwidget cancel] config -width 10 -command "UI_PB_SaveAsCancel_CB $win" + [$but_box subwidget apply] config -width 10 -command "UI_PB_SaveAsDlgFilter $win" + [$but_box subwidget ok] config -width 10 + + # Enables or Disables the entry's of a file + UI_PB_UpdateFileExtWidgets $win pui + } +} + +#=============================================================================== +proc UI_PB_SaveAsCancel_CB { dialog_id } { +#=============================================================================== + $dialog_id popdown + + UI_PB_com_DismissActiveWindow $dialog_id +} + +#=============================================================================== +proc UI_PB_SaveAsDlgFilter { win } { +#=============================================================================== + # Sets the pattern + UI_PB_SaveAsSetPattern $win + + # Updates the file listing box + UI_PB_UpdateFileListBox $win +} + +#=============================================================================== +proc UI_PB_UpdateFileListBox { win } { +#=============================================================================== + set file_box [$win subwidget fsbox] + set pattern [$file_box cget -pattern] + set dir [$file_box cget -directory] + + # Trim redundant chars off the directory name under WNT + global tcl_platform + if {$tcl_platform(platform) != "unix"} \ + { + set dir [string trimright $dir "*"] + set dir [string trimright $dir "\\"] + $file_box config -directory $dir + } + + set file_listbox [[$file_box subwidget filelist] subwidget listbox] + $file_listbox delete 0 end +## set cur_dir [pwd] + + cd $dir + foreach match [glob -nocomplain -- $pattern] \ + { + $file_listbox insert end $match + } +## cd $cur_dir +} + +#=============================================================================== +proc UI_PB_UpdateFileExtWidgets { dialog_id file_ext } { +#=============================================================================== + global gPB + + set file_box [$dialog_id subwidget fsbox] + $file_box config -pattern "*.$file_ext" + + switch $file_ext \ + { + "pui" { + $file_box.ptd.ent1 config -state normal -bg $gPB(entry_color) + $file_box.ptd.ent2 config -state disabled -bg lightBlue + $file_box.ptd.ent3 config -state disabled -bg lightBlue + focus $file_box.ptd.ent1 + } + + "def" { + $file_box.ptd.ent1 config -state disabled -bg lightBlue + $file_box.ptd.ent2 config -state normal -bg $gPB(entry_color) + $file_box.ptd.ent3 config -state disabled -bg lightBlue + focus $file_box.ptd.ent2 + } + + "tcl" { + $file_box.ptd.ent1 config -state disabled -bg lightBlue + $file_box.ptd.ent2 config -state disabled -bg lightBlue + $file_box.ptd.ent3 config -state normal -bg $gPB(entry_color) + focus $file_box.ptd.ent3 + } + } +} + +#=============================================================================== +proc UI_PB_SaveAsRad_CB { dialog_id file_ext } { +#=============================================================================== + set file_box [$dialog_id subwidget fsbox] + $file_box config -pattern "*.$file_ext" + + # Enables or Disables the entry's of a file + UI_PB_UpdateFileExtWidgets $dialog_id $file_ext + + # Updates the files in the file listing box + UI_PB_UpdateFileListBox $dialog_id +} + +#=============================================================================== +proc UI_PB_SaveAsSetPattern { win } { +#=============================================================================== + global gpb_file_ext + + set file_box [$win subwidget fsbox] + $file_box config -pattern "*.$gpb_file_ext" +} + +#=============================================================================== +proc UI_PB_AssignFileName { win } { +#=============================================================================== + global gpb_file_ext + global gpb_pui_file + global gpb_def_file + global gpb_tcl_file + + set file_box [$win subwidget fsbox] + set file_listbox [[$file_box subwidget filelist] subwidget listbox] + + set sel_index [$file_listbox curselection] + set sel_file_name [$file_listbox get $sel_index $sel_index] + + switch $gpb_file_ext \ + { + "pui" { set gpb_pui_file $sel_file_name } + "def" { set gpb_def_file $sel_file_name } + "tcl" { set gpb_tcl_file $sel_file_name } + } +} + +#=============================================================================== +proc UI_PB_SavePbFiles { win args } { +#=============================================================================== + global gPB + global gpb_pui_file + global gpb_def_file + global gpb_tcl_file + + set main_win $gPB(main_window) + + if { [string compare $gpb_pui_file ""] == 0 } \ + { + tk_messageBox -parent $main_win -type ok -icon warning \ + -message "Enter file name for the Post Builder Session." + $win popup +return + } elseif { [string compare $gpb_def_file ""] == 0 } \ + { + tk_messageBox -parent $main_win -type ok -icon warning \ + -message "Enter file name for the N/C Data Definition." + $win popup +return + } elseif { [string compare $gpb_tcl_file ""] == 0 } \ + { + tk_messageBox -parent $main_win -type ok -icon warning \ + -message "Enter file name for the Event Handlers." + $win popup +return + } + + UI_PB_AttachExtToFile gpb_pui_file pui + UI_PB_AttachExtToFile gpb_def_file def + UI_PB_AttachExtToFile gpb_tcl_file tcl + + set file_box [$win subwidget fsbox] + set top_filter_ent [[$file_box subwidget filter] subwidget entry] + set entry_text [$top_filter_ent get] + set cur_dir [file dirname $entry_text] + + PB_int_SetPostOutputFiles cur_dir gpb_pui_file gpb_def_file gpb_tcl_file + + # Outputs the post files + UI_PB_save_a_post + + # Releases the window + UI_PB_com_DismissActiveWindow $win +} + +#=============================================================================== +proc UI_PB_AttachExtToFile { FILE_NAME ext } { +#=============================================================================== + upvar $FILE_NAME file_name + + if { [string match *.$ext $file_name] == 0 } \ + { + set file_name $file_name.$ext + } +} + +#=============================================================================== +proc UI_PB_GreyOutAllFileOpts { } { +#=============================================================================== + global gPB + + set pb_topwin $gPB(top_window) + + # Configures the file options + set mb $gPB(main_menu_bar).file.m + $mb entryconfigure 1 -state disabled + $mb entryconfigure 2 -state disabled + if [catch { $mb entryconfigure 3 -state disabled } result] { } + $mb entryconfigure 4 -state disabled + $mb entryconfigure 5 -state disabled + $mb entryconfigure 6 -state disabled + + # Configures the tool icons + set mm $gPB(main_menu).tool + [$mm subwidget new] config -state disabled + [$mm subwidget open] config -state disabled + [$mm subwidget save] config -state disabled +} + +#=============================================================================== +proc UI_PB_ActivateOpenFileOpts { } { +#=============================================================================== + global gPB + + set pb_topwin $gPB(top_window) + + # Configures the file options + set mb $gPB(main_menu_bar).file.m + $mb entryconfigure 1 -state disabled + $mb entryconfigure 2 -state disabled + if [catch { $mb entryconfigure 3 -state disabled } result] { } + $mb entryconfigure 4 -state normal + $mb entryconfigure 5 -state normal + $mb entryconfigure 6 -state normal + + # Configures the tool icons + set mm $gPB(main_menu).tool + [$mm subwidget new] config -state disabled + [$mm subwidget open] config -state disabled + [$mm subwidget save] config -state normal +} + +#=============================================================================== +proc UI_PB_NewPost { } { +#=============================================================================== + global tixOption paOption + global gPB + + set win $gPB(top_window).new + + if [winfo exists $win] { + wm deiconify $win + UI_PB_com_ClaimActiveWindow $win +return + } + + # Create dialog window + toplevel $win + UI_PB_com_CreateTransientWindow $win "Create New Post Processor" "+300+250" \ + "tixDestroy $win" "UI_PB_NewDestroy" + global output_unit + global mach_type + global axisoption + global controller + global pb_output_file + + set output_unit "Inches" + set mach_type "Mill" + set axisoption "3-Axis" + set pb_output_file "[pwd]/mill3ax" + + frame $win.top -relief raised -bd 1 + pack $win.top -side top -fill both -expand yes + + frame $win.top.level1 + frame $win.top.level2 + frame $win.top.level3 + frame $win.top.level5 + frame $win.top.level5.left + frame $win.top.level5.right + + # Name + set pname [tixLabelEntry $win.top.level1.name -label "Name " \ + -options { + entry.width 49 + entry.textVariable pb_output_file + }] + [$pname subwidget entry] config -bg $paOption(tree_bg) + pack $pname -side left -padx 5 -pady 5 + + pack $win.top.level1 -side top -fill x -expand yes + pack $win.top.level2 -side top -fill x -expand yes + pack $win.top.level3 -side top -fill both -expand yes + pack $win.top.level5 -side top -fill both -expand yes + pack $win.top.level5.left -side left -fill both -expand yes + pack $win.top.level5.right -side right -fill both -expand yes + + # Description + set desc_lab [label $win.top.level2.lab -text "Description"] + set desc_txt [tixScrolledText $win.top.level2.desc \ + -height 50 -width 400 -scrollbar y] + + [$desc_txt subwidget text] config -bg $paOption(tree_bg) + [$desc_txt subwidget vsb] config -width $paOption(trough_wd) \ + -troughcolor $paOption(trough_bg) + + pack $desc_lab -side left -padx 5 -pady 5 + pack $desc_txt -side left -padx 5 -pady 5 + + # Output Unit + tixLabelFrame $win.top.level3.lbf -label "Post Output Unit" + set out_frame [$win.top.level3.lbf subwidget frame] + pack $win.top.level3.lbf -side left -pady 10 + + radiobutton $out_frame.inch -text "Inches" -variable output_unit \ + -anchor w -value "Inches" + + radiobutton $out_frame.mm -text "Millimeters" \ + -variable output_unit -anchor w -value "Millimeters" + pack $out_frame.inch $out_frame.mm -side left -padx 10 -pady 5 + + # Controller + tixLabelFrame $win.top.level5.left.bottom -label "Controller" + set fb [$win.top.level5.left.bottom subwidget frame] + grid $win.top.level5.left.bottom -row 2 -pady 10 + + tixOptionMenu $fb.contr \ + -variable controller \ + -options { + entry.anchor e + menubutton.width 30 + } + [$fb.contr subwidget menubutton] config -font $tixOption(bold_font) \ + -bg lightSkyBlue + pack $fb.contr -padx 5 -pady 2 + + # Machine Tool Image + canvas $win.top.level5.right.can -width 300 -height 300 + $win.top.level5.right.can config -bg black -relief sunken + pack $win.top.level5.right.can -fill both -expand yes -padx 5 \ + -pady 5 + + global env + image create photo myphoto -file $env(PB_HOME)/images/pb_hg500.gif + $win.top.level5.right.can create image 150 150 -image myphoto + + # Machine Type + tixLabelFrame $win.top.level5.left.top -label "Machine Tool" + set fa [$win.top.level5.left.top subwidget frame] + grid $win.top.level5.left.top -row 1 -sticky w + + radiobutton $fa.mill -text "Mill" -variable mach_type -anchor w \ + -value "Mill" -command "CB_MachType $win Mill $fa $fb" + + radiobutton $fa.lathe -text "Lathe" -variable mach_type -anchor w \ + -value "Lathe" -command "CB_MachType $win Lathe $fa $fb" + + radiobutton $fa.wedm -text "Wire EDM" -variable mach_type -anchor w \ + -value "Wedm" -command "CB_MachType $win Wedm $fa $fb" + + radiobutton $fa.punch -text "Punch" -variable mach_type -anchor w \ + -value "Punch" -command "CB_MachType $win Punch $fa $fb" + + # Axis Type + tixOptionMenu $fa.axis \ + -variable axisoption \ + -command "CB_MachineAxisType $win" \ + -options { + entry.anchor e + menubutton.width 30 + } + [$fa.axis subwidget menubutton] config -font $tixOption(bold_font) \ + -bg lightSkyBlue + + grid $fa.mill -sticky w -padx 5 -pady 2 + grid $fa.lathe -sticky w -padx 5 -pady 2 + grid $fa.wedm -sticky w -padx 5 -pady 2 + grid $fa.punch -sticky w -padx 5 -pady 2 + grid $fa.axis -sticky w -padx 5 -pady 2 + + # Use a ButtonBox to hold the buttons. + global paOption + tixButtonBox $win.box \ + -orientation horizontal \ + -relief sunken \ + -bd 2 \ + -bg $paOption(butt_bg) + + $win.box add rej -text Cancel -underline 0 \ + -command "UI_PB_NewCancel_CB $win" -width 10 + $win.box add acc -text Ok -underline 0 \ + -command "OpenNewFile $win" -width 10 + + pack $win.box -side bottom -fill x -padx 3 -pady 3 + + # Machine Description & Optional menus are created + CB_MachType $win $mach_type $fa $fb + + # Activates save, close & Save As options and deactivates + # open & close + UI_PB_GreyOutAllFileOpts +} + +#=============================================================================== +proc UI_PB_NewCancel_CB { win } { +#=============================================================================== + UI_PB_EnableFileOptions + wm withdraw $win +} + +#=============================================================================== +proc UI_PB_NewDestroy { args } { +#=============================================================================== + # Activates the file options + UI_PB_EnableFileOptions + + # Releases the grab +### grab release $win +} + +#=============================================================================== +proc UI_PB_EnableFileOptions { } { +#=============================================================================== + global gPB + + # Configures the file options + set mb $gPB(main_menu_bar).file.m + $mb entryconfigure 1 -state normal + $mb entryconfigure 2 -state normal + if [catch { $mb entryconfigure 3 -state normal } result] { } + $mb entryconfigure 4 -state disabled + $mb entryconfigure 5 -state disabled + $mb entryconfigure 6 -state disabled + + # Configures the tool icons + set mm $gPB(main_menu).tool + [$mm subwidget new] config -state normal + [$mm subwidget open] config -state normal + [$mm subwidget save] config -state disabled + + # Unclaim active window status and release the grab + UI_PB_com_DismissActiveWindow [UI_PB_com_AskActiveWindow] +} + +#=============================================================================== +proc CreateMachineTypeOptMenu { widget mach_type } { +#=============================================================================== + global axisoption + + set opt_labels(2H) "2-Axis Horizontal" + set opt_labels(2V) "2-Axis Vertical" + set opt_labels(3) "3-Axis" + set opt_labels(4T) "4-Axis with Rotary Table" + set opt_labels(4H) "4-Axis with Rotary Head" + set opt_labels(4I) "4-Axis Independent (Merging)" + set opt_labels(4D) "4-Axis Dependent" + set opt_labels(5HH) "5-Axis with Dual Rotary Heads" + set opt_labels(5TT) "5-Axis with Dual Rotary Tables" + set opt_labels(5HT) "5-Axis with Rotary Head and Table" + set opt_labels(2) "2-Axis Wire EDM" + set opt_labels(4) "4-Axis Wire EDM" + + # Deletes the current options + set cur_opt_names [$widget.axis entries] + foreach name $cur_opt_names \ + { + $widget.axis delete $name + } + + switch $mach_type \ + { + "Mill" { + set opts { 3 4T 4H 5HH 5TT 5HT } + $widget.axis config -state normal + } + + "Lathe" { + set opts { 2H 2V 4I 4D } + $widget.axis config -state normal + } + + "Wedm" { + set opts { 2 4 } + $widget.axis config -state normal + } + + default { + set opts "" + set axisoption "" + $widget.axis config -state disabled + } + } + + foreach opt $opts \ + { + $widget.axis add command $opt -label $opt_labels($opt) + } +} + +#=============================================================================== +proc CreateControllerOptMenu { widget mach_type } { +#=============================================================================== + set opts_cont { Generic AllnBrdy BrdgPrt BrwnShrp Cincin KrnyTrckr Fanuc \ + GE GN GddngLws Heiden Mazak Seimens} + + set opt_labels_c(Generic) "Generic" + set opt_labels_c(AllnBrdy) "Allen Bradley" + set opt_labels_c(BrdgPrt) "Bridgeport" + set opt_labels_c(BrwnShrp) "Brown & Sharp" + set opt_labels_c(Cincin) "Cinicinnatti Milacron " + set opt_labels_c(KrnyTrckr) "Kearny & Tracker" + set opt_labels_c(Fanuc) "Fanuc" + set opt_labels_c(GE) "General Electric" + set opt_labels_c(GN) "General Numerics" + set opt_labels_c(GddngLws) "Gidding & Lewis" + set opt_labels_c(Heiden) "Heidenhain" + set opt_labels_c(Mazak) "Mazak" + set opt_labels_c(Seimens) "Seimens" + + set cur_opt_names [$widget.contr entries] + foreach name $cur_opt_names \ + { + $widget.contr delete $name + } + + foreach opt $opts_cont \ + { + $widget.contr add command $opt -label $opt_labels_c($opt) + } +} + +#=============================================================================== +proc OpenNewFile {w} { +#=============================================================================== + global mach_type + global axisoption + global output_unit + global controller + global pb_output_file + global env + global gPB + + if { $mach_type != "Mill" || $controller != "Generic" } \ + { + tk_messageBox -parent $w -type ok -icon question \ + -message "Post Builder currently has only been implemented \ + for Generic Milling Machines" + return + } + + # Standard file name format + set file_format { machine axis controller units } + + append stand_file_name pb + foreach label $file_format \ + { + switch $label \ + { + "controller" { + append stand_file_name _ + append stand_file_name $controller + } + + "machine" { + append stand_file_name _ + append stand_file_name $mach_type + } + + "axis" { + if { $axisoption != "" } \ + { + append stand_file_name _ + append stand_file_name $axisoption + } + } + + "units" { + append stand_file_name _ + switch $output_unit \ + { + "Inches" { append stand_file_name "IN" } + "Millimeters" { append stand_file_name "MM" } + } + } + } + } + + set dot_index [string last . $pb_output_file] + if { $dot_index != -1 } \ + { + set pb_output_file [string range $pb_output_file 0 [expr $dot_index - 1]] + } + + set pb_std_file $env(PB_HOME)/pblib/$stand_file_name.pui + PB_Start $pb_std_file + + # Sets the post output files + set dir [file dirname $pb_output_file] + if { $dir == "." } \ + { + set dir [pwd] + } + set file_name [file tail $pb_output_file] + set pui_file $file_name.pui + set def_file $file_name.def + set tcl_file $file_name.tcl + PB_int_SetPostOutputFiles dir pui_file def_file tcl_file + + # Hide New Post dialog + UI_PB_com_DismissActiveWindow $w + wm withdraw $w + + # Create main window + UI_PB_main_window + + update + + UI_PB_ActivateOpenFileOpts + AcceptMachineToolSelection + + set gPB(session) NEW +} + +#=============================================================================== +proc CB_MachType { win mach_type fa fb } { +#=============================================================================== + switch -- $mach_type \ + { + "Lathe" { + set desc "This is a Lathe Machine." + } + "Wedm" { + set desc "This is a Wire EDM Machine." + } + "Punch" { + set desc "This is a Punch Machine." + } + "Mill" { + set desc "This is a Milling Machine." + } + } + + [$win.top.level2.desc subwidget text] delete 1.0 end + [$win.top.level2.desc subwidget text] insert 1.0 $desc + + # Creates the machine axis options + CreateMachineTypeOptMenu $fa $mach_type + + # Creates the Controller options + CreateControllerOptMenu $fb $mach_type +} + +#=============================================================================== +proc CB_MachineAxisType { win args } { +#=============================================================================== + global axisoption + + switch -- $axisoption \ + { + "2" { + set desc "This is a 2-Axis Wire EDM Machine" + } + "4" { + set desc "This is a 4-Axis Wire EDM Machine" + } + "2H" { + set desc "This is a 2-Axis Horizontal Lathe Machine" + } + "2V" { + set desc "This is a 2-Axis Vertical Lathe Machine" + } + "4I" { + set desc "This is a 4-Axis Independent Lathe Machine" + } + "4D" { + set desc "This is a 4-Axis Dependent Lathe Machine" + } + "3" { + set desc "This is a 3-Axis Milling Machine." + } + "4H" { + set desc "This is a 4-Axis Milling Machine With Rotary Head." + } + "4T" { + set desc "This is a 4-Axis Milling Machine With Rotaty Tabel." + } + "5TT" { + set desc "This is a 5-Axis Milling Machine With Dual Rotary \ + Tables." + } + "5HH" { + set desc "This is a 5-Axis Milling Machine with Dual Rotary \ + Heads." + } + "5HT" { + set desc "This is a 5-Axis Milling Machine With Rotary Head \ + and Table." + } + } + + [$win.top.level2.desc subwidget text] delete 1.0 end + [$win.top.level2.desc subwidget text] insert 1.0 $desc +} + +#=============================================================================== +proc AcceptMachineToolSelection { } { +#=============================================================================== + global axisoption MachineToolObject + global mach_type + global machData machTree + global mom_kin_var + global general_param axis_4th_param axis_5th_param + + set general_param {"mom_kinematic_unit" "mom_kin_output_unit" \ + "mom_kin_x_axis_limit" "mom_kin_y_axis_limit" \ + "mom_kin_z_axis_limit" "mom_kin_home_x_pos" \ + "mom_kin_home_y_pos" "mom_kin_machine_resolution" \ + "mom_kin_max_traversal_rate"} + + set axis_4th_param {"mom_kin_4th_axis_type" "mom_kin_4th_axis_plane" \ + "mom_kin_4th_axis_address" "mom_kin_4th_axis_min_incr" \ + "mom_kin_4th_axis_max_limit" "mom_kin_4th_axis_min_limit" \ + "mom_kin_4th_axis_rotation" "mom_kin_4th_axis_center_offset(0)" \ + "mom_kin_4th_axis_center_offset(1)" "mom_kin_4th_axis_center_offset(2)" \ + "mom_kin_4th_axis_ang_offset" "mom_kin_pivot_guage_offset" \ + "mom_kin_max_dpm" "mom_kin_linearization_flag" \ + "mom_kin_linearization_tol" "mom_kin_4th_axis_limit_action"} + + set axis_5th_param {"mom_kin_5th_axis_type" "mom_kin_5th_axis_plane" \ + "mom_kin_5th_axis_address" "mom_kin_5th_axis_min_incr" \ + "mom_kin_5th_axis_max_limit" "mom_kin_5th_axis_min_limit" \ + "mom_kin_5th_axis_rotation" "mom_kin_5th_axis_center_offset(0)" \ + "mom_kin_5th_axis_center_offset(1)" "mom_kin_5th_axis_center_offset(2)" \ + "mom_kin_5th_axis_ang_offset" "mom_kin_pivot_guage_offset" \ + "mom_kin_max_dpm" "mom_kin_linearization_flag" \ + "mom_kin_linearization_tol" "mom_kin_5th_axis_limit_action"} + + # Retrieve the default machine kinematic parameters according to the + # type of machine tool you choose + PB_int_RetDefKinVarValues general_param mom_kin_var + PB_int_RetDefKinVarValues axis_4th_param mom_kin_var + PB_int_RetDefKinVarValues axis_5th_param mom_kin_var + + if { $axisoption != "3" } \ + { + set mom_kin_var(mom_kin_4th_axis_plane) "yz" + set mom_kin_var(mom_kin_4th_axis_address) "A" + set mom_kin_var(mom_kin_5th_axis_plane) "zx" + set mom_kin_var(mom_kin_5th_axis_address) "B" + if { $axisoption == "4T" || $axisoption == "5T"} \ + { + set mom_kin_var(mom_kin_4th_axis_type) "Table" + } elseif { $axisoption == "4H" || \ + $axisoption == "5HH" || \ + $axisoption == "5HT" } \ + { + set mom_kin_var(mom_kin_4th_axis_type) "Head" + } + + if { $axisoption == "5TT" || \ + $axisoption == "5HT" } \ + { + set mom_kin_var(mom_kin_5th_axis_type) "Table" + } elseif { $axisoption == "5HH" } \ + { + set mom_kin_var(mom_kin_5th_axis_type) "Head" + } + } + + if { [info exists machData] } \ + { + [$machTree subwidget hlist] delete all + BuildMachTreeList + [$machTree subwidget hlist] anchor set 0.0 + MachDisplayParams $machTree machData + ChangeOffsetEntryDisplay + } +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_format.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_format.tcl new file mode 100644 index 0000000..4f0a9b8 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_format.tcl @@ -0,0 +1,1218 @@ +#=============================================================================== +# UI_PB_FORMAT.TCL +#=============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Format page. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 gsl & mnb Initial # +# 07-Apr-1999 mnb Removed puts # +# 27-May-1999 gsl Added display window to verify the format. # +# 02-Jun-1999 mnb Code Integration # +# 13-Jun-1999 mnb Update address and format arrays # +# 14-Jun-1999 gsl Set tixControl -selectmode immediate. # +# 07-Sep-1999 mnb New toplevel format page. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#=============================================================================== +# This procedure is called, when the format page is selected for the first +# time. This procedure creates the ui stuff for displaying the format data +# +# Inputs : Nc Data Definition book id +# format page object +# +# Output : Widget ids stored as attributes of the page object. +#=============================================================================== +proc UI_PB_Def_Format {book_id fmt_page_obj} { +#=============================================================================== + global tixOption + global paOption + global FORMATOBJATTR + global fmt_dis_attr + + set Page::($fmt_page_obj,page_id) [$book_id subwidget \ + $Page::($fmt_page_obj,page_name)] + set Page::($fmt_page_obj,act_fmt_name) "" + + # Creates a pane + Page::CreatePane $fmt_page_obj + + # Adds create, cut and paste buttons to left pane + UI_PB_fmt_AddCompLeftPane fmt_page_obj + + # Creates a tree frame in the left frame + Page::CreateTree $fmt_page_obj + + # Create the tree elements + UI_PB_fmt_CreateTreeElements fmt_page_obj + UI_PB_fmt_FormatDisplayParams fmt_page_obj 0 + + # Divides the main frame into three + UI_PB_fmt_CreateFmtFrames fmt_page_obj + + # Create format display + UI_PB_fmt_CreateFmtDisplay fmt_page_obj + + # Create format components in the right frame + UI_PB_fmt_AddPageFmtParm fmt_page_obj + + # Creates action buttons + UI_PB_fmt_CreateActionButtons fmt_page_obj +} + +#=============================================================================== +# This procedure creates the tree elements. It displays all the formats in +# the tree frame and attaches the callback to each format name. +# +# Input : Format page object +# +# Output : Nothing +#=============================================================================== +proc UI_PB_fmt_CreateTreeElements { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + set tree $Page::($page_obj,tree) + set page_id $Page::($page_obj,page_id) + + set h [$tree subwidget hlist] + $h config -bg $paOption(tree_bg) + + set obj_index 0 + + # Gets all the format names from the database and displays + # all the format names in the tree frame + UI_PB_fmt_DisplayNameList page_obj obj_index + + # Attaches the callback to all the format names + $tree config \ + -command "UI_PB_fmt_FormatItemSelec $page_obj" \ + -browsecmd "UI_PB_fmt_FormatItemSelec $page_obj" +} + +#============================================================================== +# This procedure creates the buttons, create, cut & paste in the left pane +# +# Input : Format page object +# +# Output : Nothing +# +#============================================================================== +proc UI_PB_fmt_AddCompLeftPane { PAGE_OBJ } { +#============================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + set left_pane $Page::($page_obj,left_pane_id) + + set but [frame $left_pane.f] + pack $but -side top -fill x -padx 7 + + button $but.new -text "Create" -bg $paOption(app_butt_bg) \ + -command "UI_PB_fmt_CreateFormat $page_obj" + button $but.del -text "Cut" -bg $paOption(app_butt_bg) \ + -command "UI_PB_fmt_CutFormat $page_obj" + button $but.pas -text "Paste" -bg $paOption(app_butt_bg) \ + -command "UI_PB_fmt_PasteFormat $page_obj" + + pack $but.new $but.del $but.pas -side left -fill x -expand yes +} + +#============================================================================== +# This procedure gets the format names from the database and displays them +# as tree elements. It highlights the format name based upon the index. +# +# Inputs : Format Page object +# Index of the format selected +# +# Output : Nothing +# +#============================================================================== +proc UI_PB_fmt_DisplayNameList { PAGE_OBJ OBJ_INDEX } { +#============================================================================== + upvar $PAGE_OBJ page_obj + upvar $OBJ_INDEX obj_index + global paOption + + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + + $HLIST delete all + $HLIST add 0 -itemtype imagetext -text "" -image $paOption(folder) -state disabled + + set file [tix getimage pb_format] + + # Gets all the format objects from the database + PB_fmt_RetFormatObjs fmt_obj_list + + # Displays all the format names as tree elements + global gPB + set style $gPB(font_style_normal) + set no_names [llength $fmt_obj_list] + for {set count 0} {$count < $no_names} {incr count}\ + { + set fmt_obj [lindex $fmt_obj_list $count] + + # Gets the format name from the format object + set fmt_name $format::($fmt_obj,for_name) + $HLIST add 0.$count -itemtype imagetext -text $fmt_name -image $file \ + -style $style + } + + # Highlights the format name at the index + if {$obj_index >= 0}\ + { + $HLIST selection set 0.$obj_index + } else\ + { + $HLIST selection set 0 + } + $tree autosetmode +} + +#============================================================================== +# This procedure is called, when the Create button is selected. This creates +# new format, using the data of the selected format. After creating the +# new format, it updates the tree elements and the new format will be the +# active format. +# +# Inputs : Format page object +# +# Output : New format object +# +#============================================================================== +proc UI_PB_fmt_CreateFormat { page_obj } { +#============================================================================== + global FORMATOBJATTR + global paOption + + set act_fmt_obj $Page::($page_obj,act_fmt_obj) + + # New format object will be created in the database, using the + # selected formats data. + PB_int_FormatCreateObject act_fmt_obj FORMATOBJATTR obj_index + + # Makes the new format as active format + set fmt_name $FORMATOBJATTR(0) + + # Updates the Address Summary global arrays + UI_PB_fmt_UpdateFmtArr FORMATOBJATTR $fmt_name + + # Recreates the tree elements + UI_PB_fmt_DisplayNameList page_obj obj_index + + # Displays the new formats data + UI_PB_fmt_FormatDisplayParams page_obj $obj_index + UI_PB_fmt_PackFormatAttr $page_obj +} + +#============================================================================== +# This procedure is called, when the cut button is selected. This procedure +# basically deletes the format selected, if it is not used by an address. +# If the selected format is used by an address .. an warning message is popued +# up, which tells user that the format cannot be deleted as it is used by +# some addresses. If the format is deleted, it recreates the tree elements +# and makes the next format as the active format. +# +# Inputs : Format page object +# +# Outputs : Selected format object deletion from the database +# +#============================================================================== +proc UI_PB_fmt_CutFormat { page_obj } { +#============================================================================== + global FORMATOBJATTR + + # Gets the tree widget id from the page object + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + + # Gets the index of the selected format + set ent [$HLIST info selection] + set obj_index [string range $ent 2 [string length $ent]] + + set active_fmt_obj $Page::($page_obj,act_fmt_obj) + + # An error message is popued up, if the format is used by an address + if {$format::($active_fmt_obj,fmt_addr_list) != ""} \ + { + set format_name $format::($active_fmt_obj,for_name) + tk_messageBox -type ok -icon error\ + -message "Format \"$format_name\" is used by the Address. \ + Format cannot be deleted" + return + } + + set Page::($page_obj,fmt_buff_obj_attr) [array get FORMATOBJATTR] + + # Selected format object is deleted from the database + PB_int_FormatCutObject active_fmt_obj obj_index + set fmt_name $FORMATOBJATTR(0) + + # Updates the address summary global variables + UI_PB_fmt_UnsetFmtArr $fmt_name + + # Updates the format page tree elements + UI_PB_fmt_DisplayNameList page_obj obj_index + UI_PB_fmt_FormatDisplayParams page_obj $obj_index + UI_PB_fmt_PackFormatAttr $page_obj +} + +#============================================================================== +# This procedure is executed, when the Paste button in the format page is +# selected. It basically adds the cut format (buffer) to the database. +# +# Inputs : Format Page Object +# +# Outputs : Adds the buffer format object to database +# +#============================================================================== +proc UI_PB_fmt_PasteFormat { page_obj } { +#============================================================================== + global paOption + + # gets the tree widget id from page object + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set obj_index [string range $ent 2 [string length $ent]] + + # if there is no format object in the buffer, it just does nothing + if {![info exists Page::($page_obj,fmt_buff_obj_attr)]} \ + { + return + } + array set fmt_buff_obj_attr $Page::($page_obj,fmt_buff_obj_attr) + + # Data base call, which adds the buffer format object to the database + set temp_index $obj_index + PB_int_FormatPasteObject fmt_buff_obj_attr obj_index + + if {$temp_index != $obj_index } \ + { + # Recreates the tree elements + UI_PB_fmt_DisplayNameList page_obj obj_index + + set fmt_name $fmt_buff_obj_attr(0) + UI_PB_fmt_UpdateFmtArr fmt_buff_obj_attr $fmt_name + + # Updates the ui of active Format + UI_PB_fmt_FormatDisplayParams page_obj $obj_index + UI_PB_fmt_PackFormatAttr $page_obj + } +} + +#============================================================================== +# This procedure is called, when enter(return key) is hit in the format name +# entry widget. This procedure changes the format name and updates +# the database. It pops up an error message, if the format exists. +# +# +# Inputs : Format page object +# +# Outputs : Format name change .. updates database +#============================================================================== +proc UI_PB_fmt_FmtNameEntryCallBack { page_obj } { +#============================================================================== + global FORMATOBJATTR + + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set obj_index [string range $ent 2 [string length $ent]] + + set act_fmt_obj $Page::($page_obj,act_fmt_obj) + set prev_fmt_name $Page::($page_obj,act_fmt_name) + set cur_fmt_name $FORMATOBJATTR(0) + + if {[string compare $prev_fmt_name $cur_fmt_name] != 0} \ + { + # Gets the list of avialbale format objects + PB_fmt_RetFormatObjs fmt_obj_list + + # Checks, if there is any format by that name, returns 0 + # if there is not format by that name. + PB_com_RetObjFrmName cur_fmt_name fmt_obj_list ret_code + + if {$ret_code == 0} \ + { + UI_PB_fmt_UpdateFmtNamesOfTree page_obj prev_fmt_name \ + cur_fmt_name FORMATOBJATTR act_fmt_obj + } else \ + { + tk_messageBox -type ok -icon error\ + -message "Format \"$cur_fmt_name\" exists" + set FORMATOBJATTR(0) $prev_fmt_name + } + } +} + +#============================================================================== +# This procedure is called to update the address summary global variables and +# the database, whenever the format name is changed. +# +# Inputs : Format Page object +# Previous format name +# Current format name +# Current format data +# Selected format object +# +# Ouput : Updates the database +# +#============================================================================== +proc UI_PB_fmt_UpdateFmtNamesOfTree { PAGE_OBJ PREV_FMT_NAME CUR_FMT_NAME \ + CUR_FMT_OBJ_ATTR FMT_OBJ } { +#============================================================================== + upvar $PAGE_OBJ page_obj + upvar $PREV_FMT_NAME prev_fmt_name + upvar $CUR_FMT_NAME cur_fmt_name + upvar $CUR_FMT_OBJ_ATTR cur_fmt_obj_attr + upvar $FMT_OBJ fmt_obj + global gpb_addr_var + + # Deletes the data of the previous format name from the + # global array + UI_PB_fmt_UnsetFmtArr $prev_fmt_name + + # Sets the new format name data + UI_PB_fmt_UpdateFmtArr cur_fmt_obj_attr $cur_fmt_name + set format::($fmt_obj,for_name) $cur_fmt_name + set Page::($page_obj,act_fmt_name) $cur_fmt_name + + # Updates the address summary global variables + set add_obj_list $format::($fmt_obj,fmt_addr_list) + foreach add_obj $add_obj_list \ + { + set add_name $address::($add_obj,add_name) + set gpb_addr_var($add_name,fmt_name) $cur_fmt_name + } + + # Recreates the tree elements + PB_fmt_RetFormatObjs fmt_obj_list + set obj_index [lsearch $fmt_obj_list $fmt_obj] + UI_PB_fmt_DisplayNameList page_obj obj_index +} + +#============================================================================= +# This procedure creates the frames required for the format page. +# +# Inputs : Format Page Object +# +# Output : Frame ids are stored as attributes of page object +# +#============================================================================= +proc UI_PB_fmt_CreateFmtFrames { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + + set canvas_frame $Page::($page_obj,canvas_frame) + + # Creates the top frame + set top_frame [tixButtonBox $canvas_frame.top \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg gray85] + + set Page::($page_obj,top_frame) $top_frame + + # Creates the middle frame + set middle_frame [frame $canvas_frame.mid] + set Page::($page_obj,middle_frame) $middle_frame + + # Creates the bottom frame + set bottom_frame [frame $canvas_frame.bot] + set Page::($page_obj,bottom_frame) $bottom_frame + + pack $top_frame -side top -fill x -padx 3 -pady 3 + pack $middle_frame -side top -fill both -pady 30 + pack $bottom_frame -side bottom -fill x +} + +#============================================================================= +# This procedure creates the widgets in the top frame. It creates a flat +# Button to display the formatted value of the selected format. +# +# Inputs : Format Page Object +# +# Outputs : Stores the button id as a attribute of page object +# +#============================================================================= +proc UI_PB_fmt_CreateFmtDisplay { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global tixOption + global paOption + + # Gets the top framr from the page object + set top_frame $Page::($page_obj,top_frame) + + # Creates the button + global forget_flag + button $top_frame.fmt -text "" -cursor "" \ + -font $tixOption(bold_font) \ + -bg darkSeaGreen3 -relief flat \ + -state disabled -disabledforeground lightYellow + grid $top_frame.fmt -row 1 -column 1 -pady 10 + + set forget_flag 0 + $top_frame.fmt configure -activebackground darkSeaGreen3 + + # Displays the formatted value of the selected format on the button + UI_PB_fmt__ConfigureFmtDisplay $page_obj +} + +#============================================================================== +# Creates all the widgets, to display the data of the formats. +# +# Inputs : Format Page Object +# +# Outputs : The widget ids are stored as the attributes of +# page object. +# +#============================================================================== +proc UI_PB_fmt_AddPageFmtParm { PAGE_OBJ } { +#============================================================================== + upvar $PAGE_OBJ page_obj + global tixOption + global paOption + global FORMATOBJATTR + + set fch $Page::($page_obj,middle_frame) + + # Creates the entry to display the format name + tixLabelEntry $fch.nam -label "Format Name: " \ + -options { + entry.width 20 + entry.anchor w + label.anchor w + entry.textVariable FORMATOBJATTR(0) + } + set fch_entry [$fch.nam subwidget entry] + bind $fch_entry "UI_PB_fmt_FmtNameEntryCallBack $page_obj" + set Page::($page_obj,fmt_name_widget) $fch.nam + + # Creates the label frames, to display the data type of format + tixLabelFrame $fch.typ -label "Data Type" + set frm1 [$fch.typ subwidget frame] + set Page::($page_obj,fmt_data_widget) $frm1 + + # Creates the label frames, to display the attributes of data type + tixLabelFrame $fch.pad -label "Padding" + set frm2 [$fch.pad subwidget frame] + set Page::($page_obj,fmt_pad_widget) $frm2 + + set frm3 [frame $fch.ent] + set Page::($page_obj,data_ent_widget) $frm3 + + # Creates the check button + global pls_sel + checkbutton $fch.pls -text "Output Leading Plus Sign (+)" \ + -variable FORMATOBJATTR(2) \ + -relief flat -bd 2 -pady 0 -anchor w \ + -command " UI_PB_fmt__ConfigureFmtDisplay $page_obj " + + set Page::($page_obj,lead_plus_widget) $fch.pls + + grid $fch.nam - -pady 10 -sticky nw + grid $fch.typ -row 1 -column 0 -pady 25 -sticky nw + grid $fch.ent -row 1 -column 1 -sticky w + grid $fch.pls - -sticky nw + grid columnconfig $fch 1 -minsize 180 + + pack $fch -side top -pady 30 -fill both + + # Creates radio buttons for data type + UI_PB_fmt_CreateDataTypes page_obj + + # Creates trailing & leading zeros widgets + UI_PB_fmt_CreatePaddingElements page_obj + + # Creates the Data type attributes + UI_PB_fmt_CreateDataElements page_obj +} + +#=============================================================================== +# This procedure creates the widgets for data types of a format +# +# Inputs : Format Page Object +# +# Outputs : The widget ids are stored as the attributes of +# page object. +# +#=============================================================================== +proc UI_PB_fmt_CreateDataTypes { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global typ_sel + global typ_sel_old + global FORMATOBJATTR + + set frm1 $Page::($page_obj,fmt_data_widget) + set b 0 + set typ_sel_old $FORMATOBJATTR(1) + + foreach typ {Real\ Number Integer Text\ String} \ + { + radiobutton $frm1.$b -text $typ \ + -variable FORMATOBJATTR(1) \ + -relief flat -value $typ -bd 2 -width 15 -anchor w \ + -command "UI_PB_fmt_PackFormatAttr $page_obj" + + pack $frm1.$b -side top -anchor w -padx 6 + incr b + } +} + +#============================================================================== +# This procedures creates the trailing and leading widgets. It packs them +# based upon the type of data. It packs leading widget, if it is an integer +# and packs both leading and trailing widgets, if it is a Real number. +# +# Inputs : Format Page Object +# +# Outputs : Packs the valid widgets +# +#============================================================================== +proc UI_PB_fmt_CreatePaddingElements { PAGE_OBJ } { +#============================================================================== + upvar $PAGE_OBJ page_obj + global pad_sel pad_selb + global FORMATOBJATTR + + set frm2 $Page::($page_obj,fmt_pad_widget) + + # Fill in details for Padding frame + # -- Contents vary per data type selected. + + # Real Number + + checkbutton $frm2.r_lead -text "Leading Zeros" \ + -command " UI_PB_fmt__ConfigureFmtDisplay $page_obj " \ + -variable FORMATOBJATTR(3) \ + -relief flat -bd 2 -anchor w -padx 10 -width 15 + + checkbutton $frm2.r_tral -text "Trailing Zeros" \ + -command " UI_PB_fmt__ConfigureFmtDisplay $page_obj " \ + -variable FORMATOBJATTR(4) \ + -relief flat -bd 2 -anchor w -padx 10 -width 15 + + + # Integer + + checkbutton $frm2.i_lead -text "Leading Zeros" \ + -command " UI_PB_fmt__ConfigureFmtDisplay $page_obj " \ + -variable FORMATOBJATTR(3) \ + -relief flat -bd 2 -anchor w -padx 10 -width 15 + + + switch -exact -- $FORMATOBJATTR(1) { + + "Real Number" { + + pack $frm2.r_lead $frm2.r_tral -side top -anchor w + } + + "Integer" { + + pack $frm2.i_lead -side top -anchor w + set pad_sel "None" + } + + "Text String" { + + grid forget $Page::($page_obj,fmt_pad_widget) + grid forget $Page::($page_obj,lead_plus_widget) + } + } +} + +#============================================================================= +# This procedure creates the widgets of the data type. If the data type +# is integer .. it creates only one tixcontrol widgets to accept the no +# of digits. If it is real number, then it creates two tixcontrols to +# accept the no of digits before and after the decimal point. If it is +# a string it doesn't create any widgets. +# +# Inputs : Format Page Object +# +# Outputs : Valid data type attributes +# +#============================================================================= +proc UI_PB_fmt_CreateDataElements { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global paOption + global FORMATOBJATTR + + # Control buttons + set frm3 $Page::($page_obj,data_ent_widget) + set fch $Page::($page_obj,middle_frame) + set f4 [frame $frm3.f] + + set callback " UI_PB_fmt__ConfigureFmtDisplay $page_obj " + + # Integer control + tixControl $f4.a -integer true \ + -command $callback \ + -selectmode immediate \ + -variable FORMATOBJATTR(5) \ + -options { + entry.width 4 + label.anchor e + } + + # Decimal point + label $f4.lab -text "." + + # Fraction control + tixControl $f4.b -integer true \ + -command $callback \ + -selectmode immediate \ + -variable FORMATOBJATTR(7) \ + -min 0 -max 99 \ + -options { + entry.width 4 + label.anchor e + } + + grid $f4.a $f4.lab $f4.b + + checkbutton $frm3.dec -text "Output Decimal Point (.)" \ + -command $callback \ + -variable FORMATOBJATTR(6) \ + -relief flat -bd 2 -pady 0 -anchor w + + tixControl $frm3.c -integer true \ + -command $callback \ + -selectmode immediate \ + -variable FORMATOBJATTR(5) \ + -min 0 -max 99 \ + -options { + entry.width 4 + label.anchor e + } + + # Flaten the entries + $f4.a.frame.entry config -relief flat + $f4.b.frame.entry config -relief flat + $frm3.c.frame.entry config -relief flat + + # Sunken the frames + $f4.a.frame config -relief sunken -bd 1 + $f4.b.frame config -relief sunken -bd 1 + $frm3.c.frame config -relief sunken -bd 1 + + # Place control buttons to the left of the entry + pack $f4.a.frame.entry -side right + pack $f4.a.frame.incr -side top + pack $f4.a.frame.decr -side bottom + + pack $frm3.c.frame.entry -side right + pack $frm3.c.frame.incr -side top + pack $frm3.c.frame.decr -side bottom + + # Packs the widgets based upon the data type of the format + switch -exact -- $FORMATOBJATTR(1) { + + "Real Number" { + pack $f4 $frm3.dec -side top -pady 5 -anchor w + grid $fch.pad -pady 20 -sticky nw + } + + "Integer" { + pack $frm3.c -side top -pady 5 -anchor w + grid $fch.pad -pady 20 -sticky nw + } + + "Text String" { + } + } +} + +#============================================================================ +# This procedure creates the action buttons in the bottom frame. +# +# Inputs : Format Page Object +# +# Outputs : Valid data type attributes +# +#============================================================================ +proc UI_PB_fmt_CreateActionButtons { PAGE_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + global paOption + + set tree $Page::($page_obj,tree) + set ff $Page::($page_obj,bottom_frame) + + # Buttons + set bb [tixButtonBox $ff.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + $bb add def -text Default -width 10 -underline 0 -command \ + "UI_PB_fmt_DefaultCallBack $page_obj" + $bb add app -text Restore -underline 0 -width 10 -command \ + "UI_PB_fmt_RestoreCallBack $page_obj" + + pack $bb -fill x -padx 3 -pady 3 +} + +#============================================================================= +# This procedure unsets the attributes of a format, in the global variable +# gpb_fmt_var. which is used in address summary page. +# +# Inputs : Format name +# +# Outputs : updates the global variable gpb_fmt_var +# +#============================================================================= +proc UI_PB_fmt_UnsetFmtArr { fmt_name } { +#============================================================================= + global gpb_fmt_var + + unset gpb_fmt_var($fmt_name,name) + unset gpb_fmt_var($fmt_name,dtype) + unset gpb_fmt_var($fmt_name,plus_status) + unset gpb_fmt_var($fmt_name,lead_zero) + unset gpb_fmt_var($fmt_name,trailzero) + unset gpb_fmt_var($fmt_name,integer) + unset gpb_fmt_var($fmt_name,decimal) + unset gpb_fmt_var($fmt_name,fraction) +} + +#============================================================================= +# This procedure stores the attributes of a format, in the global variable +# gpb_fmt_var. which is used in address summary page. +# +# Inputs : Format Attributes +# Format name +# +# Outputs : updates the global variable gpb_fmt_var +# +#============================================================================= +proc UI_PB_fmt_UpdateFmtArr { TEMP_FMT_ARR fmt_name } { +#============================================================================= + upvar $TEMP_FMT_ARR temp_fmt_arr + global gpb_fmt_var + + set gpb_fmt_var($fmt_name,name) $temp_fmt_arr(0) + set gpb_fmt_var($fmt_name,dtype) $temp_fmt_arr(1) + set gpb_fmt_var($fmt_name,plus_status) $temp_fmt_arr(2) + set gpb_fmt_var($fmt_name,lead_zero) $temp_fmt_arr(3) + set gpb_fmt_var($fmt_name,trailzero) $temp_fmt_arr(4) + set gpb_fmt_var($fmt_name,integer) $temp_fmt_arr(5) + set gpb_fmt_var($fmt_name,decimal) $temp_fmt_arr(6) + set gpb_fmt_var($fmt_name,fraction) $temp_fmt_arr(7) +} + +#============================================================================= +# This procedure updates the data of the current format in the database. +# It also updates the address summary global variables. +# +# Inputs : format page object +# +# Outputs : updates address summary global variables and database +# +#============================================================================= +proc UI_PB_fmt_ApplyCurrentFmtData { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global FORMATOBJATTR + + if {[info exists Page::($page_obj,act_fmt_obj)]} \ + { + set act_fmt_obj $Page::($page_obj,act_fmt_obj) + if {[string compare $FORMATOBJATTR(1) "Integer"] == 0} \ + { + set FORMATOBJATTR(4) 0 + set FORMATOBJATTR(6) 0 + set FORMATOBJATTR(7) 0 + } + # updates the database + format::setvalue $act_fmt_obj FORMATOBJATTR + + set fmt_name $FORMATOBJATTR(0) + + # Updates the global variables + UI_PB_fmt_UpdateFmtArr FORMATOBJATTR $fmt_name + } +} +#============================================================================= +# This procedure updates the data of the selected format in the database. +# It also updates the address summary global variables. +# +# Inputs : format page object +# +# Outputs : updates address summary global variables and database +# +#============================================================================= +proc UI_PB_fmt_ApplyFormat { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global FORMATOBJATTR + if {[info exists Page::($page_obj,act_fmt_obj)]} \ + { + UI_PB_fmt_ApplyCurrentFmtData page_obj + unset Page::($page_obj,act_fmt_obj) + unset Page::($page_obj,act_fmt_name) + } +} + +#============================================================================= +# This procedure is called, when the default button in the format page is +# selected. It basically changes the format data to default data. +# +# Inputs : Format Page Object +# +# Outputs : Defualt format data +# +#============================================================================= +proc UI_PB_fmt_DefaultCallBack { page_obj } { +#============================================================================= + global FORMATOBJATTR + set act_fmt_obj $Page::($page_obj,act_fmt_obj) + array set temp_fmt_obj_attr $format::($act_fmt_obj,def_value) + set prev_fmt_name $Page::($page_obj,act_fmt_name) + set cur_fmt_name $temp_fmt_obj_attr(0) + + if {[string compare $prev_fmt_name $cur_fmt_name] != 0} \ + { + # Sets format name to default name and updates the tree elements + UI_PB_fmt_UpdateFmtNamesOfTree page_obj prev_fmt_name cur_fmt_name \ + temp_fmt_obj_attr act_fmt_obj + } else \ + { + UI_PB_fmt_UpdateFmtArr temp_fmt_obj_attr $cur_fmt_name + } + + # Based upon the format data type, packs the required widgets + UI_PB_fmt_SetFormatAttr $page_obj + UI_PB_fmt_PackFormatAttr $page_obj +} + +#============================================================================= +# This procedure is called, when the Restore button in the format page is +# selected. It basically changes the format data to the previously applied +# format data. +# +# Inputs : Format Page Object +# +# Outputs : Defualt format data +# +#============================================================================= +proc UI_PB_fmt_RestoreCallBack { page_obj } { +#============================================================================= + global FORMATOBJATTR + array set rest_formatobjattr $Page::($page_obj,rest_formatobjattr) + set prev_fmt_name $Page::($page_obj,act_fmt_name) + set cur_fmt_name $rest_formatobjattr(0) + set act_fmt_obj $Page::($page_obj,act_fmt_obj) + + if {[string compare $prev_fmt_name $cur_fmt_name] != 0} \ + { + # Sets the format name to restore name and updates the tree elements + UI_PB_fmt_UpdateFmtNamesOfTree page_obj prev_fmt_name cur_fmt_name \ + rest_formatobjattr act_fmt_obj + } else \ + { + UI_PB_fmt_UpdateFmtArr rest_formatobjattr $cur_fmt_name + } + + # Based upon the format data type, packs the required widgets + UI_PB_fmt_SetFormatAttr $page_obj + UI_PB_fmt_PackFormatAttr $page_obj +} + +#============================================================================= +# This procedure packs the valid widgets based upon the data type of a +# format. +# +# Inputs : Format Page Object +# +# Outputs : Valid data type widgets +# +#============================================================================= +proc UI_PB_fmt_PackFormatAttr {page_obj} { +#============================================================================= + global FORMATOBJATTR typ_sel_old + + set fch $Page::($page_obj,middle_frame) + set frm2 $Page::($page_obj,fmt_pad_widget) + set frm3 $Page::($page_obj,data_ent_widget) + + # Unpack + switch -exact -- $typ_sel_old { + + "Real Number" { + + pack forget $frm2.r_lead $frm2.r_tral + pack forget $frm3.f $frm3.dec + grid forget $fch.pad + grid forget $fch.pls + } + + "Integer" { + pack forget $frm2.i_lead + pack forget $frm3.c + grid forget $fch.pad + grid forget $fch.pls + } + + "Text String" { + grid forget $fch.pad + grid forget $fch.pls + } + } + + # Repack + switch -exact -- $FORMATOBJATTR(1) { + + "Real Number" { + pack $frm2.r_lead $frm2.r_tral -side top -anchor w + pack $frm3.f $frm3.dec -side top -pady 5 -anchor w + grid $fch.pls - -sticky nw + grid $fch.pad -pady 20 -sticky nw + set FORMATOBJATTR(6) 1 + } + + "Integer" { + pack $frm2.i_lead -side top -anchor w + pack $frm3.c -side top -pady 5 -padx 15 -anchor w + grid $fch.pls - -sticky nw + grid $fch.pad -pady 20 -sticky nw + } + + "Text String" { +# pack $frm2.s_none $frm2.s_left $frm2.s_rght -side top -anchor w + } + } + + set typ_sel_old $FORMATOBJATTR(1) + UI_PB_fmt__ConfigureFmtDisplay $page_obj +} + +#============================================================================= +# This is a callback procedure, attached to the tree elements i.e format names +# It displays the data of the selected format. +# +# Inputs : Format Page object +# +# Outputs : Displays Format data +# +#============================================================================= +proc UI_PB_fmt_FormatItemSelec {page_obj args} { +#============================================================================= + # Gets the tree widget id + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + + # Gets the index of the selected format + set ent [$HLIST info selection] + set index [string range $ent 2 [string length $ent]] + if {[string compare $index ""] == 0} \ + { + set index 0 + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.0 + $HLIST anchor set 0.0 + } + + # Updates the previous format data + UI_PB_fmt_ApplyFormat page_obj + + # Displays the selected format data + UI_PB_fmt_FormatDisplayParams page_obj $index + UI_PB_fmt_PackFormatAttr $page_obj +} + +#============================================================================= +# This procedure gets the format object from the database, based upon the +# selected format index. +# +# Inputs : Format Page Object +# Selected format index +# +# Outputs : Displays the selected format data +# +#============================================================================= +proc UI_PB_fmt_FormatDisplayParams { PAGE_OBJ index } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global FORMATOBJATTR + + if {$index >= 0} \ + { + # returns the format object list + PB_int_RetFormatObjList fmt_obj_list + + set fmt_obj [lindex $fmt_obj_list $index] + set Page::($page_obj,act_fmt_obj) $fmt_obj + set Page::($page_obj,act_fmt_name) $format::($fmt_obj,for_name) + + UI_PB_fmt_SetFormatAttr $page_obj + if {[info exists Page::($page_obj,rest_formatobjattr)]} \ + { + unset Page::($page_obj,rest_formatobjattr) + } + set Page::($page_obj,rest_formatobjattr) [array get FORMATOBJATTR] + } +} + +#======================================================================== +# Thsi procedures gets the format data from the address summary +# global variables. +# +# Inputs : Format Page Object +# global variable gpb_fmt_var +# +# Outputs : format data is set to the global variable +# FORMATOBJATTR +# +#======================================================================== +proc UI_PB_fmt_SetFormatAttr { page_obj } { +#======================================================================== + global FORMATOBJATTR + global gpb_fmt_var + + set fmt_name $Page::($page_obj,act_fmt_name) + set FORMATOBJATTR(0) $gpb_fmt_var($fmt_name,name) + set FORMATOBJATTR(1) $gpb_fmt_var($fmt_name,dtype) + set FORMATOBJATTR(2) $gpb_fmt_var($fmt_name,plus_status) + set FORMATOBJATTR(3) $gpb_fmt_var($fmt_name,lead_zero) + set FORMATOBJATTR(4) $gpb_fmt_var($fmt_name,trailzero) + set FORMATOBJATTR(5) $gpb_fmt_var($fmt_name,integer) + set FORMATOBJATTR(6) $gpb_fmt_var($fmt_name,decimal) + set FORMATOBJATTR(7) $gpb_fmt_var($fmt_name,fraction) +} + +#============================================================================= +# This procedure displays the formatted value, based upon the selected +# format, on the button. +# +# Inputs : Format Page Object +# +# Outputs : displays formatted value +# +#============================================================================= +proc UI_PB_fmt__ConfigureFmtDisplay { page_obj args } { +#============================================================================= + global fmt_dis_attr + global FORMATOBJATTR + + if {[string compare $FORMATOBJATTR(1) "Integer"] == 0} \ + { + set FORMATOBJATTR(4) 0 + set FORMATOBJATTR(6) 0 + set FORMATOBJATTR(7) 0 + } + + PB_int_GetFormat FORMATOBJATTR fmt_value + set fmt_dis_attr $fmt_value + set top_frame $Page::($page_obj,top_frame) + $top_frame.fmt configure -text $fmt_dis_attr +} + +#============================================================================= +# This procedure creates the format page. +# +# Inputs : Format Page Object +# +# Outputs : Format Page Widgets +# +#============================================================================= +proc UI_PB_fmt_CreateFmtPage { fmt_obj frame } { +#============================================================================= + global FORMATOBJATTR + global paOption + + format::readvalue $fmt_obj FORMATOBJATTR + + set win [toplevel $frame.fmt] + + UI_PB_com_CreateTransientWindow $win "FORMAT : $FORMATOBJATTR(0)" "" "" "" + + set pname $FORMATOBJATTR(0) + set new_fmt_page [new Page $pname $pname] + set Page::($new_fmt_page,canvas_frame) $win + set Page::($new_fmt_page,act_fmt_obj) $fmt_obj + set Page::($new_fmt_page,act_fmt_name) $FORMATOBJATTR(0) + set Page::($new_fmt_page,rest_formatobjattr) [array get FORMATOBJATTR] + + # Divides the main frame into three + UI_PB_fmt_CreateFmtFrames new_fmt_page + + # Create format display widget + UI_PB_fmt_CreateFmtDisplay new_fmt_page + + # Create format components in the right frame + UI_PB_fmt_AddPageFmtParm new_fmt_page + + # Creates the Action buttons + set ff $Page::($new_fmt_page,bottom_frame) + set box1_frm [frame $ff.box1] + set box2_frm [frame $ff.box2] + + tixForm $box1_frm -top 0 -left 1 -right %50 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 1 -right %100 + + set bb1 [tixButtonBox $box1_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + set bb2 [tixButtonBox $box2_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + $bb1 add def -text Default -width 10 -underline 0 -command \ + "UI_PB_fmt_DefaultCallBack $new_fmt_page" + $bb1 add rest -text Restore -underline 0 -width 10 -command \ + "UI_PB_fmt_RestoreCallBack $new_fmt_page" + + $bb2 add app -text Cancel -underline 0 -width 10 -command \ + "UI_PB_fmt_CancelCallBack $new_fmt_page $win" + $bb2 add def -text Ok -width 10 -underline 0 -command \ + "UI_PB_fmt_OkCallBack $new_fmt_page $win" + + pack $bb1 -fill x + pack $bb2 -fill x +} + +#============================================================================= +# This procedure updates the format object +# +# Inputs : Format Page Object +# +# Outputs : Updates the format object +# +#============================================================================= +proc UI_PB_fmt_OkCallBack { fmt_page_obj win} { +#============================================================================= + UI_PB_fmt_ApplyCurrentFmtData fmt_page_obj + + destroy $win + + # Unset the new format page data +} + +#============================================================================= +# This procedure destroys the fmt page +# +# Inputs : Format Page Object +# +# +#============================================================================= +proc UI_PB_fmt_CancelCallBack { fmt_page_obj win } { +#============================================================================= + destroy $win + + # Unset the new format page data +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_gcode.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_gcode.tcl new file mode 100644 index 0000000..5e04fce --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_gcode.tcl @@ -0,0 +1,180 @@ +#============================================================================== +# UI_PB_GCODE.TCL +#============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Gcodes page. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-Apr-1999 mnb Attached callbacks to action buttons # +# 06-May-1999 gsl Removed redundant frames. # +# 02-Jun-1999 mnb Code Integration # +# 07-Sep-1999 mnb Validates the data entered in the entry widget, # +# based upon the address format # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================== +proc UI_PB_ProgTpth_Gcode {book_id page_obj} { +#============================================================================== + global paOption + set Page::($page_obj,page_id) [$book_id subwidget \ + $Page::($page_obj,page_name)] + set page_id $Page::($page_obj,page_id) + + PB_int_GCodePageAttributes g_codes_desc g_codes_mom_var + set Page::($page_obj,g_codes_mom_var) [array get g_codes_mom_var] + set no_gcodes [array size g_codes_mom_var] + + set top_frm [tixScrolledWindow $page_id.top -height 525 -scrollbar auto] + set act_frm [frame $page_id.actfm] + pack $act_frm -side bottom -fill both -expand yes + pack $top_frm -side top -expand yes -padx 3 + + [$top_frm subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$top_frm subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + + set gcode_frm [$top_frm subwidget window] + + # Creates Action buttons + UI_PB_gcd_CreateActionButtons $act_frm page_obj + + set no_row_gcodes [expr $no_gcodes / 2] + if {[expr $no_gcodes %2] > 0} \ + { + incr no_row_gcodes + } + + set first_col [frame $gcode_frm.fst -relief sunken -bd 3] + set second_col [frame $gcode_frm.sec -relief sunken -bd 3] + + set Page::($page_obj,gcode_col1) $first_col + set Page::($page_obj,gcode_col2) $second_col + + tixForm $first_col -padleft 5 -padtop 5 -padbottom 5 + tixForm $second_col -left $first_col -padleft 5 -padright 5 -padtop 5 -padbottom 5 + + set data_type "a" + for {set count 0} {$count < $no_row_gcodes} {incr count} \ + { + UI_PB_com_CreateRowAttr $first_col $count $g_codes_desc($count) \ + $g_codes_mom_var($count) $data_type + } + + for {set count $no_row_gcodes} {$count < $no_gcodes} {incr count} \ + { + UI_PB_com_CreateRowAttr $second_col $count $g_codes_desc($count) \ + $g_codes_mom_var($count) $data_type + } +} + +#=============================================================================== +proc UI_PB_gcd_RestoreGcodeData { page_obj } { +#=============================================================================== + global mom_sys_arr + array set gcode_vars $Page::($page_obj,g_codes_mom_var) + set no_gcodes [array size gcode_vars] + + set no_row_gcd [expr $no_gcodes / 2] + if { [expr $no_gcodes % 2] } { incr no_row_gcd } + + set data_type a + set gcode_frm $Page::($page_obj,gcode_col1) + set row_no 0 + for {set count 0} {$count < $no_gcodes} {incr count} \ + { + set gcode_var $gcode_vars($count) + set rest_gcode_var_value($gcode_var) $mom_sys_arr($gcode_var) + if { $row_no == $no_row_gcd } \ + { + set gcode_frm $Page::($page_obj,gcode_col2) + } + + set data_type [UI_PB_com_RetSysVarDataType gcode_var] + set mom_sys_arr($gcode_var) [UI_PB_com_RetValByDataType \ + $mom_sys_arr($gcode_var) $data_type] + bind $gcode_frm.$row_no.1_int "UI_PB_com_ValidateDataOfEntry \ + %W %K $data_type" + incr row_no + } + + if {[info exists rest_gcode_var_value]} \ + { + set Page::($page_obj,rest_gcode_var_value) \ + [array get rest_gcode_var_value] + } +} + +#=============================================================================== +proc UI_PB_gcd_CreateActionButtons { act_frm PAGE_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global paOption + set box [tixButtonBox $act_frm.act \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + + pack $box -side bottom -fill x -padx 3 -pady 3 + + $box add def -text Default -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_gcd_DefaultCallBack $page_obj" + $box add res -text Restore -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_gcd_RestoreCallBack $page_obj" +} + +#========================================================================= +proc UI_PB_gcd_DefaultCallBack { page_obj } { +#========================================================================= + global mom_sys_arr + + array set gcode_vars $Page::($page_obj,g_codes_mom_var) + PB_int_RetDefMOMVarValues gcode_vars def_gcode_value + + set no_gcodes [array size gcode_vars] + for {set count 0} { $count < $no_gcodes } { incr count} \ + { + set mom_var $gcode_vars($count) + + set data_type [UI_PB_com_RetSysVarDataType mom_var] + set mom_sys_arr($mom_var) [UI_PB_com_RetValByDataType \ + $def_gcode_value($mom_var) $data_type] + } +} + +#========================================================================= +proc UI_PB_gcd_RestoreCallBack { page_obj } { +#========================================================================= + global mom_sys_arr + + array set rest_gcode_var_value $Page::($page_obj,rest_gcode_var_value) + array set gcode_vars $Page::($page_obj,g_codes_mom_var) + + set no_gcodes [array size gcode_vars] + for {set count 0} { $count < $no_gcodes } { incr count} \ + { + set mom_var $gcode_vars($count) + set data_type [UI_PB_com_RetSysVarDataType mom_var] + set mom_sys_arr($mom_var) [UI_PB_com_RetValByDataType \ + $rest_gcode_var_value($mom_var) $data_type] + } +} + +#========================================================================= +proc UI_PB_gcd_ApplyGcodeData { book_obj page_obj } { +#========================================================================= + global mom_sys_arr + + PB_int_UpdateMOMVar mom_sys_arr +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_list.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_list.tcl new file mode 100644 index 0000000..2098e79 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_list.tcl @@ -0,0 +1,234 @@ +#============================================================================= +# UI_PB_LIST.TCL +#============================================================================= +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Listing file page. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 12-May-1999 gsl Eliminated redundant frames in AddListPage. # +# 02-Jun-1999 mnb Code Integration # +# 14-Jun-1999 mnb Removed Apply Action button # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#***************************************************************************** +proc UI_PB_List { book_id list_page_obj } { +#***************************************************************************** + global tixOption + + AddListPage [$book_id subwidget $Page::($list_page_obj,page_name)] 0 +} + +#============================================================================= +proc AddListPage {w n} { +#============================================================================= + global tixOption + global paOption + global ListObjectList + global ListObjectAttr + + set ff [frame $w.ff -relief sunken -bd 1] + pack $ff -side top -expand yes -fill both -padx 5 + + set f [frame $ff.f] + pack $f -side top -pady 30 + + set bb [tixButtonBox $w.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + pack $bb -fill x -padx 5 -pady 5 + + + set list [frame $f.1] + set nam [frame $f.2] + set g1 [frame $f.3 ] + set g2 [frame $f.4 ] + set g3 [frame $f.5 ] + set g4 [frame $f.6 ] + + checkbutton $list.lisflg -text "Generate Listing File" \ + -variable ListObjectAttr(listfile) \ + -relief flat -font $tixOption(bold_font) \ + -bd 2 -anchor w -padx 6 + + tixLabelEntry $nam.fnm -label "File Name" \ + -options { + entry.width 30 + entry.anchor e + label.anchor w + entry.textVariable ListObjectAttr(fname) + } + + + tixLabelFrame $g1.param -label "List of Parameters" + tixLabelFrame $g2.fmt -label "Page Format" + tixLabelFrame $g2.warn -label "Warning" + tixLabelFrame $g3.head -label "Program Header" + tixLabelFrame $g3.foot -label "Program Footer" + tixLabelFrame $g4.body -label "Operator Messages" + + + # CALL BACK FUNCTIONS + $list.lisflg config -command \ + "UI_PB_lst__SetCheckButtonState $nam.fnm ListObjectAttr(listfile)" + + pack $list.lisflg + pack $nam.fnm + pack $g1.param + pack $g2.fmt -side top + pack $g2.warn -side bottom + pack $g3.head -side top + pack $g3.foot -side bottom + pack $g4.body -fill both + + grid $list -row 0 -column 0 -padx 10 -pady 20 -sticky nw + grid $nam -row 0 -column 1 -padx 10 -pady 20 -sticky nw + grid $g1 -row 1 -column 0 -padx 10 -pady 10 -sticky nw + grid $g2 -row 1 -column 1 -padx 10 -pady 10 -sticky ns + grid $g3 -row 2 -column 0 -padx 10 -sticky nw + grid $g4 -row 2 -column 1 -padx 10 -sticky ns + + set f1 [$g1.param subwidget frame] + set f2 [$g2.fmt subwidget frame] + set f3 [$g2.warn subwidget frame] + set f4 [$g3.head subwidget frame] + set f5 [$g4.body subwidget frame] + set f6 [$g3.foot subwidget frame] + + grid columnconfig $f 1 -minsize 180 + +#--- Parameters list + + checkbutton $f1.x -text "X-Coordinate" -variable ListObjectAttr(x) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f1.y -text "Y-Coordinate" -variable ListObjectAttr(y) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f1.z -text "Z-Coordinate" -variable ListObjectAttr(z) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f1.4a -text "4th Axis Angle" -variable ListObjectAttr(4axis) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f1.5a -text "5th Axis Angle" -variable ListObjectAttr(5axis) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f1.fed -text "Feed" -variable ListObjectAttr(feed) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f1.spd -text "Speed" -variable ListObjectAttr(speed) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + pack $f1.x $f1.y $f1.z $f1.4a $f1.5a $f1.fed $f1.spd -side top \ + -anchor w + +#---- Page Format + + checkbutton $f2.hed -text "Print Page Header" \ + -variable ListObjectAttr(head) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + tixLabelEntry $f2.row -label "Page Length (Rows)" \ + -options { + label.width 20 + label.anchor w + entry.width 10 + entry.anchor e + entry.textVariable ListObjectAttr(lines) + } + + [$f2.row subwidget label] config -font $tixOption(font) + + tixLabelEntry $f2.col -label "Page Width (Columns)" \ + -options { + label.width 20 + label.anchor w + entry.width 10 + entry.anchor e + entry.textVariable ListObjectAttr(column) + } + + [$f2.col subwidget label] config -font $tixOption(font) + + pack $f2.hed -side top + pack $f2.row -side top -fill x -padx 10 -pady 5 + pack $f2.col -side top -fill x -padx 10 -pady 3 + + +#----- Warnings + + checkbutton $f3.warn -text "Suppress all Warnings" \ + -variable ListObjectAttr(warn) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + pack $f3.warn -side top -anchor w + +#------- Program Header + + checkbutton $f4.oper -text "Operation List" \ + -variable ListObjectAttr(oper) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f4.tool -text "Tool List" \ + -variable ListObjectAttr(tool) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + pack $f4.oper $f4.tool -side top -anchor w + +#--------- Operator Messages + + checkbutton $f5.strt -text "Start Of Path" \ + -variable ListObjectAttr(start_path) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f5.chng -text "Tool Change" \ + -variable ListObjectAttr(tool_chng) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f5.end -text "End Of Path" \ + -variable ListObjectAttr(end_path) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + checkbutton $f5.time -text "Machining Time" \ + -variable ListObjectAttr(oper_time) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + pack $f5.strt $f5.chng $f5.end $f5.time -side top -anchor w + +#--------- Program Footer + + checkbutton $f6.time -text "Total Machining Time" \ + -variable ListObjectAttr(setup_time) \ + -relief flat -bd 2 -anchor w -padx 6 -width 30 + + pack $f6.time -side top -anchor w + + + + $bb add def -text Default -underline 0 -width 10 -command \ + "DefListObjAttr ListObjectList ListObjectAttr" + $bb add res -text Restore -underline 0 -width 10 -command \ + "RestoreListObjAttr ListObjectList ListObjectAttr" + + UI_PB_lst__SetCheckButtonState $nam.fnm ListObjectAttr(listfile) +} + +#============================================================================= +proc UI_PB_lst__SetCheckButtonState {widget STATE} { +#============================================================================= + upvar $STATE state + switch $state\ + { + 0 {$widget config -state disabled} + 1 {$widget config -state normal} + } +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_machine.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_machine.tcl new file mode 100644 index 0000000..49131e2 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_machine.tcl @@ -0,0 +1,1793 @@ +#=============================================================================== +# UI_PB_MACHINETOOL.TCL +#=============================================================================== +################################################################################ +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Machine Tool Book. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 gsl Initial # +# 01-Jun-1999 gsl Consolidated assignments for rotary axes with # +# 02-Jun-1999 mnb V16 p.11 code Integration # +# 08-Jun-1999 mnb Added mom kin variables # +# 10-Jun-1999 mnb Attached callbacks to rotary axis configuration # +# window # +# 13-Jun-1999 mnb Attached callbacks to Action buttons # +# 29-Jun-1999 mnb Updates machine tool image # +# 07-Sep-1999 mnb Changed entry widget attributes # +# 18-Oct-1999 gsl Added setTolState. # +# 19-Oct-1999 gsl Manage the image window correctly. # +# 03-Nov-1999 gsl Added UI_PB_mach_DisableWindow & # +# UI_PB_mach_EnableWindow. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +################################################################################ + +#=============================================================================== +proc UI_PB_mach_DisableWindow { args } { +#=============================================================================== + global machData machTree + global gPB + + set h [$machTree subwidget hlist] + + #*************************** + # Retrieve some font styles + #*************************** + set sty_n $gPB(font_style_normal) + set sty_ng $gPB(font_style_normal_gray) + + #*************************************************** + # Disable everything, then enable the selected item. + #*************************************************** + $h entryconfig 0.0 -state disabled -style $sty_ng + + switch $machData(1) \ + { + "4-Axis" \ + { + $h entryconfig 0.1 -state disabled -style $sty_ng + } + + "5-Axis" \ + { + $h entryconfig 0.1 -state disabled -style $sty_ng + $h entryconfig 0.2 -state disabled -style $sty_ng + } + } + + set anc [$h info anchor] + $h entryconfig $anc -state normal -style $sty_n +} + +#=============================================================================== +proc UI_PB_mach_EnableWindow { args } { +#=============================================================================== + global machData machTree + global gPB + + set h [$machTree subwidget hlist] + + #*************************** + # Retrieve some font styles + #*************************** + set sty_n $gPB(font_style_normal) + set sty_ng $gPB(font_style_normal_gray) + + #******************* + # Enable everything. + #******************* + $h entryconfig 0.0 -state normal -style $sty_n + + switch $machData(1) \ + { + "4-Axis" \ + { + $h entryconfig 0.1 -state normal -style $sty_n + } + + "5-Axis" \ + { + $h entryconfig 0.1 -state normal -style $sty_n + $h entryconfig 0.2 -state normal -style $sty_n + } + } +} + +#=============================================================================== +proc UI_PB_MachineTool { book_id mctl_page_obj } { +#=============================================================================== + global paOption + global machData + + set f [$book_id subwidget $Page::($mctl_page_obj,page_name)] + + # machine type + set machData(0) "Mill" + # axis_type + set machData(1) 5-Axis + # spindle_type + set machData(2) Vertical + # image name + set machData(3) "pb_mill_3axis.gif" + # unit + set machData(4) "Milimeter(mm)" + # empty spot + set machData(5) empty + # empty spot + set machData(6) empty + # general parameters + set machData(7) "General Parameters" + # primary rotary axis + set machData(8) "Fourth Axis" + # secondary rotary axis + set machData(9) "Fifth Axis" + + set general_param {"mom_kinematic_unit" "mom_kin_output_unit" \ + "mom_kin_x_axis_limit" "mom_kin_y_axis_limit" \ + "mom_kin_z_axis_limit" "mom_kin_home_x_pos" \ + "mom_kin_home_y_pos" "mom_kin_home_z_pos" \ + "mom_kin_machine_resolution" "mom_kin_max_traversal_rate"} + + set axis_4th_param {"mom_kin_4th_axis_type" "mom_kin_4th_axis_plane" \ + "mom_kin_4th_axis_address" "mom_kin_4th_axis_min_incr" \ + "mom_kin_4th_axis_max_limit" \ + "mom_kin_4th_axis_min_limit" \ + "mom_kin_4th_axis_rotation" \ + "mom_kin_4th_axis_center_offset(0)" \ + "mom_kin_4th_axis_center_offset(1)" \ + "mom_kin_4th_axis_center_offset(2)" \ + "mom_kin_4th_axis_ang_offset" \ + "mom_kin_pivot_guage_offset" \ + "mom_kin_max_dpm" "mom_kin_linearization_flag" \ + "mom_kin_linearization_tol" \ + "mom_kin_4th_axis_limit_action"} + + set axis_5th_param {"mom_kin_5th_axis_type" "mom_kin_5th_axis_plane" \ + "mom_kin_5th_axis_address" "mom_kin_5th_axis_min_incr" \ + "mom_kin_5th_axis_max_limit" "mom_kin_5th_axis_min_limit" \ + "mom_kin_5th_axis_rotation" \ + "mom_kin_5th_axis_center_offset(0)" \ + "mom_kin_5th_axis_center_offset(1)" \ + "mom_kin_5th_axis_center_offset(2)" \ + "mom_kin_5th_axis_ang_offset" \ + "mom_kin_pivot_guage_offset" \ + "mom_kin_max_dpm" "mom_kin_linearization_flag" \ + "mom_kin_linearization_tol" \ + "mom_kin_5th_axis_limit_action"} + + # Stores all the kin variables + set Page::($mctl_page_obj,general_param) $general_param + set Page::($mctl_page_obj,axis_4th_param) $axis_4th_param + set Page::($mctl_page_obj,axis_5th_param) $axis_5th_param + AddMachParam $f mctl_page_obj +} + +#=============================================================================== +proc AddMachParam {w PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global tixOption + global paOption + global machData + global axisoption + global machTree paramPath + + # pane = nb.page.pane + set pane [tixPanedWindow $w.pane -orient horizontal] + pack $pane -expand yes -fill both + + set f1 [$pane add p1 -expand 1 -size 275] + set f3 [$pane add p3 -expand 2 -size 625] + + $f1 config -relief flat + $f3 config -relief flat + + # Left pane: the Tree: + set tree [tixTree $f1.slb \ + -options { + hlist.indicator 1 + hlist.indent 20 + hlist.drawbranch 1 + hlist.selectMode single + hlist.width 40 + hlist.separator "." + hlist.wideselect false + }] + set machTree $tree + + # Buttons + set but [frame $f1.f] + set disp [button $but.disp -text "Display Machine Tool" \ + -bg $paOption(app_butt_bg) \ + -command "AddMachImage"] + + pack $disp -expand yes + + pack $but -side top -fill x -padx 7 + + + [$tree subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$tree subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + + pack $tree -side top -fill both -expand yes -padx 5 + + BuildMachTreeList + $tree config \ + -browsecmd "MachDisplayParams $tree machData" + + # Parameter pane + # + set machData(gen) [frame $f3.gen -relief sunken -bd 1] + AddGeneralParams page_obj $machData(gen) "general_param" + + switch $machData(1) \ + { + "4-Axis" { + + set machData(4th) [frame $f3.4th -relief sunken -bd 1] + AddRotaryAxisParams page_obj $machData(4th) "axis_4th_param" 4 + } + + "5-Axis" { + + set machData(4th) [frame $f3.4th -relief sunken -bd 1] + set machData(5th) [frame $f3.5th -relief sunken -bd 1] + AddRotaryAxisParams page_obj $machData(4th) "axis_4th_param" 4 + AddRotaryAxisParams page_obj $machData(5th) "axis_5th_param" 5 + } + } +} + +#=============================================================================== +proc BuildMachTreeList {} { +#=============================================================================== + global machTree machData + global paOption tixOption + + set h [$machTree subwidget hlist] + $h config -bg $paOption(tree_bg) + + uplevel #0 set TRANSPARENT_GIF_COLOR [$h cget -bg] + + set mach_comp [tix getimage pb_mach_kin] + + SetMachTreeTitle + + global gPB + set style $gPB(font_style_bold) + set style1 $gPB(font_style_normal) + + $h add 0 -itemtype imagetext -text "$machData(1) $machData(0)" \ + -image $paOption(folder) -style $style \ + -state disabled + + $h add 0.0 -itemtype imagetext -text $machData(7) -image $mach_comp \ + -style $style1 + + switch $machData(1) \ + { + "4-Axis" { + + $h add 0.1 -itemtype imagetext -text $machData(8) -image $mach_comp \ + -style $style1 + } + + "5-Axis" { + + $h add 0.1 -itemtype imagetext -text $machData(8) -image $mach_comp \ + -style $style1 + $h add 0.2 -itemtype imagetext -text $machData(9) -image $mach_comp \ + -style $style1 + } + + default {} + } + + $h anchor set 0.0 + $h selection set 0.0 +} + +#=============================================================================== +proc SetMachTreeTitle {} { +#=============================================================================== + global mach_type axisoption machData + + set machData(0) $mach_type + + if { $mach_type == "Mill" } \ + { + switch -- $axisoption \ + { + "3" { + set machData(1) "3-Axis" + } + "4T" - + "4H" { + set machData(1) "4-Axis" + } + "5HH" - + "5TT" - + "5HT" { + set machData(1) "5-Axis" + } + } + } +} + +#=============================================================================== +proc MachDisplayParams {tree MACHDATA args} { +#=============================================================================== + upvar $MACHDATA machData + + set HLIST [$tree subwidget hlist] + set ent [$HLIST info anchor] + set indx [string range $ent 2 [string length $ent]] + + + if {[info exists machData(5th)] && [winfo exists $machData(5th)]} { + pack forget $machData(5th) + } + + if {[info exists machData(4th)] && [winfo exists $machData(4th)]} { + pack forget $machData(4th) + } + + pack forget $machData(gen) + + switch $machData([expr $indx + 7])\ + { + "General Parameters" { + pack $machData(gen) -expand yes -fill both -padx 5 + } + + "Fourth Axis" { + pack $machData(4th) -expand yes -fill both -padx 5 + } + + "Fifth Axis" { + pack $machData(5th) -expand yes -fill both -padx 5 + } + } +} + +#=============================================================================== +proc AddGeneralParams {PAGE_OBJ w axis_param} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global tixOption + global paOption + global mom_kin_var + global machData + + set f [frame $w.f] + pack $f -side top -pady 30 -fill both + + switch $mom_kin_var(mom_kin_output_unit) \ + { + "IN" { set output_unit "Inch" } + "MM" { set output_unit "Metric" } + default { set output_unit $mom_kin_var(mom_kin_output_unit) } + } + + set pf [frame $f.pf -bg royalBlue] + grid $pf -padx 10 -pady 10 -sticky ew + label $pf.postunit -text "Post Output Unit = $output_unit" \ + -fg white -bg royalBlue + pack $pf.postunit -pady 10 + + tixLabelFrame $f.kinunit -label "Kinematic Data Unit" + tixLabelFrame $f.limit -label "Linear Axis Travel Limit" + tixLabelFrame $f.home -label "Home Position" + tixLabelFrame $f.res -label "Linear Motion Step Size" + tixLabelFrame $f.trav -label "Traversal Feed Rate" + + set fk [$f.kinunit subwidget frame] + set fl [$f.limit subwidget frame] + set fh [$f.home subwidget frame] + set fr [$f.res subwidget frame] + set ft [$f.trav subwidget frame] + + # Kinematic units + radiobutton $fk.in -text Inch -variable mom_kin_var(mom_kinematic_unit) \ + -value Inch + radiobutton $fk.mm -text Metric -variable mom_kin_var(mom_kinematic_unit) \ + -value Metric + pack $fk.in -side left -padx 15 -pady 5 + pack $fk.mm -side right -padx 15 -pady 5 + + tixLabelEntry $fl.x -label [format %-30s X] \ + -options { + entry.width 10 + entry.anchor w + label.anchor e + entry.textVariable mom_kin_var(mom_kin_x_axis_limit) + } + bind [$fl.x subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K i" + bind [$fl.x subwidget entry] { %W config -state normal } + + tixLabelEntry $fl.y -label [format %-30s Y] \ + -options { + entry.width 10 + entry.anchor w + label.anchor e + entry.textVariable mom_kin_var(mom_kin_y_axis_limit) + } + bind [$fl.y subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K i" + bind [$fl.y subwidget entry] { %W config -state normal } + + tixLabelEntry $fl.z -label [format %-30s Z] \ + -options { + entry.width 10 + entry.anchor w + label.anchor e + entry.textVariable mom_kin_var(mom_kin_z_axis_limit) + } + bind [$fl.z subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K i" + bind [$fl.z subwidget entry] { %W config -state normal } + + pack $fl.x $fl.y $fl.z -padx 10 -pady 7 + + tixLabelEntry $fh.x -label [format %-30s X] \ + -options { + entry.width 10 + entry.anchor w + label.anchor e + entry.textVariable mom_kin_var(mom_kin_home_x_pos) + } + bind [$fh.x subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fh.x subwidget entry] { %W config -state normal } + + tixLabelEntry $fh.y -label [format %-30s Y] \ + -options { + entry.width 10 + entry.anchor w + label.anchor e + entry.textVariable mom_kin_var(mom_kin_home_y_pos) + } + bind [$fh.y subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fh.y subwidget entry] { %W config -state normal } + + tixLabelEntry $fh.z -label [format %-30s Z] \ + -options { + entry.width 10 + entry.anchor w + label.anchor e + entry.textVariable mom_kin_var(mom_kin_home_z_pos) + } + bind [$fh.z subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fh.z subwidget entry] { %W config -state normal } + + pack $fh.x $fh.y $fh.z -side top -padx 10 -pady 7 + + tixLabelEntry $fr.value -label [format %-23s Minimum] \ + -options { + entry.width 10 + entry.anchor w + label.anchor e + entry.textVariable mom_kin_var(mom_kin_machine_resolution) + } + bind [$fr.value subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fr.value subwidget entry] { %W config -state normal } + + pack $fr.value -padx 10 -pady 7 + + tixLabelEntry $ft.value -label [format %-23s Maximum]\ + -options { + entry.width 10 + entry.anchor w + label.anchor e + entry.textVariable mom_kin_var(mom_kin_max_traversal_rate) + } + bind [$ft.value subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K i" + bind [$ft.value subwidget entry] { %W config -state normal } + + pack $ft.value -padx 10 -pady 7 + + grid $f.kinunit -padx 5 -pady 15 -sticky we + grid $f.limit $f.home -padx 5 -pady 15 + grid $f.res $f.trav -padx 5 -pady 15 + + # Action buttons + set ff [frame $w.ff] + pack $ff -side bottom -fill x + addActionButtons page_obj $ff $axis_param +} + +#=============================================================================== +proc AddRotaryAxisParams {PAGE_OBJ w axis_param n_axis} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + + global tixOption + global paOption + global x_limit + global machData + global mom_kin_var + + switch $n_axis { + + 4 { + set axis_rotation mom_kin_4th_axis_rotation + set axis_max_limit mom_kin_4th_axis_max_limit + set axis_min_limit mom_kin_4th_axis_min_limit + set axis_min_incr mom_kin_4th_axis_min_incr + set axis_center_offset0 mom_kin_4th_axis_center_offset(0) + set axis_center_offset1 mom_kin_4th_axis_center_offset(1) + set axis_center_offset2 mom_kin_4th_axis_center_offset(2) + set axis_ang_offset mom_kin_4th_axis_ang_offset + set axis_limit_action mom_kin_4th_axis_limit_action + set axis_pivot_offset mom_kin_pivot_guage_offset + set axis_max_dpm mom_kin_max_dpm + set axis_linear_tol mom_kin_linearization_tol + } + + 5 { + set axis_min_incr mom_kin_5th_axis_min_incr + set axis_max_limit mom_kin_5th_axis_max_limit + set axis_min_limit mom_kin_5th_axis_min_limit + set axis_rotation mom_kin_5th_axis_rotation + set axis_center_offset0 mom_kin_5th_axis_center_offset(0) + set axis_center_offset1 mom_kin_5th_axis_center_offset(1) + set axis_center_offset2 mom_kin_5th_axis_center_offset(2) + set axis_ang_offset mom_kin_5th_axis_ang_offset + set axis_limit_action mom_kin_5th_axis_limit_action + set axis_pivot_offset mom_kin_pivot_guage_offset + set axis_max_dpm mom_kin_max_dpm + set axis_linear_tol mom_kin_linearization_tol + } + + default {} + } + + set f [frame $w.f] + + pack $f -side top -pady 30 -fill both + + tixLabelFrame $f.mach -label "Rotary Axis" + tixLabelFrame $f.loffset -label "Machine Zero to Rotary Axis Center" + tixLabelFrame $f.direction -label "Axis Rotation Direction" + tixLabelFrame $f.combine -label "Consecutive Linear Motions" + tixLabelFrame $f.action -label "Axis Limit Violation Handling" + tixLabelFrame $f.limits -label "Rotary Axis Limits (Deg)" + + set fm [$f.mach subwidget frame] + set fo [$f.loffset subwidget frame] + set fd [$f.direction subwidget frame] + set fc [$f.combine subwidget frame] + set fa [$f.action subwidget frame] + set fl [$f.limits subwidget frame] + + # Rotary axis + if {$n_axis == 4} \ + { + switch $machData(1) \ + { + "4-Axis" { + + configParms $fm 4TH_AXIS + } + + "5-Axis" { + + createRotaryAxisConfig $fm + } + } + } else \ + { + createRotaryAxisConfig $fm + } + + # Max/Min + tixLabelEntry $f.resolution -label "Min. Angular Step Size (Deg)" \ + -options { + label.width 26 + entry.width 10 + entry.anchor e + label.anchor w + } + [$f.resolution subwidget entry] config -textvariable \ + mom_kin_var($axis_min_incr) + bind [$f.resolution subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$f.resolution subwidget entry] \ + { %W config -state normal } + + tixLabelEntry $fl.min -label "Minimum" \ + -options { + label.width 25 + entry.width 10 + entry.anchor e + label.anchor w + } + [$fl.min subwidget entry] config -textvariable mom_kin_var($axis_min_limit) + bind [$fl.min subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fl.min subwidget entry] { %W config -state normal } + + tixLabelEntry $fl.max -label "Maximum" \ + -options { + label.width 25 + entry.width 10 + entry.anchor e + label.anchor w + } + [$fl.max subwidget entry] config -textvariable mom_kin_var($axis_max_limit) + bind [$fl.max subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fl.max subwidget entry] { %W config -state normal } + + grid $fl.min -padx 5 -pady 2 + grid $fl.max -padx 5 -pady 2 + + + # Linear Offset + radiobutton $fd.normal -text Standard -width 13 -anchor w \ + -variable mom_kin_var($axis_rotation) -value standard + radiobutton $fd.reverse -text Reverse -width 14 -anchor w \ + -variable mom_kin_var($axis_rotation) -value Reverse + + grid $fd.normal $fd.reverse -padx 5 -pady 16 + + tixLabelEntry $fo.x -label "X Offset" \ + -options { + label.width 20 + entry.width 10 + entry.anchor e + label.anchor w + } + [$fo.x subwidget entry] config -textvariable \ + mom_kin_var($axis_center_offset0) + bind [$fo.x subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fo.x subwidget entry] { %W config -state normal } + + tixLabelEntry $fo.y -label "Y Offset" \ + -options { + label.width 20 + entry.width 10 + entry.anchor e + label.anchor w + } + [$fo.y subwidget entry] config -textvariable \ + mom_kin_var($axis_center_offset1) + bind [$fo.y subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fo.y subwidget entry] { %W config -state normal } + + tixLabelEntry $fo.z -label "Z Offset" \ + -options { + label.width 20 + entry.width 10 + entry.anchor e + label.anchor w + } + [$fo.z subwidget entry] config -textvariable \ + mom_kin_var($axis_center_offset2) + bind [$fo.z subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$fo.z subwidget entry] { %W config -state normal } + + grid $fo.x -sticky w -padx 5 -pady 0 + grid $fo.y -sticky w -padx 5 -pady 0 + grid $fo.z -sticky w -padx 5 -pady 0 + + # Angular Offset + tixLabelEntry $f.aoffset -label "Angular Offset (Deg)" \ + -options { + label.width 21 + entry.width 10 + entry.anchor e + label.anchor w + } + [$f.aoffset subwidget entry] config \ + -textvariable mom_kin_var($axis_ang_offset) + bind [$f.aoffset subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$f.aoffset subwidget entry] { %W config -state normal } + + tixLabelEntry $f.dist -label "Pivot Distance" \ + -options { + label.width 21 + entry.width 10 + entry.anchor e + label.anchor w + } + [$f.dist subwidget entry] config \ + -textvariable mom_kin_var($axis_pivot_offset) + bind [$f.dist subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$f.dist subwidget entry] { %W config -state normal } + + tixLabelEntry $f.dpm -label "Max. Feed Rate (Deg/Min)" \ + -options { + label.width 26 + entry.width 10 + entry.anchor w + label.anchor w + } + [$f.dpm subwidget entry] config \ + -textvariable mom_kin_var($axis_max_dpm) + bind [$f.dpm subwidget entry] \ + "UI_PB_com_ValidateDataOfEntry %W %K f" + bind [$f.dpm subwidget entry] { %W config -state normal } + + # Consecutive Linear Motions + checkbutton $fc.rotary_motion -text "Combined" \ + -variable mom_kin_var(mom_kin_linearization_flag) \ + -command "setTolState $fc" + + tixLabelEntry $fc.tol -label "Tolerance " \ + -options { + label.width 20 + entry.width 10 + entry.anchor e + label.anchor w + entry.textVariable mom_kin_var(mom_kin_linearization_tol) + } + [$fc.tol subwidget entry] config \ + -textvariable mom_kin_var($axis_linear_tol) + + grid $fc.rotary_motion -sticky w -padx 5 -pady 2 + grid $fc.tol -sticky w -padx 5 -pady 2 + + + # Axis Violation Action + radiobutton $fa.warning -text "Warning" -width 27 -anchor w \ + -variable mom_kin_var($axis_limit_action) \ + -value Warning + radiobutton $fa.ret -text "Retract / Re-Engage" -width 27 -anchor w \ + -variable mom_kin_var($axis_limit_action) \ + -value "Retract / Re-Engage" + + grid $fa.warning -sticky w -padx 5 -pady 2 + grid $fa.ret -sticky w -padx 5 -pady 2 + + grid $f.mach $f.loffset -padx 5 -pady 5 -sticky news + grid $f.resolution $f.dist -padx 15 -pady 5 -sticky ew + grid $f.dpm $f.aoffset -padx 15 -pady 5 -sticky ew + grid $f.direction $f.combine -padx 5 -pady 20 -sticky news + grid $f.limits $f.action -padx 5 -pady 5 -sticky news + + # Action buttons + set ff [frame $w.ff] + pack $ff -side bottom -fill x + addActionButtons page_obj $ff $axis_param +} + +#=============================================================================== +proc setTolState { fc } { +#=============================================================================== + global mom_kin_var + global gPB + + set e [$fc.tol subwidget entry] + + if { $mom_kin_var(mom_kin_linearization_flag) } \ + { +# +# Due to some technical difficulties, we don't change bg color just yet. + $e config -state normal + bind $e "UI_PB_com_ValidateDataOfEntry %W %K f" + bind $e { %W config -state normal } + + } else \ + { + $e config -state disabled + bind $e "" + bind $e "" + } +} + +#=============================================================================== +proc addActionButtons { PAGE_OBJ f axis_param } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + set bb [tixButtonBox $f.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + $bb add def -text "Default" -underline 0 -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_mach_DefaultCallBack $page_obj $axis_param" + + $bb add app -text "Restore" -underline 0 -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_mach_RestoreCallBack $page_obj $axis_param" + + pack $bb -fill x -padx 3 -pady 3 +} + +#=============================================================================== +proc createRotaryAxisConfig { f } { +#=============================================================================== + set bb [tixButtonBox $f.bb -orientation horizontal] + $bb config -relief flat -bg navyBlue -pady 6 + $bb add spec -text "Configuration" -width 20 + grid $bb + + set b [$bb subwidget spec] + $b config -command "configRotaryAxisWin $b" +} + +#=============================================================================== +proc configRotaryAxisWin { f } { +#=============================================================================== + global paOption tixOption + global gPB + + set w $gPB(top_window).axis_config + + if { [winfo exists $w] } { + raise $w + focus $w +return + } else { + toplevel $w + } + + UI_PB_com_CreateTransientWindow $w "Rotary Axis Configuration" "+500+300" \ + "" "" + + set page_frm [frame $w.f1 -relief sunken -bd 1] + pack $page_frm -fill both -expand yes -padx 6 -pady 5 + configRotaryAxisParms $page_frm + + set frame [frame $w.f2] + pack $frame -side bottom -fill x -padx 3 -pady 4 + configRotaryAxisNavButtons $frame +} + +#=============================================================================== +proc configRotaryAxisParms { f } { +#=============================================================================== + global tixOption + global paOption + global x_limit + global machData + global mom_kin_var + + tixLabelFrame $f.4th -label "4th Axis" + tixLabelFrame $f.5th -label "5th Axis" + grid $f.4th $f.5th -padx 10 -pady 30 + + set f4 [$f.4th subwidget frame] + set f5 [$f.5th subwidget frame] + configParms $f4 4TH_AXIS + configParms $f5 5TH_AXIS +} + +#=============================================================================== +proc configParms { fm axis_type } { +#=============================================================================== + global mom_kin_var + + if { $axis_type == "4TH_AXIS" } \ + { + set AXIS mom_kin_4th_axis + } else \ + { + set AXIS mom_kin_5th_axis + } + + set temp_name $mom_kin_var($AXIS\_plane) + + append head_var $AXIS _type + radiobutton $fm.head -text Head -variable mom_kin_var($head_var) \ + -value Head + radiobutton $fm.table -text Table -variable mom_kin_var($head_var) \ + -value Table + + set opts {xy yz zx} + + set opt_labels(xy) "XY" + set opt_labels(yz) "YZ" + set opt_labels(zx) "ZX" + append plane_type $AXIS _plane + tixOptionMenu $fm.plane -label "Plane of Rotation" \ + -variable mom_kin_var($plane_type) \ + -options { + label.width 25 + label.anchor w + entry.anchor e + menubutton.width 6 + } + + foreach opt $opts { + $fm.plane add command $opt -label $opt_labels($opt) + } + + set mom_kin_var($plane_type) $temp_name + + tixLabelEntry $fm.address -label "Address Leader" \ + -options { + label.width 25 + entry.width 10 + entry.anchor e + label.anchor w + } + + append rotary_leader $AXIS _address + [$fm.address subwidget entry] config -textvariable \ + mom_kin_var($rotary_leader) + + grid $fm.head $fm.table -sticky w -padx 5 + grid $fm.plane - -sticky w -padx 5 + grid $fm.address - -sticky nw -padx 5 +} + +#=============================================================================== +proc configRotaryAxisNavButtons { frame } { +#=============================================================================== + global paOption + + set box1_frm [frame $frame.box1] + + set box2_frm [frame $frame.box2] + + tixForm $box1_frm -top 0 -left 3 -right %60 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 3 -right %100 + + set box1 [tixButtonBox $box1_frm.resapp \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + + set box2 [tixButtonBox $box2_frm.okcan \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + pack $box1 -fill x + pack $box2 -fill x + + # Box1 attributes + $box1 add res -text Default -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_mach_RotaryDefCallBack" + + $box1 add und -text Restore -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_mach_RotaryResCallBack" + + $box1 add app -text Apply -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_mach_RotaryAppCallBack" + + # Box2 attributes + $box2 add ca -text Cancel -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "destroy [winfo parent $frame]" + + $box2 add ok -text OK -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "acceptRotaryAxisConfig [winfo parent $frame]" +} + +#=============================================================================== +proc UI_PB_mach_RotaryResCallBack { } { +#=============================================================================== + global mom_kin_var + global rest_mom_kin_var + + # Fourth Axis parameters + set mom_kin_var(mom_kin_4th_axis_type) \ + $rest_mom_kin_var(mom_kin_4th_axis_type) + set mom_kin_var(mom_kin_4th_axis_plane) \ + $rest_mom_kin_var(mom_kin_4th_axis_plane) + set mom_kin_var(mom_kin_4th_axis_address) \ + $rest_mom_kin_var(mom_kin_4th_axis_address) + + # Fifth Axis parameters + set mom_kin_var(mom_kin_5th_axis_type) \ + $rest_mom_kin_var(mom_kin_5th_axis_type) + set mom_kin_var(mom_kin_5th_axis_plane) \ + $rest_mom_kin_var(mom_kin_5th_axis_plane) + set mom_kin_var(mom_kin_5th_axis_address) \ + $rest_mom_kin_var(mom_kin_5th_axis_address) +} + +#=============================================================================== +proc UI_PB_mach_RotaryAppCallBack { } { +#=============================================================================== + global mom_kin_var + global rest_mom_kin_var + + # Fourth Axis parameters + set rest_mom_kin_var(mom_kin_4th_axis_type) \ + $mom_kin_var(mom_kin_4th_axis_type) + set rest_mom_kin_var(mom_kin_4th_axis_plane) \ + $mom_kin_var(mom_kin_4th_axis_plane) + set rest_mom_kin_var(mom_kin_4th_axis_address) \ + $mom_kin_var(mom_kin_4th_axis_address) + + # Fifth Axis parameters + set rest_mom_kin_var(mom_kin_5th_axis_type) \ + $mom_kin_var(mom_kin_5th_axis_type) + set rest_mom_kin_var(mom_kin_5th_axis_plane) \ + $mom_kin_var(mom_kin_5th_axis_plane) + set rest_mom_kin_var(mom_kin_5th_axis_address) \ + $mom_kin_var(mom_kin_5th_axis_address) + CBMachHeadTable +} + +#=============================================================================== +proc UI_PB_mach_RotaryDefCallBack { } { +#=============================================================================== + PB_int_RetDefKinVars def_mom_kin_var + global mom_kin_var + + # Fourth Axis parameters + set mom_kin_var(mom_kin_4th_axis_type) \ + $def_mom_kin_var(mom_kin_4th_axis_type) + set mom_kin_var(mom_kin_4th_axis_plane) \ + $def_mom_kin_var(mom_kin_4th_axis_plane) + set mom_kin_var(mom_kin_4th_axis_address) \ + $def_mom_kin_var(mom_kin_4th_axis_address) + + # Fifth Axis parameters + set mom_kin_var(mom_kin_5th_axis_type) \ + $def_mom_kin_var(mom_kin_5th_axis_type) + set mom_kin_var(mom_kin_5th_axis_plane) \ + $def_mom_kin_var(mom_kin_5th_axis_plane) + set mom_kin_var(mom_kin_5th_axis_address) \ + $def_mom_kin_var(mom_kin_5th_axis_address) +} + +#=============================================================================== +proc acceptRotaryAxisConfig { w } { +#=============================================================================== + if {[CBMachHeadTable] == "TCL_OK"} \ + { + destroy $w + } +} + +#=============================================================================== +proc CBMachHeadTable {} { +#=============================================================================== + global axisoption machTree + global mom_kin_var + + set 4head $mom_kin_var(mom_kin_4th_axis_type) + + if { $axisoption == "4T" && $4head == "Head" } \ + { + set axisoption "4H" +return TCL_OK + } elseif { $axisoption == "4H" && $4head == "Table" } \ + { + set axisoption "4T" +return TCL_OK + } + + if { ![info exists mom_kin_var(mom_kin_5th_axis_type)] } \ + { +return TCL_OK + } + + set 5head $mom_kin_var(mom_kin_5th_axis_type) + + if { $4head == "Head" && $5head == "Head" } { + set axisoption "5HH" + } elseif { $4head == "Table" && $5head == "Table" } { + set axisoption "5TT" + } elseif { $4head == "Head" && $5head == "Table" } { + set axisoption "5HT" + } else { + + if {[ValidateMachObjAttr $machTree 5] == "TCL_OK"} \ + { + switch -- $axisoption { + "5HH" { + set mom_kin_var(mom_kin_4th_axis_type) "Head" + set mom_kin_var(mom_kin_5th_axis_type) "Head" + } + "5TT" { + set mom_kin_var(mom_kin_4th_axis_type) "Table" + set mom_kin_var(mom_kin_5th_axis_type) "Table" + } + "5HT" { + set mom_kin_var(mom_kin_4th_axis_type) "Head" + set mom_kin_var(mom_kin_5th_axis_type) "Table" + } + } + } else \ + { +return TCL_ERROR + } + } + + ChangeOffsetEntryDisplay + +return TCL_OK +} + +#=============================================================================== +proc CBMach5thAxisPlane { value } { +#=============================================================================== + global mach5thOffsetPath + global axisoption + + if { $axisoption != "5TT" } { return } + if { ![info exists mach5thOffsetPath] } { return } + + ChangeOffsetEntryDisplay +} + +#=============================================================================== +proc ChangeOffsetEntryDisplay { } { +#=============================================================================== + global mach5thOffsetPath + global mom_kin_var + global axisoption + global gridOffset + + if { [info exists mach5thOffsetPath] } { + set fo $mach5thOffsetPath + if { [info exists gridOffset(x)] && $gridOffset(x) == "true" } { + grid forget $mach5thOffsetPath.x + set gridOffset(x) false + } + if { [info exists gridOffset(y)] && $gridOffset(y) == "true" } { + grid forget $mach5thOffsetPath.y + set gridOffset(y) false + } + if { [info exists gridOffset(z)] && $gridOffset(z) == "true" } { + grid forget $mach5thOffsetPath.z + set gridOffset(z) false + } + } else { +return + } + + if { $axisoption == "5TT" } { + if { $mom_kin_var(mom_kin_5th_axis_plane) == "zx" } { + grid $fo.y -sticky w -padx 5 -pady 3 + set gridOffset(y) true + } elseif { $mom_kin_var(mom_kin_5th_axis_plane) == "xy" } { + grid $fo.z -sticky w -padx 5 -pady 3 + set gridOffset(z) true + } else { + grid $fo.x -sticky w -padx 5 -pady 3 + set gridOffset(x) true + } + } elseif { $axisoption == "5HH" || \ + $axisoption == "5HT" } { + grid $fo.x -sticky w -padx 5 -pady 3 + set gridOffset(x) true + grid $fo.y -sticky w -padx 5 -pady 3 + set gridOffset(y) true + grid $fo.z -sticky w -padx 5 -pady 3 + set gridOffset(z) true + } +} + +#=============================================================================== +proc UI_PB_mach_DefaultCallBack { page_obj axis_param } { +#=============================================================================== + global mom_kin_var + + if {[string compare $axis_param "general_param"] == 0} \ + { + set mom_var_list $Page::($page_obj,general_param) + } elseif { [string compare $axis_param "axis_4th_param"] == 0 } \ + { + set mom_var_list $Page::($page_obj,axis_4th_param) + } else \ + { + set mom_var_list $Page::($page_obj,axis_5th_param) + } + PB_int_RetDefKinVarValues mom_var_list def_mom_kin_var + foreach kin_var $mom_var_list \ + { + set mom_kin_var($kin_var) $def_mom_kin_var($kin_var) + } +} + +#=============================================================================== +proc UI_PB_mach_RestoreCallBack { page_obj axis_param } { +#=============================================================================== + global mom_kin_var + global rest_mom_kin_var + + if {[string compare $axis_param "general_param"] == 0} \ + { + set mom_var_list $Page::($page_obj,general_param) + } elseif { [string compare $axis_param "axis_4th_param"] == 0 } \ + { + set mom_var_list $Page::($page_obj,axis_4th_param) + } else \ + { + set mom_var_list $Page::($page_obj,axis_5th_param) + } + foreach kin_var $mom_var_list \ + { + set mom_kin_var($kin_var) $rest_mom_kin_var($kin_var) + } +} + +set w 0 + +#=============================================================================== +proc DisplayMachImage {} { +#=============================================================================== + global w + + # Verify if image needs to be reconstructed, + # due to parameter changes, or simply restored. + + if {[winfo exists $w]} \ + { + if {[wm state $w] == "iconic"}\ + { + wm deiconify $w + } else\ + { + raise $w + focus $w + } + } else \ + { + AddMachImage + } +} + +#=============================================================================== +proc AddMachImage {} { +#=============================================================================== + global machData + global w + global mach_type axisoption + global mom_kin_var + global imagefile ImageWindowText + + # 4x1,4y1-4xmin; 4x2,4y2-4xmax; 4ax1,4ay1-arrow start + # 4ax2,4ay2-arrow end; 4sx,4sy-direction symbol + global 4x1 4y1 4x2 4y2 4ax1 4ay1 4ax2 4ay2 4sx 4sy + # 5x1,5y1-5xmin; 5x2,5y2-5xmax; 5ax1,5ay1-arrow start + # 5ax2,5ay2-arrow end; 5sx,5sy-direction symbol + global 5x1 5y1 5x2 5y2 5ax1 5ay1 5ax2 5ay2 5sx 5sy + # 5axis offset vector. 5ox, 5oy for one of X, Y, Z + global 5ox 5oy + + if {[info exists w]} { + destroy $w + } + set imagefile "" + ConstructMachDisplayParameters + if { $imagefile == "" } { return } + + global gPB + set w $gPB(active_window).mach_image + toplevel $w + wm title $w "Machine Tool" + wm geometry $w 800x700+300+200 + + label $w.lab -justify left -text $ImageWindowText + + pack $w.lab -anchor c -padx 10 -pady 6 + tixCObjView $w.c + pack $w.c -expand yes -fill both -padx 4 -pady 2 + + image create photo myphoto -file $imagefile + [$w.c subwidget canvas] create image 390 340 -image myphoto \ + -anchor c + if { $mach_type == "Mill" && $axisoption != "3" } { + set 4xmin $mom_kin_var(mom_kin_4th_axis_min_limit) + set 4xmax $mom_kin_var(mom_kin_4th_axis_max_limit) + set 4dire $mom_kin_var(mom_kin_4th_axis_rotation) + set 4address $mom_kin_var(mom_kin_4th_axis_address) + if { $4dire == "standard" } { + set 4sign +$4address + } else { + set 4sign -$4address + } + if { $4dire == "standard" } { + [$w.c subwidget canvas] create text $4x1 $4y1 -text $4xmin \ + -fill white -font {helvetica 18 bold} + [$w.c subwidget canvas] create text $4x2 $4y2 -text $4xmax \ + -fill white -font {helvetica 18 bold} + } else { + [$w.c subwidget canvas] create text $4x2 $4y2 -text $4xmin \ + -fill white -font {helvetica 18 bold} + [$w.c subwidget canvas] create text $4x1 $4y1 -text $4xmax \ + -fill white -font {helvetica 18 bold} + } + eval {[$w.c subwidget canvas] create line} {$4ax1 $4ay1 $4ax2 $4ay2} \ + {-tag arrow -arrow last -arrowshape [list 20 25 8] -fill yellow} + [$w.c subwidget canvas] create text $4sx $4sy -text $4sign \ + -fill white -font {helvetica 22 bold} + + if { $axisoption == "5HH" || \ + $axisoption == "5TT" || \ + $axisoption == "5HT" } { + set 5xmin $mom_kin_var(mom_kin_5th_axis_min_limit) + set 5xmax $mom_kin_var(mom_kin_5th_axis_max_limit) + set 5dire $mom_kin_var(mom_kin_5th_axis_rotation) + set 5address $mom_kin_var(mom_kin_5th_axis_address) + if { $5dire == "standard" } { + set 5sign +$5address + } else { + set 5sign -$5address + } + if { $5dire == "standard" } { + [$w.c subwidget canvas] create text $5x1 $5y1 -text $5xmin \ + -fill white -font {helvetica 18 bold} + [$w.c subwidget canvas] create text $5x2 $5y2 -text $5xmax \ + -fill white -font {helvetica 18 bold} + } else { + [$w.c subwidget canvas] create text $5x2 $5y2 -text $5xmin \ + -fill white -font {helvetica 18 bold} + [$w.c subwidget canvas] create text $5x1 $5y1 -text $5xmax \ + -fill white -font {helvetica 18 bold} + } + eval {[$w.c subwidget canvas] create line} \ + {$5ax1 $5ay1 $5ax2 $5ay2} \ + {-tag arrow -arrow last -arrowshape [list 20 25 8] -fill yellow} + [$w.c subwidget canvas] create text $5sx $5sy -text $5sign \ + -fill white -font {helvetica 22 bold} + if { $axisoption == "5TT" } { + if { $mom_kin_var(mom_kin_5th_axis_plane) == "zx" } { + set offset $mom_kin_var(mom_kin_5th_axis_center_offset\(1\)) + } elseif { $mom_kin_var(mom_kin_5th_axis_plane) == "xy" } { + set offset $mom_kin_var(mom_kin_5th_axis_center_offset\(2\)) + } elseif { $mom_kin_var(mom_kin_5th_axis_plane) == "yz" } { + set offset $mom_kin_var(mom_kin_5th_axis_center_offset\(0\)) + } + [$w.c subwidget canvas] create text $5ox $5oy -text $offset \ + -fill white -font {helvetica 18 bold} + } + } + } + $w.c adjustscrollregion +} + +#=============================================================================== +proc ConstructMachDisplayParameters {} { +#=============================================================================== + global mach_type axisoption machTree + global imagefile directory + global ImageWindowText + global env + + + set directory "$env(PB_HOME)/images/mach_tool/" + + if { ![info exists mach_type] || ![info exists axisoption] } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "Please select a machine tool!" + return + } + if { $mach_type == "Mill" } { + switch -- $axisoption { + "3" { + set ImageWindowText [list 3-Axis $mach_type] + append imagefile $directory pb_m3x_v.gif + } + "4T" - + "4H" { + if { [ValidateMachObjAttr $machTree 4] == "TCL_ERROR" } { return } + set ImageWindowText [list 4-Axis $mach_type] + Construct4thAxisDisplayParameter + } + "5HH" - + "5TT" - + "5HT" { + if { [ValidateMachObjAttr $machTree 5] == "TCL_ERROR" } { return } + set ImageWindowText [list 5-Axis $mach_type] + Construct5thAxisDisplayParameter + } + } + } +} + +#=============================================================================== +proc Construct4thAxisDisplayParameter {} { +#=============================================================================== + global mom_kin_var + global imagefile directory + # 4x1,4y1-4xmin; 4x2,4y2-4xmax; 4sx,4sy-direction symbol + # 4ax1_1,4ay1_1-arrow start normal; 4ax2_1,4ay2_1-arrow end normal + # 4ax1_2,4ay1_2-arrow start reversed; 4ax2_2,4ay2_2-arrow end reversed + + set 4head $mom_kin_var(mom_kin_4th_axis_type) + set 4plane $mom_kin_var(mom_kin_4th_axis_plane) + set 4address $mom_kin_var(mom_kin_4th_axis_address) + + if { $4plane == "yz" && $4address == "A" } { + if { $4head == "Table" } { + Set4thDispParams 200 380 320 390 258 374 \ + 313 421 308 407 \ + 220 411 223 383 + append imagefile $directory pb_m4x_TA_h.gif + } elseif { $4head == "Head" } { + Set4thDispParams 550 450 550 380 458 440 \ + 507 367 525 374 \ + 517 442 536 425 + append imagefile $directory pb_m4x_HA_h.gif + } + } elseif { $4plane == "zx" && $4address == "B" } { + if { $4head == "Table" } { + Set4thDispParams 550 430 330 430 434 515 \ + 359 482 333 478 \ + 520 463 545 452 + append imagefile $directory pb_m4x_TB_h.gif + } elseif { $4head == "Head" } { + Set4thDispParams 585 319 490 325 538 309 \ + 514 348 526 362 \ + 581 349 574 363 + append imagefile $directory pb_m4x_HB_h.gif + } + } else { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon question \ + -message "No Display For This Machine Tool Configuration" + return + } +} + +#=============================================================================== +proc Set4thDispParams { x1 y1 x2 y2 sx sy ax1_1 ay1_1 ax2_1 ay2_1 \ + ax1_2 ay1_2 ax2_2 ay2_2 } { +#=============================================================================== + global mom_kin_var + # 4x1,4y1-4xmin; 4x2,4y2-4xmax; 4sx,4sy-direction symbol + # 4ax1_1,4ay1_1-arrow start normal; 4ax2_1,4ay2_1-arrow end normal + # 4ax1_2,4ay1_2-arrow start reversed; 4ax2_2,4ay2_2-arrow end reversed + global 4x1 4y1 4x2 4y2 4ax1 4ay1 4ax2 4ay2 4sx 4sy + + set 4dire $mom_kin_var(mom_kin_4th_axis_rotation) + set 4x1 $x1; set 4y1 $y1 + set 4x2 $x2; set 4y2 $y2 + set 4sx $sx; set 4sy $sy + if { $4dire == "standard" } { + set 4ax1 $ax1_1; set 4ay1 $ay1_1 + set 4ax2 $ax2_1; set 4ay2 $ay2_1 + } else { + set 4ax1 $ax1_2; set 4ay1 $ay1_2 + set 4ax2 $ax2_2; set 4ay2 $ay2_2 + } +} + +#=============================================================================== +proc Set5thDispParams { x1 y1 x2 y2 sx sy ax1_1 ay1_1 ax2_1 ay2_1 \ + ax1_2 ay1_2 ax2_2 ay2_2 ox oy } { +#=============================================================================== + global mom_kin_var + # 5x1,5y1-5xmin; 5x2,5y2-4xmax; 5sx,5sy-direction symbol + # 5ax1_1,5ay1_1-arrow start normal; 5ax2_1,5ay2_1-arrow end normal + # 5ax1_2,5ay1_2-arrow start reversed; 5ax2_2,5ay2_2-arrow end reversed + # 5axis offset vector. 5ox, 5oy for one of X, Y, Z + global 5x1 5y1 5x2 5y2 5ax1 5ay1 5ax2 5ay2 5sx 5sy + global 5ox 5oy + + set 5dire $mom_kin_var(mom_kin_5th_axis_rotation) + set 5x1 $x1; set 5y1 $y1 + set 5x2 $x2; set 5y2 $y2 + set 5sx $sx; set 5sy $sy + if { $5dire == "standard" } { + set 5ax1 $ax1_1; set 5ay1 $ay1_1 + set 5ax2 $ax2_1; set 5ay2 $ay2_1 + } else { + set 5ax1 $ax1_2; set 5ay1 $ay1_2 + set 5ax2 $ax2_2; set 5ay2 $ay2_2 + } + set 5ox $ox + set 5oy $oy +} + +#=============================================================================== +proc Construct5thAxisDisplayParameter {} { +#=============================================================================== + global imagefile directory + global axisoption + global mom_kin_var + + # 4x1,4y1-4xmin; 4x2,4y2-4xmax; 4sx,4sy-direction symbol + # 4ax1_1,4ay1_1-arrow start normal; 4ax2_1,4ay2_1-arrow end normal + # 4ax1_2,4ay1_2-arrow start reversed; 4ax2_2,4ay2_2-arrow end reversed + + # 5x1,5y1-5xmin; 5x2,5y2-4xmax; 5sx,5sy-direction symbol + # 5ax1_1,5ay1_1-arrow start normal; 5ax2_1,5ay2_1-arrow end normal + # 5ax1_2,5ay1_2-arrow start reversed; 5ax2_2,5ay2_2-arrow end reversed + # 5axis offset position. 5ox, 5oy for one of X, Y, Z if 5axis table-table + + set 4plane $mom_kin_var(mom_kin_4th_axis_plane) + set 4address $mom_kin_var(mom_kin_4th_axis_address) + + set 5plane $mom_kin_var(mom_kin_5th_axis_plane) + set 5address $mom_kin_var(mom_kin_5th_axis_address) + + if { $4plane == "yz" && $4address == "A" } { + if { $5plane == "zx" && $5address == "B" } { + if { $axisoption == "5HH" } { + Set4thDispParams 470 270 450 220 381 281 \ + 424 253 444 237 \ + 451 304 467 293 + Set5thDispParams 540 270 500 300 580 347 \ + 497 346 494 316 \ + 545 290 530 285 \ + 0 0 + append imagefile $directory \ + pb_m5x_HA_HB_v.gif + } elseif { $axisoption == "5TT" } { + Set4thDispParams 250 420 370 450 307 439 \ + 361 491 354 471 \ + 267 470 271 443 + Set5thDispParams 470 550 480 440 531 477 \ + 506 413 492 422 \ + 509 535 485 531 \ + 240 536 + append imagefile $directory \ + pb_m5x_TA_TB_v.gif + } elseif { $axisoption == "5HT" } { + Set4thDispParams 470 240 390 280 393 253 \ + 420 283 419 256 \ + 462 269 452 255 + Set5thDispParams 540 500 680 440 607 469 \ + 678 474 670 461 \ + 564 530 570 502 \ + 0 0 + append imagefile $directory \ + pb_m5x_HA_TB_v.gif + } + } elseif { $5plane == "xy" && $5address == "C" } { + if { $axisoption == "5HH" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon question -message "No Display For This Machine Tool Configuration" + return + } elseif { $axisoption == "5TT" } { + Set4thDispParams 230 480 340 480 286 460 \ + 342 512 337 496 \ + 255 495 259 470 + Set5thDispParams 410 390 460 470 478 393 \ + 495 446 474 448 \ + 420 413 399 423 \ + 240 530 + append imagefile $directory \ + pb_m5x_TA_TC_v.gif + } elseif { $axisoption == "5HT" } { + Set4thDispParams 430 220 355 250 355 223 \ + 386 255 385 228 \ + 426 241 417 228 + Set5thDispParams 610 450 380 460 479 476 \ + 393 507 373 505 \ + 589 484 607 477 \ + 0 0 + append imagefile $directory \ + pb_m5x_HA_TC_v.gif + } + } else { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon question \ + -message "No Display For This Machine Tool Configuration" + return + } + } elseif { $4plane == "zx" && $4address == "B" } { + if { $5plane == "yz" && $5address == "A" } { + if { $axisoption == "5HH" } { + Set4thDispParams 580 240 520 250 610 280 \ + 539 288 529 272 \ + 581 275 578 257 + Set5thDispParams 480 280 440 290 396 327 \ + 442 328 440 309 \ + 486 305 476 293 \ + 0 0 + append imagefile $directory \ + pb_m5x_HB_HA_v.gif + } elseif { $axisoption == "5TT" } { + Set4thDispParams 550 400 650 410 560 556 \ + 647 447 646 427 \ + 555 432 568 411 + Set5thDispParams 410 475 455 350 439 412 \ + 462 369 448 365 \ + 433 460 413 440 \ + 690 500 + append imagefile $directory \ + pb_m5x_TB_TA_v.gif + } elseif { $axisoption == "5HT" } { + Set4thDispParams 520 230 450 280 553 314 \ + 483 306 481 279 \ + 532 252 517 248 + Set5thDispParams 310 410 400 500 347 465 \ + 385 535 385 520 \ + 294 451 309 434 \ + 0 0 + append imagefile $directory \ + pb_m5x_HB_TA_v.gif + } + } elseif { $5plane == "xy" && $5address == "C" } { + if { $axisoption == "5HH" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon question -message "No Display For This Machine Tool Configuration" + return + } elseif { $axisoption == "5TT" } { + Set4thDispParams 460 460 560 420 534 577 \ + 565 450 557 438 \ + 467 496 471 474 + Set5thDispParams 380 425 470 360 393 355 \ + 443 376 457 383 \ + 373 403 393 408 \ + 590 510 + append imagefile $directory \ + pb_m5x_TB_TC_v.gif + } elseif { $axisoption == "5HT" } { + Set4thDispParams 465 190 401 235 488 271 \ + 431 254 430 232 \ + 474 218 462 209 + Set5thDispParams 570 465 376 477 459 548 \ + 396 509 380 506 \ + 556 490 571 484 \ + 0 0 + append imagefile $directory \ + pb_m5x_HB_TC_v.gif + } + } else { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon question \ + -message "No Display For This Machine Tool Configuration" + return + } + } elseif { $4plane == "xy" && $4address == "C" } { + if { $5plane == "yz" && $5address == "A" } { + if { $axisoption == "5HH" } { + Set4thDispParams 410 190 590 220 603 262 \ + 562 252 584 246 \ + 419 219 429 204 + Set5thDispParams 490 290 410 330 410 304 \ + 442 331 441 303 \ + 485 313 476 301 \ + 0 0 + append imagefile $directory \ + pb_m5x_HC_HA_v.gif + } elseif { $axisoption == "5TT" } { + if { $4address == "C" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon error -message "4 axis C table not allowed" + return + } + } elseif { $axisoption == "5HT" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon question -message "No Display For This Machine Tool Configuration" + return + } + } elseif { $5plane == "zx" && $5address == "B" } { + if { $axisoption == "5HH" } { + Set4thDispParams 370 200 540 230 560 265 \ + 510 254 529 249 \ + 374 220 385 211 + Set5thDispParams 530 330 460 290 504 299 \ + 482 314 500 304 \ + 519 356 522 343 \ + 0 0 + append imagefile $directory \ + pb_m5x_HC_HB_v.gif + } elseif { $axisoption == "5TT" } { + if { $4address == "C" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon error -message "4 axis C table not allowed" + return + } + } elseif { $axisoption == "5HT" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon question -message "No Display For This Machine Tool Configuration" + return + } + } else { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon question \ + -message "No Display For This Machine Tool Configuration" + return + } + } else { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon question \ + -message "No Display For This Machine Tool Configuration" + return + } +} + +#=============================================================================== +proc ValidateMachObjAttr { tree axis_type } { +#=============================================================================== + global mom_kin_var + + switch -- $axis_type { + 3 { + return TCL_OK + } + 4 { + if { $mom_kin_var(mom_kin_4th_axis_plane) == "xy" && \ + $mom_kin_var(mom_kin_4th_axis_address) == "C" && \ + $mom_kin_var(mom_kin_4th_axis_type) == "Table" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon error -message "4th axis C table not allowed" + return TCL_ERROR + } + set 4xmin $mom_kin_var(mom_kin_4th_axis_min_limit) + set 4xmax $mom_kin_var(mom_kin_4th_axis_max_limit) + set 4range [expr $4xmax - $4xmin] + if { $4range == 0 } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon error -message "4th axis maximum axis limit can not be equal to \ + minimum axis limit!" + return TCL_ERROR + } elseif { $4xmax < 0 && $4xmin < 0 } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "4th axis limits can not both be negative!" + return TCL_ERROR + } + } + 5 { + if { $mom_kin_var(mom_kin_4th_axis_plane) == $mom_kin_var(mom_kin_5th_axis_plane) } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "Plane of the 4th axis can not be \ + the same as that of the 5th axis" + return TCL_ERROR + } + if { $mom_kin_var(mom_kin_4th_axis_plane) == "xy" && \ + $mom_kin_var(mom_kin_4th_axis_address) == "C" && \ + $mom_kin_var(mom_kin_4th_axis_type) == "Table" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon error -message "4th axis C table not allowed" + return TCL_ERROR + } + if { $mom_kin_var(mom_kin_4th_axis_type) == "Table" && \ + $mom_kin_var(mom_kin_5th_axis_type) == "Head" } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok \ + -icon error -message "4th axis table and 5th axis head not allowed" + return TCL_ERROR + } + set 4xmin $mom_kin_var(mom_kin_4th_axis_min_limit) + set 4xmax $mom_kin_var(mom_kin_4th_axis_max_limit) + set 4range [expr $4xmax - $4xmin] + if { $4range == 0 } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "4th axis maximum axis limit can not be equal to \ + minimum axis limit!" + return TCL_ERROR + } elseif { $4xmax < 0 && $4xmin < 0 } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "4th axis limits can not both be negative!" + return TCL_ERROR + } + set 5xmin $mom_kin_var(mom_kin_5th_axis_min_limit) + set 5xmax $mom_kin_var(mom_kin_5th_axis_max_limit) + set 5range [expr $5xmax - $5xmin] + if { $5range == 0 } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "5th axis maximum axis limit can not be equal to \ + minimum axis limit!" + return TCL_ERROR + } elseif { $5xmax < 0 && $5xmin < 0 } { + tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "5th axis limits can not both be negative" + return TCL_ERROR + } + } + } +return TCL_OK +} + +#================================================================================= +proc UI_PB_mach_CreateTabAttr { mach_page_obj } { +#================================================================================= + global mom_kin_var + global rest_mom_kin_var + + # restores the mom_kin_var + array set rest_mom_kin_var [array get mom_kin_var] +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_main.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_main.tcl new file mode 100644 index 0000000..4ee61cc --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_main.tcl @@ -0,0 +1,886 @@ +################################################################################ +# ************** # +# ui_pb_main.tcl # +# ************** # +# Entry program to Postino # +#------------------------------------------------------------------------------# +# # +# Copyright (c) 1999, Unigraphics Solutions Inc. # +# # +# See the file "license.terms" for information on usage and redistribution # +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. # +# # +# # +# Description # +# This file contains all the main procedures of post builder. # +# # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 gsl Initial # +# 07-Apr-1999 mnb Changed bitmap names # +# 19-May-1999 gsl Added more options to "Help" pulldown menu. # +# 20-May-1999 gsl Renamed from "post_builder.tcl". # +# 27-May-1999 gsl Added Help icons. # +# 02-Jun-1999 mnb V16 Code Integration # +# 03-Jun-1999 gsl Added Ballon & Context Sensitive Help icons. # +# 10-Jun-1999 mnb source pb_proc_parser.tcl, to display event procedure # +# 14-Jun-1999 mnb Attached Tab procedure to Preview page # +# 15-Jun-1999 mnb Removed puts # +# 29-Jun-1999 mnb Made pb_book as global variable # +# 26-Jul-1999 gsl Move UI_PB_main_menu to post_builder.c. # +# 07-Sep-1999 mnb Updates the current page data .. whenever save is # +# selected # +# 06-Oct-1999 gsl Added Context Sensitive Help mechanism. # +# 18-Oct-1999 gsl Minor changes # +# 22-Oct-1999 gsl Added use of UI_PB_com_CreateTransientWinow. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# 23-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +################################################################################ +global env +global tixOption + +#+++++++++++++++++++++++++++++++++++++++++++++++++++ +# Various attributes that can be set in PostBuilder +#+++++++++++++++++++++++++++++++++++++++++++++++++++ + tix addbitmapdir [tixFSJoin $env(PB_HOME) images] + + set paOption(title_bg) darkSeaGreen3 + set paOption(title_fg) lightYellow + set paOption(table_bg) lightSkyBlue + set paOption(app_bg) #9676a2 ;# #b87888 + set paOption(tree_bg) lightYellow ;#fefae0 Linen SeaShell Ivory MintCream + set paOption(butt_bg) Gold1 ;# #f0da1c + set paOption(app_butt_bg) #d0c690 ;# #a8d464 #b0868e + set paOption(can_bg) #ace8d2 + set paOption(can_trough_bg) #7cdabc + set paOption(trough_bg) #f0da1c + set paOption(trough_wd) 12 + set paOption(file) [tix getimage pb_textfile] + set paOption(folder) [tix getimage pb_folder] + set paOption(format) [tix getimage pb_format] + set paOption(address) [tix getimage pb_address] + set paOption(popup) #e3e3e3 + set paOption(seq_bg) yellow ;#Aquamarine1 AntiqueWhite CadetBlue1 #8ceeb6 #f8de58 + set paOption(seq_fg) blue3 ;#Purple4 NavyBlue Purple3 + set paOption(event) skyBlue3 + set paOption(cell_color) paleTurquoise + set paOption(active_color) burlyWood1 + set paOption(focus) lightYellow + set paOption(balloon) yellow + set paOption(select_clr) orange ;# YellowGreen PaleGreen1 Orchid + set paOption(menu_bar_bg) lightBlue ;# Aquamarine1 + set paOption(text) lightSkyBlue + set paOption(disabled_fg) gray + set paOption(tree_disabled_fg) lightGray + + option add *Menu.background gray95 + option add *Menu.activeBackground blue + option add *Menu.activeForeground yellow + option add *Menu.selectColor $paOption(select_clr) + option add *Menu.activeBorderWidth 0 + option add *Menu.font {helvetica 10 bold} + + option add *Button.cursor hand2 + option add *Button.activeBackground $paOption(focus) + option add *Button.activeForeground black + option add *Button.disabledForeground $paOption(disabled_fg) + option add *Menubutton.cursor hand2 + option add *Menubutton.activeBackground $paOption(focus) + option add *Checkbutton.cursor hand2 + option add *Checkbutton.activeBackground $paOption(focus) + option add *Checkbutton.disabledForeground $paOption(disabled_fg) + option add *Checkbutton.selectColor $paOption(select_clr) + option add *Radiobutton.cursor hand2 + option add *Radiobutton.activeBackground $paOption(focus) + option add *Radiobutton.disabledForeground $paOption(disabled_fg) + option add *Radiobutton.selectColor $paOption(select_clr) + option add *TixOptionMenu.cursor hand2 + + option add *TixNoteBook.tagPadX 6 + option add *TixNoteBook.tagPadY 4 + option add *TixNoteBook.borderWidth 2 + option add *TixNoteBook.font {helvetica 14 bold} + + option add *TixLabelFrame.label.font $tixOption(italic_font) + + +source $env(PB_DIR)/ui/ui_pb_tclindex.tcl +source $env(PB_DIR)/ui/ui_pb_resource.tcl +source $env(PB_DIR)/dbase/pb_file.tcl +##source $env(PB_DIR)/dbase/pb_mdfa.tcl +source $env(PB_DIR)/dbase/pb_proc_parser.tcl +source $env(PB_DIR)/ui/ui_pb_file.tcl +source $env(PB_DIR)/ui/ui_pb_class.tcl +source $env(PB_DIR)/ui/ui_pb_method.tcl +source $env(PB_DIR)/ui/ui_pb_sequence.tcl +source $env(PB_DIR)/ui/ui_pb_toolpath.tcl +source $env(PB_DIR)/ui/ui_pb_common.tcl +source $env(PB_DIR)/ui/ui_pb_balloon.tcl +source $env(PB_DIR)/ui/ui_pb_context_help.tcl + +#=============================================================================== +proc UI_PB_main {w} { +#=============================================================================== + global auto_path gPB_dir + global paOption tixOption + global gPB + + #************************************** + # Initialize "my" window manager stuff + #************************************** + set gPB(active_window_list) {} + set gPB(active_window) "" + set gPB(top_window) "" + set gPB(top_window).new "" + set gPB(top_window).open "" + set gPB(main_window) "" + set gPB(main_window_disabled) 0 + set gPB(toplevel_list) {} + + #*************************************************************** + # Define some font styles + #--------------------------------------------------------------- + # Following attributes are available to the Display Items. + # However, most of them will be overwritten by the properties + # of the HList. Therefore, no need to specify them here. + # + # activeBackground activeForeground + # anchor background + # disabledBackground disabledForeground + # foreground font + # justify padX + # padY selectBackground + # selectForeground wrapLength + # + #*************************************************************** + set gPB(font_style_normal) [tixDisplayStyle imagetext \ + -bg $paOption(tree_bg) -padx 4 -pady 1 -font $tixOption(font) \ + -selectforeground blue] + + set gPB(font_style_bold) [tixDisplayStyle imagetext \ + -bg $paOption(tree_bg) -padx 4 -pady 2 -font $tixOption(bold_font) \ + -selectforeground blue] + + set gPB(font_style_normal_gray) [tixDisplayStyle imagetext \ + -fg $paOption(tree_disabled_fg) \ + -bg $paOption(tree_bg) \ + -padx 4 -pady 1 -font $tixOption(font)] + + set gPB(font_style_bold_gray) [tixDisplayStyle imagetext \ + -fg $paOption(tree_disabled_fg) \ + -bg $paOption(tree_bg) \ + -padx 4 -pady 2 -font $tixOption(bold_font)] + + + if ![info exists gPB_dir] { + # Initialize the auto_path and the bitmap directory. The gPB_dir + # variable would be already set by the test program, if we are + # running in the self test more + # + set script [info script] + if {$script != {}} { + set gPB_dir [file dirname $script] + } else { + set gPB_dir [pwd] + } + + set gPB_dir [tixFSAbsPath $gPB_dir] + } + + lappend auto_path $gPB_dir + tix addbitmapdir [tixFSJoin $gPB_dir bitmaps] + + toplevel $w + wm title $w "Unigraphics Post Builder" + wm geometry $w 1000x110+100+20 + wm resizable $w 0 0 + wm protocol $w WM_DELETE_WINDOW "UI_PB_ExitPost" + + $w config -bg $paOption(app_bg) + + set gPB(top_window) $w + UI_PB_com_ClaimActiveWindow $w + + set main_menu [UI_PB__main_menu $w] + set status [UI_PB__main_status $w] + + # Save away main menu id to be used in Context Help + set gPB(main_menu) $main_menu + + pack $main_menu -side top -fill x + pack $status -side bottom -fill x + + # Register Context Sensitive Help for menu-bar items + set mb $gPB(main_menu_bar) + set gPB(c_help,$mb.file) "main,file" + set gPB(c_help,$mb.option) "main,options" + set gPB(c_help,$mb.help) "main,help" + + # Register Context Sensitive Help for tool palette items + set gPB(c_help,[$main_menu.tool subwidget new]) "tool,new" + set gPB(c_help,[$main_menu.tool subwidget open]) "tool,open" + set gPB(c_help,[$main_menu.tool subwidget save]) "tool,save" + set gPB(c_help,[$main_menu.help subwidget bal]) "tool,bal" + set gPB(c_help,[$main_menu.help subwidget wtd]) "tool,what" + set gPB(c_help,[$main_menu.help subwidget dia]) "tool,dialog" + set gPB(c_help,[$main_menu.help subwidget man]) "tool,manual" + + # Configures the file options + $mb.file.m entryconfigure 4 -state disabled + $mb.file.m entryconfigure 5 -state disabled + $mb.file.m entryconfigure 6 -state disabled + + # Configures the tixselect icons + [$main_menu.tool subwidget save] config -state disabled + + # Find active Entry widget background color + if ![info exists gPB(entry_color)] \ + { + entry .xxxentry + set gPB(entry_color) [lindex [.xxxentry config -bg] end] + tixDestroy .xxxentry + } +} + +#------------------------------------------------------------------------------- +proc CB_HelpCmd { w opt } { +#------------------------------------------------------------------------------- + global gPB + + # Keep first 3 buttons always popped to behave like action buttons + switch -exact -- $w \ + { + man - + dia - + wtd { + set idx [lsearch $gPB(help_sel_var) $w] + if {$idx >= 0} { + set gPB(help_sel_var) [lreplace $gPB(help_sel_var) $idx $idx] + } else { + # To prevent CB from being called twice + # due to button's value changed twice. + return + } + } + } + + # Take action + switch -exact -- $w \ + { + man { HelpCmd_man $w } + dia { HelpCmd_dia $w } + wtd { HelpCmd_wtd $w } + bal { HelpCmd_bal $w } + inf { HelpCmd_inf $w } + } +} + +#------------------------------------------------------------------------------- +proc HelpCmd_inf { w } { +#------------------------------------------------------------------------------- + global gPB + + if {[lsearch $gPB(help_sel_var) $w] >= 0} { + set gPB(use_info) 1 + } else { + set gPB(use_info) 0 + } + + UI_PB_chelp_SetContextHelp +} + +#------------------------------------------------------------------------------- +proc HelpCmd_bal { w } { +#------------------------------------------------------------------------------- + global gPB + + if {[lsearch $gPB(help_sel_var) $w] >= 0} { + set gPB(use_bal) 1 + } else { + set gPB(use_bal) 0 + } + + SetBalloonHelp +} + +#------------------------------------------------------------------------------- +proc HelpCmd_wtd { w } { +#------------------------------------------------------------------------------- +return [tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "Pending implementation"] +} + +#------------------------------------------------------------------------------- +proc HelpCmd_dia { w } { +#------------------------------------------------------------------------------- +return [tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "Pending implementation"] +} + +#------------------------------------------------------------------------------- +proc HelpCmd_man { w } { +#------------------------------------------------------------------------------- +return [tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "Pending implementation"] +} + +#------------------------------------------------------------------------------- +proc SetBalloonHelp {} { +#------------------------------------------------------------------------------- + global gPB + global gPB_use_balloons gPB_help_tips + + set gPB_use_balloons $gPB(use_bal) + set gPB_help_tips(state) $gPB(use_bal) + + # Reset Balloon Tip button + set idx [lsearch $gPB(help_sel_var) bal] + + if { $gPB(use_bal) && $idx >= 0 } \ + { + return + } elseif { !$gPB(use_bal) && $idx < 0 } \ + { + return + } else \ + { + # Set the button + if { $gPB(use_bal) } \ + { + set gPB(help_sel_var) [linsert $gPB(help_sel_var) 0 bal] + } else \ + { + set gPB(help_sel_var) [lreplace $gPB(help_sel_var) $idx $idx] + } + } +} + +#------------------------------------------------------------------------------- +proc SetContextHelp {} { +#------------------------------------------------------------------------------- + global gPB + + # Reset Context Help button + set idx [lsearch $gPB(help_sel_var) inf] + + if { $gPB(use_info) && $idx >= 0 } \ + { +puts "Context Help On" + + # Retrive toplevels currently available + # + for {set i 0} {$i < [llength $gPB(active_window_list)]} {incr i} \ + { + set tw [lindex $gPB(active_window_list) $i] + +puts "---------------------" +puts "Toplevel found -> $tw" +puts "---------------------" + + set wlist [tixDescendants $tw] + for {set j 0} {$j < [llength $wlist]} {incr j} \ + { + set witem [lindex $wlist $j] + +##puts "Widget : $witem" + + if ![catch {set cur [$witem config -cursor]} result] { + + #============================================================ + # Remember to leave the Scrollers alone! + #============================================================ + + #============================================================ + # We should change cursor only for those who have registered + # the callback for context sensitive help + #============================================================ + if [info exists gPB(c_help,$witem)] { +##puts " with csh = $witem" +# set gPB(c_help,cursor,$witem) [lindex $cur end] +# $witem config -cursor question_arrow +# set gPB(c_help,b1,$witem) [bind $witem <1>] +# bind $witem <1> "PB_context_help $w \[winfo -displayof $w containing %X %Y]" +# grab $w + } + } + } + } + +return [tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error \ + -message "Pending implementation"] + } elseif { !$gPB(use_info) && $idx < 0 } \ + { +puts "Context Help Off" + set wlist [tixDescendants $gPB(top_window)] + for {set i 0} {$i < [llength $wlist]} {incr i} \ + { + set witem [lindex $wlist $i] + if [info exists gPB(c_help,cursor,$witem)] { + $witem config -cursor $gPB(c_help,cursor,$witem) + } + } + return + } +} + +#=============================================================================== +proc UI_PB_ExitPost { args } { +#=============================================================================== + global gPB + + if { [info exists gPB(main_window)] && $gPB(main_window) != "" } \ + { + # Calls the post close proceuder + set choice [UI_PB_ClosePost] + if { $choice == "yes" || $choice == "no" } \ + { + exit + } + } else \ + { + exit + } +} + +#=============================================================================== +proc UI_PB_save_a_post { args } { +#=============================================================================== + global gPB + + # Updates the current page objects + UI_PB_UpdateCurrentBookPageAttr gPB(book) + + # Outputs the Def & TCL files + PB_CreateDefTclFiles + + set gPB(session) EDIT +} + +#=============================================================================== +proc UI_PB_ClosePost {args} { +#=============================================================================== + global gPB + + set choice [tk_messageBox -parent $gPB(active_window) -type yesnocancel \ + -icon question -message "Save your changes before closing\ + the Post in progress"] + + if { $choice == "yes" } \ + { + # Saves the post + UI_PB_SavePost + + # Deletes the post widgets & objects + if { $gPB(session) == "EDIT" } \ + { + # Delete all toplevel windows + # + UI_PB_com_DeleteTopLevelWindows + + } else \ + { +return + } + } elseif { $choice == "no" } \ + { + # Delete all toplevel windows + # + UI_PB_com_DeleteTopLevelWindows + } + +return $choice +} + +#------------------------------------------------------------------------------- +proc DeletePostWidgets { } { +#------------------------------------------------------------------------------- + global gPB + + # Clean up tixGrid + if [info exists gPB(tix_grid)] \ + { + global addr_app_text + + PB_int_AddrSummaryAttr addr_name_list addr_app_text addr_desc_arr + set no_addr [llength $addr_name_list] + for {set count 0} {$count < [expr $no_addr + 1]} {incr count} \ + { + $gPB(tix_grid) delete row $count + } + unset gPB(tix_grid) + } + + # Activates the file menu options + UI_PB_EnableFileOptions + + #=================================== + # We MUST delete all Post objects!!! + #=================================== +} + +#=============================================================================== +proc UI_PB_main_window {args} { +#=============================================================================== + global paOption + global gPB + + + # Fresh start a main window... + if { [info exists gPB(main_window)] } { + unset gPB(main_window) + } + + # Create main window + set mw [toplevel $gPB(top_window).main] + UI_PB_com_CreateTransientWindow $mw "Post Processor" "1000x700+100+165" \ + "UI_PB_ClosePost" "DeletePostWidgets" 0 + + set gPB(main_window) $mw + + set ww [tixScrolledWindow $mw.scr] + [$ww subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$ww subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + pack $ww -expand yes -fill both -padx 3 -pady 3 + set sw [$ww subwidget window] + + set w [tixNoteBook $sw.nb -ipadx 3 -ipady 3] + [$w subwidget nbframe] config -backpagecolor $paOption(app_bg) \ + -tabpadx 0 -tabpady 0 + bind [$w subwidget nbframe] "UI_PB_NoteBookTabBinding $w %x %y" + + set gPB(book) [new Book w] + + Book::CreatePage $gPB(book) mac "Machine Tool" pb_machine \ + UI_PB_MachineTool UI_PB_MachToolTab + + Book::CreatePage $gPB(book) pro "Program & Tool Path" pb_prog \ + UI_PB_ProgTpth UI_PB_ProgTpthTab + + Book::CreatePage $gPB(book) def "N/C Data Definitions" pb_mcd \ + UI_PB_Def UI_PB_DefTab + + Book::CreatePage $gPB(book) lis "Listing File" pb_listing \ + UI_PB_List UI_PB_ListTab + + Book::CreatePage $gPB(book) pre "Files Preview" pb_output \ + UI_PB_Preview UI_PB_PreviewTab + + Book::CreatePage $gPB(book) adv "Post Advisor" pb_advisor \ + UI_PB_Advisor UI_PB_AdvisorTab + + set Book::($gPB(book),x_def_tab_img) 0 + set Book::($gPB(book),current_tab) -1 + + pack $w -expand yes -fill both +} + +#=============================================================================== +proc UI_PB_NoteBookTabBinding { book_id x y } { +#=============================================================================== + global machTree + + if { [info exists machTree] && ([UI_PB__MachToolValidation] == "bad") } { + return + } else { + tixNoteBook:MouseDown $book_id $x $y + } +} + +#=============================================================================== +proc UI_PB_MachToolTab { book_id page_img book_obj } { +#=============================================================================== + CB_nb_def $book_id $page_img $book_obj + UI_PB_DeleteBookAttr book_obj + set Book::($book_obj,current_tab) 0 + UI_PB_UpdateBookAttr book_obj +} + +#=============================================================================== +proc UI_PB_ProgTpthTab { book_id page_img book_obj } { +#=============================================================================== + CB_nb_def $book_id $page_img $book_obj + UI_PB_DeleteBookAttr book_obj + set Book::($book_obj,current_tab) 1 + UI_PB_UpdateBookAttr book_obj +} + +#=============================================================================== +proc UI_PB_DefTab { book_id page_img book_obj } { +#=============================================================================== + CB_nb_def $book_id $page_img $book_obj + UI_PB_DeleteBookAttr book_obj + set Book::($book_obj,current_tab) 2 + UI_PB_UpdateBookAttr book_obj +} + +#=============================================================================== +proc UI_PB_ListTab { book_id page_img book_obj } { +#=============================================================================== + CB_nb_def $book_id $page_img $book_obj + UI_PB_DeleteBookAttr book_obj + set Book::($book_obj,current_tab) 3 + UI_PB_UpdateBookAttr book_obj +} + +#=============================================================================== +proc UI_PB_PreviewTab { book_id page_img book_obj } { +#=============================================================================== + CB_nb_def $book_id $page_img $book_obj + UI_PB_DeleteBookAttr book_obj + set Book::($book_obj,current_tab) 4 + UI_PB_UpdateBookAttr book_obj +} + +#=============================================================================== +proc UI_PB_AdvisorTab { book_id page_img book_obj } { +#=============================================================================== + CB_nb_def $book_id $page_img $book_obj + UI_PB_DeleteBookAttr book_obj + set Book::($book_obj,current_tab) 5 + UI_PB_UpdateBookAttr book_obj +} + +#=============================================================================== +proc UI_PB__MachToolValidation {} { +#=============================================================================== + global machTree axisoption + + if { [info exists machTree] } { + switch -- $axisoption { + "3" { + set axis_type 3 + } + "4H" - + "4T" { + set axis_type 4 + } + "5TT" - + "5HH" - + "5HT" { + set axis_type 5 + } + } + return [ValidateMachObjAttr $machTree $axis_type] + } +} + +#=============================================================================== +proc UI_PB_DeleteBookAttr { BOOK_OBJ } { +#=============================================================================== + upvar $BOOK_OBJ book_obj + + switch -exact -- $Book::($book_obj,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 0] + global mom_kin_var + PB_int_UpdateKinVar mom_kin_var + } + 1 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 1] + if {[info exists Page::($page_obj,book_obj)]} \ + { + set page_book_obj $Page::($page_obj,book_obj) + UI_PB_progtpth_DeleteTabAtt page_book_obj + } + } + 2 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 2] + if {[info exists Page::($page_obj,book_obj)]} \ + { + set page_book_obj $Page::($page_obj,book_obj) + UI_PB_Def_UpdatePrevTabElems page_book_obj + } + } + 3 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 3] + } + 4 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 4] + } + 5 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 5] + } + } +} + +#=============================================================================== +proc UI_PB_UpdateBookAttr { BOOK_OBJ } { +#=============================================================================== + upvar $BOOK_OBJ book_obj + + switch -exact -- $Book::($book_obj,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 0] + UI_PB_mach_CreateTabAttr $page_obj + } + 1 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 1] + if {[info exists Page::($page_obj,book_obj)]} \ + { + set page_book_obj $Page::($page_obj,book_obj) + UI_PB_progtpth_CreateTabAttr page_book_obj + } + } + 2 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 2] + if {[info exists Page::($page_obj,book_obj)]} \ + { + set page_book_obj $Page::($page_obj,book_obj) + UI_PB_Def_CreateTabAttr page_book_obj + } + } + 3 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 3] + } + 4 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 4] + if {[info exists Page::($page_obj,book_obj)]} \ + { + set page_book_obj $Page::($page_obj,book_obj) + UI_PB_prv_CreateTabAttr page_book_obj + } + } + 5 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 5] + } + } +} + +#=============================================================================== +proc UI_PB_UpdateProgTpthBook { PRG_BOOK } { +#=============================================================================== + upvar $PRG_BOOK prg_book + + switch -exact -- $Book::($prg_book,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($prg_book,page_obj_list) 0] + UI_PB_evt_GetSequenceIndex page_obj seq_index + set seq_obj [lindex $Page::($page_obj,seq_obj_list) $seq_index] + } + + 1 { + set page_obj [lindex $Book::($prg_book,page_obj_list) 1] + UI_PB_gcd_ApplyGcodeData $prg_book $page_obj + } + + 2 { + set page_obj [lindex $Book::($prg_book,page_obj_list) 2] + UI_PB_gcd_ApplyMcodeData $prg_book $page_obj + } + + 3 { + set page_obj [lindex $Book::($prg_book,page_obj_list) 3] + UI_PB_ads_UpdateAddressObjects + } + + 4 { + set page_obj [lindex $Book::($prg_book,page_obj_list) 4] + UI_PB_mseq_ApplyMastSeq page_obj + } + } +} + +#=============================================================================== +proc UI_PB_UpdateNCDefBoock { DEF_BOOK } { +#=============================================================================== + upvar $DEF_BOOK def_book + + switch -exact -- $Book::($def_book,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($def_book,page_obj_list) 0] + UI_PB_blk_BlkApplyCallBack $page_obj + } + + 1 { + set page_obj [lindex $Book::($def_book,page_obj_list) 1] + UI_PB_addr_ApplyCurrentAddrData page_obj + } + + 2 { + set page_obj [lindex $Book::($def_book,page_obj_list) 2] + UI_PB_fmt_ApplyCurrentFmtData page_obj + } + + 3 { + set page_obj [lindex $Book::($def_book,page_obj_list) 3] + UI_PB_oth_ApplyOtherAttr + } + } +} + +#=============================================================================== +proc UI_PB_UpdateCurrentBookPageAttr { PB_BOOK } { +#=============================================================================== + upvar $PB_BOOK book + + switch -exact -- $Book::($book,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($book,page_obj_list) 0] + global mom_kin_var + PB_int_UpdateKinVar mom_kin_var + } + + 1 { + set page_obj [lindex $Book::($book,page_obj_list) 1] + if {[info exists Page::($page_obj,book_obj)]} \ + { + set page_book_obj $Page::($page_obj,book_obj) + UI_PB_UpdateProgTpthBook page_book_obj + } + } + + 2 { + set page_obj [lindex $Book::($book,page_obj_list) 2] + if {[info exists Page::($page_obj,book_obj)]} \ + { + set page_book_obj $Page::($page_obj,book_obj) + UI_PB_UpdateNCDefBoock page_book_obj + } + } + + 3 { + set page_obj [lindex $Book::($book,page_obj_list) 3] + } + + 4 { + set page_obj [lindex $Book::($book,page_obj_list) 4] + if {[info exists Page::($page_obj,book_obj)]} \ + { + set page_book_obj $Page::($page_obj,book_obj) + } + } + + 5 { + set page_obj [lindex $Book::($book,page_obj_list) 5] + } + } +} + +#------------------------------------------------------------------------------- +proc UI_PB__main_status {top} { +#------------------------------------------------------------------------------- + global gPB + + set w [frame $top.f3 -relief raised -bd 1] + set gPB(statusbar) \ + [label $w.status -font {helvetica 12 bold} -bg Black -fg Gold1 \ + -relief sunken -bd 1 -textvariable gPB(menu_bar_status)] + + set gPB(menu_bar_status) "Thank you for using UG Post Builder" + + tixForm $gPB(statusbar) -padx 3 -pady 3 -left 0 -right %70 + return $w +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_mcode.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_mcode.tcl new file mode 100644 index 0000000..7eddab0 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_mcode.tcl @@ -0,0 +1,147 @@ +#============================================================================== +# UI_PB_MCODE.TCL +#============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Mcode page. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-Apr-1999 mnb Attached callbacks to action buttons # +# 06-May-1999 gsl Removed redundant frames. # +# 02-Jun-1999 mnb Code Integration # +# 07-Sep-1999 mnb Validates the data entered in the entry widget, # +# based upon the address format # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================== +proc UI_PB_ProgTpth_Mcode {book_id page_obj} { +#============================================================================== + global paOption + + set Page::($page_obj,page_id) [$book_id subwidget \ + $Page::($page_obj,page_name)] + set page_id $Page::($page_obj,page_id) + + PB_int_MCodePageAttributes m_codes_desc m_codes_mom_var + set Page::($page_obj,m_codes_mom_var) [array get m_codes_mom_var] + set no_mcodes [array size m_codes_mom_var] + + set top_frm [frame $page_id.top -relief sunken -bd 1] + set act_frm [frame $page_id.actfm] + pack $top_frm -side top -expand yes -padx 3 + pack $act_frm -side bottom -fill both -expand yes + + + # Creates Action buttons + UI_PB_mcd_CreateActionButtons $act_frm page_obj + + set first_col [frame $top_frm.1 -relief sunken -bd 3] + grid $first_col -padx 5 -pady 5 + + set Page::($page_obj,mcode_frm) $first_col + set data_type "a" + for {set count 0} {$count < $no_mcodes} {incr count} \ + { + UI_PB_com_CreateRowAttr $first_col $count $m_codes_desc($count) \ + $m_codes_mom_var($count) $data_type + } +} + +#=============================================================================== +proc UI_PB_mcd_CreateActionButtons { act_frm PAGE_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global paOption + set box [tixButtonBox $act_frm.act \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + + pack $box -side bottom -fill x -padx 3 -pady 3 + + $box add def -text Default -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_mcd_DefaultCallBack $page_obj" + $box add res -text Restore -width 10 -bg $paOption(app_butt_bg) \ + -command "UI_PB_mcd_RestoreCallBack $page_obj" +} + +#======================================================================= +proc UI_PB_mcd_DefaultCallBack { page_obj } { +#======================================================================= + global mom_sys_arr + + array set mcode_vars $Page::($page_obj,m_codes_mom_var) + PB_int_RetDefMOMVarValues mcode_vars def_mcode_value + + set no_mcodes [array size mcode_vars] + for {set count 0} { $count < $no_mcodes } { incr count} \ + { + set mom_var $mcode_vars($count) + set data_type [UI_PB_com_RetSysVarDataType mom_var] + set mom_sys_arr($mom_var) [UI_PB_com_RetValByDataType \ + $def_mcode_value($mom_var) $data_type] + } +} + +#======================================================================= +proc UI_PB_mcd_RestoreCallBack { page_obj } { +#======================================================================= + global mom_sys_arr + + array set rest_mcode_var_value $Page::($page_obj,rest_mcode_var_value) + array set mcode_vars $Page::($page_obj,m_codes_mom_var) + + set no_mcodes [array size mcode_vars] + for {set count 0} { $count < $no_mcodes } { incr count} \ + { + set mom_var $mcode_vars($count) + set data_type [UI_PB_com_RetSysVarDataType mom_var] + set mom_sys_arr($mom_var) [UI_PB_com_RetValByDataType \ + $rest_mcode_var_value($mom_var) $data_type] + } +} + +#======================================================================= +proc UI_PB_mcd_ApplyMcodeData { book_obj page_obj } { +#======================================================================= + global mom_sys_arr + + PB_int_UpdateMOMVar mom_sys_arr +} + +#======================================================================= +proc UI_PB_mcd_RestoreMcodeData { page_obj } { +#======================================================================= + global mom_sys_arr + array set mcode_vars $Page::($page_obj,m_codes_mom_var) + set no_mcodes [array size mcode_vars] + + set mcode_frm $Page::($page_obj,mcode_frm) + set data_type "a" + for {set count 0} {$count < $no_mcodes} {incr count} \ + { + set mcode_var $mcode_vars($count) + set rest_mcode_var_value($mcode_var) $mom_sys_arr($mcode_var) + + set data_type [UI_PB_com_RetSysVarDataType mcode_var] + set mom_sys_arr($mcode_var) [UI_PB_com_RetValByDataType \ + $mom_sys_arr($mcode_var) $data_type] + bind $mcode_frm.$count.1_int "UI_PB_com_ValidateDataOfEntry \ + %W %K $data_type" + } + + if {[info exists rest_mcode_var_value]} \ + { + set Page::($page_obj,rest_mcode_var_value) \ + [array get rest_mcode_var_value] + } +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_method.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_method.tcl new file mode 100644 index 0000000..d9c0a0d --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_method.tcl @@ -0,0 +1,466 @@ +#======================================================================== +# UI_PB_METHODS.TCL +#======================================================================== +############################################################################## +# Description # +# This file contains all the methods of the ui classes. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-Apr_1999 mnb Changed bitmap name # +# 02-Jun-1999 mnb Code Integration # +# 14-Jun-1999 gsl Made tixControl react to the user's key strokes # +# immaediately. # +# 07-Sep-1999 mnb Added few procedures for page class # +# 21-Sep-1999 mnb Added a new procedure, to create combo box menu # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#======================================================================== +proc UI_PB_mthd_CreateFrame {inp_frm frm_ext} { +#======================================================================== + set frame_id [frame $inp_frm.$frm_ext] + return $frame_id +} + +#======================================================================== +proc UI_PB_mthd_CreateLabel {inp_frm ext label} { +#======================================================================== + + label $inp_frm.$ext -text $label -wraplength 170 + pack $inp_frm.$ext -pady 5 +} + +#======================================================================== +proc UI_PB_mthd_CreateLblFrame {inp_frm ext label} { +#======================================================================== + tixLabelFrame $inp_frm.$ext -label $label + return $inp_frm.$ext +} + +#======================================================================== +proc UI_PB_mthd_CreateIntControl {var inp_frm ext label} { +#======================================================================== + global mom_sys_arr + global tixOption + + tixControl $inp_frm.$ext -integer true \ + -variable mom_sys_arr($var) \ + -selectmode immediate \ + -options { + entry.width 3 + label.anchor e + } + $inp_frm.$ext.frame config -relief sunken -bd 1 + $inp_frm.$ext.frame.entry config -relief flat + + if {[string compare $label ""] == 0} \ + { + set text $label + } else \ + { + set text [UI_PB_com_FormatString $label] + label $inp_frm.1_$ext -text $text -font $tixOption(font) + pack $inp_frm.1_$ext -side left -padx 20 -pady 2 + } + + pack $inp_frm.$ext -side right -padx 5 -pady 2 + +} + +#======================================================================== +proc UI_PB_mthd_CreateFloatControl {val1 val2 inp_frm ext label} { +#======================================================================== + global mom_sys_arr + global tixOption + + tixControl $inp_frm.1_$ext -integer true \ + -variable mom_sys_arr($val1) \ + -selectmode immediate \ + -options { + entry.width 2 + label.anchor e + } + + label $inp_frm.2_$ext -text "." + + tixControl $inp_frm.3_$ext -integer true \ + -variable mom_sys_arr($val2) \ + -selectmode immediate \ + -options { + entry.width 2 + label.anchor e + } + $inp_frm.1_$ext.frame config -relief sunken -bd 1 + $inp_frm.1_$ext.frame.entry config -relief flat + $inp_frm.3_$ext.frame config -relief sunken -bd 1 + $inp_frm.3_$ext.frame.entry config -relief flat + + if {[string compare $label ""] == 0} \ + { + set text $label + } else \ + { + set text [format %-20s $label] + } + + label $inp_frm.4_$ext -text $text -font $tixOption(font) + pack $inp_frm.4_$ext $inp_frm.1_$ext $inp_frm.2_$ext \ + $inp_frm.3_$ext -side left + +} + +#======================================================================== +proc UI_PB_mthd_CreateLblEntry { data_type var inp_frm ext label} { +#======================================================================== + global mom_sys_arr + global tixOption + + if {[string compare $label ""] == 0} \ + { + set text $label + } else \ + { + set text [format %-20s $label] + } + + label $inp_frm.$ext -text $text -font $tixOption(font) + entry $inp_frm.1_$ext -width 10 -relief sunken -bd 2 \ + -textvariable mom_sys_arr($var) + + pack $inp_frm.$ext -side left -padx 5 -pady 5 + pack $inp_frm.1_$ext -side right -padx 5 -pady 5 + + if { $data_type == "a" } \ + { + set data_type [UI_PB_com_RetSysVarDataType var] + } + + bind $inp_frm.1_$ext "UI_PB_com_ValidateDataOfEntry %W %K \ + $data_type" + bind $inp_frm.1_$ext {%W config -state normal } +} + +#======================================================================== +proc UI_PB_mthd_CreateCheckButton {var inp_frm ext label} { +#======================================================================== + global mom_sys_arr + set text $label + checkbutton $inp_frm.$ext -text "$text" \ + -variable mom_sys_arr($var) \ + -relief flat -bd 2 -anchor w + + pack $inp_frm.$ext -side left -padx 5 +} + +#======================================================================== +proc UI_PB_mthd_CreateButton { inp_frm ext label} { +#======================================================================== + + set text [format %-20s $label] + button $inp_frm.$ext -text "$text" + + pack $inp_frm.$ext -padx 50 -anchor c + +} + +#======================================================================== +proc UI_PB_mthd_CreateRadioButton { var inp_frm ext label } { +#======================================================================== + global mom_sys_arr + set text [join [split $label " "] _] + radiobutton $inp_frm.$ext -text $label -variable mom_sys_arr($var) \ + -value $text + pack $inp_frm.$ext -side left -padx 5 +} + +#======================================================================== +proc UI_PB_mthd_CreateEntry { var inp_frm ext } { +#======================================================================== + global mom_sys_arr + + entry $inp_frm.1_$ext -width 30 -relief sunken -bd 2 \ + -textvariable mom_sys_arr($var) -state disabled + + pack $inp_frm.1_$ext -side left + +} + +#======================================================================== +proc UI_PB_mthd_CreateOptionalMenu { var inp_frm ext option_list \ + label } { +#======================================================================== + global mom_sys_arr + set temp_value $mom_sys_arr($var) + + if { [string compare $label ""] == 0} \ + { + set text "" + } else \ + { + set text [format %-25s $label] + } + + tixOptionMenu $inp_frm.$ext -label $text \ + -variable mom_sys_arr($var) \ + -options { + menubutton.width 25 + } + + foreach option $option_list \ + { + set temp_opt [split $option " "] + set opt [join $temp_opt _] + $inp_frm.$ext add command $opt -label $option + unset temp_opt opt + } + + $inp_frm.$ext config -value $temp_value + pack $inp_frm.$ext -padx 3 -pady 10 +} + +#======================================================================== +proc UI_PB_mthd_CreatePane {this} { +#======================================================================== + global paOption + set page_id $Page::($this,page_id) + set pane [tixPanedWindow $page_id.pane -orient horizontal] + pack $pane -expand yes -fill both + + set f1 [$pane add p1 -expand 1 -size 225] + set f2 [$pane add p2 -expand 1 -size 675] + set Page::($this,left_pane_id) $f1 + + $f1 config -relief flat + $f2 config -relief flat + + set p2s [$pane subwidget p2] + set p2p [frame $p2s.pp] + pack $p2p -expand yes -fill both + + tixScrolledWindow $p2p.scr + [$p2p.scr subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$p2p.scr subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + pack $p2p.scr -padx 5 -expand yes -fill both + + set p2t [$p2p.scr subwidget window] + set sec_frm [frame $p2t.f] + pack $sec_frm -expand yes -fill both + set Page::($this,canvas_frame) $sec_frm +} + +#======================================================================== +proc UI_PB_mthd_CreateTree {this} { +#======================================================================== + global paOption + global tixOption + + set left_pane $Page::($this,left_pane_id) + + # Tree + set tree [tixTree $left_pane.slb \ + -options { + hlist.indicator 1 + hlist.indent 20 + hlist.drawbranch 1 + hlist.selectMode single + hlist.width 40 + hlist.separator "." + hlist.wideselect false + }] + set Page::($this,tree) $tree + + [$tree subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$tree subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + pack $tree -side top -fill both -expand yes -padx 5 + +} + +#======================================================================== +proc UI_PB_mthd_CreateCheckList {this} { +#======================================================================== + global paOption + global tixOption + + set left_pane $Page::($this,left_pane_id) + + # Tree + set tree [tixCheckList $left_pane.slb \ + -options { + relief sunken + hlist.indicator 1 + hlist.indent 20 + hlist.drawbranch 1 + hlist.selectMode single + hlist.width 40 + hlist.separator "." + hlist.wideselect false + }] + set Page::($this,tree) $tree + + [$tree subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$tree subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + pack $tree -side top -fill both -expand yes -padx 5 + +} + +#======================================================================== +proc UI_PB_mthd_CreateCanvas {this TOP_CANVAS_DIM BOT_CANVAS_DIM} { +#======================================================================== + upvar $TOP_CANVAS_DIM top_canvas_dim + upvar $BOT_CANVAS_DIM bot_canvas_dim + global paOption + + # Gets the canvas frame id + set WIDGET $Page::($this,canvas_frame) + + set seq_canvas_id [frame $WIDGET.frame] + set box [tixButtonBox $WIDGET.box \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg yellow] + pack $seq_canvas_id -side top -fill both -expand yes + pack $box -side bottom -fill x -padx 3 -pady 3 + + # Creates top canvas + set top_canvas [canvas $seq_canvas_id.top] + + # configures the height and width of the top canvas + $top_canvas config -height $top_canvas_dim(0) -width $top_canvas_dim(1) + pack $top_canvas -side top -fill x -padx 3 + + # Supress highlight color of top canvas + set bc [$top_canvas config -background] + $top_canvas config -highlightcolor [lindex $bc end] + + # Bottom Canvas + # Create the horizontal scrollers for bottom canvas + set hs [scrollbar $seq_canvas_id.hs -orient horizontal \ + -troughcolor $paOption(can_trough_bg) \ + -width $paOption(trough_wd) \ + -command "$seq_canvas_id.bot xview"] + + # Create the vertical scrollers for bottom canvas + set vs [scrollbar $seq_canvas_id.vs -orient vertical \ + -troughcolor $paOption(can_trough_bg) \ + -width $paOption(trough_wd) \ + -command "$seq_canvas_id.bot yview"] + + # Creates the bottom canvas with horizontal and vertical scrollers + set bot_canvas [canvas $seq_canvas_id.bot -relief sunken \ + -bd 2 -bg $paOption(can_bg) \ + -xscrollcommand "$seq_canvas_id.hs set" \ + -yscrollcommand "$seq_canvas_id.vs set"] + + pack $hs -side bottom -fill x + pack $bot_canvas -side left -expand yes -fill both -padx 3 + pack $vs -side right -fill y + + # Configures the scrollregion for the bottom canvas + $bot_canvas config -scrollregion "0 0 $bot_canvas_dim(0) \ + $bot_canvas_dim(1)" + # Stores the top canvas and bottom canvas ids in the page object + set Page::($this,act_can_frame) $seq_canvas_id + set Page::($this,top_canvas) $top_canvas + set Page::($this,bot_canvas) $bot_canvas + set Page::($this,panel_hi) $top_canvas_dim(0) + set Page::($this,hor_scrol) $hs + set Page::($this,ver_scrol) $vs + set Page::($this,bot_height) $bot_canvas_dim(0) + set Page::($this,box) $box +} + +#======================================================================== +proc UI_PB_mthd_CreateMenu { this } { +#======================================================================== + # Gets the top canvas id from the page object + set top_canvas $Page::($this,top_canvas) + + # Creates a frame on top canvas to put the entry and + # menu button + set evt_frm [frame $top_canvas.f] + $top_canvas create window 495 40 -window $evt_frm + + # gets the image ids + set cbx [tix getbitmap cbxarrow] + set entry_icon [UI_PB_blk_CreateIcon $top_canvas pb_comb_entry ""] + + # Entry icon + $top_canvas create image 330 40 -image $entry_icon + $entry_icon config -relief sunken -bd 2 -bg lightBlue + set Page::($this,entry_cx) 330 + set Page::($this,entry_cy) 40 + + # Creates a menu button + menubutton $evt_frm.but -bitmap $cbx -width 17 -height 20 \ + -relief raised -menu $evt_frm.but.menu + + pack $evt_frm.but -side left -padx 1 + set comb_widget $evt_frm.but.menu + + # Creates a menu + menu $comb_widget + set Page::($this,comb_widget) $comb_widget +} + +#======================================================================== +proc UI_PB_mthd_CreateAddTrashinCanvas {this} { +#======================================================================== + global paOption + global tixOption + + # Gets the top canvas id from the page object + set top_canvas $Page::($this,top_canvas) + + # Sets the top canvas height as a attribute of page object + set panel_hi $Page::($this,panel_hi) + + # Creates the add and trash icons + set evt_cell1(trash) [UI_PB_blk_CreateIcon $top_canvas pb_trash ""] + + set add_comp [image create compound -window $top_canvas \ + -bd 1 \ + -background #c0c0ff \ + -borderwidth 2 \ + -relief raised \ + -showbackground 1] + $add_comp add text -text $Page::($this,add_name) \ + -font $tixOption(bold_font) -anchor w + + # Puts the add icons at the specified center + set dy [expr [expr $panel_hi / 2] + 2] + $top_canvas create image 80 $dy -image $add_comp \ + -tag add_movable + + # configures the background color of add icon + $add_comp config -bg $paOption(app_butt_bg) + set Page::($this,add) $add_comp + + + # Locates the Trash icon at the specified center + $top_canvas create image 610 $dy -image $evt_cell1(trash) \ + -tag evt_trash + + # Configures the background color of trash icon + $evt_cell1(trash) config -bg $paOption(app_butt_bg) + + + # Stores the trash cell id the dimensions of the trash icon + lappend trash_cell $evt_cell1(trash) [expr 610 - 80] \ + [expr 610 + 80] -$panel_hi 0 + + set Page::($this,trash) $trash_cell +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_others.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_others.tcl new file mode 100644 index 0000000..bdedba2 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_others.tcl @@ -0,0 +1,108 @@ +#=============================================================================== +# UI_PB_OTHERS.TCL +#=============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Other Elements page. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 gsl Initial # +# 30-Apr-1999 gsl Removed components tree. # +# 02-Jun-1999 mnb Code Integration # +# 10-Jun-1999 mnb Attached callbacks to action button # +# 14-Jun-1999 mnb Added Supress Sequence Number check button # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#=============================================================================== +proc UI_PB_Def_OtherElements {book_id other_page_obj} { +#=============================================================================== + global tixOption + global paOption + + set w [$book_id subwidget $Page::($other_page_obj,page_name)] + + # Parameter pane + AddPageGenParm $other_page_obj $w 0 +} + + +#============================================================================== +proc AddPageGenParm {page_obj p e} { +#============================================================================== + global tixOption + global paOption + + set f [frame $p.f -relief sunken -bd 1] + pack $f -expand yes -fill both -padx 3 + + UI_PB_ads_CreateSpecialChars page_obj $f + + # Navigation buttons + # + set bb [tixButtonBox $p.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + pack $bb -fill x -padx 3 -pady 3 + + $bb add def -text Default \ + -command "UI_PB_oth_DefaultCallBack" \ + -width 10 -underline 0 + $bb add app -text Restore \ + -command "UI_PB_oth_RestCallBack $page_obj" \ + -width 10 -underline 0 +} + +#============================================================================ +proc UI_PB_oth_DefaultCallBack { } { +#============================================================================ + + UI_PB_ads_SpecDefaultCallBack +} + +#============================================================================ +proc UI_PB_oth_RestCallBack { page_obj } { +#============================================================================ + + UI_PB_ads_SpecRestCallBack $page_obj +} + +#============================================================================ +proc UI_PB_oth_UpdateOtherPage { PAGE_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + # Restores the values of these mom variables + set mom_var_list {"seqnum_start" "seqnum_incr" "seqnum_freq" \ + "Word_Seperator" "Decimal_Point" "End_of_Block" \ + "Comment_Start" "Comment_End"} + + foreach var $mom_var_list \ + { + set rest_spec_momvar($var) $mom_sys_arr($var) + } + set Page::($page_obj,rest_spec_momvar) [array get rest_spec_momvar] +} + +#============================================================================ +proc UI_PB_oth_ApplyOtherAttr { } { +#============================================================================ + global mom_sys_arr + global special_char + + set mom_var_list {"Word_Seperator" "Decimal_Point" "End_of_Block" \ + "Comment_Start" "Comment_End"} + + foreach option $mom_var_list \ + { + set mom_sys_arr($option) $special_char($option,char) + } + + PB_int_UpdateMOMVar mom_sys_arr +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_preview.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_preview.tcl new file mode 100644 index 0000000..202ed25 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_preview.tcl @@ -0,0 +1,866 @@ +#============================================================================= +# UI_PB_PREVIEW.TCL +#============================================================================= +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Preview page.. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 gsl Initial # +# 30-May-1999 mnb Added preview procedures # +# 02-Jun-1999 mnb Code Integration # +# 07-jun-1999 mnb Displays the old and new event procedures # +# 14-Jun-1999 mnb Added procedures to output worseperator endofline # +# and sequence number # +# 29-Jun-1999 mnb Added Composite Blocks # +# 07-Sep-1999 mnb Format is changed from % to & format # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================ +proc UI_PB_Preview { book_id pre_page_obj } { +#============================================================================ + global paOption + + set f [$book_id subwidget $Page::($pre_page_obj,page_name)] + set w [tixNoteBook $f.nb -ipadx 5 -ipady 5] + [$f.nb subwidget nbframe] config -tabpady 0 + + set prev_book [new Book w] + set Page::($pre_page_obj,book_obj) $prev_book + + Book::CreatePage $prev_book eve "Event Handlers" "" UI_PB_prv_EventHandler \ + UI_PB_prv_EventTab + Book::CreatePage $prev_book def "Definitions" "" UI_PB_prv_Definition \ + UI_PB_prv_DefTab + + pack $f.nb -expand yes -fill both + set Book::($prev_book,x_def_tab_img) 0 + set Book::($prev_book,current_tab) -1 +} + +#============================================================= +proc UI_PB_prv_EventHandler { book_id eve_page_obj } { +#============================================================= + global tixOption + global paOption + + set Page::($eve_page_obj,page_id) [$book_id subwidget \ + $Page::($eve_page_obj,page_name)] + + # Creates the pane for event preview page + Page::CreatePane $eve_page_obj + + # Creates the tree + Page::CreateCheckList $eve_page_obj + UI_PB_prv_CreateEveListElements eve_page_obj + + # Right pane: the Text + UI_PB_prv_CreateSecPaneElems eve_page_obj + + # Parses the Event Handler + PB_pps_ParseTclFile event_proc_data + set Page::($eve_page_obj,evt_proc_list) [array get event_proc_data] +} + +#====================================================================== +proc UI_PB_prv_CreateSecPaneElems { PAGE_OBJ } { +#====================================================================== + upvar $PAGE_OBJ page_obj + global paOption + global tixOption + set sec_pane $Page::($page_obj,canvas_frame) + + set pane [tixPanedWindow $sec_pane.pane -orient vertical] + pack $pane -fill both -expand yes + + set f1 [$pane add p1 -expand 1 -size 200] + set f2 [$pane add p2 -expand 1 -size 200] + + $f1 config -relief flat + $f2 config -relief flat + + # First pane + set p1s [$pane subwidget p1] + set p1_frame [frame $p1s.frm -relief sunken -bd 1] + pack $p1_frame -padx 2 -pady 6 -fill both -expand yes + + set lla [label $p1_frame.la -text "New Code" -bg darkSeaGreen3 \ + -fg lightYellow -bd 2 -relief raised -anchor c] + pack $lla -side top -fill x + + set lsw [tixScrolledWindow $p1_frame.lsw -scrollbar auto] + [$lsw subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$lsw subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + + pack $lsw -side bottom -fill both -expand yes + + set lswf [$lsw subwidget window] + + set ltext [text $lswf.tx -bg yellow \ + -font $tixOption(bold_font) \ + -height 200 -wrap word -bd 0] + pack $ltext -side top -fill both -expand yes + + set p2s [$pane subwidget p2] + set p2_frame [frame $p2s.frm -relief sunken -bd 1] + pack $p2_frame -padx 4 -pady 6 -expand yes -fill both + + set rla [label $p2_frame.la -text "Old Code" -bg darkSeaGreen3 \ + -fg lightYellow -bd 2 -relief raised -anchor c] + pack $rla -side top -fill x + + set rsw [tixScrolledWindow $p2_frame.rsw -scrollbar auto] + [$rsw subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$rsw subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + pack $rsw -side bottom -fill both -expand yes + + set rswf [$rsw subwidget window] + set rtext [text $rswf.tx -bg lightGoldenRod1 -fg blue \ + -font $tixOption(bold_font) \ + -height 200 -wrap word -bd 0] + pack $rtext -side bottom -fill both -expand yes + + set Page::($page_obj,ltext) $ltext + set Page::($page_obj,rtext) $rtext +} + +#====================================================================== +proc UI_PB_prv_CreateEveListElements { EVE_PAGE_OBJ } { +#====================================================================== + upvar $EVE_PAGE_OBJ eve_page_obj + global paOption + global tixOption + global gPB + + + set tree $Page::($eve_page_obj,tree) + + set h [$tree subwidget hlist] + $h config -bg $paOption(tree_bg) + + set style $gPB(font_style_bold) + set style1 $gPB(font_style_normal) + + uplevel #0 set TRANSPARENT_GIF_COLOR [$h cget -bg] + + set file $paOption(file) + set folder $paOption(folder) + set seq [tix getimage pb_sequence] + + set t 0 + $h add 0 -itemtype imagetext -text "" -image $folder -state disabled + + PB_int_RetSequenceObjs seq_obj_list + foreach seq_obj $seq_obj_list \ + { + $h add 0.$t -itemtype imagetext -text $sequence::($seq_obj,seq_name) \ + -image $seq -style $style -state disabled + set evt_indx 0 + foreach evt_obj $sequence::($seq_obj,evt_obj_list)\ + { + set event_name $event::($evt_obj,event_name) + if { [string compare $event_name "Inch / Metric Mode"] == 0 || \ + [string compare $event_name "Feedrates"] == 0 || \ + [string compare $event_name "Cycle Set"] == 0} \ + { + incr evt_indx + continue + } + + $h add 0.$t.$evt_indx -itemtype imagetext -text $event_name -style $style1 + $tree setstatus 0.$t.$evt_indx on + incr evt_indx + } + incr t + } + + $tree configure -browsecmd "UI_PB_prv_TclTreeSelection $eve_page_obj" + + $h selection set 0.0 + $h anchor set 0.0 + + $tree autosetmode + $tree setmode 0 none +} + +#=============================================================== +proc UI_PB_prv_TclTreeSelection { page_obj args } { +#=============================================================== + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set index [string range $ent 2 [string length $ent]] + + if {[string compare $index ""] == 0} \ + { + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.0 + $HLIST anchor set 0.0 + set index 0 + } + + set dot_indx [string first . $index] + if {$dot_indx != -1} \ + { + set first_indx [string range $index 0 [expr $dot_indx -1]] + set sec_indx [string range $index [expr $dot_indx + 1] end] + } else \ + { + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.$index.0 + $HLIST anchor set 0.$index.0 + set first_indx $index + set sec_indx 0 + } + UI_PB_prv_DisplayTclCode first_indx sec_indx page_obj +} + +#=============================================================== +proc UI_PB_prv_DisplayTclCode { FIRST_INDX SEC_INDX PAGE_OBJ } { +#=============================================================== + upvar $FIRST_INDX first_indx + upvar $SEC_INDX sec_indx + upvar $PAGE_OBJ page_obj + + PB_int_RetSequenceObjs seq_obj_list + set evt_blks "" + switch $first_indx \ + { + 0 - + 3 - + 4 - + 5 - + 6 { + set seq_obj [lindex $seq_obj_list $first_indx] + set event_obj [lindex $sequence::($seq_obj,evt_obj_list) \ + $sec_indx] + set temp_evt_blks "" + UI_PB_prv_GetBlkNamesOFEvent event_obj temp_evt_blks + lappend evt_blks $temp_evt_blks + } + + 1 { + set seq_obj [lindex $seq_obj_list 1] + set event_obj [lindex $sequence::($seq_obj,evt_obj_list) \ + $sec_indx] + set temp_evt_blks "" + UI_PB_prv_GetBlkNamesOFEvent event_obj temp_evt_blks + lappend evt_blks $temp_evt_blks + + set sec_seq_obj [lindex $seq_obj_list 2] + set seq_evt_obj_list $sequence::($sec_seq_obj,evt_obj_list) + set evt_name $event::($event_obj,event_name) + PB_com_RetObjFrmName evt_name seq_evt_obj_list next_event_obj + if {$next_event_obj != 0} \ + { + set temp_evt_blks "" + UI_PB_prv_GetBlkNamesOFEvent next_event_obj temp_evt_blks + lappend evt_blks $temp_evt_blks + } + } + + 2 { + set seq_obj [lindex $seq_obj_list 2] + set event_obj [lindex $sequence::($seq_obj,evt_obj_list) \ + $sec_indx] + set sec_seq_obj [lindex $seq_obj_list 1] + set seq_evt_obj_list $sequence::($sec_seq_obj,evt_obj_list) + set evt_name $event::($event_obj,event_name) + PB_com_RetObjFrmName evt_name seq_evt_obj_list next_event_obj + if {$next_event_obj != 0} \ + { + set temp_evt_blks "" + UI_PB_prv_GetBlkNamesOFEvent next_event_obj temp_evt_blks + lappend evt_blks $temp_evt_blks + } + + set temp_evt_blks "" + UI_PB_prv_GetBlkNamesOFEvent event_obj temp_evt_blks + lappend evt_blks $temp_evt_blks + } + } + + set temp_event_name $event::($event_obj,event_name) + set temp_event_name [string tolower $temp_event_name] + set temp_evt_name [join [split $temp_event_name " "] _ ] + append event_name MOM_ $temp_evt_name + unset temp_evt_name + + PB_output_GetEventProcData event_name evt_blks event_output + + if {$first_indx == 4} \ + { + array set event_proc_data $Page::($page_obj,evt_proc_list) + set name_list [array names event_proc_data] + append temp_name $event_name _move + if { [lsearch $name_list $temp_name] != -1} \ + { + lappend temp_evt_list $event_name $temp_name + set event_name $temp_evt_list + unset temp_evt_list temp_name + } + } + UI_PB_prv_DisplayEventProc page_obj event_output event_name +} + +#============================================================================= +proc UI_PB_prv_GetBlkNamesOFEvent { EVENT_OBJ EVT_BLKS } { +#============================================================================= + upvar $EVENT_OBJ event_obj + upvar $EVT_BLKS evt_blks + + foreach evt_elem_row $event::($event_obj,evt_elem_list) \ + { + if { [llength $evt_elem_row] > 1} \ + { + set first_elem_obj [lindex $evt_elem_row 0] + lappend evt_blks $event_element::($first_elem_obj,evt_elem_name) + } else \ + { + foreach evt_elem_obj $evt_elem_row \ + { + set block_obj $event_element::($evt_elem_obj,block_obj) + lappend evt_blks $block::($block_obj,block_name) + } + } + } +} + +#============================================================================= +proc UI_PB_prv_DisplayEventProc { PAGE_OBJ EVENT_OUTPUT EVT_NAME_LIST } { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $EVENT_OUTPUT event_output + upvar $EVT_NAME_LIST evt_name_list + + set ltext $Page::($page_obj,ltext) + set rtext $Page::($page_obj,rtext) + + $ltext delete 1.0 end + + foreach line $event_output \ + { + $ltext insert end " $line\n" + } + + array set event_proc_data $Page::($page_obj,evt_proc_list) + $rtext delete 1.0 end + + foreach event_name $evt_name_list \ + { + set old_event_output $event_proc_data($event_name) + $rtext insert end "\n\n" + foreach line $old_event_output \ + { + $rtext insert end " $line\n" + } + } +} + +#================================================================ +proc UI_PB_prv_Definition { book_id def_page_obj } { +#================================================================ + global tixOption + global paOption + + set Page::($def_page_obj,page_id) [$book_id subwidget \ + $Page::($def_page_obj,page_name)] + + # Creates a pane + Page::CreatePane $def_page_obj + + # Creates a tree in left pane + Page::CreateCheckList $def_page_obj + + # Right pane: the Text + UI_PB_prv_CreateSecPaneElems def_page_obj +} + +#========================================================================= +proc UI_PB_prv_CreateDefListElements { DEF_PAGE_OBJ INDEX } { +#========================================================================= + upvar $DEF_PAGE_OBJ def_page_obj + upvar $INDEX index + global paOption + global tixOption + + set tree $Page::($def_page_obj,tree) + set h [$tree subwidget hlist] + $h config -bg $paOption(tree_bg) + +## set style [tixDisplayStyle imagetext -refwindow $h +## -bg $paOption(tree_bg) -padx 4 -font $tixOption(bold_font)] + global gPB + set style $gPB(font_style_bold) + set style1 $gPB(font_style_normal) + + uplevel #0 set TRANSPARENT_GIF_COLOR [$h cget -bg] + + set file $paOption(file) + set folder $paOption(folder) + + $h delete all + $h add 0 -itemtype imagetext -text "" -image $folder -state disabled + + $tree setstatus 0 none + $h add 0.0 -itemtype imagetext -text "WORD_SEPARATOR" -style $style1 + $h add 0.1 -itemtype imagetext -text "END_OF_BLOCK" -style $style1 + $h add 0.2 -itemtype imagetext -text "SEQUENCE_NUM" -style $style1 + + $tree setstatus 0.0 on + $tree setstatus 0.1 on + $tree setstatus 0.2 on + + PB_int_RetFormatObjList fmt_obj_list + set fmt_img [tix getimage pb_format] + $h add 0.3 -itemtype imagetext -text "FORMAT" -image $fmt_img -style $style \ + -state disabled + + set t 0 + foreach fmt_obj $fmt_obj_list \ + { + $h add 0.3.$t -itemtype imagetext -style $style1 \ + -text $format::($fmt_obj,for_name) + $tree setstatus 0.3.$t on + incr t + } + + PB_int_RetAddressObjList add_obj_list + set add_img [tix getimage pb_address] + $h add 0.4 -itemtype imagetext -text "ADDRESS" -image $add_img \ + -style $style -state disabled + + set t 0 + foreach add_obj $add_obj_list \ + { + $h add 0.4.$t -itemtype imagetext \ + -text $address::($add_obj,add_name) -style $style1 + $tree setstatus 0.4.$t on + incr t + } + + PB_int_RetBlkObjList blk_obj_list + set blk_img [tix getimage pb_block_s] + $h add 0.5 -itemtype imagetext -text "BLOCK" -image $blk_img \ + -style $style -state disabled + set t 0 + foreach blk_obj $blk_obj_list \ + { + $h add 0.5.$t -itemtype imagetext \ + -text $block::($blk_obj,block_name) -style $style1 + $tree setstatus 0.5.$t on + incr t + } + set Page::($def_page_obj,blk_obj_list) $blk_obj_list + + set comp_blk_list "" + PB_output_GetCompositeBlks comp_blk_list + foreach blk_obj $comp_blk_list \ + { + $h add 0.5.$t -itemtype imagetext \ + -text $block::($blk_obj,block_name) -style $style1 + $tree setstatus 0.5.$t on + incr t + } + set Page::($def_page_obj,comp_blk_list) $comp_blk_list + + $tree configure -browsecmd "UI_PB_DefinitionTreeSelect $def_page_obj" + + $h selection set 0.$index + $h anchor set 0.$index + + $tree autosetmode + $tree setmode 0 none +} + +#====================================================================== +proc UI_PB_DefinitionTreeSelect { page_obj args } { +#====================================================================== + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info selection] + set index [string range $ent 2 [string length $ent]] + + if {[string compare $index ""] == 0} \ + { + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.0 + $HLIST anchor set 0.0 + set index 0 + } + + set dot_indx [string first . $index] + if {$dot_indx != -1} \ + { + set first_indx [string range $index 0 [expr $dot_indx -1]] + set sec_indx [string range $index [expr $dot_indx + 1] end] + } elseif {$index == 0 || $index == 1 || $index == 2} \ + { + set first_indx $index + set sec_indx 0 + } elseif { $index == 3 || $index == 4 || $index == 5} \ + { + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.$index.0 + $HLIST anchor set 0.$index.0 + set first_indx $index + set sec_indx 0 + } + UI_PB_prv_DisplayDefCode first_indx sec_indx page_obj +} + +#====================================================================== +proc UI_PB_prv_DisplayDefCode { FIRST_INDX SEC_INDX PAGE_OBJ } { +#====================================================================== + upvar $FIRST_INDX first_indx + upvar $SEC_INDX sec_indx + upvar $PAGE_OBJ page_obj + + switch $first_indx \ + { + 0 { + UI_PB_prv_WordSep page_obj + } + + 1 { + UI_PB_prv_EndOfBlock page_obj + } + + 2 { + UI_PB_prv_SeqNumber page_obj + } + + 3 { + UI_PB_prv_Format page_obj sec_indx + } + + 4 { + UI_PB_prv_Address page_obj sec_indx + } + + 5 { + UI_PB_prv_BlockTemplate page_obj sec_indx + } + } +} + +#====================================================================== +proc UI_PB_prv_WordSep { PAGE_OBJ } { +#====================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + set ltext $Page::($page_obj,ltext) + set rtext $Page::($page_obj,rtext) + + # New code + PB_output_GetWordSeperator $mom_sys_arr(Word_Seperator) new_word_sep + UI_PB_prv_OutputWordSep ltext new_word_sep + + # Old code + set mom_var_arr(0) "Word_Seperator" + PB_int_RetDefMOMVarValues mom_var_arr mom_var_value + PB_output_GetWordSeperator $mom_var_value(Word_Seperator) word_sep + UI_PB_prv_OutputWordSep rtext word_sep +} + +#====================================================================== +proc UI_PB_prv_OutputWordSep { TEXT_WIDGET WORD_SEP } { +#====================================================================== + upvar $TEXT_WIDGET text_widget + upvar $WORD_SEP word_sep + + $text_widget delete 1.0 end + + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end " $word_sep" +} + +#====================================================================== +proc UI_PB_prv_EndOfBlock { PAGE_OBJ } { +#====================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + set ltext $Page::($page_obj,ltext) + set rtext $Page::($page_obj,rtext) + + # new code + PB_output_GetEndOfLine $mom_sys_arr(End_of_Block) new_endof_line + UI_PB_prv_OutputEndBlk ltext new_endof_line + + # Old code + set mom_var_arr(0) "End_of_Block" + PB_int_RetDefMOMVarValues mom_var_arr mom_var_value + PB_output_GetEndOfLine $mom_var_value(End_of_Block) endof_line + UI_PB_prv_OutputEndBlk rtext endof_line +} + +#====================================================================== +proc UI_PB_prv_OutputEndBlk { TEXT_WIDGET END_OF_LINE } { +#====================================================================== + upvar $TEXT_WIDGET text_widget + upvar $END_OF_LINE end_of_line + + $text_widget delete 1.0 end + + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end " $end_of_line" +} +#====================================================================== +proc UI_PB_prv_SeqNumber { PAGE_OBJ } { +#====================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + set ltext $Page::($page_obj,ltext) + set rtext $Page::($page_obj,rtext) + + set seq_param(0) $mom_sys_arr(seqnum_block) + set seq_param(1) $mom_sys_arr(seqnum_start) + set seq_param(2) $mom_sys_arr(seqnum_incr) + set seq_param(3) $mom_sys_arr(seqnum_freq) + PB_output_GetSequenceNumber seq_param new_seq_num + UI_PB_prv_OutputSeqNo ltext new_seq_num + + set mom_var_arr(0) "seqnum_block" + set mom_var_arr(1) "seqnum_start" + set mom_var_arr(2) "seqnum_incr" + set mom_var_arr(3) "seqnum_freq" + PB_int_RetDefMOMVarValues mom_var_arr mom_var_value + set seq_param(0) $mom_var_value(seqnum_block) + set seq_param(1) $mom_var_value(seqnum_start) + set seq_param(2) $mom_var_value(seqnum_incr) + set seq_param(3) $mom_var_value(seqnum_freq) + PB_output_GetSequenceNumber seq_param seq_num + UI_PB_prv_OutputSeqNo rtext seq_num +} + +#====================================================================== +proc UI_PB_prv_OutputSeqNo { TEXT_WIDGET SEQUENCE_NUM } { +#====================================================================== + upvar $TEXT_WIDGET text_widget + upvar $SEQUENCE_NUM sequence_num + + $text_widget delete 1.0 end + + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end " $sequence_num" +} +#====================================================================== +proc UI_PB_prv_Format { PAGE_OBJ INDEX } { +#====================================================================== + upvar $PAGE_OBJ page_obj + upvar $INDEX index + + set ltext $Page::($page_obj,ltext) + set rtext $Page::($page_obj,rtext) + PB_int_RetFormatObjList fmt_obj_list + + set fmt_obj [lindex $fmt_obj_list $index] + + # Outputs the new address code in left window + format::readvalue $fmt_obj fmt_obj_attr + PB_fmt_RetFmtFrmAttr fmt_obj_attr for_value + UI_PB_prv_OutputFormat ltext fmt_obj_attr(0) for_value + + # Outputs the old address code in right window + array set def_fmt_obj_attr $format::($fmt_obj,def_value) + PB_fmt_RetFmtFrmAttr def_fmt_obj_attr def_for_value + UI_PB_prv_OutputFormat rtext def_fmt_obj_attr(0) def_for_value +} + +#====================================================================== +proc UI_PB_prv_OutputFormat { TEXT_WIDGET FMT_NAME FMT_VALUE } { +#====================================================================== + upvar $TEXT_WIDGET text_widget + upvar $FMT_NAME fmt_name + upvar $FMT_VALUE fmt_value + + $text_widget delete 1.0 end + + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + + $text_widget insert end " FORMAT $fmt_name $fmt_value" +} + +#====================================================================== +proc UI_PB_prv_Address { PAGE_OBJ INDEX } { +#====================================================================== + upvar $PAGE_OBJ page_obj + upvar $INDEX index + + set ltext $Page::($page_obj,ltext) + set rtext $Page::($page_obj,rtext) + + PB_int_RetAddressObjList add_obj_list + set add_obj [lindex $add_obj_list $index] + + # Outputs the new address code in left window + address::readvalue $add_obj add_obj_attr + PB_adr_RetAddFrmAddAttr add_obj_attr add_val_list + UI_PB_prv_OutputAddress ltext add_obj_attr(0) add_val_list + + # Outputs the old address code in right window + array set def_add_obj_attr $address::($add_obj,def_value) + PB_adr_RetAddFrmAddAttr def_add_obj_attr def_add_val_list + UI_PB_prv_OutputAddress rtext def_add_obj_attr(0) def_add_val_list +} + +#====================================================================== +proc UI_PB_prv_OutputAddress { TEXT_WIDGET ADD_NAME ADD_VALUE } { +#====================================================================== + upvar $TEXT_WIDGET text_widget + upvar $ADD_NAME add_name + upvar $ADD_VALUE add_value + + $text_widget delete 1.0 end + + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + + $text_widget insert end " ADDRESS $add_name\n" + $text_widget insert end " \{\n" + set ii [llength $add_value] + for {set jj 0} {$jj < $ii} {incr jj} \ + { + $text_widget insert end " [lindex $add_value $jj]\n" + } + $text_widget insert end " \}\n" +} + +#====================================================================== +proc UI_PB_prv_BlockTemplate { PAGE_OBJ INDEX} { +#====================================================================== + upvar $PAGE_OBJ page_obj + upvar $INDEX index + + set ltext $Page::($page_obj,ltext) + set rtext $Page::($page_obj,rtext) + + set blk_obj_list $Page::($page_obj,blk_obj_list) + set comp_blk_list $Page::($page_obj,comp_blk_list) + + set no_of_actblks [llength $blk_obj_list] + + if {$index < $no_of_actblks} \ + { + set block_obj [lindex $blk_obj_list $index] + } else \ + { + set block_obj [lindex $comp_blk_list [expr $index - $no_of_actblks]] + } + + # Outputs the new code in left window + block::readvalue $block_obj blk_obj_attr + PB_blk_RetBlkFrmBlkAttr blk_obj_attr blk_value + UI_PB_prv_OutputBlockTemplate ltext blk_obj_attr(0) blk_value + + # Outputs the old code in right window + array set def_blk_obj_attr $block::($block_obj,def_value) + PB_blk_RetBlkFrmBlkAttr def_blk_obj_attr def_blk_value + UI_PB_prv_OutputBlockTemplate rtext def_blk_obj_attr(0) def_blk_value +} + +#=========================================================================== +proc UI_PB_prv_OutputBlockTemplate { TEXT_WIDGET BLOCK_NAME BLK_VALUE } { +#=========================================================================== + upvar $TEXT_WIDGET text_widget + upvar $BLOCK_NAME block_name + upvar $BLK_VALUE blk_value + + $text_widget delete 1.0 end + + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end "\n" + $text_widget insert end " BLOCK_TEMPLATE $block_name\n" + $text_widget insert end " \{\n" + + set line_no 6 + set ii [llength $blk_value] + for {set jj 0} {$jj < $ii} {incr jj} \ + { + $text_widget insert end " [lindex $blk_value $jj]\n" + incr line_no + } + $text_widget insert end " \}\n" +} + +#=========================================================================== +proc UI_PB_prv_CreateTabAttr { BOOK_OBJ } { +#=========================================================================== + upvar $BOOK_OBJ book_obj + + switch -exact -- $Book::($book_obj,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 0] + UI_PB_prv_TclTreeSelection $page_obj + } + + 1 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 1] + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + + set ent [$HLIST info selection] + set index [string range $ent 2 [string length $ent]] + + if {[string compare $index ""] == 0} \ + { + set index 0 + } + + UI_PB_prv_CreateDefListElements page_obj index + UI_PB_DefinitionTreeSelect $page_obj + } + } +} + +#=========================================================================== +proc UI_PB_prv_EventTab { book_id page_img book_obj } { +#=========================================================================== + CB_nb_def $book_id $page_img $book_obj + set Book::($book_obj,current_tab) 0 + + UI_PB_prv_CreateTabAttr book_obj +} + +#=========================================================================== +proc UI_PB_prv_DefTab { book_id page_img book_obj } { +#=========================================================================== + CB_nb_def $book_id $page_img $book_obj + set Book::($book_obj,current_tab) 1 + + UI_PB_prv_CreateTabAttr book_obj +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_program.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_program.tcl new file mode 100644 index 0000000..dbed00e --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_program.tcl @@ -0,0 +1,1093 @@ +#=============================================================================== +# UI_PB_PROGRAM.TCL +#=============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Program page.. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 02-Jun-1999 mnb Code Integration # +# 23-Jun-1999 gsl Added envent_list attribute to Sequence apge # +# to keep track of opened Event windows. # +# 29-Jun-1999 mnb Removed User Defined events from tree # +# 07-Sep-1999 mnb Changed the top canvas menu to combobox & added # +# popup menu to edit blocks # +# 21-Sep-1999 mnb Changed Menu in Sequence page to Combo Box # +# 18-Oct-1999 gsl Minor changes # +# 22-Oct-1999 gsl Removed grayed-out popup menu. # +# 03-Nov-1999 gsl Added UI_PB_prog_DisableWindow & # +# UI_PB_prog_EnableWindow. # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + + +#===================================================================== +proc UI_PB_prog_DisableWindow { CHAP } { +#===================================================================== + upvar $CHAP chap + global gPB + + + #********** + # Sections + #********** + set sect $Page::($chap,book_obj) + set sect_id $Book::($sect,book_id) + + #******************************************************************* + # Save away the Button-1 callback and attach a message dialog to it. + #******************************************************************* + set gPB($sect_id,b1_cb) [bind [$sect_id subwidget nbframe] <1>] + + bind [$sect_id subwidget nbframe] <1> \ + "tk_messageBox -parent [UI_PB_com_AskActiveWindow] -type ok -icon error\ + -message \"You have to close all sub-windows to enable this tab.\"" + + # Disable notebook tabs + $sect_id pageconfig prog -state disabled + $sect_id pageconfig gcod -state disabled + $sect_id pageconfig mcod -state disabled + $sect_id pageconfig asum -state disabled + $sect_id pageconfig wseq -state disabled + + #**************************************************** + # Retrieve some font styles for disabling tree items + #**************************************************** + set sty_n $gPB(font_style_normal) + set sty_b $gPB(font_style_bold) + set sty_ng $gPB(font_style_normal_gray) + set sty_bg $gPB(font_style_bold_gray) + + #*********************** + # Get tabbed pages info + #*********************** + set page_tab $Book::($sect,current_tab) + set page_obj [lindex $Book::($sect,page_obj_list) $page_tab] + + # Disable tree items on Program tab + set page_tab $Book::($sect,current_tab) + + if { $page_tab == 0 } \ + { + set t $Page::($page_obj,tree) + set h [$t subwidget hlist] + + # Disable everything first, then enable branches selectively. + $h entryconfig 0.0 -state disabled -style $sty_bg + $h entryconfig 0.1 -state disabled -style $sty_bg + $h entryconfig 0.2 -state disabled -style $sty_bg + $h entryconfig 0.2.0 -state disabled -style $sty_ng + $h entryconfig 0.2.1 -state disabled -style $sty_ng + $h entryconfig 0.2.2 -state disabled -style $sty_ng + $h entryconfig 0.3 -state disabled -style $sty_bg + $h entryconfig 0.4 -state disabled -style $sty_bg + + # The 3rd char of the selected item... + set anc [$h info anchor] + set ind [string index $anc 2] + + if { [string compare $ind "2"] == 0 } \ + { + # Event items + $h entryconfig $anc -state normal -style $sty_n + + } else \ + { + # Sequence items + $h entryconfig $anc -state normal -style $sty_b + } + + # Disable items on canvas frame + set f $Page::($page_obj,canvas_frame) + } +} + +#===================================================================== +proc UI_PB_prog_EnableWindow { CHAP } { +#===================================================================== + upvar $CHAP chap + global gPB + + #********** + # Sections + #********** + set sect $Page::($chap,book_obj) + set sect_id $Book::($sect,book_id) + + #******************************************* + # Restore Button-1 callback for the chapter + #******************************************* + bind [$sect_id subwidget nbframe] <1> $gPB($sect_id,b1_cb) + + #************* + # Enable tabs + #************* + $sect_id pageconfig prog -state normal + $sect_id pageconfig gcod -state normal + $sect_id pageconfig mcod -state normal + $sect_id pageconfig asum -state normal + $sect_id pageconfig wseq -state normal + + #*************************************************** + # Retrieve some font styles for enabling tree items + #*************************************************** + set sty_n $gPB(font_style_normal) + set sty_b $gPB(font_style_bold) + + if { $Book::($sect,current_tab) == 0 } \ + { + set page_obj [lindex $Book::($sect,page_obj_list) 0] + + set t $Page::($page_obj,tree) + set h [$t subwidget hlist] + + $h entryconfig 0.0 -state normal -style $sty_b + $h entryconfig 0.1 -state normal -style $sty_b + $h entryconfig 0.2 -state normal -style $sty_b + $h entryconfig 0.2.0 -state normal -style $sty_n + $h entryconfig 0.2.1 -state normal -style $sty_n + $h entryconfig 0.2.2 -state normal -style $sty_n + $h entryconfig 0.3 -state normal -style $sty_b + $h entryconfig 0.4 -state normal -style $sty_b + } +} + +#===================================================================== +proc UI_PB_ProgTpth_Program {book_id prog_page} { +#===================================================================== + global paOption + global tixOption + global mom_sys_arr + + set Page::($prog_page,page_id) [$book_id subwidget \ + $Page::($prog_page,page_name)] + set top_canvas_dim(0) 80 + set top_canvas_dim(1) 400 + set bot_canvas_dim(0) 2000 + set bot_canvas_dim(1) 2000 + set index 0 + + # Returns the database sequence objects + PB_int_RetSequenceObjs seq_obj_list + + # Set the sequence objects to sequence page + set Page::($prog_page,seq_obj_list) $seq_obj_list + + # Initialize event list + set Page::($prog_page,event_list) {} + + Page::CreatePane $prog_page + Page::CreateTree $prog_page + UI_PB_evt_CreateTree prog_page + + set canvas_frm $Page::($prog_page,canvas_frame) + + # Creates NC Code output toggle button + set nc_frm [frame $canvas_frm.nc -bg navyBlue] + pack $nc_frm -side top -fill x + + checkbutton $nc_frm.bnc -text "Display Blocks in N/C Code" \ + -relief ridge -bd 1 -font $tixOption(bold_font) \ + -variable mom_sys_arr(seq_blk_nc_code) -anchor c \ + -command "UI_PB_evt_ChangeSeqDisplay $prog_page" + pack $nc_frm.bnc -pady 6 + + set Page::($prog_page,disp_nc_frm) $nc_frm + set Page::($prog_page,disp_nc_flag) 0 + Page::CreateCanvas $prog_page top_canvas_dim bot_canvas_dim + + # Template Button + $Page::($prog_page,box) config -relief sunken \ + -bg gray + $Page::($prog_page,box) add seqtmp -width 30 \ + -text "Select A Sequence Template" \ + -bg $paOption(app_butt_bg) + set Page::($prog_page,box_flag) 0 + set Page::($prog_page,hor_scrol_flag) 0 + + # Creates Apply & Default buttons + set canvas_frame $Page::($prog_page,canvas_frame) + set act_box [tixButtonBox $canvas_frame.appbut \ + -orientation horizontal \ + -bd 2 \ + -relief sunken] + $act_box config -bg $paOption(butt_bg) + pack $act_box -side bottom -fill x -padx 3 -pady 3 + + $act_box add def -text "Default" -width 10 \ + -command "UI_PB_evt_DefaultCallBack $prog_page" + $act_box add und -text "Restore" -width 10 \ + -command "UI_PB_evt_RestoreCallBack $prog_page" + + set Page::($prog_page,act_box) $act_box + set Page::($prog_page,act_box_flag) 0 + set Page::($prog_page,add_name) " Add Block " + Page::CreateAddTrashinCanvas $prog_page + UI_PB_evt_CreateComboBox $prog_page + + # Attaches the bind procedures to the Add icon + UI_PB_evt_AddBindProcs prog_page + + Page::AddComponents $prog_page + UI_PB_evt_SetASequenceAttr $prog_page 0 + + # Creates canvas popup menu + UI_PB_evt_CreatePopupMenu $prog_page +} + +#========================================================================== +# This procedure creates the comboBox widget. +#========================================================================== +proc UI_PB_evt_CreateComboBox { page_obj } { +#========================================================================== + # Gets the top canvas id from the page object + set top_canvas $Page::($page_obj,top_canvas) + + # Creates a frame on top canvas to put the entry and + # menu button + set evt_frm [frame $top_canvas.f] + $top_canvas create window 350 40 -window $evt_frm + + # Creates combobox + set blk_sel [tixComboBox $evt_frm.blk_sel \ + -dropdown yes \ + -editable false \ + -variable CB_Block_Name \ + -command "" \ + -grab local \ + -listwidth 335 \ + -options { + listbox.height 10 + listbox.anchor c + entry.width 38 + }] + + pack $evt_frm.blk_sel -side right + set Page::($page_obj,comb_widget) $blk_sel + [$blk_sel subwidget entry] config -bg lightBlue -justify center -cursor "" +} + +#========================================================================== +# This procedure creates the popup menu for all the sequences +#========================================================================== +proc UI_PB_evt_CreatePopupMenu { page_obj } { +#========================================================================== + global tixOption + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + option add *Menu.tearOff 0 + + set popup [menu $bot_canvas.pop] + set Page::($page_obj,popup) $popup + set Page::($page_obj,popup_flag) 0 + $popup add separator + + bind $bot_canvas <3> "UI_PB_evt_CanvasPopupMenu $page_obj %X %Y" +} + +#===================================================================== +proc UI_PB_evt_CanvasPopupMenu { page_obj x y } { +#===================================================================== + set popup $Page::($page_obj,popup) + if { $Page::($page_obj,popup_flag) == 1} \ + { + set Page::($page_obj,popup_flag) 0 + + # Position popup menu + tk_popup $popup $x $y + } + +} + +#===================================================================== +proc UI_PB_evt_ChangeSeqDisplay { page_obj } { +#===================================================================== + global mom_sys_arr + + set act_seq_obj $Page::($page_obj,active_seq) + set bot_canvas $Page::($page_obj,bot_canvas) + + UI_PB_evt_DeleteSeqEvents page_obj act_seq_obj + + switch $Page::($page_obj,prev_seq) \ + { + 0 { set mom_sys_arr(\$pgss_blk_nc) $mom_sys_arr(seq_blk_nc_code) } + 1 { set mom_sys_arr(\$pges_blk_nc) $mom_sys_arr(seq_blk_nc_code) } + 3 { set mom_sys_arr(\$opss_blk_nc) $mom_sys_arr(seq_blk_nc_code) } + 4 { set mom_sys_arr(\$opes_blk_nc) $mom_sys_arr(seq_blk_nc_code) } + } + + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr act_seq_obj + + # Top Canvas + UI_PB_evt_TopCanvasPackUnpack page_obj + + if { $Page::($page_obj,prev_seq) == 0 } \ + { + # unpacks the template and horizontal scroller + UI_PB_evt_PackActCanvasItems page_obj + } + + if { $mom_sys_arr(seq_blk_nc_code) == 1 } \ + { + bind $bot_canvas <3> "" + } else \ + { + bind $bot_canvas <3> "UI_PB_evt_CanvasPopupMenu $page_obj %X %Y" + } + + UI_PB_evt_CreateSeqAttributes page_obj +} + +#===================================================================== +proc UI_PB_evt_RestoreCallBack { page_obj } { +#===================================================================== + set prev_seq $Page::($page_obj,prev_seq) + set seq_obj [lindex $Page::($page_obj,seq_obj_list) $prev_seq] + + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + foreach event_obj $sequence::($seq_obj,evt_obj_list) \ + { + array set evt_obj_attr $event::($event_obj,rest_value) + event::setvalue $event_obj evt_obj_attr + foreach row_evt_elem $event::($event_obj,evt_elem_list) \ + { + foreach evt_elem $row_evt_elem \ + { + array set evt_elem_obj_attr $event_element::($evt_elem,rest_value) + event_element::setvalue $evt_elem evt_elem_obj_attr + } + } + } + UI_PB_evt_CreateSeqAttributes page_obj +} + +#===================================================================== +proc UI_PB_evt_DefaultCallBack { page_obj } { +#===================================================================== + set prev_seq $Page::($page_obj,prev_seq) + set seq_obj [lindex $Page::($page_obj,seq_obj_list) $prev_seq] + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + foreach event_obj $sequence::($seq_obj,evt_obj_list) \ + { + array set evt_obj_attr $event::($event_obj,def_value) + event::setvalue $event_obj evt_obj_attr + foreach row_evt_elem $event::($event_obj,evt_elem_list) \ + { + foreach evt_elem $row_evt_elem \ + { + array set evt_elem_obj_attr $event_element::($evt_elem,def_value) + event_element::setvalue $evt_elem evt_elem_obj_attr + } + } + } + UI_PB_evt_CreateSeqAttributes page_obj +} + +#===================================================================== +proc UI_PB_evt_prog {PAGE_OBJ} { +#===================================================================== + upvar $PAGE_OBJ page_obj + + set Page::($page_obj,glob_evnt_dim) {170 26} + set Page::($page_obj,glob_blk_dim) {170 25} + set Page::($page_obj,glob_blk_blkdist_hor) 20 + set Page::($page_obj,glob_blk_blkdist_ver) 25 + set Page::($page_obj,glob_evt_blkdist) 30 + set Page::($page_obj,glob_evt_evtdist) 30 + set Page::($page_obj,glob_text_shift) 10 + set Page::($page_obj,glob_rect_gap) 3 + set Page::($page_obj,prev_seq) -1 + set Page::($page_obj,cen_shift) 4 + set Page::($page_obj,topcanvas_flag) 0 + set Page::($page_obj,drag_sensitivity) 3 + + set tree $Page::($page_obj,tree) + set sec_frm $Page::($page_obj,canvas_frame) + +} + +#===================================================================== +proc UI_PB_evt_CreateTree {PAGE_OBJ} { +#===================================================================== + upvar $PAGE_OBJ page_obj + global paOption + global tixOption + global gPB + + set tree $Page::($page_obj,tree) + set sec_frm $Page::($page_obj,canvas_frame) + + $tree config \ + -command "UI_PB_evt_progItemSelection $page_obj" \ + -browsecmd "UI_PB_evt_progItemSelection $page_obj" + + set h [$tree subwidget hlist] + $h config -bg $paOption(tree_bg) + + uplevel #0 set TRANSPARENT_GIF_COLOR [$h cget -bg] + + set file $paOption(file) + set folder $paOption(folder) + set seq [tix getimage pb_sequence] + set subseq [tix getimage pb_sub_seq] + + set style $gPB(font_style_bold) + set style1 $gPB(font_style_normal) + + $h add 0 -itemtype imagetext -text "" -image $folder -state disabled + + $h add 0.0 -itemtype imagetext -text "Program Start Sequence" \ + -image $seq -style $style + $h add 0.1 -itemtype imagetext -text "Operation Start Sequence" \ + -image $seq -style $style + $h add 0.2 -itemtype imagetext -text "Tool Path Events" \ + -image $seq -style $style + + $h add 0.2.0 -itemtype imagetext -text "Machine Control" \ + -image $subseq -style $style1 + $h add 0.2.1 -itemtype imagetext -text "Motions" \ + -image $subseq -style $style1 + $h add 0.2.2 -itemtype imagetext -text "Cycles" \ + -image $subseq -style $style1 + + $h add 0.3 -itemtype imagetext -text "Operation End Sequence" \ + -image $seq -style $style + $h add 0.4 -itemtype imagetext -text "Program End Sequence" \ + -image $seq -style $style + + $h selection set 0.0 + $h anchor set 0.0 +} + +#================================================================== +proc UI_PB_evt_GetSequenceIndex { PAGE_OBJ SEQ_INDEX } { +#================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_INDEX seq_index + + switch $Page::($page_obj,prev_seq) \ + { + 0 { set seq_index 0 } + 1 { set seq_index 1 } + 2 { set seq_index 2 } + 2.1 { set seq_index 3 } + 2.2 { set seq_index 4 } + 3 { set seq_index 5 } + 4 { set seq_index 6 } + } +} + +#================================================================== +proc UI_PB_evt_DeleteObjectsPrevSeq { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + + # gets the previous sequence object + UI_PB_evt_GetSequenceIndex page_obj prev_seq_index + set prev_seq_obj [lindex $Page::($page_obj,seq_obj_list) \ + $prev_seq_index] + + # Deletes all the Events and blocks of the previous sequence + UI_PB_evt_DeleteSeqEvents page_obj prev_seq_obj + + # Deletes the combobox entry text + if {[info exists sequence::($prev_seq_obj,comb_text)]}\ + { + $Page::($page_obj,top_canvas) delete \ + $sequence::($prev_seq_obj,comb_text) + } +} + +#================================================================== +proc UI_PB_evt_PackActCanvasItems { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + # Unpacks the sequence template box + if {$Page::($page_obj,box_flag) == 0} \ + { + pack forget $Page::($page_obj,box) + set Page::($page_obj,box_flag) 1 + } + + # Packs the Action canvas, if it is not packed + if {$Page::($page_obj,action_flag) == 1 && \ + $mom_sys_arr(seq_blk_nc_code) == 0 } \ + { + pack $Page::($page_obj,action_canvas) -side bottom \ + -fill both -padx 3 + set Page::($page_obj,action_flag) 0 + } elseif { $Page::($page_obj,action_flag) == 0 && \ + $mom_sys_arr(seq_blk_nc_code) == 1 } \ + { + pack forget $Page::($page_obj,action_canvas) + set Page::($page_obj,action_flag) 1 + } + + # Unpacks the horizontal scroller bar + if {$Page::($page_obj,hor_scrol_flag) == 0} \ + { + pack forget $Page::($page_obj,hor_scrol) + set Page::($page_obj,hor_scrol_flag) 1 + } +} + +#================================================================== +proc UI_PB_evt_CreateSeqAttributes { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + + grab set $Page::($page_obj,canvas_frame) + switch $Page::($page_obj,prev_seq) \ + { + 0 { + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 0] + UI_PB_evt_SeqComponents page_obj seq_obj + set Page::($page_obj,active_seq) $seq_obj + } + + 1 { + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 1] + UI_PB_evt_SeqComponents page_obj seq_obj + set Page::($page_obj,active_seq) $seq_obj + } + + 2 { + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 2] + UI_PB_evt_ToolPathSeqComponents page_obj seq_obj + set Page::($page_obj,active_seq) $seq_obj + } + + 2.1 { + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 3] + UI_PB_evt_ToolPathSeqComponents page_obj seq_obj + set Page::($page_obj,active_seq) $seq_obj + + } + + 2.2 { + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 4] + UI_PB_evt_ToolPathSeqComponents page_obj seq_obj + set Page::($page_obj,active_seq) $seq_obj + } + + 3 { + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 5] + UI_PB_evt_SeqComponents page_obj seq_obj + set Page::($page_obj,active_seq) $seq_obj + } + + 4 { + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 6] + UI_PB_evt_SeqComponents page_obj seq_obj + set Page::($page_obj,active_seq) $seq_obj + } + } + grab release $Page::($page_obj,canvas_frame) +} + +#================================================================== +proc UI_PB_evt_RestoreSeqObjData { SEQ_OBJ } { +#================================================================== + upvar $SEQ_OBJ seq_obj + + # Restore the sequence data + sequence::RestoreValue $seq_obj + + # Restores the sequence event data + foreach event_obj $sequence::($seq_obj,evt_obj_list) \ + { + event::RestoreValue $event_obj + foreach row_evt_elem $event::($event_obj,evt_elem_list) \ + { + foreach evt_elem $row_evt_elem \ + { + event_element::RestoreValue $evt_elem + } + } + } +} + +#================================================================== +proc UI_PB_evt_TopCanvasPackUnpack { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + # Top Canvas + if { $mom_sys_arr(seq_blk_nc_code) == 1 && \ + $Page::($page_obj,topcanvas_flag) == 0} \ + { + pack forget $Page::($page_obj,top_canvas) + set Page::($page_obj,topcanvas_flag) 1 + } elseif { $mom_sys_arr(seq_blk_nc_code) == 0 && \ + $Page::($page_obj,topcanvas_flag) == 1} \ + { + pack forget $Page::($page_obj,bot_canvas) + pack forget $Page::($page_obj,ver_scrol) + pack $Page::($page_obj,top_canvas) -side top -fill x -padx 3 + set Page::($page_obj,topcanvas_flag) 0 + pack $Page::($page_obj,bot_canvas) -side left -expand yes \ + -fill both -padx 3 + pack $Page::($page_obj,ver_scrol) -side right -fill y + } +} + +#================================================================== +proc UI_PB_evt_PackDispNcFrame { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + + # NC Code Display Code Frame + if { $Page::($page_obj,disp_nc_flag) } \ + { + pack forget $Page::($page_obj,canvas_frame).frame + pack $Page::($page_obj,disp_nc_frm) -side top -fill x + pack $Page::($page_obj,canvas_frame).frame \ + -side top -fill both -expand yes + set Page::($page_obj,disp_nc_flag) 0 + } +} + +#================================================================== +proc UI_PB_evt_UnpackDispNcFrame { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + + # NC Code Display Code Frame + if { $Page::($page_obj,disp_nc_flag) == 0 } \ + { + pack forget $Page::($page_obj,disp_nc_frm) + set Page::($page_obj,disp_nc_flag) 1 + } +} + +#================================================================== +proc UI_PB_evt_ProgStartSeq { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + if { $Page::($page_obj,prev_seq) == -1 } \ + { + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 0] + + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + set Page::($page_obj,prev_seq) 0 + + # Creates the Action canvas blocks + UI_PB_evt_CreateActionCanvas page_obj seq_obj + set Page::($page_obj,action_flag) 0 + + # unpacks the template and horizontal scroller + UI_PB_evt_PackActCanvasItems page_obj + + # Top Canvas + UI_PB_evt_TopCanvasPackUnpack page_obj + + } else \ + { + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + + # Packs the NC Code frame + UI_PB_evt_PackDispNcFrame page_obj + + if {$Page::($page_obj,act_box_flag) == 1}\ + { + pack $Page::($page_obj,act_box) -side bottom -fill x \ + -padx 3 -pady 3 + set Page::($page_obj,act_box_flag) 0 + } + set Page::($page_obj,prev_seq) 0 + + # unpacks the template and horizontal scroller + UI_PB_evt_PackActCanvasItems page_obj + + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 0] + + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + # Top Canvas + UI_PB_evt_TopCanvasPackUnpack page_obj + $Page::($page_obj,bot_canvas) yview moveto 0 + } +} + +#================================================================== +proc UI_PB_evt_OperStartSeq { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 1] + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + set Page::($page_obj,prev_seq) 1 + + # Unpacks the action canvas and packs the hor scroller + UI_PB_evt_PackforgetBoxActCanvas page_obj + + # Packs the NC Code frame + UI_PB_evt_PackDispNcFrame page_obj + + # Top Canvas + UI_PB_evt_TopCanvasPackUnpack page_obj + + if {$Page::($page_obj,act_box_flag) == 1}\ + { + pack $Page::($page_obj,act_box) -side bottom -fill x \ + -padx 3 -pady 3 + set Page::($page_obj,act_box_flag) 0 + } + + # Packs the template sequence + if {$Page::($page_obj,box_flag) == 1} \ + { + pack $Page::($page_obj,box) -side bottom -fill x \ + -padx 3 -pady 3 + set Page::($page_obj,box_flag) 0 + } + $Page::($page_obj,bot_canvas) yview moveto 0 + $Page::($page_obj,bot_canvas) xview moveto 0 +} + +#================================================================== +proc UI_PB_evt_MachineControl { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 2] + + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + set Page::($page_obj,prev_seq) 2 + UI_PB_evt_PackforgetBoxActCanvas page_obj + + # Unpacks the nc frame + UI_PB_evt_UnpackDispNcFrame page_obj + + if {$Page::($page_obj,topcanvas_flag) == 0} \ + { + pack forget $Page::($page_obj,top_canvas) + set Page::($page_obj,topcanvas_flag) 1 + } + + set sequence::($seq_obj,ude_flag) 1 + if {$Page::($page_obj,act_box_flag) == 0}\ + { + pack forget $Page::($page_obj,act_box) + set Page::($page_obj,act_box_flag) 1 + } + $Page::($page_obj,bot_canvas) yview moveto 0 + $Page::($page_obj,bot_canvas) xview moveto 0 +} + +#================================================================== +proc UI_PB_evt_Cycles { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 3] + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + set Page::($page_obj,prev_seq) 2.1 + UI_PB_evt_PackforgetBoxActCanvas page_obj + + # Unpacks the Nc toggle frame + UI_PB_evt_UnpackDispNcFrame page_obj + + if {$Page::($page_obj,topcanvas_flag) == 0} \ + { + pack forget $Page::($page_obj,top_canvas) + set Page::($page_obj,topcanvas_flag) 1 + } + set sequence::($seq_obj,ude_flag) 0 + if {$Page::($page_obj,act_box_flag) == 0}\ + { + pack forget $Page::($page_obj,act_box) + set Page::($page_obj,act_box_flag) 1 + } + $Page::($page_obj,bot_canvas) yview moveto 0 + $Page::($page_obj,bot_canvas) xview moveto 0 +} + +#================================================================== +proc UI_PB_evt_Motion { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 4] + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + set Page::($page_obj,prev_seq) 2.2 + UI_PB_evt_PackforgetBoxActCanvas page_obj + + # Unpacks the nc frame + UI_PB_evt_UnpackDispNcFrame page_obj + + if {$Page::($page_obj,topcanvas_flag) == 0} \ + { + pack forget $Page::($page_obj,top_canvas) + set Page::($page_obj,topcanvas_flag) 1 + } + set sequence::($seq_obj,ude_flag) 0 + if {$Page::($page_obj,act_box_flag) == 0}\ + { + pack forget $Page::($page_obj,act_box) + set Page::($page_obj,act_box_flag) 1 + } + $Page::($page_obj,bot_canvas) yview moveto 0 + $Page::($page_obj,bot_canvas) xview moveto 0 +} + +#================================================================== +proc UI_PB_evt_UserDefined { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + +# To be implemented +# set sequence::($seq_obj,ude_flag) 0 +} + +#================================================================== +proc UI_PB_evt_OperEndSeq { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 5] + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + # packs the nc frame + UI_PB_evt_PackDispNcFrame page_obj + + # Top Canvas + UI_PB_evt_TopCanvasPackUnpack page_obj + + set Page::($page_obj,prev_seq) 3 + UI_PB_evt_PackforgetBoxActCanvas page_obj + if {$Page::($page_obj,act_box_flag) == 1}\ + { + pack $Page::($page_obj,act_box) -side bottom -fill x \ + -padx 3 -pady 3 + set Page::($page_obj,act_box_flag) 0 + } + $Page::($page_obj,bot_canvas) yview moveto 0 + $Page::($page_obj,bot_canvas) xview moveto 0 +} + +#================================================================== +proc UI_PB_evt_ProgEndSeq { PAGE_OBJ } { +#================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + + set seq_obj [lindex $Page::($page_obj,seq_obj_list) 6] + + # Sets all the sequence attributes to the seq_obj + UI_PB_evt_SetSequenceObjAttr seq_obj + + # packs the nc frame + UI_PB_evt_PackDispNcFrame page_obj + + # Top Canvas + UI_PB_evt_TopCanvasPackUnpack page_obj + + set Page::($page_obj,prev_seq) 4 + + UI_PB_evt_PackforgetBoxActCanvas page_obj + if {$Page::($page_obj,act_box_flag) == 1}\ + { + pack $Page::($page_obj,act_box) -side bottom -fill x \ + -padx 3 -pady 3 + set Page::($page_obj,act_box_flag) 0 + } + $Page::($page_obj,bot_canvas) yview moveto 0 + $Page::($page_obj,bot_canvas) xview moveto 0 +} + +#================================================================== +proc UI_PB_evt_progItemSelection {page_obj args} { +#================================================================== + set tree $Page::($page_obj,tree) + set HLIST [$tree subwidget hlist] + set ent [$HLIST info anchor] + set index [string range $ent 2 [string length $ent]] + + if { [string compare $index ""] == 0} \ + { + set index 0 + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.0 + $HLIST anchor set 0.0 + } elseif {$index == 2} \ + { + $HLIST selection clear + $HLIST anchor clear + $HLIST selection set 0.2.0 + $HLIST anchor set 0.2.0 + } + + if {$Page::($page_obj,prev_seq) != $index} \ + { + # Display all the attributes of a sequence + UI_PB_evt_SetASequenceAttr $page_obj $index + + # Restores the sequence data + UI_PB_evt_GetSequenceIndex page_obj seq_index + set seq_obj [lindex $Page::($page_obj,seq_obj_list) $seq_index] + UI_PB_evt_RestoreSeqObjData seq_obj + + # Creates the sequence elements + UI_PB_evt_CreateSeqAttributes page_obj + } +} + +#================================================================== +proc UI_PB_evt_SetASequenceAttr {page_obj index} { +#================================================================== + global mom_sys_arr + set bot_canvas $Page::($page_obj,bot_canvas) + + switch $index \ + { + 0 { + set mom_sys_arr(seq_blk_nc_code) $mom_sys_arr(\$pgss_blk_nc) + UI_PB_evt_ProgStartSeq page_obj + bind $bot_canvas <3> "UI_PB_evt_CanvasPopupMenu $page_obj %X %Y" + } + 1 { + set mom_sys_arr(seq_blk_nc_code) $mom_sys_arr(\$pges_blk_nc) + UI_PB_evt_OperStartSeq page_obj + bind $bot_canvas <3> "UI_PB_evt_CanvasPopupMenu $page_obj %X %Y" + } + 2 { + UI_PB_evt_MachineControl page_obj + bind $bot_canvas <3> "" + } + 2.0 { + UI_PB_evt_MachineControl page_obj + bind $bot_canvas <3> "" + } + 2.1 { + UI_PB_evt_Cycles page_obj + bind $bot_canvas <3> "" + } + 2.2 { + UI_PB_evt_Motion page_obj + bind $bot_canvas <3> "" + } + 2.3 { + UI_PB_evt_UserDefined page_obj + bind $bot_canvas <3> "" + } + 3 { + set mom_sys_arr(seq_blk_nc_code) $mom_sys_arr(\$opss_blk_nc) + UI_PB_evt_OperEndSeq page_obj + bind $bot_canvas <3> "UI_PB_evt_CanvasPopupMenu $page_obj %X %Y" + } + 4 { + set mom_sys_arr(seq_blk_nc_code) $mom_sys_arr(\$opes_blk_nc) + UI_PB_evt_ProgEndSeq page_obj + bind $bot_canvas <3> "UI_PB_evt_CanvasPopupMenu $page_obj %X %Y" + } + } +} + +#======================================================= +proc UI_PB_evt_PackforgetBoxActCanvas {PAGE_OBJ} { +#======================================================= + upvar $PAGE_OBJ page_obj + + # unpacks the action canvas + if {$Page::($page_obj,action_flag) == 0} \ + { + pack forget $Page::($page_obj,action_canvas) + set Page::($page_obj,action_flag) 1 + } + + # packs the horizontal scroller, if it is not packed + if {$Page::($page_obj,hor_scrol_flag) == 1} \ + { + pack forget $Page::($page_obj,bot_canvas) + pack $Page::($page_obj,hor_scrol) -side bottom -fill x + pack $Page::($page_obj,bot_canvas) -side left \ + -expand yes -fill both -padx 3 + set Page::($page_obj,hor_scrol_flag) 0 + } + + # Unpacks the sequence template selection box + if {$Page::($page_obj,box_flag) == 0} \ + { + pack forget $Page::($page_obj,box) + set Page::($page_obj,box_flag) 1 + } +} + +#======================================================= +proc UI_PB_evt_SetSequenceObjAttr {SEQ_OBJ} { +#======================================================= + upvar $SEQ_OBJ seq_obj + + set sequence::($seq_obj,region) 60 + set sequence::($seq_obj,evt_focus_cell) 0 + set sequence::($seq_obj,blk_focus_cell) 0 + set sequence::($seq_obj,active_evt) 0 + set sequence::($seq_obj,focus_rect) 0 + set sequence::($seq_obj,focus_sep) 0 + set sequence::($seq_obj,icon_top) 0 + set sequence::($seq_obj,icon_top_text) 0 + set sequence::($seq_obj,icon_bot) 0 + set sequence::($seq_obj,icon_bot_text) 0 + set sequence::($seq_obj,add_blk) 0 + set sequence::($seq_obj,blk_temp) 0 + set sequence::($seq_obj,drag_flag) 0 + set sequence::($seq_obj,trash_flag) 0 + set sequence::($seq_obj,action_blk_add) 0 +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_progtpth.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_progtpth.tcl new file mode 100644 index 0000000..c9caeba --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_progtpth.tcl @@ -0,0 +1,171 @@ +#============================================================================== +# UI_PB_PROGTPTH.TCL +#============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Program & Tool Path Book. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-apr-1999 mnb Removed puts # +# 02-Jun-1999 mnb Code Integration # +# 13-Jun-1999 mnb Attached Tab procedures to Address Summary page # +# 07-Sep-1999 mnb Tree index is stored as the sequence index # +# 21-Sep-1999 mnb Changed Address Summary Tab Procedure, to update # +# Grid rows # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#============================================================================== +proc UI_PB_ProgTpth { book_id prgtpth_page_obj } { +#============================================================================== + set f [$book_id subwidget $Page::($prgtpth_page_obj,page_name)] + + set w [tixNoteBook $f.nb -ipadx 5 -ipady 5] + [$w subwidget nbframe] config -tabpady 0 + + set evnt_book [new Book w] + set Page::($prgtpth_page_obj,book_obj) $evnt_book + Book::CreatePage $evnt_book prog "Program" "" UI_PB_ProgTpth_Program \ + UI_PB_progtpth_ProgramTab + Book::CreatePage $evnt_book gcod "G Codes" "" UI_PB_ProgTpth_Gcode \ + UI_PB_progtpth_GcodeTab + Book::CreatePage $evnt_book mcod "M Codes" "" UI_PB_ProgTpth_Mcode \ + UI_PB_progtpth_McodeTab + Book::CreatePage $evnt_book asum "Address Summary" "" \ + UI_PB_ProgTpth_AddSum UI_PB_progtpth_AddsumTab + Book::CreatePage $evnt_book wseq "Word Sequencing" "" \ + UI_PB_ProgTpth_WordSeq UI_PB_progtpth_WordSeqTab + + pack $f.nb -expand yes -fill both + set Book::($evnt_book,x_def_tab_img) 0 + set Book::($evnt_book,current_tab) -1 +} + +#============================================================================== +proc UI_PB_progtpth_ProgramTab {book_id page_img book_obj} { +#============================================================================== + CB_nb_def $book_id $page_img $book_obj + + UI_PB_progtpth_DeleteTabAtt book_obj + + set Book::($book_obj,current_tab) 0 + UI_PB_progtpth_CreateTabAttr book_obj +} + +#============================================================================== +proc UI_PB_progtpth_GcodeTab {book_id page_img book_obj} { +#============================================================================== + + CB_nb_def $book_id $page_img $book_obj + UI_PB_progtpth_DeleteTabAtt book_obj + set Book::($book_obj,current_tab) 1 + UI_PB_progtpth_CreateTabAttr book_obj +} + +#============================================================================== +proc UI_PB_progtpth_McodeTab {book_id page_img book_obj} { +#============================================================================== + + CB_nb_def $book_id $page_img $book_obj + UI_PB_progtpth_DeleteTabAtt book_obj + set Book::($book_obj,current_tab) 2 + UI_PB_progtpth_CreateTabAttr book_obj +} + +#============================================================================== +proc UI_PB_progtpth_AddsumTab {book_id page_img book_obj} { +#============================================================================== + CB_nb_def $book_id $page_img $book_obj + UI_PB_progtpth_DeleteTabAtt book_obj + set Book::($book_obj,current_tab) 3 + UI_PB_progtpth_CreateTabAttr book_obj +} + +#============================================================================== +proc UI_PB_progtpth_WordSeqTab {book_id page_img book_obj} { +#============================================================================== + CB_nb_def $book_id $page_img $book_obj + UI_PB_progtpth_DeleteTabAtt book_obj + set Book::($book_obj,current_tab) 4 + UI_PB_progtpth_CreateTabAttr book_obj +} + +#============================================================================== +proc UI_PB_progtpth_CreateTabAttr { BOOK_OBJ } { +#============================================================================== + upvar $BOOK_OBJ book_obj + + switch -exact -- $Book::($book_obj,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 0] + UI_PB_evt_GetSequenceIndex page_obj seq_index + set seq_obj [lindex $Page::($page_obj,seq_obj_list) $seq_index] + UI_PB_evt_RestoreSeqObjData seq_obj + UI_PB_evt_CreateSeqAttributes page_obj + } + + 1 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 1] + UI_PB_gcd_RestoreGcodeData $page_obj + } + + 2 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 2] + UI_PB_mcd_RestoreMcodeData $page_obj + } + + 3 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 3] + UI_PB_ads_TabAddrsumCreate page_obj + } + + 4 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 4] + UI_PB_mseq_CreateMastSeqElements page_obj + } + } +} + +#============================================================================== +proc UI_PB_progtpth_DeleteTabAtt { BOOK_OBJ } { +#============================================================================== + upvar $BOOK_OBJ book_obj + + switch -exact -- $Book::($book_obj,current_tab) \ + { + 0 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 0] + # Deletes the objects of previous sequence + UI_PB_evt_DeleteObjectsPrevSeq page_obj + } + + 1 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 1] + UI_PB_gcd_ApplyGcodeData $book_obj $page_obj + } + + 2 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 2] + UI_PB_mcd_ApplyMcodeData $book_obj $page_obj + } + + 3 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 3] + UI_PB_ads_UpdateAddressObjects + } + + 4 { + set page_obj [lindex $Book::($book_obj,page_obj_list) 4] + UI_PB_mseq_ApplyMastSeq page_obj + UI_PB_mseq_DeleteMastSeqElems page_obj + } + } +} diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_resource.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_resource.tcl new file mode 100644 index 0000000..b589579 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_resource.tcl @@ -0,0 +1,200 @@ +############################################################################## +# UI_PB_RESOURCE.TCL +############################################################################## +# Description # +# This file defines resources for the widgets used in Post Builder. # +# # +# Revisions # +# --------- # +# Date Who Reason # +# 05-Oct-1999 gsl Initial # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +global gPB env + +#=============== +# Main Menu Bar +#=============== +## File +set gPB(main,file,Label) "File" + +set gPB(main,file,Balloon) "\ New, Open, Save,\n\ + Save\ As, Close and Exit" + +set gPB(main,file,Balloon1) "\ New, Open, Save,\n\ + Import MDFA,\n\ + Save\ As, Close and Exit" + +set gPB(main,file,Context) "File Utilities" + +set gPB(main,file,new,Label) "New ..." +set gPB(main,file,new,Balloon) "Create a new Post" + +set gPB(main,file,open,Label) "Open ..." +set gPB(main,file,open,Balloon) "Edit an existing Post" + +set gPB(main,file,mdfa,Label) "Import MDFA ..." +set gPB(main,file,mdfa,Balloon) "Create a new Post from MDFA" + +set gPB(main,file,save,Label) "Save" +set gPB(main,file,save,Balloon) "Save the Post in progress" + +set gPB(main,file,save_as,Label) "Save As ..." +set gPB(main,file,save_as,Balloon) "Save the Post to a new name" + +set gPB(main,file,close,Label) "Close" +set gPB(main,file,close,Balloon) "Close the Post in progress" + +set gPB(main,file,exit,Label) "Exit" +set gPB(main,file,exit,Balloon) "Terminate Post Builder" + +## Options +set gPB(main,options,Label) "Options" +set gPB(main,options,Balloon) "\ Properties, Post\ Advisor" +set gPB(main,options,Context) "Options" + +set gPB(main,options,properties,Label) "Properties" +set gPB(main,options,properties,Balloon) "Properties" + +set gPB(main,options,advisor,Label) "Post Advisor" +set gPB(main,options,advisor,Balloon) "Post Advisor" + +## Help +set gPB(main,help,Label) "Help" +set gPB(main,help,Balloon) "\ Balloon\ Tip,\n\ + Context\ Info,\n\ + What\ To\ Do,\n\ + Help\ on\ Dialog,\n\ + User's\ Manual,\n\ + About\ Post\ Builder,\n\ + Acknowledgements" + +set gPB(main,help,Context) "Help" + +set gPB(main,help,bal,Label) "Balloon Tip" +set gPB(main,help,bal,Balloon) "Balloon Tip on Icons" + +set gPB(main,help,chelp,Label) "Context Help" +set gPB(main,help,chelp,Balloon) "Context Sensitive Help on Dialog Items" + +set gPB(main,help,what,Label) "What To Do ?" +set gPB(main,help,what,Balloon) "What You Can Do Here?" + +set gPB(main,help,dialog,Label) "Help On Dialog" +set gPB(main,help,dialog,Balloon) "Help On This Dialog" + +set gPB(main,help,manual,Label) "User's Manual" +set gPB(main,help,manual,Balloon) "User's Help Manual" + +set gPB(main,help,about,Label) "About Post Builder" +set gPB(main,help,about,Balloon) "About Post Builder" + +set gPB(main,help,acknow,Label) "Acknoledgements" +set gPB(main,help,acknow,Balloon) "Acknoledgements & Credits" + +#========== +# Tool Bar +#========== +set gPB(tool,new,Label) "New" +set gPB(tool,new,Context) "New" + +set gPB(tool,open,Label) "Open" +set gPB(tool,open,Context) "Open" + +set gPB(tool,save,Label) "Save" +set gPB(tool,save,Context) "Save" + +set gPB(tool,bal,Label) "Balloon Tip" +set gPB(tool,bal,Context) "Balloon Tip" + +set gPB(tool,chelp,Label) "Context Info" +set gPB(tool,chelp,Context) "Context Info" + +set gPB(tool,what,Label) "What To Do?" +set gPB(tool,what,Context) "What To Do?" + +set gPB(tool,dialog,Label) "Help On Dialog" +set gPB(tool,dialog,Context) "Help On Dialog" + +set gPB(tool,manual,Label) "User's Manual" +set gPB(tool,manual,Context) "User's Manual" + +#============= +# Main Window +#============= +## Navigation Buttons +set gPB(nav_button,cancel,Label) "Cancel" +set gPB(nav_button,cancel,Context) "Cancel" +set gPB(nav_button,default,Label) "Default" +set gPB(nav_button,default,Context) "Default" +set gPB(nav_button,restore,Label) "Restore" +set gPB(nav_button,restore,Context) "Restore" +set gPB(nav_button,apply,Label) "Apply" +set gPB(nav_button,apply,Context) "Apply" +set gPB(nav_button,ok,Label) "OK" +set gPB(nav_button,ok,Context) "OK" +set gPB(nav_button,filter,Label) "Filter" +set gPB(nav_button,filter,Context) "Filter" +set gPB(nav_button,yes,Label) "Yes" +set gPB(nav_button,yes,Context) "Yes" +set gPB(nav_button,no,Label) "No" +set gPB(nav_button,no,Context) "No" + +set gPB(nav_button,no_license,Message) "No License To Perform This Function!" + +## Machine Tool +set gPB(machine,tab,Label) "Machine Tool" + +### Display +set gPB(machine,display,Label) "Display Machine Tool" +set gPB(machine,display,Context) "Display Machine Tool" + +### General parms +set gPB(machine,gen,Label) "General & Linear Parameters" +set gPB(machine,gen,out_unit,Label) "Post Output Unit :" +set gPB(machine,gen,kin_unit,Label) "Kinematic Data Unit" +set gPB(machine,gen,travel_limit,Label) "Linear Axis Travel Limits" +set gPB(machine,gen,travel_limit,x,Label) "X" +set gPB(machine,gen,travel_limit,y,Label) "Y" +set gPB(machine,gen,travel_limit,z,Label) "Z" +set gPB(machine,gen,home_pos,Label) "Home Postion" +set gPB(machine,gen,home_pos,x,Label) "X" +set gPB(machine,gen,home_pos,y,Label) "Y" +set gPB(machine,gen,home_pos,z,Label) "Z" +set gPB(machine,gen,step_size,Label) "Linear Motion Step Size" +set gPB(machine,gen,step_size,min,Label) "Minimum" +set gPB(machine,gen,traverse_feed,Label) "Traversal Feed Rate" +set gPB(machine,gen,traverse_feed,max,Label) "Maximum" + +### 4-th Axis parms +set gPB(machine,fourth,Label) "Fourth Axis Parameters" + +### 5-th Axis parms +set gPB(machine,fifth,Label) "Fifth Axis Parameters" + + + +## Program & Tool Path +set gPB(program,tab,Label) "Program & Tool Path" + + +## N/C Data Definitions +set gPB(nc_data,tab,Label) "N/C Data Definitions" + + +## Listing File +set gPB(listing,tab,Label) "Listing File" + + +## Output Preview +set gPB(output,tab,Label) "Files Preview" + + +## Post Advisor +set gPB(advisor,tab,Label) "Post Advisor" + + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_sequence.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_sequence.tcl new file mode 100644 index 0000000..f0f627c --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_sequence.tcl @@ -0,0 +1,3535 @@ +#============================================================================= +# UI_PB_SEQUENCE.TCL +#============================================================================= +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements of the sequences. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-Apr-1999 mnb Changed bitmap names # +# 02-Jun-1999 mnb Code Integration # +# 29-Jun-1999 mnb Changes event image properties, when the event # +# dialog is open # +# 07-Sep-1999 mnb A new block can be created and added to any event # +# in the sequence page # +# 21-Sep-1999 mnb Added Modality (Force Output Dialog) to a block # +# 18-Oct-1999 gsl Minor changes # +# 22-Oct-1999 gsl Added "Delete" option to the popup menu. # +# 09-Nov-1999 gsl Disable entire canvas when a Block is being edited # +# (UI_PB_evt_EditBlock) # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#========================================================================== +# This procedure creates the menu options i.e a list of blocks +# that are valid for a Sequence. +#========================================================================== +proc UI_PB_evt_CreateMenuOptions {PAGE_OBJ SEQ_OBJ} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + global tixOption + global CB_Block_Name + + # Gets the menubutton id + set comb_widget $Page::($page_obj,comb_widget) + set lbx [$comb_widget subwidget listbox] + + # Deletes all the existing options + $lbx delete 0 end + + # no of combobox elements + set no_of_elements [llength $sequence::($seq_obj,comb_elem_list)] + + # Adds new block option to combo box + $comb_widget insert end "New Block" + + # Adds the options to the combobox + for {set jj 0} {$jj < $no_of_elements} {incr jj} \ + { + set element [lindex $sequence::($seq_obj,comb_elem_list) $jj] + $comb_widget insert end $element + } + + # Sets the combobox variable to the first option, as default + set comb_var [lindex $sequence::($seq_obj,comb_elem_list) 0] + set sequence::($seq_obj,comb_var) $comb_var + set CB_Block_Name $comb_var +} + +#========================================================================== +# This procedure is called whenever an option is selected +# from the combobox list. +#========================================================================== +proc UI_PB_evt_ComboSelection {page_obj seq_obj sel_index} { +#========================================================================== + global tixOption + + # Gets the selected option, from the combo list,through the index + set selected_elem [lindex $sequence::($seq_obj,comb_elem_list) \ + $sel_index] + set comb_var $selected_elem + + # Checks for the combobox text entry, if it exists delets it + if {[info exists sequence::($seq_obj,comb_text)]}\ + { + $Page::($page_obj,top_canvas) delete \ + $sequence::($seq_obj,comb_text) + } + + # Creates a new combobox text entry, with selected option + set sequence::($seq_obj,comb_text) [$Page::($page_obj,top_canvas) \ + create text $Page::($page_obj,entry_cx) \ + $Page::($page_obj,entry_cy) -text $comb_var -font $tixOption(font)] + + set sequence::($seq_obj,comb_var) $comb_var +} + +#=============================================================== +# This procedure creates the action canvas for the action +# blocks. The action blocks exists only for the +# Program Start of Sequence. +#=============================================================== +proc UI_PB_evt_CreateActionCanvas {PAGE_OBJ SEQ_OBJ} { +#=============================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + global tixOption + + # Hard coded action block names + set prog_start_act {"Program ID" "Part No" "Tape Leader"} + + # Gets all the page attributes + set t_shift $Page::($page_obj,glob_text_shift) + set blk_width [lindex $Page::($page_obj,glob_evnt_dim) 0] + set blk_height [lindex $Page::($page_obj,glob_evnt_dim) 1] + set blk_blkdis $Page::($page_obj,glob_blk_blkdist_hor) + set rect_gap $Page::($page_obj,glob_rect_gap) + + set canvas_frame $Page::($page_obj,canvas_frame) + + # Creates the action canvas in the canvas frame + set action_canvas [canvas $canvas_frame.act] + + pack $action_canvas -side bottom -fill x -padx 3 + $action_canvas config -height 70 + + set Page::($page_obj,action_canvas) $action_canvas + set Page::($page_obj,act_canvas_hi) 70 + + # Hard coded the center of the first action block + set xc 120 + set yc 35 + + # Creates a rectangle around the action blocks based upon + # the no of action blocks + set no_action_blk [llength $prog_start_act] + set x1 [expr $xc - [expr $blk_width / 2] - $rect_gap] + set y1 [expr $yc - [expr $blk_height / 2] - $rect_gap] + set x2 [expr $x1 + [expr $blk_width * $no_action_blk] + \ + [expr $blk_blkdis * [expr $no_action_blk - 1]] + \ + [expr 2 * $rect_gap]] + set y2 [expr $y1 + $blk_height + [expr 2 * $rect_gap]] + + # stores the action rect and its coords as the attribute of sequence + set sequence::($seq_obj,action_rect) [$action_canvas create rect \ + $x1 $y1 $x2 $y2 -fill lightgray -outline lightgray] + + lappend sequence::($seq_obj,action_dim) $x1 $y1 $x2 $y2 + + # Creates the ui block objects of action blocks + foreach act_elem $prog_start_act \ + { + set act_blk_obj [new block] + set blk_obj_attr(0) $act_elem + set blk_obj_attr(1) "" + set blk_obj_attr(2) "" + set blk_obj_attr(3) "" + set blk_obj_attr(4) "" + block::setvalue $act_blk_obj blk_obj_attr + + set act_elem_obj [new event_element] + set elem_obj_attr(0) $act_elem + set elem_obj_attr(1) $act_blk_obj + set elem_obj_attr(2) "action" + event_element::setvalue $act_elem_obj elem_obj_attr + + #stores the type of block + set blk_img_id [UI_PB_blk_CreateIcon $action_canvas pb_block ""] + $blk_img_id config -bg lightsteelblue1 + + # creates the action icon at the xc and yc center + set img_id [$action_canvas create image $xc $yc -image $blk_img_id \ + -tag act_movable] + # stores the image id as the attribute of block object + set event_element::($act_elem_obj,icon_id) $img_id + + # Creates the text widget for the action block + set text_id [$action_canvas create text [expr $xc + $t_shift] \ + $yc -text $act_elem -font $tixOption(bold_font) \ + -tag act_movable] + # stores the text_id and the icon center + set event_element::($act_elem_obj,text_id) $text_id + set event_element::($act_elem_obj,xc) $xc + set event_element::($act_elem_obj,yc) $yc + + # stores the icon id and text id as a list + lappend sequence::($seq_obj,action_texticon) $text_id $img_id + set xc [expr $xc + $blk_width + $blk_blkdis] + + # Creates a tempory list of all the action block objects + lappend temp_actelem_list $act_elem_obj + } + # stores the action block object in the sequence object + set sequence::($seq_obj,action_elem_list) $temp_actelem_list + set sequence::($seq_obj,def_action_elem_list) $temp_actelem_list + set sequence::($seq_obj,rest_action_elem_list) $temp_actelem_list + + # Bind procedure + UI_PB_evt_ActionBindProcs page_obj seq_obj +} + +#===================================================================== +# This procedure attaches the bind calls to the action blocks +#===================================================================== +proc UI_PB_evt_ActionBindProcs {PAGE_OBJ SEQ_OBJ} { +#===================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + # Gets the action canvas id + set action_canvas $Page::($page_obj,action_canvas) + + # Binds Enter + $action_canvas bind act_movable \ + "UI_PB_evt_ActionFocusOn $action_canvas $seq_obj" + # Binds Leave + $action_canvas bind act_movable \ + "UI_PB_evt_ActionFocusOff $action_canvas $seq_obj" + # Binds First mouse button + $action_canvas bind act_movable <1> \ + "UI_PB_evt_ActionStartDrag $page_obj $seq_obj %x %y" + # Binds the First button motion + $action_canvas bind act_movable \ + "UI_PB_evt_ActionDrag $page_obj $seq_obj %x %y" + # Binds the release of the first button + $action_canvas bind act_movable \ + "UI_PB_evt_ActionEndDrag $page_obj $seq_obj" +} + +#===================================================================== +proc UI_PB_evt_ActionUnBindProcs {PAGE_OBJ SEQ_OBJ} { +#===================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + # Gets the action canvas id + set action_canvas $Page::($page_obj,action_canvas) + + # UnBinds Enter + $action_canvas bind act_movable "" + + # UnBinds Leave + $action_canvas bind act_movable "" + + # UnBinds First mouse button + $action_canvas bind act_movable <1> "" + + # UnBinds the First button motion + $action_canvas bind act_movable "" + + # UnBinds the release of the first button + $action_canvas bind act_movable "" +} + +#======================================================================== +# This procedure highlights the in focus action block, when the +# cursor enters the action block. +#========================================================================= +proc UI_PB_evt_ActionFocusOn {action_canvas seq_obj} { +#========================================================================= + global paOption + + # Gets the texticon list of action blocks + set texticon_id $sequence::($seq_obj,action_texticon) + + # Based upon the current x and y position, it returns the + # icon id of action block + set img [UI_PB_evt_GetCurrentImage $action_canvas texticon_id] + + # The icon id of the action block is stored as the focus block + set sequence::($seq_obj,act_focus_cell) $img + $img configure -background $paOption(focus) + + # Change cursor + $action_canvas config -cursor hand2 +} + +#======================================================================== +# This procedure unhighlights the in focus action block, when the +# cursor leaves the action block. +#======================================================================== +proc UI_PB_evt_ActionFocusOff {action_canvas seq_obj} { +#======================================================================== + # Unhighlight current icon + set act_focus_cell $sequence::($seq_obj,act_focus_cell) + + if {$act_focus_cell != 0} \ + { + $act_focus_cell configure -background lightsteelblue1 + set sequence::($seq_obj,act_focus_cell) 0 + } + + # Restore cursor + $action_canvas config -cursor "" +} + +#======================================================================= +# This procedure returns the action block object, based upon +# the image name. +#======================================================================== +proc UI_PB_evt_GetActionBlock {PAGE_OBJ SEQ_OBJ image_name} { +#======================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + # Gets the list of action block objects + set action_elem_list $sequence::($seq_obj,action_elem_list) + set action_canvas $Page::($page_obj,action_canvas) + + # Cycles all the action block objects, and matches + # the image name with the icon id stored in the action + # block objects. + foreach action_elem_obj $action_elem_list \ + { + set img_id $event_element::($action_elem_obj,icon_id) + set elem_img_name [lindex [$action_canvas itemconfigure \ + $img_id -image] end] + if {[string compare $image_name $elem_img_name] == 0} \ + { + set sequence::($seq_obj,drag_blk_obj) $action_elem_obj + break + } + } +} + +#========================================================================= +# This procedure is called, when first mouse button is clicked on the +# Action block. +#========================================================================== +proc UI_PB_evt_ActionStartDrag {page_obj seq_obj x y} { +#========================================================================== + global paOption + global tixOption + + set bot_canvas $Page::($page_obj,bot_canvas) + set action_canvas $Page::($page_obj,action_canvas) + set t_shift $Page::($page_obj,glob_text_shift) + + # Returns the top and bottom portion of the canvas, that is + # not to be seen + set y_shift [$bot_canvas yview] + + # Gets the top portion of canvas + set top_portion [expr [lindex $y_shift 0] * $Page::($page_obj,bot_height)] + + # Gets the bottom canvas height + set canvas_hi [expr [expr [lindex $y_shift 1] - [lindex $y_shift 0]] * \ + $Page::($page_obj,bot_height)] + + set Page::($page_obj,bot_canvas_hi) $canvas_hi + set panel_hi $Page::($page_obj,bot_canvas_hi) + set dy [expr $panel_hi + 6] + + set xx [$action_canvas canvasx $x] + set yy [$action_canvas canvasy $y] + + set texticon_id $sequence::($seq_obj,action_texticon) + # Gets the current action block image based upon cursor location + set img [UI_PB_evt_GetCurrentImage $action_canvas texticon_id] + + set sequence::($seq_obj,prev_act_blk_xc) $xx + set sequence::($seq_obj,prev_act_blk_yc) $yy + + UI_PB_evt_GetActionBlock page_obj seq_obj $img + set elem_obj $sequence::($seq_obj,drag_blk_obj) + + # Action block center is obtained + set elem_xc $event_element::($elem_obj,xc) + set elem_yc $event_element::($elem_obj,yc) + + # Calculates the distance between the cursor and the + # action block center + set diff_x [expr $xx - $elem_xc] + set diff_y [expr $yy - $elem_yc] + + # Creates a block image in the bottom canvas + set img_addr [UI_PB_blk_CreateIcon $bot_canvas pb_block ""] + $img_addr config -bg $paOption(focus) + + # Creates the new block image in the bottom canvas + set elem_bot_img [$bot_canvas create image [expr $x - $diff_x] \ + [expr $y + $dy - $diff_y + $top_portion] \ + -image $img_addr -tag del_block] + + # Creates the text widget + set block_obj $event_element::($elem_obj,block_obj) + set elem_text $block::($block_obj,block_name) + set elem_bot_text [$bot_canvas create text [expr $x - $diff_x + $t_shift] \ + [expr $y + $dy - $diff_y + $top_portion] -text $elem_text \ + -font $tixOption(bold_font) -tag act_movable] + + # Stores the attributes of action block as atributes of sequence + set sequence::($seq_obj,icon_bot) $elem_bot_img + set sequence::($seq_obj,icon_bot_text) $elem_bot_text + set sequence::($seq_obj,prev_bot_blk_xc) $x + set sequence::($seq_obj,prev_bot_blk_yc) \ + [expr $y + $panel_hi + $top_portion] +} + +#========================================================================== +# This procedure is triggered, when the cursor is moved by +# pressing the first mouse button on the action block +#========================================================================== +proc UI_PB_evt_ActionDrag {page_obj seq_obj x y} { +#========================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + set action_canvas $Page::($page_obj,action_canvas) + + # Gets the height of the bottom canvas + set panel_hi $Page::($page_obj,bot_canvas_hi) + + set xa [$action_canvas canvasx $x] + set ya [$action_canvas canvasy $y] + + set texticon_id $sequence::($seq_obj,action_texticon) + # Gets the current icon and test id based upon the cursor location + set objects [UI_PB_evt_GetCurrentCanvasObject $action_canvas texticon_id] + + # Translates the icon and text in action canvas + $action_canvas move [lindex $objects 0] \ + [expr $xa - $sequence::($seq_obj,prev_act_blk_xc)] \ + [expr $ya - $sequence::($seq_obj,prev_act_blk_yc)] + + $action_canvas move [lindex $objects 1] \ + [expr $xa - $sequence::($seq_obj,prev_act_blk_xc)] \ + [expr $ya - $sequence::($seq_obj,prev_act_blk_yc)] + + $action_canvas raise [lindex $objects 0] + $action_canvas raise [lindex $objects 1] + + set xb [$bot_canvas canvasx $x] + set yb [$bot_canvas canvasy $y] + + # Translates the icon and text in bottom canvas + $bot_canvas move $sequence::($seq_obj,icon_bot) \ + [expr $xb - $sequence::($seq_obj,prev_bot_blk_xc)] \ + [expr $yb - $sequence::($seq_obj,prev_bot_blk_yc) + $panel_hi] + + $bot_canvas move $sequence::($seq_obj,icon_bot_text) \ + [expr $xb - $sequence::($seq_obj,prev_bot_blk_xc)] \ + [expr $yb - $sequence::($seq_obj,prev_bot_blk_yc) + $panel_hi] + + set sequence::($seq_obj,prev_act_blk_xc) $xa + set sequence::($seq_obj,prev_act_blk_yc) $ya + + set yb [expr $yb + $panel_hi] + + set sequence::($seq_obj,prev_bot_blk_xc) $xb + set sequence::($seq_obj,prev_bot_blk_yc) $yb + + # Gets the Event object based upon the cursor location + UI_PB_evt_GetEventObjFromCurPos page_obj seq_obj $xb $yb + + # Based upon the cursor position, it highlights the + # top or bottom seperators or the rectangle itself + UI_PB_evt_HighLightSep page_obj seq_obj $xb $yb +} + +#========================================================================= +# This proecedure is called, when the first mouse button holding the +# action block is released +#========================================================================== +proc UI_PB_evt_ActionEndDrag {page_obj seq_obj} { +#========================================================================== + global paOption + + set action_canvas $Page::($page_obj,action_canvas) + set bot_canvas $Page::($page_obj,bot_canvas) + set drag_elem_obj $sequence::($seq_obj,drag_blk_obj) + + # Deletes the temporary block icon, created in the + # bottom canvas, for drag and drop. + if {$sequence::($seq_obj,icon_bot) != 0} \ + { + $bot_canvas delete $sequence::($seq_obj,icon_bot) + set sequence::($seq_obj,icon_bot) 0 + $bot_canvas delete $sequence::($seq_obj,icon_bot_text) + set sequence::($seq_obj,icon_bot_text) 0 + } + + # Checks for the existence of the event, at the point of + # releasing the first mouse button. If it didnot find + # any event, it returns the action block to its original + # position. + if {![info exists sequence::($seq_obj,add_blkto_evt_obj)]} \ + { + UI_PB_evt_ReturnActionBlock page_obj seq_obj + return + } + + # Checks for the adding conditions. Whether it has + # to be added to a existing row, or above a block (top) or + # below a block (bot). If neither of these conditions is + # is satisfied it returns back to its original position. + if {$sequence::($seq_obj,add_blk) != 0} \ + { + # Unhighlights the highligted seperators + UI_PB_evt_UnHighlightSeperators $bot_canvas seq_obj + set active_evt_obj $sequence::($seq_obj,add_blkto_evt_obj) + + # Checks status of the Event. Whether it is collapsed or in the + # expanded status. If it is collapsed, block is returned to its + # original position. + if {[string compare $event::($active_evt_obj,col_image) "minus"] == 0} \ + { + $action_canvas delete $event_element::($drag_elem_obj,icon_id) + # Creates a new element of a event + set new_elem_obj [new event_element] + set block_obj $event_element::($drag_elem_obj,block_obj) + set elem_obj_attr(0) $block::($block_obj,block_name) + set elem_obj_attr(1) $block_obj + set elem_obj_attr(2) "action" + event_element::setvalue $new_elem_obj elem_obj_attr + + switch $sequence::($seq_obj,add_blk) \ + { + "row" \ + { + # Adds the action block to a selected row + UI_PB_evt_AddBlkToARow page_obj seq_obj new_elem_obj + } + "top" \ + { + # Adds the action block, above the selected row + UI_PB_evt_AddBlkAboveOrBelow page_obj seq_obj new_elem_obj + } + "bottom" \ + { + # Adds the action block, below the selected row + UI_PB_evt_AddBlkAboveOrBelow page_obj seq_obj new_elem_obj + } + } + } + set sequence::($seq_obj,add_blk) 0 + } else \ + { + # Returns the action block to its originla position + UI_PB_evt_ReturnActionBlock page_obj seq_obj + } +} + +#============================================================================== +# This procedure locates the draged action block at its +# original position +#=============================================================================== +proc UI_PB_evt_ReturnActionBlock {PAGE_OBJ SEQ_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set action_canvas $Page::($page_obj,action_canvas) + set drag_elem_obj $sequence::($seq_obj,drag_blk_obj) + set text_shift $Page::($page_obj,glob_text_shift) + + set texticon_id $sequence::($seq_obj,action_texticon) + + # Gets the icon and text ids based upon the current cursor location + set objects [UI_PB_evt_GetCurrentCanvasObject $action_canvas texticon_id] + $action_canvas coords [lindex $objects 0] \ + $event_element::($drag_elem_obj,xc) $event_element::($drag_elem_obj,yc) + $action_canvas coords [lindex $objects 1] \ + [expr $event_element::($drag_elem_obj,xc) \ + + $text_shift] $event_element::($drag_elem_obj,yc) +} + +#========================================================================== +# This procedure attaches the bind calls to the Add icon +#========================================================================== +proc UI_PB_evt_AddBindProcs { PAGE_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + set top_canvas $Page::($page_obj,top_canvas) + + # Binds Enter of cursor to Add icon + $top_canvas bind add_movable "UI_PB_evt_AddFocusOn $top_canvas" + + # Binds Leave + $top_canvas bind add_movable "UI_PB_evt_AddFocusOff $top_canvas" + + # Binds First mouse button + $top_canvas bind add_movable <1> "UI_PB_evt_AddStartDrag $page_obj \ + %x %y" + # Binds the First button motion + $top_canvas bind add_movable "UI_PB_evt_AddDrag $page_obj \ + %x %y" + # Binds the release of first button + $top_canvas bind add_movable "UI_PB_evt_AddEndDrag \ + $page_obj" +} + +#========================================================================== +proc UI_PB_evt_AddUnBindProcs { PAGE_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + set top_canvas $Page::($page_obj,top_canvas) + + # UnBinds Enter of cursor to Add icon + $top_canvas bind add_movable "" + + # UnBinds Leave + $top_canvas bind add_movable "" + + # UnBinds First mouse button + $top_canvas bind add_movable <1> "" + + # UnBinds the First button motion + $top_canvas bind add_movable "" + + # UnBinds the release of first button + $top_canvas bind add_movable "" +} + +#========================================================================== +# This procedure is called whenever the cursor enters the +# Add icon +#========================================================================== +proc UI_PB_evt_AddFocusOn {top_canvas} { +#========================================================================== + global paOption + + # Highlight current icon by changing the background color + # of the icon + set im [$top_canvas itemconfigure current -image] + [lindex $im end] configure -background $paOption(focus) + + +# Change cursor +set c $top_canvas +$c config -cursor hand2 +} + +#========================================================================== +# This proecedure is called whenever the cursor leves the Add icon +#========================================================================== +proc UI_PB_evt_AddFocusOff {top_canvas} { +#========================================================================== + global paOption + + # Unhighlight current icon by changing the bacground color of + # icon to its original color + set im [$top_canvas itemconfigure current -image] + [lindex $im end] configure -background $paOption(app_butt_bg) + + +# Change cursor +set c $top_canvas +$c config -cursor "" +} + +#========================================================================== +# This procedure is called upon the clicking the +# first mouse button on the Add icon. +#========================================================================== +proc UI_PB_evt_AddStartDrag {page_obj x y} { +#========================================================================== + global paOption + global tixOption + global CB_Block_Name + + # Gets the Sequence objects based upon the selected + # Sequence. + UI_PB_evt_GetSequenceIndex page_obj seq_index + set seq_obj [lindex $Page::($page_obj,seq_obj_list) $seq_index] + set sequence::($seq_obj,comb_var) $CB_Block_Name + + set top_canvas $Page::($page_obj,top_canvas) + set bot_canvas $Page::($page_obj,bot_canvas) + + # Top canvas height + set panel_hi $Page::($page_obj,panel_hi) + set t_shift $Page::($page_obj,glob_text_shift) + + # Draws icon in the top canvas + set xt [$top_canvas canvasx $x] + set yt [$top_canvas canvasy $y] + + # Creates the new block icon in the top canvas + set icon1 [UI_PB_blk_CreateIcon $top_canvas pb_block ""] + + set icon_top [$top_canvas create image $xt $yt \ + -image $icon1] + # Creates the text widget + set icon_top_text [$top_canvas create text [expr $xt + $t_shift] \ + $yt -text $sequence::($seq_obj,comb_var) \ + -font $tixOption(bold_font)] + + # configures the icon backgorund + $icon1 config -bg $paOption(butt_bg) + + # Stores the icon id and its text id + set sequence::($seq_obj,icon_top) $icon_top + set sequence::($seq_obj,icon_top_text) $icon_top_text + + # Creates new block icon in the bottom canvas + set xb [$bot_canvas canvasx $x] + set yb [$bot_canvas canvasy [expr $y - $panel_hi - 2]] + + set icon2 [UI_PB_blk_CreateIcon $bot_canvas pb_block ""] + set icon_bot [$bot_canvas create image $xb $yb \ + -image $icon2] + set icon_bot_text [$bot_canvas create text [expr $xb + $t_shift] \ + $yb -text $sequence::($seq_obj,comb_var) \ + -font $tixOption(bold_font)] + + $icon2 config -bg $paOption(butt_bg) + set sequence::($seq_obj,icon_bot) $icon_bot + set sequence::($seq_obj,icon_bot_text) $icon_bot_text +} + +#========================================================================== +# This procedure is triggered, when the cursor is moved by +# pressing the first mouse button on the add block +#========================================================================== +proc UI_PB_evt_AddDrag {page_obj x y} { +#========================================================================== + set top_canvas $Page::($page_obj,top_canvas) + set bot_canvas $Page::($page_obj,bot_canvas) + + UI_PB_evt_GetSequenceIndex page_obj seq_index + set seq_obj [lindex $Page::($page_obj,seq_obj_list) $seq_index] + + set xx [$top_canvas canvasx $x] + set yy [$top_canvas canvasy $y] + + # Translates the icon in top canvas + $top_canvas coords $sequence::($seq_obj,icon_top) $xx $yy + $top_canvas coords $sequence::($seq_obj,icon_top_text) $xx $yy + + set panel_hi $Page::($page_obj,panel_hi) + set dy [expr $panel_hi + 2] + set xx [$bot_canvas canvasx $x] + set yy [$bot_canvas canvasy [expr $y - $dy]] + + # Translates the block icon in bottom canvas + $bot_canvas coords $sequence::($seq_obj,icon_bot) $xx $yy + $bot_canvas coords $sequence::($seq_obj,icon_bot_text) $xx $yy + + # Gets the Event object, based upon the current cursor location. + UI_PB_evt_GetEventObjFromCurPos page_obj seq_obj $xx $yy + + # Highlights the seperators of block templates, based on + # the cursor location + UI_PB_evt_HighLightSep page_obj seq_obj $xx $yy +} + +#======================================================================== +# This procedure returns the Event object based upon the location +# of the cursor. +#========================================================================= +proc UI_PB_evt_GetEventObjFromCurPos {PAGE_OBJ SEQ_OBJ x y} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set evt_dim_height [lindex $Page::($page_obj,glob_evnt_dim) 1] + set evt_evtdist $Page::($page_obj,glob_evt_evtdist) + set flag 0 + + # Cycles through events of a Sequence, matching the cursor + # coordinates with the Event range. (Right upper corner of Event to the + # right lower corner of the last block of the event) + foreach evt_obj $sequence::($seq_obj,evt_obj_list) \ + { + if {$y > [expr $event::($evt_obj,yc) - [expr $evt_dim_height / 2] \ + - [expr $evt_evtdist / 2]] && $y < \ + [expr $event::($evt_obj,event_height) - [expr $evt_dim_height / 2] \ + - [expr $evt_evtdist / 2]] } \ + { + set sequence::($seq_obj,add_blkto_evt_obj) $evt_obj + set flag 1 + break + } + + } + + if {$flag == 0} \ + { + if {[info exists sequence::($seq_obj,add_blkto_evt_obj)]} \ + { + unset sequence::($seq_obj,add_blkto_evt_obj) + } + } +} + +#========================================================================= +proc UI_PB_evt_HighLightRowOfEvent { PAGE_OBJ SEQ_OBJ EVT_OBJ COUNT } { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + upvar $COUNT count + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + + # If the cursor is within the upper right corner and the + # lower left corner of the block template. It highlights + # the two seperators and the rectangle. + set rect_id [lindex $event::($evt_obj,rect_id) $count] + $bot_canvas itemconfigure $rect_id -outline $paOption(focus) \ + -fill $paOption(focus) + + set temp_sep [lindex $event::($evt_obj,sep_id) $count] + set sep_id1 [lindex $temp_sep 0] + set sep_id2 [lindex $temp_sep 1] + $bot_canvas itemconfigure $sep_id1 -outline $paOption(focus) + $bot_canvas itemconfigure $sep_id2 -outline $paOption(focus) + lappend list_ids $rect_id $sep_id1 $sep_id2 + set sequence::($seq_obj,focus_rect) $list_ids + set sequence::($seq_obj,add_blk) "row" + set sequence::($seq_obj,blk_temp) $count +} + +#========================================================================= +proc UI_PB_evt_AvoidHighLightRow { SEQ_OBJ ACTIVE_EVT_OBJ COUNT } { +#========================================================================= + upvar $SEQ_OBJ seq_obj + upvar $ACTIVE_EVT_OBJ active_evt_obj + upvar $COUNT count + + # To avoid highligting the row of a dragged block + if {[info exists sequence::($seq_obj,drag_evt_obj)]} \ + { + if {$sequence::($seq_obj,drag_evt_obj) == $active_evt_obj \ + && $sequence::($seq_obj,drag_row) == $count} \ + { + set sequence::($seq_obj,add_blk) 0 + set sequence::($seq_obj,blk_temp) 0 + return 1 + } else \ + { + return 0 + } + } else \ + { + return 0 + } +} + +#========================================================================= +proc UI_PB_evt_AvoidHighLightTopOrBottomSep { SEQ_OBJ ACTIVE_EVT_OBJ COUNT } { +#========================================================================= + upvar $SEQ_OBJ seq_obj + upvar $ACTIVE_EVT_OBJ active_evt_obj + upvar $COUNT count + + # To avoid highligting the top seperator, if there is + # is only one block in the row, and if that block itself + # is draged. + if {[info exists sequence::($seq_obj,drag_evt_obj)]} \ + { + set drag_evt_obj $sequence::($seq_obj,drag_evt_obj) + set drag_row $sequence::($seq_obj,drag_row) + set temp_length \ + [llength [lindex $event::($drag_evt_obj,evt_elem_list) $drag_row]] + if {$drag_evt_obj == $active_evt_obj && \ + $drag_row == $count && $temp_length == 1} \ + { + return 1 + } else \ + { + return 0 + } + } else \ + { + return 0 + } +} + +#========================================================================= +proc UI_PB_evt_HighLightTopSeperator { PAGE_OBJ SEQ_OBJ EVT_OBJ COUNT } { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + upvar $COUNT count + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + + set temp_sep [lindex $event::($evt_obj,sep_id) $count] + set sep_id [lindex $temp_sep 0] + set sequence::($seq_obj,focus_sep) $sep_id + $bot_canvas itemconfigure $sep_id -outline $paOption(focus) + set sequence::($seq_obj,add_blk) "top" + set sequence::($seq_obj,blk_temp) $count +} + +#========================================================================= +proc UI_PB_evt_HighLightBottomSeperator { PAGE_OBJ SEQ_OBJ EVT_OBJ COUNT } { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + upvar $COUNT count + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + + set temp_sep [lindex $event::($evt_obj,sep_id) $count] + set sep_id [lindex $temp_sep 1] + set sequence::($seq_obj,focus_sep) $sep_id + $bot_canvas itemconfigure $sep_id -outline $paOption(focus) + set sequence::($seq_obj,add_blk) "bottom" + set sequence::($seq_obj,blk_temp) $count +} + +#========================================================================= +# This procedure Highlights the seperators of the block template (row) and +# the row itself, based upon the position of the cursor. +#========================================================================== +proc UI_PB_evt_HighLightSep {PAGE_OBJ SEQ_OBJ x y} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + global paOption + + set region $sequence::($seq_obj,region) + set blk_dim_height [lindex $Page::($page_obj,glob_blk_dim) 1] + set bot_canvas $Page::($page_obj,bot_canvas) + set rect_gap $Page::($page_obj,glob_rect_gap) + + # Unhighlights the rectangle and two seperators + UI_PB_evt_UnHighlightSeperators $bot_canvas seq_obj + + # Checks for an event, to which the block has to be added + if {[info exists sequence::($seq_obj,add_blkto_evt_obj)]} \ + { + # Gets the selected event to which block has to be added + set active_evt_obj $sequence::($seq_obj,add_blkto_evt_obj) + + # Gets the no of block template rows + set no_rows $event::($active_evt_obj,block_nof_rows) + set event_width $event::($active_evt_obj,event_width) + set event_xc $event::($active_evt_obj,xc) + + if {$no_rows > 0} \ + { + for {set count 0} {$count < $no_rows} {incr count} \ + { + set row_elem_objs [lindex $event::($active_evt_obj,evt_elem_list) \ + $count] + set elem_obj [lindex $row_elem_objs 0] + set yc $event_element::($elem_obj,yc) + + # To Highlight the rectangle + if {$y > [expr $yc - [expr $blk_dim_height / 2]] && \ + $y < [expr $yc + [expr $blk_dim_height / 2]] && \ + $x > [expr $event_xc - $region] && \ + $x < [expr $event_xc + $event_width + $region]} \ + { + set high_flag [UI_PB_evt_AvoidHighLightRow seq_obj \ + active_evt_obj count] + if {$high_flag} { return } + + UI_PB_evt_HighLightRowOfEvent page_obj seq_obj \ + active_evt_obj count + break + + # To Highlight the top seperator. + } elseif {$y > [expr $yc - [expr $blk_dim_height / 2] - \ + [expr 3 * $rect_gap]] && \ + $y < [expr $yc - [expr $blk_dim_height / 2]] && \ + $x > [expr $event_xc - $region] && \ + $x < [expr $event_xc + $event_width + $region]} \ + { + set high_flag [UI_PB_evt_AvoidHighLightTopOrBottomSep seq_obj \ + active_evt_obj count] + if {$high_flag} { return } + + UI_PB_evt_HighLightTopSeperator page_obj seq_obj \ + active_evt_obj count + break + + # To HighLight the bottom Seperato. + } elseif {$y > [expr $yc + [expr $blk_dim_height / 2]] && \ + $y < [expr $yc + [expr $blk_dim_height / 2] + \ + [expr 3 * $rect_gap]] && \ + $x > [expr $event_xc - $region] && \ + $x < [expr $event_xc + $event_width + $region]} \ + { + set high_flag [UI_PB_evt_AvoidHighLightTopOrBottomSep seq_obj \ + active_evt_obj count] + if {$high_flag} { return } + + UI_PB_evt_HighLightBottomSeperator page_obj seq_obj \ + active_evt_obj count + break + } else \ + { + set sequence::($seq_obj,add_blk) 0 + set sequence::($seq_obj,blk_temp) 0 + } + } + # If the event has got zero no of block templates (rows) + } elseif {$no_rows == 0} \ + { + set yc $event::($active_evt_obj,yc) + + if {$y > [expr $yc - [expr $blk_dim_height / 2]] && \ + $y < [expr $yc + [expr $blk_dim_height / 2]] && \ + $x > [expr $event_xc - $region] && \ + $x < [expr $event_xc + $event_width + $region]} \ + { + set rect_id [lindex $event::($active_evt_obj,rect_id) 0] + $bot_canvas itemconfigure $rect_id -outline $paOption(focus) \ + -fill $paOption(focus) + lappend list_ids $rect_id + set sequence::($seq_obj,focus_rect) $list_ids + set sequence::($seq_obj,add_blk) "top" + } + } + } else \ + { + set sequence::($seq_obj,add_blk) 0 + set sequence::($seq_obj,blk_temp) 0 + } +} + +#========================================================================== +proc UI_PB_evt_DeleteTemporaryIcons { PAGE_OBJ SEQ_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set top_canvas $Page::($page_obj,top_canvas) + set bot_canvas $Page::($page_obj,bot_canvas) + + # Deletes the temporary iocn created in the top canvas + # for drag and drop. + if {$sequence::($seq_obj,icon_top) != 0} \ + { + $top_canvas delete $sequence::($seq_obj,icon_top) + set sequence::($seq_obj,icon_top) 0 + $top_canvas delete $sequence::($seq_obj,icon_top_text) + set sequence::($seq_obj,icon_top_text) 0 + } + + # Deletes the temporary iocn created in the bottom canvas + # for drag and drop. + if {$sequence::($seq_obj,icon_bot) != 0} \ + { + $bot_canvas delete $sequence::($seq_obj,icon_bot) + set sequence::($seq_obj,icon_bot) 0 + $bot_canvas delete $sequence::($seq_obj,icon_bot_text) + set sequence::($seq_obj,icon_bot_text) 0 + } +} + +#========================================================================== +# This proceduer is triggered, when the first mouse button holding +# the add block is released. +#========================================================================== +proc UI_PB_evt_AddEndDrag {page_obj} { +#========================================================================== + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + UI_PB_evt_GetSequenceIndex page_obj seq_index + set seq_obj [lindex $Page::($page_obj,seq_obj_list) $seq_index] + + UI_PB_evt_DeleteTemporaryIcons page_obj seq_obj + + # Checks for the event at the cursor location. if it didnot + # find a event it does nothing. + if {![info exists sequence::($seq_obj,add_blkto_evt_obj)]} \ + { + return + } + + # Unhighlightes the highlighted seperators + UI_PB_evt_UnHighlightSeperators $bot_canvas seq_obj + + set active_evt_obj $sequence::($seq_obj,add_blkto_evt_obj) + + # Checks for the status of the Event. + if {[string compare $event::($active_evt_obj,col_image) "minus"] == 0} \ + { + set new_elem_name $sequence::($seq_obj,comb_var) + + if { [string compare $new_elem_name "New Block"] == 0 } \ + { + set active_evt_name $event::($active_evt_obj,event_name) + set new_elem_name "new_block" + set new_blk_elem_list "" + PB_int_CreateNewBlock new_elem_name new_blk_elem_list \ + active_evt_name new_block_obj + + } else \ + { + set temp_name [split $new_elem_name " "] + set new_elem_name [join $temp_name "_"] + set new_elem_name [string tolower $new_elem_name] + } + + set elem_type "normal" + PB_int_GetNewEventElement active_evt_obj new_elem_name \ + elem_type elem_obj + UI_PB_evt_AddBlockToEvent page_obj seq_obj elem_obj + + # Add a new Block to the Sequence + if { [string compare $new_elem_name "new_block"] == 0 && \ + $sequence::($seq_obj,add_blk) != 0 } \ + { + set blk_img_id $event_element::($elem_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $blk_img_id -image] end] + $img config -relief sunken -bg pink + + update + set canvas_frame $Page::($page_obj,canvas_frame) + + # Gets the unique block name + UI_PB_com_ReturnBlockName active_evt_obj new_block_name + set block::($new_block_obj,block_name) $new_block_name + + + UI_PB_evt__DisplayBlockPage $page_obj $seq_obj $new_block_obj $elem_obj + + +## UI_PB_blk_CreateBlockPage new_block_obj canvas_frame new_blkpg_obj +## UI_PB_blk_NewBlkActionButtons new_blkpg_obj page_obj seq_obj \ + active_evt_obj elem_obj + } + } + set sequence::($seq_obj,add_blk) 0 +} + +#========================================================================= +proc UI_PB_evt_AddBlockToEvent { PAGE_OBJ SEQ_OBJ ELEM_OBJ } { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $ELEM_OBJ elem_obj + + # Based upon the selection, it adds the block to a template, + # or above the selected templated or below a block template + switch $sequence::($seq_obj,add_blk) \ + { + "row" \ + { + set blk_exists_flag [UI_PB_evt_CheckBlkInTemplate seq_obj elem_obj] + + # Checks for the existance of new block in the block template. + # if it exists it popups an error message. + if {$blk_exists_flag} \ + { + set block_obj $event_element::($elem_obj,block_obj) + set block_name $block::($block_obj,block_name) + tk_messageBox -type ok -icon error \ + -message "Block $block_name exists in the Block Template" + return + } + + UI_PB_evt_AddBlkToARow page_obj seq_obj elem_obj + } + "top" \ + { + UI_PB_evt_AddBlkAboveOrBelow page_obj seq_obj elem_obj + } + "bottom" \ + { + UI_PB_evt_AddBlkAboveOrBelow page_obj seq_obj elem_obj + } + } +} + +#========================================================================= +# This procedure returns a value based upon the existance of the +# new block in the block template (row). If the new block exists +# in the template it returns 1 else it returns 0. +#========================================================================== +proc UI_PB_evt_CheckBlkInTemplate {SEQ_OBJ NEW_ELEM_OBJ} { +#========================================================================== + upvar $SEQ_OBJ seq_obj + upvar $NEW_ELEM_OBJ new_elem_obj + + set block_obj $event_element::($new_elem_obj,block_obj) + set new_block_name $block::($block_obj,block_name) + + set active_evt_obj $sequence::($seq_obj,add_blkto_evt_obj) + set blk_temp_no $sequence::($seq_obj,blk_temp) + set row_elements [lindex $event::($active_evt_obj,evt_elem_list) \ + $blk_temp_no] + set blk_exists 0 + + # Cycles through the block objects + foreach elem_obj $row_elements \ + { + set block_obj $event_element::($elem_obj,block_obj) + set temp_blk_name $block::($block_obj,block_name) + if {[string compare $temp_blk_name $new_block_name] == 0} \ + { + set blk_exists 1 + break + } + } + + if {$blk_exists} \ + { + return 1 + } else \ + { + return 0 + } +} + +#========================================================================= +# This procedure unhighlights the block template seperators, +# if they are highlited. +#========================================================================== +proc UI_PB_evt_UnHighlightSeperators {bot_canvas SEQ_OBJ} { +#========================================================================== + upvar $SEQ_OBJ seq_obj + global paOption + + # Unhighlights the top or bottom seperators. + # If a block is added above or below the template + if {$sequence::($seq_obj,focus_sep) != 0} \ + { + $bot_canvas itemconfigure $sequence::($seq_obj,focus_sep) \ + -outline $paOption(can_bg) + set sequence::($seq_obj,focus_sep) 0 + } + + # Unhighlights the top, bottom and the rect. + # If the block is added to the row itself + if {$sequence::($seq_obj,focus_rect) != 0} \ + { + set length [llength $sequence::($seq_obj,focus_rect)] + + set rect_id [lindex $sequence::($seq_obj,focus_rect) 0] + $bot_canvas itemconfigure $rect_id -outline $paOption(can_bg) \ + -fill $paOption(can_bg) + + if {$length > 1} \ + { + set sep_id1 [lindex $sequence::($seq_obj,focus_rect) 1] + $bot_canvas itemconfigure $sep_id1 -outline $paOption(can_bg) + + set sep_id2 [lindex $sequence::($seq_obj,focus_rect) 2] + $bot_canvas itemconfigure $sep_id2 -outline $paOption(can_bg) + } + } +} + +#========================================================================== +# This procedure adds the new element to the existing block +# template (row). +#========================================================================== +proc UI_PB_evt_AddBlkToARow {PAGE_OBJ SEQ_OBJ ELEM_OBJ} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $ELEM_OBJ elem_obj + + # Gets the bottom canvas id and the dimensions of the block. + set bot_canvas $Page::($page_obj,bot_canvas) + set blk_blkdist $Page::($page_obj,glob_blk_blkdist_hor) + set blk_dim_width [lindex $Page::($page_obj,glob_blk_dim) 0] + + # Gets the event object, to which an new block has to be added. + set active_evt_obj $sequence::($seq_obj,add_blkto_evt_obj) + + # gets the row number i.e block template + set blk_temp_no $sequence::($seq_obj,blk_temp) + + # Gets the block list of the template + set row_elem_list [lindex $event::($active_evt_obj,evt_elem_list) \ + $blk_temp_no] + set last_elem_obj [lindex $row_elem_list end] + + set x1 $event_element::($last_elem_obj,xc) + set elem_xc [expr $event_element::($last_elem_obj,xc) + $blk_blkdist + \ + $blk_dim_width] + set elem_yc $event_element::($last_elem_obj,yc) + + # Appends the new block to the selected block template + lappend row_elem_list $elem_obj + set event::($active_evt_obj,evt_elem_list) [lreplace \ + $event::($active_evt_obj,evt_elem_list) $blk_temp_no \ + $blk_temp_no $row_elem_list] + + set event_element::($elem_obj,xc) $elem_xc + set event_element::($elem_obj,yc) $elem_yc + + # creates the new block + UI_PB_evt_CreateEventElement page_obj seq_obj elem_obj + + set line_id [UI_PB_evt_CreateLine bot_canvas $x1 $elem_yc \ + $elem_xc $elem_yc] + set event_element::($elem_obj,line_id) $line_id + + # Deletes all the seperators of the templates and recreates + # them. + $bot_canvas delete [lindex $event::($active_evt_obj,rect_id) \ + $blk_temp_no] + + set sep_list [lindex $event::($active_evt_obj,sep_id) \ + $blk_temp_no] + + $bot_canvas delete [lindex $sep_list 0] + $bot_canvas delete [lindex $sep_list 1] + + set temp_ids [UI_PB_evt_CreateARowTempRect page_obj active_evt_obj \ + blk_temp_no] + + set rect_sep [lindex $temp_ids 0] + set event::($active_evt_obj,rect_id) \ + [lreplace $event::($active_evt_obj,rect_id) \ + $blk_temp_no $blk_temp_no $rect_sep] + + set sep_list [lrange $temp_ids 1 end] + set event::($active_evt_obj,sep_id) \ + [lreplace $event::($active_evt_obj,sep_id) \ + $blk_temp_no $blk_temp_no $sep_list] +} + +#========================================================================== +# This procedure is called for adding a new block, above or +# below the selected block template. +#========================================================================== +proc UI_PB_evt_AddBlkAboveOrBelow {PAGE_OBJ SEQ_OBJ NEW_ELEM_OBJ} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $NEW_ELEM_OBJ new_elem_obj + + # Gets the selected event and the block template no. + set active_evt_obj $sequence::($seq_obj,add_blkto_evt_obj) + set blk_tempno $sequence::($seq_obj,blk_temp) + + # Total no of block templates in the event. + set no_of_templates $event::($active_evt_obj,block_nof_rows) + + # Deletes all the blocks of the events + UI_PB_evt_DeleteEventElements page_obj seq_obj active_evt_obj + + # if the new block has to be added below the selected templated + # block, it increments the block template number. + switch $sequence::($seq_obj,add_blk) \ + { + "bottom" \ + { + incr blk_tempno + } + } + + for {set count 0} {$count < $blk_tempno} {incr count} \ + { + set temp_list [lindex $event::($active_evt_obj,evt_elem_list) $count] + lappend elem_obj_list $temp_list + } + + lappend elem_obj_list $new_elem_obj + + # Realigns all the template blocks in sequence. + for {set count $blk_tempno} {$count < $no_of_templates} \ + {incr count} \ + { + set temp_list [lindex $event::($active_evt_obj,evt_elem_list) $count] + lappend elem_obj_list $temp_list + } + + set event::($active_evt_obj,evt_elem_list) $elem_obj_list + unset elem_obj_list + set event::($active_evt_obj,block_nof_rows) [expr $no_of_templates + 1] + + # Creates all the blocks of a event + UI_PB_evt_CreateElementsOfEvent page_obj seq_obj active_evt_obj + + set active_evt_index [lsearch $sequence::($seq_obj,evt_obj_list) \ + $active_evt_obj] + + # Transforms all other Events and blocks of there respective + # Events. + UI_PB_evt_TransformEvtElem page_obj seq_obj active_evt_index +} + +#========================================================================= +# This procedure creates the events and blocks of the non tool path +# Sequence +#========================================================================= +proc UI_PB_evt_CreateSeqEvent {PAGE_OBJ SEQ_OBJ TPTH_EVENT_FLAG} { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $TPTH_EVENT_FLAG tpth_event_flag + + global tixOption + global paOption + + set origin(0) 60 + set origin(1) 50 + + # Gets the dimensions of Event and block icons + set evt_dim_width [lindex $Page::($page_obj,glob_evnt_dim) 0] + set evt_dim_height [lindex $Page::($page_obj,glob_evnt_dim) 1] + set blk_dim_width [lindex $Page::($page_obj,glob_blk_dim) 0] + set blk_dim_height [lindex $Page::($page_obj,glob_blk_dim) 1] + + set prev_evt_focus_cell $sequence::($seq_obj,evt_focus_cell) + set prev_blk_focus_cell $sequence::($seq_obj,blk_focus_cell) + + # total no of events in the sequence. + set no_of_events [llength $sequence::($seq_obj,evt_obj_list)] + set bot_canvas $Page::($page_obj,bot_canvas) + + # calculates the center of first event. + set evt_xc [expr [expr $origin(0) + $evt_dim_width] / 2] + set evt_yc [expr [expr $origin(1) + $evt_dim_height] / 2] + + # unbinds the event procs + UI_PB_evt_UnBindEvtProcs page_obj + + for {set evt_count 0} {$evt_count < $no_of_events} {incr evt_count} \ + { + # Creates the Event Icon + set evt_obj [lindex $sequence::($seq_obj,evt_obj_list) $evt_count] + set event::($evt_obj,xc) $evt_xc + set event::($evt_obj,yc) $evt_yc + set event::($evt_obj,col_image) "minus" + UI_PB_evt_CreateEvent page_obj seq_obj evt_obj + + # Creates Blocks of a Event + if {$tpth_event_flag == 0} \ + { + UI_PB_evt_CreateElementsOfEvent page_obj seq_obj evt_obj + } else \ + { + UI_PB_evt_CreateElemOfTpthEvent page_obj seq_obj evt_obj + } + set evt_yc $event::($evt_obj,event_height) + } + + $bot_canvas bind col_movable <1> "UI_PB_evt_CollapseAEvent $page_obj \ + $seq_obj %x %y" +} + +#========================================================================= +# This proecedure deletes all the events and its blocks of a +# specified sequence. +#========================================================================= +proc UI_PB_evt_DeleteSeqEvents {PAGE_OBJ SEQ_OBJ} { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Cycles through all the events of a sequence + foreach evt_obj $sequence::($seq_obj,evt_obj_list) \ + { + # Deletes the event + UI_PB_evt_DeleteAEvent $bot_canvas seq_obj evt_obj + + # Deletes all the blocks + UI_PB_evt_DeleteEventElements page_obj seq_obj evt_obj + } +} + +#========================================================================= +# This proecedure creates a Collapse icon for an Event. +#========================================================================= +proc UI_PB_evt_CreateCollapseIcon {PAGE_OBJ SEQ_OBJ EVT_OBJ} { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + + # Gets the image name of collapse from the library + set image_name $event::($evt_obj,col_image) + + # Gets the center and dimensions of the Event. + set icon_xc $event::($evt_obj,xc) + set icon_yc $event::($evt_obj,yc) + set evt_dim_width [lindex $Page::($page_obj,glob_evnt_dim) 0] + set bot_canvas $Page::($page_obj,bot_canvas) + + # Creates the collapse icon and stores the icon id and + # its center as attributes of event. + set col_img_id [UI_PB_blk_CreateIcon $bot_canvas $image_name ""] + + set xc [expr [expr $icon_xc - [expr $evt_dim_width / 2]] - 15] + set yc $icon_yc + set icon_id [$bot_canvas create image $xc $yc \ + -image $col_img_id -tag col_movable] + set event::($evt_obj,col_icon_id) $icon_id +} + +#========================================================================== +# This procedure returns the flag, as 1 if the block is displayed with the +# NC code and 0 if the block is displayed with the block name. +#========================================================================== +proc UI_PB_evt_RetBlkTypeFlag { PAGE_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + global mom_sys_arr + + if {$Page::($page_obj,prev_seq) == 0 || $Page::($page_obj,prev_seq) == 1 || \ + $Page::($page_obj,prev_seq) == 3 || $Page::($page_obj,prev_seq) == 4} \ + { + switch $Page::($page_obj,prev_seq) \ + { + 0 { set flag $mom_sys_arr(\$pgss_blk_nc) } + 1 { set flag $mom_sys_arr(\$pges_blk_nc) } + 3 { set flag $mom_sys_arr(\$opss_blk_nc) } + 4 { set flag $mom_sys_arr(\$opes_blk_nc) } + } + } else \ + { + set flag 1 + } + return $flag +} + +#========================================================================== +# This procedure is called, when the first mouse button is +# clicked on the collapse icon. +# It collapses a event by deleting all the blocks of the event. +#========================================================================== +proc UI_PB_evt_CollapseAEvent {page_obj seq_obj x y} { +#========================================================================== + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + set yy [$bot_canvas canvasy $y] + + # Gets the no of events in the sequence. + set no_of_events [llength $sequence::($seq_obj,evt_obj_list)] + + # Based upon the cursor location, it gets the event object + # index. + for {set count 0} {$count < $no_of_events} {incr count} \ + { + set evt_obj [lindex $sequence::($seq_obj,evt_obj_list) $count] + if {$yy > [expr $event::($evt_obj,yc) - 10] && \ + $yy < [expr $event::($evt_obj,yc) + 10]} \ + { + set evnt_index $count + } + } + + # Based upon the event index it gets the event object + set evt_obj [lindex $sequence::($seq_obj,evt_obj_list) $evnt_index] + + set xc $event::($evt_obj,xc) + set yc $event::($evt_obj,yc) + set evt_evtdist $Page::($page_obj,glob_evt_evtdist) + set evt_dim_height [lindex $Page::($page_obj,glob_evnt_dim) 1] + + # It checks whether the collapse image is minus or plus. + # if it is minus it deletes all the blocks and transforms + # all the other events to top. Else if it is plus, it creates + # all the blocks and trasforms other events to down. + + set tpth_flag [UI_PB_evt_RetBlkTypeFlag page_obj] + if {[string compare $event::($evt_obj,col_image) "minus"] == 0} \ + { + # Checks for the no of block templates in an event. + # if the no of block templates are zero, it does nothing + if {$event::($evt_obj,block_nof_rows) == 0} \ + { + return + } + + if {$tpth_flag} \ + { + # sets the height of the event. + set event::($evt_obj,event_height) [expr $yc + $evt_evtdist + \ + [expr $evt_dim_height / 2]] + $bot_canvas delete $event::($evt_obj,blk_text) + $bot_canvas delete $event::($evt_obj,blk_rect) + } else \ + { + # sets the height of the event. + set event::($evt_obj,event_height) [expr $yc + $evt_evtdist + \ + $evt_dim_height] + } + + # Deletes all the blocks of an event + UI_PB_evt_DeleteEventElements page_obj seq_obj evt_obj + + $bot_canvas delete $event::($evt_obj,col_icon_id) + set event::($evt_obj,col_image) "plus" + + } elseif {[string compare $event::($evt_obj,col_image) "plus"] == 0} { + + # Creates the blocks of an event. + if {$tpth_flag} \ + { + UI_PB_evt_CreateElemOfTpthEvent page_obj seq_obj evt_obj + } else \ + { + UI_PB_evt_CreateElementsOfEvent page_obj seq_obj evt_obj + } + + $bot_canvas delete $event::($evt_obj,col_icon_id) + set event::($evt_obj,col_image) "minus" + } + # replaces the collapse icon with plus + UI_PB_evt_CreateCollapseIcon page_obj seq_obj evt_obj + + # Transforms other events + if {$event::($evt_obj,block_nof_rows) > 1} \ + { + UI_PB_evt_TransformEvtElem page_obj seq_obj evnt_index + } +} + +#========================================================================== +# This procedure delets all the attributes of an Event. +#========================================================================== +proc UI_PB_evt_DeleteAEvent {bot_canvas SEQ_OBJ EVT_OBJ} { +#========================================================================== + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + + # Deletes the icon + $bot_canvas delete $event::($evt_obj,icon_id) + # Deletes the text widget + $bot_canvas delete $event::($evt_obj,text_id) + # Deletes the collapse icon + $bot_canvas delete $event::($evt_obj,col_icon_id) + # Deletes the rectangle (drawn for 3D effect) + $bot_canvas delete $event::($evt_obj,evt_rect) + + # Removes the icon id and text id from the texticon list + set index [lsearch $sequence::($seq_obj,texticon_ids) \ + $event::($evt_obj,text_id)] + if {$index != -1} \ + { + set sequence::($seq_obj,texticon_ids) \ + [lreplace $sequence::($seq_obj,texticon_ids) $index [expr $index + 1]] + } + + if {[info exists event::($evt_obj,blk_text)]} \ + { + $bot_canvas delete $event::($evt_obj,blk_text) + } + + if {[info exists event::($evt_obj,blk_rect)]} \ + { + $bot_canvas delete $event::($evt_obj,blk_rect) + } +} + +#========================================================================== +# Transforms all the events and its blocks from the specified +# Event object index. +#========================================================================== +proc UI_PB_evt_TransformEvtElem {PAGE_OBJ SEQ_OBJ EVNT_INDEX} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVNT_INDEX evnt_index + + # all the event dimensions + set evt_evtdist $Page::($page_obj,glob_evt_evtdist) + set bot_canvas $Page::($page_obj,bot_canvas) + set evt_dim_height [lindex $Page::($page_obj,glob_evnt_dim) 1] + set evt_evtdis $Page::($page_obj,glob_evt_evtdist) + set no_of_events [llength $sequence::($seq_obj,evt_obj_list)] + + set tpth_flag [UI_PB_evt_RetBlkTypeFlag page_obj] + + # Cycles through the Events and delets an event and its blocks + # It cycles from the specified index. + for {set count [expr $evnt_index + 1]} {$count < $no_of_events} \ + {incr count} \ + { + set evt_obj [lindex $sequence::($seq_obj,evt_obj_list) $count] + # Deletes the event + UI_PB_evt_DeleteAEvent $bot_canvas seq_obj evt_obj + + # Deletes all the blocks + UI_PB_evt_DeleteEventElements page_obj seq_obj evt_obj + } + + set ind_evt_obj [lindex $sequence::($seq_obj,evt_obj_list) $evnt_index] + set evt_xc $event::($ind_evt_obj,xc) + set evt_yc $event::($ind_evt_obj,event_height) + + for {set count [expr $evnt_index + 1]} {$count < $no_of_events} \ + {incr count} \ + { + # Creates the Event Icon + set evt_obj [lindex $sequence::($seq_obj,evt_obj_list) $count] + set event::($evt_obj,xc) $evt_xc + set event::($evt_obj,yc) $evt_yc + UI_PB_evt_CreateEvent page_obj seq_obj evt_obj + + # Create Blocks of a Event + if {[string compare $event::($evt_obj,col_image) "minus"] == 0} \ + { + if {$tpth_flag} \ + { + UI_PB_evt_CreateElemOfTpthEvent page_obj seq_obj evt_obj + } else \ + { + UI_PB_evt_CreateElementsOfEvent page_obj seq_obj evt_obj + } + set evt_yc $event::($evt_obj,event_height) + } else \ + { + if {$tpth_flag} \ + { + set evt_yc [expr $evt_yc + [expr $evt_dim_height / 2] + \ + $evt_evtdis] + } else \ + { + set evt_yc [expr $evt_yc + $evt_dim_height + $evt_evtdis] + } + } + } +} + +#========================================================================== +# This procedure create an Event. +#========================================================================== +proc UI_PB_evt_CreateEvent { PAGE_OBJ SEQ_OBJ EVT_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + + global tixOption + global paOption + + if {$Page::($page_obj,prev_seq) == 0 || $Page::($page_obj,prev_seq) == 1 || \ + $Page::($page_obj,prev_seq) == 3 || $Page::($page_obj,prev_seq) == 4} \ + { + set icon_bg $paOption(seq_bg) + set text_bg $paOption(seq_fg) + set icon_relief flat + set bd_width 1 + + } else \ + { + set icon_bg $paOption(event) + set text_bg white + set icon_relief raised + set bd_width 2 + } + + # Gets all the Event dimension, which are stored + # as page attributes. + set t_shift $Page::($page_obj,glob_text_shift) + set bot_canvas $Page::($page_obj,bot_canvas) + set evt_dim_width [lindex $Page::($page_obj,glob_evnt_dim) 0] + set evt_dim_height [lindex $Page::($page_obj,glob_evnt_dim) 1] + + # Creates a minus collapse icon. + UI_PB_evt_CreateCollapseIcon page_obj seq_obj evt_obj + + # Creates Event icon and locates it at the specified center + set evt_img_id [UI_PB_blk_CreateIcon $bot_canvas pb_event ""] + $evt_img_id config -bg $icon_bg -borderwidth $bd_width + + set evt_xc $event::($evt_obj,xc) + set evt_yc $event::($evt_obj,yc) + + set icon_id [$bot_canvas create image $evt_xc $evt_yc \ + -image $evt_img_id -tag evt_movable] + + $evt_img_id config -relief $icon_relief + + # Creates the event text + set event_name $event::($evt_obj,event_name) + set text_id [$bot_canvas create text [expr $evt_xc + $t_shift] $evt_yc \ + -text $event_name -font $tixOption(bold_font) \ + -fill $text_bg -tag evt_movable] + + set event::($evt_obj,icon_id) $icon_id + set event::($evt_obj,text_id) $text_id + lappend sequence::($seq_obj,texticon_ids) $text_id $icon_id + set cen_shift $Page::($page_obj,cen_shift) + + # creates a rectangle to hold the Event icon + set cordx1 [expr $evt_xc + $cen_shift - [expr $evt_dim_width / 2]] + set cordy1 [expr $evt_yc + $cen_shift - [expr $evt_dim_height / 2]] + set cordx2 [expr $evt_xc + $cen_shift + [expr $evt_dim_width / 2]] + set cordy2 [expr $evt_yc + $cen_shift + [expr $evt_dim_height / 2]] + + set rect_id [$bot_canvas create rect $cordx1 $cordy1 $cordx2 $cordy2 \ + -outline navyblue -fill navyblue] + + $bot_canvas lower $rect_id + set event::($evt_obj,evt_rect) $rect_id +} + +#========================================================================== +# This procedure creates the blocks of toolpath event in the +# specified way. +#========================================================================== +proc UI_PB_evt_CreateElemOfTpthEvent {PAGE_OBJ SEQ_OBJ EVT_OBJ} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + + global paOption + global tixOption + + set bot_canvas $Page::($page_obj,bot_canvas) + set evt_blkdist $Page::($page_obj,glob_evt_blkdist) + set evt_evtdist $Page::($page_obj,glob_evt_evtdist) + set evt_dim_width [lindex $Page::($page_obj,glob_evnt_dim) 0] + set evt_dim_height [lindex $Page::($page_obj,glob_evnt_dim) 1] + set rect_gap $Page::($page_obj,glob_rect_gap) + + # Event center from event object + set evt_xc $event::($evt_obj,xc) + set evt_yc $event::($evt_obj,yc) + + # Calculates the first blocks center + set blk_corner1_x [expr $evt_xc + [expr $evt_dim_width / 2] + \ + $evt_blkdist] + set blk_corner1_y [expr $evt_yc - [expr $evt_dim_height / 2]] + + # No of block templates + set rows $event::($evt_obj,block_nof_rows) + set event::($evt_obj,event_width) 0 + + # Creates Block templates + UI_PB_com_ReturnEventNcOutAttr evt_obj str_size ver_height \ + evt_nc_output + set blk_corner2_x [expr $blk_corner1_x + $str_size + 10] + set blk_corner2_y [expr $blk_corner1_y + $ver_height + 10] + + if {[info exists evt_nc_output]} \ + { + set rect_id [$bot_canvas create rect $blk_corner1_x $blk_corner1_y \ + $blk_corner2_x $blk_corner2_y -outline black \ + -width $rect_gap -fill $paOption(tree_bg)] + + set line_id [UI_PB_evt_CreateLine bot_canvas $evt_xc \ + $evt_yc $blk_corner1_x $evt_yc] + set xc [expr $blk_corner1_x + [expr $str_size / 2]] + set yc [expr $blk_corner1_y + [expr $ver_height / 2]] + set text_id [$bot_canvas create text [expr $xc + 5] [expr $yc + 13] \ + -text $evt_nc_output -justify left] + + set event::($evt_obj,blk_rect) $rect_id + set event::($evt_obj,blk_text) $text_id + set event::($evt_obj,extra_lines) $line_id + unset evt_nc_output + } + + if {$ver_height} \ + { + set event::($evt_obj,event_height) [expr $blk_corner1_y + \ + $ver_height + $evt_evtdist + 10] + } else \ + { + set event::($evt_obj,event_height) [expr $blk_corner1_y + \ + $evt_dim_height + $evt_evtdist] + } + +#### Update has a problem, when there is only one event in the sequence. + + # updates the display + if { $Page::($page_obj,prev_seq) != 0 && \ + $Page::($page_obj,prev_seq) != 6 } \ + { + update idletasks + } +} + +#========================================================================== +# This procedure creates the blocks of an event in the +# specified way. +#========================================================================== +proc UI_PB_evt_CreateElementsOfEvent { PAGE_OBJ SEQ_OBJ EVT_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + + global paOption + global tixOption + + # Gets all the block attributes + set bot_canvas $Page::($page_obj,bot_canvas) + set blk_blkdist_hor $Page::($page_obj,glob_blk_blkdist_hor) + set blk_blkdist_ver $Page::($page_obj,glob_blk_blkdist_ver) + set evt_blkdist $Page::($page_obj,glob_evt_blkdist) + set evt_evtdist $Page::($page_obj,glob_evt_evtdist) + set t_shift $Page::($page_obj,glob_text_shift) + set blk_dim_width [lindex $Page::($page_obj,glob_blk_dim) 0] + set blk_dim_height [lindex $Page::($page_obj,glob_blk_dim) 1] + set evt_dim_width [lindex $Page::($page_obj,glob_evnt_dim) 0] + set evt_dim_height [lindex $Page::($page_obj,glob_evnt_dim) 1] + + # Event center from event object + set evt_xc $event::($evt_obj,xc) + set evt_yc $event::($evt_obj,yc) + set x1 $evt_xc + + # Calculates the first blocks center + set elem_xc [expr $evt_dim_width + $evt_xc + $evt_blkdist] + set elem_yc $evt_yc + + # No of block templates + set rows $event::($evt_obj,block_nof_rows) + set event::($evt_obj,event_width) 0 + + # Creates Block templates + for {set count 0} {$count < $rows} {incr count} \ + { + set evt_row_elem_list [lindex $event::($evt_obj,evt_elem_list) $count] + + # Creates the blocks of a template block (row) + foreach evt_elem_obj $evt_row_elem_list \ + { + set event_element::($evt_elem_obj,xc) $elem_xc + set event_element::($evt_elem_obj,yc) $elem_yc + + # Creates a block + UI_PB_evt_CreateEventElement page_obj seq_obj evt_elem_obj + + # Creates a line either connecting a event and a block + # or block and a block. + set line_id [UI_PB_evt_CreateLine bot_canvas $x1 $elem_yc \ + $elem_xc $elem_yc] + + # Stores the line id as attribute of block object + set event_element::($evt_elem_obj,line_id) $line_id + + set x1 $elem_xc + set elem_xc [expr $elem_xc + $blk_dim_width + $blk_blkdist_hor] + } + + # Creates a rectangle and the two seperators, above and + # below the block template. + set temp_ids [UI_PB_evt_CreateARowTempRect page_obj evt_obj count] + lappend temp_rect [lindex $temp_ids 0] + lappend sep_ids [lrange $temp_ids 1 end] + if { $count < [expr $rows - 1]} \ + { + set x1 [expr $evt_xc + [expr $evt_dim_width / 2] + \ + [expr $evt_blkdist / 2]] + set y2 [expr $elem_yc + $blk_dim_height + $blk_blkdist_ver] + + # Creates a line, to connect two block templates (rows) + set line_id [UI_PB_evt_CreateLine bot_canvas $x1 \ + $elem_yc $x1 $y2] + lappend extra_lines $line_id + set elem_yc $y2 + set elem_xc [expr $evt_dim_width + $evt_xc + $evt_blkdist] + set y1 $y2 + } + } + + # if the no of block templates are zero. It just draws + # a rectangle as a seperator. + if {$rows == 0} \ + { + set temp_ids [UI_PB_evt_CreateARowTempRect page_obj evt_obj count] + lappend temp_rect [lindex $temp_ids 0] + } + + # stores the line_ids (the line connecting the two block template) + # as attributes of event object + if {[info exists extra_lines]}\ + { + set event::($evt_obj,extra_lines) $extra_lines + } + + # stores the ids of all the block templates rectangles. + if {[info exists temp_rect]}\ + { + set event::($evt_obj,rect_id) $temp_rect + } + + # stores the ids of top and bottom seperators of all + # block templates. + if {[info exists sep_ids]} \ + { + set event::($evt_obj,sep_id) $sep_ids + } + + set event::($evt_obj,event_height) [expr $elem_yc + $evt_dim_height \ + + $evt_evtdist] +} + +#============================================================================ +# This procedure creates a block. +#============================================================================ +proc UI_PB_evt_CreateEventElement {PAGE_OBJ SEQ_OBJ EVT_ELEM_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_ELEM_OBJ evt_elem_obj + + global paOption + global tixOption + + set bot_canvas $Page::($page_obj,bot_canvas) + set blk_dim_width [lindex $Page::($page_obj,glob_blk_dim) 0] + set blk_dim_height [lindex $Page::($page_obj,glob_blk_dim) 1] + set t_shift $Page::($page_obj,glob_text_shift) + set rect_gap $Page::($page_obj,glob_rect_gap) + + set elem_img_id [UI_PB_blk_CreateIcon $bot_canvas pb_block ""] + $elem_img_id configure -bg lightSkyBlue + + set elem_xc $event_element::($evt_elem_obj,xc) + set elem_yc $event_element::($evt_elem_obj,yc) + + # creates a rectangle to hold the block icon + set cordx1 [expr $elem_xc - [expr $blk_dim_width / 2]] + set cordy1 [expr $elem_yc - [expr $blk_dim_height / 2]] + set cordx2 [expr $elem_xc + [expr $blk_dim_width / 2]] + set cordy2 [expr $elem_yc + [expr $blk_dim_height / 2]] + set rect_id [$bot_canvas create rect $cordx1 $cordy1 $cordx2 $cordy2 \ + -outline lightgray -fill lightgray] + set event_element::($evt_elem_obj,rect_id) $rect_id + + # Puts the block icon at the specfied center + set elem_icon_id [$bot_canvas create image $elem_xc $elem_yc \ + -image $elem_img_id -tag blk_movable] + + set event_element::($evt_elem_obj,icon_id) $elem_icon_id + set block_obj $event_element::($evt_elem_obj,block_obj) + set elem_text $block::($block_obj,block_name) + + # Replaces the underscores in the string with space + PB_com_GetModEvtBlkName elem_text + + set elem_text_id [$bot_canvas create text [expr $elem_xc + $t_shift] \ + $elem_yc -text $elem_text -font $tixOption(bold_font) \ + -tag blk_movable] + + set event_element::($evt_elem_obj,text_id) $elem_text_id + + lappend sequence::($seq_obj,texticon_ids) $elem_text_id $elem_icon_id +} + +#============================================================================ +# This procedure creates a Block template rectangle and the two +# seperators, one above the block template and another one below +# the block template. It returns the ids. +#============================================================================ +proc UI_PB_evt_CreateARowTempRect {PAGE_OBJ EVT_OBJ COUNT} { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $EVT_OBJ evt_obj + upvar $COUNT count + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Gets all the dimensions of an event and block + set rect_gap $Page::($page_obj,glob_rect_gap) + set evt_dim_width [lindex $Page::($page_obj,glob_evnt_dim) 0] + set blk_dim_width [lindex $Page::($page_obj,glob_blk_dim) 0] + set blk_dim_height [lindex $Page::($page_obj,glob_blk_dim) 1] + set blk_blkdist_hor $Page::($page_obj,glob_blk_blkdist_hor) + set blk_blkdist_ver $Page::($page_obj,glob_blk_blkdist_ver) + set evt_blkdist $Page::($page_obj,glob_evt_blkdist) + + # no of block templates + set no_rows $event::($evt_obj,block_nof_rows) + + # Checks for the no of block templates (rows), if + # there are zero no of rows, it just creates a rectangle. + # else it creates a rectangle and two seperators. + if {$no_rows} \ + { + # Gets the list of block objects of the template block. + set elem_obj_list [lindex $event::($evt_obj,evt_elem_list) $count] + + # no of blocks in block template. + set no_elems [llength $elem_obj_list] + + # first block center. + set first_blk_obj [lindex $elem_obj_list 0] + set xc $event_element::($first_blk_obj,xc) + set yc $event_element::($first_blk_obj,yc) + + # Calculates the upper and lower corners for the rectangle + set x1 [expr $xc - [expr $blk_dim_width / 2]] + set y1 [expr $yc - [expr $blk_dim_height / 2]] + + set x2 [expr $x1 + [expr $blk_dim_width * $no_elems] + \ + [expr $blk_blkdist_hor * [expr $no_elems - 1]]] + + set y2 [expr $y1 + $blk_dim_height] + set event_width $x2 + + # Creates the rectangle + set rect_id [$bot_canvas create rect [expr $x1 - $rect_gap] \ + [expr $y1 - $rect_gap] [expr $x2 + $rect_gap] \ + [expr $y2 + $rect_gap] -outline $paOption(can_bg) \ + -width $rect_gap -fill $paOption(can_bg)] + + $bot_canvas lower $rect_id + + # Creates the two seperators + set top_sep [$bot_canvas create rect $x1 [expr $y1 - $rect_gap] \ + $x2 [expr $y1 - 1]\ + -outline $paOption(can_bg) -width $rect_gap] + + set bot_sep [$bot_canvas create rect $x1 [expr $y2 + 1] \ + $x2 [expr $y2 + $rect_gap] \ + -outline $paOption(can_bg) -width $rect_gap] + + lappend template_ids $rect_id $top_sep $bot_sep + + } else \ + { + # For the else condition, it creates only a rectangle + set xc [expr $event::($evt_obj,xc) + $evt_dim_width + \ + $evt_blkdist] + set yc $event::($evt_obj,yc) + set no_elems 1 + + set x1 [expr $xc - [expr $blk_dim_width / 2]] + set y1 [expr $yc - [expr $blk_dim_height / 2]] + + set x2 [expr $x1 + [expr $blk_dim_width * $no_elems] + \ + [expr $blk_blkdist_hor * [expr $no_elems - 1]]] + + set y2 [expr $y1 + $blk_dim_height] + set event_width $x2 + + set rect_id [$bot_canvas create rect [expr $x1 - $rect_gap] \ + [expr $y1 - $rect_gap] [expr $x2 + $rect_gap] \ + [expr $y2 + $rect_gap] -outline $paOption(can_bg) \ + -width $rect_gap -fill $paOption(can_bg)] + + $bot_canvas lower $rect_id + + lappend template_ids $rect_id + } + + if {$event_width > $event::($evt_obj,event_width)} \ + { + set event::($evt_obj,event_width) $event_width + } + + return $template_ids +} + +#============================================================================ +# This procedure deletes the blocks of an event. +#============================================================================ +proc UI_PB_evt_DeleteEventElements {PAGE_OBJ SEQ_OBJ EVT_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVT_OBJ evt_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + set no_of_rows $event::($evt_obj,block_nof_rows) + + set tpth_flag [UI_PB_evt_RetBlkTypeFlag page_obj] + + # Cycles through the block templates (rows) + if {!$tpth_flag} \ + { + for {set count 0} {$count < $no_of_rows} {incr count} \ + { + # Gets the list of blocks of a row + set row_elem_objs [lindex $event::($evt_obj,evt_elem_list) $count] + + # cycles through the blocks of a row + foreach elem_obj $row_elem_objs \ + { + # Deletes the block icon + $bot_canvas delete $event_element::($elem_obj,icon_id) + + # Deletes the rectangle + $bot_canvas delete $event_element::($elem_obj,rect_id) + + # Deletes the text id + $bot_canvas delete $event_element::($elem_obj,text_id) + + # Deletes the line that joins two blocks or block and + # event. + $bot_canvas delete $event_element::($elem_obj,line_id) + + # Deletes the text and icon ids from the texticon list + set index [lsearch $sequence::($seq_obj,texticon_ids) \ + $event_element::($elem_obj,text_id)] + if {$index != -1} \ + { + set sequence::($seq_obj,texticon_ids) \ + [lreplace $sequence::($seq_obj,texticon_ids) \ + $index [expr $index + 1]] + } + } + } + + # Deletes the rectangles of each block template + if {[info exists event::($evt_obj,rect_id)]} \ + { + foreach rect_id $event::($evt_obj,rect_id) \ + { + $bot_canvas delete $rect_id + } + } + + # Deletes the two seperatores of each block template + if {[info exists event::($evt_obj,sep_id)]} \ + { + foreach sep_list $event::($evt_obj,sep_id) \ + { + foreach sep_id $sep_list \ + { + $bot_canvas delete $sep_id + } + } + } + } + + # Deletes the lines, that connect the two block templates (rows) + if {[info exists event::($evt_obj,extra_lines)]} \ + { + foreach line $event::($evt_obj,extra_lines) \ + { + $bot_canvas delete $line + } + } +} + +#============================================================================ +# This procedure attaches the bind procedures to the Event icons +#============================================================================ +proc UI_PB_evt_EvtBindProcs { PAGE_OBJ SEQ_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Binds the enter of the cursor + $bot_canvas bind evt_movable "UI_PB_evt_EventFocusOn $bot_canvas \ + $seq_obj" + # Binds the leave of the cursor + $bot_canvas bind evt_movable "UI_PB_evt_EventFocusOff $bot_canvas \ + $seq_obj" + # Binds the first mouse button + $bot_canvas bind evt_movable <1> "UI_PB_evt_EventStartDrag $page_obj \ + $seq_obj" +} + +#============================================================================ +proc UI_PB_evt_EvtUnBindProcs { PAGE_OBJ SEQ_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + # UnBinds the enter of the cursor + $bot_canvas bind evt_movable "" + + # UnBinds the leave of the cursor + $bot_canvas bind evt_movable "" + + # UnBinds the first mouse button + $bot_canvas bind evt_movable <1> "" +} + +#============================================================================ +# This procedure unbinds the binded procedures to event icon +#============================================================================ +proc UI_PB_evt_UnBindEvtProcs { PAGE_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Binds the enter of the cursor + $bot_canvas bind evt_movable "" + + # Binds the leave of the cursor + $bot_canvas bind evt_movable "" + + # Binds the first mouse button + $bot_canvas bind evt_movable <1> "" +} + +#============================================================================ +# This procedure attaches the bind procedures to the Block icons +#========================================================================== +proc UI_PB_evt_BlkBindProcs { PAGE_OBJ SEQ_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Binds the Enter + $bot_canvas bind blk_movable "UI_PB_evt_BlockFocusOn $page_obj \ + $seq_obj" + # Binds the Leave + $bot_canvas bind blk_movable "UI_PB_evt_BlockFocusOff $page_obj \ + $seq_obj" + # Binds the first mouse button + $bot_canvas bind blk_movable <1> "UI_PB_evt_BlockStartDrag $page_obj \ + $seq_obj %x %y" + # Binds the motion of first mouse button + $bot_canvas bind blk_movable "UI_PB_evt_BlockDrag $page_obj \ + $seq_obj %x %y" + # Binds the release of first mouse button + $bot_canvas bind blk_movable "UI_PB_evt_BlockEndDrag \ + $page_obj $seq_obj" + # Binds the third mouse button + $bot_canvas bind blk_movable <3> "UI_PB_evt_CreateBlkPopup $page_obj \ + $seq_obj" +} + +#========================================================================== +proc UI_PB_evt_BlkUnBindProcs { PAGE_OBJ SEQ_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + # UnBinds the Enter + $bot_canvas bind blk_movable "" + + # UnBinds the Leave + $bot_canvas bind blk_movable "" + + # UnBinds the first mouse button + $bot_canvas bind blk_movable <1> "" + + # UnBinds the motion of first mouse button + $bot_canvas bind blk_movable "" + + # UnBinds the release of first mouse button + $bot_canvas bind blk_movable "" + + # UnBinds the third mouse button + $bot_canvas bind blk_movable <3> "" +} + +#============================================================================ +# This procedure unbinds the bind procs of Blocks +#========================================================================== +proc UI_PB_evt_UnBindBlkProcs { PAGE_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Binds the Enter + $bot_canvas bind blk_movable " " + + # Binds the Leave + $bot_canvas bind blk_movable " " + + # Binds the first mouse button + $bot_canvas bind blk_movable <1> " " + + # Binds the motion of first mouse button + $bot_canvas bind blk_movable " " + + # Binds the release of first mouse button + $bot_canvas bind blk_movable " " +} + +#========================================================================== +# This procedure is triggered, when the cursor enters the +# Event icon. It highlights the event, by changing the +# background color of icon to yellow. +#========================================================================== +proc UI_PB_evt_EventFocusOn { bot_canvas seq_obj} { +#========================================================================== + global paOption + + set texticon_id $sequence::($seq_obj,texticon_ids) + + # Gets the image id based upon the cursor location. + set objects [UI_PB_evt_GetCurrentCanvasObject $bot_canvas texticon_id] + set img [lindex [$bot_canvas itemconfigure [lindex $objects 0] -image] end] + $img configure -background $paOption(focus) + $bot_canvas itemconfigure [lindex $objects 1] -fill black + set sequence::($seq_obj,evt_focus_cell) $objects + + +# Change cursor +set c $bot_canvas +$c config -cursor hand2 +} + +#======================================================================== +# This procedure returns the icon name based upon the cursor +# position. The inputs to this procedure are the canvas id +# and a list which contains the text icon ids of the canvas. +#========================================================================== +proc UI_PB_evt_GetCurrentImage {canvas TEXTICON_ID } { +#========================================================================== + upvar $TEXTICON_ID texticon_ids + + # It gets the list of options that can be configured + set test [$canvas itemconfigure current] + + # Gets the index of -text from the list + set text_flag [lsearch $test "-text*"] + + # Gets the index of -image from the list + set image_flag [lsearch $test "-image*"] + + if {$image_flag != -1} \ + { + # gets the image id from the list + set img [lindex [$canvas itemconfigure current -image] end] + + } elseif {$text_flag != -1} \ + { + # gets the text id from the list + set text_id [$canvas find withtag current] + + # gets the image id from the textiocn list based + # upon the text id index + set index [lsearch $texticon_ids $text_id] + set icon_id [lindex $texticon_ids [expr $index + 1]] + set img [lindex [$canvas itemconfigure $icon_id -image] end] + } + return $img +} + +#============================================================================== +# This procedure returns the text and icon ids based upon +# the cursor location. +#============================================================================== +proc UI_PB_evt_GetCurrentCanvasObject {bot_canvas TEXTICON_ID} { +#============================================================================== + upvar $TEXTICON_ID texticon_ids + + # It gets the list of options that can be configured + set test [$bot_canvas itemconfigure current] + + # Gets the index of -text from the list + set text_flag [lsearch $test "-text*"] + + # Gets the index of -image from the list + set image_flag [lsearch $test "-image*"] + + if {$image_flag != -1} \ + { + set img [$bot_canvas find withtag current] + set index [lsearch $texticon_ids $img] + set text_id [lindex $texticon_ids [expr $index - 1]] + lappend objects $img $text_id + + } elseif {$text_flag != -1} \ + { + set text_id [$bot_canvas find withtag current] + # gets the image id from the textiocn list based + # upon the text id index + set index [lsearch $texticon_ids $text_id] + set icon_id [lindex $texticon_ids [expr $index + 1]] + lappend objects $icon_id $text_id + } + return $objects +} + +#========================================================================== +# This procedure is triggered, when the cursor leaves the +# Event icon. It unhighlights the event, by changing the +# background color of icon to its original color +#========================================================================== +proc UI_PB_evt_EventFocusOff { bot_canvas seq_obj } { +#========================================================================== + global paOption + set prev_evt_focus_cell $sequence::($seq_obj,evt_focus_cell) + set texticon_id $sequence::($seq_obj,texticon_ids) + + # Gets the image id based upon the cursor location. + set objects [UI_PB_evt_GetCurrentCanvasObject $bot_canvas texticon_id] + + foreach event_obj $sequence::($seq_obj,evt_obj_list) \ + { + if { $event::($event_obj,icon_id) == [lindex $objects 0] } { break } + } + + # Unhighlight current icon + if {$prev_evt_focus_cell != 0} \ + { + set img [lindex [$bot_canvas itemconfigure \ + [lindex $prev_evt_focus_cell 0] -image] end] + if {[string compare $img ""] != 0 } \ + { + if {$event::($event_obj,event_open)} \ + { + $img configure -background pink + } else \ + { + $img configure -background $paOption(event) + } + + $bot_canvas itemconfigure [lindex $prev_evt_focus_cell 1] -fill white + set sequence::($seq_obj,prev_evt_focus_cell) 0 + } + } + + +# Change cursor +set c $bot_canvas +$c config -cursor "" +} + +#========================================================================== +# This procedure is called when the first mouse button is +# clicked on any of the event icon. +#========================================================================== +proc UI_PB_evt_EventStartDrag { page_obj seq_obj } { +#========================================================================== + set texticon_id $sequence::($seq_obj,texticon_ids) + set bot_canvas $Page::($page_obj,bot_canvas) + + # Gets the image id based upon the cursor location. + set objects [UI_PB_evt_GetCurrentCanvasObject $bot_canvas texticon_id] + + foreach event_obj $sequence::($seq_obj,evt_obj_list) \ + { + if { $event::($event_obj,icon_id) == [lindex $objects 0] } { break } + } + + # Calls the respective event procedure + set event::($event_obj,event_open) 1 + UI_PB_evt_ToolPath page_obj seq_obj event_obj +} + +#========================================================================= +proc UI_PB_eve_CreateBalloon { PAGE_OBJ } { +#========================================================================= + upvar $PAGE_OBJ page_obj + global gPB_help_tips + global gPB + + if {$gPB_help_tips(state)} \ + { + set c $Page::($page_obj,bot_canvas) + + if {![info exists gPB(seq_page_blk_item_focus_on)]} \ + { + set gPB(seq_page_blk_item_focus_on) 0 + } + + if {$gPB(seq_page_blk_item_focus_on) == 0} \ + { + set gPB_help_tips($c) {Block Description} + set gPB(seq_page_blk_item_focus_on) 1 + } + } +} + +#========================================================================= +proc UI_PB_eve_DeleteBalloon { PAGE_OBJ } { +#========================================================================= + upvar $PAGE_OBJ page_obj + global gPB_help_tips + + if {$gPB_help_tips(state)} \ + { + set c $Page::($page_obj,bot_canvas) + + if [info exists gPB_help_tips($c)] { + unset gPB_help_tips($c) + } + PB_cancel_balloon + global gPB + set gPB(seq_page_blk_item_focus_on) 0 + } +} + +#========================================================================== +# This procedure is triggered, when the cursor enters the +# Block icon. It highlights the Block, by changing the +# background color of icon to yellow. +#========================================================================== +proc UI_PB_evt_BlockFocusOn { page_obj seq_obj } { +#========================================================================== + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + set texticon_id $sequence::($seq_obj,texticon_ids) + set img [UI_PB_evt_GetCurrentImage $bot_canvas texticon_id] + set sequence::($seq_obj,blk_focus_cell) $img + $img configure -background $paOption(focus) + + # Add balloon help + UI_PB_eve_CreateBalloon page_obj + + +# Change cursor +set c $bot_canvas +$c config -cursor hand2 +} + +#========================================================================== +# This procedure is triggered, when the cursor leaves the +# Block icon. It unhighlights the Block, by changing the +# background color of icon to its original color. +#========================================================================== +proc UI_PB_evt_BlockFocusOff { page_obj seq_obj } { +#========================================================================== + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Unhighlight current icon + set prev_blk_focus_cell $sequence::($seq_obj,blk_focus_cell) + + if {$prev_blk_focus_cell != 0} \ + { + $prev_blk_focus_cell configure -background lightSkyBlue + set sequence::($seq_obj,blk_focus_cell) 0 + } + + # Unset balloon + UI_PB_eve_DeleteBalloon page_obj + + +# Change cursor +set c $bot_canvas +$c config -cursor "" +} + +#========================================================================= +# This procedure returns the block object based upon the +# block icon id +#========================================================================= +proc UI_PB_evt_GetBlkObjFromImageid {PAGE_OBJ SEQ_OBJ focus_img} { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + set active_blk_flag 0 + + # Cycles through the events + foreach evt_obj $sequence::($seq_obj,evt_obj_list) \ + { + # Gets the no of block templates of an event + set no_rows $event::($evt_obj,block_nof_rows) + + for {set count 0} {$count < $no_rows} {incr count} \ + { + # Cycles through the blocks of the block template + set row_elem_objs [lindex $event::($evt_obj,evt_elem_list) $count] + foreach elem_obj $row_elem_objs \ + { + set elem_img $event_element::($elem_obj,icon_id) + set img_name [lindex [$bot_canvas itemconfigure $elem_img -image] end] + + # Compares the image id with the block object image id + if {[string compare $img_name $focus_img] == 0} \ + { + set sequence::($seq_obj,drag_blk_obj) $elem_obj + set sequence::($seq_obj,drag_evt_obj) $evt_obj + set sequence::($seq_obj,drag_row) $count + set active_blk_flag 1 + break + } + } + + if {$active_blk_flag} {break} + } + if {$active_blk_flag} {break} + } +} + +#========================================================================== +# This procedure is called, when the first mouse button is +# clicked on the Block icon. It creates the temporary icon +# in the top and action canvas based upon the type of block. +# If the block that is dragged is a normal one, then it will +# be draggable only in the bottom and top canvas. While the +# action block is draggable in bottom canvas and action canvas. +#========================================================================== +proc UI_PB_evt_BlockStartDrag {page_obj seq_obj x y} { +#========================================================================== + global paOption + global tixOption + + # for editing the block + set Page::($page_obj,being_dragged) 0 + + # Gets the id of bottom and top canvas + set bot_canvas $Page::($page_obj,bot_canvas) + set top_canvas $Page::($page_obj,top_canvas) + set t_shift $Page::($page_obj,glob_text_shift) + + # maps the cursor coords to the bottom canvas + set xx [$bot_canvas canvasx $x] + set yy [$bot_canvas canvasy $y] + + # Gets the current block image name, based upon the cursor + set texticon_id $sequence::($seq_obj,texticon_ids) + set img [UI_PB_evt_GetCurrentImage $bot_canvas texticon_id] + + set sequence::($seq_obj,prev_bot_blk_xc) $xx + set sequence::($seq_obj,prev_bot_blk_yc) $yy + + # Gets the block object based upon the block image id + UI_PB_evt_GetBlkObjFromImageid page_obj seq_obj $img + set elem_obj $sequence::($seq_obj,drag_blk_obj) + + set elem_xc $event_element::($elem_obj,xc) + set elem_yc $event_element::($elem_obj,yc) + + # calculates the distance between the center of + # block that is dragged and the cursor location. + set diff_x [expr $xx - $elem_xc] + set diff_y [expr $yy - $elem_yc] + + # Top canvas height + set panel_hi $Page::($page_obj,panel_hi) + set dy [expr $panel_hi + 2] + set block_obj $event_element::($elem_obj,block_obj) + set elem_text $block::($block_obj,block_name) + + # If the block that is dragged is a normal one, then the + # Temporary icon is created only in the top canvas. + if {[string compare $event_element::($elem_obj,type) "normal"] == 0} \ + { + set img_addr [UI_PB_blk_CreateIcon $top_canvas pb_block ""] + $img_addr config -bg $paOption(focus) + + # creates the temporary icon in top canvas + set elem_top_img [$top_canvas create image [expr $x - $diff_x] \ + [expr $y + $dy - $diff_y] -image $img_addr -tag new_comp] + + # creates the temporary text in top canvas + set elem_top_text [$top_canvas create text [expr $x - $diff_x + $t_shift] \ + [expr $y + $dy - $diff_y] -text $elem_text \ + -font $tixOption(bold_font) -tag blk_movable] + + set sequence::($seq_obj,blk_top_img) $elem_top_img + set sequence::($seq_obj,blk_top_text) $elem_top_text + set sequence::($seq_obj,prev_top_blk_xc) $x + set sequence::($seq_obj,prev_top_blk_yc) [expr $y + $panel_hi] + + # If the block that is dragged is a action block, then the + # Temporary icon is created only in the action canvas. + } elseif {$Page::($page_obj,action_flag) == 0 && \ + [string compare $event_element::($elem_obj,type) "action"] == 0} \ + { + set act_canvas $Page::($page_obj,action_canvas) + set act_img_addr [UI_PB_blk_CreateIcon $act_canvas pb_block ""] + $act_img_addr config -bg $paOption(focus) + + # gets the top and bottom portion of the canvas that is + # not visable. + set y_shift [$bot_canvas yview] + + # Gets the top portion of canvas that is not visable. + set top_portion [expr [lindex $y_shift 0] * 2000] + + # difference of top and bottom gives the visable portion. + # that is the height of the bottom canvas + set bot_canvas_hi [expr [expr [lindex $y_shift 1] \ + - [lindex $y_shift 0]] * 2000] + set dy [expr $bot_canvas_hi + 6] + set Page::($page_obj,bot_canvas_hi) $bot_canvas_hi + + # creates the temporary icon in action canvas + set elem_act_img [$act_canvas create image [expr $x - $diff_x] \ + [expr $y - $dy - $diff_y - $top_portion] \ + -image $act_img_addr -tag del_block] + + # creates the temporary text in action canvas + set elem_act_text [$act_canvas create text \ + [expr $x - $diff_x + $t_shift] [expr $y - $dy - $diff_y - \ + $top_portion] -text $elem_text -font $tixOption(bold_font) \ + -tag blk_movable] + + set sequence::($seq_obj,blk_act_img) $elem_act_img + set sequence::($seq_obj,blk_act_text) $elem_act_text + set sequence::($seq_obj,prev_act_blk_xc) $x + set sequence::($seq_obj,prev_act_blk_yc) \ + [expr $y - $bot_canvas_hi - $top_portion] + } + + +# Change cursor to grab +# UI_PB_com_ChangeCursor $bot_canvas +} + +#========================================================================== +# This procedure is triggered, when the mouse is moved without +# releasing the first mouse button. +#========================================================================== +proc UI_PB_evt_BlockDrag {page_obj seq_obj x y} { +#========================================================================== + if {$Page::($page_obj,being_dragged) < $Page::($page_obj,drag_sensitivity)} \ + { + incr Page::($page_obj,being_dragged) + } + + set top_canvas $Page::($page_obj,top_canvas) + set bot_canvas $Page::($page_obj,bot_canvas) + set panel_hi $Page::($page_obj,panel_hi) + + set xb [$bot_canvas canvasx $x] + set yb [$bot_canvas canvasy $y] + + # Translate elements in the bottom canvas + set texticon_id $sequence::($seq_obj,texticon_ids) + set objects [UI_PB_evt_GetCurrentCanvasObject $bot_canvas texticon_id] + + # icon + $bot_canvas move [lindex $objects 0] \ + [expr $xb - $sequence::($seq_obj,prev_bot_blk_xc)] \ + [expr $yb - $sequence::($seq_obj,prev_bot_blk_yc)] + + # text + $bot_canvas move [lindex $objects 1] \ + [expr $xb - $sequence::($seq_obj,prev_bot_blk_xc)] \ + [expr $yb - $sequence::($seq_obj,prev_bot_blk_yc)] + + set sequence::($seq_obj,prev_bot_blk_xc) $xb + set sequence::($seq_obj,prev_bot_blk_yc) $yb + + $bot_canvas raise [lindex $objects 0] + $bot_canvas raise [lindex $objects 1] + + set elem_obj $sequence::($seq_obj,drag_blk_obj) + + # if the block that is dragged is a normal one, then the + # temporary block created in the top canvas is moved. + if {[string compare $event_element::($elem_obj,type) "normal"] == 0} \ + { + set xt [$top_canvas canvasx $x] + set yt [$top_canvas canvasy $y] + + $top_canvas move $sequence::($seq_obj,blk_top_img) \ + [expr $xt - $sequence::($seq_obj,prev_top_blk_xc)] \ + [expr $yt - $sequence::($seq_obj,prev_top_blk_yc) + $panel_hi] + + $top_canvas move $sequence::($seq_obj,blk_top_text) \ + [expr $xt - $sequence::($seq_obj,prev_top_blk_xc)] \ + [expr $yt - $sequence::($seq_obj,prev_top_blk_yc) + $panel_hi] + + + set sequence::($seq_obj,prev_top_blk_xc) $xt + set sequence::($seq_obj,prev_top_blk_yc) [expr $yt + $panel_hi] + + UI_PB_evt_TrashFocusOn page_obj seq_obj $x $y + } + + # Gets the event object based upon the current cursor location + UI_PB_evt_GetEventObjFromCurPos page_obj seq_obj $xb $yb + + # Highlights the seperators based upon the cursor location + UI_PB_evt_HighLightSep page_obj seq_obj $xb $yb + + # if the block that is dragged is a action block, then it + # is translated in the action canvas. + if {$Page::($page_obj,action_flag) == 0 && \ + [string compare $event_element::($elem_obj,type) "action"] == 0} \ + { + set action_canvas $Page::($page_obj,action_canvas) + set bot_canvas_hi $Page::($page_obj,bot_canvas_hi) + set xa [$action_canvas canvasx $x] + set ya [$action_canvas canvasy $y] + + $action_canvas move $sequence::($seq_obj,blk_act_img) \ + [expr $xa - $sequence::($seq_obj,prev_act_blk_xc)] \ + [expr $ya - $sequence::($seq_obj,prev_act_blk_yc) - $bot_canvas_hi] + + $action_canvas move $sequence::($seq_obj,blk_act_text) \ + [expr $xa - $sequence::($seq_obj,prev_act_blk_xc)] \ + [expr $ya - $sequence::($seq_obj,prev_act_blk_yc) - \ + $bot_canvas_hi] + + set sequence::($seq_obj,prev_act_blk_xc) $xa + set ya [expr $ya - $bot_canvas_hi] + set sequence::($seq_obj,prev_act_blk_yc) $ya + + # Highlights the action rectangle based upon the cursor + # location. + UI_PB_evt_HighLightActionRect page_obj seq_obj $xa $ya + } +} + +#========================================================================== +# This procedure is called, when the first mouse button holding the +# block of an event is released. If the block, that is dragged is a +# normal one, and if it is released within the range of the trash icon,it +# deletes that block and transforms the other events and their blocks. Else +# the dragged block is added to any of the template block or above or +# below template block of the event based upon its release. +# +# If the block dragged is a action block, and if it is released +# in the range of the action canvas, it deletes the dragged block, +# transforms the other events and their blocks and puts the action +# block in action canvas. +#========================================================================== +proc UI_PB_evt_BlockEndDrag {page_obj seq_obj} { +#========================================================================== + global paOption + global tixOption + + set bot_canvas $Page::($page_obj,bot_canvas) + set elem_obj $sequence::($seq_obj,drag_blk_obj) + + # Deletes the temporary icon created in the top canvas + if {[string compare $event_element::($elem_obj,type) "normal"] == 0} \ + { + set top_canvas $Page::($page_obj,top_canvas) + $top_canvas delete $sequence::($seq_obj,blk_top_img) + $top_canvas delete $sequence::($seq_obj,blk_top_text) + } + + # Deletes the temporary icon created in the action canvas + if {$Page::($page_obj,action_flag) == 0 && \ + [string compare $event_element::($elem_obj,type) "action"] == 0} \ + { + set action_canvas $Page::($page_obj,action_canvas) + $action_canvas delete $sequence::($seq_obj,blk_act_img) + $action_canvas delete $sequence::($seq_obj,blk_act_text) + } + + # Unhighlights the seperators, if the seperators are + # highlighted + UI_PB_evt_UnHighlightSeperators $bot_canvas seq_obj + + # Edit the block + if {$Page::($page_obj,being_dragged) < \ + $Page::($page_obj,drag_sensitivity)} \ + { + set focus_img $event_element::($elem_obj,icon_id) + UI_PB_evt_EditBlock $page_obj $seq_obj $focus_img + } + + # Checks if the dragged block is released with in the + # region of trashcan. + if {$sequence::($seq_obj,trash_flag)} \ + { + # Deletes the dragged block and transforms other + # events and their blocks. + UI_PB_evt_PutBlkInTrash page_obj seq_obj + + # Checks if the dragged block is released within + # the regions of the other block templates. + } elseif {$sequence::($seq_obj,add_blk) != 0} \ + { + # Based upon the release, it either adds to a + # a row or above or below the row + UI_PB_evt_SwapBlocks page_obj seq_obj + + # Checks if the dragged block is released within the + # region of the action canvas. + } elseif {$sequence::($seq_obj,action_blk_add)} \ + { + # Deletes the dragged block, and puts in the action + # action canvas + UI_PB_evt_AddBlockActionCanvas page_obj seq_obj + + } else \ + { + # Else returns to its original position. + UI_PB_evt_ReturnBlock page_obj seq_obj + } + + set sequence::($seq_obj,prev_top_blk_xc) 0 + set sequence::($seq_obj,prev_top_blk_yc) 0 + set sequence::($seq_obj,drag_flag) 0 + set sequence::($seq_obj,trash_flag) 0 + set sequence::($seq_obj,add_blk) 0 + set sequence::($seq_obj,action_blk_add) 0 + + unset sequence::($seq_obj,drag_blk_obj) + unset sequence::($seq_obj,drag_evt_obj) + + set trash_cell $Page::($page_obj,trash) + [lindex $trash_cell 0] config -bg $paOption(app_butt_bg) + + # Delete connecting line + $Page::($page_obj,top_canvas) delete connect_line + + # Unset balloon + UI_PB_eve_DeleteBalloon page_obj +} + +#====================================================================== +proc UI_PB_evt_CreateBlkPopup { page_obj seq_obj } { +#====================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + set texticon_id $sequence::($seq_obj,texticon_ids) + set focus_img [UI_PB_evt_GetCurrentImage $bot_canvas texticon_id] + + set popup $Page::($page_obj,popup) + $popup delete 0 end + $popup add command -label "Edit" -state normal \ + -command "UI_PB_evt_EditBlock $page_obj $seq_obj $focus_img" + $popup add command -label "Force Output" -state normal \ + -command "UI_PB_evt_EvtBlockModality $page_obj $seq_obj $focus_img" + $popup add sep + $popup add command -label "Delete" + + set Page::($page_obj,popup_flag) 1 +} + +#====================================================================== +proc UI_PB_evt_EvtBlockModality { page_obj seq_obj focus_img } { +#====================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + + UI_PB_evt_GetBlkObjFromImageid page_obj seq_obj $focus_img + set element_obj $sequence::($seq_obj,drag_blk_obj) + set current_blk_obj $event_element::($element_obj,block_obj) + + # Creates the block page + $bot_canvas bind blk_movable "" + set canvas_frame $Page::($page_obj,canvas_frame) + set evt_img_id $event_element::($element_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $evt_img_id -image] end] + $img config -relief sunken -bg pink + update + + UI_PB_blk_ModalityDialog page_obj seq_obj element_obj canvas_frame +} + +#====================================================================== +proc UI_PB_evt_EditBlock { page_obj seq_obj focus_img } { +#====================================================================== + UI_PB_evt_GetBlkObjFromImageid page_obj seq_obj $focus_img + set element_obj $sequence::($seq_obj,drag_blk_obj) + set current_blk_obj $event_element::($element_obj,block_obj) + + # Creates the block page + set bot_canvas $Page::($page_obj,bot_canvas) + $bot_canvas bind blk_movable "" +## set canvas_frame $Page::($page_obj,canvas_frame) + set evt_img_id $event_element::($element_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $evt_img_id -image] end] + $img config -relief sunken -bg pink + update + + + UI_PB_evt__DisplayBlockPage $page_obj $seq_obj $current_blk_obj $element_obj + + +## # UnBind callbacks to the canvas +## tixDisableAll $canvas_frame +## UI_PB_evt_ActionUnBindProcs page_obj seq_obj +## UI_PB_evt_AddUnBindProcs page_obj +## UI_PB_evt_BlkUnBindProcs page_obj seq_obj +## set c $Page::($page_obj,bot_canvas) +## $c config -cursor "" +## ## global gPB_help_tips +## ## unset gPB_help_tips($c) +## +## +## UI_PB_blk_CreateBlockPage current_blk_obj canvas_frame new_blkpage_obj +## UI_PB_blk_EditBlkActionButtons new_blkpage_obj page_obj seq_obj \ +## element_obj +## +## block::readvalue $current_blk_obj blk_obj_attr +## tkwait window $canvas_frame.$blk_obj_attr(0) +## +## # ReBind callbacks to the canvas +## tixEnableAll $canvas_frame +## UI_PB_evt_ActionBindProcs page_obj seq_obj +## UI_PB_evt_AddBindProcs page_obj +## UI_PB_evt_BlkBindProcs page_obj seq_obj +} + +#====================================================================== +proc UI_PB_evt__DisplayBlockPage { page_obj seq_obj block_obj element_obj } { +#====================================================================== +## UI_PB_evt_GetBlkObjFromImageid page_obj seq_obj $focus_img + + # Creates the block page + set bot_canvas $Page::($page_obj,bot_canvas) + $bot_canvas bind blk_movable "" + set canvas_frame $Page::($page_obj,canvas_frame) + +# UnBind callbacks to the canvas +tixDisableAll $canvas_frame +UI_PB_evt_ActionUnBindProcs page_obj seq_obj +UI_PB_evt_AddUnBindProcs page_obj +UI_PB_evt_BlkUnBindProcs page_obj seq_obj +set c $Page::($page_obj,bot_canvas) +$c config -cursor "" + + + UI_PB_blk_CreateBlockPage block_obj canvas_frame new_blk_page_obj + UI_PB_blk_EditBlkActionButtons new_blk_page_obj page_obj seq_obj \ + element_obj + +block::readvalue $block_obj blk_obj_attr +tkwait window $canvas_frame.$blk_obj_attr(0) + +# ReBind callbacks to the canvas +tixEnableAll $canvas_frame +UI_PB_evt_ActionBindProcs page_obj seq_obj +UI_PB_evt_AddBindProcs page_obj +UI_PB_evt_BlkBindProcs page_obj seq_obj +} + +#====================================================================== +# This procedure deletes the dragged action block of an event, +# transforms the other events and their blocks and at the same +# time it adds the action block to the action canvas. +#====================================================================== +proc UI_PB_evt_AddBlockActionCanvas {PAGE_OBJ SEQ_OBJ} { +#====================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + global tixOption + global paOption + + # Deletes the dragged block and transforms the other + # events and their blocks. + UI_PB_evt_PutBlkInTrash page_obj seq_obj + + set elem_obj $sequence::($seq_obj,drag_blk_obj) + set action_canvas $Page::($page_obj,action_canvas) + set t_shift $Page::($page_obj,glob_text_shift) + + # Unhighlights the highlighted action canvas rectangle. + $action_canvas itemconfigure $sequence::($seq_obj,action_rect) \ + -fill lightgray -outline lightgray + + set act_img_addr [UI_PB_blk_CreateIcon $action_canvas pb_block ""] + set block_obj $event_element::($elem_obj,block_obj) + set blk_text $block::($block_obj,block_name) + $act_img_addr config -bg lightsteelblue1 + + # Cycles through the action blocks and based upon the + # action block name it gets the action block object + foreach act_elem_obj $sequence::($seq_obj,action_elem_list) \ + { + set act_blk_obj $event_element::($act_elem_obj,block_obj) + if {[string compare $block::($act_blk_obj,block_name) \ + $blk_text] == 0} \ + { + set action_elem $act_elem_obj + break + } + } + + # Creates the action block at its original position + set xc $event_element::($action_elem,xc) + set yc $event_element::($action_elem,yc) + + set elem_act_img [$action_canvas create image $xc \ + $yc -image $act_img_addr -tag act_movable] + + set elem_act_text [$action_canvas create text \ + [expr $xc + $t_shift] $yc -text $blk_text \ + -font $tixOption(bold_font) -tag act_movable] + + lappend sequence::($seq_obj,action_texticon) $elem_act_text $elem_act_img + set event_element::($action_elem,icon_id) $elem_act_img + set event_element::($action_elem,text_id) $elem_act_text +} + +#======================================================================== +# This procedure either adds the dragged block to the +# selected row or above the selected row or below the +# selected row based upon the location at which the dragged +# block is released. +#======================================================================== +proc UI_PB_evt_SwapBlocks {PAGE_OBJ SEQ_OBJ} { +#======================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + # if the dragged block is released outside the range of + # block templates, then it does nothing. + if {![info exists sequence::($seq_obj,add_blkto_evt_obj)]} \ + { + return + } + + # dragged block object. + set drag_elem_obj $sequence::($seq_obj,drag_blk_obj) + + # checks for the new block in the template block + if {[string compare $sequence::($seq_obj,add_blk) "row"] == 0} \ + { + set blk_exists_flag [UI_PB_evt_CheckBlkInTemplate seq_obj drag_elem_obj] + + # Checks for the existance of new block in the block template. + # if it exists it popups an error message. + if {$blk_exists_flag} \ + { + set bot_canvas $Page::($page_obj,bot_canvas) + UI_PB_evt_BlockFocusOff $page_obj $seq_obj + + set block_obj $event_element::($drag_elem_obj,block_obj) + set block_name $block::($block_obj,block_name) + tk_messageBox -type ok -icon error \ + -message "Block $block_name exists in the Block Template" + + UI_PB_evt_ReturnBlock page_obj seq_obj + return + } + } + + set drag_evt_obj $sequence::($seq_obj,drag_evt_obj) + set no_rows $event::($drag_evt_obj,block_nof_rows) + + # Gets the block template number (row no) and the index + # of the block itself in the block template. + for {set count 0} {$count < $no_rows} {incr count} \ + { + set elem_index [lsearch [lindex $event::($drag_evt_obj,evt_elem_list) \ + $count] $sequence::($seq_obj,drag_blk_obj)] + + if {$elem_index != -1} { break } + } + + # Event object to which the block has to be added. + set add_evt_obj $sequence::($seq_obj,add_blkto_evt_obj) + + # if the collapse image is minus, then only the block is added, + # otherwise the dragged block is returned back to its original position. + if {[string compare $event::($add_evt_obj,col_image) "minus"] == 0} \ + { + # finds the no of blocks in the block template, from which + # the block is dragged. + if {[llength [lindex $event::($drag_evt_obj,evt_elem_list) $count]] > 1} \ + { + UI_PB_evt_AddDragBlockToRow page_obj seq_obj count elem_index + } else \ + { + UI_PB_evt_AddDragBlockAboveOrBelow page_obj seq_obj count + } + } else \ + { + UI_PB_evt_ReturnBlock page_obj seq_obj + } +} + +#======================================================================== +proc UI_PB_evt_AddDragBlockToRow { PAGE_OBJ SEQ_OBJ COUNT ELEM_INDEX} { +#======================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $COUNT count + upvar $ELEM_INDEX elem_index + + set drag_evt_obj $sequence::($seq_obj,drag_evt_obj) + set drag_elem_obj $sequence::($seq_obj,drag_blk_obj) + + # Deletes all the blocks of an dragged event. + UI_PB_evt_DeleteEventElements page_obj seq_obj drag_evt_obj + set row_elem_list [lindex $event::($drag_evt_obj,evt_elem_list) $count] + + # updates the block template list by eliminating the + # dragged block. + set row_elem_list [lreplace $row_elem_list $elem_index $elem_index] + set event::($drag_evt_obj,evt_elem_list) \ + [lreplace $event::($drag_evt_obj,evt_elem_list) $count $count $row_elem_list] + + # Creates the blocks of an event again. + UI_PB_evt_CreateElementsOfEvent page_obj seq_obj drag_evt_obj + + # Then adds the dragged block to the selected block template + # of an event. + UI_PB_evt_AddBlockToEvent page_obj seq_obj drag_elem_obj +} + +#======================================================================== +proc UI_PB_evt_AddDragBlockAboveOrBelow { PAGE_OBJ SEQ_OBJ COUNT} { +#======================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + upvar $COUNT count + + set drag_evt_obj $sequence::($seq_obj,drag_evt_obj) + set drag_elem_obj $sequence::($seq_obj,drag_blk_obj) + + # Deletes the blocks of an dragged event + UI_PB_evt_DeleteEventElements page_obj seq_obj drag_evt_obj + + # updates all the block templates of an dragged event, by + # eliminating the dragged block. + set add_evt_obj $sequence::($seq_obj,add_blkto_evt_obj) + set event::($drag_evt_obj,evt_elem_list) \ + [lreplace $event::($drag_evt_obj,evt_elem_list) $count $count] + set event::($drag_evt_obj,block_nof_rows) \ + [expr $event::($drag_evt_obj,block_nof_rows) - 1] + + # if the block is dragged and added to the + # same event + if {$drag_evt_obj == $add_evt_obj} \ + { + if {$sequence::($seq_obj,blk_temp) > $count} \ + { + incr sequence::($seq_obj,blk_temp) -1 + } + } + + # creates the blocks of an event agin + UI_PB_evt_CreateElementsOfEvent page_obj seq_obj drag_evt_obj + + set active_evt_index [lsearch $sequence::($seq_obj,evt_obj_list) \ + $drag_evt_obj] + UI_PB_evt_TransformEvtElem page_obj seq_obj active_evt_index + + # finally it adds the dragged block to the selected template block + # of an event + UI_PB_evt_AddBlockToEvent page_obj seq_obj drag_elem_obj +} + +#======================================================================== +# This procedure deletes the dragged block and transforms other +# events and their blocks. +#======================================================================== +proc UI_PB_evt_PutBlkInTrash {PAGE_OBJ SEQ_OBJ } { +#======================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + # Gets the Event object, of the dragged block + set active_evt_obj $sequence::($seq_obj,drag_evt_obj) + + # Removes the block object from the block event list + set evt_elem_obj $sequence::($seq_obj,drag_blk_obj) + set block_obj $event_element::($evt_elem_obj,block_obj) + block::DeleteFromEventList $block_obj active_evt_obj + + # total no of block templates in an event + set no_rows $event::($active_evt_obj,block_nof_rows) + + # finds the block template number and its index in the block + # block template. + for {set count 0} {$count < $no_rows} {incr count} \ + { + set elem_index [lsearch [lindex $event::($active_evt_obj,evt_elem_list) \ + $count] $sequence::($seq_obj,drag_blk_obj)] + + if {$elem_index != -1} { break } + } + + # It deletes the blocks of an dragged event and updates the + # template block and recreates all the blocks of an event. + if {[llength [lindex $event::($active_evt_obj,evt_elem_list) \ + $count]] > 1} \ + { + UI_PB_evt_DeleteEventElements page_obj seq_obj active_evt_obj + set row_elem_list [lindex $event::($active_evt_obj,evt_elem_list) \ + $count] + + set row_elem_list [lreplace $row_elem_list $elem_index $elem_index] + set event::($active_evt_obj,evt_elem_list) \ + [lreplace $event::($active_evt_obj,evt_elem_list) $count \ + $count $row_elem_list] + UI_PB_evt_CreateElementsOfEvent page_obj seq_obj active_evt_obj + } else \ + { + UI_PB_evt_DeleteEventElements page_obj seq_obj active_evt_obj + set event::($active_evt_obj,evt_elem_list) \ + [lreplace $event::($active_evt_obj,evt_elem_list) $count $count] + set event::($active_evt_obj,block_nof_rows) [expr $no_rows - 1] + + UI_PB_evt_CreateElementsOfEvent page_obj seq_obj active_evt_obj + + set active_evt_index [lsearch $sequence::($seq_obj,evt_obj_list) \ + $active_evt_obj] + UI_PB_evt_TransformEvtElem page_obj seq_obj active_evt_index + } +} + +#========================================================================= +# This procedure highlights the trashcan, if the cursor location +# falls within the region of the trash. It highlights by changing +# the background color to yellow. +#========================================================================= +proc UI_PB_evt_TrashFocusOn {PAGE_OBJ SEQ_OBJ x y} { +#========================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + global paOption + + set top_canvas $Page::($page_obj,top_canvas) + set trash_cell $Page::($page_obj,trash) + + if {$x > [lindex $trash_cell 1] && $x < [lindex $trash_cell 2] && \ + $y > [lindex $trash_cell 3] && $y < [lindex $trash_cell 4]} \ + { + [lindex $trash_cell 0] config -bg $paOption(focus) + UI_PB_blk_TrashConnectLine page_obj + set sequence::($seq_obj,trash_flag) 1 + } else \ + { + [lindex $trash_cell 0] config -bg $paOption(app_butt_bg) + set sequence::($seq_obj,trash_flag) 0 + $top_canvas delete connect_line + } +} + +#========================================================================= +# This procedure highlights the action canvas rectangle, if the +# cursor location falls within the region of the action canvas +# rectangle. It highlights by filling the rectangle with yellow. +#========================================================================== +proc UI_PB_evt_HighLightActionRect {PAGE_OBJ SEQ_OBJ x y} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + global paOption + + set action_canvas $Page::($page_obj,action_canvas) + set action_dim $sequence::($seq_obj,action_dim) + + if {$x > [expr [lindex $action_dim 0] - 20] && \ + $x < [expr [lindex $action_dim 2] + 20] && \ + $y > [expr [lindex $action_dim 1] - 20] && \ + $y < [expr [lindex $action_dim 3] + 20]} \ + { + $action_canvas itemconfigure $sequence::($seq_obj,action_rect) \ + -fill $paOption(focus) -outline $paOption(focus) + set sequence::($seq_obj,action_blk_add) 1 + } else \ + { + $action_canvas itemconfigure $sequence::($seq_obj,action_rect) \ + -fill lightgray -outline lightgray + set sequence::($seq_obj,action_blk_add) 0 + } +} + +#========================================================================== +# This procedure puts back the dragged block of an event to +# its original position. +#========================================================================== +proc UI_PB_evt_ReturnBlock {PAGE_OBJ SEQ_OBJ} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + set text_shift $Page::($page_obj,glob_text_shift) + + # Gets the block object + set elem_obj $sequence::($seq_obj,drag_blk_obj) + + # puts it at its center + $bot_canvas coords $event_element::($elem_obj,icon_id) \ + $event_element::($elem_obj,xc) $event_element::($elem_obj,yc) + $bot_canvas coords $event_element::($elem_obj,text_id) \ + [expr $event_element::($elem_obj,xc) + $text_shift] \ + $event_element::($elem_obj,yc) +} + +#========================================================================== +# This procedure creates a line in the canvas. The inputs are +# the canvas id, the top upper corner and the lower left +# corner coordinates. +#========================================================================== +proc UI_PB_evt_CreateLine {CANVAS_ID x1 y1 x2 y2} { +#========================================================================== + upvar $CANVAS_ID canvas_id + + set line_id [$canvas_id create line $x1 $y1 $x2 $y2] + + $canvas_id lower $line_id + + return $line_id +} + +#========================================================================== +# This procedure is called, when the program start of sequence or +# Operation start of sequence or program end sequence or Operation +# end sequence is selected from the tree. +#========================================================================== +proc UI_PB_evt_SeqComponents {PAGE_OBJ SEQ_OBJ} { + +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + global mom_sys_arr + + # Creates the events and blocks of the sequence + if { $mom_sys_arr(seq_blk_nc_code) } \ + { + set tpth_event_flag 1 + } else \ + { + set tpth_event_flag 0 + } + + UI_PB_evt_CreateSeqEvent page_obj seq_obj tpth_event_flag + UI_PB_evt_CreateMenuOptions page_obj seq_obj + + # Bind procs for event and blocks + if { $mom_sys_arr(seq_blk_nc_code) } \ + { + UI_PB_evt_UnBindBlkProcs page_obj + } else \ + { + UI_PB_evt_BlkBindProcs page_obj seq_obj + } +} + +#========================================================================== +proc UI_PB_evt_ActivateEvent { PAGE_OBJ SEQ_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set seq_evt_list $sequence::($seq_obj,evt_obj_list) + set bot_canvas $Page::($page_obj,bot_canvas) + foreach event_name $Page::($page_obj,event_list) \ + { + PB_com_RetObjFrmName event_name seq_evt_list ret_obj + if { $ret_obj } \ + { + set evt_img_id $event::($ret_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $evt_img_id -image] end] + $img config -relief sunken -bg pink + } + } +} + +#========================================================================== +# This procedure is called, when the Tool Path elements is +# selected from the tree. +#========================================================================== +proc UI_PB_evt_ToolPathSeqComponents {PAGE_OBJ SEQ_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_OBJ seq_obj + + set tpth_event_flag 1 + # Creates the events and blocks of the sequence + UI_PB_evt_CreateSeqEvent page_obj seq_obj tpth_event_flag + UI_PB_evt_CreateMenuOptions page_obj seq_obj + UI_PB_evt_EvtBindProcs page_obj seq_obj + UI_PB_evt_UnBindBlkProcs page_obj + UI_PB_evt_ActivateEvent page_obj seq_obj +} + diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_tclindex.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_tclindex.tcl new file mode 100644 index 0000000..9c93469 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_tclindex.tcl @@ -0,0 +1,57 @@ +############################################################################## +# Description # +# Tcl autoload index file, version 2.0 This file is generated by the # +# "tixindex" program, *NOT* by the "auto_mkindex" command, and sourced # +# to set up indexing information for one or more commands. # +# Typically each line is a command that sets an element in the # +# auto_index array, where the element name is the name of a command # +# and the value is a script that loads the command. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-Apr-1999 mnb Added env. variable # +# 02-Jun-1999 mnb Code Integration # +# 07-Sep-1999 mnb Added CreateFmtPage, CreateAddressPage & # +# CreateBlockPage proceduers to load respective files# +# 21-Sep-1999 mnb Added ModalityDialog proc to the index # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +global env +set dir $env(PB_DIR)/ui/ +set auto_index(UI_PB_List) "source {$dir/ui_pb_list.tcl}" +set auto_index(UI_PB_MachineTool) "source {$dir/ui_pb_machine.tcl}" +set auto_index(UI_PB_Preview) "source {$dir/ui_pb_preview.tcl}" +set auto_index(UI_PB_Advisor) "source {$dir/ui_pb_advisor.tcl}" +set auto_index(UI_PB_Def) "source {$dir/ui_pb_definition.tcl}" +set auto_index(UI_PB_Def_Block) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_CreateMenuOptions) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_GetBlkAttrSort) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_CreateBlockCells) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_AddBindProcs) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_TrashFocusOn) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_UI_PB_blk_ReturnAddr) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_TrashConnectLine) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_CreatePopupMenu) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_BlockPopupMenu) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_CreateBalloon) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_Def_Address) "source {$dir/ui_pb_address.tcl}" +set auto_index(UI_PB_Def_Format) "source {$dir/ui_pb_format.tcl}" +set auto_index(UI_PB_Def_OtherElements) "source {$dir/ui_pb_others.tcl}" +set auto_index(UI_PB_ProgTpth) "source {$dir/ui_pb_progtpth.tcl}" +set auto_index(UI_PB_ProgTpth_Program) "source {$dir/ui_pb_program.tcl}" +set auto_index(UI_PB_ProgTpth_Gcode) "source {$dir/ui_pb_gcode.tcl}" +set auto_index(UI_PB_ProgTpth_Mcode) "source {$dir/ui_pb_mcode.tcl}" +set auto_index(UI_PB_ProgTpth_WordSeq) "source {$dir/ui_pb_addrseq.tcl}" +set auto_index(UI_PB_ProgTpth_AddSum) "source {$dir/ui_pb_addrsum.tcl}" +set auto_index(UI_PB_evt_ToolPath) "source {$dir/ui_pb_toolpath.tcl}" +set auto_index(UI_PB_ads_CreateSpecialChars) "source {$dir/ui_pb_addrsum.tcl}" +set auto_index(UI_PB_fmt_CreateFmtPage) "source {$dir/ui_pb_format.tcl}" +set auto_index(UI_PB_addr_CreateAddressPage) "source {$dir/ui_pb_address.tcl}" +set auto_index(UI_PB_blk_CreateBlockPage) "source {$dir/ui_pb_block.tcl}" +set auto_index(UI_PB_blk_ModalityDialog) "source {$dir/ui_pb_block.tcl}" diff --git a/PB16_1999_release/POSTBUILD/app/ui/ui_pb_toolpath.tcl b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_toolpath.tcl new file mode 100644 index 0000000..003d9f7 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/app/ui/ui_pb_toolpath.tcl @@ -0,0 +1,4073 @@ +#=============================================================================== +# UI_PB_TOOLPATH.TCL +#=============================================================================== +############################################################################## +# Description # +# This file contains all functions dealing with the creation of # +# ui elements for Tool Path Sequenc Events. # +# # +# Revisions # +# # +# Date Who Reason # +# 01-feb-1999 mnb Initial # +# 07-Apr-1999 mnb Changed bitmap name # +# 02-Jun-1999 mnb Code Integration # +# 04-Jun-1999 mnb Added pb_ to image names # +# 14-Jun-1999 mnb Added pb_ to optional images # +# 22-Jun-1999 gsl Grab the Sequence page when event window is opened.# +# 28-Jun-1999 mnb A Text element can be added multiple times to # +# any block of an event # +# 29-Jun-1999 mnb Changed text background color # +# 07-Jul-1999 mnb Incorporated Work Plane change for Rapid Event # +# 07-Sep-1999 mnb Block Element Address can be editted & an # +# expression can be added as mom vairbale # +# 21-Sep-1999 mnb Added Modality # +# 17-Nov-1999 gsl Submitted for phase-22. # +# # +# $HISTORY$ # +# # +############################################################################## + +#=============================================================================== +proc UI_PB_evt_ToolPath { SEQ_PAGE_OBJ SEQ_OBJ EVENT_OBJ} { +#=============================================================================== + upvar $SEQ_PAGE_OBJ seq_page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVENT_OBJ event_obj + global paOption gPB + + set sequence_name $sequence::($seq_obj,seq_name) + set event_name $event::($event_obj,event_name) + set dbase_evt_name $event_name + + set bot_canvas $Page::($seq_page_obj,bot_canvas) + set evt_img_id $event::($event_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $evt_img_id -image] end] + $img config -relief sunken -bg pink + + + # Top level doesn't accept a string having capital chars + set temp_event_name [split $event_name] + set event_name [join $temp_event_name _ ] + set event_name [string tolower $event_name] + +## set seq_canvas $Page::($seq_page_obj,canvas_frame) + + + set win $gPB(main_window).$event_name + + if {[winfo exists $win]} \ + { + raise $win + focus $win +return + } else { + toplevel $win + } + + # Register this window with the Sequence page + lappend Page::($seq_page_obj,event_list) $event::($event_obj,event_name) + + set evt_book [new Book win] + Book::CreateTopLvlPage $evt_book "$event_name" + set page_obj $Book::($evt_book,top_lvl_evt_page) + set Page::($page_obj,event_name) $event::($event_obj,event_name) + +# UI_PB_tpth_LockBookPages seq_page_obj + + UI_PB_com_CreateTransientWindow $win "EVENT : $dbase_evt_name" "800x700+200+200" \ + "UI_PB_tpth_CancelCallBack \ + $seq_page_obj $page_obj $event_obj" "" + set Page::($page_obj,win) $win + set page_frm $Page::($page_obj,page_id) + pack $page_frm -fill both -expand yes + + set ncout_flag 0 + if {[string compare $sequence_name "Machine Control"] == 0} \ + { + set ncout_flag 1 + } + + # Database call for getting the Event items and ude flag + PB_int_RetEvtCombElems comb_box_elems + + set item_obj_list $event::($event_obj,evt_itm_obj_list) + set ude_flag $sequence::($seq_obj,ude_flag) + + if { [llength $item_obj_list ] > 0 } \ + { + UI_PB_tpth_CreateHorzPane page_obj + UI_PB_tpth_CreateToolPathComponents page_obj seq_page_obj seq_obj \ + event_obj $ncout_flag + UI_PB_tpth_CreateItemsOfEvent page_obj item_obj_list + UI_PB_tpth_PackItems page_obj + } else \ + { + wm geometry $win 800x500+200+200 + set page_id $Page::($page_obj,page_id) + set Page::($page_obj,canvas_frame) $page_id + set Page::($page_obj,param_frame) $page_id + set Page::($page_obj,box_frame) $page_id + UI_PB_tpth_CreateToolPathComponents page_obj seq_page_obj seq_obj \ + event_obj $ncout_flag + } + + UI_PB_tpth_CreateMembersOfItem page_obj event_obj + + if {$ude_flag} \ + { + set no_items [llength $item_obj_list] + if {$no_items > 0} \ + { + UI_PB_tpth_CreateUserDefIcon page_obj no_items + } + } + + set Page::($page_obj,dummy_blk) 0 + UI_PB_tpth_CreateElemObjects page_obj event_obj + + # Returns the mom variables used by the event + UI_PB_tpth_GetEventMomVars event_obj evt_mom_var_list + set Page::($page_obj,evt_mom_var_list) [array get evt_mom_var_list] + + # Restores the event data + UI_PB_tpth_RestoreEventData page_obj event_obj + + # PopupMenu bind call + set Page::($page_obj,block_popup_flag) 0 + UI_PB_blk_CreatePopupMenu page_obj + + set Page::($page_obj,blk_WordNameList) $comb_box_elems + UI_PB_tpth_CreateEventBlockTemplates page_obj event_obj + UI_PB_blk_CreateMenuOptions page_obj +} + +#=============================================================================== +proc UI_PB_tpth_LockBookPages { SEQ_PAGE_OBJ } { +#=============================================================================== + upvar $SEQ_PAGE_OBJ seq_page_obj + global gPB + + if {[llength $Page::($seq_page_obj,event_list)] > 0} \ + { + set pb_book_id $Book::($gPB(book),book_id) + + $pb_book_id pageconfig mac -state disabled + $pb_book_id pageconfig pro -state disabled + $pb_book_id pageconfig def -state disabled + $pb_book_id pageconfig lis -state disabled + $pb_book_id pageconfig pre -state disabled + $pb_book_id pageconfig adv -state disabled + + set pb_book_page_list $Book::($gPB(book),page_obj_list) + + set prg_tpth_page [lindex $pb_book_page_list 1] + + set prg_tpth_book $Page::($prg_tpth_page,book_obj) + set prg_tpth_book_id $Book::($prg_tpth_book,book_id) + + $prg_tpth_book_id pageconfig prog -state disabled + $prg_tpth_book_id pageconfig gcod -state disabled + $prg_tpth_book_id pageconfig mcod -state disabled + $prg_tpth_book_id pageconfig asum -state disabled + $prg_tpth_book_id pageconfig wseq -state disabled + } +} + +#=============================================================================== +proc UI_PB_tpth_RestoreEventData { PAGE_OBJ EVENT_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + global mom_sys_arr + + # Restores the event attributes + event::RestoreValue $event_obj + + # Restores the Event elements data + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + foreach evt_elem_obj $event::($event_obj,evt_elem_list) \ + { + # Restores the event element data + event_element::RestoreValue $evt_elem_obj + + # Restores the block data + set block_obj $event_element::($evt_elem_obj,block_obj) + block::RestoreValue $block_obj + + # Restores the block Elements data + if {[string compare $block::($block_obj,elem_addr_list) ""] != 0} \ + { + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + block_element::RestoreValue $blk_elem_obj + } + } + } + } + + # Restores the values of event mom variables + array set evt_mom_var $Page::($page_obj,evt_mom_var_list) + set no_vars [array size evt_mom_var] + for {set count 0} {$count < $no_vars} {incr count} \ + { + set mom_var $evt_mom_var($count) + set rest_evt_mom_var($mom_var) $mom_sys_arr($mom_var) + + if {[string match \$mom* $mom_var]} \ + { + set data_type [UI_PB_com_RetSysVarDataType mom_var] + set mom_sys_arr($mom_var) [UI_PB_com_RetValByDataType \ + $mom_sys_arr($mom_var) $data_type] + } + } + + if {[info exists rest_evt_mom_var]} \ + { + set Page::($page_obj,rest_evt_mom_var) [array get rest_evt_mom_var] + } +} + +#=============================================================================== +proc UI_PB_tpth_GetEventMomVars { EVENT_OBJ EVT_MOM_VAR_LIST } { +#=============================================================================== + upvar $EVENT_OBJ event_obj + upvar $EVT_MOM_VAR_LIST evt_mom_var_list + + set count 0 + if {[string compare $event::($event_obj,evt_itm_obj_list) ""] != 0} \ + { + foreach item_obj $event::($event_obj,evt_itm_obj_list) \ + { + if {[string compare $item::($item_obj,grp_obj_list) ""] != 0} \ + { + foreach grp_obj $item::($item_obj,grp_obj_list) \ + { + if {[string compare $item_group::($grp_obj,mem_obj_list) ""] != 0} \ + { + foreach mem_obj $item_group::($grp_obj,mem_obj_list) \ + { + if {[string compare $group_member::($mem_obj,mom_var) "null"]} \ + { + if {$group_member::($mem_obj,widget_type) == 5} \ + { + append temp_var $group_member::($mem_obj,mom_var) _int + set evt_mom_var_list($count) $temp_var + unset temp_var + incr count + append temp_var $group_member::($mem_obj,mom_var) _dec + set evt_mom_var_list($count) $temp_var + unset temp_var + incr count + } else \ + { + set evt_mom_var_list($count) $group_member::($mem_obj,mom_var) + incr count + } + } + } + } + } + } + } + } +} + +#=============================================================================== +proc UI_PB_tpth_CreateToolPathComponents { PAGE_OBJ SEQ_PAGE_OBJ SEQ_OBJ \ + EVENT_OBJ ncout_flag } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $SEQ_PAGE_OBJ seq_page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVENT_OBJ event_obj + global paOption + global val + + set top_canvas_dim(0) 80 + set top_canvas_dim(1) 400 + set bot_canvas_dim(0) 1000 + set bot_canvas_dim(1) 1000 + + Page::CreateCanvas $page_obj top_canvas_dim bot_canvas_dim + set bot_canvas $Page::($page_obj,bot_canvas) + $bot_canvas config -height 100 -width 400 + + # Adds apply,restore,default buttons + UI_PB_tpth_AddApplyDef page_obj seq_page_obj seq_obj event_obj + + # Template Button + set temp_box [tixButtonBox $Page::($page_obj,canvas_frame).temp \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg gray] + + pack $temp_box -side bottom -fill x -pady 5 -padx 3 + $temp_box add seqtmp -width 30 \ + -text "Select An Event Template" \ + -bg $paOption(app_butt_bg) + + #Create this frame only for Machine control events + if {$ncout_flag} \ + { + UI_PB_tpth_CreateNCOutputFrame page_obj + } + + # Adds the Add and Trash buttons to the top canvas + set Page::($page_obj,add_name) " Add Word " + Page::CreateAddTrashinCanvas $page_obj + Page::CreateMenu $page_obj + + #Binds the Add button + UI_PB_blk_AddBindProcs page_obj + set top_canvas $Page::($page_obj,top_canvas) + + # Binds the motion of first mouse button + $top_canvas bind add_movable \ + "UI_PB_tpth_ItemDrag1 $page_obj \ + $event_obj \ + %x %y" + # Binds the release of first mouse button + $top_canvas bind add_movable \ + "UI_PB_tpth_ItemEndDrag1 $page_obj \ + $event_obj \ + %x %y" +} + +#============================================================================= +proc UI_PB_tpth_CreateEventBlockTemplates { PAGE_OBJ EVENT_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + UI_PB_tpth_SetPageAttributes page_obj + + # Creates the block elements + UI_PB_tpth_CreateBlkElements page_obj event_obj +} + +#============================================================================= +proc UI_PB_tpth_CreateNCOutputFrame { PAGE_OBJ } { +#============================================================================= + upvar $PAGE_OBJ page_obj + global evt_ncoutput_status + + set canvas_frame $Page::($page_obj,canvas_frame) + set ncout_frame [frame $canvas_frame.ncout] + pack $ncout_frame -side bottom -fill x -pady 5 + + set option_list {"Output Imediately" "Output Later"} + + set lbl_frame [Page::CreateLblFrame $ncout_frame ncfrm "N/C Code"] + grid $lbl_frame + set output_frm [$lbl_frame subwidget frame] + + set no 0 + set var "\$evt_ncoutput_status" + foreach option $option_list \ + { + Page::CreateRadioButton $var $output_frm rad_$no $option + incr no + } +} + +#============================================================================= +proc UI_PB_tpth_CreateItemsOfEvent { PAGE_OBJ ITEM_OBJ_LIST} { +#============================================================================= + upvar $PAGE_OBJ page_obj + upvar $ITEM_OBJ_LIST item_obj_list + + set param_frm $Page::($page_obj,param_frame) + set item_row 0 + set item_col 0 + set count 0 + foreach item_obj $item_obj_list \ + { + set item_label $item::($item_obj,label) + if {[string compare $item_label "null"] != 0} \ + { + set widget_id [Page::CreateLblFrame $param_frm ent_$count $item_label] + } else \ + { + set widget_id [Page::CreateFrame $param_frm ent_$count] + } + set item::($item_obj,row) $item_row + set item::($item_obj,col) $item_col + set item::($item_obj,widget_id) $widget_id + + if {$item_col != 1} \ + { + lappend row_items_list $item_obj + lappend pack_row_items 0 + incr item_col + } else \ + { + incr item_row + set item_col 0 + lappend row_items_list $item_obj + lappend row_item_obj $row_items_list + unset row_items_list + + lappend pack_row_items 0 + lappend packed_items $pack_row_items + unset pack_row_items + } + incr count + } + + if {[info exists row_items_list]} \ + { + lappend row_item_obj $row_items_list + unset row_items_list + } + + if {[info exists pack_row_items]} \ + { + lappend packed_items $pack_row_items + unset pack_row_items + } + set Page::($page_obj,items_in_row) $row_item_obj + set Page::($page_obj,packed_items) $packed_items + +} + +#============================================================================== +proc UI_PB_tpth_CreateUserDefIcon { PAGE_OBJ NO_ITEMS } { +#============================================================================== + upvar $PAGE_OBJ page_obj + upvar $NO_ITEMS no_items + + set row_items $Page::($page_obj,items_in_row) + set param_frame $Page::($page_obj,param_frame) + + set ude_frame [Page::CreateFrame $param_frame ude] + set no_rows [llength $Page::($page_obj,items_in_row)] + + if { $no_items == 1 } \ + { + set topitem_obj [lindex $row_items 0] + set ref_topitem_id $item::($topitem_obj,widget_id) + tixForm $ude_frame -top 10 -pady 5 \ + -bottom &$ref_topitem_id \ + -left $ref_topitem_id \ + -padx 70 + } elseif {[expr $no_items % 2] == 0 || $no_rows == 1} \ + { + set last_elem [llength [lindex $row_items [expr $no_rows - 1]]] + set topitem_obj [lindex [lindex $row_items [expr $no_rows - 1]] \ + [expr $last_elem - 1]] + set ref_topitem_id $item::($topitem_obj,widget_id) + tixForm $ude_frame -top $ref_topitem_id -pady 5 \ + -left &$ref_topitem_id \ + -right &$ref_topitem_id -padx 25 + + } else \ + { + set topitem_obj [lindex [lindex $row_items [expr $no_rows - 2]] 1] + set ref_topitem_id $item::($topitem_obj,widget_id) + set sideitem_obj [lindex [lindex $row_items [expr $no_rows - 1]] 0] + set ref_sideitem_id $item::($sideitem_obj,widget_id) + tixForm $ude_frame -top $ref_topitem_id -pady 5 \ + -bottom &$ref_sideitem_id \ + -left &$ref_topitem_id \ + -right &$ref_topitem_id -padx 25 + } + + set f_image [tix getimage pb_user] + button $ude_frame.but -image $f_image + global gPB_help_tips + PB_enable_balloon $ude_frame.but + set gPB_help_tips($ude_frame.but) {User-Defined parameters} + pack $ude_frame.but -side right -padx 5 -pady 5 +} + +#============================================================================== +proc UI_PB_tpth_GetItemMembersCount { ITEM_OBJ } { +#============================================================================== + upvar $ITEM_OBJ item_obj + + set item_groups $item::($item_obj,grp_obj_list) + + set no_of_members 0 + foreach group_obj $item_groups \ + { + set group_align $item_group::($group_obj,elem_align) + if {[string compare $group_align "V"] == 0} \ + { + set no_of_members [expr $item_group::($group_obj,nof_elems) + \ + $no_of_members] + } else \ + { + incr no_of_members + } + } + return $no_of_members +} + +#============================================================================== +proc UI_PB_tpth_PackItems { PAGE_OBJ } { +#============================================================================== + upvar $PAGE_OBJ page_obj + + foreach row_items $Page::($page_obj,items_in_row) \ + { + # gets the count of members of row items + + if {[llength $row_items] > 1} \ + { + set first_item_obj [lindex $row_items 0] + set sec_item_obj [lindex $row_items 1] + set first_grp_members [UI_PB_tpth_GetItemMembersCount \ + first_item_obj] + set sec_grp_members [UI_PB_tpth_GetItemMembersCount \ + sec_item_obj] + } else \ + { + set first_item_obj [lindex $row_items 0] + set first_grp_members 0 + set sec_grp_members 0 + + } + + if {$sec_grp_members > $first_grp_members} \ + { + set item::($sec_item_obj,ref_side) "left" + UI_PB_tpth_TixForm page_obj sec_item_obj + set item::($first_item_obj,ref_side) "right" + UI_PB_tpth_TixForm page_obj first_item_obj + } elseif {$first_grp_members == 0 && $sec_grp_members == 0} \ + { + set item::($first_item_obj,ref_side) "right" + UI_PB_tpth_TixForm page_obj first_item_obj + } else \ + { + set item::($first_item_obj,ref_side) "right" + UI_PB_tpth_TixForm page_obj first_item_obj + set item::($sec_item_obj,ref_side) "left" + UI_PB_tpth_TixForm page_obj sec_item_obj + } + } +} + +#=============================================================================== +proc UI_PB_tpth_CreateMembersOfItem { PAGE_OBJ EVENT_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + if {![info exists Page::($page_obj,items_in_row)]} \ + { + return + } + + set item_obj_list $Page::($page_obj,items_in_row) + + foreach row_items $item_obj_list \ + { + foreach item_obj $row_items \ + { + if {[string compare $item::($item_obj,label) "null"] != 0} \ + { + set widget_id [$item::($item_obj,widget_id) subwidget frame] + } else \ + { + set widget_id $item::($item_obj,widget_id) + } + set item_group_list $item::($item_obj,grp_obj_list) + + set grp_no 0 + if {[string compare $item::($item_obj,grp_align) "V"] == 0} \ + { + set pack_item "top" + } else \ + { + set pack_item "left" + } + + foreach group_obj $item_group_list \ + { + set group_align $item_group::($group_obj,elem_align) + set members_obj_list $item_group::($group_obj,mem_obj_list) + set grp_name $item_group::($group_obj,name) + if {[string compare $grp_name "null"] == 0} \ + { + set grp_frame [Page::CreateFrame $widget_id grp_$grp_no] + pack $grp_frame -side $pack_item -expand yes -fill both -padx 20 + } else \ + { + set grp_lblframe [Page::CreateLblFrame $widget_id grp_$grp_no \ + $grp_name] + pack $grp_lblframe -side $pack_item -padx 20 + set grp_frame [$grp_lblframe subwidget frame] + } + set memb_no 0 + if {![string compare $group_align "V"]} \ + { + set memb_pack "top" + } else \ + { + set memb_pack "left" + } + + foreach member_obj $members_obj_list \ + { + set memb_frame [Page::CreateFrame $grp_frame memb_$memb_no] + pack $memb_frame -side $memb_pack -expand yes -fill both + UI_PB_tpth_CreateAWidget page_obj event_obj member_obj \ + $memb_frame $memb_no + incr memb_no + } + incr grp_no + } + } + } +} + +#=============================================================================== +proc UI_PB_tpth_TixForm { PAGE_OBJ ITEM_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $ITEM_OBJ item_obj + + UI_PB_tpth_GetReferenceWidgets page_obj item_obj ref_topitem_id \ + ref_sideitem_id + + if {$ref_topitem_id} \ + { + set ref_topitem_id $item::($ref_topitem_id,widget_id) + } + + if {$ref_sideitem_id} \ + { + set ref_sideitem_id $item::($ref_sideitem_id,widget_id) + } + + set packed_items $Page::($page_obj,packed_items) + set item_row $item::($item_obj,row) + set item_col $item::($item_obj,col) + set row_items [lindex $packed_items $item_row] + set row_items [lreplace $row_items $item_col $item_col $item_obj] + set packed_items [lreplace $packed_items $item_row $item_row $row_items] + set Page::($page_obj,packed_items) $packed_items + + set ref_side $item::($item_obj,ref_side) + set widget_id $item::($item_obj,widget_id) + + if { $ref_topitem_id == 0 && $ref_sideitem_id == 0 } \ + { + tixForm $widget_id -top 10 -pady 5 \ + -$ref_side %50 -padx 25 + } elseif { $ref_topitem_id == 0 && $ref_sideitem_id != 0 } \ + { + tixForm $widget_id -top 10 -pady 5 \ + -bottom &$ref_sideitem_id \ + -$ref_side $ref_sideitem_id -padx 25 + } elseif { $ref_topitem_id != 0 && $ref_sideitem_id == 0} \ + { + tixForm $widget_id -top $ref_topitem_id -pady 5 \ + -left &$ref_topitem_id \ + -right &$ref_topitem_id -padx 25 + } else \ + { + tixForm $widget_id -top $ref_topitem_id -pady 5 \ + -bottom &$ref_sideitem_id \ + -left &$ref_topitem_id \ + -right &$ref_topitem_id -padx 25 + } +} + +#=============================================================================== +proc UI_PB_tpth_GetReferenceWidgets { PAGE_OBJ ITEM_OBJ REF_TOPITEM_ID \ + REF_SIDEITEM_ID} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $ITEM_OBJ item_obj + upvar $REF_TOPITEM_ID ref_topitem_id + upvar $REF_SIDEITEM_ID ref_sideitem_id + + set packed_items $Page::($page_obj,packed_items) + set ref_side $item::($item_obj,ref_side) + + set row $item::($item_obj,row) + set col $item::($item_obj,col) + + if {$row} \ + { + set row_item_list [lindex $packed_items [expr $row - 1]] + set ref_topitem_id [lindex $row_item_list $col] + } else \ + { + set ref_topitem_id 0 + } + + if {[string compare $ref_side "left"] == 0} \ + { + set ref_incr -1 + } else \ + { + set ref_incr 1 + } + + set row_item_list [lindex $packed_items $row] + if {[llength $row_item_list] > 1} \ + { + set ref_sideitem_id [lindex $row_item_list [expr $col + $ref_incr]] + } else \ + { + set ref_sideitem_id 0 + } +} + +#=============================================================================== +proc UI_PB_tpth_CreateAWidget {PAGE_OBJ EVENT_OBJ MEMBER_OBJ inp_frm no} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + upvar $MEMBER_OBJ member_obj + global mom_sys_arr + + set label $group_member::($member_obj,label) + if {[string compare $label "null"] == 0} \ + { + set label "" + } + + set widget_type $group_member::($member_obj,widget_type) + set val1 $group_member::($member_obj,mom_var) + set call_back $group_member::($member_obj,callback) + + switch $widget_type \ + { + 0 { + set ext int_$no + Page::CreateIntControl $val1 $inp_frm $ext $label + } + + 1 { + set ext but_$no + Page::CreateButton $inp_frm $ext $label + } + + 2 { + set data_type $group_member::($member_obj,data_type) + set ext lent_$no + Page::CreateLblEntry $data_type $val1 $inp_frm $ext $label + } + + 3 { + set ext chkbut_$no + Page::CreateCheckButton $val1 $inp_frm $ext $label + } + + 4 { + set ext radbut_$no + Page::CreateRadioButton $val1 $inp_frm $ext $label + } + + 5 { + set ext flot_$no + append temp1 $val1 _int + append temp2 $val1 _dec + set val1 $temp1 + set val2 $temp2 + unset temp1 + unset temp2 + Page::CreateFloatControl $val1 $val2 $inp_frm $ext $label + } + + 6 { + set ext bent_$no + Page::CreateEntry $val1 $inp_frm $ext + } + + 7 { + set ext lb_$no + Page::CreateLabel $inp_frm $ext $label + } + + 8 { + set ext opt_$no + set optional_lis $group_member::($member_obj,opt_list) + Page::CreateOptionalMenu $val1 $inp_frm $ext $optional_lis \ + $label + } + } + if {[string compare $call_back "null"] != 0} \ + { + $inp_frm.$ext config -command "$call_back $page_obj \ + $event_obj $member_obj" + } +} + +#=============================================================================== +proc UI_PB_tpth_OtherOptions { page_obj event_obj member_obj } { +#=============================================================================== + global mom_sys_arr + global paOption + + set canvas_frame $Page::($page_obj,canvas_frame) + if {[winfo exists $canvas_frame.oth]} \ + { + raise $scanvas_frame.oth + focus $scanvas_frame.oth +return + } + + set mom_variables {\$oth_rev_xy_plane \$oth_rev_yz_plane \$oth_rev_zx_plane \ + \$oth_sup_out_ijk_zero \$oth_sup_out_ijk_xyz} + + foreach var $mom_variables \ + { + set rest_var($var) $mom_sys_arr($var) + } + set Page::($page_obj,rest_page_momvalues) [array get rest_var] + set Page::($page_obj,page_momvars) $mom_variables + + set win [toplevel $canvas_frame.oth] + UI_PB_com_CreateTransientWindow $win "Circular Move -- Other Options" "" "" "" + + set top_frm [frame $win.top] + set bot_frm [frame $win.bot] + pack $top_frm -side top -fill x -padx 10 -pady 10 + pack $bot_frm -side bottom -fill x -padx 10 -pady 10 + + set plane_lbfrm [Page::CreateLblFrame $top_frm ijk " IJK Options "] + pack $plane_lbfrm -side top -pady 5 -padx 25 + set pln_frm [$plane_lbfrm subwidget frame] + + # IJK Options + set frm1 [frame $pln_frm.1] + set frm2 [frame $pln_frm.2] + set frm3 [frame $pln_frm.3] + pack $frm1 $frm2 $frm3 -side left -anchor nw -padx 10 -pady 10 + + UI_PB_mthd_CreateCheckButton \$oth_rev_xy_plane $frm1 rad "XY" + UI_PB_mthd_CreateCheckButton \$oth_rev_yz_plane $frm2 rad "YZ" + UI_PB_mthd_CreateCheckButton \$oth_rev_zx_plane $frm3 rad "ZX" + + # Suppress output of i = 0, j = 0, k = 0; + set ijk_zero [frame $top_frm.ijk0] + pack $ijk_zero -side top -pady 5 -padx 25 + UI_PB_mthd_CreateCheckButton \$oth_sup_out_ijk_zero $ijk_zero rad \ + "Suppress Output of \{I = 0\} \{J = 0\} \{k = 0\}" + + # Suppress output of i = x, j = y, k = z; + set ijk_xyz [frame $top_frm.ijkxyz] + pack $ijk_xyz -side top -pady 5 -padx 25 + UI_PB_mthd_CreateCheckButton \$oth_sup_out_ijk_xyz $ijk_xyz rad \ + "Suppress Output of \{I = X\} \{J = Y\} \{k = Z\}" + + UI_PB_tpth_DialogActionButtons $win $page_obj $bot_frm +} + +#=============================================================================== +proc UI_PB_tpth_IJKOptions { page_obj event_obj member_obj } { +#=============================================================================== + global mom_sys_arr + global paOption + + set canvas_frame $Page::($page_obj,canvas_frame) + set win $canvas_frame.ijk + + if {[winfo exists $win]} \ + { + raise $win + focus $win +return + } else { + toplevel $win + UI_PB_com_CreateTransientWindow $win "Circular Move -- I, J, K Options" "" "" "" + } + + set mom_variables {\$cir_ijk_opt} + + foreach var $mom_variables \ + { + set rest_var($var) $mom_sys_arr($var) + } + set Page::($page_obj,rest_page_momvalues) [array get rest_var] + set Page::($page_obj,page_momvars) $mom_variables + + set top_frm [frame $win.top] + set bot_frm [frame $win.bot] + pack $top_frm -side top -fill x -padx 10 -pady 10 + pack $bot_frm -side bottom -fill x -padx 10 -pady 10 + + set plane_lbfrm [Page::CreateLblFrame $top_frm ijk " IJK Options "] + pack $plane_lbfrm -pady 5 -padx 25 + set pln_frm [$plane_lbfrm subwidget frame] + + # IJK Options + set frm1 [frame $pln_frm.1] + set frm2 [frame $pln_frm.2] + set frm3 [frame $pln_frm.3] + set frm4 [frame $pln_frm.4] + pack $frm1 $frm2 $frm3 $frm4 -anchor nw -padx 10 -pady 10 + + UI_PB_mthd_CreateRadioButton \$cir_ijk_opt $frm1 rad \ + "Vector-Start of Arc to Center" + $frm1.rad config -command "UI_PB_tpth_IJKRadBut_CB" + UI_PB_mthd_CreateRadioButton \$cir_ijk_opt $frm2 rad \ + "Vector-Center to Start of Arc" + $frm2.rad config -command "UI_PB_tpth_IJKRadBut_CB" + UI_PB_mthd_CreateRadioButton \$cir_ijk_opt $frm3 rad \ + "Unsigned Vector-Start of Arc to Center" + $frm3.rad config -command "UI_PB_tpth_IJKRadBut_CB" + UI_PB_mthd_CreateRadioButton \$cir_ijk_opt $frm4 rad \ + "Vector-Absolute Arc Center" + $frm4.rad config -command "UI_PB_tpth_IJKRadBut_CB" + + # Bottom Frame + set box1_frm [frame $bot_frm.box1] + set box2_frm [frame $bot_frm.box2] + + tixForm $box1_frm -top 0 -left 3 -right %50 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 3 -right %100 + + set bb1 [tixButtonBox $box1_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + set bb2 [tixButtonBox $box2_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + $bb1 add def -text Default -width 10 -underline 0 \ + -command "UI_PB_tpth_IJKDefault_CB $page_obj" + $bb1 add res -text Restore -underline 0 -width 10 \ + -command "UI_PB_tpth_IJKRestore_CB $page_obj" + + $bb2 add cac -text Cancel -width 10 -underline 0 \ + -command "UI_PB_tpth_DialogCancel_CB $win $page_obj" + $bb2 add ok -text Ok -width 10 -underline 0 \ + -command "UI_PB_tpth_DialogOk_CB $win $page_obj" + pack $bb1 -fill x + pack $bb2 -fill x +} + +#=============================================================================== +proc UI_PB_tpth_IJKRadBut_CB { } { +#=============================================================================== + global mom_sys_arr + + set mom_sys_arr(\$cir_vector) [join [split $mom_sys_arr(\$cir_ijk_opt) _] " "] +} + +#=============================================================================== +proc UI_PB_tpth_IJKDefault_CB { page_obj } { +#=============================================================================== + global mom_sys_arr + + UI_PB_tpth_DialogDefault_CB $page_obj + set mom_sys_arr(\$cir_vector) [join [split $mom_sys_arr(\$cir_ijk_opt) _] " "] +} + +#=============================================================================== +proc UI_PB_tpth_IJKRestore_CB { page_obj } { +#=============================================================================== + global mom_sys_arr + + UI_PB_tpth_DialogRestore_CB $page_obj + set mom_sys_arr(\$cir_vector) [join [split $mom_sys_arr(\$cir_ijk_opt) _] " "] +} + +#=============================================================================== +proc UI_PB_tpth_EditPlaneCodes { page_obj event_obj member_obj } { +#=============================================================================== + global mom_sys_arr + + set canvas_frame $Page::($page_obj,canvas_frame) + set win $canvas_frame.epc + + if {[winfo exists $win]} \ + { + raise $win + focus $win +return + } else { + toplevel $win + UI_PB_com_CreateTransientWindow $win "Circular Move -- Plane Codes" "" "" "" + } + + set mom_variables { \$mom_sys_cutcom_plane_code(XY) \ + \$mom_sys_cutcom_plane_code(YZ) \ + \$mom_sys_cutcom_plane_code(ZX)} + + foreach var $mom_variables \ + { + set rest_var($var) $mom_sys_arr($var) + } + set Page::($page_obj,rest_page_momvalues) [array get rest_var] + set Page::($page_obj,page_momvars) $mom_variables + + set top_frm [frame $win.top] + set bot_frm [frame $win.bot] + pack $top_frm -side top -fill x -padx 10 -pady 10 + pack $bot_frm -side bottom -fill x -padx 10 -pady 10 + + set plane_lbfrm [Page::CreateLblFrame $top_frm edt " Plane G Codes "] + pack $plane_lbfrm -pady 5 -padx 25 + set pln_frm [$plane_lbfrm subwidget frame] + + # Plane Codes + set xy_frm [frame $pln_frm.xy] + set yz_frm [frame $pln_frm.yz] + set zx_frm [frame $pln_frm.zx] + pack $xy_frm $yz_frm $zx_frm -anchor nw -padx 10 -pady 10 + + UI_PB_mthd_CreateLblEntry a \$mom_sys_cutcom_plane_code(XY) $xy_frm \ + int "XY Plane" + UI_PB_mthd_CreateLblEntry a \$mom_sys_cutcom_plane_code(YZ) $yz_frm \ + int "YZ Plane" + UI_PB_mthd_CreateLblEntry a \$mom_sys_cutcom_plane_code(ZX) $zx_frm \ + int "ZX Plane" + + UI_PB_tpth_DialogActionButtons $win $page_obj $bot_frm +} + +#=============================================================================== +proc UI_PB_tpth_DialogActionButtons { win page_obj action_frm } { +#=============================================================================== + global paOption + + # Bottom Frame + set box1_frm [frame $action_frm.box1] + set box2_frm [frame $action_frm.box2] + + tixForm $box1_frm -top 0 -left 3 -right %50 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 3 -right %100 + + set bb1 [tixButtonBox $box1_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + set bb2 [tixButtonBox $box2_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + $bb1 add def -text Default -width 10 -underline 0 \ + -command "UI_PB_tpth_DialogDefault_CB $page_obj" + $bb1 add res -text Restore -underline 0 -width 10 \ + -command "UI_PB_tpth_DialogRestore_CB $page_obj" + + $bb2 add cac -text Cancel -width 10 -underline 0 \ + -command "UI_PB_tpth_DialogCancel_CB $win $page_obj" + $bb2 add ok -text Ok -width 10 -underline 0 \ + -command "UI_PB_tpth_DialogOk_CB $win $page_obj" + pack $bb1 -fill x + pack $bb2 -fill x +} + +#=============================================================================== +proc UI_PB_tpth_DialogDefault_CB { page_obj } { +#=============================================================================== + global mom_sys_arr + set mom_var_list $Page::($page_obj,page_momvars) + + set count 0 + foreach var $mom_var_list \ + { + set mom_var_arr($count) $var + incr count + } + + PB_int_RetDefMOMVarValues mom_var_arr def_var_values + foreach var $mom_var_list \ + { + set mom_sys_arr($var) $def_var_values($var) + } +} + +#=============================================================================== +proc UI_PB_tpth_DialogRestore_CB { page_obj } { +#=============================================================================== + global mom_sys_arr + set mom_var_list $Page::($page_obj,page_momvars) + array set rest_var_values $Page::($page_obj,rest_page_momvalues) + + foreach var $mom_var_list \ + { + set mom_sys_arr($var) $rest_var_values($var) + } +} + +#=============================================================================== +proc UI_PB_tpth_DialogOk_CB { win page_obj } { +#=============================================================================== + global mom_sys_arr + set mom_var_list $Page::($page_obj,page_momvars) + + PB_int_UpdateMOMVar mom_sys_arr + foreach var $mom_var_list \ + { + set rest_var_values($var) $mom_sys_arr($var) + } + unset Page::($page_obj,rest_page_momvalues) + unset Page::($page_obj,page_momvars) + + destroy $win +} + +#=============================================================================== +proc UI_PB_tpth_DialogCancel_CB { win page_obj } { +#=============================================================================== + + UI_PB_tpth_DialogRestore_CB $page_obj + unset Page::($page_obj,rest_page_momvalues) + unset Page::($page_obj,page_momvars) + + destroy $win +} + +#=============================================================================== +proc UI_PB_tpth_ConfToolCode { page_obj event_obj member_obj } { +#=============================================================================== + global tixOption + global paOption + global mom_sys_arr + + set canvas_frame $Page::($page_obj,canvas_frame) + set win $canvas_frame.tlcd + + if {[winfo exists $win]} \ + { + raise $win + focus $win +return + } else { + toplevel $canvas_frame.tlcd + UI_PB_com_CreateTransientWindow $win "Tool Code Configuration" "" "" "" + } + + set mom_variables { \$tool_min_num \$tool_max_num \$tool_num_output} + foreach var $mom_variables \ + { + set rest_var($var) $mom_sys_arr($var) + } + set Page::($page_obj,rest_page_momvalues) [array get rest_var] + set Page::($page_obj,page_momvars) $mom_variables + + set top_frm [tixButtonBox $win.top -orientation horizontal \ + -bd 2 -relief sunken -bg gray85] + set mid_frm [frame $win.mid] + set bot_frm [frame $win.bot] + + pack $top_frm -side top -fill x -padx 10 -pady 10 + pack $mid_frm -padx 10 -pady 10 + pack $bot_frm -side bottom -fill x -padx 10 -pady 10 + + # Top Frame + button $top_frm.fmt -text "" -cursor "" \ + -font $tixOption(bold_font) \ + -bg darkSeaGreen3 -relief flat \ + -state disabled -disabledforeground lightYellow + grid $top_frm.fmt -row 1 -column 1 -pady 20 + + $top_frm.fmt configure -activebackground darkSeaGreen3 + + # Middle Frame + set tl_num_frm [Page::CreateLblFrame $mid_frm tlnum "Tool Number"] + set out_frm [Page::CreateLblFrame $mid_frm out "Output"] + + tixForm $tl_num_frm -top 10 -left %10 -right %90 -pady 5 -padx 25 + tixForm $out_frm -top $tl_num_frm -left &$tl_num_frm \ + -right &$tl_num_frm -pady 5 -padx 25 + + set tlsubfrm [$tl_num_frm subwidget frame] + set outsubfrm [$out_frm subwidget frame] + + # Tool Number + set lft_frm [frame $tlsubfrm.lft] + set rgh_frm [frame $tlsubfrm.rgt] + pack $lft_frm -side left + pack $rgh_frm -side right + + UI_PB_mthd_CreateIntControl \$tool_min_num $lft_frm int Minimum + UI_PB_mthd_CreateIntControl \$tool_max_num $rgh_frm int Maximum + + # Output + set frm1 [frame $outsubfrm.top] + set frm2 [frame $outsubfrm.mid] + set frm3 [frame $outsubfrm.bot] + pack $frm1 -anchor nw -pady 10 -padx 10 + pack $frm2 -anchor nw -pady 10 -padx 10 + pack $frm3 -anchor nw -pady 10 -padx 10 + UI_PB_mthd_CreateRadioButton \$tool_num_output $frm1 rad \ + "Tool Number Only" + $frm1.rad config -command "UI_PB_tpth_ChangeToolCodeOutput $top_frm" + UI_PB_mthd_CreateRadioButton \$tool_num_output $frm2 rad \ + "Tool Number And Length Offset Number" + $frm2.rad config -command "UI_PB_tpth_ChangeToolCodeOutput $top_frm" + UI_PB_mthd_CreateRadioButton \$tool_num_output $frm3 rad \ + "Length Offset Number And Tool Number" + $frm3.rad config -command "UI_PB_tpth_ChangeToolCodeOutput $top_frm" + + # Bottom Frame + set box1_frm [frame $bot_frm.box1] + set box2_frm [frame $bot_frm.box2] + + tixForm $box1_frm -top 0 -left 3 -right %50 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 3 -right %100 + + set bb1 [tixButtonBox $box1_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + set bb2 [tixButtonBox $box2_frm.bb -orientation horizontal \ + -relief sunken -bd 2 -bg $paOption(butt_bg)] + + $bb1 add def -text Default -width 10 -underline 0 \ + -command "UI_PB_tpth_ToolConfDefault $page_obj $top_frm" + $bb1 add res -text Restore -underline 0 -width 10 \ + -command "UI_PB_tpth_ToolConfRestore $page_obj $top_frm" + + $bb2 add cac -text Cancel -width 10 -underline 0 \ + -command "UI_PB_tpth_DialogCancel_CB $win $page_obj" + $bb2 add ok -text Ok -width 10 -underline 0 \ + -command "UI_PB_tpth_DialogOk_CB $win $page_obj" + pack $bb1 -fill x + pack $bb2 -fill x + + UI_PB_tpth_ChangeToolCodeOutput $top_frm +} + +#=============================================================================== +proc UI_PB_tpth_ChangeToolCodeOutput { top_frm } { +#=============================================================================== + global mom_sys_arr + + set button_widget $top_frm.fmt + + set tool_number 1 + set length_offset 1 + set toolnum_var "\$mom_tool_number" + set length_adjust "\$mom_tool_adjust_register" + + set toolnum_add [UI_PB_com_RetAddrOfMOMSysVar toolnum_var] + set tooloff_add [UI_PB_com_RetAddrOfMOMSysVar length_adjust] + + address::readvalue $toolnum_add toolnum_addr_attr + address::readvalue $tooloff_add tooloff_addr_attr + + format::readvalue $toolnum_addr_attr(1) toolnum_fmt_attr + format::readvalue $tooloff_addr_attr(1) tooloff_fmt_attr + + switch $mom_sys_arr(\$tool_num_output) \ + { + Tool_Number_Only \ + { + set inp_value 1 + } + + Tool_Number_And_Length_Offset_Number \ + { + set toolnum_fmt_attr(5) [expr $toolnum_fmt_attr(5) + \ + $tooloff_fmt_attr(5)] + set raise_p [expr $toolnum_fmt_attr(5) - 1] + set inp_value [expr [expr pow(10,$raise_p) * 1] + 2] + } + + Length_Offset_Number_And_Tool_Number \ + { + set toolnum_fmt_attr(5) [expr $toolnum_fmt_attr(5) + \ + $tooloff_fmt_attr(5)] + set raise_p [expr $toolnum_fmt_attr(5) - 1] + set inp_value [expr [expr pow(10,$raise_p) * 1] + 2] + + } + } + + PB_fmt_RetFmtOptVal toolnum_fmt_attr inp_value fmt_value + $top_frm.fmt configure -text $fmt_value +} + +#=============================================================================== +proc UI_PB_tpth_ToolConfDefault { page_obj top_frm } { +#=============================================================================== + UI_PB_tpth_DialogDefault_CB $page_obj + UI_PB_tpth_ChangeToolCodeOutput $top_frm +} + +#=============================================================================== +proc UI_PB_tpth_ToolConfRestore { page_obj top_frm } { +#=============================================================================== + UI_PB_tpth_DialogRestore_CB $page_obj + UI_PB_tpth_ChangeToolCodeOutput $top_frm +} + +#=============================================================================== +proc UI_PB_tpth_EditRapidBlocks { page_obj event_obj member_obj } { +#=============================================================================== + global mom_sys_arr + + set variable $group_member::($member_obj,mom_var) + set event_name $event::($event_obj,event_name) + set evt_elem_list $event::($event_obj,evt_elem_list) + + # Deletes the event attributes + UI_PB_tpth_DeleteTpthEventBlkAttr page_obj event_obj + UI_PB_tpth_SetPageAttributes page_obj + + set index 0 + set spin_blk 0 + set trav_blk 0 + foreach evt_elem_obj $evt_elem_list \ + { + set block_obj $event_element::($evt_elem_obj,block_obj) + set block_name $block::($block_obj,block_name) + switch $block_name \ + { + "rapid_traverse" { + set trav_blk $block_obj + set trav_index $index + } + "rapid_spindle" { + set spin_blk $block_obj + set spin_index $index + } + } + incr index + } + + if { $mom_sys_arr($variable) && $trav_blk != 0 } \ + { + set blk_obj_attr(0) "rapid_spindle" + foreach tra_elem_obj $block::($trav_blk,active_blk_elem_list) \ + { + set trav_elem_add $block_element::($tra_elem_obj,elem_add_obj) + set trav_add_name $address::($trav_elem_add,add_name) + if {[string compare $trav_add_name "Z"] == 0 || \ + [string compare $trav_add_name "H"] == 0 || \ + [string compare $trav_add_name "M_cool"] == 0} \ + { + lappend spin_blk_elem $tra_elem_obj + } else \ + { + lappend tra_blk_elem $tra_elem_obj + if {[string compare $trav_add_name "G_motion"] == 0} \ + { + PB_int_CreateBlkElemFromElemObj tra_elem_obj new_elem_obj \ + blk_obj_attr + lappend spin_blk_elem $new_elem_obj + set block_element::($new_elem_obj,owner) $event_name + } + } + } + set block::($trav_blk,active_blk_elem_list) $tra_blk_elem + PB_int_CreateNewBlock blk_obj_attr(0) spin_blk_elem event_name \ + new_blk_obj + set block::($new_blk_obj,active_blk_elem_list) $spin_blk_elem + set evt_elem_type "normal" + PB_int_CreateNewEventElement new_blk_obj evt_elem_type new_evt_elem_obj + lappend event::($event_obj,evt_elem_list) $new_evt_elem_obj + } elseif { $spin_blk } \ + { + foreach spin_blk_elem_obj $block::($spin_blk,active_blk_elem_list) \ + { + set spin_elem_add $block_element::($spin_blk_elem_obj,elem_add_obj) + set blk_exist_flag 0 + foreach tra_elem_obj $block::($trav_blk,active_blk_elem_list) \ + { + set trav_elem_add $block_element::($tra_elem_obj,elem_add_obj) + if {$trav_elem_add == $spin_elem_add} \ + { + set blk_exist_flag 1 + break + } + } + + if { !$blk_exist_flag } \ + { + lappend block::($trav_blk,active_blk_elem_list) $spin_blk_elem_obj + set blk_exist_flag 0 + } + } + + PB_int_RemoveBlkObjFrmList spin_blk + set evt_elem_list [lreplace $evt_elem_list $spin_index $spin_index] + set event::($event_obj,evt_elem_list) $evt_elem_list + } + + foreach evt_elem_obj $event::($event_obj,evt_elem_list) \ + { + set elem_blk_obj $event_element::($evt_elem_obj,block_obj) + # Sorts the block elements of a Block template + set active_blk_elem_list $block::($elem_blk_obj,active_blk_elem_list) + UI_PB_com_SortBlockElements active_blk_elem_list + set block::($elem_blk_obj,active_blk_elem_list) $active_blk_elem_list + unset active_blk_elem_list + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj elem_blk_obj + + # sets the origin of the block + set block::($elem_blk_obj,x_orig) $Page::($page_obj,x_orig) + set block::($elem_blk_obj,y_orig) $Page::($page_obj,y_orig) + UI_PB_tpth_CreateDividers page_obj elem_blk_obj + + # Creates the block elements + set block_owner $block::($elem_blk_obj,blk_owner) + set new_blk_elem_obj 0 + UI_PB_blk_CreateBlockCells page_obj elem_blk_obj new_blk_elem_obj \ + block_owner + set Page::($page_obj,y_orig) [expr \ + $Page::($page_obj,y_orig) + $Page::($page_obj,blk_blkdist)] + } +} + +#=============================================================================== +proc UI_PB_tpth_SetPageAttributes { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + + set Page::($page_obj,h_cell) 30 ;# cell height + set Page::($page_obj,w_cell) 62 ;# cell width + set Page::($page_obj,w_divi) 4 ;# divider width + set Page::($page_obj,x_orig) 80 ;# upper-left corner of 1st cell + set Page::($page_obj,y_orig) 30 + set Page::($page_obj,rect_region) 15 ;# Block rectangle region + set Page::($page_obj,add_blk) 0 + set Page::($page_obj,add_flag) 0 + set Page::($page_obj,icon_top) 0 + set Page::($page_obj,icon_bot) 0 + set Page::($page_obj,blk_blkdist) 60 + set Page::($page_obj,in_focus_elem) 0 + set Page::($page_obj,out_focus_elem) 0 + set Page::($page_obj,active_blk_elem) 0 + set Page::($page_obj,trash_flag) 0 + set Page::($page_obj,source_blk_elem_obj) 0 + set Page::($page_obj,source_evt_elem_obj) 0 +} + +#=============================================================================== +proc UI_PB_tpth_CreateHorzPane { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + set page_id $Page::($page_obj,page_id) + set pane [tixPanedWindow $page_id.pane -orient vertical] + pack $pane -expand yes -fill both + + set f1 [$pane add p1 -expand 1.5] + set f2 [$pane add p2 -expand 1] + + $f1 config -relief flat + $f2 config -relief flat + + set p1s [$pane subwidget p1] + set p1p [frame $p1s.pp] + pack $p1p -expand yes -fill both -pady 6 + + tixScrolledWindow $p1p.scr + [$p1p.scr subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$p1p.scr subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + pack $p1p.scr -padx 5 -expand yes -fill both + + set p1t [$p1p.scr subwidget window] + set top_frm [frame $p1t.f] + pack $top_frm -expand yes -fill both + set Page::($page_obj,canvas_frame) $top_frm + + set p2s [$pane subwidget p2] + set p2p [frame $p2s.pp] + set p3p [frame $p2p.bb] + pack $p2p -expand yes -fill both + pack $p3p -side bottom -expand yes -fill both + + tixScrolledWindow $p2p.scr + [$p2p.scr subwidget hsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + [$p2p.scr subwidget vsb] config -troughcolor $paOption(trough_bg) \ + -width $paOption(trough_wd) + pack $p2p.scr -padx 5 -pady 5 -expand yes -fill both + + set p2t [$p2p.scr subwidget window] + set sec_frm [frame $p2t.f] + pack $sec_frm -fill both -expand yes + set Page::($page_obj,param_frame) $sec_frm + + set Page::($page_obj,box_frame) $p3p +} + +#============================================================================== +proc UI_PB_tpth_ItemDrag1 {page_obj event_obj x y} { +#============================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + set top_canvas $Page::($page_obj,top_canvas) + set panel_hi $Page::($page_obj,panel_hi) + + # Icon in the component panel does not need to be + # manipulated when it goes too far out of the panel. + set xx [$top_canvas canvasx $x] + set yy [$top_canvas canvasy $y] + $top_canvas coords $Page::($page_obj,icon_top) $xx $yy + + set dx 1 + set dy [expr $panel_hi + 2] + set xx [$bot_canvas canvasx [expr $x + $dx]] + set yy [$bot_canvas canvasy [expr $y - $dy]] + $bot_canvas coords $Page::($page_obj,icon_bot) $xx $yy + + set sel_addr $Page::($page_obj,sel_base_addr) + UI_PB_tpth_HighlightSeperators $page_obj $event_obj \ + $sel_addr $xx $yy +} + +#=============================================================================== +proc UI_PB_tpth_UnHighLightSep { PAGE_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + global paOption + + set main_cell_color $paOption(can_bg) + set divi_color turquoise + set bot_canvas $Page::($page_obj,bot_canvas) + + switch $Page::($page_obj,add_flag) \ + { + + 1 { + $bot_canvas itemconfigure [lindex $Page::($page_obj,focus_rect) 0] \ + -outline $main_cell_color -fill $main_cell_color + $bot_canvas itemconfigure [lindex $Page::($page_obj,focus_rect) 1] \ + -outline $main_cell_color -fill $main_cell_color + $bot_canvas itemconfigure [lindex $Page::($page_obj,focus_rect) 2] \ + -outline $main_cell_color -fill $main_cell_color + unset Page::($page_obj,focus_rect) + } + 2 { + set act_blk_elem $Page::($page_obj,insert_elem) + $bot_canvas itemconfigure $block_element::($act_blk_elem,div_id) \ + -outline $divi_color -fill $divi_color + } + 3 { + set active_evt_elem $Page::($page_obj,active_evt_elem_obj) + set act_blk_obj $event_element::($active_evt_elem,block_obj) + $bot_canvas itemconfigure $block::($act_blk_obj,div_id) \ + -outline $divi_color -fill $divi_color + } + } + + if {[info exists Page::($page_obj,focus_sep)]} \ + { + $bot_canvas itemconfigure $Page::($page_obj,focus_sep) \ + -outline $main_cell_color -fill $main_cell_color + unset Page::($page_obj,focus_sep) + } +} + +#=============================================================================== +proc UI_PB_tpth_AddTextElemeToBlk { PAGE_OBJ EVENT_OBJ ADD_TO_EVT_ELEM_OBJ \ + NEW_ELEM_OBJ text_label } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + upvar $ADD_TO_EVT_ELEM_OBJ add_to_evt_elem_obj + upvar $NEW_ELEM_OBJ new_elem_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + set sel_base_addr $Page::($page_obj,sel_base_addr) + + # popup text window, if text element is added + UI_PB_com_CreateTextEntry page_obj new_elem_obj $text_label + tkwait window $bot_canvas.txtent + + if {[string compare $block_element::($new_elem_obj,elem_mom_variable) \ + "000"] != 0} \ + { + UI_PB_blk_ReplaceIcon page_obj $sel_base_addr $new_elem_obj + } else \ + { + set evt_elem_obj_list $event::($event_obj,evt_elem_list) + switch $Page::($page_obj,add_blk) \ + { + "row" { + set evt_elem_obj $add_to_evt_elem_obj + } + + "top" { + set elem_index [lsearch $evt_elem_obj_list \ + $add_to_evt_elem_obj] + set evt_elem_obj [lindex $evt_elem_obj_list \ + [expr $elem_index - 1]] + } + + "bottom" { + set elem_index [lsearch $evt_elem_obj_list \ + $add_to_evt_elem_obj] + set evt_elem_obj [lindex $evt_elem_obj_list \ + [expr $elem_index + 1]] + } + } + + set block_obj $event_element::($evt_elem_obj,block_obj) + set no_blk_elems [llength $block::($block_obj,active_blk_elem_list)] + set source_cell_num [lsearch $block::($block_obj,active_blk_elem_list) \ + $new_elem_obj] + + set no_event_elems [llength $event::($event_obj,evt_elem_list)] + set elem_index [lsearch $event::($event_obj,evt_elem_list) evt_elem_obj] + + if { $no_blk_elems > 1 || $elem_index == [expr $no_event_elems - 1]} \ + { + UI_PB_tpth_DeleteElemOfRow page_obj event_obj evt_elem_obj \ + source_cell_num + + } elseif { $no_blk_elems == 1} \ + { + UI_PB_tpth_DeleteARow page_obj event_obj evt_elem_obj + } + } +} + +#=============================================================================== +proc UI_PB_tpth_ItemEndDrag1 {page_obj event_obj x y } { +#=============================================================================== + set top_canvas $Page::($page_obj,top_canvas) + set bot_canvas $Page::($page_obj,bot_canvas) + + UI_PB_tpth_UnHighLightSep page_obj + + if {$Page::($page_obj,icon_top)} \ + { + $top_canvas delete $Page::($page_obj,icon_top) + set Page::($page_obj,icon_top) 0 + } + + if {$Page::($page_obj,icon_bot)} \ + { + $bot_canvas delete $Page::($page_obj,icon_bot) + set Page::($page_obj,icon_bot) 0 + } + + $Page::($page_obj,add) configure -relief raised \ + -background #c0c0ff + + if { $Page::($page_obj,add_blk) != 0} \ + { + set add_to_evt_elem_obj $Page::($page_obj,active_evt_elem_obj) + set new_elem_mom_var $Page::($page_obj,new_elem_mom_var) + set sel_base_addr $Page::($page_obj,sel_base_addr) + + # Creates new address + if { [string compare $sel_base_addr "New_Address"] == 0 } \ + { + set sel_base_addr "user_add" + set fmt_name "String" + PB_int_CreateNewAddress sel_base_addr fmt_name new_add_obj + } + + # Database call for creating a new block element + set add_to_blk_obj $event_element::($add_to_evt_elem_obj,block_obj) + PB_int_AddNewBlockElemObj sel_base_addr new_elem_mom_var \ + add_to_blk_obj new_elem_obj + set block_element::($new_elem_obj,owner) $event::($event_obj,event_name) + + switch $Page::($page_obj,add_blk) \ + { + "row" \ + { + UI_PB_tpth_AddBlkElemRow page_obj add_to_evt_elem_obj new_elem_obj + } + "top" \ + { + UI_PB_tpth_AddBlkElemTopOrBottom page_obj event_obj \ + add_to_evt_elem_obj new_elem_obj + } + "bottom" \ + { + UI_PB_tpth_AddBlkElemTopOrBottom page_obj event_obj \ + add_to_evt_elem_obj new_elem_obj + } + } + + # It is executed for text element only + if { [string compare $Page::($page_obj,sel_base_addr) "Text"] == 0} \ + { + UI_PB_tpth_AddTextElemeToBlk page_obj event_obj add_to_evt_elem_obj \ + new_elem_obj Text + } elseif { [string compare $Page::($page_obj,sel_base_addr) \ + "New_Address"] == 0} \ + { + UI_PB_blk_NewAddress page_obj event_obj add_to_evt_elem_obj \ + new_elem_obj event + } elseif { [string match "*User Defined*" \ + $block_element::($new_elem_obj,elem_desc)] } \ + { + UI_PB_tpth_AddTextElemeToBlk page_obj event_obj add_to_evt_elem_obj \ + new_elem_obj Expression + } + } + set Page::($page_obj,add_blk) 0 + set Page::($page_obj,add_flag) 0 + + # Restore cursor and focus + $top_canvas config -cursor "" + UI_PB_blk_ItemFocusOn1 $page_obj $x $y +} + +#=============================================================================== +proc UI_PB_tpth_AddBlkElemRow {PAGE_OBJ ADD_TO_EVT_ELEM_OBJ NEW_BLK_ELEM_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $ADD_TO_EVT_ELEM_OBJ add_to_evt_elem_obj + upvar $NEW_BLK_ELEM_OBJ new_blk_elem_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + if {$Page::($page_obj,active_blk_elem)} \ + { + set act_blk_elem_obj $Page::($page_obj,active_blk_elem) + set icon_id $block_element::($act_blk_elem_obj,icon_id) + set im [$bot_canvas itemconfigure $icon_id -image] + [lindex $im end] configure -relief raised \ + -background #c0c0ff + } + + # Checks the existance of the block element in the block template + # if the block element exists it gives out a error message and returns + set add_to_blk_obj $event_element::($add_to_evt_elem_obj,block_obj) + set new_blk_elem_add_obj $block_element::($new_blk_elem_obj,elem_add_obj) + set new_blk_elem_add_name $address::($new_blk_elem_add_obj,add_name) + set blk_elem_flag [UI_PB_com_CheckElemBlkTemplate add_to_blk_obj \ + new_blk_elem_add_name] + if {$blk_elem_flag} \ + { + UI_PB_com_DisplyErrorMssg new_blk_elem_add_name + return + } + + # Deletes all the existing cells and icons of a block + UI_PB_blk_DeleteCellsIcons page_obj add_to_blk_obj + + if { $Page::($page_obj,add_flag) == 1 || \ + $Page::($page_obj,add_flag) == 3 } \ + { + lappend block::($add_to_blk_obj,active_blk_elem_list) $new_blk_elem_obj + } else \ + { + set active_blk_elem_list $block::($add_to_blk_obj,active_blk_elem_list) + set insert_elem $Page::($page_obj,insert_elem) + set insert_indx [lsearch $active_blk_elem_list $insert_elem] + set active_blk_elem_list [linsert $active_blk_elem_list $insert_indx \ + $new_blk_elem_obj] + set block::($add_to_blk_obj,active_blk_elem_list) $active_blk_elem_list + unset active_blk_elem_list + } + + # Sorts the block elements of a Block template + set active_blk_elem_list $block::($add_to_blk_obj,active_blk_elem_list) + UI_PB_com_SortBlockElements active_blk_elem_list + set block::($add_to_blk_obj,active_blk_elem_list) $active_blk_elem_list + unset active_blk_elem_list + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj add_to_blk_obj + UI_PB_tpth_CreateDividers page_obj add_to_blk_obj + + # proc is called to create the block cells + set Page::($page_obj,x_orig) $block::($add_to_blk_obj,x_orig) + set Page::($page_obj,y_orig) $block::($add_to_blk_obj,y_orig) + set block_owner $block::($add_to_blk_obj,blk_owner) + UI_PB_blk_CreateBlockCells page_obj add_to_blk_obj new_blk_elem_obj \ + block_owner +} + +#=============================================================================== +proc UI_PB_tpth_AddBlkElemTopOrBottom { PAGE_OBJ EVENT_OBJ ADD_TO_EVT_ELEM_OBJ \ + NEW_BLK_ELEM_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + upvar $ADD_TO_EVT_ELEM_OBJ add_to_evt_elem_obj + upvar $NEW_BLK_ELEM_OBJ new_blk_elem_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + set event_name $event::($event_obj,event_name) + + set no_elems [llength $event::($event_obj,evt_elem_list)] + set elem_index [lsearch $event::($event_obj,evt_elem_list) \ + $add_to_evt_elem_obj] + + if {$Page::($page_obj,active_blk_elem)} \ + { + set act_blk_elem_obj $Page::($page_obj,active_blk_elem) + set icon_id $block_element::($act_blk_elem_obj,icon_id) + set im [$bot_canvas itemconfigure $icon_id -image] + [lindex $im end] configure -relief raised \ + -background #c0c0ff + } + + set elem_obj [lindex $event::($event_obj,evt_elem_list) $elem_index] + set add_to_blk_obj $event_element::($elem_obj,block_obj) + + if {![string compare $Page::($page_obj,add_blk) "bottom"]} \ + { + incr elem_index + } + + for {set count $elem_index} {$count < $no_elems} {incr count} \ + { + set del_elem [lindex $event::($event_obj,evt_elem_list) $count] + set del_blk $event_element::($del_elem,block_obj) + + # Deletes all the existing cells and icons of a block + UI_PB_blk_DeleteCellsIcons page_obj del_blk + + if {[info exists block::($del_blk,sep_id)]} \ + { + set bot_canvas $Page::($page_obj,bot_canvas) + $bot_canvas delete [lindex $block::($del_blk,sep_id) 0] + $bot_canvas delete [lindex $block::($del_blk,sep_id) 1] + unset block::($del_blk,sep_id) + } + } + + # Gets the unique block name + UI_PB_com_ReturnBlockName event_obj new_block_name + + # Creates a new block + PB_int_CreateNewBlock new_block_name new_blk_elem_obj \ + event_name new_block_obj + + # Creates a new event element + set evt_elem_type "normal" + PB_int_CreateNewEventElement new_block_obj evt_elem_type new_evt_elem + + # Appends new block element to the new block + lappend block::($new_block_obj,active_blk_elem_list) $new_blk_elem_obj + + set temp_evt_elem_list $event::($event_obj,evt_elem_list) + unset event::($event_obj,evt_elem_list) + + for {set count 0} {$count < $elem_index} {incr count} \ + { + lappend event::($event_obj,evt_elem_list) \ + [lindex $temp_evt_elem_list $count] + } + + lappend event::($event_obj,evt_elem_list) $new_evt_elem + + for {set count $elem_index} {$count < $no_elems} \ + {incr count} \ + { + lappend event::($event_obj,evt_elem_list) \ + [lindex $temp_evt_elem_list $count] + } + + if {$elem_index >= $no_elems} \ + { + set elem_obj [lindex $event::($event_obj,evt_elem_list) \ + [expr $elem_index - 1]] + set block_obj $event_element::($elem_obj,block_obj) + set Page::($page_obj,x_orig) $block::($block_obj,x_orig) + set Page::($page_obj,y_orig) [expr $block::($block_obj,y_orig) \ + + $Page::($page_obj,blk_blkdist)] + + } else \ + { + set elem_obj [lindex $event::($event_obj,evt_elem_list) \ + [expr $elem_index + 1]] + set block_obj $event_element::($elem_obj,block_obj) + set Page::($page_obj,x_orig) $block::($block_obj,x_orig) + set Page::($page_obj,y_orig) $block::($block_obj,y_orig) + } + incr no_elems + + for {set count $elem_index} {$count < $no_elems} \ + {incr count} \ + { + set elem_obj [lindex $event::($event_obj,evt_elem_list) $count] + set block_obj $event_element::($elem_obj,block_obj) + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + + # proc is called to create the block cells + set block::($block_obj,x_orig) $Page::($page_obj,x_orig) + set block::($block_obj,y_orig) $Page::($page_obj,y_orig) + UI_PB_tpth_CreateDividers page_obj block_obj + + if {$count == $elem_index} \ + { + set active_blk_elem $new_blk_elem_obj + } else \ + { + set active_blk_elem 0 + } + + UI_PB_blk_CreateBlockCells page_obj block_obj active_blk_elem \ + event_name + set Page::($page_obj,y_orig) \ + [expr $Page::($page_obj,y_orig) + $Page::($page_obj,blk_blkdist)] + } + set Page::($page_obj,active_blk_obj) $new_block_obj + set add_to_evt_elem_obj $new_evt_elem +} + +#=============================================================================== +proc UI_PB_tpth_HighLightTopSeperator { PAGE_OBJ EVT_ELEM_OBJ } { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVT_ELEM_OBJ evt_elem_obj + global paOption + + set block_obj $event_element::($evt_elem_obj,block_obj) + set bot_canvas $Page::($page_obj,bot_canvas) + set high_color $paOption(focus) + set sep_id [lindex $block::($block_obj,sep_id) 0] + $bot_canvas itemconfigure $sep_id \ + -outline $high_color -fill $high_color + set Page::($page_obj,focus_sep) $sep_id + set Page::($page_obj,active_evt_elem_obj) $evt_elem_obj + set Page::($page_obj,add_blk) "top" +} + +#=============================================================================== +proc UI_PB_tpth_HighLightCellDividers { PAGE_OBJ EVT_ELEM_OBJ xx yy} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVT_ELEM_OBJ evt_elem_obj + global paOption + + set high_color $paOption(focus) + set bot_canvas $Page::($page_obj,bot_canvas) + set block_obj $event_element::($evt_elem_obj,block_obj) + set rect_region $Page::($page_obj,rect_region) + + foreach blk_elem_obj $block::($block_obj,active_blk_elem_list) \ + { + if { $yy > [expr $block_element::($blk_elem_obj,div_corn_y0) - \ + $rect_region] && \ + $yy < [expr $block_element::($blk_elem_obj,div_corn_y1) + \ + $rect_region] && \ + $xx > [expr $block_element::($blk_elem_obj,div_corn_x0) - 10] && \ + $xx < [expr $block_element::($blk_elem_obj,div_corn_x1) + 10]} \ + { + $bot_canvas itemconfigure $block_element::($blk_elem_obj,div_id) \ + -fill $high_color -outline $high_color + set Page::($page_obj,active_evt_elem_obj) $evt_elem_obj + set Page::($page_obj,insert_elem) $blk_elem_obj + set Page::($page_obj,add_blk) row + set Page::($page_obj,add_flag) 2 + break + } else \ + { + set Page::($page_obj,add_blk) 0 + set Page::($page_obj,add_flag) 0 + } + } + + if {$Page::($page_obj,add_blk) == 0} \ + { + if { $yy > [expr $block::($block_obj,div_corn_y0) - \ + $rect_region] && \ + $yy < [expr $block::($block_obj,div_corn_y1) + \ + $rect_region] && \ + $xx > [expr $block::($block_obj,div_corn_x0) - 10] && \ + $xx < [expr $block::($block_obj,div_corn_x1) + 10]} \ + { + $bot_canvas itemconfigure $block::($block_obj,div_id) \ + -fill $high_color -outline $high_color + set Page::($page_obj,active_evt_elem_obj) $evt_elem_obj + set Page::($page_obj,add_blk) row + set Page::($page_obj,add_flag) 3 + } else \ + { + set Page::($page_obj,add_blk) 0 + set Page::($page_obj,add_flag) 0 + } + } +} + +#=============================================================================== +proc UI_PB_tpth_HighLightRow { PAGE_OBJ EVT_ELEM_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVT_ELEM_OBJ evt_elem_obj + global paOption + + set block_obj $event_element::($evt_elem_obj,block_obj) + set bot_canvas $Page::($page_obj,bot_canvas) + set high_color $paOption(focus) + set sep_id1 [lindex $block::($block_obj,sep_id) 0] + $bot_canvas itemconfigure $sep_id1 \ + -outline $high_color -fill $high_color + + set sep_id2 [lindex $block::($block_obj,sep_id) 1] + $bot_canvas itemconfigure $sep_id2 \ + -outline $high_color -fill $high_color + + $bot_canvas itemconfigure $block::($block_obj,rect) \ + -outline $high_color -fill $high_color + + lappend Page::($page_obj,focus_rect) $block::($block_obj,rect) \ + $sep_id1 $sep_id2 + set Page::($page_obj,active_evt_elem_obj) $evt_elem_obj + set Page::($page_obj,add_blk) "row" + set Page::($page_obj,add_flag) 1 +} + +#=============================================================================== +proc UI_PB_tpth_HighLightBottomSeperator { PAGE_OBJ EVT_ELEM_OBJ} { +#=============================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVT_ELEM_OBJ evt_elem_obj + global paOption + + set block_obj $event_element::($evt_elem_obj,block_obj) + set bot_canvas $Page::($page_obj,bot_canvas) + set high_color $paOption(focus) + set sep_id [lindex $block::($block_obj,sep_id) 1] + $bot_canvas itemconfigure $sep_id \ + -outline $high_color -fill $high_color + set Page::($page_obj,focus_sep) $sep_id + set Page::($page_obj,active_evt_elem_obj) $evt_elem_obj + set Page::($page_obj,add_blk) "bottom" +} + +#=============================================================================== +proc UI_PB_tpth_HighlightSeperators {page_obj event_obj sel_addr x y } { +#=============================================================================== + global paOption + set h_cell $Page::($page_obj,h_cell) + set w_divi $Page::($page_obj,w_divi) + set rect_region $Page::($page_obj,rect_region) + set high_color $paOption(focus) + set main_cell_color $paOption(can_bg) + set bot_canvas $Page::($page_obj,bot_canvas) + + set event_elem_list $event::($event_obj,evt_elem_list) + set event_name $event::($event_obj,event_name) + + UI_PB_tpth_UnHighLightSep page_obj + + set Page::($page_obj,add_flag) 0 + set Page::($page_obj,add_blk) 0 + + foreach elem_obj $event_elem_list \ + { + set block_obj $event_element::($elem_obj,block_obj) + set blk_x0 $block::($block_obj,x_orig) + set blk_y0 $block::($block_obj,y_orig) + set blk_height $block::($block_obj,blk_h) + set blk_width $block::($block_obj,blk_w) + + # Avoids highlighting the block seperatores of the blocks, which + # are not owned by the event + if {[string compare $event_name $block::($block_obj,blk_owner)] != 0} \ + { + set Page::($page_obj,add_blk) 0 + continue + } + + # It avoids highlighting the row and the two seperators, if there is + # is only one element in the block, and that itself is dragged. + if {$Page::($page_obj,source_evt_elem_obj) != 0} \ + { + set source_evt_elem_obj $Page::($page_obj,source_evt_elem_obj) + set source_blk_obj $event_element::($source_evt_elem_obj,block_obj) + if {[llength $block::($source_blk_obj,active_blk_elem_list)] \ + == 1 && $elem_obj == $source_evt_elem_obj} \ + { + set Page::($page_obj,add_blk) 0 + continue + } + } + + # This part of the code is for highlighting the top seperator of a block + if {$y > [expr $blk_y0 - $rect_region] && $y < $blk_y0 && \ + $x > [expr $blk_x0 - [expr 6 * $rect_region]] && \ + $x < [expr $blk_width + [expr 6 * $rect_region]]} \ + { + # To avoid highlighting the seperators, if there are no block elements + # in the page + if {$block::($block_obj,active_blk_elem_list) == ""} \ + { + set Page::($page_obj,add_blk) 0 + continue + } + UI_PB_tpth_HighLightTopSeperator page_obj elem_obj + break + # This part of the code is for highlighting the, row of a block + } elseif { $y >= $blk_y0 && $y <= $blk_height && \ + $x > [expr $blk_x0 - [expr 6 * $rect_region]] && \ + $x < [expr $blk_width + [expr 6 * $rect_region]]} \ + { + + # It does not hightlight the row of a block, when one of the + # block element is dragged. + if {$Page::($page_obj,source_evt_elem_obj) != 0 && \ + [string compare $sel_addr "Text"] != 0 } \ + { + set source_evt_elem_obj $Page::($page_obj,source_evt_elem_obj) + set source_blk_obj $event_element::($source_evt_elem_obj,block_obj) + if {$block_obj == $source_blk_obj} \ + { + set Page::($page_obj,add_blk) 0 + continue + } + } + if { [string compare $sel_addr "Text"] != 0} \ + { + UI_PB_tpth_HighLightRow page_obj elem_obj + } else \ + { + UI_PB_tpth_HighLightCellDividers page_obj elem_obj $x $y + } + break + # This part of the code is for highlighting the bottom seperator of a block + } elseif { $y > $blk_height && $y < [expr $blk_height + $rect_region] && \ + $x > [expr $blk_x0 - [expr 6 * $rect_region]] && \ + $x < [expr $blk_width + [expr 6 * $rect_region]]} \ + { + # To avoid highlighting the seperators, if there are no block elements + # in the page + if {$block::($block_obj,active_blk_elem_list) == ""} \ + { + set Page::($page_obj,add_blk) 0 + continue + } + UI_PB_tpth_HighLightBottomSeperator page_obj elem_obj + break + } else \ + { + set Page::($page_obj,add_blk) 0 + set Page::($page_obj,add_flag) 0 + } + } +} + +#======================================================================= +proc UI_PB_tpth_AddApplyDef {PAGE_OBJ SEQ_PAGE_OBJ SEQ_OBJ EVENT_OBJ } { +#======================================================================= + upvar $PAGE_OBJ page_obj + upvar $SEQ_PAGE_OBJ seq_page_obj + upvar $EVENT_OBJ event_obj + upvar $SEQ_OBJ seq_obj + global paOption + + pack forget $Page::($page_obj,box) + + # Template Button + set frame [frame $Page::($page_obj,box_frame).frm1] + pack $frame -side bottom -fill x -pady 5 -padx 3 + + set box1_frm [frame $frame.box1] + set box2_frm [frame $frame.box2] + + tixForm $box1_frm -top 0 -left 3 -right %60 -padright 20 + tixForm $box2_frm -top 0 -left $box1_frm -padx 3 -right %100 + + set box1 [tixButtonBox $box1_frm.resapp \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + + set box2 [tixButtonBox $box2_frm.okcan \ + -orientation horizontal \ + -bd 2 \ + -relief sunken \ + -bg $paOption(butt_bg)] + pack $box1 -fill x + pack $box2 -fill x + + # Box1 attributes + $box1 add res -text Default -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_tpth_DefaultCallBack $page_obj $event_obj" + $box1 add und -text Restore -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_tpth_RestoreCallBack $page_obj $event_obj" + $box1 add app -text Apply -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_tpth_ApplyCallBack $page_obj $seq_page_obj \ + $seq_obj $event_obj" + + # Box2 attributes + $box2 add canc -text Cancel -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_tpth_CancelCallBack $seq_page_obj $page_obj $event_obj" + $box2 add ok -text OK -width 10 \ + -bg $paOption(app_butt_bg) \ + -command "UI_PB_tpth_OkCallBack $page_obj $seq_page_obj \ + $seq_obj $event_obj" +} + +#============================================================================ +proc UI_PB_tpth_DeleteDummyBlock { PAGE_OBJ EVENT_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + if {$Page::($page_obj,dummy_blk)} \ + { + if {[llength $event::($event_obj,evt_elem_list)] == 1} \ + { + set evt_elem_obj [lindex $event::($event_obj,evt_elem_list) 0] + set block_obj $event_element::($evt_elem_obj,block_obj) + if {$block::($block_obj,active_blk_elem_list) == ""} \ + { + PB_int_RemoveBlkObjFrmList block_obj + set event::($event_obj,evt_elem_list) [lreplace \ + $event::($event_obj,evt_elem_list) 0 0] + } + } + } +} + +#============================================================================ +proc UI_PB_tpth_DeleteTpthBlock { SEQ_PAGE_OBJ EVENT_OBJ } { +#============================================================================ + upvar $SEQ_PAGE_OBJ seq_page_obj + upvar $EVENT_OBJ event_obj + + set bot_canvas $Page::($seq_page_obj,bot_canvas) + + if {[info exists event::($event_obj,blk_text)]} \ + { + $bot_canvas delete $event::($event_obj,blk_text) + } + + if {[info exists event::($event_obj,blk_rect)]} \ + { + $bot_canvas delete $event::($event_obj,blk_rect) + } + + # Deletes the line, that connect the event and block + if {[info exists event::($event_obj,extra_lines)]} \ + { + $bot_canvas delete $event::($event_obj,extra_lines) + } +} + +#============================================================================ +proc UI_PB_tpth_UnsetTpthEvtBlkAttr { EVENT_OBJ } { +#============================================================================ + upvar $EVENT_OBJ event_obj + + if {[info exists event::($event_obj,evt_elem_list)]} \ + { + foreach elem_obj $event::($event_obj,evt_elem_list) \ + { + set block_obj $event_element::($elem_obj,block_obj) + if {[info exists block::($block_obj,sep_id)]} \ + { + unset block::($block_obj,sep_id) + } + } + } +} + +#============================================================================ +proc UI_PB_UpdateSequenceEvent { SEQ_PAGE_OBJ SEQ_OBJ EVENT_OBJ} { +#============================================================================ + upvar $SEQ_PAGE_OBJ seq_page_obj + upvar $SEQ_OBJ seq_obj + upvar $EVENT_OBJ event_obj + + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + set updat_no_elems [llength $event::($event_obj,evt_elem_list)] + array set rest_evt_obj_attr $event::($event_obj,rest_value) + set act_no_elems [llength $rest_evt_obj_attr(2)] + unset rest_evt_obj_attr + + UI_PB_evt_CreateElemOfTpthEvent seq_page_obj seq_obj event_obj + + set current_evt_name $event::($event_obj,event_name) + PB_int_RetCycleComAndSharedEvts cycle_com_evt cycle_shared_evts + if {$act_no_elems != $updat_no_elems || \ + [string compare $current_evt_name $cycle_com_evt] == 0} \ + { + set active_evt_index [lsearch $sequence::($seq_obj,evt_obj_list) \ + $event_obj] + UI_PB_evt_TransformEvtElem seq_page_obj seq_obj active_evt_index + } + } +} + +#============================================================================ +proc UI_PB_tpth_OkCallBack { page_obj seq_page_obj seq_obj event_obj } { +#============================================================================ + global mom_sys_arr + global paOption + + UI_PB_tpth_DeleteDummyBlock page_obj event_obj + + if {$Page::($seq_page_obj,active_seq) == $seq_obj} \ + { + UI_PB_tpth_DeleteTpthBlock seq_page_obj event_obj + } + + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + array set event_rest_data $event::($event_obj,rest_value) + foreach elem_obj $event::($event_obj,evt_elem_list)\ + { + set blk_obj $event_element::($elem_obj,block_obj) + if {[info exists block::($blk_obj,active_blk_elem_list)]} \ + { + set block::($blk_obj,elem_addr_list) \ + $block::($blk_obj,active_blk_elem_list) + unset block::($blk_obj,active_blk_elem_list) + set evt_elem_index [lsearch $event_rest_data(2) $elem_obj] + if { $evt_elem_index == -1 } \ + { + block::readvalue $blk_obj blk_obj_attr + block::DefaultValue $blk_obj blk_obj_attr + unset blk_obj_attr + } + } else \ + { + set block::($blk_obj,elem_addr_list) "" + } + } + } + + PB_int_UpdateMOMVar mom_sys_arr + if {[string compare $event::($event_obj,event_name) "Cycle Set"] == 0} \ + { + # Deletes the post blocks and post elements + UI_PB_tpth_DeletePostBlocks event_obj + + # Adds post blocks + PB_int_CreateCyclePostBlks event_obj + } + destroy $Page::($page_obj,win) + set bot_canvas $Page::($seq_page_obj,bot_canvas) + set evt_img_id $event::($event_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $evt_img_id -image] end] + if { $img != "" } \ + { + $img config -relief raised -bg $paOption(event) + } + + UI_PB_tpth_UpdateCycleEvent event_obj seq_obj + if {$Page::($seq_page_obj,active_seq) == $seq_obj} \ + { + UI_PB_UpdateSequenceEvent seq_page_obj seq_obj event_obj + } + UI_PB_tpth_UnsetTpthEvtBlkAttr event_obj + set event::($event_obj,event_open) 0 + UI_PB_tpth_ReleaseSeqPageGrab $seq_page_obj $page_obj +} + +#============================================================================ +proc UI_PB_tpth_CancelCallBack { seq_page_obj page_obj event_obj } { +#============================================================================ + global mom_sys_arr + global paOption + + # Replaces the event run time data with restore data + array set rest_evt_obj_attr $event::($event_obj,rest_value) + event::setvalue $event_obj rest_evt_obj_attr + + # Replaces the element run time data with restore data + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + foreach elem_obj $event::($event_obj,evt_elem_list)\ + { + set blk_obj $event_element::($elem_obj,block_obj) + if {[info exists block::($blk_obj,active_blk_elem_list)]} \ + { + unset block::($blk_obj,active_blk_elem_list) + } + # Event element data + array set rest_elem_obj_attr $event_element::($elem_obj,rest_value) + event_element::setvalue $elem_obj rest_elem_obj_attr + + # Block data + array set rest_blk_obj_attr $block::($blk_obj,rest_value) + block::setvalue $blk_obj rest_blk_obj_attr + + # Block Element data + foreach blk_elem_obj $block::($blk_obj,elem_addr_list) \ + { + array set blk_elem_attr $block_element::($blk_elem_obj,rest_value) + block_element::setvalue $blk_elem_obj blk_elem_attr + unset blk_elem_attr + } + } + } + + if {[info exist Page::($page_obj,rest_evt_mom_var)]} \ + { + array set rest_evt_mom_var $Page::($page_obj,rest_evt_mom_var) + array set evt_mom_var $Page::($page_obj,evt_mom_var_list) + set no_vars [array size evt_mom_var] + for {set count 0} {$count < $no_vars} {incr count} \ + { + set mom_var $evt_mom_var($count) + set mom_sys_arr($mom_var) $rest_evt_mom_var($mom_var) + } + } + + # Destroy the Event window + destroy $Page::($page_obj,win) + + set bot_canvas $Page::($seq_page_obj,bot_canvas) + set evt_img_id $event::($event_obj,icon_id) + set img [lindex [$bot_canvas itemconfigure $evt_img_id -image] end] + if { $img != "" } \ + { + $img config -relief raised -bg $paOption(event) + } + + # Release the Sequence page grab when necessary. + UI_PB_tpth_ReleaseSeqPageGrab $seq_page_obj $page_obj + set event::($event_obj,event_open) 0 +} + +#============================================================================ +proc UI_PB_tpth_ReleaseSeqPageGrab { seq_page_obj page_obj } { +#============================================================================ + # Find the index of the Event name in the list + set event_name $Page::($page_obj,event_name) + set idx [lsearch $Page::($seq_page_obj,event_list) $event_name] + + # Delete this Event from the list + if {$idx >= 0} \ + { + set Page::($seq_page_obj,event_list) \ + [lreplace $Page::($seq_page_obj,event_list) $idx $idx] + } + + # Release the grabbing on the Sequence page when no Event window is open. + if {![llength $Page::($seq_page_obj,event_list)]} \ + { +# UI_PB_tpth_UnLockBookPages + } +} + +#=============================================================================== +proc UI_PB_tpth_UnLockBookPages { } { +#=============================================================================== + global gPB + + set pb_book_id $Book::($gPB(book),book_id) + + $pb_book_id pageconfig mac -state normal + $pb_book_id pageconfig pro -state normal + $pb_book_id pageconfig def -state normal + $pb_book_id pageconfig lis -state normal + $pb_book_id pageconfig pre -state normal + $pb_book_id pageconfig adv -state normal + + set pb_book_page_list $Book::($gPB(book),page_obj_list) + set prg_tpth_page [lindex $pb_book_page_list 1] + set prg_tpth_book $Page::($prg_tpth_page,book_obj) + set prg_tpth_book_id $Book::($prg_tpth_book,book_id) + + $prg_tpth_book_id pageconfig prog -state normal + $prg_tpth_book_id pageconfig gcod -state normal + $prg_tpth_book_id pageconfig mcod -state normal + $prg_tpth_book_id pageconfig asum -state normal + $prg_tpth_book_id pageconfig wseq -state normal +} + +#============================================================================ +proc UI_PB_tpth_DeleteTpthEventBlkAttr { PAGE_OBJ EVENT_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + foreach evt_elem_obj $event::($event_obj,evt_elem_list) \ + { + # Deletes the existing blk elements + set block_obj $event_element::($evt_elem_obj,block_obj) + UI_PB_blk_DeleteCellsIcons page_obj block_obj + if {[info exists block::($block_obj,sep_id)]} \ + { + $bot_canvas delete [lindex $block::($block_obj,sep_id) 0] + $bot_canvas delete [lindex $block::($block_obj,sep_id) 1] + unset block::($block_obj,sep_id) + } + } + } +} + +#============================================================================ +proc UI_PB_tpth_DefaultCallBack { page_obj event_obj } { +#============================================================================ + global mom_sys_arr + + # Deletes the block attributes of a tool path event + UI_PB_tpth_DeleteTpthEventBlkAttr page_obj event_obj + + array set evt_obj_attr $event::($event_obj,def_value) + event::setvalue $event_obj evt_obj_attr + + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + foreach elem_obj $event::($event_obj,evt_elem_list) \ + { + array set evt_elem_obj_attr $event_element::($elem_obj,def_value) + event_element::setvalue $elem_obj evt_elem_obj_attr + unset evt_elem_obj_attr + + set block_obj $event_element::($elem_obj,block_obj) + array set blk_obj_attr $block::($block_obj,def_value) + block::setvalue $block_obj blk_obj_attr + unset blk_obj_attr + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + array set blk_elem_attr $block_element::($blk_elem_obj,def_value) + block_element::setvalue $blk_elem_obj blk_elem_attr + unset blk_elem_attr + } + } + } + + set Page::($page_obj,dummy_blk) 0 + UI_PB_tpth_CreateElemObjects page_obj event_obj + + # Recreates the event block elements + UI_PB_tpth_CreateEventBlockTemplates page_obj event_obj + + # Sets the default values to the global variable + array set evt_mom_var $Page::($page_obj,evt_mom_var_list) + PB_int_RetDefMOMVarValues evt_mom_var def_val_mom_var + set no_vars [array size evt_mom_var] + for {set count 0} {$count < $no_vars} {incr count} \ + { + set mom_var $evt_mom_var($count) + if {[string match \$mom* $mom_var]} \ + { + set data_type [UI_PB_com_RetSysVarDataType mom_var] + set mom_sys_arr($mom_var) [UI_PB_com_RetValByDataType \ + $def_val_mom_var($mom_var) $data_type] + } + } +} + +#============================================================================ +proc UI_PB_tpth_RestoreCallBack { page_obj event_obj } { +#============================================================================ + global mom_sys_arr + + # Deletes the block attributes of a tool path event + UI_PB_tpth_DeleteTpthEventBlkAttr page_obj event_obj + + array set evt_obj_attr $event::($event_obj,rest_value) + event::setvalue $event_obj evt_obj_attr + + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + foreach elem_obj $event::($event_obj,evt_elem_list) \ + { + array set evt_elem_obj_attr $event_element::($elem_obj,rest_value) + event_element::setvalue $elem_obj evt_elem_obj_attr + unset evt_elem_obj_attr + + set block_obj $event_element::($elem_obj,block_obj) + array set blk_obj_attr $block::($block_obj,rest_value) + block::setvalue $block_obj blk_obj_attr + unset blk_obj_attr + + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + array set blk_elem_attr $block_element::($blk_elem_obj,rest_value) + block_element::setvalue $blk_elem_obj blk_elem_attr + unset blk_elem_attr + } + } + } + + if {[info exist Page::($page_obj,rest_evt_mom_var)]} \ + { + array set rest_evt_mom_var $Page::($page_obj,rest_evt_mom_var) + array set evt_mom_var $Page::($page_obj,evt_mom_var_list) + set no_vars [array size evt_mom_var] + for {set count 0} {$count < $no_vars} {incr count} \ + { + set mom_var $evt_mom_var($count) + if {[string match \$mom* $mom_var]} \ + { + set data_type [UI_PB_com_RetSysVarDataType mom_var] + set mom_sys_arr($mom_var) [UI_PB_com_RetValByDataType \ + $rest_evt_mom_var($mom_var) $data_type] + } + } + } + + # Recreates the event block elements + UI_PB_tpth_CreateEventBlockTemplates page_obj event_obj +} + +#============================================================================ +proc UI_PB_tpth_ValidateEventUIData { EVENT_OBJ } { +#============================================================================ + upvar $EVENT_OBJ event_obj + + foreach item_obj $event::($event_obj,evt_itm_obj_list) \ + { + foreach grp_obj $item::($item_obj,grp_obj_list) \ + { + foreach mem_obj $item_group::($grp_obj,mem_obj_list) \ + { + group_member::readvalue $mem_obj mem_obj_attr + UI_PB_com_ValidateData mem_obj_attr(2) mem_obj_attr(3) ret_code + if { $ret_code} \ + { + tk_messageBox -type ok -icon error \ + -message "Invalid data has been keyed in for the parameter \ + $mem_obj_attr(0)" + return 1 + } + } + } + } + return 0 +} + +#============================================================================ +proc UI_PB_tpth_UpdateEventFloats { EVENT_OBJ MOM_SYS_ARR } { +#============================================================================ + upvar $EVENT_OBJ event_obj + upvar $MOM_SYS_ARR mom_sys_arr + + foreach item_obj $event::($event_obj,evt_itm_obj_list) \ + { + foreach grp_obj $item::($item_obj,grp_obj_list) \ + { + foreach mem_obj $item_group::($grp_obj,mem_obj_list) \ + { + group_member::readvalue $mem_obj mem_obj_attr + if {$mem_obj_attr(1) == 5} \ + { + append var1 $mem_obj_attr(3) _int + append var2 $mem_obj_attr(3) _dec + append value $mom_sys_arr($var1) . $mom_sys_arr($var2) + set mom_sys_arr($mem_obj_attr(3)) $value + unset var1 var2 value + } + } + } + } +} + +#============================================================================ +proc UI_PB_tpth_ApplyCallBack { page_obj seq_page_obj seq_obj event_obj } { +#============================================================================ + global mom_sys_arr + + UI_PB_tpth_DeleteTpthBlock seq_page_obj event_obj + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + array set event_rest_data $event::($event_obj,rest_value) + foreach elem_obj $event::($event_obj,evt_elem_list)\ + { + set blk_obj $event_element::($elem_obj,block_obj) + if {[info exist block::($blk_obj,active_blk_elem_list)]} \ + { + set block::($blk_obj,elem_addr_list) \ + $block::($blk_obj,active_blk_elem_list) + set evt_elem_index [lsearch $event_rest_data(2) $elem_obj] + if { $evt_elem_index == -1 } \ + { + block::readvalue $blk_obj blk_obj_attr + block::DefaultValue $blk_obj blk_obj_attr + unset blk_obj_attr + } + } else \ + { + set block::($blk_obj,elem_addr_list) "" + } + } + } + + PB_int_UpdateMOMVar mom_sys_arr + if {[string compare $event::($event_obj,event_name) "Cycle Set"] == 0} \ + { + UI_PB_tpth_UpdateCycleSetEvent page_obj event_obj + } else \ + { + UI_PB_tpth_DeleteAndRecreateIcons page_obj event_obj + } + + UI_PB_tpth_UpdateCycleEvent event_obj seq_obj + if { $Page::($seq_page_obj,active_seq) == $seq_obj} \ + { + UI_PB_UpdateSequenceEvent seq_page_obj seq_obj event_obj + } + set Page::($page_obj,active_blk_elem) 0 + + # Restores the event data + UI_PB_tpth_RestoreEventData page_obj event_obj +} + +#============================================================================ +proc UI_PB_tpth_UpdateCycleSetEvent { PAGE_OBJ EVENT_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + # Deletes the block attributes of a tool path event + UI_PB_tpth_DeleteTpthEventBlkAttr page_obj event_obj + + # Deletes the post blocks and post elements + UI_PB_tpth_DeletePostBlocks event_obj + + # Adds post blocks + PB_int_CreateCyclePostBlks event_obj + + # Creates the block templates + UI_PB_tpth_CreateEventBlockTemplates page_obj event_obj +} + +#========================================================================== +proc UI_PB_tpth_DeletePostBlocks { EVENT_OBJ } { +#========================================================================== + upvar $EVENT_OBJ event_obj + + foreach evt_elem_obj $event::($event_obj,evt_elem_list) \ + { + set block_obj $event_element::($evt_elem_obj,block_obj) + if {[string compare $block::($block_obj,blk_owner) "post"] == 0} \ + { + continue + } + + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + if {[string compare $block_element::($blk_elem_obj,owner) "post"] == 0 \ + && [string compare $block_element::($blk_elem_obj,elem_mom_variable) \ + "\$mom_sys_cycle_reps_code"] != 0} \ + { + continue + } + lappend blk_elem_list $blk_elem_obj + } + + if {[info exists blk_elem_list]} \ + { + set block::($block_obj,elem_addr_list) $blk_elem_list + unset blk_elem_list + } + lappend evt_elem_list $evt_elem_obj + } + + if {[info exists evt_elem_list]} \ + { + set event::($event_obj,evt_elem_list) $evt_elem_list + unset evt_elem_list + } +} + +#============================================================================ +proc UI_PB_tpth_CreateRapidToBlock { EVENT_OBJ } { +#============================================================================ + upvar $EVENT_OBJ event_obj + global mom_sys_arr + + switch $mom_sys_arr(\$cycle_rapto_opt) \ + { + "None" { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "R" { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr {"R"} + set add_rep_blk_var {"$mom_cycle_rapid_to_pos(2)"} + } + + "G00_X_Y_&_R" { + set elem_address {{"G_motion" "X" "Y"}} + set elem_mom_var {{"$mom_sys_rapid_code" "$mom_pos(0)" \ + "$mom_pos(1)"}} + set add_rep_blk_addr {"R"} + set add_rep_blk_var {"$mom_cycle_rapid_to_pos(2)"} + } + + "G00_X_Y_Z" { + set elem_address {{"G_motion" "X" "Y"} {"Z"}} + set elem_mom_var {{"$mom_sys_rapid_code" "$mom_pos(0)" \ + "$mom_pos(1)"} {"$mom_pos(2)"}} + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + default { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + } + + + # Creates new post objects based upon the selected option + UI_PB_tpth_CreatePostBlock event_obj elem_address elem_mom_var \ + evt_elem_list + + if {[info exists evt_elem_list]} \ + { + foreach evt_elem_obj $event::($event_obj,evt_elem_list) \ + { + lappend evt_elem_list $evt_elem_obj + } + set event::($event_obj,evt_elem_list) $evt_elem_list + unset evt_elem_list + } + + # Adds the new post element to the representive block + UI_PB_tpth_AddPostElementToBlock event_obj add_rep_blk_addr \ + add_rep_blk_var +} + +#============================================================================ +proc UI_PB_tpth_CreatePostBlock { EVENT_OBJ ELEM_ADDRESS ELEM_MOM_VAR \ + EVT_ELEM_LIST } { +#============================================================================ + upvar $EVENT_OBJ event_obj + upvar $ELEM_ADDRESS elem_address + upvar $ELEM_MOM_VAR elem_mom_var + upvar $EVT_ELEM_LIST evt_elem_list + + if {$elem_address != ""} \ + { + set no_blks [llength $elem_address] + for {set ii 0} {$ii < $no_blks} {incr ii} \ + { + set blk_obj [new block] + set blk_elem_adds [lindex $elem_address $ii] + set blk_elem_vars [lindex $elem_mom_var $ii] + set no_of_elems [llength $blk_elem_adds] + for {set jj 0} {$jj < $no_of_elems} {incr jj} \ + { + set add_name [lindex $blk_elem_adds $jj] + set mom_var [lindex $blk_elem_vars $jj] + PB_int_AddNewBlockElemObj add_name mom_var blk_obj \ + new_elem_obj + lappend blk_elem_obj_list $new_elem_obj + set block_element::($new_elem_obj,owner) "post" + } + set blk_obj_attr(0) "post_rapid_$ii" + set blk_obj_attr(1) [llength $blk_elem_obj_list] + set blk_obj_attr(2) $blk_elem_obj_list + block::setvalue $blk_obj blk_obj_attr + set block::($blk_obj,blk_owner) "post" + unset blk_obj_attr + unset blk_elem_obj_list + set evt_elem_obj_attr(0) "post_rapid_$ii" + set evt_elem_obj_attr(1) $blk_obj + set evt_elem_obj_attr(2) "normal" + set evt_elem_obj [new event_element] + event_element::setvalue $evt_elem_obj evt_elem_obj_attr + unset evt_elem_obj_attr + lappend evt_elem_list $evt_elem_obj + } + } +} + +#============================================================================ +proc UI_PB_tpth_AddPostElementToBlock { EVENT_OBJ ADD_REP_BLK_ADDR \ + ADD_REP_BLK_VAR } { +#============================================================================ + upvar $EVENT_OBJ event_obj + upvar $ADD_REP_BLK_ADDR add_rep_blk_addr + upvar $ADD_REP_BLK_VAR add_rep_blk_var + + if {$add_rep_blk_addr != ""} \ + { + foreach evt_elem_obj $event::($event_obj,evt_elem_list) \ + { + set cyc_block_obj $event_element::($evt_elem_obj,block_obj) + set ret [UI_PB_tpth_CheckCycleRefWord cyc_block_obj] + if {$ret == 1} { break } + } + + set no_of_elems [llength $add_rep_blk_addr] + for {set jj 0} {$jj < $no_of_elems} {incr jj} \ + { + set blk_elem_add [lindex $add_rep_blk_addr $jj] + set blk_elem_var [lindex $add_rep_blk_var $jj] + PB_int_AddNewBlockElemObj blk_elem_add blk_elem_var cyc_block_obj \ + new_elem_obj + set block_element::($new_elem_obj,owner) "post" + lappend block::($cyc_block_obj,elem_addr_list) $new_elem_obj + } + } +} + +#============================================================================ +proc UI_PB_tpth_CreateRetractToBlock { EVENT_OBJ } { +#============================================================================ + upvar $EVENT_OBJ event_obj + global mom_sys_arr + + switch $mom_sys_arr(\$cycle_recto_opt) \ + { + "None" { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "K" { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr {"K_cycle"} + set add_rep_blk_var {"$mom_cycle_retract_to"} + } + + "G98/G99" { + set elem_address {{"G_return"}} + set elem_mom_var {{"$mom_sys_canned_cyc_ret_plane"}} + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "Rapid_Z_Move" { + set elem_address {{"G_motion" "Z"}} + set elem_mom_var {{"$mom_sys_rapid_code" "$mom_cycle_retract_to"}} + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "Cycle_Off_then_Rapid_Z_Move" { + set elem_address {{"G_motion"} {"G_motion" "Z"}} + set elem_mom_var {{"$mom_sys_cycle_off"} \ + {"$mom_sys_rapid_code" "$mom_cycle_retract_to"}} + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + default { + set elem_address "" + set elem_mom_var "" + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + } + + # Creates new post objects based upon the selected option + UI_PB_tpth_CreatePostBlock event_obj elem_address elem_mom_var \ + evt_elem_list + + if {[info exists evt_elem_list]} \ + { + foreach evt_elem_obj $evt_elem_list \ + { + lappend event::($event_obj,evt_elem_list) $evt_elem_obj + } + unset evt_elem_list + } + + # Adds the new post element to the representive block + UI_PB_tpth_AddPostElementToBlock event_obj add_rep_blk_addr \ + add_rep_blk_var +} + +#============================================================================ +proc UI_PB_tpth_CreateCycleStartBlock { EVENT_OBJ } { +#============================================================================ + upvar $EVENT_OBJ event_obj + global mom_sys_arr + + switch $mom_sys_arr(\$cycle_start_blk) \ + { + "None" { + set elem_address "" + set elem_mom_var "" + } + + "G79_X_Y_Z" { + set elem_address {{"G_motion" "X" "Y" "Z"}} + set elem_mom_var {{"$mom_sys_cycle_start_code" "$mom_pos(0)" \ + "$mom_pos(1)" "$mom_pos(2)"}} + } + } + + # Creates new post objects based upon the selected option + UI_PB_tpth_CreatePostBlock event_obj elem_address elem_mom_var \ + evt_elem_list + + if {[info exists evt_elem_list]} \ + { + foreach evt_elem_obj $evt_elem_list \ + { + lappend event::($event_obj,evt_elem_list) $evt_elem_obj + } + unset evt_elem_list + } +} + +#============================================================================ +proc UI_PB_tpth_CreateCyclePlaneBlock { EVENT_OBJ } { +#============================================================================ + upvar $EVENT_OBJ event_obj + global mom_sys_arr + + switch $mom_sys_arr(\$cycle_plane_control_opt) \ + { + "None" { + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "G17_/_G18_/_G19" { + set add_rep_blk_addr {"G_plane"} + set add_rep_blk_var {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)"} + } + + "G81_/_G181_/_G281" { + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + + "R_/_R'_R''" { + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + default { + set add_rep_blk_addr "" + set add_rep_blk_var "" + } + } + + # Adds the new post element to the representive block + UI_PB_tpth_AddPostElementToBlock event_obj add_rep_blk_addr \ + add_rep_blk_var +} + +#============================================================================ +proc UI_PB_tpth_DeleteComEvtBlkElems { CYC_EVT_OBJ COM_EVT_NAME } { +#============================================================================ + upvar $CYC_EVT_OBJ cyc_evt_obj + upvar $COM_EVT_NAME com_evt_name + + foreach cyc_evt_elem_obj $event::($cyc_evt_obj,evt_elem_list)\ + { + set cyc_blk_obj $event_element::($cyc_evt_elem_obj,block_obj) + set blk_elem_list $block::($cyc_blk_obj,elem_addr_list) + + # Gets the index of all the common elements + set index 0 + foreach blk_elem_obj $blk_elem_list \ + { + set blk_elem_owner $block_element::($blk_elem_obj,owner) + if { [string compare $blk_elem_owner $com_evt_name] == 0} \ + { + # deletes the block element object + } else \ + { + lappend new_blk_elem_list $blk_elem_obj + } + incr index + } + + if {[info exists new_blk_elem_list]} \ + { + set block::($cyc_blk_obj,elem_addr_list) $new_blk_elem_list + unset new_blk_elem_list + } else \ + { + set block::($cyc_blk_obj,elem_addr_list) "" + } + } + + # Deletes the event elements which has got null block elements + foreach cyc_evt_elem_obj $event::($cyc_evt_obj,evt_elem_list)\ + { + set blk_obj $event_element::($cyc_evt_elem_obj,block_obj) + if {[string compare $block::($blk_obj,elem_addr_list) ""] != 0}\ + { + lappend new_cyc_evt_elems $cyc_evt_elem_obj + } + } + + if {[info exists new_cyc_evt_elems]} \ + { + set event::($cyc_evt_obj,evt_elem_list) $new_cyc_evt_elems + unset new_cyc_evt_elems + } else \ + { + set event::($cyc_evt_obj,evt_elem_list) "" + } +} + +#============================================================================ +proc UI_PB_tpth_AddComBlkElemToBlk { COM_BLK_OBJ ADD_BLK_ELEM_LIST \ + CUR_EVT_NAME DUP_ADDR_FLAG } { +#============================================================================ + upvar $COM_BLK_OBJ com_blk_obj + upvar $ADD_BLK_ELEM_LIST add_blk_elem_list + upvar $CUR_EVT_NAME cur_evt_name + upvar $DUP_ADDR_FLAG dup_addr_flag + + block::readvalue $com_blk_obj blk_obj_attr + + foreach blk_elem_obj $block::($com_blk_obj,elem_addr_list) \ + { + if {$dup_addr_flag} \ + { + set blk_elem_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + if {[string match "\$mom_sys_cycle*" $blk_elem_mom_var]} \ + { + continue + } + } + block_element::readvalue $blk_elem_obj blk_elem_attr + PB_blk_CreateBlkElemObj blk_elem_attr new_blk_elem \ + blk_obj_attr + lappend add_blk_elem_list $new_blk_elem + set block_element::($new_blk_elem,owner) $cur_evt_name + unset blk_elem_attr + } +} + +#============================================================================ +proc UI_PB_tpth_CheckCycleRefWord { BLOCK_OBJ } { +#============================================================================ + upvar $BLOCK_OBJ block_obj + + if {[string compare $block::($block_obj,blk_owner) "post"] == 0} \ + { + return 0 + } + + foreach blk_elem_obj $block::($block_obj,elem_addr_list) \ + { + set blk_elem_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + if {[string match "\$mom_sys_cycle*" $blk_elem_mom_var]}\ + { + return 1 + } + } + return 0 +} + +#============================================================================ +proc UI_PB_tpth_CreateEvtElemFrmEvtObj { EVT_ELEM_OBJ NEW_EVT_ELEM_OBJ \ + EVENT_NAME } { +#============================================================================ + upvar $EVT_ELEM_OBJ evt_elem_obj + upvar $NEW_EVT_ELEM_OBJ new_evt_elem_obj + upvar $EVENT_NAME current_evt_name + + # Adds the common elements to the block + set blk_obj $event_element::($evt_elem_obj,block_obj) + set new_block_name $block::($blk_obj,block_name) + + # Creates a new block + set dup_addr 0 + UI_PB_tpth_AddComBlkElemToBlk blk_obj cyc_elem_addr_list \ + current_evt_name dup_addr + + set new_block_obj [new block] + set blk_obj_attr(0) $new_block_name + set blk_obj_attr(1) [llength $cyc_elem_addr_list] + set blk_obj_attr(2) $cyc_elem_addr_list + block::setvalue $new_block_obj blk_obj_attr + block::DefaultValue $new_block_obj blk_obj_attr + unset blk_obj_attr + + set new_evt_elem_obj [new event_element] + set evt_elem_attr(0) $new_block_name + set evt_elem_attr(1) $new_block_obj + set evt_elem_attr(2) "normal" + event_element::setvalue $new_evt_elem_obj evt_elem_attr + event_element::DefaultValue $new_evt_elem_obj evt_elem_attr +} + +#============================================================================ +proc UI_PB_tpth_UpdateCycleEvent { EVENT_OBJ SEQ_OBJ } { +#============================================================================ + upvar $EVENT_OBJ event_obj + upvar $SEQ_OBJ seq_obj + + set current_evt_name $event::($event_obj,event_name) + PB_int_RetCycleComAndSharedEvts cycle_com_evt cycle_shared_evts + + if {[string compare $cycle_com_evt $current_evt_name] == 0} \ + { + # Gets no of current event elements + set cur_evt_elems [llength $event::($event_obj,evt_elem_list)] + + # Gets all the cycle event objects + set evt_obj_list $sequence::($seq_obj,evt_obj_list) + + # Updates the blocks of the cycle events + foreach cycle_event_name $cycle_shared_evts \ + { + # Returns the event objects by using the event name + PB_com_RetObjFrmName cycle_event_name evt_obj_list cycle_evt_obj + + # Procedure deletes the common elements of all blocks + UI_PB_tpth_DeleteComEvtBlkElems cycle_evt_obj current_evt_name + + # Adds the common blocks to the cycle event + foreach evt_elem_obj $event::($event_obj,evt_elem_list) \ + { + set evt_blk $event_element::($evt_elem_obj,block_obj) + set ret [UI_PB_tpth_CheckCycleRefWord evt_blk] + if {$ret == 0} \ + { + UI_PB_tpth_CreateEvtElemFrmEvtObj evt_elem_obj \ + new_evt_elem_obj current_evt_name + lappend act_cyc_evt_elem $new_evt_elem_obj + } else \ + { + foreach cyc_evt_elem $event::($cycle_evt_obj,evt_elem_list)\ + { + set cyc_evt_blk $event_element::($cyc_evt_elem,block_obj) + set ret_code [UI_PB_tpth_CheckCycleRefWord cyc_evt_blk] + if {$ret_code == 1}\ + { + # Adds the common elements to the block + set cyc_elem_addr_list \ + $block::($cyc_evt_blk,elem_addr_list) + + # Flag is set to remove the representive element + set dup_addr 1 + UI_PB_tpth_AddComBlkElemToBlk evt_blk \ + cyc_elem_addr_list current_evt_name dup_addr + set block::($cyc_evt_blk,elem_addr_list) \ + $cyc_elem_addr_list + unset cyc_elem_addr_list + } + lappend act_cyc_evt_elem $cyc_evt_elem + } + } + } + if {[info exists act_cyc_evt_elem]} \ + { + set event::($cycle_evt_obj,evt_elem_list) $act_cyc_evt_elem + unset act_cyc_evt_elem + } + } + } +} + +#============================================================================ +proc UI_PB_tpth_DeleteAndRecreateIcons { PAGE_OBJ EVENT_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + global paOption + + set bot_canvas $Page::($page_obj,bot_canvas) + + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + foreach elem_obj $event::($event_obj,evt_elem_list)\ + { + set blk_obj $event_element::($elem_obj,block_obj) + foreach blk_elem_obj $block::($blk_obj,elem_addr_list) \ + { + $bot_canvas delete $block_element::($blk_elem_obj,icon_id) + set blk_elem_addr $block_element::($blk_elem_obj,elem_add_obj) + set blk_elem_add_name $address::($blk_elem_addr,add_name) + set addr_leader $address::($blk_elem_addr,add_leader) + set blk_elem_mom_var $block_element::($blk_elem_obj,elem_mom_variable) + + UI_PB_com_RetImageAppdText blk_elem_addr blk_elem_mom_var \ + img_name blk_elem_text + set blk_elem_img [UI_PB_blk_CreateIcon $bot_canvas $img_name \ + $blk_elem_text] + append opt_img pb_ $block_element::($blk_elem_obj,elem_opt_nows_var) + set name_addr [tix getimage $opt_img] + unset opt_img + + $blk_elem_img add image -image $name_addr + + set blk_elem_owner $block_element::($blk_elem_obj,owner) + if {[string compare $blk_elem_owner "post"] == 0} \ + { + set icon_id [$bot_canvas create image \ + $block_element::($blk_elem_obj,xc) \ + $block_element::($blk_elem_obj,yc) \ + -image $blk_elem_img -tag nonmovable] + set im [$bot_canvas itemconfigure $icon_id -image] + [lindex $im end] configure -relief flat + } else \ + { + set icon_id [$bot_canvas create image \ + $block_element::($blk_elem_obj,xc) \ + $block_element::($blk_elem_obj,yc) \ + -image $blk_elem_img -tag movable] + } + + if {[string compare $blk_elem_add_name "Text"] == 0} \ + { + set im [$bot_canvas itemconfigure $icon_id -image] + [lindex $im end] configure -bg $paOption(text) + } + set block_element::($blk_elem_obj,icon_id) $icon_id + } + } + } +} + +#============================================================================ +proc UI_PB_tpth_CreateDividers { PAGE_OBJ BLOCK_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $BLOCK_OBJ block_obj + + global paOption + set bot_canvas $Page::($page_obj,bot_canvas) + + set h_cell $Page::($page_obj,h_cell) ;# cell height + set w_cell $Page::($page_obj,w_cell) ;# cell width + set w_divi $Page::($page_obj,w_divi) ;# divider width + set x_orig $block::($block_obj,x_orig) ;# upper-left corner of 1st cell + set y_orig $block::($block_obj,y_orig) + set main_cell_color $paOption(can_bg) + + if {[info exists block::($block_obj,active_blk_elem_list)]} \ + { + set n_comp [llength $block::($block_obj,active_blk_elem_list)] + } else \ + { + set n_comp 0 + } + + if {[info exists block::($block_obj,sep_id)]} \ + { + $bot_canvas delete [lindex $block::($block_obj,sep_id) 0] + $bot_canvas delete [lindex $block::($block_obj,sep_id) 1] + } + + #------------------- + # Creates Divider + #------------------- + set x0 [expr $x_orig + $w_divi] + set y0 $y_orig + set x1 [expr $x0 + [expr [expr $w_divi + $w_cell] * $n_comp] + \ + $w_divi] + set y1 [expr $y_orig + $w_divi] + + lappend div_id [$bot_canvas create rect $x0 $y0 $x1 $y1 \ + -fill $main_cell_color -outline $main_cell_color \ + -tag stationary] + + set y0 [expr $y_orig + $h_cell + $w_divi] + set y1 [expr $y0 + $w_divi] + + lappend div_id [$bot_canvas create rect $x0 $y0 $x1 $y1 \ + -fill $main_cell_color -outline $main_cell_color \ + -tag stationary] + + set block::($block_obj,sep_id) $div_id +} + +#============================================================================ +proc UI_PB_tpth_CreateBlkElements { PAGE_OBJ EVENT_OBJ } { +#============================================================================ + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + set event_name $event::($event_obj,event_name) + foreach event_elem $event::($event_obj,evt_elem_list) \ + { + set block_obj $event_element::($event_elem,block_obj) + # Gets the sorted list of the block elements according to + # the master sequence + UI_PB_blk_GetBlkAttrSort page_obj block_obj + + # Gets the image ids of all the elements of a block + UI_PB_blk_CreateBlockImages page_obj block_obj + + # sets the origin of the block + set block::($block_obj,x_orig) $Page::($page_obj,x_orig) + set block::($block_obj,y_orig) $Page::($page_obj,y_orig) + UI_PB_tpth_CreateDividers page_obj block_obj + + # Creates the block elements + set active_blk_elem_obj 0 + UI_PB_blk_CreateBlockCells page_obj block_obj active_blk_elem_obj \ + event_name + + set Page::($page_obj,y_orig) [expr \ + $Page::($page_obj,y_orig) + $Page::($page_obj,blk_blkdist)] + } + # Bind procs + UI_PB_tpth_IconBindProcs page_obj event_obj +} + +#========================================================================== +proc UI_PB_tpth_IconBindProcs { PAGE_OBJ EVENT_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + $bot_canvas bind movable "UI_PB_tpth_BlkFocusOn $page_obj $event_obj\ + %x %y" + + $bot_canvas bind movable "UI_PB_tpth_BlkFocusOff $page_obj" + + $bot_canvas bind movable <1> "UI_PB_tpth_StartDragBlk $page_obj $event_obj\ + %x %y" + + $bot_canvas bind movable "UI_PB_tpth_DragBlk $page_obj \ + $event_obj \ + %x %y" + + $bot_canvas bind movable "UI_PB_tpth_EndDragBlk $page_obj \ + $event_obj" + + $bot_canvas bind movable <3> "UI_PB_tpth_BindRightButton $page_obj \ + %x %y" + + $bot_canvas bind nonmovable "UI_PB_tpth_BlkFocusOn $page_obj \ + $event_obj %x %y" + + $bot_canvas bind nonmovable "UI_PB_tpth_BlkFocusOff $page_obj" + + $bot_canvas bind nonmovable <1> "UI_PB_tpth_StartDragBlk $page_obj \ + $event_obj %x %y" +} + +#========================================================================== +proc UI_PB_tpth_BindRightButton { page_obj x y } { +#========================================================================== + set active_blk_elem $Page::($page_obj,in_focus_elem) + + UI_PB_blk_BlockPopupMenu page_obj active_blk_elem $x $y +} + +#========================================================================== +proc UI_PB_tpth_BlkFocusOn { page_obj event_obj x y} { +#========================================================================== + global gPB_help_tips + set bot_canvas $Page::($page_obj,bot_canvas) + + set x [$bot_canvas canvasx $x] + set y [$bot_canvas canvasy $y] + + #---------------------- + # Locate in-focus cell + #---------------------- + UI_PB_tpth_GetEvtElemAndBlkElem event_obj act_blk_elem act_evt_elem $x $y + set Page::($page_obj,in_focus_elem) $act_blk_elem + + # Change cursor + $bot_canvas config -cursor hand2 + + #----------------------------- + # Highlight new in-focus cell + #----------------------------- + if {$Page::($page_obj,in_focus_elem) != \ + $Page::($page_obj,out_focus_elem)} \ + { + if { $Page::($page_obj,out_focus_elem) } \ + { + set out_focus_elem $Page::($page_obj,out_focus_elem) + $bot_canvas itemconfigure $block_element::($out_focus_elem,rect) \ + -fill $Page::($page_obj,x_color) + } + + set cell_highlight_color navyblue + set in_focus_elem $Page::($page_obj,in_focus_elem) + set Page::($page_obj,x_color) [lindex [$bot_canvas itemconfigure \ + $block_element::($in_focus_elem,rect) -fill] end] + + $bot_canvas itemconfigure $block_element::($in_focus_elem,rect) \ + -fill $cell_highlight_color + set Page::($page_obj,out_focus_elem) $Page::($page_obj,in_focus_elem) + + if { $Page::($page_obj,in_focus_elem) } \ + { + if {$gPB_help_tips(state)} \ + { + global tpth_item_focus_on + + if {![info exists tpth_item_focus_on]} \ + { + set tpth_item_focus_on 0 + } + if {$tpth_item_focus_on == 0} \ + { + UI_PB_blk_CreateBalloon page_obj + set tpth_item_focus_on 1 + } + } + } + } +} + +#========================================================================== +proc UI_PB_tpth_GetEvtElemAndBlkElem { EVENT_OBJ ACTIVE_BLK_ELEM_OBJ \ + ACTIVE_EVENT_ELEM x y } { +#========================================================================== + upvar $EVENT_OBJ event_obj + upvar $ACTIVE_BLK_ELEM_OBJ active_blk_elem_obj + upvar $ACTIVE_EVENT_ELEM active_event_elem + + set event_elems $event::($event_obj,evt_elem_list) + + set active_blk_elem_obj 0 + set break_flag 0 + foreach elem_obj $event_elems \ + { + set block_obj $event_element::($elem_obj,block_obj) + set active_blk_elem_list $block::($block_obj,active_blk_elem_list) + foreach blk_elem_obj $active_blk_elem_list \ + { + if {$x >= $block_element::($blk_elem_obj,rect_corn_x0) && \ + $x < $block_element::($blk_elem_obj,rect_corn_x1) && \ + $y >= $block_element::($blk_elem_obj,rect_corn_y0) && \ + $y < $block_element::($blk_elem_obj,rect_corn_y1)} \ + { + set active_blk_elem_obj $blk_elem_obj + set active_event_elem $elem_obj + set break_flag 1 + break; + } + } + if {$break_flag} { break } + } +} + +#========================================================================== +proc UI_PB_tpth_BlkFocusOff { page_obj } { +#========================================================================== + set bot_canvas $Page::($page_obj,bot_canvas) + + if { $Page::($page_obj,out_focus_elem) } \ + { + set out_focus_elem $Page::($page_obj,out_focus_elem) + $bot_canvas itemconfigure $block_element::($out_focus_elem,rect) \ + -fill $Page::($page_obj,x_color) + } + + set Page::($page_obj,in_focus_elem) 0 + set Page::($page_obj,out_focus_elem) 0 + + # Restore cursor + $bot_canvas config -cursor "" + + # Balloon stuff + global gPB_help_tips + if {$gPB_help_tips(state)} \ + { + if [info exists gPB_help_tips($bot_canvas)] { + unset gPB_help_tips($bot_canvas) + } + PB_cancel_balloon + global tpth_item_focus_on + set tpth_item_focus_on 0 + } +} + +#========================================================================== +proc UI_PB_tpth_StartDragBlk { page_obj event_obj x y } { +#========================================================================== + global paOption + set bot_canvas $Page::($page_obj,bot_canvas) + + # Unhighlight previously selected icon + if {$Page::($page_obj,active_blk_elem)} \ + { + set act_blk_elem_obj $Page::($page_obj,active_blk_elem) + set act_blk_elem_add_obj $block_element::($act_blk_elem_obj,elem_add_obj) + set act_blk_add_name $address::($act_blk_elem_add_obj,add_name) + set icon_id $block_element::($act_blk_elem_obj,icon_id) + + set im [$bot_canvas itemconfigure $icon_id -image] + set icon_tag [lindex [$bot_canvas itemconfigure $icon_id -tags] end] + if {[string compare $icon_tag "nonmovable"] == 0} \ + { + [lindex $im end] configure -relief flat -background #c0c0ff + } else \ + { + [lindex $im end] configure -relief raised -background #c0c0ff + } + + if {[string compare $act_blk_add_name "Text"] == 0} \ + { + [lindex $im end] configure -background $paOption(text) + } + } + + # Highlight current icon + $bot_canvas raise current + set im [$bot_canvas itemconfigure current -image] + set cur_img_tag [lindex [lindex [$bot_canvas itemconfigure current \ + -tags] end] 0] + [lindex $im end] configure -relief sunken -background pink + + set panel_hi $Page::($page_obj,panel_hi) + + # Fine adjustment in next 2 lines is needed to line up icons nicely. + # This may have something to do with the -bd & -relief in canvas. + set dx 1 + set dy [expr $panel_hi + 2] + + set xx [$bot_canvas canvasx $x] + set yy [$bot_canvas canvasy $y] + + # Finds source block object and block element object + UI_PB_tpth_GetEvtElemAndBlkElem event_obj focus_blk_elem \ + focus_evt_elem $xx $yy + set Page::($page_obj,active_blk_elem) $focus_blk_elem + + if {[string compare $cur_img_tag "movable"] == 0} \ + { + set origin_xb [$bot_canvas canvasx $x] + set origin_yb [$bot_canvas canvasy $y] + set Page::($page_obj,last_xb) $origin_xb + set Page::($page_obj,last_yb) $origin_yb + set blk_elem_addr $block_element::($focus_blk_elem,elem_add_obj) + + set blk_elem_mom_var $block_element::($focus_blk_elem,elem_mom_variable) + UI_PB_com_RetImageAppdText blk_elem_addr blk_elem_mom_var \ + image_name blk_elem_text + + set Page::($page_obj,source_blk_elem_obj) $focus_blk_elem + set Page::($page_obj,source_evt_elem_obj) $focus_evt_elem + + set origin_xt [expr [expr $block_element::($focus_blk_elem,rect_corn_x0) \ + + $block_element::($focus_blk_elem,rect_corn_x1)] / 2] + set origin_yt [expr [expr $block_element::($focus_blk_elem,rect_corn_y0) \ + + $block_element::($focus_blk_elem,rect_corn_y1)] / 2] + + set diff_x [expr $xx - $origin_xt] + set diff_y [expr $yy - $origin_yt] + + set top_canvas $Page::($page_obj,top_canvas) + set img_addr [UI_PB_blk_CreateIcon $top_canvas $image_name $blk_elem_text] + + append opt_img pb_ $block_element::($focus_blk_elem,elem_opt_nows_var) + $img_addr add image -image [tix getimage $opt_img] + unset opt_img + + set icon_top [$top_canvas create image \ + [expr $x - $dx - $diff_x] [expr $y + $dy - $diff_y] \ + -image $img_addr -tag new_comp] + set Page::($page_obj,icon_top) $icon_top + + set last_xt [expr $x - $dx] + set last_yt [expr $y + $dy] + + set Page::($page_obj,last_xt) $last_xt + set Page::($page_obj,last_yt) $last_yt + + set im [$top_canvas itemconfigure $icon_top -image] + [lindex $im end] configure -relief sunken -background pink + + $bot_canvas bind movable "" + $bot_canvas bind movable "" + + # Change cursor +# UI_PB_com_ChangeCursor $bot_canvas + } +} + +#========================================================================== +proc UI_PB_tpth_DragBlk { page_obj event_obj x y } { +#========================================================================== + global env + set bot_canvas $Page::($page_obj,bot_canvas) + + # Change cursor +# UI_PB_com_ChangeCursor $bot_canvas + + set panel_hi $Page::($page_obj,panel_hi) + + set xc [$bot_canvas canvasx $x] + set yc [$bot_canvas canvasy $y] + + # Translate element + $bot_canvas move current [expr $xc - $Page::($page_obj,last_xb)] \ + [expr $yc - $Page::($page_obj,last_yb)] + + set dx 1 + set dy [expr $panel_hi + 2] + + set top_canvas $Page::($page_obj,top_canvas) + set xp [$top_canvas canvasx $x] + set yp [$top_canvas canvasy $y] + + $top_canvas move $Page::($page_obj,icon_top) \ + [expr $xp - $Page::($page_obj,last_xt) - $dx] \ + [expr $yp - $Page::($page_obj,last_yt) + $dy] + + set Page::($page_obj,last_xb) $xc + set Page::($page_obj,last_yb) $yc + set Page::($page_obj,last_xt) [expr $xp - $dx] + set Page::($page_obj,last_yt) [expr $yp + $dy] + + # Highlight the trash cell + UI_PB_blk_TrashFocusOn $page_obj $x $y + + set focus_blk_elem $Page::($page_obj,source_blk_elem_obj) + set sel_addr_obj $block_element::($focus_blk_elem,elem_add_obj) + set sel_addr_name $address::($sel_addr_obj,add_name) + UI_PB_tpth_HighlightSeperators $page_obj $event_obj \ + $sel_addr_name $xc $yc +} + +#========================================================================== +proc UI_PB_tpth_EndDragBlk { page_obj event_obj } { +#========================================================================== + global paOption + set bot_canvas $Page::($page_obj,bot_canvas) + + UI_PB_tpth_UnHighLightSep page_obj + + if {$Page::($page_obj,trash_flag)} \ + { + UI_PB_tpth_PutBlockElemTrash page_obj event_obj + [lindex $Page::($page_obj,trash) 0] configure \ + -background $paOption(app_butt_bg) + + } elseif {$Page::($page_obj,add_blk) != 0} \ + { + UI_PB_tpth_SwapBlockElements page_obj event_obj + } else \ + { + set source_blk_elem_obj $Page::($page_obj,source_blk_elem_obj) + UI_PB_blk_ReturnAddr page_obj source_blk_elem_obj + } + + # Deletes the icon that has been created in the top canvas + $Page::($page_obj,top_canvas) delete $Page::($page_obj,icon_top) + + # Delete connecting line + $Page::($page_obj,top_canvas) delete connect_line + + # Rebind callbacks + $bot_canvas bind movable "UI_PB_tpth_BlkFocusOn $page_obj \ + $event_obj \ + %x %y" + $bot_canvas bind movable "UI_PB_tpth_BlkFocusOff $page_obj" + + # Adjust cursor + $bot_canvas config -cursor "" + + set Page::($page_obj,source_blk_elem_obj) 0 + set Page::($page_obj,source_evt_elem_obj) 0 + set Page::($page_obj,add_blk) 0 + set Page::($page_obj,add_flag) 0 + set Page::($page_obj,trash_flag) 0 +} + +#========================================================================== +proc UI_PB_tpth_SwapBlockElements {PAGE_OBJ EVENT_OBJ} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + # Source block and block element + set source_blk_elem_obj $Page::($page_obj,source_blk_elem_obj) + set source_evt_elem_obj $Page::($page_obj,source_evt_elem_obj) + + # source block element is added to active block obj + set add_to_evt_elem $Page::($page_obj,active_evt_elem_obj) + set add_to_blk_obj $event_element::($add_to_evt_elem,block_obj) + + if {[string compare $Page::($page_obj,add_blk) "row"] == 0} \ + { + set new_elem_add_obj $block_element::($source_blk_elem_obj,elem_add_obj) + set new_elem_add_name $address::($new_elem_add_obj,add_name) + set blk_exists_flag [UI_PB_com_CheckElemBlkTemplate add_to_blk_obj \ + new_elem_add_name] + if {$blk_exists_flag} \ + { + UI_PB_com_DisplyErrorMssg new_elem_add_name + set source_blk_elem_obj $Page::($page_obj,source_blk_elem_obj) + UI_PB_blk_ReturnAddr page_obj source_blk_elem_obj + return + } + } + + UI_PB_tpth_PutBlockElemTrash page_obj event_obj + + switch $Page::($page_obj,add_blk) \ + { + "row" \ + { + UI_PB_tpth_AddBlkElemRow page_obj add_to_evt_elem source_blk_elem_obj + } + "top" \ + { + UI_PB_tpth_AddBlkElemTopOrBottom page_obj event_obj add_to_evt_elem \ + source_blk_elem_obj + } + "bottom" \ + { + UI_PB_tpth_AddBlkElemTopOrBottom page_obj event_obj add_to_evt_elem \ + source_blk_elem_obj + } + } + + set Page::($page_obj,add_blk) 0 + set Page::($page_obj,add_flag) 0 +} + +#========================================================================== +proc UI_PB_tpth_PutBlockElemTrash { PAGE_OBJ EVENT_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + set bot_canvas $Page::($page_obj,bot_canvas) + + # Unhighlight previously selected icon + if {$Page::($page_obj,active_blk_elem)} \ + { + set act_blk_elem_obj $Page::($page_obj,active_blk_elem) + set icon_id $block_element::($act_blk_elem_obj,icon_id) + set im [$bot_canvas itemconfigure $icon_id -image] + [lindex $im end] configure -relief raised -background #c0c0ff + } + + set source_blk_elem_obj $Page::($page_obj,source_blk_elem_obj) + set evt_elem_obj $Page::($page_obj,source_evt_elem_obj) + + set block_obj $event_element::($evt_elem_obj,block_obj) + set no_blk_elems [llength $block::($block_obj,active_blk_elem_list)] + set source_cell_num [lsearch $block::($block_obj,active_blk_elem_list) \ + $source_blk_elem_obj] + + # Removes the blk object from the address blk element list. + set addr_obj $block_element::($source_blk_elem_obj,elem_add_obj) + address::DeleteFromBlkElemList $addr_obj source_blk_elem_obj + + set no_event_elems [llength $event::($event_obj,evt_elem_list)] + set elem_index [lsearch $event::($event_obj,evt_elem_list) evt_elem_obj] + + if { $no_blk_elems > 1 || $elem_index == [expr $no_event_elems - 1]} \ + { + UI_PB_tpth_DeleteElemOfRow page_obj event_obj evt_elem_obj source_cell_num + + } elseif { $no_blk_elems == 1} \ + { + UI_PB_tpth_DeleteARow page_obj event_obj evt_elem_obj + } +} + +#========================================================================== +proc UI_PB_tpth_DeleteARow { PAGE_OBJ EVENT_OBJ EVT_ELEM_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + upvar $EVT_ELEM_OBJ evt_elem_obj + + set event_name $event::($event_obj,event_name) + set elem_index [lsearch $event::($event_obj,evt_elem_list) $evt_elem_obj] + set bot_canvas $Page::($page_obj,bot_canvas) + + # Deletes the existing blk elements + set block_obj $event_element::($evt_elem_obj,block_obj) + UI_PB_blk_DeleteCellsIcons page_obj block_obj + + if {[info exists block::($block_obj,sep_id)]} \ + { + $bot_canvas delete [lindex $block::($block_obj,sep_id) 0] + $bot_canvas delete [lindex $block::($block_obj,sep_id) 1] + } + + # Deletes the block from the block list + PB_int_RemoveBlkObjFrmList block_obj + + set x_orig $block::($block_obj,x_orig) + set y_orig $block::($block_obj,y_orig) + + set no_elems [llength $event::($event_obj,evt_elem_list)] + if {$elem_index || [expr $elem_index + 1] < $no_elems} \ + { + set event_elems $event::($event_obj,evt_elem_list) + unset event::($event_obj,evt_elem_list) + set event_elems [lreplace $event_elems $elem_index $elem_index] + set event::($event_obj,evt_elem_list) $event_elems + incr no_elems -1 + } else \ + { + set evt_elem_obj [lindex $event::($event_obj,evt_elem_list) $elem_index] + set elem_blk_obj $event_element::($evt_elem_obj,block_obj) + set block::($elem_blk_obj,active_blk_elem_list) "" + } + + for {set count $elem_index} {$count < $no_elems} {incr count} \ + { + set temp_elem_obj [lindex $event::($event_obj,evt_elem_list) $count] + set temp_blk_obj $event_element::($temp_elem_obj,block_obj) + + # Deletes the existing blk elements + UI_PB_blk_DeleteCellsIcons page_obj temp_blk_obj + + set Page::($page_obj,x_orig) $x_orig + set Page::($page_obj,y_orig) $y_orig + + set block::($temp_blk_obj,x_orig) $Page::($page_obj,x_orig) + set block::($temp_blk_obj,y_orig) $Page::($page_obj,y_orig) + UI_PB_tpth_CreateDividers page_obj temp_blk_obj + + # Creates the block elements + UI_PB_blk_CreateBlockImages page_obj temp_blk_obj + + set active_blk_elem_obj 0 + UI_PB_blk_CreateBlockCells page_obj temp_blk_obj active_blk_elem_obj \ + event_name + set y_orig [expr $y_orig + $Page::($page_obj,blk_blkdist)] + } + + if { $elem_index } \ + { + set active_elem_obj \ + [lindex $event::($event_obj,evt_elem_list) [expr $elem_index - 1]] + set active_blk_obj $event_element::($active_elem_obj,block_obj) + set active_blk_elem_obj [lindex \ + $block::($active_blk_obj,active_blk_elem_list) end] + set im [$Page::($page_obj,bot_canvas) itemconfigure \ + $block_element::($active_blk_elem_obj,icon_id) -image] + [lindex $im end] configure -relief sunken -bg pink + set Page::($page_obj,active_blk_elem) $active_blk_elem_obj + } else \ + { + set Page::($page_obj,active_blk_elem) 0 + } +} + +#========================================================================== +proc UI_PB_tpth_DeleteElemOfRow { PAGE_OBJ EVENT_OBJ EVT_ELEM_OBJ \ + SOURCE_CELL_NUM} { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + upvar $EVT_ELEM_OBJ evt_elem_obj + upvar $SOURCE_CELL_NUM source_cell_num + + set bot_canvas $Page::($page_obj,bot_canvas) + set event_name $event::($event_obj,event_name) + + set block_obj $event_element::($evt_elem_obj,block_obj) + set no_blk_elems [llength $block::($block_obj,active_blk_elem_list)] + set elem_index [lsearch $event::($event_obj,evt_elem_list) $evt_elem_obj] + set no_event_elemss [llength $event::($event_obj,evt_elem_list)] + + # Deletes the existing blk elements + UI_PB_blk_DeleteCellsIcons page_obj block_obj + + set block::($block_obj,active_blk_elem_list) \ + [lreplace $block::($block_obj,active_blk_elem_list) \ + $source_cell_num $source_cell_num] + + set Page::($page_obj,x_orig) $block::($block_obj,x_orig) + set Page::($page_obj,y_orig) $block::($block_obj,y_orig) + + if {$no_blk_elems > 1} \ + { + if {$source_cell_num > 0} \ + { + set active_blk_elem_obj [lindex \ + $block::($block_obj,active_blk_elem_list) [expr $source_cell_num -1]] + } elseif {$source_cell_num == 0} \ + { + set active_blk_elem_obj [lindex \ + $block::($block_obj,active_blk_elem_list) $source_cell_num] + } + } elseif {$elem_index == [expr $no_event_elems - 1]} \ + { + if {[info exists block::($block_obj,sep_id)]} \ + { + $bot_canvas delete [lindex $block::($block_obj,sep_id) 0] + $bot_canvas delete [lindex $block::($block_obj,sep_id) 1] + } + set event::($event_obj,evt_elem_list) \ + [lreplace $event::($event_obj,evt_elem_list) $elem_index $elem_index] + + if {$elem_index > 0} \ + { + set active_blk_obj [lindex \ + $event::($event_obj,evt_elem_list) [expr $elem_index -1]] + set active_blk_elem_obj \ + [lindex $block::($active_blk_obj,active_blk_elem_list) end] + } else \ + { + set no_elems [llength $event::($event_obj,evt_elem_list)] + set new_block_obj [new block] + set blk_obj_attr(0) "sample_$no_elems" + set blk_obj_attr(1) "" + set blk_obj_attr(2) "" + set blk_obj_attr(3) "" + set blk_obj_attr(4) "" + + block::setvalue $new_block_obj blk_obj_attr + set new_evt_elem_obj [new event_element] + set evt_elem_obj_attr(0) "sample_$no_elems" + set evt_elem_obj_attr(1) $new_block_obj + set evt_elem_obj_attr(2) "normal" + event_element::setvalue $new_evt_elem_obj evt_elem_obj_attr + + lappend event::($event_obj,evt_elem_list) $new_evt_elem_obj + + # sets the origin of the block + set block::($new_block_obj,x_orig) $Page::($page_obj,x_orig) + set block::($new_block_obj,y_orig) $Page::($page_obj,y_orig) + set active_blk_elem_obj 0 + + set Page::($page_obj,active_evt_elem_obj) $new_evt_elem_obj + UI_PB_tpth_CreateDividers page_obj new_block_obj + UI_PB_blk_CreateBlockImages page_obj new_block_obj + UI_PB_blk_CreateBlockCells page_obj new_block_obj active_blk_elem_obj \ + event_name + set Page::($page_obj,active_blk_elem) 0 + return + } + } else \ + { + set active_blk_elem_obj 0 + } + + # Creates the block elements + if {[llength $block::($block_obj,active_blk_elem_list)] > 0} \ + { + UI_PB_tpth_CreateDividers page_obj block_obj + UI_PB_blk_CreateBlockImages page_obj block_obj + UI_PB_blk_CreateBlockCells page_obj block_obj active_blk_elem_obj \ + event_name + } else \ + { + set im [$bot_canvas itemconfigure \ + $block_element::($active_blk_elem_obj,icon_id) -image] + [lindex $im end] configure -relief sunken -bg pink + set Page::($page_obj,active_blk_elem) $active_blk_elem_obj + } +} + +#========================================================================== +proc UI_PB_tpth_CreateElemObjects { PAGE_OBJ EVENT_OBJ } { +#========================================================================== + upvar $PAGE_OBJ page_obj + upvar $EVENT_OBJ event_obj + + if {[string compare $event::($event_obj,evt_elem_list) ""] != 0} \ + { + set test_blk_obj [lindex $event::($event_obj,evt_elem_list) 0] + if {[info exists event_element::($test_blk_obj,block_obj)]} \ + { + return + } + } else \ + { + set temp_event_name [split $Page::($page_obj,event_name)] + set event_name [join $temp_event_name _ ] + set event_name [string tolower $event_name] + set block_name $event_name + set blk_elem_list "" + set blk_owner $event::($event_obj,event_name) + PB_int_CreateNewBlock block_name blk_elem_list blk_owner \ + blk_obj + + set elem_type "normal" + PB_int_CreateNewEventElement blk_obj elem_type evt_elem + + set event::($event_obj,evt_elem_list) $evt_elem + set Page::($page_obj,dummy_blk) 1 + } +} diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_3param.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_3param.gif new file mode 100644 index 0000000..cd26f4b Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_3param.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_4param.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_4param.gif new file mode 100644 index 0000000..6030baa Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_4param.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_5param.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_5param.gif new file mode 100644 index 0000000..1c706ba Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_5param.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_general.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_general.gif new file mode 100644 index 0000000..3f84480 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_general.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_l3x.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_l3x.gif new file mode 100644 index 0000000..eb45830 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_l3x.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m3x_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m3x_h.gif new file mode 100644 index 0000000..224cf72 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m3x_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m3x_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m3x_v.gif new file mode 100644 index 0000000..3eed3de Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m3x_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HA_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HA_h.gif new file mode 100644 index 0000000..c3d7b7c Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HA_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HA_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HA_v.gif new file mode 100644 index 0000000..d750c0f Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HA_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HB_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HB_h.gif new file mode 100644 index 0000000..df34131 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HB_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HB_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HB_v.gif new file mode 100644 index 0000000..5ca7b4c Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_HB_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TA_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TA_h.gif new file mode 100644 index 0000000..7a2422d Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TA_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TA_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TA_v.gif new file mode 100644 index 0000000..e8ed7d7 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TA_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TB_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TB_h.gif new file mode 100644 index 0000000..9ccf988 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TB_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TB_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TB_v.gif new file mode 100644 index 0000000..3fd587b Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m4x_TB_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_HB_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_HB_v.gif new file mode 100644 index 0000000..1118341 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_HB_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TB_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TB_h.gif new file mode 100644 index 0000000..9cdcbd4 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TB_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TB_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TB_v.gif new file mode 100644 index 0000000..85e54c6 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TB_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TC_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TC_v.gif new file mode 100644 index 0000000..ddc1dda Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_TC_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_h.gif new file mode 100644 index 0000000..056cc90 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HA_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_HA_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_HA_v.gif new file mode 100644 index 0000000..1c53428 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_HA_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TA_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TA_h.gif new file mode 100644 index 0000000..0db8e7b Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TA_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TA_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TA_v.gif new file mode 100644 index 0000000..0306e35 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TA_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TC_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TC_h.gif new file mode 100644 index 0000000..f7a31b3 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TC_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TC_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TC_v.gif new file mode 100644 index 0000000..5642e1e Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_TC_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_h.gif new file mode 100644 index 0000000..0c9af22 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HB_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HC_HA_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HC_HA_v.gif new file mode 100644 index 0000000..6c1a830 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HC_HA_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HC_HB_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HC_HB_v.gif new file mode 100644 index 0000000..4c3395c Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_HC_HB_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TB_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TB_h.gif new file mode 100644 index 0000000..00a90bb Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TB_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TB_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TB_v.gif new file mode 100644 index 0000000..240e1d6 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TB_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TC_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TC_h.gif new file mode 100644 index 0000000..41c056e Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TC_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TC_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TC_v.gif new file mode 100644 index 0000000..1bbda6c Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TA_TC_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TA_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TA_h.gif new file mode 100644 index 0000000..17bd344 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TA_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TA_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TA_v.gif new file mode 100644 index 0000000..ffc6ba9 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TA_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TC_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TC_h.gif new file mode 100644 index 0000000..ea51819 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TC_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TC_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TC_v.gif new file mode 100644 index 0000000..756d9f6 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TB_TC_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TA_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TA_h.gif new file mode 100644 index 0000000..f6fdab7 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TA_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TA_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TA_v.gif new file mode 100644 index 0000000..5be1109 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TA_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TB_h.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TB_h.gif new file mode 100644 index 0000000..74f80f5 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TB_h.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TB_v.gif b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TB_v.gif new file mode 100644 index 0000000..acc6c4a Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/mach_tool/pb_m5x_TC_TB_v.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/pb_A_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_A_addr.xbm new file mode 100644 index 0000000..638cfe9 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_A_addr.xbm @@ -0,0 +1,10 @@ +#define _a_addr.xbm_width 20 +#define _a_addr.xbm_height 20 +#define _a_addr.xbm_x_hot 0 +#define _a_addr.xbm_y_hot 0 +static unsigned char _a_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x0d, 0x00, + 0x80, 0x19, 0x00, 0x80, 0x18, 0x00, 0x80, 0x18, 0x00, 0xc0, 0x30, 0x00, + 0xc0, 0x3f, 0x00, 0x40, 0x30, 0x00, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, + 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_B_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_B_addr.xbm new file mode 100644 index 0000000..3fbf6b2 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_B_addr.xbm @@ -0,0 +1,10 @@ +#define _b_addr.xbm_width 20 +#define _b_addr.xbm_height 20 +#define _b_addr.xbm_x_hot 0 +#define _b_addr.xbm_y_hot 0 +static unsigned char _b_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, + 0xc0, 0x18, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, + 0xc0, 0x18, 0x00, 0xc0, 0x1f, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x60, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x30, 0x00, + 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_C_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_C_addr.xbm new file mode 100644 index 0000000..5503a1c --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_C_addr.xbm @@ -0,0 +1,10 @@ +#define _c_addr.xbm_width 20 +#define _c_addr.xbm_height 20 +#define _c_addr.xbm_x_hot 0 +#define _c_addr.xbm_y_hot 0 +static unsigned char _c_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, + 0x80, 0x71, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x40, 0x00, 0x60, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, + 0x60, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x40, 0x00, 0x80, 0x73, 0x00, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_D_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_D_addr.xbm new file mode 100644 index 0000000..f64f433 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_D_addr.xbm @@ -0,0 +1,10 @@ +#define _d_addr.xbm_width 20 +#define _d_addr.xbm_height 20 +#define _d_addr.xbm_x_hot 0 +#define _d_addr.xbm_y_hot 0 +static unsigned char _d_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, + 0xc0, 0x38, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0xc0, 0x00, + 0xc0, 0xc0, 0x00, 0xc0, 0xc0, 0x00, 0xc0, 0xc0, 0x00, 0xc0, 0xc0, 0x00, + 0xc0, 0xc0, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x38, 0x00, + 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_E_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_E_addr.xbm new file mode 100644 index 0000000..c301d86 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_E_addr.xbm @@ -0,0 +1,10 @@ +#define _e_addr.xbm_width 20 +#define _e_addr.xbm_height 20 +#define _e_addr.xbm_x_hot 0 +#define _e_addr.xbm_y_hot 0 +static unsigned char _e_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x40, 0x00, 0xc0, 0x40, 0x00, 0xc0, 0x08, 0x00, + 0xc0, 0x08, 0x00, 0xc0, 0x0f, 0x00, 0xc0, 0x08, 0x00, 0xc0, 0x08, 0x00, + 0xc0, 0x00, 0x00, 0xc0, 0x40, 0x00, 0xc0, 0x40, 0x00, 0xc0, 0x60, 0x00, + 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_F_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_F_addr.xbm new file mode 100644 index 0000000..1e97ace --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_F_addr.xbm @@ -0,0 +1,10 @@ +#define _f_addr.xbm_width 20 +#define _f_addr.xbm_height 20 +#define _f_addr.xbm_x_hot 0 +#define _f_addr.xbm_y_hot 0 +static unsigned char _f_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x40, 0x00, 0xc0, 0x40, 0x00, 0xc0, 0x08, 0x00, + 0xc0, 0x08, 0x00, 0xc0, 0x0f, 0x00, 0xc0, 0x08, 0x00, 0xc0, 0x08, 0x00, + 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_G_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_G_addr.xbm new file mode 100644 index 0000000..ab1dd14 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_G_addr.xbm @@ -0,0 +1,10 @@ +#define _g_addr.xbm_width 20 +#define _g_addr.xbm_height 20 +#define _g_addr.xbm_x_hot 0 +#define _g_addr.xbm_y_hot 0 +static unsigned char _g_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, + 0x80, 0x71, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x40, 0x00, 0x60, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0xf8, 0x00, 0x60, 0x60, 0x00, + 0x60, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0x80, 0x73, 0x00, + 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_H_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_H_addr.xbm new file mode 100644 index 0000000..74f5a0c --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_H_addr.xbm @@ -0,0 +1,10 @@ +#define _h_addr.xbm_width 20 +#define _h_addr.xbm_height 20 +#define _h_addr.xbm_x_hot 0 +#define _h_addr.xbm_y_hot 0 +static unsigned char _h_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf1, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x7f, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, + 0xe0, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_I_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_I_addr.xbm new file mode 100644 index 0000000..33356c0 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_I_addr.xbm @@ -0,0 +1,10 @@ +#define _i_addr.xbm_width 20 +#define _i_addr.xbm_height 20 +#define _i_addr.xbm_x_hot 0 +#define _i_addr.xbm_y_hot 0 +static unsigned char _i_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, + 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_J_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_J_addr.xbm new file mode 100644 index 0000000..29cbc45 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_J_addr.xbm @@ -0,0 +1,11 @@ +#define _j_addr.xbm_width 21 +#define _j_addr.xbm_height 22 +#define _j_addr.xbm_x_hot 0 +#define _j_addr.xbm_y_hot 0 +static unsigned char _j_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfe, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, + 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, + 0x80, 0x19, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_K_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_K_addr.xbm new file mode 100644 index 0000000..e8b1c33 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_K_addr.xbm @@ -0,0 +1,10 @@ +#define _k_addr.xbm_width 20 +#define _k_addr.xbm_height 20 +#define _k_addr.xbm_x_hot 0 +#define _k_addr.xbm_y_hot 0 +static unsigned char _k_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x78, 0x00, + 0x60, 0x30, 0x00, 0x60, 0x18, 0x00, 0x60, 0x0c, 0x00, 0x60, 0x06, 0x00, + 0x60, 0x03, 0x00, 0xe0, 0x03, 0x00, 0xe0, 0x03, 0x00, 0x60, 0x07, 0x00, + 0x60, 0x0e, 0x00, 0x60, 0x1c, 0x00, 0x60, 0x38, 0x00, 0x60, 0x70, 0x00, + 0xf0, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_L_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_L_addr.xbm new file mode 100644 index 0000000..32b7eda --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_L_addr.xbm @@ -0,0 +1,10 @@ +#define L_addr.xbm_width 20 +#define L_addr.xbm_height 20 +#define L_addr.xbm_x_hot 0 +#define L_addr.xbm_y_hot 0 +static unsigned char L_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xc0, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_M_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_M_addr.xbm new file mode 100644 index 0000000..99e1bbc --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_M_addr.xbm @@ -0,0 +1,10 @@ +#define _m_addr.xbm_width 20 +#define _m_addr.xbm_height 20 +#define _m_addr.xbm_x_hot 0 +#define _m_addr.xbm_y_hot 0 +static unsigned char _m_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x71, 0x00, 0xc0, 0x71, 0x00, 0xc0, 0x7b, 0x00, + 0x40, 0x6b, 0x00, 0x40, 0x6f, 0x00, 0x40, 0x66, 0x00, 0x40, 0x66, 0x00, + 0x40, 0x60, 0x00, 0x40, 0x60, 0x00, 0x40, 0x60, 0x00, 0x40, 0x60, 0x00, + 0xe0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_N_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_N_addr.xbm new file mode 100644 index 0000000..9e7f3fb --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_N_addr.xbm @@ -0,0 +1,8 @@ +#define _n_addr.xbm_width 20 +#define _n_addr.xbm_height 20 +static unsigned char _n_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x70, 0x00, + 0xc0, 0x21, 0x00, 0xc0, 0x21, 0x00, 0xc0, 0x23, 0x00, 0x40, 0x23, 0x00, + 0x40, 0x27, 0x00, 0x40, 0x26, 0x00, 0x40, 0x2e, 0x00, 0x40, 0x2c, 0x00, + 0x40, 0x3c, 0x00, 0x40, 0x38, 0x00, 0x40, 0x38, 0x00, 0x40, 0x30, 0x00, + 0xe0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_O_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_O_addr.xbm new file mode 100644 index 0000000..018af53 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_O_addr.xbm @@ -0,0 +1,10 @@ +#define O_addr.xbm_width 20 +#define O_addr.xbm_height 20 +#define O_addr.xbm_x_hot 0 +#define O_addr.xbm_y_hot 0 +static unsigned char O_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x80, 0x31, 0x00, 0xc0, 0x60, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, + 0xc0, 0x60, 0x00, 0x80, 0x31, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_P_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_P_addr.xbm new file mode 100644 index 0000000..6eb3db0 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_P_addr.xbm @@ -0,0 +1,8 @@ +#define _p_addr.xbm_width 20 +#define _p_addr.xbm_height 20 +static unsigned char _p_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xc0, 0x30, 0x00, + 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, + 0xc0, 0x30, 0x00, 0xc0, 0x1f, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_Q_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_Q_addr.xbm new file mode 100644 index 0000000..0dddd19 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_Q_addr.xbm @@ -0,0 +1,8 @@ +#define _q_addr.xbm_width 20 +#define _q_addr.xbm_height 20 +static unsigned char _q_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0xc0, 0x1d, 0x00, + 0x60, 0x30, 0x00, 0x60, 0x30, 0x00, 0x30, 0x60, 0x00, 0x30, 0x60, 0x00, + 0x30, 0x60, 0x00, 0x30, 0x60, 0x00, 0x30, 0x60, 0x00, 0x30, 0x60, 0x00, + 0x60, 0x30, 0x00, 0x60, 0x36, 0x00, 0xc0, 0x1e, 0x00, 0x80, 0x0f, 0x00, + 0x00, 0x0c, 0x00, 0x00, 0x18, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_R_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_R_addr.xbm new file mode 100644 index 0000000..1cdbf5f --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_R_addr.xbm @@ -0,0 +1,8 @@ +#define _r_addr.xbm_width 20 +#define _r_addr.xbm_height 20 +static unsigned char _r_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, + 0xc0, 0x30, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, + 0xc0, 0x30, 0x00, 0xc0, 0x1f, 0x00, 0xc0, 0x0c, 0x00, 0xc0, 0x18, 0x00, + 0xc0, 0x18, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x60, 0x00, + 0xe0, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_S_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_S_addr.xbm new file mode 100644 index 0000000..1692b23 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_S_addr.xbm @@ -0,0 +1,8 @@ +#define _s_addr.xbm_width 20 +#define _s_addr.xbm_height 20 +static unsigned char _s_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, + 0xe0, 0x1c, 0x00, 0x30, 0x38, 0x00, 0x30, 0x30, 0x00, 0x70, 0x00, 0x00, + 0xe0, 0x01, 0x00, 0x80, 0x07, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x38, 0x00, + 0x00, 0x70, 0x00, 0x30, 0x60, 0x00, 0x70, 0x60, 0x00, 0xe0, 0x38, 0x00, + 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_T_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_T_addr.xbm new file mode 100644 index 0000000..81886b2 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_T_addr.xbm @@ -0,0 +1,8 @@ +#define _t_addr.xbm_width 20 +#define _t_addr.xbm_height 20 +static unsigned char _t_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, + 0x60, 0x66, 0x00, 0x20, 0x46, 0x00, 0x20, 0x46, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, + 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_U_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_U_addr.xbm new file mode 100644 index 0000000..d5512f9 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_U_addr.xbm @@ -0,0 +1,10 @@ +#define U_addr.xbm_width 20 +#define U_addr.xbm_height 20 +#define U_addr.xbm_x_hot 0 +#define U_addr.xbm_y_hot 0 +static unsigned char U_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, + 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, + 0xc0, 0x30, 0x00, 0xc0, 0x39, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_V_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_V_addr.xbm new file mode 100644 index 0000000..a9694f1 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_V_addr.xbm @@ -0,0 +1,10 @@ +#define V_addr.xbm_width 20 +#define V_addr.xbm_height 20 +#define V_addr.xbm_x_hot 0 +#define V_addr.xbm_y_hot 0 +static unsigned char V_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0xc0, 0x30, 0x00, + 0xc0, 0x30, 0x00, 0x80, 0x19, 0x00, 0x80, 0x19, 0x00, 0x00, 0x09, 0x00, + 0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_W_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_W_addr.xbm new file mode 100644 index 0000000..b22237f --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_W_addr.xbm @@ -0,0 +1,10 @@ +#define W_addr.xbm_width 20 +#define W_addr.xbm_height 20 +#define W_addr.xbm_x_hot 0 +#define W_addr.xbm_y_hot 0 +static unsigned char W_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x30, 0x84, 0x01, 0x30, 0x8e, 0x01, 0x30, 0x8e, 0x01, + 0x30, 0x9b, 0x01, 0x60, 0xdb, 0x00, 0x60, 0xdb, 0x00, 0x60, 0xd1, 0x00, + 0xc0, 0x71, 0x00, 0xc0, 0x60, 0x00, 0xc0, 0x60, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_X_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_X_addr.xbm new file mode 100644 index 0000000..2addc05 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_X_addr.xbm @@ -0,0 +1,8 @@ +#define _x_addr.xbm_width 20 +#define _x_addr.xbm_height 20 +static unsigned char _x_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x78, 0x00, + 0x60, 0x30, 0x00, 0xc0, 0x18, 0x00, 0xc0, 0x18, 0x00, 0x80, 0x0d, 0x00, + 0x80, 0x0d, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x80, 0x0d, 0x00, + 0x80, 0x0d, 0x00, 0xc0, 0x18, 0x00, 0xc0, 0x18, 0x00, 0x60, 0x30, 0x00, + 0xf0, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_Y_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_Y_addr.xbm new file mode 100644 index 0000000..e4d2eab --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_Y_addr.xbm @@ -0,0 +1,8 @@ +#define _y_addr.xbm_width 20 +#define _y_addr.xbm_height 20 +static unsigned char _y_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, + 0x60, 0x60, 0x00, 0xc0, 0x30, 0x00, 0xc0, 0x30, 0x00, 0x80, 0x19, 0x00, + 0x80, 0x19, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, + 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_Z_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_Z_addr.xbm new file mode 100644 index 0000000..1b332cf --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_Z_addr.xbm @@ -0,0 +1,8 @@ +#define _z_addr.xbm_width 20 +#define _z_addr.xbm_height 20 +static unsigned char _z_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, + 0x60, 0x60, 0x00, 0x20, 0x60, 0x00, 0x20, 0x30, 0x00, 0x00, 0x18, 0x00, + 0x00, 0x0c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x00, 0x80, 0x01, 0x00, + 0xc0, 0x00, 0x00, 0x60, 0x40, 0x00, 0x60, 0x40, 0x00, 0x60, 0x60, 0x00, + 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_address.xpm b/PB16_1999_release/POSTBUILD/images/pb_address.xpm new file mode 100644 index 0000000..51bbf3b --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_address.xpm @@ -0,0 +1,30 @@ +/* XPM */ +static char * address_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"13 19 5 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor3 m black c red", +"o s iconGray2 m white c #bdbdbdbdbdbd", +"O s iconGray4 m white c #949494949494", +/* pixels */ +" ", +" ", +" ", +" ..........", +" .XXXXXXXX. ", +" .XXXXXXXX. .", +".......... ", +". . . .", +" ", +". . . .", +" ", +". . . .", +" .o . o. o.", +". . o . ", +"o. O. ", +".o. . . .. ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_advisor.xpm b/PB16_1999_release/POSTBUILD/images/pb_advisor.xpm new file mode 100644 index 0000000..74f0eea --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_advisor.xpm @@ -0,0 +1,55 @@ +/* XPM */ +static char * pb_advisor_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"32 32 17 1 0 0", +/* colors */ +" s iconColor6 m white c yellow", +". c #AAAABFBFBFBF", +"X s iconColor5 m black c blue", +"o c #AAAA80808080", +"O c #5555BFBFBFBF", +"+ c #555580808080", +"@ s bottomShadowColor m black c #636363636363", +"# s iconColor1 m black c black", +"$ s iconColor2 m white c white", +"% s iconGray4 m white c #949494949494", +"& s iconGray8 m black c #212121212121", +"* c #000000008080", +"= c #00000000BFBF", +"- c #AAAABFBF8080", +"; c #AAAA8080BFBF", +": c #5555BFBF8080", +"> s iconGray1 m white c #dededededede", +/* pixels */ +" ... .... ", +" XXXXXXX..o.o...ooOo..XXXXXXXXX ", +" XXXXXoXo.o+.+oo@.+.o..o##XXXXX ", +" XXX#.o.o.+.o.o.@.o@@o.oo.#XXXX ", +" XXXo.oo@@o.o.o@.o@Oo.@+.o+#XXX ", +" XX.@OooOo@ooOo@o@@o.@@o.+o.oXX ", +" X#o.@ooo.o@+.o@@@@@.@o@@..oXXX ", +" Xo@oo.@o.$@@o.@o.@@@@@.+@@%.XX ", +" o@.o@oo.o@$ @@@ $ $ $@@oo.oXXX ", +" o.@o.@o@@$ $ $ $ $ $ $ @.o.ooX ", +"oo@.@oo@@o.$ $ $ $ $ $ $@o.o.oX ", +"o@o@.@o@.o. $ $ $ $ $ $ $@oOo.o ", +"o.@o@o@@@.oo.$ $ $ $ $ $ @o&o+. ", +".@.@o@@.@o+o$ $ $ $ $ $ $@ooOo. ", +"oo@.@o@@@o@@@@@$ $ $@@@$ $#o&.X ", +".@o@.@o@o@@ @ @@$ $@@ $ ##%XX ", +"o.@@@@@@o@ @@@@@ $@@*=@@@$#.oXX ", +" @@oo@@.o.@=* @.o @@* @oo.#%XXX ", +" .@.@o@o.oo@*$ .o$@o $ $o#oXXXX ", +" o@.@o@oO@$ $ $o$ $ $ $ $#.XXXX ", +" X@@@@@.o@ $ $ +o$ $ $ $ #XXXXX ", +" XX@o.@.o@$ $ o@@ $ $ $ $#XXXXX ", +" XXX@o@o.o@$ $@@o$ $ $ $ #XXXXX ", +" XXXX@oo.o-@$@@.@ $o$ $ #XXXXXX ", +" XXXX@.o.o.oo.o@@@@@ $ $#XXXXXX ", +" XXXXX-;:;@.o@@@@@.@@ $ #XXXXXX ", +" XXXXXo.o.@o@@@@@o@@@@ #XXXXXXX ", +" XXXXXXo;-@o@@@o.oo@@@>XXXXXXXX ", +" XXXXXXXXo.oo.o$ o $@>XXXXXXXXX ", +" XXXXXXXXX.o.@$ $ $ $XXXXXXXXXX ", +" XXXXXXXXXXo.o@$o$o>XXXXXXXXXXX ", +" o.o@o> "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_b_arrow.xpm b/PB16_1999_release/POSTBUILD/images/pb_b_arrow.xpm new file mode 100644 index 0000000..9445623 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_b_arrow.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char * b_arrow_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"45 25 5 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconGray6 m black c #636363636363", +"o s iconColor6 m white c yellow", +"O s bottomShadowColor m black c #636363636363", +/* pixels */ +" ", +" . ", +" ..X ", +" .o.X ", +" .oo.X ", +" .ooo.X ", +" .oooo.X ", +" .ooooo.X ", +" .oooooo................................ ", +" .ooooooooooooooooooooooooooooooooooooooOX", +" .oooooooooooooooooooooooooooooooooooooooOX", +" .ooooooooooooooooooooooooooooooooooooooooOX", +" .oooooooooooooooooooooooooooooooooooooooooOX", +" .ooooooooooooooooooooooooooooooooooooooooOX", +" .oooooooooooooooooooooooooooooooooooooooOX", +" .ooooooooooooooooooooooooooooooooooooooOX", +" .oooooo................................X", +" .ooooo.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +" .oooo.X ", +" .ooo.X ", +" .oo.X ", +" .o.X ", +" ..X ", +" .X ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_balloon.xpm b/PB16_1999_release/POSTBUILD/images/pb_balloon.xpm new file mode 100644 index 0000000..ec2dbce --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_balloon.xpm @@ -0,0 +1,40 @@ +/* XPM */ +static char * _balloon_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"24 24 10 1 0 0", +/* colors */ +" s none m none c none", +". s iconGray3 m white c #adadadadadad", +"X s iconGray5 m black c #737373737373", +"o s iconColor1 m black c black", +"O s iconColor6 m white c yellow", +"+ c #00000000FFFF", +"@ s iconColor5 m black c blue", +"# c #AAAA80808080", +"$ c #5555BFBFBFBF", +"% c #AAAABFBFBFBF", +/* pixels */ +" ", +" .XoooooooX. ", +" oXOOOOOOOOOXo ", +" ooOOOO+++++OOOOoo ", +" oOOOOO+OOO+++OOOOOo ", +" oOOOOOO+@OOO++OOOOOOo ", +" oOOOOOO++OOO++OOOOOOo ", +" oOOOOOOOOOOO+++OOOOOOOo", +" oOOOOOOOOOOO++OOOOOOOOo", +" oOOOOOOOOOO++OOOOOOOOOo", +" oOOOOOOOOOO+OOOOOOOOOOo", +" oOOOOOOOOOOOOOOOOOOOX#", +" oOOOOOOOOO+OOOOOOOOOo$", +" ooOOOOOO+++OOOOOOOo%%", +" #ooOOOOO+OOOOOOoo%$ ", +" %$oXOOOOOOOooo$$$ ", +" #%#oOOOOooo%%$$% ", +" %oOOOo%$%$$% ", +" oOOo%$%% ", +" oOo$% ", +" oo%# ", +" o$% ", +" %# ", +" % "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_blank.xpm b/PB16_1999_release/POSTBUILD/images/pb_blank.xpm new file mode 100644 index 0000000..e1e2499 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_blank.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static char * blank_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"10 20 1 1 0 0", +/* colors */ +" s none m none c none", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_blank_addr.xbm b/PB16_1999_release/POSTBUILD/images/pb_blank_addr.xbm new file mode 100644 index 0000000..fb0b200 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_blank_addr.xbm @@ -0,0 +1,7 @@ +#define blank_addr.xbm_width 3 +#define blank_addr.xbm_height 20 +#define blank_addr.xbm_x_hot 0 +#define blank_addr.xbm_y_hot 0 +static unsigned char blank_addr.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_blank_f.xpm b/PB16_1999_release/POSTBUILD/images/pb_blank_f.xpm new file mode 100644 index 0000000..d9b5dd7 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_blank_f.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static char * pb_blank_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"10 20 2 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor2 m white c white", +/* pixels */ +" ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_block.xpm b/PB16_1999_release/POSTBUILD/images/pb_block.xpm new file mode 100644 index 0000000..5db0069 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_block.xpm @@ -0,0 +1,32 @@ +/* XPM */ +static char * block_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"170 21 5 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor3 m black c red", +"o s iconColor6 m white c yellow", +"O s iconColor7 m white c cyan", +/* pixels */ +" ", +" ", +" ", +" ", +" .......... ", +" .XXXXXXXX.. ", +" .XXXXXXXX.o. ", +" ..........oo. ", +" .OOOOOOOO.oo. ", +" .OOOOOOOO.oo. ", +" .OOOOOOOO.oo. ", +" .OOOOOOOO.oo. ", +" .OOOOOOOO.oo. ", +" .OOOOOOOO.oo. ", +" .OOOOOOOO.o. ", +" .OOOOOOOO.. ", +" .......... ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_block_s.xpm b/PB16_1999_release/POSTBUILD/images/pb_block_s.xpm new file mode 100644 index 0000000..3cad4d5 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_block_s.xpm @@ -0,0 +1,30 @@ +/* XPM */ +static char * block_s_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"13 19 5 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor3 m black c red", +"o s iconColor6 m white c yellow", +"O s iconColor7 m white c cyan", +/* pixels */ +" ", +" ", +" ", +" ..........", +" .XXXXXXXX..", +" .XXXXXXXX.o.", +"..........oo.", +".OOOOOOOO.oo.", +".OOOOOOOO.oo.", +".OOOOOOOO.oo.", +".OOOOOOOO.oo.", +".OOOOOOOO.oo.", +".OOOOOOOO.oo.", +".OOOOOOOO.o. ", +".OOOOOOOO.. ", +".......... ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_both.xpm b/PB16_1999_release/POSTBUILD/images/pb_both.xpm new file mode 100644 index 0000000..c9d022b --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_both.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char * optnows_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"10 20 3 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor3 m black c red", +"X s iconColor5 m black c blue", +/* pixels */ +" ", +" ", +" ... ", +" .. .. ", +" .. .. ", +" . . ", +" .. .. ", +" .. .. ", +" ... ", +" ", +" ", +" ", +" ", +" XX XX ", +" XXX XX ", +" XX X XX ", +" XX XXX ", +" XX XX ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_both_f.xpm b/PB16_1999_release/POSTBUILD/images/pb_both_f.xpm new file mode 100644 index 0000000..b582c2c --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_both_f.xpm @@ -0,0 +1,30 @@ +/* XPM */ +static char * pb_both_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"10 20 4 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor2 m white c white", +"X s iconColor3 m black c red", +"o s iconColor5 m black c blue", +/* pixels */ +" ", +"......... ", +"...XXX... ", +"..XX.XX.. ", +".XX...XX. ", +".X.....X. ", +".XX...XX. ", +"..XX.XX.. ", +"...XXX... ", +"......... ", +"......... ", +"......... ", +"......... ", +".oo...oo. ", +".ooo..oo. ", +".oo.o.oo. ", +".oo..ooo. ", +".oo...oo. ", +"......... ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_ck_def.xbm b/PB16_1999_release/POSTBUILD/images/pb_ck_def.xbm new file mode 100644 index 0000000..c711dd1 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_ck_def.xbm @@ -0,0 +1,5 @@ +#define ck_def.xbm_width 12 +#define ck_def.xbm_height 12 +static unsigned char ck_def.xbm_bits[] = { + 0xff, 0x07, 0x01, 0x0c, 0x55, 0x0d, 0x01, 0x0c, 0x55, 0x0d, 0x01, 0x0c, + 0x55, 0x0d, 0x01, 0x0c, 0x55, 0x0d, 0x01, 0x0c, 0xff, 0x0f, 0xfe, 0x0f}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_ck_off.xbm b/PB16_1999_release/POSTBUILD/images/pb_ck_off.xbm new file mode 100644 index 0000000..1df5fba --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_ck_off.xbm @@ -0,0 +1,5 @@ +#define ck_off.xbm_width 12 +#define ck_off.xbm_height 12 +static unsigned char ck_off.xbm_bits[] = { + 0xff, 0x07, 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x0c, + 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x0c, 0xff, 0x0f, 0xfe, 0x0f}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_ck_on.xbm b/PB16_1999_release/POSTBUILD/images/pb_ck_on.xbm new file mode 100644 index 0000000..747dd5c --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_ck_on.xbm @@ -0,0 +1,5 @@ +#define ck_on.xbm_width 12 +#define ck_on.xbm_height 12 +static unsigned char ck_on.xbm_bits[] = { + 0xff, 0x07, 0x01, 0x0c, 0x01, 0x0d, 0x81, 0x0d, 0xc5, 0x0d, 0xed, 0x0c, + 0x7d, 0x0c, 0x39, 0x0c, 0x11, 0x0c, 0x01, 0x0c, 0xff, 0x0f, 0xfe, 0x0f}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_comb_entry.xpm b/PB16_1999_release/POSTBUILD/images/pb_comb_entry.xpm new file mode 100644 index 0000000..705f5ee --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_comb_entry.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static char * comb_entry_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"300 20 1 1 0 0", +/* colors */ +" s none m none c none", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_event.xpm b/PB16_1999_release/POSTBUILD/images/pb_event.xpm new file mode 100644 index 0000000..5bcffdd --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_event.xpm @@ -0,0 +1,37 @@ +/* XPM */ +static char * evnt_nav_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"170 25 6 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor6 m white c yellow", +"o s iconColor7 m white c cyan", +"O s iconColor3 m black c red", +"+ s iconColor5 m black c blue", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ...... ", +" .XXXX.. ", +" ......o. ", +" .OOOO.o. ", +" .OOOO.o. ", +" .OOOO.o...... ", +" .OOOO..XXXX.. ", +" ...........+. ", +" .oooo..oooo.+. ", +" ......O.oooo.+. ", +" .XXXX.O.oooo.+. ", +" .XXXX.O.oooo.. ", +" .XXXX.O...... ", +" .XXXX.. ", +" ...... ", +" ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_f_arrow.xpm b/PB16_1999_release/POSTBUILD/images/pb_f_arrow.xpm new file mode 100644 index 0000000..de04573 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_f_arrow.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char * f_arrow_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"45 25 5 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor6 m white c yellow", +"o s bottomShadowColor m black c #636363636363", +"O s iconGray6 m black c #636363636363", +/* pixels */ +" ", +" . ", +" .. ", +" .X. ", +" .XX. ", +" .XXX. ", +" .XXXX. ", +" .XXXXX. ", +" o...............................XXXXXX. ", +" oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ", +" oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ", +" oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ", +" oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ", +" oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.O ", +" oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.OO ", +" oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.OO ", +" ................................XXXXXX.OO ", +" OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.XXXXX.OO ", +" .XXXX.OO ", +" .XXX.OO ", +" .XX.OO ", +" .X.OO ", +" ..OO ", +" .OO ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_file.xpm b/PB16_1999_release/POSTBUILD/images/pb_file.xpm new file mode 100644 index 0000000..8c0085a --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_file.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char * pb_file_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"24 24 5 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor7 m white c cyan", +"o s iconGray1 m white c #dededededede", +"O s iconColor6 m white c yellow", +/* pixels */ +" ", +" ", +" ", +" ", +" ................. ", +" .X.ooooooooooo.X. ", +" .X.ooooooooooo.X. ", +" .X.ooooooooooo.X. ", +" .X.ooooooooooo.X. ", +" .X.ooooooooooo.X. ", +" .X.ooooooooooo.X. ", +" .X.ooooooooooo.X. ", +" .X.............X. ", +" .XXXXXXXXXXXXXXX. ", +" .XXXXXXXXXXXXXXX. ", +" .XXX..........XX. ", +" .XXX..........XX. ", +" .XXX......OO..XX. ", +" .XXX......OO..XX. ", +" .XXX..........XX. ", +" ............... ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_folder.xpm b/PB16_1999_release/POSTBUILD/images/pb_folder.xpm new file mode 100644 index 0000000..e143686 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_folder.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * folder_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"16 12 4 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconGray4 m white c #949494949494", +"o s iconColor6 m white c yellow", +/* pixels */ +" .....X ", +" .ooooo.X ", +".............X ", +".ooooooooooo.X ", +".ooooooooooo.X ", +".ooooooooooo.X ", +".ooooooooooo.X ", +".ooooooooooo.X ", +".ooooooooooo.X ", +".ooooooooooo.X ", +".............X ", +"XXXXXXXXXXXXXX "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_format.xpm b/PB16_1999_release/POSTBUILD/images/pb_format.xpm new file mode 100644 index 0000000..80a3191 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_format.xpm @@ -0,0 +1,31 @@ +/* XPM */ +static char * format_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"13 19 6 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor2 m white c white", +"o s iconGray4 m white c #949494949494", +"O s iconColor5 m black c blue", +"+ s iconColor4 m white c green", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +"............ ", +".XXXXXXXXXX.o", +".XOOOOOOOOX.o", +".XO++O+++OX.o", +".XOOOOOOOOX.o", +".XO++O+++OX.o", +".XOOOOOOOOX.o", +".XXXXXXXXXX.o", +"............o", +" oooooooooooo", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_hand.mask b/PB16_1999_release/POSTBUILD/images/pb_hand.mask new file mode 100644 index 0000000..1a19528 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_hand.mask @@ -0,0 +1,9 @@ +#define hand.mask_width 13 +#define hand.mask_height 19 +#define hand.mask_x_hot 0 +#define hand.mask_y_hot 0 +static unsigned char hand.mask_bits[] = { + 0xe0, 0x00, 0xf0, 0x01, 0xf8, 0x03, 0xfc, 0x07, 0xfc, 0x0f, 0xfc, 0x1f, + 0xfe, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, + 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xfe, 0x1f, 0xfc, 0x0f, 0xf8, 0x0f, + 0xf0, 0x07}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_hand.xbm b/PB16_1999_release/POSTBUILD/images/pb_hand.xbm new file mode 100644 index 0000000..9e13ce0 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_hand.xbm @@ -0,0 +1,9 @@ +#define hand.xbm_width 13 +#define hand.xbm_height 19 +#define hand.xbm_x_hot 0 +#define hand.xbm_y_hot 0 +static unsigned char hand.xbm_bits[] = { + 0x00, 0x00, 0xe0, 0x00, 0xb0, 0x01, 0xa8, 0x02, 0xa8, 0x06, 0xa8, 0x0a, + 0xa8, 0x0a, 0xae, 0x0a, 0xaa, 0x0a, 0x0a, 0x08, 0x0a, 0x08, 0x0a, 0x08, + 0x02, 0x08, 0x02, 0x08, 0x02, 0x08, 0x04, 0x08, 0x08, 0x04, 0x10, 0x04, + 0x00, 0x00}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_help_dia.xpm b/PB16_1999_release/POSTBUILD/images/pb_help_dia.xpm new file mode 100644 index 0000000..47e01a7 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_help_dia.xpm @@ -0,0 +1,43 @@ +/* XPM */ +static char * _help_dia_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"24 24 13 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconGray4 m white c #949494949494", +"o s iconColor6 m white c yellow", +"O s iconColor2 m white c white", +"+ s iconGray5 m black c #737373737373", +"@ s iconColor4 m white c green", +"# s iconGray3 m white c #adadadadadad", +"$ s iconGray2 m white c #bdbdbdbdbdbd", +"% s iconGray6 m black c #636363636363", +"& s iconGray1 m white c #dededededede", +"* s iconColor7 m white c cyan", +"= s iconColor5 m black c blue", +/* pixels */ +" ", +" ......X ", +" .oooooo.X ", +" ...................... ", +" .OOOOOOOOOOOOOOOOOOOO.X", +" .OXXO+O+O+OXXXXXXXXXO.X", +" .OXOO+O+O+OOOOOOOOOXO.X", +" .OXOOOOOOOO+++++++OXO.X", +" .OXO.O.O.OO+@@@@@#OXO.X", +" .OXO$O$O$OO+######OXO.X", +" .OXOOOOOOOOOOOOOOOOXO.X", +" .OXOXXXXXXXX%OOOOOO&O+X", +" .OXOX*O*O*O*%OOO=====#X", +" .OXOXO*OXXXO%OO=OOO===X", +" .OXOX*O*O*O*%O&==OOO==X", +" .OXOX%%%%%%%%O&==OOO==X", +" .OXOOOOOOOOOOO&&&OO===X", +" .OXXXXXXXXXXXXXXXX&==XX", +" .OOOOOOOOOOOOOOOOO==O+X", +" .OOOOOOOOOOOOOOOOO=$O.X", +" .................X&X..X", +" XXXXXXXXXXXXXXXXX=XXXX", +" === ", +" X=X "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_help_man.xpm b/PB16_1999_release/POSTBUILD/images/pb_help_man.xpm new file mode 100644 index 0000000..719f222 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_help_man.xpm @@ -0,0 +1,51 @@ +/* XPM */ +static char * _help_man_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"24 24 21 1 0 0", +/* colors */ +" s none m none c none", +". c #AAAA0000BFBF", +"X c #AAAA00008080", +"o c #000000000000", +"O c #AAAA8080BFBF", +"+ c #55550000BFBF", +"@ c #AAAA80808080", +"# c #AAAABFBF0000", +"$ c #FFFFFFFF0000", +"% s iconGray4 m white c #949494949494", +"& c #5555BFBF0000", +"* s iconGray6 m black c #636363636363", +"= c #555500008080", +"- c #AAAA80800000", +"; c #AAAABFBF8080", +": c #AAAABFBFBFBF", +"> c #555580800000", +", c #FFFFBFBFBFBF", +"< c #FFFFBFBFFFFF", +"1 c #AAAABFBFFFFF", +"2 s iconColor2 m white c white", +/* pixels */ +" .Xo ", +" XOX+oo ", +" XOX.X.Xoo ", +" .@X+X.XX.Xoo ", +" X@X.XX#$$#X.Xoo ", +" .@.+.X$$X$$$.X.Xo%", +" .@..X.X#&X.#$&X.X.*", +" .@X+X..X=.=##$#XXXo ", +" .@..X.X.X-#$$$$X.Xo* ", +" XOX+X.X.X-$$#-.X.Xo;* ", +" XOX.X.XXXXX#-.X.XXo;:* ", +"XoooX.XXX#$>X.X.XXo@:,* ", +".o@:ooX+X-$-.XX.Xo;:<1*%", +".o,2:@ooX+XX=.X.o;:<1;X*", +"Xo:222O;oo.XX.Xo@1<:;.o ", +"Xo,22222:@oo+Xo;1,1;.o ", +"X.X2222222@:oo;1<1;.o ", +" oo.X2222222@:1<:;.o ", +" ooX.222222:,1;Xo ", +" ooXX2222,1;Xo ", +" ooX+22;;.o ", +" ooX@;Xo ", +" oo.o ", +" %* "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_hg500.gif b/PB16_1999_release/POSTBUILD/images/pb_hg500.gif new file mode 100644 index 0000000..c4b10cc Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/pb_hg500.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/pb_info.xpm b/PB16_1999_release/POSTBUILD/images/pb_info.xpm new file mode 100644 index 0000000..22b0358 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_info.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char * _info_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"24 24 4 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor5 m black c blue", +"o s iconColor6 m white c yellow", +/* pixels */ +" ", +" ", +" ", +" . ", +" .. XXXXXX ", +" .o. X XXX ", +" .oo. XXX XXX ", +" .ooo. XXX XXX ", +" .oooo. XXX XXX ", +" .ooooo. XXXX ", +" .oooooo. XXX ", +" .ooo..... XXX ", +" .oo.. XX ", +" .o. . XX ", +" .. . XX ", +" . . ", +" . XX ", +" . XXXX ", +" . XX ", +" . ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_listing.xpm b/PB16_1999_release/POSTBUILD/images/pb_listing.xpm new file mode 100644 index 0000000..6b4cb17 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_listing.xpm @@ -0,0 +1,49 @@ +/* XPM */ +static char * pb_listing_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"32 32 11 1 0 0", +/* colors */ +" s iconColor6 m white c yellow", +". s iconColor5 m black c blue", +"X s iconColor2 m white c white", +"o s iconGray1 m white c #dededededede", +"O s iconGray8 m black c #212121212121", +"+ s iconColor1 m black c black", +"@ s iconGray6 m black c #636363636363", +"# s iconGray5 m black c #737373737373", +"$ s iconGray7 m black c #424242424242", +"% s iconGray3 m white c #adadadadadad", +"& s iconGray4 m white c #949494949494", +/* pixels */ +" ", +" .............................. ", +" .............................. ", +" .............................. ", +" ....XXXXXXXXXXXXXXXXXXX....... ", +" ....XoooooooooooooooooO....... ", +" ....Xo+@o+o@+@ooooooooO....... ", +" ....XoooooooooooooooooO....... ", +" ....Xo++o@oOo+@+o@+oooO....... ", +" ....XoooooooooooooooooO....... ", +" ....XoooooooooooooooooO....... ", +" ....Xo@+o+#+#oooooooooO....... ", +" ....Xoooooo$+#%oooooooO....... ", +" ....Xoooooo$%XX%%oooooO....... ", +" ....Xooooooo$Xo %%ooooO....... ", +" ....Xooooooo$@%o %%oooO....... ", +" ....Xoooooooo$@%o %%ooO....... ", +" ....Xoooooooo%$@%o %%oO....... ", +" ....Xoooooooo%%$@%o %%O....... ", +" ....Xooooooooo%%$@%o %#....... ", +" ....Xoooooooooo%%$@%o %#...... ", +" ....Xooooooooooo%%$@%o %#..... ", +" ....Xoooooooooooo%%$@%o$$#.... ", +" ....Xooooooooooooo%%$@%oo&.... ", +" ....Xoooooooooooooo%%$@&o&.... ", +" ....Xooooooooooooooo%%$&&$.... ", +" ....Xoooooooooooooooo%O$$$.... ", +" ....X++++++++++++++++++....... ", +" .............................. ", +" .............................. ", +" .............................. ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_mach_kin.xpm b/PB16_1999_release/POSTBUILD/images/pb_mach_kin.xpm new file mode 100644 index 0000000..9398272 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_mach_kin.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char * mach_comp_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"18 18 10 1 0 0", +/* colors */ +" s none m none c none", +". s iconGray4 m white c #949494949494", +"X c #808080800000", +"o s iconColor1 m black c black", +"O c #BFBFBFBFBFBF", +"+ c #000000000000", +"@ c #808080808080", +"# s iconColor6 m white c yellow", +"$ s iconColor2 m white c white", +"% c #FFFFFFFF0000", +/* pixels */ +" ", +" .... ", +" Xoo O++@ X++ ", +" X##+@$@+X+$XX ", +" XX%X@@@++$%XX ", +" XX$X@$@+X%XXo ", +" +++X%+@$@++$XX++ ", +"X$%$%+$@$@+$+$%$%+", +"XXXX$%X++++X$%+XX+", +"XXXo%$%#X#X$%$+XX+", +" Xo%##X%$%$X#%$++ ", +" o##XXXX%$+XXX%$+ ", +" XX+XX+X$%+++XXX+ ", +" XX+X+ X%$+ X+XX+ ", +" +++ XXX+ ++ ", +" +XX+ ", +" ++ ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_machine.xpm b/PB16_1999_release/POSTBUILD/images/pb_machine.xpm new file mode 100644 index 0000000..a551005 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_machine.xpm @@ -0,0 +1,49 @@ +/* XPM */ +static char * pb_machine_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"32 32 11 1 0 0", +/* colors */ +" s iconColor6 m white c yellow", +". s iconColor5 m black c blue", +"X s iconGray1 m white c #dededededede", +"o s iconGray3 m white c #adadadadadad", +"O s iconGray5 m black c #737373737373", +"+ s iconColor7 m white c cyan", +"@ s iconColor2 m white c white", +"# s iconColor1 m black c black", +"$ s iconGray4 m white c #949494949494", +"% s iconGray2 m white c #bdbdbdbdbdbd", +"& s iconColor3 m black c red", +/* pixels */ +" ", +" .............................. ", +" .............................. ", +" .............................. ", +" ..........XXXXXXXXX........... ", +" ..........XXXXXXXXX........... ", +" ..........XoooooooX........... ", +" ...........ooooooo............ ", +" ...........ooooooo............ ", +" ............ooooo............. ", +" .............OOO.............. ", +" .............OOO.............. ", +" .............. ............... ", +" .............. ............... ", +" .........+++.. ............... ", +" .........+++.. .++............ ", +" .........+++....++............ ", +" .......@@+++++++++@@.......... ", +" .......@#o#####ooo#@..... .... ", +" ....XXXXXXXXXXXXXXXXXXXX.@.... ", +" ....XXXXXXXXXXXXXXXXXXXXo .... ", +" ........$$$$$$$$$$$$$....@.... ", +" ..........%% %%%%%...... .... ", +" ..........%@%% %&&%........... ", +" ..........%@%% %&&%........... ", +" ..........%%@@%%%%%........... ", +" .........$$$$$$$$$$$.......... ", +" ......OOOOOOOOOOOOOOOOO....... ", +" .............................. ", +" .............................. ", +" .............................. ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_mcd.xpm b/PB16_1999_release/POSTBUILD/images/pb_mcd.xpm new file mode 100644 index 0000000..df63bd5 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_mcd.xpm @@ -0,0 +1,49 @@ +/* XPM */ +static char * pb_mcd_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"32 32 11 1 0 0", +/* colors */ +" s iconColor6 m white c yellow", +". s iconColor5 m black c blue", +"X s iconGray2 m white c #bdbdbdbdbdbd", +"o s iconGray1 m white c #dededededede", +"O s iconColor2 m white c white", +"+ s iconGray3 m white c #adadadadadad", +"@ s iconColor4 m white c green", +"# s iconGray4 m white c #949494949494", +"$ s iconColor1 m black c black", +"% s iconGray6 m black c #636363636363", +"& s iconGray8 m black c #212121212121", +/* pixels */ +" ", +" .............................. ", +" .............................. ", +" .............................. ", +" ....XXoOOOoX.................. ", +" ....+@@#@#@XOO................ ", +" ....o@#@#@$@X@OX.............. ", +" ....%#@$@#@X##%O.............. ", +" ....+@#@#@$@#%OX.............. ", +" ....o#@$@#@#OO#@.............. ", +" ....%@#@#@OOX##X.............. ", +" ....o#@#OO%#X@#@.............. ", +" ....+@#O#&X#@##X.............. ", +" ....o#@O%%%%###@.............. ", +" ....%@#OOO####%%.............. ", +" ....o#OO@@XOOOOOOOOOOOOOOO.... ", +" .......O@@@@@@@@@@@@@@@@@@.... ", +" .......O@@$@@@@@$@@@@@@@@X.... ", +" .......O@@@@@$@@@@@#@@$@+$.... ", +" .......O@@@@@@@@$@@$@@@@@X.... ", +" .......O@@$@@@@@X@@@@@@@@@.... ", +" .......O@@@@@$@@@@@@@@$@@$.... ", +" .......O@@$@@@@@@@@@@@X@+@.... ", +" .......O@@#@@@@@$@@$@@@@@$.... ", +" .......O@@@@@$@@@@@@@@$@@X.... ", +" ........OO@@@#@@@@@@@@@@X@.... ", +" ..........XOOOOOOOOOOOOOOO.... ", +" .............................. ", +" .............................. ", +" .............................. ", +" .............................. ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_mill_3axis.gif b/PB16_1999_release/POSTBUILD/images/pb_mill_3axis.gif new file mode 100644 index 0000000..ffe6462 Binary files /dev/null and b/PB16_1999_release/POSTBUILD/images/pb_mill_3axis.gif differ diff --git a/PB16_1999_release/POSTBUILD/images/pb_new.xpm b/PB16_1999_release/POSTBUILD/images/pb_new.xpm new file mode 100644 index 0000000..a6dbcf6 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_new.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char * pb_new_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"24 24 6 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor2 m white c white", +"o s iconColor6 m white c yellow", +"O s iconGray3 m white c #adadadadadad", +"+ s iconGray2 m white c #bdbdbdbdbdbd", +/* pixels */ +" ", +" ", +" ", +" ", +" .......... ", +" .XXXXXXXX.. ", +" o .XXXXXXXX.X. ", +" Oo.Xo+XXXXX.XX. ", +" +oo+XXXXXX..... ", +" ooo+ooXXXXXXXXX. ", +" +o+o++XXXXXXXXX. ", +" o+.XoXXXXXXXXXX. ", +" .XXOXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .............. ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_nows.xpm b/PB16_1999_release/POSTBUILD/images/pb_nows.xpm new file mode 100644 index 0000000..cec2465 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_nows.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static char * nows_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"10 20 2 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor5 m black c blue", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .. .. ", +" ... .. ", +" .. . .. ", +" .. ... ", +" .. .. ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_nows_f.xpm b/PB16_1999_release/POSTBUILD/images/pb_nows_f.xpm new file mode 100644 index 0000000..da685b5 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_nows_f.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char * pb_nows_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"10 20 3 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor2 m white c white", +"X s iconColor5 m black c blue", +/* pixels */ +" ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +".XX...XX. ", +".XXX..XX. ", +".XX.X.XX. ", +".XX..XXX. ", +".XX...XX. ", +"......... ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_open.xpm b/PB16_1999_release/POSTBUILD/images/pb_open.xpm new file mode 100644 index 0000000..f164b37 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_open.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char * pb_open_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"24 24 6 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor6 m white c yellow", +"o s iconGray6 m black c #636363636363", +"O s iconGray5 m black c #737373737373", +"+ s iconGray4 m white c #949494949494", +/* pixels */ +" ", +" ", +" ", +" ... ", +" . . . ", +" .. ", +" ...... ... ", +" .XXXXXX. ", +" .XXXXXXXX....... ", +" .XXXXXXXXXXXXXX. ", +" .XXXX.............. ", +" .XXXX.XoXoXoXoXOX+. ", +" .XXX.XoXoXoXoXOXO. ", +" .XXX.+XoXoXoXOXOX. ", +" .XX.+XoXoXoXOXOX. ", +" .XX.XoXoXoXOXOX+. ", +" .X.XOXOXOXOXOXO. ", +" .X.OXOXOXOXOXOX. ", +" ..+XOXOXOXOXOX. ", +" ............... ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_opt.xpm b/PB16_1999_release/POSTBUILD/images/pb_opt.xpm new file mode 100644 index 0000000..0d520a7 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_opt.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static char * optional_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"10 20 2 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor3 m black c red", +/* pixels */ +" ", +" ", +" ... ", +" .. .. ", +" .. .. ", +" . . ", +" .. .. ", +" .. .. ", +" ... ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_opt_f.xpm b/PB16_1999_release/POSTBUILD/images/pb_opt_f.xpm new file mode 100644 index 0000000..e2b9255 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_opt_f.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char * pb_opt_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"10 20 3 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor2 m white c white", +"X s iconColor3 m black c red", +/* pixels */ +" ", +"......... ", +"...XXX... ", +"..XX.XX.. ", +".XX...XX. ", +".X.....X. ", +".XX...XX. ", +"..XX.XX.. ", +"...XXX... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +"......... ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_output.xpm b/PB16_1999_release/POSTBUILD/images/pb_output.xpm new file mode 100644 index 0000000..e2a76ce --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_output.xpm @@ -0,0 +1,52 @@ +/* XPM */ +static char * pb_output_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"32 32 14 1 0 0", +/* colors */ +" s iconColor6 m white c yellow", +". s iconColor5 m black c blue", +"X s iconGray6 m black c #636363636363", +"o s iconGray2 m white c #bdbdbdbdbdbd", +"O s iconColor2 m white c white", +"+ s iconGray4 m white c #949494949494", +"@ s iconGray5 m black c #737373737373", +"# s iconGray3 m white c #adadadadadad", +"$ s iconGray1 m white c #dededededede", +"% s iconGray7 m black c #424242424242", +"& s bottomShadowColor m black c #636363636363", +"* s iconColor4 m white c green", +"= s iconGray8 m black c #212121212121", +"- c #383846464E4E", +/* pixels */ +" ", +" .............................. ", +" .............................. ", +" .............................. ", +" .............................. ", +" .......XoOOOOOOOOOo+.......... ", +" .......@#OOOOOOOOO$%.......... ", +" .......+OOOOOOOOOO+%.......... ", +" .......+OooOOOOOoO+%.......... ", +" .......+OOOOOOOOOO+%.......... ", +" .......+OoooooOooO@%.......... ", +" ......&$OOOOOOOOOO@@@@@....... ", +" .....&o$OoooOOoooO%####o...... ", +" .....$@+OOOOOOOOOOX####oo..... ", +" ....$o@XXXXXXXXXXXXXoooooo.... ", +" ....OOOOOOOOOOOOOOOOOOOOO$.... ", +" ....Ooooooooooooo$XXXXXX$#.... ", +" ....O$$$$$$$$$$$$$X****X$#.... ", +" ....O$@@@@@@@@@@@@@XXXXX$#.... ", +" ....O$$$$$$$$$$$$$$$$$$$$#.... ", +" ....O$$$$$$$$$$$$$$$$$$$$#.... ", +" ....O$==============$$$$$#.... ", +" ....$$=$@@@@@@@@@@@=$$$$$#.... ", +" ....==$#############==%%%%.... ", +" ....%%+@@@@@@@@@@@@@%%%%%..... ", +" ....%=XXXXXXXXXXXXXX===%...... ", +" .....@%=============-@........ ", +" .............................. ", +" .............................. ", +" .............................. ", +" .............................. ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_prog.xpm b/PB16_1999_release/POSTBUILD/images/pb_prog.xpm new file mode 100644 index 0000000..7ec902a --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_prog.xpm @@ -0,0 +1,46 @@ +/* XPM */ +static char * pb_prog_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"32 32 8 1 0 0", +/* colors */ +" s iconColor6 m white c yellow", +". s iconColor5 m black c blue", +"X s iconGray3 m white c #adadadadadad", +"o s iconGray1 m white c #dededededede", +"O s iconColor2 m white c white", +"+ s iconGray2 m white c #bdbdbdbdbdbd", +"@ s iconColor7 m white c cyan", +"# s iconGray6 m black c #636363636363", +/* pixels */ +" ", +" .............................. ", +" .............................. ", +" .............................. ", +" .............................. ", +" .........XoooooX.............. ", +" ........oOOOOOOOo............. ", +" ........+oooooooO............. ", +" ........+XXXXX+oO............. ", +" ........+XXXXX+oO............. ", +" ....@@@.+XXXXX+oO.@@@...@@.... ", +" ........+XXXXX+oO..@...@...... ", +" ......@.+XXXXX+oo.@...@....... ", +" .....@...++++++o.@...@...@.... ", +" ....@...@..# O..@...@...@..... ", +" .......@... #O.@...@...@...... ", +" ......@.... +....@...@....... ", +" .....@...@. o...@...@...@.... ", +" ....@...@..# O..@...@...@..... ", +" .......@... #O.@...@...@...... ", +" ......@.... +....@...@....... ", +" .....@...@.o o...@...@...@.... ", +" ....@...@.......@...@...@..... ", +" .......@...@...@...@...@...... ", +" ......@...@...@...@...@....... ", +" .....@...@...@...@...@...@.... ", +" ....@@@@@...@@@@@...@@@@@..... ", +" .............................. ", +" .............................. ", +" .............................. ", +" .............................. ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_screw.xpm b/PB16_1999_release/POSTBUILD/images/pb_screw.xpm new file mode 100644 index 0000000..8d5950c --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_screw.xpm @@ -0,0 +1,42 @@ +/* XPM */ +static char * screw_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"32 32 4 1 0 0", +/* colors */ +" c #BFBFBFBFBFBF", +". c #000000000000", +"X s iconColor2 m white c white", +"o c #808080808080", +/* pixels */ +" ", +" ", +" ", +" ..X ", +" .oo X ", +" .oooo. ", +" .oooo. ", +" .ooo o. ", +" .oo oo. ", +" .o o o. ", +" .oXooo. . . . . . . . . . . ", +" .o .o .....................X ", +" ...oo ..o.o.o.o.o.o.o.o.o.o.X ", +" o.oo.ooooooooooooooooooooo. ", +" X .o .oo o o oXoXoXoXoXoXoo. ", +" ...ooo.oo o o o o o o o o oX. ", +" .oooo .oo o o o o o o o o o X ", +" .ooooo.o.o.o.o.o.o.o.o.o.o.o. ", +" .o ooo.. . . . . . . . . . . ", +" .o o o. ", +" .ooooo. ", +" .oooXo. ", +" .ooooo. ", +" .ooo . ", +" .oooo ", +" .oo . ", +" . . ", +" ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_sequence.xpm b/PB16_1999_release/POSTBUILD/images/pb_sequence.xpm new file mode 100644 index 0000000..5a4eeff --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_sequence.xpm @@ -0,0 +1,32 @@ +/* XPM */ +static char * sequence_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"17 19 7 1 0 0", +/* colors */ +" s none m none c none", +". c #000000000000", +"X c #FFFF00000000", +"o c #FFFFFFFF0000", +"O s iconColor4 m white c green", +"+ s iconColor7 m white c cyan", +"@ s iconColor5 m black c blue", +/* pixels */ +" ", +" .............", +" .XXXXX.ooooo..", +" .............O.", +" .ooooo.+++++..O.", +".............o.O.", +".+++++.XXXXX.o.O.", +".+++++.XXXXX.o.O.", +".+++++.XXXXX.o...", +".+++++.XXXXX.o.X.", +".+++++.XXXXX...X.", +".............+.X.", +".@@@@@.ooooo.+.X.", +".@@@@@.ooooo.+.X.", +".@@@@@.ooooo.+.. ", +".@@@@@.ooooo.+. ", +".@@@@@.ooooo.. ", +"............. ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_sub_seq.xpm b/PB16_1999_release/POSTBUILD/images/pb_sub_seq.xpm new file mode 100644 index 0000000..0fcc6b4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_sub_seq.xpm @@ -0,0 +1,33 @@ +/* XPM */ +static char * sub_seq_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"15 17 10 1 0 0", +/* colors */ +" s none m none c none", +". c #000000000000", +"X s iconColor1 m black c black", +"o c #FFFF00000000", +"O s iconColor3 m black c red", +"+ c #FFFFFFFF0000", +"@ s iconColor4 m white c green", +"# s iconColor6 m white c yellow", +"$ s iconColor7 m white c cyan", +"% s iconColor5 m black c blue", +/* pixels */ +" ", +" ...........", +" XoooOX++++..", +" ...........@.", +" X+++#X$$$$..@.", +"...........+.@.", +"X$$$$X%%%%.+.@.", +"X$$$$X%%%%.+.X.", +"X$$$$X%%%%.+.O.", +"X$$$$X%%%%.X.o.", +"XXXX.XXXXXX$.o.", +"XOOOOX####.$.o.", +"XOOOOX####.$.X ", +"XOOOOX####.$. ", +"XOOOOX####.X ", +"XXXXXXXXXX. ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_textfile.xpm b/PB16_1999_release/POSTBUILD/images/pb_textfile.xpm new file mode 100644 index 0000000..ad53313 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_textfile.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * textfile_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"13 13 4 1 0 0", +/* colors */ +" s none m none c none", +". s iconColor1 m black c black", +"X s iconColor2 m white c white", +"o s iconGray4 m white c #949494949494", +/* pixels */ +" ....... ", +" .XXXXX.. ", +" .XXXXX.X. ", +" .X...X.... ", +" .XXXXXXXX.o ", +" .X..XXXXX.o ", +" .XXXXXXXX.o ", +" .X.....XX.o ", +" .XXXXXXXX.o ", +" .X.....XX.o ", +" .XXXXXXXX.o ", +" ..........o ", +" oooooooooo "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_todo.xpm b/PB16_1999_release/POSTBUILD/images/pb_todo.xpm new file mode 100644 index 0000000..1633e2c --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_todo.xpm @@ -0,0 +1,47 @@ +/* XPM */ +static char * _todo_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"24 24 17 1 0 0", +/* colors */ +" s none m none c none", +". c #000000000000", +"X c #AAAABFBFBFBF", +"o s iconColor1 m black c black", +"O s iconColor2 m white c white", +"+ s iconColor5 m black c blue", +"@ c #00000000FFFF", +"# s iconColor7 m white c cyan", +"$ c #000000008080", +"% s iconGray1 m white c #dededededede", +"& c #00000000BFBF", +"* s iconGray7 m black c #424242424242", +"= s iconGray4 m white c #949494949494", +"- s iconColor3 m black c red", +"; c #AAAA80808080", +": s iconGray6 m black c #636363636363", +"> s iconGray5 m black c #737373737373", +/* pixels */ +" ", +" .........X o..", +" ..OOOOOOOOXo.o+@", +" .OOOOOOOOOOOOOo+@", +"oooooo.OOO.OOOOOOOOOOo+@", +"o####.OOX.OOOOOOOOOOOo+@", +"oooo.OOX.OOX.OOOOOOOOo+@", +"oOO.OOX..OX.OOOOOOOOOo+@", +"oO.OOX...O.OOX.OOOOOXo+$", +"oOoXX.OO.O.OX.OOoXXXoo+$", +"oOoo.O%%.O.O.OXX.oooooo&", +"oO%%%OX%X..O.O*.X%OX.= ", +"oOOOOOOOOO.X.O*OOOOOo= ", +"oO---O%%%%%%.X*%%%OOo= ", +"oO;;;OX;X;X;X::;X;OOo= ", +"oOOOOOOOOOOOOOOOOOOO.= ", +"oO---O%%%%%%%%%%%%OO.= ", +"oO;;;OX;X;X;X;X;X;OO.= ", +"oOOOOOOOOOOOOOOOOOOO.= ", +"oO---O%%%%%%%%%%%%OO.= ", +"oO;;;OX;X;X;X;X;X;OO.= ", +"oOOOOOOOOOOOOOOOOOOO.= ", +"ooooooooooooooooooooo= ", +" >>>>>>>>>>>>>>>>>>>>> "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_toolbox.xpm b/PB16_1999_release/POSTBUILD/images/pb_toolbox.xpm new file mode 100644 index 0000000..16e40cd --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_toolbox.xpm @@ -0,0 +1,52 @@ +/* XPM */ +static char * toolbox_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"40 40 6 1 0 0", +/* colors */ +" s none m none c none", +". c #000000000000", +"X s iconColor2 m white c white", +"o c #FFFF00000000", +"O c #808000000000", +"+ c #BFBFBFBFBFBF", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ...... ", +" .XXXXXX. ", +" ...................... ", +" .oooooooooooooooooooo.O. ", +" ......................OOO. ", +" ......................OO. ", +" ......................O. ", +" .++++++++++++++++++++.. ", +" ...................... ", +" ....................... ", +" ......................O. ", +" ......................OO. ", +" ......................OOO. ", +" .oooooooooooooooooooo.OOO. ", +" .ooooooooo..ooooooooo.OOO. ", +" .ooooooooo..ooooooooo.OOO. ", +" .oooooooooooooooooooo.OOO. ", +" ......................OOO. ", +" .oooooooooooooooooooo.OOO. ", +" .ooooooooo..ooooooooo.OOO. ", +" .ooooooooo..ooooooooo.OO. ", +" .oooooooooooooooooooo.O. ", +" ....................... ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_trash.xpm b/PB16_1999_release/POSTBUILD/images/pb_trash.xpm new file mode 100644 index 0000000..5d9ff88 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_trash.xpm @@ -0,0 +1,54 @@ +/* XPM */ +static char * recycle_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"40 40 8 1 0 0", +/* colors */ +" s none m none c none", +". c #808080808080", +"X s iconColor2 m white c white", +"o s iconGray6 m black c #636363636363", +"O c #BFBFBFBFBFBF", +"+ s iconColor5 m black c blue", +"@ c #000000000000", +"# s iconGray7 m black c #424242424242", +/* pixels */ +" ", +" ", +" ", +" ", +" ... ", +" ...XoX.. ", +" ...XXX.o.XX.. ", +" ..XXX....o.OOXX.. ", +" .XX.......o..OOOXX.. ", +" .X........o..OOOOOXX.. ", +" .XX.......o...OOOOOOXX.. ", +" .OOXX.....o...OOOOOOOOXX.. ", +" .OOOOXX...o....OOOOOOOOOXX.. ", +" .OOOOOXX.o....OOOOOOOOOOOXXo ", +" .OOOOOOOXX.....OOOOOOOOOOXXo ", +" .OOOOOOOOOXX....OOOOOOXXX..o ", +" .OOOOOOOOOOOXX..OOOXXX.....o ", +" .OOOOOOO.++OOXXXXX.......o ", +" .OOOOOO+++++O+OO.........o ", +" .OO++++OOO++++OO.........o ", +" .OOO+++OOOO+++OO.........o ", +" .O++++OOO++++OO........o ", +" .O++O+OOOOOOOOO........o ", +" .O++OOOOOOOO+OO........o ", +" .O++OOOO+OOO+OO........o ", +" .O+.OO++OO.+OO.......o ", +" .OO+O+++++++OO.......o ", +" .OOOO.+++++OOO.......o ", +" ...OOO.+OOOOOO.......o ", +" @@..OO.OOOOOO......o ", +" @@..OOOOOOO......o ", +" @@..OOOOO......o ", +" @@..OOO....##@ ", +" @@..O..##@@ ", +" @@.##@@ ", +" @@@ ", +" ", +" ", +" ", +" "}; diff --git a/PB16_1999_release/POSTBUILD/images/pb_user.xpm b/PB16_1999_release/POSTBUILD/images/pb_user.xpm new file mode 100644 index 0000000..4cb10bb --- /dev/null +++ b/PB16_1999_release/POSTBUILD/images/pb_user.xpm @@ -0,0 +1,50 @@ +/* XPM */ +static char * _user_xpm[] = { +/* width height ncolors cpp [x_hot y_hot] */ +"32 32 12 1 0 0", +/* colors */ +" c #0000FFFFFFFF", +". s iconColor7 m white c cyan", +"X c #000000000000", +"o s iconColor1 m black c black", +"O s iconGray2 m white c #bdbdbdbdbdbd", +"+ s iconColor2 m white c white", +"@ s iconGray4 m white c #949494949494", +"# c #FFFFFFFF0000", +"$ s iconGray6 m black c #636363636363", +"% s iconColor6 m white c yellow", +"& s iconGray1 m white c #dededededede", +"* c #FFFF00000000", +/* pixels */ +" .XXXXX XXXXXo ", +" .XXXXXXXXXXXXXXo ", +" .XXO+XXXX@OXXXXXXo ", +" .XO@XXXXXX@XXXXXXX. ", +" .XX@XXXXXXXXXXXXXXXo ", +" .XXXXXXXXXo+XXXXXXXX. ", +" .XXXXXXXXXo+#+#+XXXXXo ", +" .XXX$oXXoo+#+#+#+o$XXX. ", +" .XX$#+Xo#+#+#+#+%O$XXX. ", +" %XX$+&&OO#+#+#&&&#O$XXo ", +" @XX@#$XXXX#+#XXXX$#$XXo ", +" @+X%+OOOO#+#X#OOO@+$X+o ", +" @#@+#@@X@+#+X+@X@@#@X#o ", +" @+@%+%@X+#+#X#+X@#+@@+o ", +" @#@+#+#+#+#+X+#+#+#O@#o ", +" @+@%+#+#+#+#@O+#+#+O@+X ", +" X@O#+#+#+#+#@#+#+#O@X@ ", +" .$O+#+#+@+#+X+#+#&O@X ", +" .@O#+#+%@XXX@%+#+O@X@ ", +" .O+#+%+%+O+%+%+#O@X ", +" OO+%+%+#+#+%+%+OX ", +" .O#+#Oooooo@#+O@X ", +" OO#+%&OOO&%+%@X. ", +" O@O#+%+%+%+#@@$. ", +" ++@+#+#+#+#+@o@@ ", +" O+++X+#+@+#+XoO@@$ ", +" O+++++oX@o@Xo+++O@XXXX ", +" +++++X++++++X*X+++++OX++&OXXX", +"+++++++++X++++X***X++++X+++++&OO", +"++++++++++X+++X***X+++X+++++++++", +"+++++++++++X+X*****X+X++++++++++", +"++++++++++++X++***++X+++++++++++"}; diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.def new file mode 100644 index 0000000..f317123 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.4_" + FORMAT AbsCoord "&__9.4_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.pui new file mode 100644 index 0000000..6d85105 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.pui @@ -0,0 +1,771 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + + +## POST EVENT HANDLER START +def_file pb_Mill_3_Generic_IN.def +tcl_file pb_Mill_3_Generic_IN.tcl +## POST EVENT HANDLER END + + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 3_axis_mill +mom_kin_machine_resolution .0001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kin_output_unit IN +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kinematic_unit Inch +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +Text "" 0 "Text String" +N "" 0 "Sequence Number" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" "G/G" "XYZ(absolute)/UVW(incremental)" "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null}}} + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null} \ +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_IN.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.def new file mode 100644 index 0000000..8accb34 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.3_" + FORMAT AbsCoord "&__9.3_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.pui new file mode 100644 index 0000000..8c4455e --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_3_Generic_MM.def +tcl_file pb_Mill_3_Generic_MM.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 3_axis_mill +mom_kin_machine_resolution .001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kinematic_unit Inch +mom_kin_output_unit MM +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_3_Generic_MM.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.def new file mode 100644 index 0000000..f317123 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.4_" + FORMAT AbsCoord "&__9.4_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.pui new file mode 100644 index 0000000..4fbb4c3 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_4H_Generic_IN.def +tcl_file pb_Mill_4H_Generic_IN.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 4_axis_head +mom_kin_machine_resolution .0001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kin_output_unit IN +mom_kinematic_unit Inch +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_IN.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.def new file mode 100644 index 0000000..8accb34 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.3_" + FORMAT AbsCoord "&__9.3_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.pui new file mode 100644 index 0000000..ed6102f --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_4H_Generic_MM.def +tcl_file pb_Mill_4H_Generic_MM.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 4_axis_head +mom_kin_machine_resolution .001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kinematic_unit Inch +mom_kin_output_unit MM +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4H_Generic_MM.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.def new file mode 100644 index 0000000..f317123 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.4_" + FORMAT AbsCoord "&__9.4_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.pui new file mode 100644 index 0000000..dae1b5f --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_4T_Generic_IN.def +tcl_file pb_Mill_4T_Generic_IN.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 4_axis_table +mom_kin_machine_resolution .0001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kin_output_unit IN +mom_kinematic_unit Inch +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_IN.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.def new file mode 100644 index 0000000..8accb34 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.3_" + FORMAT AbsCoord "&__9.3_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.pui new file mode 100644 index 0000000..ab3d450 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_4T_Generic_MM.def +tcl_file pb_Mill_4T_Generic_MM.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 4_axis_table +mom_kin_machine_resolution .001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kinematic_unit Inch +mom_kin_output_unit MM +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_4T_Generic_MM.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.def new file mode 100644 index 0000000..f317123 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.4_" + FORMAT AbsCoord "&__9.4_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.pui new file mode 100644 index 0000000..a8f8539 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_5HH_Generic_IN.def +tcl_file pb_Mill_5HH_Generic_IN.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 5_axis_dual_head +mom_kin_machine_resolution .0001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kin_output_unit IN +mom_kinematic_unit Inch +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_IN.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.def new file mode 100644 index 0000000..8accb34 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.3_" + FORMAT AbsCoord "&__9.3_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.pui new file mode 100644 index 0000000..08e3fd4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_5HH_Generic_MM.def +tcl_file pb_Mill_5HH_Generic_MM.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 5_axis_dual_head +mom_kin_machine_resolution .001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kinematic_unit Inch +mom_kin_output_unit MM +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HH_Generic_MM.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.def new file mode 100644 index 0000000..f317123 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.4_" + FORMAT AbsCoord "&__9.4_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.pui new file mode 100644 index 0000000..ea76d1a --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_5HT_Generic_IN.def +tcl_file pb_Mill_5HT_Generic_IN.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 5_axis_head_table +mom_kin_machine_resolution .0001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kin_output_unit IN +mom_kinematic_unit Inch +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_IN.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.def new file mode 100644 index 0000000..8accb34 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.3_" + FORMAT AbsCoord "&__9.3_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.pui new file mode 100644 index 0000000..2c7a425 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_5HT_Generic_MM.def +tcl_file pb_Mill_5HT_Generic_MM.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 5_axis_head_table +mom_kin_machine_resolution .001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kinematic_unit Inch +mom_kin_output_unit MM +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5HT_Generic_MM.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.def new file mode 100644 index 0000000..f317123 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.4_" + FORMAT AbsCoord "&__9.4_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.pui new file mode 100644 index 0000000..8b0327a --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_5TT_Generic_IN.def +tcl_file pb_Mill_5TT_Generic_IN.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 5_axis_dual_table +mom_kin_machine_resolution .0001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kin_output_unit IN +mom_kinematic_unit Inch +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_IN.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.def b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.def new file mode 100644 index 0000000..8accb34 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.def @@ -0,0 +1,586 @@ +############################################################################## +# Description +# This is the definition file for mill3ax +# +# Revisions +# +# Date Who Reason +# 02-jul-1998 whb Original +# 31-jul-1998 whb load_tool_number now tool_number +# 01-feb-1999 mnb Initial +# 02-jun-1999 mnb V16 Code Integration +# 14-Jun-1999 mnb Remove comments +# 29-Jun-1999 mnb Added composite blocks +# 07-Sep-1999 mnb Changed % to & format +# 21-Sep-1999 mnb Changed Format Names +# +# $HISTORY$ +# +############################################################################### +MACHINE mill3ax + +FORMATTING +{ + WORD_SEPARATOR " " + END_OF_LINE "" + SEQUENCE sequence_number 10 10 1 + + FORMAT Coordinate "&__8.3_" + FORMAT AbsCoord "&__9.3_" + FORMAT EventNum "&+03___" + FORMAT Dwell_sec "&__8.3_" + FORMAT Digit_5 "&-_5___" + FORMAT Digit_4 "&_04___" + FORMAT Digit_2 "&_02___" + FORMAT String "%s" + FORMAT Feed_IPM "&__3.2_" + FORMAT Feed_IPR "&__4.1_" + FORMAT Feed_MMPM "&__5.1_" + FORMAT Feed_MMPR "&__6.0_" + FORMAT Feed_FRN "&__4.3_" + FORMAT Feed_INV "&__6.2_" + FORMAT Feed "&__8.4_" + FORMAT Rev "&__4___" + + ADDRESS N { + FORMAT Digit_4 + FORCE off + } + ADDRESS G { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS G_motion { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_feed { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_mode { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_adjust { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_spin { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_plane { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_cutcom { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS G_return { + LEADER "G" + FORMAT Digit_2 + FORCE off + } + ADDRESS X { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Y { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS Z { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fourth_axis { + LEADER "A" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS fifth_axis { + LEADER "B" + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS R { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS I { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS J { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS K_cycle { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "K" + } + ADDRESS cycle_dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS dwell { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS P_cutcom { + FORMAT Dwell_sec + MAX 99999.999 + MIN 0.001 + FORCE off + LEADER "P" + } + ADDRESS cycle_step { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS Q_cutcom { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "Q" + } + ADDRESS cycle_step1 { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + LEADER "I" + } + ADDRESS E { + FORMAT Coordinate + MAX 9999.9999 + MIN -9999.9999 + FORCE off + } + ADDRESS F { + FORMAT Feed + MAX 9999.9 + MIN 0.1 + FORCE off + } + ADDRESS S { + FORMAT Digit_5 + MAX 99999 + MIN 0 + FORCE always + LEADER "S" + } + ADDRESS T { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_coolant { + LEADER "M" + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS M_spindle { + LEADER "M" + FORMAT Digit_2 + FORCE always + } + ADDRESS M { + FORMAT Digit_2 + FORCE off + } + ADDRESS D { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE off + } + ADDRESS H { + FORMAT Digit_2 + MAX 99 + MIN 0 + FORCE always + } + ADDRESS LF_ENUM { + FORMAT Digit_5 + FORCE always + LEADER "" + } + ADDRESS LF_XABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_YABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_ZABS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_AAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_BAXIS { + FORMAT AbsCoord + FORCE always + LEADER "" + } + ADDRESS LF_FEED { + FORMAT Feed + FORCE always + LEADER "" + } + ADDRESS LF_SPEED { + FORMAT Rev + FORCE always + LEADER "" + } + + BLOCK_TEMPLATE rewind_stop_code { + M[$mom_sys_rewind_code] + } + + BLOCK_TEMPLATE output_unit { + G[$mom_sys_unit_code($mom_part_unit)] + } + + BLOCK_TEMPLATE sequence_number { + N[$mom_seqnum] + } + + BLOCK_TEMPLATE coordinate_system { + G[$mom_sys_absolute_pos_reset_code] + } + + BLOCK_TEMPLATE absolute_mode { + G_mode[$mom_sys_output_code(ABSOLUTE)] + } + + BLOCK_TEMPLATE incremental_mode { + G_mode[$mom_sys_output_code(INCREMENTAL)] + } + + BLOCK_TEMPLATE set_mode { + G_mode[$mom_sys_output_code($mom_output_mode)] + } + + BLOCK_TEMPLATE coolant_on { + M_coolant[$mom_sys_coolant_code($mom_coolant_status)] + } + + BLOCK_TEMPLATE return_home { + G[$mom_sys_return_home] + } + + BLOCK_TEMPLATE auto_tool_change { + T[$mom_tool_number] + } + + BLOCK_TEMPLATE auto_tool_change_1 { + M[$mom_sys_tool_change_code] + } + + BLOCK_TEMPLATE manual_tool_change { + M[$mom_sys_program_stop_code] + T[$mom_tool_number] + } + + BLOCK_TEMPLATE rapid_traverse { + G_motion[$mom_sys_rapid_code] + G_mode[$mom_sys_output_code($mom_output_mode)]\opt + X[$mom_pos(0)] + Y[$mom_pos(1)] + } + + BLOCK_TEMPLATE rapid_spindle { + G_motion[$mom_sys_rapid_code] + Z[$mom_pos(2)] + H[$mom_tool_adjust_register]\opt + M_coolant[$mom_sys_coolant_code($mom_coolant_status)]\opt + } + + BLOCK_TEMPLATE spindle_rpm { + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE spindle_rpm_1 { + M_spindle[$mom_sys_spindle_range_code($mom_spindle_range)] + } + + BLOCK_TEMPLATE tool_length_adjust { + G_adjust[$mom_sys_adjust_code] + H[$mom_tool_adjust_register] + } + + BLOCK_TEMPLATE tool_len_adj_off { + H[$mom_sys_zero] + } + + BLOCK_TEMPLATE coolant_off { + M_coolant[$mom_sys_coolant_code(OFF)] + } + + BLOCK_TEMPLATE cutcom_on { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)]\opt + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE cutcom_off { + G_cutcom[$mom_sys_cutcom_code(OFF)] + } + + BLOCK_TEMPLATE spindle_off { + M_spindle[$mom_sys_spindle_direction_code(OFF)] + } + + BLOCK_TEMPLATE delay { + G[$mom_sys_delay_code($mom_delay_mode)] + dwell[$mom_delay_value] + } + + BLOCK_TEMPLATE opstop { + M[$mom_sys_optional_stop_code]\opt\nows + } + + BLOCK_TEMPLATE auxfun { + M[$mom_auxfun] + } + + BLOCK_TEMPLATE prefun { + G[$mom_prefun] + } + + BLOCK_TEMPLATE stop { + M[$mom_sys_program_stop_code] + } + + BLOCK_TEMPLATE tool_preselect { + T[$mom_next_tool_number] + } + + BLOCK_TEMPLATE linear { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_linear_code] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + F[$mom_feed_rate] + D[$mom_cutcom_adjust_register]\opt + } + + BLOCK_TEMPLATE circle { + G_cutcom[$mom_sys_cutcom_code($mom_cutcom_status)]\opt + G_plane[$mom_sys_cutcom_plane_code($mom_cutcom_plane)] + G_motion[$mom_sys_circle_code($mom_arc_direction)] + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + I[$mom_pos_arc_center(0)-$mom_prev_pos(0)] + J[$mom_pos_arc_center(1)-$mom_prev_pos(1)] + K[$mom_pos_arc_center(2)-$mom_prev_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE from { + X[$mom_pos(0)] + Y[$mom_pos(1)] + Z[$mom_pos(2)] + } + + BLOCK_TEMPLATE initial_move { + G_mode[$mom_sys_output_code(ABSOLUTE)] + M_spindle[$mom_sys_spindle_direction_code($mom_spindle_direction)] + S[$mom_spindle_speed] + } + + BLOCK_TEMPLATE cycle_set { + G_motion[$mom_sys_cycle_reps_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_off { + G_motion[$mom_sys_cycle_off] + } + + BLOCK_TEMPLATE cycle_plane_change { + G_motion[$mom_sys_rapid_code] + Z[$mom_cycle_feed_to_pos(2)] + } + + BLOCK_TEMPLATE cycle_drill { + G_motion[$mom_sys_cycle_drill_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_dwell { + G_motion[$mom_sys_cycle_drill_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_drill_deep { + G_motion[$mom_sys_cycle_drill_deep_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_breakchip { + G_motion[$mom_sys_cycle_breakchip_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_step[$mom_cycle_step1] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_tap { + G_motion[$mom_sys_cycle_tap_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore { + G_motion[$mom_sys_cycle_bore_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_drag { + G_motion[$mom_sys_cycle_bore_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_no_drag { + G_motion[$mom_sys_cycle_bore_no_drag_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_dwell { + G_motion[$mom_sys_cycle_bore_dwell_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_manual { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_back { + G_motion[$mom_sys_cycle_bore_back_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE cycle_bore_m_dwell { + G_motion[$mom_sys_cycle_bore_manual_code] + X[$mom_cycle_feed_to_pos(0)] + Y[$mom_cycle_feed_to_pos(1)] + Z[$mom_cycle_feed_to_pos(2)] + cycle_dwell[$mom_cycle_delay]\opt + F[$mom_feed_rate] + } + + BLOCK_TEMPLATE end_of_program { + M[$mom_sys_end_of_program_code] + } + + BLOCK_TEMPLATE comment_data { + LF_ENUM[$mom_debug_event_num] + LF_XABS[$mom_pos(0)] + LF_YABS[$mom_pos(1)] + LF_ZABS[$mom_pos(2)] + LF_AAXIS[$mom_pos(3)]\opt + LF_BAXIS[$mom_pos(4)]\opt + LF_FEED[$mom_feed_rate]\opt + LF_SPEED[$mom_spindle_speed]\opt + } +} diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.pui b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.pui new file mode 100644 index 0000000..0e5c0af --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.pui @@ -0,0 +1,774 @@ +######################################################################### +# # +# This is the POST UI FILE used to read and write the parameters # +# associated with a spedific post processor. # +# # +# WARNING: The Syntax of the file should not be changed!!! # +# # +######################################################################### + +## POST EVENT HANDLER START +def_file pb_Mill_5TT_Generic_MM.def +tcl_file pb_Mill_5TT_Generic_MM.tcl +## POST EVENT HANDLER END + +## LISTING FILE START +Listfileflag 1 +Listfileflag_tool 0 +Listfileflag_oper 0 +Listfileflag_start_path 0 +Listfileflag_head 0 +Listfileflag_end_path 0 +Listfilelines 40 +Listfileflag_oper_time 0 +Listfileflag_tool_chng 0 +Listfilecolumn 30 +Listfileflag_setup_time 0 +Listfilename listfile.lpt +## LISTING FILE END + +## KINEMATIC VARIABLES START +mom_kin_5th_axis_limit_action Warning +mom_kin_home_y_pos 0.0 +mom_kin_clamp_time 2.0 +mom_kin_4th_axis_rotation standard +mom_kin_5th_axis_rotation standard +mom_kin_z_axis_limit 635 +mom_kin_machine_type 5_axis_dual_table +mom_kin_machine_resolution .001 +mom_kin_4th_axis_max_limit 360 +mom_kin_5th_axis_address B +mom_kin_x_axis_limit 510 +mom_kin_4th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_center_offset(0) 0.0 +mom_kin_5th_axis_max_limit 360 +mom_kin_4th_axis_address A +mom_kin_linearization_flag 1 +mom_kin_5th_axis_zero 0.0 +mom_kin_4th_axis_center_offset(1) 0.0 +mom_kin_4th_axis_type Head +mom_kin_5th_axis_center_offset(1) 0.0 +mom_kin_min_fpm 0.0 +mom_kin_4th_axis_limit_action Warning +mom_kin_max_fpm 1000 +mom_kin_home_x_pos 0.0 +mom_kin_4th_axis_min_incr 0.001 +mom_kin_home_z_pos 0.0 +mom_kin_min_fpr 0.0 +mom_kin_5th_axis_min_incr 0.001 +mom_kin_max_traversal_rate 300 +mom_kin_5th_axis_plane yz +mom_kin_4th_axis_center_offset(2) 0.0 +mom_kin_max_fpr 0.0 +mom_kin_5th_axis_center_offset(2) 0.0 +mom_kin_4th_axis_ang_offset 0.0 +mom_kin_linearization_tol 0.001 +mom_kin_y_axis_limit 635 +mom_kin_4th_axis_min_limit 0 +mom_kinematic_unit Inch +mom_kin_output_unit MM +mom_kin_flush_time 2.0 +mom_kin_min_frn 0.0 +mom_kin_tool_change_time 12.0 +mom_kin_max_frn 0.0 +mom_kin_5th_axis_min_limit 0 +mom_kin_pivot_guage_offset 0.0 +mom_kin_5th_axis_ang_offset 0.0 +mom_kin_4th_axis_plane xy +mom_kin_4th_axis_zero 0.0 +mom_kin_min_dpm 0.0 +mom_kin_5th_axis_type Head +mom_kin_max_dpm 10 +## KINEMATIC VARIABLES END + +## GCODES START +"$mom_sys_rapid_code" "Motion Rapid" +"$mom_sys_linear_code" "Motion Linear" +"$mom_sys_circle_code(CLW)" "Circular Interperlation CLW" +"$mom_sys_circle_code(CCLW)" "Circular Interperlation CCLW" +"$mom_sys_delay_code(SECONDS)" "Delay (Sec)" +"$mom_sys_delay_code(REVOLUTIONS)" "Delay (Rev)" +"$mom_sys_cutcom_plane_code(XY)" "Plane XY" +"$mom_sys_cutcom_plane_code(ZX)" "Plane ZX" +"$mom_sys_cutcom_plane_code(YZ)" "Plane YZ" +"$mom_sys_cutcom_code(OFF)" "Cutcom Off" +"$mom_sys_cutcom_code(LEFT)" "Cutcom Left" +"$mom_sys_cutcom_code(RIGHT)" "Cutcom On/Right" +"$mom_sys_adjust_code" "Tool Length Adjust Plus" +"$mom_sys_adjust_code_minus" "Tool Length Adjust Minus" +"$mom_sys_adjust_cancel_code" "Tool Length Adjust Off" +"$mom_sys_unit_code(IN)" "Inch Mode" +"$mom_sys_unit_code(MM)" "Metric Mode" +"$mom_sys_cycle_breakchip_code" "Cycle Break Chip" +"$mom_sys_cycle_bore_no_drag_code" "Cycle Bore No Drag" +"$mom_sys_cycle_off" "Cycle Off" +"$mom_sys_cycle_drill_code" "Cycle Drill" +"$mom_sys_cycle_drill_deep_code" "Cycle Drill Deep" +"$mom_sys_cycle_drill_dwell_code" "Cycle Drill Dwell" +"$mom_sys_cycle_tap_code" "Cycle Tap" +"$mom_sys_cycle_bore_code" "Cycle Bore" +"$mom_sys_cycle_bore_drag_code" "Cycle Bore Drag" +"$mom_sys_cycle_bore_back_code" "Cycle Bore Manual" +"$mom_sys_cycle_bore_manual_code" "Cycle Bore Manual Dwell" +"$mom_sys_cycle_bore_dwell_code" "Cycle Bore Dwell" +"$mom_sys_output_code(ABSOLUTE)" "Absolute Mode" +"$mom_sys_output_code(INCREMENTAL)" "Incremental Mode" +"$mom_sys_absolute_pos_reset_code" "Reset" +"$mom_sys_feed_rate_mode_code(IPM)" "Feedrate Mode Ipm (Mmpm)" +"$mom_sys_feed_rate_mode_code(IPR)" "Feedrate Mode Ipr (Mmpr)" +"$mom_sys_spindle_mode_code(SFM)" "Spindle CSS" +"$mom_sys_spindle_mode_code(RPM)" "Spindle RPM" +## GCODES END + +## MCODES START +"$mom_sys_program_stop_code" "Stop/Manual Tool Change" +"$mom_sys_optional_stop_code" "Opstop" +"$mom_sys_end_of_program_code" "Program End" +"$mom_sys_spindle_direction_code(CLW)" "Spindle On/CLW" +"$mom_sys_spindle_direction_code(CCLW)" "Spindle CCLW" +"$mom_sys_spindle_direction_code(OFF)" "Spindle Off" +"$mom_sys_tool_change_code" "Tool Change/Retract" +"$mom_sys_coolant_code(MIST)" "Coolant Mist" +"$mom_sys_coolant_code(ON)" "Coolant On" +"$mom_sys_coolant_code(FLOOD)" "Coolant Flood" +"$mom_sys_coolant_code(TAP)" "Coolant Tap" +"$mom_sys_coolant_code(OFF)" "Coolant Off" +"$mom_sys_return_home" "Return Home" +"$mom_sys_rewind_code" "Rewind" +## MCODES END + +## MASTER SEQUENCE START +G_motion "$mom_sys_linear_code" 0 "Motion G-Code" +G_plane "$mom_sys_cutcom_plane_code($mom_cutcom_plane)" 0 "Plane G-Code" +G_cutcom "$mom_sys_cutcom_code(OFF)" 0 "Cutcom G-Code" +G_adjust "$mom_sys_adjust_code" 0 "Tool Length Adjust G-Code" +G_feed "$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" 0 "Feedrate Mode G-Code" +G_mode "$mom_sys_output_code($mom_output_mode)" 0 "Positioning Mode G-code" +G_spin "$mom_sys_spindle_mode_code($mom_spindle_mode)" 0 "Spindle Output Mode G-Code" +G_return "$mom_sys_canned_cyc_ret_plane" 0 "Return Plane for Canned Cycles" +G "$mom_sys_blank_code" 0 "Other G-Codes" +M_spindle "$mom_sys_spindle_direction_code($mom_spindle_direction)" 0 "Spindle Direction M-Code" +M_coolant "$mom_sys_coolant_code($mom_coolant_status)" 0 "Coolant M-Code" +M "$mom_sys_optional_stop_code" 0 "Other M-Codes" +X "$mom_sys_blank_code" 0 "X Axis Position or Canned Cycle X Axis Position" +Y "$mom_sys_blank_code" 0 "Y Axis Position or Canned Cycle Y Axis Position" +Z "$mom_sys_blank_code" 0 "Z Axis Position or Canned Cycle Z Axis Position" +fourth_axis "$mom_sys_blank_code" 0 "A Axis Position (4th or 5th axis)" +fifth_axis "$mom_sys_blank_code" 0 "B Axis Position (4th or 5th axis)" +I "$mom_sys_blank_code" 0 "X Axis Position of the Circle Center" +J "$mom_sys_blank_code" 0 "Y Axis Position of the Circle Center" +K "$mom_sys_blank_code" 0 "Z Axis Position of the Circle Center" +R "$mom_sys_blank_code" 0 "Rapid Approach Position in a Canned Cycle Block" +F "$mom_sys_blank_code" 0 "Feedrate" +S "$mom_sys_blank_code" 0 "Spindle Speed" +T "$mom_sys_blank_code" 0 "Tool Select Code" +D "$mom_sys_blank_code" 0 "Tool Radius Compensation Register" +H "$mom_sys_blank_code" 0 "Tool Length Compensation Register" +Z_cutcom "$mom_sys_blank_code" 0 "Z Cutcom" +G_inmm "$mom_sys_blank_code" 0 "G - Code (Inch/Metric)" +G_intp "$mom_sys_blank_code" 0 "G - Code" +dwell "$mom_sys_delay_value" 0 "Programmed Dwell" +cycle_dwell "$mom_sys_cycle_delay" 0 "Delay for Canned cycle Dwell" +P_cutcom "$mom_sys_p_cutcom_code" 0 "P-Cutcom" +K_cycle "$mom_sys_cycle_retract_to" 0 "Retract Position in a Canned Cycle Block" +cycle_step1 "$mom_sys_cycle_step2" 0 "Step Increment Modifier for Ndeep/break chip cycle" +cycle_step "$mom_sys_cycle_step1" 0 "Step Increment for Deep/Nor Break Chip Cycle" +Q_cutcom "$mom_sys_q_cutcom_code" 0 "Q-Cutcom" +E "$mom_sys_blank_code" 0 "Thread Increment for Threads" +N "" 0 "Sequence Number" +Text "" 0 "Text String" +## MASTER SEQUENCE END + +## CYCLE EVENT START +#Cycle Common Block Start +{Cycle Set} +#Cycle Common Block End + +#Cycle Block Share Common Block Start +{ \ + {Drill} \ + {Drill Dwell} \ + {Drill Deep} \ + {Drill Break Chip} \ + {Tap} \ + {Bore} \ + {Bore Drag} \ + {Bore No Drag} \ + {Bore Dwell} \ + {Bore Manual} \ + {Bore Back} \ + {Bore Manual Dwell} \ +} +#Cycle Block Share Common Block End +## CYCLE EVENT END + +## BLOCK MODALITY START +## BLOCK MODALITY END + +## COMPOSITE BLOCKS START +{initial_move} +## COMPOSITE BLOCKS END + +## SEQUENCE START +#Program Start Sequence Start +{Start of Program} {rewind_stop_code output_unit} +#Program Start Sequence End + +#Operation Start Sequence Start +{Start of Path} {coordinate_system} +{From Move} {} +{Tool Change} {return_home auto_tool_change} +{Spindle RPM} {} +{Coolant Start} {coolant_on} +{Initial Move} {{absolute_mode spindle_rpm}} +{Start Move} {} +{Approach Move} {} +{Engage Move} {} +#Operation Start Sequence End + +##Tool Path Start +#Control Functions Start +{Tool Change} {auto_tool_change auto_tool_change_1} +{First Tool} {} +{Tool Length Comp} {tool_length_adjust} +{Set Mode} {set_mode} +{Spindle RPM} {spindle_rpm} +{Spindle Off} {spindle_off} +{Coolant On} {coolant_on} +{Coolant Off} {coolant_off} +{Inch / Metric Mode} {} +{Feedrates} {} +{Cutcom On} {cutcom_on} +{Cutcom Off} {cutcom_off} +{Delay} {delay} +{Opstop} {opstop} +{Opskip On} {} +{Opskip Off} {} +{Auxfun} {auxfun} +{Prefun} {prefun} +{Load Tool} {} +{Sequence Number} {sequence_number} +{Stop} {stop} +{Tool Preselect} {tool_preselect} +#Control Functions End + +#Motions Start +{Linear Move} {linear} +{Circular Move} {circle} +{Rapid Move} {rapid_traverse rapid_spindle} +#Motions End + +#Cycles Start +{Cycle Set} {cycle_set} +{Cycle Off} {cycle_off} +{Cycle Plane Change} {cycle_plane_change} +{Drill} {cycle_drill} +{Drill Dwell} {cycle_drill_dwell} +{Drill Deep} {cycle_drill_deep} +{Drill Break Chip} {cycle_breakchip} +{Tap} {cycle_tap} +{Bore} {cycle_bore} +{Bore Drag} {cycle_bore_drag} +{Bore No Drag} {cycle_bore_no_drag} +{Bore Manual} {cycle_bore_manual} +{Bore Dwell} {cycle_bore_dwell} +{Bore Back} {cycle_bore_back} +{Bore Manual Dwell} {cycle_bore_m_dwell} +#Cycles End +##Tool Path End + +#Operation End Sequence Start +{Retract Motion} {tool_len_adj_off coolant_off spindle_off} +{Return Motion} {} +{Gohome Motion} {} +{End of Path} {} +#Operation End Sequence End + +#Program End Sequence Start +{End Of Program} {end_of_program} +#Program End Sequence End +## SEQUENCE END + +## EVENTS USER INTERFACE START +{Tool Change} \ + {{"M Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Change" 2 a $mom_sys_tool_change_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Retract to Position" 1 V} \ + {{"null" 3 V} \ + {"X" 2 f $tl_rect_posx null null} \ + {"Y" 2 f $tl_rect_posy null null} \ + {"Z" 2 f $tl_rect_posz null null}}} \ + {{"Time (Sec)" 1 V} \ + {{"null" 2 V} \ + {"Tool Change" 0 i $tl_change_sec null null} \ + {"Dwell" 0 i $tl_change_dwell null null}}} +{Tool Length Comp} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Tool Length Adjust" 2 a $mom_sys_adjust_code null null}}} \ + {{"T Code" 1 V} \ + {{"null" 1 V} \ + {"Configure" 1 n null UI_PB_tpth_ConfToolCode null}}} \ + {{"Length Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $tl_len_offs_min null null} \ + {"Maximum" 0 i $tl_len_offs_max null null}}} +{Set Mode} \ + {{"Output Mode" 1 V} \ + {{"null" 1 V} \ + {"null" 8 n $output_mode_opt null {"Absolute Only" "Incremental Only" \ + "G/G" "XYZ(absolute)/UVW(incremental)" \ + "X9.9(absolute)/X9.9(incremental)"}}}} \ + {{"Default Mode" 1 V} \ + {{"null" 2 H} \ + {"Absolute" 4 n $def_output_mode null null} \ + {"Incremental" 4 n $def_output_mode null null}}} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Absolute" 2 a $mom_sys_output_code(ABSOLUTE) null null} \ + {"Incremental" 2 a $mom_sys_output_code(INCREMENTAL) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Rotary Axis Can Be Incremental" 3 n $mode_rot_axis null null}}} +{Spindle RPM} \ + {{"null" 1 V} \ + {{"Spindle Direction M Codes" 2 V} \ + {"Clockwise (CW)" 2 a $mom_sys_spindle_direction_code(CLW) null null} \ + {"Counter Clockwise (CCW)" 2 a $mom_sys_spindle_direction_code(CCLW) null null}}} +{Spindle Off} \ + {{"null" 1 V} \ + {{"Spindle Direction M Code" 1 V} \ + {"Off" 2 a $mom_sys_spindle_direction_code(OFF) null null}}} +{Coolant On} \ + {{"null" 1 V} \ + {{"M Code" 6 V} \ + {"On" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Flood" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist" 2 a $mom_sys_coolant_code(MIST) null null} \ + {"Thru" 2 a $mom_sys_coolant_code(ON) null null} \ + {"Tap" 2 a $mom_sys_coolant_code(TAP) null null} \ + {"Flood-Thru" 2 a $mom_sys_coolant_code(FLOOD) null null} \ + {"Mist-Thru" 2 a $mom_sys_coolant_code(MIST) null null}}} +{Coolant Off} \ + {{"null" 1 V} \ + {{"M Code" 1 V} \ + {"Off" 2 a $mom_sys_coolant_code(OFF) null null}}} +{Inch / Metric Mode} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"English (Inch)" 2 a $mom_sys_unit_code(IN) null null} \ + {"Metric (Millimeter)" 2 a $mom_sys_unit_code(MM) null null}}} \ + {{"null" 1 V} \ + {{"null" 1 H} \ + {"Output at Start of Path" 3 n $output_unit_start_of_path null null}}} +{Feedrates} \ + {{"G Code" 2 V} \ + {{"null" 3 V} \ + {"IPM" 2 a $mom_sys_feed_rate_mode_code(IPM) null null} \ + {"IPR" 2 a $mom_sys_feed_rate_mode_code(IPR) null null} \ + {"FPN" 2 a $mom_sys_feed_rate_mode_code(INVERSE) null null}} \ + {{"null" 1 H} \ + {"Output with Motion" 3 n $feed_output_motion null null}}} \ + {{"Feed Rate Format" 1 V} \ + {{"null" 3 V} \ + {"IPM" 5 f $ipm_feed null null} \ + {"IPR" 5 f $ipr_feed null null} \ + {"FRN" 5 f $fpn_feed null null}}} \ + {{"Default Mode" 1 V} \ + {{"null" 3 H} \ + {"IPM" 4 n $mom_feed_rate_mode null null} \ + {"IPR" 4 n $mom_feed_rate_mode null null} \ + {"FRN" 4 n $mom_feed_rate_mode null null}}} +{Cutcom On} \ + {{"G Code" 1 V} \ + {{"null" 2 V} \ + {"Left" 2 a $mom_sys_cutcom_code(LEFT) null null} \ + {"Right" 2 a $mom_sys_cutcom_code(RIGHT) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cutcom_plane_xy null null} \ + {"YZ" 3 n $cutcom_plane_yz null null} \ + {"ZX" 3 n $cutcom_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Radial Offset Register" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 0 i $rad_offset_min null null} \ + {"Maximum" 0 i $rad_offset_max null null}}} +{Cutcom Off} \ + {{"null" 1 V} \ + {{"G Code" 1 V} \ + {"Off" 2 a $mom_sys_cutcom_code(OFF) null null}}} +{Linear Move} \ + {{"G Code" 1 V} \ + {{"null" 1 V} \ + {"Linear Motion" 2 a $mom_sys_linear_code null null}}} \ + {{"Axis Modality" 1 V} \ + {{"null" 3 H} \ + {"X" 3 f $lin_axis_modx null null} \ + {"Y" 3 f $lin_axis_mody null null} \ + {"Z" 3 f $lin_axis_modz null null}}} +{Circular Move} \ + {{"Motion G Code" 1 V} \ + {{"null" 2 V} \ + {"Clockwise (CLW)" 2 a $mom_sys_circle_code(CLW) null null} \ + {"Counter-Clockwise (CCLW)" 2 a $mom_sys_circle_code(CCLW) null null}}} \ + {{"Applicable Planes" 2 V} \ + {{"null" 3 H} \ + {"XY" 3 n $cir_plane_xy null null} \ + {"YZ" 3 n $cir_plane_yz null null} \ + {"ZX" 3 n $cir_plane_zx null null}} \ + {{"null" 1 V} \ + {"Edit Plane Codes" 1 n null UI_PB_tpth_EditPlaneCodes null}}} \ + {{"Circular Record" 1 V} \ + {{"null" 2 H} \ + {"Full Circle" 4 n $circular_record null null} \ + {"Quadrants" 4 n $circular_record null null}}} \ + {{"Default Plane" 1 V} \ + {{"null" 3 H} \ + {"XY" 4 n $cir_def_plane null null} \ + {"YZ" 4 n $cir_def_plane null null} \ + {"ZX" 4 n $cir_def_plane null null}}} \ + {{"Radius" 1 V} \ + {{"null" 2 V} \ + {"Minimum" 2 f $cir_rad_min null null} \ + {"Maximum" 2 f $cir_rad_max null null}}} \ + {{"null" 1 H} \ + {{"null" 2 V} \ + {"I J K" 1 n null UI_PB_tpth_IJKOptions null} \ + {"null" 6 n $cir_vector null null}}} \ + {{"null" 1 V} \ + {{"null" 1 V} \ + {"Other Options" 1 n null UI_PB_tpth_OtherOptions null}}} +{Rapid Move} \ + {{"null" 6 V} \ + {{"G Code" 1 V} \ + {"Rapid Motion" 2 a $mom_sys_rapid_code null null}} \ + {{"null" 1 H} \ + {"Work Plane Change" 3 n $rap_wrk_pln_chg UI_PB_tpth_EditRapidBlocks null}} \ + {{"null" 1 H} \ + {"Modal Rapid F Code" 3 n $rap_f_code null null}} \ + {{"null" 2 H} \ + {"Assumed Rapid Mode at Max. Traversal Rate" 3 n $rap_mode_trav_rate null null} \ + {"" 2 $rap_mode_trav_value null null}} \ + {{"null" 2 H} \ + {"Modal Canned Cycle Rapid Feed Rate Word" 3 n $rap_cann_feed_status null null} \ + {"null" 0 $rap_cann_feed_rate null null}} \ + {{"null" 2 H} \ + {"Optional Feed Rate Codes for Small Moves" 3 n $rap_opt_feed_status null null} \ + {"null" 0 n $rap_opt_feed_rate null null}}} +{Cycle Set} \ + {{"G Code" 1 V} \ + {{"null" 11 V} \ + {"Cycle Start" 2 a $mom_sys_cycle_start_code null null} \ + {"Cycle Off" 2 a $mom_sys_cycle_off null null} \ + {"Drill" 2 a $mom_sys_cycle_drill_code null null} \ + {"Drill Dwell (SpotFace)" 2 a $mom_sys_cycle_drill_dwell_code null null} \ + {"Drill Deep (Peck)" 2 a $mom_sys_cycle_drill_deep_code null null} \ + {"Tap" 2 a $mom_sys_cycle_tap_code null null} \ + {"Bore (Ream)" 2 a $mom_sys_cycle_bore_code null null} \ + {"Bore Drag" 2 a $mom_sys_cycle_bore_drag_code null null} \ + {"Bore No-Drag" 2 a $mom_sys_cycle_bore_no_drag_code null null} \ + {"Bore Manual" 2 a $mom_sys_cycle_bore_manual_code null null} \ + {"Bore Dwell" 2 a $mom_sys_cycle_bore_dwell_code null null}}} \ + {{"null" 4 V} \ + {{"Cycle Start" 2 H} \ + {"G79 X Y Z" 3 n $cycle_start_blk null null} \ + {"Use Cycle Start Block To Execute Cycle" 7 n null null null}} \ + {{"Rapid - To" 1 V} \ + {"null" 8 n $cycle_rapto_opt null {"None" "R" "G00 X Y & R" "G00 X Y Z"}}} \ + {{"Retract - To" 1 V} \ + {"null" 8 n $cycle_recto_opt null {"None" "K" "G98/G99" "Rapid Z Move" "Cycle Off then Rapid Z Move"}}} \ + {{"Cycle Plane Control" 1 V} \ + {"null" 8 n $cycle_plane_control_opt null {"None" "G17 / G18 / G19" "G81 / G181 / G281" "R / R' / R''"}}}} +## EVENTS USER INTERFACE END + +## MOM SYS VARIABLES START +{N} \ + {"$mom_seqnum" "" "Sequence Number"} +{G_motion} \ + {"$mom_sys_linear_code" "1" "Linear Move"} \ + {"$mom_sys_rapid_code" "0" "Rapid Move"} \ + {"$mom_sys_circle_code(CLW)" "2" "Circular Interpolation CLW"} \ + {"$mom_sys_circle_code(CCLW)" "3" "Circular Interpolation CCLW"} \ + {"$mom_sys_circle_code($mom_arc_direction)" "3" "Circular Move"} \ + {"$mom_sys_cycle_breakchip_code" "73" "Break Chip"} \ + {"$mom_sys_cycle_off" "80" "Cycle Off"} \ + {"$mom_sys_cycle_drill_code" "81" "Drill"} \ + {"$mom_sys_cycle_drill_dwell_code" "82" "Drill Dwell"} \ + {"$mom_sys_cycle_drill_deep_code" "83" "Drill Deep"} \ + {"$mom_sys_cycle_tap_code" "84" "Tap"} \ + {"$mom_sys_cycle_bore_code" "85" "Bore"} \ + {"$mom_sys_cycle_bore_drag_code" "86" "Bore Drag"} \ + {"$mom_sys_cycle_bore_dwell_code" "89" "Bore Dwell"} \ + {"$mom_sys_cycle_bore_no_drag_code" "76" "No Drag"} \ + {"$mom_sys_cycle_bore_back_code" "87" "Bore Back"} \ + {"$mom_sys_cycle_bore_manual_code" "88" "Bore Manual"} \ + {"$mom_sys_cycle_start_code" "79" "Cycle Start Code"} \ + {"$mom_sys_cycle_reps_code" "x" "Cycle Code Representative"} +{G_plane} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" "XY Plane Code"} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" "ZX Plane Code"} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" "YZ Plane Code"} \ + {"$mom_sys_cutcom_plane_code($mom_cutcom_plane)" "17" "Plane Code"} +{G_cutcom} \ + {"$mom_sys_cutcom_code(LEFT)" "41" "Cutcom Left"} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" "Cutcom Right"} \ + {"$mom_sys_cutcom_code(OFF)" "40" "Cutcom Off"} \ + {"$mom_sys_cutcom_code($mom_cutcom_status)" "41" "Cutcom"} +{G_mode} \ + {"$mom_sys_output_code(ABSOLUTE)" "90" "Absolute Mode"} \ + {"$mom_sys_output_code(INCREMENTAL)" "91" "Incremental Mode"} \ + {"$mom_sys_output_code($mom_output_mode)" "90" "Abs/Incr Mode"} +{G_adjust} \ + {"$mom_sys_adjust_code" "43" "Tool Len Adjust Plus"} \ + {"$mom_sys_adjust_code_minus" "44" "Tool Len Adjust Minus"} \ + {"$mom_sys_adjust_cancel_code" "49" "Cancel Tool Len Adjust"} +{G_feed} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" "IPM Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" " IPR Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" "FPN Feed Rate Mode"} \ + {"$mom_sys_feed_rate_mode_code($mom_feed_rate_mode)" "94" "Feed Rate Mode"} +{G_spin} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" "Spindle output (CSS)"} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" "Spindle output (RPM)"} \ + {"$mom_sys_spindle_mode_code($mom_spindle_mode)" "96" "Spindle output Mode"} +{G_return} \ + {"$mom_sys_canned_cyc_ret_plane" "98" "Return Plane"} +{G} \ + {"$mom_prefun" "" "Pre Function"} \ + {"$mom_sys_delay_code(SECONDS)" "4" "Delay in Seconds"} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" "Delay in Revloutions"} \ + {"$mom_sys_delay_code($mom_delay_mode)" "4" "Delay"} \ + {"$mom_sys_spindle_max_rpm_code" "54" "Spindle Max RPM"} \ + {"$mom_sys_absolute_pos_reset_code" "92" "Absolute Position Reset"} \ + {"$mom_sys_unit_code(IN)" "70" "Output Unit (Inch)"} \ + {"$mom_sys_unit_code(MM)" "71" "Output Unit (Metric)"} \ + {"$mom_sys_unit_code($mom_part_unit)" "70" "Output Unit"} \ + {"$mom_sys_return_home" "28" "Return Home"} +{M_spindle} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" "CLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" "CCLW Spindle Direction"} \ + {"$mom_sys_spindle_direction_code($mom_spindle_direction)" "3" "Spindle Direction"} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" "Spindle Off"} \ + {"$mom_sys_spindle_range_code($mom_spindle_range)" "41" "Spindle Range"} +{M_coolant} \ + {"$mom_sys_coolant_code(MIST)" "7" "Coolant Mist"} \ + {"$mom_sys_coolant_code(ON)" "8" "Coolant On"} \ + {"$mom_sys_coolant_code(FLOOD)" "8" "Coolant Flood"} \ + {"$mom_sys_coolant_code(TAP)" "8" "Coolant Tap"} \ + {"$mom_sys_coolant_code($mom_coolant_status)" "8" "Coolant Code"} \ + {"$mom_sys_coolant_code(OFF)" "9" "Coolant Off"} +{M} \ + {"$mom_sys_optional_stop_code" "1" "Optional Stop"} \ + {"$mom_auxfun" "0" "Aux Function"} \ + {"$mom_sys_program_stop_code" "0" "Program Stop"} \ + {"$mom_sys_end_of_program_code" "2" "End Of program"} \ + {"$mom_sys_rewind_code" "30" "Rewind Program"} \ + {"$mom_sys_tool_change_code" "6" "Tool Change"} +{X} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_cycle_rapid_to(0)" "" "Rapid X Position in Cycle"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{Y} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_cycle_rapid_to(1)" "" "Rapid Y Position in Cycle"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{Z} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_cycle_rapid_to(2)" "" "Rapid Z Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{U} \ + {"$mom_pos(0)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(0)" "" "Cycle Feed X"} \ + {"$mom_tool_x_offset" "" "Tool X Offset"} +{V} \ + {"$mom_pos(1)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(1)" "" "Cycle Feed Y"} \ + {"$mom_tool_y_offset" "" "Tool Y Offset"} +{W} \ + {"$mom_pos(2)" "" "Coordinate"} \ + {"$mom_cycle_feed_to_pos(2)" "" "Cycle Feed Z"} \ + {"$mom_tool_z_offset" "" "Tool Z Offset"} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} \ + {"$mom_sys_return_home_z" "" "Return Home Z"} +{fourth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} \ + {"$mom_out_angle_pos(0)" "" "4th Axis Angle"} +{fifth_axis} \ + {"$mom_pos(3)" "" "4th Axis"} \ + {"$mom_pos(4)" "" "5th Axis"} +{I} \ + {"$mom_pos_arc_center(0)-$mom_prev_pos(0)" "" "Circle Center X-Axis"} +{J} \ + {"$mom_pos_arc_center(1)-$mom_prev_pos(1)" "" "Circle Center Y-Axis"} +{K} \ + {"$mom_pos_arc_center(2)-$mom_prev_pos(2)" "" "Circle Center Z-Axis"} +{R} \ + {"$mom_cycle_rapid_to_pos(2)" "" "Rapid Position in Cycle"} +{K_cycle} \ + {"$mom_cycle_retract_to" "" "Retract Position in Cycle"} +{F} \ + {"$mom_feed_rate" "" "Feed Rate"} \ + {"$mom_cycle_feed_rate" "" "Cycle Feed Rate"} +{S} \ + {"$mom_spindle_speed" "" "Spindle Speed"} \ + {"$mom_spindle_maximum_rpm" "" "Spindle Max RPM"} +{Srpm} \ + {"$mom_unknown_var" "" "RPM Spindle Speed"} +{Sfm} \ + {"$mom_unknown_var" "" "SFM Spindle Speed"} +{Z_cutcom} \ + {"$mom_unknown_var" "" "Z - Cutcom"} +{G_inmm} \ + {"$mom_unknown_var" "" "G - Code (Inch/Metric)"} +{G_intp} \ + {"$mom_unknown_var" "" "G - Code"} +{T} \ + {"$mom_tool_number" "" "Tool Select"} \ + {"$mom_next_tool_number" "" "Tool Pre-Select"} +{D} \ + {"$mom_cutcom_adjust_register" "1" "Tool Radius Compensation"} +{H} \ + {"$mom_tool_adjust_register" "1" "Tool Adjust Register"} \ + {"$mom_sys_zero" "" "Cancel Tool Adjust"} +{dwell} \ + {"$mom_delay_value" "" "Programmed Dwell"} +{cycle_dwell} \ + {"$mom_cycle_delay" "" "Delay For Cycle Dwell"} +{cycle_step} \ + {"$mom_cycle_step1" "" "Step Incr Value"} +{cycle_step1} \ + {"$mom_cycle_step2" "" "Step Incr Modifier"} +{P_cutcom} \ + {"$mom_p_cutcom_code" "" "Cutcom"} +{Q_cutcom} \ + {"$mom_q_cutcom_code" "" "Cutcom"} +{E} \ + {"$mom_thread_increment" "" "Thread Increment"} +{cycle_misc} \ + {"$mom_unknown_var" "" "Cycle"} +{Text} \ + {"" "" "Text String"} +{New_Address} \ + {"" "" "User Defined Address"} +{PB_Dummy} \ + {"$pgss_blk_nc" "0" ""} \ + {"$pges_blk_nc" "0" ""} \ + {"$opss_blk_nc" "0" ""} \ + {"$opes_blk_nc" "0" ""} \ + {"$mom_sys_blank_code" "" ""} \ + {"$mom_sys_p_cutcom_code" "CC" ""} \ + {"$mom_sys_q_cutcom_code" "CC" ""} \ + {"$mom_sys_cycle_retract_to" "CY" ""} \ + {"$mom_sys_cycle_step1" "CS" ""} \ + {"$mom_sys_cycle_step2" "CS" ""} \ + {"$mom_sys_delay_value" "DW" ""} \ + {"$mom_sys_cycle_delay" "CD" ""} \ + {"$mom_feed_rate_mode" "IPM" ""} \ + {"$tl_rect_posx" "0" ""} \ + {"$tl_rect_posy" "0" ""} \ + {"$tl_rect_posz" "0" ""} \ + {"$tl_change_sec" "30" ""} \ + {"$tl_change_dwell" "5" ""} \ + {"$def_output_mode" "Absolute" ""} \ + {"$output_mode_opt" "Absolute_Only" ""} \ + {"$mode_rot_axis" "1" ""} \ + {"$output_unit_start_of_path" "1" ""} \ + {"$feed_output_motion" "1" ""} \ + {"$ipm_feed" "4.1" ""} \ + {"$ipm_feed_int" "4" ""} \ + {"$ipm_feed_dec" "1" ""} \ + {"$ipr_feed" "1.4" ""} \ + {"$ipr_feed_int" "1" ""} \ + {"$ipr_feed_dec" "4" ""} \ + {"$fpn_feed" "4.1" ""} \ + {"$fpn_feed_int" "4" ""} \ + {"$fpn_feed_dec" "1" ""} \ + {"$cutcom_plane_xy" "1" ""} \ + {"$cutcom_plane_yz" "0" ""} \ + {"$cutcom_plane_zx" "0" ""} \ + {"$rad_offset_min" "1" ""} \ + {"$rad_offset_max" "20" ""} \ + {"$tl_len_offs_min" "1" ""} \ + {"$tl_len_offs_max" "20" ""} \ + {"$lin_axis_modx" "1" ""} \ + {"$lin_axis_mody" "1" ""} \ + {"$lin_axis_modz" "1" ""} \ + {"$cir_plane_xy" "1" ""} \ + {"$cir_plane_yz" "0" ""} \ + {"$cir_plane_zx" "0" ""} \ + {"$circular_record" "Full_Circle" ""} \ + {"$cir_def_plane" "XY" ""} \ + {"$cir_rad_min" ".0001" ""} \ + {"$cir_rad_max" "9999" ""} \ + {"$cir_ijk_opt" "Vector-Start_of_Arc_to_Center" ""} \ + {"$cir_vector" "Vector-Start of Arc to Center" ""} \ + {"$rap_wrk_pln_chg" "1" ""} \ + {"$rap_mode_trav_rate" "1" ""} \ + {"$rap_f_code" "1" ""} \ + {"$rap_cann_feed_status" "0" ""} \ + {"$rap_cann_feed_rate" "0" ""} \ + {"$rap_opt_feed_status" "0" ""} \ + {"$rap_opt_feed_rate" "0" ""} \ + {"$rap_mode_trav_value" "100" ""} \ + {"$cycle_rapto_opt" "None" ""} \ + {"$cycle_recto_opt" "None" ""} \ + {"$cycle_plane_control_opt" "None" ""} \ + {"$cycle_start_blk" "0" ""} \ + {"$tool_min_num" "1" ""} \ + {"$tool_max_num" "32" ""} \ + {"$tool_num_output" "Tool_Number_Only" ""} \ + {"SeqNo_output" "0" ""} \ + {"$oth_rev_xy_plane" "0" ""} \ + {"$oth_rev_yz_plane" "0" ""} \ + {"$oth_rev_zx_plane" "0" ""} \ + {"$oth_sup_out_ijk_zero" "0" ""} \ + {"$oth_sup_out_ijk_xyz" "0" ""} \ + {"$mom_usd_add_var" "" ""} \ + {"$evt_ncoutput_status" "Output_Imediately" ""} +{PB_Tcl_var} \ + {"$mom_sys_circle_code(CLW)" "2" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_delay_code(SECONDS)" "4" ""} \ + {"$mom_sys_delay_code(REVOLUTIONS)" "4" ""} \ + {"$mom_sys_circle_code(CCLW)" "3" ""} \ + {"$mom_sys_cutcom_plane_code(XY)" "17" ""} \ + {"$mom_sys_cutcom_plane_code(ZX)" "18" ""} \ + {"$mom_sys_cutcom_plane_code(YZ)" "19" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_cutcom_code(LEFT)" "41" ""} \ + {"$mom_sys_cutcom_code(RIGHT)" "42" ""} \ + {"$mom_sys_unit_code(IN)" "70" ""} \ + {"$mom_sys_unit_code(MM)" "71" ""} \ + {"$mom_sys_cutcom_code(OFF)" "40" ""} \ + {"$mom_sys_spindle_direction_code(CLW)" "3" ""} \ + {"$mom_sys_spindle_direction_code(CCLW)" "4" ""} \ + {"$mom_sys_spindle_direction_code(OFF)" "5" ""} \ + {"$mom_sys_spindle_mode_code(SFM)" "96" ""} \ + {"$mom_sys_spindle_mode_code(RPM)" "97" ""} \ + {"$mom_sys_coolant_code(OFF)" "9" ""} \ + {"$mom_sys_coolant_code(MIST)" "7" ""} \ + {"$mom_sys_coolant_code(FLOOD)" "8" ""} \ + {"$mom_sys_coolant_code(ON)" "8" ""} \ + {"$mom_sys_coolant_code(TAP)" "8" ""} \ + {"$mom_sys_clamp_code(ON)" "10" ""} \ + {"$mom_sys_clamp_code(OFF)" "11" ""} \ + {"$mom_sys_clamp_code(AXISON)" "10" ""} \ + {"$mom_sys_clamp_code(AXISOFF)" "11" ""} \ + {"$mom_sys_gcodes_per_block" "10" ""} \ + {"$mom_sys_mcodes_per_block" "5" ""} \ + {"$mom_sys_feed_rate_mode_code(INVERSE)" "93" ""} \ + {"$mom_sys_feed_rate_mode_code(IPM)" "94" ""} \ + {"$mom_sys_feed_rate_mode_code(IPR)" "95" ""} +## MOM SYS VARIABLES END diff --git a/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.tcl b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.tcl new file mode 100644 index 0000000..949a4a4 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/pblib/pb_Mill_5TT_Generic_MM.tcl @@ -0,0 +1,815 @@ +############ TCL FILE ###################################### +# USER AND DATE STAMP +############################################################ + + set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR] +# source ${cam_post_dir}mom_debug.tcl +# source ${cam_post_dir}mom_review.tcl +# MOM_set_debug_mode ON + source ${cam_post_dir}ugpost_base.tcl + +########## SYSTEM VARIABLE DECLARATIONS ############## + set mom_sys_spindle_mode_code(RPM) 97 + set mom_sys_program_stop_code 0 + set mom_sys_optional_stop_code 1 + set mom_sys_end_of_program_code 2 + set mom_sys_spindle_direction_code(CLW) 3 + set mom_sys_spindle_direction_code(CCLW) 4 + set mom_sys_spindle_direction_code(OFF) 5 + set mom_sys_tool_change_code 6 + set mom_sys_coolant_code(MIST) 7 + set mom_sys_coolant_code(ON) 8 + set mom_sys_coolant_code(FLOOD) 8 + set mom_sys_coolant_code(TAP) 8 + set mom_sys_coolant_code(OFF) 9 + set mom_sys_return_home 28 + set mom_sys_rewind_code 30 + set mom_sys_cutcom_code(LEFT) 41 + set mom_sys_cutcom_code(RIGHT) 42 + set mom_sys_adjust_code 43 + set mom_sys_adjust_code_minus 44 + set mom_sys_adjust_cancel_code 49 + set mom_sys_unit_code(IN) 70 + set mom_sys_unit_code(MM) 71 + set mom_sys_rapid_code 0 + set mom_sys_cycle_breakchip_code 73 + set mom_sys_linear_code 1 + set mom_sys_cycle_bore_no_drag_code 76 + set mom_sys_circle_code(CLW) 2 + set mom_sys_cycle_off 80 + set mom_sys_cycle_drill_code 81 + set mom_sys_circle_code(CCLW) 3 + set mom_sys_cycle_drill_deep_code 83 + set mom_sys_delay_code(SECONDS) 4 + set mom_sys_cycle_drill_dwell_code 82 + set mom_sys_delay_code(REVOLUTIONS) 4 + set mom_sys_cycle_tap_code 84 + set mom_sys_cutcom_plane_code(XY) 17 + set mom_sys_cycle_bore_code 85 + set mom_sys_cutcom_plane_code(ZX) 18 + set mom_sys_cycle_bore_drag_code 86 + set mom_sys_cutcom_plane_code(YZ) 19 + set mom_sys_cycle_bore_back_code 87 + set mom_sys_cutcom_code(OFF) 40 + set mom_sys_cycle_bore_manual_code 88 + set mom_sys_cycle_bore_dwell_code 89 + set mom_sys_output_code(ABSOLUTE) 90 + set mom_sys_output_code(INCREMENTAL) 91 + set mom_sys_absolute_pos_reset_code 92 + set mom_sys_feed_rate_mode_code(IPM) 94 + set mom_sys_feed_rate_mode_code(IPR) 95 + set mom_sys_spindle_mode_code(SFM) 96 + +####### KINEMATIC VARIABLE DECLARATIONS ############## + set mom_kin_y_axis_limit 635 + set mom_kin_4th_axis_min_limit 0 + set mom_kin_output_unit Inch + set mom_kin_flush_time 2.0 + set mom_kin_min_frn 0.0 + set mom_kin_tool_change_time 12.0 + set mom_kin_max_frn 0.0 + set mom_kin_5th_axis_min_limit 0 + set mom_kin_pivot_guage_offset 0.0 + set mom_kin_5th_axis_ang_offset 0.0 + set mom_kin_4th_axis_plane xy + set mom_kin_4th_axis_zero 0.0 + set mom_kin_min_dpm 0.0 + set mom_kin_5th_axis_type Head + set mom_kin_max_dpm 10 + set mom_kin_x_axis_limit 510 + set mom_kin_4th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_center_offset(0) 0.0 + set mom_kin_5th_axis_max_limit 360 + set mom_kin_4th_axis_address A + set mom_kin_linearization_flag 1 + set mom_kin_5th_axis_zero 0.0 + set mom_kin_5th_axis_limit_action Warning + set mom_kin_4th_axis_center_offset(1) 0.0 + set mom_kin_home_y_pos 0.0 + set mom_kin_4th_axis_type Head + set mom_kin_clamp_time 2.0 + set mom_kin_5th_axis_center_offset(1) 0.0 + set mom_kin_min_fpm 0.0 + set mom_kin_4th_axis_rotation standard + set mom_kin_4th_axis_limit_action Warning + set mom_kin_5th_axis_rotation standard + set mom_kin_max_fpm 1000 + set mom_kin_z_axis_limit 635 + set mom_kin_home_x_pos 0.0 + set mom_kin_machine_type 3_axis_mill + set mom_kin_4th_axis_min_incr 0.001 + set mom_kin_machine_resolution .00001 + set mom_kin_home_z_pos 0.0 + set mom_kin_4th_axis_max_limit 360 + set mom_kin_min_fpr 0.0 + set mom_kin_5th_axis_address B + set mom_kin_5th_axis_min_incr 0.001 + set mom_kin_max_traversal_rate 300 + set mom_kin_5th_axis_plane yz + set mom_kin_4th_axis_center_offset(2) 0.0 + set mom_kin_max_fpr 0.0 + set mom_kin_5th_axis_center_offset(2) 0.0 + set mom_kin_4th_axis_ang_offset 0.0 + set mom_kin_linearization_tol 0.001 + + +############## EVENT HANDLING SECTION ################ +#============================================================= +proc CYCLE_set { } { +#============================================================= + global cycle_name mom_spindle_axis + if { [info exists mom_spindle_axis ] == 0} { + set mom_spindle_axis 2 + } + MOM_force once G_motion X Y Z R + if { [string first DWELL $cycle_name] != -1 } { + MOM_force once cycle_dwell } + if { [string first NODRAG $cycle_name] != -1 } { + MOM_force once cycle_nodrag } + if { [string first DEEP $cycle_name]!= -1 } { + MOM_force once cycle_step } + if { [string first BREAK_CHIP $cycle_name] != -1 } { + MOM_force once cycle_step + } + +} + + +#============================================================= +proc CIRCLE_set { } { +#============================================================= + global mom_pos_arc_plane + MOM_suppress off I J K + switch $mom_pos_arc_plane { + XY { MOM_suppress always K } + YZ { MOM_suppress always I } + ZX { MOM_suppress always J } + } +} + + +#============================================================= +proc COOLANT_set { } { +#============================================================= + global mom_coolant_status mom_coolant_mode + if { $mom_coolant_status != "OFF" } \ + { + set mom_coolant_status ON + } + if { $mom_coolant_status == "ON" } \ + { + if { $mom_coolant_mode != "" } \ + { + set mom_coolant_status $mom_coolant_mode + } + } +} + + +#============================================================= +proc CUTCOM_set { } { +#============================================================= + global mom_cutcom_status mom_cutcom_mode + if { $mom_cutcom_status != "OFF" } \ + { + set mom_cutcom_status ON + } + if { $mom_cutcom_status == "ON" } \ + { + if { $mom_cutcom_mode != "" } \ + { + set mom_cutcom_status $mom_cutcom_mode + } + } +} + + +#============================================================= +proc SPINDLE_set { } { +#============================================================= + global mom_spindle_status mom_spindle_mode + if { $mom_spindle_status != "OFF" } \ + { + set mom_spindle_status ON + } + if { $mom_spindle_status == "ON" } \ + { + if { $mom_spindle_mode != "" } \ + { + set mom_spindle_status $mom_spindle_mode + } + } +} + + +#============================================================= +proc OPSKIP_set { } { +#============================================================= + global mom_opskip_status mom_sys_opskip_code + switch $mom_opskip_status \ + { + ON { + MOM_set_line_leader always $mom_sys_opskip_code + } + default { + MOM_set_line_leader off $mom_sys_opskip_code + } + } +} + + +#============================================================= +proc RAPID_set { } { +#============================================================= + global mom_spindle_axis + global mom_pos mom_last_z_pos + global spindle_first + if { [info exists mom_spindle_axis] == 0} \ + { + set mom_spindle_axis 2 + } + if { $mom_pos($mom_spindle_axis) > $mom_last_z_pos}\ + { + set spindle_first TRUE + } else \ + { + set spindle_first FALSE + } +} + + +#============================================================= +proc SEQNO_set { } { +#============================================================= + global mom_sequence_mode mom_sequence_number + global mom_sequence_increment mom_sequence_frequency + if { [info exists mom_sequence_mode] } \ + { + switch $mom_sequence_mode \ + { + OFF { + MOM_set_seq_off + } + ON { + MOM_set_seq_on + } + default { + MOM_output_literal "error: mom_sequence_mode unknown" + } + } + } else \ + { + MOM_reset_sequence $mom_sequence_number \ + $mom_sequence_increment $mom_sequence_frequency + } +} + + +#============================================================= +proc MODES_set { } { +#============================================================= + global mom_output_mode + switch $mom_output_mode \ + { + ABSOLUTE { + set isincr OFF + } + default { + set isincr ON + } + } + MOM_incremental $isincr X Y Z +} + + +#============================================================= +proc MOM_start_of_program { } { +#============================================================= + global in_sequence + global mom_logname + global mom_date + set in_sequence start_of_program +#*** The following procedure opens the warning and listing files + OPEN_files +#*** The following procedure lists the header information in commentary dat + LIST_FILE_HEADER + MOM_output_literal "(################### #########################)" + MOM_output_literal "(# Created By : $mom_logname) " + MOM_output_literal "(# Creation Date: $mom_date)" + MOM_output_literal "(################### #########################)" + MOM_do_template rewind_stop_code + MOM_do_template output_unit +} + + +#============================================================= +proc MOM_start_of_path { } { +#============================================================= + global in_sequence + set in_sequence start_of_path + MOM_do_template coordinate_system +} + + +#============================================================= +proc MOM_from_move { } { +#============================================================= + MOM_do_template from +} + + +#============================================================= +proc MOM_tool_change { } { +#============================================================= + global in_sequence + if { $in_sequence != "none" } { MOM_do_template return_home } + if { $in_sequence != "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change } + if { $in_sequence == "none" } { MOM_do_template auto_tool_change_1 } +} + + +#============================================================= +proc MOM_spindle_rpm { } { +#============================================================= + global in_sequence + SPINDLE_set + if { $in_sequence == "none" } { MOM_do_template spindle_rpm } +} + + +#============================================================= +proc MOM_coolant_start { } { +#============================================================= +} + + +#============================================================= +proc MOM_initial_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + global mom_motion_type + global in_sequence + set in_sequence none + MOM_force once G_motion X Y Z + MOM_do_template initial_move + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + if { $mom_motion_type == "RAPID" } \ + { + MOM_rapid_move + } else \ + { + MOM_linear_move + } +} + + +#============================================================= +proc MOM_start_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_approach_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_engage_move { } { +#============================================================= +} + + +#============================================================= +proc MOM_retract_motion { } { +#============================================================= + MOM_do_template tool_len_adj_off + MOM_do_template coolant_off + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_return_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_gohome_motion { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_path { } { +#============================================================= +} + + +#============================================================= +proc MOM_end_of_program { } { +#============================================================= + MOM_do_template end_of_program +#**** The following procedure lists the tool list with time in commentary data + LIST_FILE_TRAILER +#**** The following procedure closes the warning and listing files + CLOSE_files +} + + +#============================================================= +proc MOM_first_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_tool_length_comp { } { +#============================================================= + MOM_do_template tool_length_adjust +} + + +#============================================================= +proc MOM_set_mode { } { +#============================================================= + MOM_do_template set_mode +} + + +#============================================================= +proc MOM_spindle_off { } { +#============================================================= + MOM_do_template spindle_off +} + + +#============================================================= +proc MOM_coolant_on { } { +#============================================================= + global in_sequence + COOLANT_set + if { $in_sequence != "none" } { MOM_do_template coolant_on } +} + + +#============================================================= +proc MOM_coolant_off { } { +#============================================================= + COOLANT_set + MOM_do_template coolant_off +} + + +#============================================================= +proc MOM_feedrates { } { +#============================================================= +} + + +#============================================================= +proc MOM_cutcom_on { } { +#============================================================= + global in_sequence + global mom_cutcom_status + if { $mom_cutcom_status != "SAME"} \ + { + global mom_sys_cutcom_code + MOM_output_literal $mom_sys_cutcom_code(OFF) + } + CUTCOM_set + if { $in_sequence != "none" } { MOM_do_template cutcom_on } +} + + +#============================================================= +proc MOM_cutcom_off { } { +#============================================================= + MOM_do_template cutcom_off +} + + +#============================================================= +proc MOM_delay { } { +#============================================================= + MOM_do_template delay +} + + +#============================================================= +proc MOM_opstop { } { +#============================================================= + MOM_do_template opstop +} + + +#============================================================= +proc MOM_opskip_on { } { +#============================================================= +} + + +#============================================================= +proc MOM_opskip_off { } { +#============================================================= +} + + +#============================================================= +proc MOM_auxfun { } { +#============================================================= + MOM_do_template auxfun +} + + +#============================================================= +proc MOM_prefun { } { +#============================================================= + MOM_do_template prefun +} + + +#============================================================= +proc MOM_load_tool { } { +#============================================================= +} + + +#============================================================= +proc MOM_sequence_number { } { +#============================================================= + SEQNO_set + MOM_do_template sequence_number +} + + +#============================================================= +proc MOM_stop { } { +#============================================================= + MOM_do_template stop +} + + +#============================================================= +proc MOM_tool_preselect { } { +#============================================================= + MOM_do_template tool_preselect +} + + +#============================================================= +proc MOM_linear_move { } { +#============================================================= + global mom_feed_rate + global mom_feed_rate_per_rev + global mom_kin_max_fpm + if { $mom_feed_rate >= $mom_kin_max_fpm } \ + { + MOM_rapid_move + return + } + MOM_do_template linear +} + + +#============================================================= +proc MOM_circular_move { } { +#============================================================= + CIRCLE_set + MOM_do_template circle +} + + +#============================================================= +proc MOM_rapid_move { } { +#============================================================= + global spindle_first + RAPID_set + if { $spindle_first == "TRUE" } \ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } elseif { $spindle_first == "FALSE"}\ + { + MOM_do_template rapid_traverse + MOM_do_template rapid_spindle + } else \ + { + MOM_do_template rapid_traverse + } +} + + +#============================================================= +proc MOM_cycle_off { } { +#============================================================= + MOM_do_template cycle_off +} + + +#============================================================= +proc MOM_cycle_plane_change { } { +#============================================================= + MOM_do_template cycle_plane_change +} + + +#============================================================= +proc MOM_drill { } { +#============================================================= + global cycle_name + set cycle_name DRILL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_move { } { +#============================================================= + MOM_do_template cycle_drill +} + + +#============================================================= +proc MOM_drill_dwell { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_drill_dwell_move { } { +#============================================================= + MOM_do_template cycle_drill_dwell +} + + +#============================================================= +proc MOM_drill_deep { } { +#============================================================= + global cycle_name + set cycle_name DRILL_DEEP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_deep_move { } { +#============================================================= + MOM_do_template cycle_drill_deep +} + + +#============================================================= +proc MOM_drill_break_chip { } { +#============================================================= + global cycle_name + set cycle_name DRILL_BREAK_CHIP + CYCLE_set +} + + +#============================================================= +proc MOM_drill_break_chip_move { } { +#============================================================= + MOM_do_template cycle_breakchip +} + + +#============================================================= +proc MOM_tap { } { +#============================================================= + global cycle_name + set cycle_name TAP + CYCLE_set +} + + +#============================================================= +proc MOM_tap_move { } { +#============================================================= + MOM_do_template cycle_tap +} + + +#============================================================= +proc MOM_bore { } { +#============================================================= + global cycle_name + set cycle_name BORE + CYCLE_set +} + + +#============================================================= +proc MOM_bore_move { } { +#============================================================= + MOM_do_template cycle_bore +} + + +#============================================================= +proc MOM_bore_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_drag +} + + +#============================================================= +proc MOM_bore_no_drag { } { +#============================================================= + global cycle_name + set cycle_name BORE_NO_DRAG + CYCLE_set +} + + +#============================================================= +proc MOM_bore_no_drag_move { } { +#============================================================= + MOM_do_template cycle_bore_no_drag +} + + +#============================================================= +proc MOM_bore_manual { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_move { } { +#============================================================= + MOM_do_template cycle_bore_manual +} + + +#============================================================= +proc MOM_bore_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_dwell +} + + +#============================================================= +proc MOM_bore_back { } { +#============================================================= + global cycle_name + set cycle_name BORE_BACK + CYCLE_set +} + + +#============================================================= +proc MOM_bore_back_move { } { +#============================================================= + MOM_do_template cycle_bore_back +} + + +#============================================================= +proc MOM_bore_manual_dwell { } { +#============================================================= + global cycle_name + set cycle_name BORE_MANUAL_DWELL + CYCLE_set +} + + +#============================================================= +proc MOM_bore_manual_dwell_move { } { +#============================================================= + MOM_do_template cycle_bore_m_dwell +} diff --git a/PB16_1999_release/POSTBUILD/post_builder.bat b/PB16_1999_release/POSTBUILD/post_builder.bat new file mode 100644 index 0000000..05a935c --- /dev/null +++ b/PB16_1999_release/POSTBUILD/post_builder.bat @@ -0,0 +1,35 @@ +@echo off + +REM========================================================================== +REM Set UGII_BASE_DIR & UGII_ROOT_DIR. +REM========================================================================== +call "..\UGII\SetEnv.bat" + +REM========================================================================== +REM PB_HOME is the only env var referenced in the Post Builder source codes. +REM It should be set base on the Post Builder installation. +REM========================================================================== +set PB_HOME=%UGII_BASE_DIR%\postbuild + +REM========================================================================== +REM UG DLL's search path. +REM========================================================================== +set PATH=%UGII_BASE_DIR%\UGII;%PATH% + +REM========================================================================== +REM Some vars for Tcl etc. +REM========================================================================== +set PB_TCL=%PB_HOME%\tcl +set TCL_LIBRARY=%PB_TCL%\share\tcl8.0 +set TK_LIBRARY=%PB_TCL%\share\tk8.0 +set TIX_LIBRARY=%PB_TCL%\share\tix4.1 + +REM========================================================================== +REM Tcl DLL search path +REM========================================================================== +set PATH=%PB_TCL%\exe;%PATH% + +REM========================================================================== +REM Start Post Builder +REM========================================================================== +%PB_HOME%\app\post_builder.exe diff --git a/PB16_1999_release/POSTBUILD/tcl/exe/stooop.tcl b/PB16_1999_release/POSTBUILD/tcl/exe/stooop.tcl new file mode 100644 index 0000000..c0ca26d --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/exe/stooop.tcl @@ -0,0 +1,614 @@ +set rcsId {$Id: pb_stooop.tcl,v 1.2 1999/04/27 18:35:22 dasn INTEGRATED=^BY=dasn^ON=Tue_Apr_27_11_35_20_PDT_1999^GROUP=/cam/v160^GROUPBR=1_1_1_1^FROMM=ugv160^ $} + +package provide stooop 3.6 + +catch {rename proc _proc} ;# rename proc before it is overloaded, ignore error in case of multiple inclusion of this file + +namespace eval ::stooop { + variable checkCode + variable traceProcedureChannel + variable traceProcedureFormat + variable traceDataChannel + variable traceDataFormat + variable traceDataOperations + + set checkCode {} ;# no checking by default: use an empty instruction to avoid any performance hit + if {[info exists ::env(STOOOPCHECKALL)]} { + array set ::env {STOOOPCHECKPROCEDURES {} STOOOPCHECKDATA {}} + } + if {[info exists ::env(STOOOPCHECKPROCEDURES)]} { + append checkCode {::stooop::checkProcedure;} + } + if {[info exists ::env(STOOOPTRACEALL)]} { ;# use same channel for both traces + set ::env(STOOOPTRACEPROCEDURES) $::env(STOOOPTRACEALL) + set ::env(STOOOPTRACEDATA) $::env(STOOOPTRACEALL) + } + if {[info exists ::env(STOOOPTRACEPROCEDURES)]} { + set traceProcedureChannel $::env(STOOOPTRACEPROCEDURES) + if {![regexp {^stdout|stderr$} $traceProcedureChannel]} { + set traceProcedureChannel [open $::env(STOOOPTRACEPROCEDURES) w+] ;# eventually truncate output file if it exists + } + set traceProcedureFormat {class: %C, procedure: %p, object: %O, arguments: %a} ;# default format + catch {set traceProcedureFormat $::env(STOOOPTRACEPROCEDURESFORMAT)} ;# eventually override with user defined format + append checkCode {::stooop::traceProcedure;} + } + if {[info exists ::env(STOOOPTRACEDATA)]} { + set traceDataChannel $::env(STOOOPTRACEDATA) + if {![regexp {^stdout|stderr$} $traceDataChannel]} { + set traceDataChannel [open $::env(STOOOPTRACEDATA) w+] ;# eventually truncate output file if it exists + } + # default format + set traceDataFormat {class: %C, procedure: %p, array: %A, object: %O, member: %m, operation: %o, value: %v} + catch {set traceDataFormat $::env(STOOOPTRACEDATAFORMAT)} ;# eventually override with user defined format + set traceDataOperations rwu ;# trace all operations by default + catch {set traceDataOperations $::env(STOOOPTRACEDATAOPERATIONS)} ;# eventually override with user defined operations + } + + namespace export class virtual new delete classof ;# export public commands + + if {![info exists newId]} { + variable newId 0 ;# initialize object id counter only once even if this file is sourced several times + } + + _proc new {classOrId args} { ;# create an object of specified class or copy an existing object + variable newId + variable fullClass + + # use local variable for identifier because new can be invoked recursively + if {[scan $classOrId %u dummy]==0} { ;# first argument is a class + set constructor ${classOrId}::[namespace tail $classOrId] ;# generate constructor name + # we could detect here whether class was ever declared but that would prevent stooop packages to load properly, because + # constructor would not be invoked and thus class source file never sourced + # invoke the constructor for the class with optional arguments in caller's variable context so that object creation is + # transparent and that array names as constructor parameters work with a simple upvar + # note: if class is in a package, the class namespace code is loaded here, as the first object of the class is created + uplevel $constructor [set id [incr newId]] $args + # generate fully qualified class namespace name now that we are sure that class namespace code has been invoked + set fullClass($id) [namespace qualifiers [uplevel namespace which -command $constructor]] + } else { ;# first argument is an object identifier (unsigned integer), copy source object to new object of identical class + if {[catch {set fullClass([set id [incr newId]]) $fullClass($classOrId)}]} { + error "invalid object identifier $classOrId" + } + # invoke the copy constructor for the class in caller's variable context so that object copy is transparent (see above) + uplevel $fullClass($classOrId)::_copy $id $classOrId + } + return $id ;# return a unique object identifier + } + + _proc delete {args} { ;# delete one or more objects + variable fullClass + + foreach id $args { ;# destruct in caller's variable context so that object deletion is transparent + uplevel ::stooop::deleteObject $fullClass($id) $id + unset fullClass($id) + } + } + + # delete object data starting at specified class layer and going up the base class hierarchy if any + # invoke the destructor for the object class and unset all the object data members for the class + # the destructor will in turn delete the base classes layers + _proc deleteObject {fullClass id} { + # invoke the destructor for the class in caller's variable context so that object deletion is transparent + uplevel ${fullClass}::~[namespace tail $fullClass] $id + # delete all this object data members if any (assume that they were stored as ${class}::($id,memberName)) + foreach name [array names ${fullClass}:: $id,*] { + unset ${fullClass}::($name) + } + # data member arrays deletion is left to the user + } + + _proc classof {id} { + variable fullClass + + return $fullClass($id) ;# return class of object + } + + _proc copy {fullClass from to} { ;# copy object data members from one object to another + set index [string length $from] + foreach name [array names ${fullClass}:: $from,*] { ;# copy regular data members + set ${fullClass}::($to[string range $name $index end]) [set ${fullClass}::($name)] + } + # if any, array data members copy is left to the class programmer through the then mandatory copy constructor + } +} + +_proc ::stooop::class {args} { + variable declared + + set class [lindex $args 0] + set declared([uplevel namespace eval $class {namespace current}]) {} ;# register class using its fully qualified name + # create the empty name array used to hold all class objects so that static members can be directly initialized within the class + # declaration but outside member procedures + uplevel namespace eval $class [list "::variable {}\n[lindex $args end]"] +} + +# if procedure is a member of a known class, class and procedure names are set and true is returned, otherwise false is returned +_proc ::stooop::parseProcedureName {namespace name fullClassVariable procedureVariable messageVariable} { + # namespace argument is the current namespace (fully qualified) in which the procedure is defined + variable declared + upvar $fullClassVariable fullClass $procedureVariable procedure $messageVariable message + + if {[info exists declared($namespace)]&&([string length [namespace qualifiers $name]]==0)} { + # a member procedure is being defined inside a class namespace + set fullClass $namespace + set procedure $name ;# member procedure name is full name + return 1 + } else { ;# procedure is either a member of a known class or a regular procedure + if {![string match ::* $name]} { ;# eventually fully qualify procedure name + if {[string compare $namespace ::]==0} { ;# global namespace special case + set name ::$name + } else { + set name ${namespace}::$name + } + } + set fullClass [namespace qualifiers $name] ;# eventual class name is leading part + if {[info exists declared($fullClass)]} { ;# if class is known + set procedure [namespace tail $name] ;# procedure always is the tail + return 1 + } else { ;# not a member procedure + if {[string length $fullClass]==0} { + set message "procedure $name class name is empty" + } else { + set message "procedure $name class $fullClass is unknown" + } + return 0 + } + } +} + +# virtual operator, to be placed before proc +# virtualize a member procedure, determine whether it is a pure virtual, check for procedures that cannot be virtualized +_proc ::stooop::virtual {keyword name arguments args} { + variable pureVirtual ;# set a flag so that proc knows it is acting upon a virtual procedure, also serves as a pure indicator + + if {[string compare [uplevel namespace which -command $keyword] ::proc]!=0} { + error "virtual operator works only on proc, not $keyword" + } + if {![parseProcedureName [uplevel namespace current] $name fullClass procedure message]} { + error $message ;# not in a member procedure definition + } + set class [namespace tail $fullClass] + if {[string compare $class $procedure]==0} { + error "cannot make class $fullClass constructor virtual" + } + if {[string compare ~$class $procedure]==0} { + error "cannot make class $fullClass destructor virtual" + } + if {[string compare [lindex $arguments 0] this]!=0} { + error "cannot make static procedure $procedure of class $fullClass virtual" + } + set pureVirtual [expr {[llength $args]==0}] ;# no procedure body means pure virtual + # process procedure declaration, body being empty for pure virtual procedure + uplevel ::proc [list $name $arguments [lindex $args 0]] ;# make virtual transparent by using uplevel + unset pureVirtual +} + +_proc proc {name arguments args} { + if {![::stooop::parseProcedureName [uplevel namespace current] $name fullClass procedure message]} { + # not in a member procedure definition, fall back to normal procedure declaration + # uplevel is required instead of eval here otherwise tcl seems to forget the procedure namespace if it exists + uplevel _proc [list $name $arguments] $args + return + } + if {[llength $args]==0} { ;# check for procedure body presence + error "missing body for ${fullClass}::$procedure" + } + set class [namespace tail $fullClass] + if {[string compare $class $procedure]==0} { ;# class constructor definition + if {[string compare [lindex $arguments 0] this]!=0} { + error "class $fullClass constructor first argument must be this" + } + if {[string compare [lindex $arguments 1] copy]==0} { ;# user defined copy constructor definition + if {[llength $arguments]!=2} { + error "class $fullClass copy constructor must have 2 arguments exactly" + } + if {[catch {info body ::${fullClass}::$class}]} { ;# make sure of proper declaration order + error "class $fullClass copy constructor defined before constructor" + } + eval ::stooop::constructorDeclaration $fullClass $class 1 \{$arguments\} $args + } else { ;# main constructor + eval ::stooop::constructorDeclaration $fullClass $class 0 \{$arguments\} $args + ::stooop::generateDefaultCopyConstructor $fullClass ;# always generate default copy constructor + } + } elseif {[string compare ~$class $procedure]==0} { ;# class destructor declaration + if {[llength $arguments]!=1} { + error "class $fullClass destructor must have 1 argument exactly" + } + if {[string compare [lindex $arguments 0] this]!=0} { + error "class $fullClass destructor argument must be this" + } + if {[catch {info body ::${fullClass}::$class}]} { ;# use fastest method for testing procedure existence + error "class $fullClass destructor defined before constructor" ;# make sure of proper declaration order + } + ::stooop::destructorDeclaration $fullClass $class $arguments [lindex $args 0] + } else { ;# regular member procedure, may be static if there is no this first argument + if {[catch {info body ::${fullClass}::$class}]} { ;# make sure of proper declaration order + error "class $fullClass member procedure $procedure defined before constructor" + } + ::stooop::memberProcedureDeclaration $fullClass $class $procedure $arguments [lindex $args 0] + } +} + +_proc ::stooop::constructorDeclaration {fullClass class copy arguments args} { ;# copy flag is set for user defined copy constructor + variable checkCode + variable fullBases + variable variable + + set number [llength $args] + if {($number%2)==0} { ;# check that each base class constructor has arguments + error "bad class $fullClass constructor declaration, a base class, contructor arguments or body may be missing" + } + if {[string compare [lindex $arguments end] args]==0} { + set variable($fullClass) {} ;# remember that there is a variable number of arguments in class constructor + } + if {!$copy} { + # do not initialize (or reinitialize in case of multiple class file source statements) base classes for copy constructor + set fullBases($fullClass) {} + } + foreach {base baseArguments} [lrange $args 0 [expr {$number-2}]] { ;# check base classes and their constructor arguments + # fully qualify base class namespace by looking up constructor, which must exist + set constructor ${base}::[namespace tail $base] + # in case base class is defined in a file that is part of a package, make sure that file is sourced through the tcl + # package auto-loading mechanism by directly invoking the base class constructor while ignoring the resulting error + catch {$constructor} + # determine fully qualified base class name in user invocation level (up 2 levels from here since this procedure is invoked + # exclusively by proc) + set fullBase [namespace qualifiers [uplevel 2 namespace which -command $constructor]] + if {[string length $fullBase]==0} { ;# base constructor is not defined + if {[string match *$base $fullClass]} { + # if the specified base class name is included last in the fully qualified class name, assume that it was meant to + # be the same + error "class $fullClass cannot be derived from itself" + } else { + error "class $fullClass constructor defined before base class $base constructor" + } + } + if {!$copy} { ;# check and save base classes only for main constructor that defines them + if {[lsearch -exact $fullBases($fullClass) $fullBase]>=0} { + error "class $fullClass directly inherits from class $fullBase more than once" + } + lappend fullBases($fullClass) $fullBase + } + # remove new lines in base arguments part in case user has formatted long declarations with new lines + regsub -all \n $baseArguments {} constructorArguments($fullBase) + } + # setup access to class data (an empty named array) + # fully qualify tcl variable command for it may have been redefined within the class namespace + # since constructor is directly invoked by new, the object identifier must be valid, so debugging the procedure is pointless + set constructorBody \ +"::variable {} +$checkCode +" + if {[llength $fullBases($fullClass)]>0} { ;# base class(es) derivation specified + # invoke base class constructors before evaluating constructor body + # then set base part hidden derived member so that virtual procedures are invoked at base class level as in C++ + if {[info exists variable($fullClass)]} { ;# variable number of arguments in derived class constructor + foreach fullBase $fullBases($fullClass) { + if {![info exists constructorArguments($fullBase)]} { + error "missing base class $fullBase constructor arguments from class $fullClass constructor" + } + set baseConstructor ${fullBase}::[namespace tail $fullBase] + if {[info exists variable($fullBase)]&&([string first {$args} $constructorArguments($fullBase)]>=0)} { + # variable number of arguments in base class constructor and in derived class base class constructor arguments + # use eval so that base class constructor sees arguments instead of a list + # only the last argument of the base class constructor arguments is considered as a variable list + # (it usually is $args but could be a procedure invocation, such as [filter $args]) + # fully qualify tcl commands such as set, for they may have been redefined within the class namespace + append constructorBody \ +"::set _list \[::list $constructorArguments($fullBase)\] +::eval $baseConstructor \$this \[::lrange \$_list 0 \[::expr {\[::llength \$_list\]-2}\]\] \[::lindex \$_list end\] +::unset _list +::set ${fullBase}::(\$this,_derived) $fullClass +" + } else { + # no special processing needed + # variable number of arguments in base class constructor or + # variable arguments list passed as is to base class constructor + append constructorBody \ +"$baseConstructor \$this $constructorArguments($fullBase) +::set ${fullBase}::(\$this,_derived) $fullClass +" + } + } + } else { ;# constant number of arguments + foreach fullBase $fullBases($fullClass) { + if {![info exists constructorArguments($fullBase)]} { + error "missing base class $fullBase constructor arguments from class $fullClass constructor" + } + set baseConstructor ${fullBase}::[namespace tail $fullBase] + append constructorBody \ +"$baseConstructor \$this $constructorArguments($fullBase) +::set ${fullBase}::(\$this,_derived) $fullClass +" + } + } + } ;# else no base class derivation specified + if {$copy} { ;# for user defined copy constructor, copy derived class member if it exists + append constructorBody \ +"::catch {::set ${fullClass}::(\$this,_derived) \[::set ${fullClass}::(\$[::lindex $arguments 1],_derived)\]} +" + } + append constructorBody [lindex $args end] ;# finally append user defined procedure body + if {$copy} { + _proc ${fullClass}::_copy $arguments $constructorBody + } else { + _proc ${fullClass}::$class $arguments $constructorBody + } +} + +_proc ::stooop::destructorDeclaration {fullClass class arguments body} { + variable checkCode + variable fullBases + + # setup access to class data + # since the object identifier is always valid at this point, debugging the procedure is pointless + set body \ +"::variable {} +$checkCode +$body +" + # if there are any, delete base classes parts in reverse order of construction + for {set index [expr {[llength $fullBases($fullClass)]-1}]} {$index>=0} {incr index -1} { + set fullBase [lindex $fullBases($fullClass) $index] + append body \ +"::stooop::deleteObject $fullBase \$this +" + } + _proc ${fullClass}::~$class $arguments $body +} + +_proc ::stooop::memberProcedureDeclaration {fullClass class procedure arguments body} { + variable checkCode + variable pureVirtual + + if {[info exists pureVirtual]} { ;# virtual declaration + if {$pureVirtual} { ;# pure virtual declaration + # setup access to class data + # evaluate derived procedure which must exists. derived procedure return value is automatically returned + _proc ${fullClass}::$procedure $arguments \ +"::variable {} +$checkCode +::uplevel \$${fullClass}::(\$this,_derived)::$procedure \[::lrange \[::info level 0\] 1 end\] +" + } else { ;# regular virtual declaration + # setup access to class data + # evaluate derived procedure and return if it exists + # else evaluate the base class procedure which can be invoked from derived class procedure by prepending _ + _proc ${fullClass}::_$procedure $arguments \ +"::variable {} +$checkCode +$body +" + _proc ${fullClass}::$procedure $arguments \ +"::variable {} +$checkCode +if {!\[::catch {::info body \$${fullClass}::(\$this,_derived)::$procedure}\]} { +::return \[::uplevel \$${fullClass}::(\$this,_derived)::$procedure \[::lrange \[::info level 0\] 1 end\]\] +} +::uplevel ${fullClass}::_$procedure \[::lrange \[::info level 0\] 1 end\] +" + } + } else { ;# non virtual declaration + # setup access to class data + _proc ${fullClass}::$procedure $arguments \ +"::variable {} +$checkCode +$body +" + } +} + +# generate default copy procedure which may be overriden by the user for any class layer +_proc ::stooop::generateDefaultCopyConstructor {fullClass} { + variable fullBases + + foreach fullBase $fullBases($fullClass) { ;# generate code for cloning base classes layers if there is at least one base class + append body \ +"${fullBase}::_copy \$this \$sibling +" + } + append body \ +"::stooop::copy $fullClass \$sibling \$this +" + _proc ${fullClass}::_copy {this sibling} $body +} + + +if {[llength [array names ::env STOOOP*]]>0} { ;# if one or more environment variables are set, we are in debugging mode + + catch {rename ::stooop::class ::stooop::_class} ;# gracefully handle multiple sourcing of this file + _proc ::stooop::class {args} { ;# use a new class procedure instead of adding debugging code to existing one + variable traceDataOperations + + set class [lindex $args 0] + if {[info exists ::env(STOOOPCHECKDATA)]} { ;# check write and unset operations on empty named array holding class data + uplevel namespace eval $class [list {::trace variable {} wu ::stooop::checkData}] + } + if {[info exists ::env(STOOOPTRACEDATA)]} { ;# trace write and unset operations on empty named array holding class data + uplevel namespace eval $class [list "::trace variable {} $traceDataOperations ::stooop::traceData"] + } + uplevel ::stooop::_class $args + } + + if {[info exists ::env(STOOOPCHECKPROCEDURES)]} { ;# prevent the creation of any object of a pure interface class + # use a new virtual procedure instead of adding debugging code to existing one + catch {rename ::stooop::virtual ::stooop::_virtual} ;# gracefully handle multiple sourcing of this file + _proc ::stooop::virtual {keyword name arguments args} { + variable interface ;# keep track of interface classes (which have at least 1 pure virtual procedure) + + uplevel ::stooop::_virtual [list $keyword $name $arguments] $args + parseProcedureName [uplevel namespace current] $name fullClass procedure message + if {[llength $args]==0} { ;# no procedure body means pure virtual + set interface($fullClass) {} + } + } + + catch {rename ::stooop::new ::stooop::_new} ;# gracefully handle multiple sourcing of this file + _proc ::stooop::new {classOrId args} { ;# use a new new procedure instead of adding debugging code to existing one + variable fullClass + variable interface + + if {[scan $classOrId %u dummy]==0} { ;# first argument is a class + set constructor ${classOrId}::[namespace tail $classOrId] ;# generate constructor name + catch {$constructor} ;# force loading in case class is in a package so namespace commands work properly + set fullName [namespace qualifiers [uplevel namespace which -command $constructor]] + } else { ;# first argument is an object identifier + set fullName $fullClass($classOrId) ;# class code, if from a package, must already be loaded + } + if {[info exists interface($fullName)]} { + error "class $fullName with pure virtual procedures should not be instanciated" + } + return [uplevel ::stooop::_new $classOrId $args] + } + } + + _proc ::stooop::ancestors {fullClass} { ;# return the unsorted list of ancestors in class hierarchy + variable ancestors ;# use a cache for efficiency + variable fullBases + + if {[info exists ancestors($fullClass)]} { + return $ancestors($fullClass) ;# found in the cache + } + set list {} + foreach class $fullBases($fullClass) { + set list [concat $list [list $class] [ancestors $class]] + } + set ancestors($fullClass) $list ;# save in cache + return $list + } + + # since this procedure is always invoked from a debug procedure, take the extra level in the stack frame into account + # parameters (passed as references) that cannot be determined are not set + _proc ::stooop::debugInformation {className fullClassName procedureName fullProcedureName thisParameterName} { + upvar $className class $fullClassName fullClass $procedureName procedure $fullProcedureName fullProcedure\ + $thisParameterName thisParameter + variable declared + + set namespace [uplevel 2 namespace current] + if {[lsearch -exact [array names declared] $namespace]<0} return ;# not in a class namespace + set fullClass [string trimleft $namespace :] ;# remove redundant global qualifier + set class [namespace tail $fullClass] ;# class name + set list [info level -2] + if {[llength $list]==0} return ;# not in a procedure, nothing else to do + set procedure [lindex $list 0] + set fullProcedure [uplevel 3 namespace which -command $procedure] ;# procedure must be known at the invoker level + set procedure [namespace tail $procedure] ;# strip procedure name + if {[string compare $class $procedure]==0} { ;# constructor + set procedure constructor + } elseif {[string compare ~$class $procedure]==0} { ;# destructor + set procedure destructor + } + if {[string compare [lindex [info args $fullProcedure] 0] this]==0} { ;# non static procedure + set thisParameter [lindex $list 1] ;# object identifier is first argument + } + } + + _proc ::stooop::checkProcedure {} { ;# check that member procedure is valid for object passed as parameter + variable fullClass + + debugInformation class qualifiedClass procedure qualifiedProcedure this + if {![info exists this]} return ;# static procedure, no checking possible + if {[string compare $procedure constructor]==0} return ;# in constructor, checking useless since object is not yet created + if {![info exists fullClass($this)]} { + error "$this is not a valid object identifier" + } + set fullName [string trimleft $fullClass($this) :] + if {[string compare $fullName $qualifiedClass]==0} return ;# procedure and object classes match + # restore global qualifiers to compare with internal full class array data + if {[lsearch -exact [ancestors ::$fullName] ::$qualifiedClass]<0} { + error "class $qualifiedClass of $qualifiedProcedure procedure not an ancestor of object $this class $fullName" + } + } + + _proc ::stooop::traceProcedure {} { ;# gather current procedure data, perform substitutions and output to trace channel + variable traceProcedureChannel + variable traceProcedureFormat + + debugInformation class qualifiedClass procedure qualifiedProcedure this + # all debug data is available since we are for sure in a class procedure + set text $traceProcedureFormat + regsub -all %C $text $qualifiedClass text ;# fully qualified class name + regsub -all %c $text $class text + regsub -all %P $text $qualifiedProcedure text ;# fully qualified procedure name + regsub -all %p $text $procedure text + if {[info exists this]} { ;# non static procedure + regsub -all %O $text $this text + regsub -all %a $text [lrange [info level -1] 2 end] text ;# remaining arguments + } else { ;# static procedure + regsub -all %O $text {} text + regsub -all %a $text [lrange [info level -1] 1 end] text ;# remaining arguments + } + puts $traceProcedureChannel $text + } + + # check that class data member is accessed within procedure of identical class + # then if procedure is not static, check that only data belonging to the object passed as parameter is accessed + _proc ::stooop::checkData {array name operation} { + scan $name %u,%s identifier member + if {[info exists member]&&([string compare $member _derived]==0)} return ;# ignore internally defined members + + debugInformation class qualifiedClass procedure qualifiedProcedure this + if {![info exists class]} return ;# no checking can be done outside of a class namespace + set array [uplevel [list namespace which -variable $array]] ;# determine array full name + if {![info exists procedure]} { ;# inside a class namespace + if {[string compare $array ::${qualifiedClass}::]!=0} { ;# compare with empty named array fully qualified name + # trace command error message is automatically prepended and indicates operation + error "class access violation in class $qualifiedClass namespace" + } + return ;# done + } + if {[string compare $qualifiedProcedure ::stooop::copy]==0} return ;# ignore internal copy procedure + if {[string compare $array ::${qualifiedClass}::]!=0} { ;# compare with empty named array fully qualified name + # trace command error message is automatically prepended and indicates operation + error "class access violation in procedure $qualifiedProcedure" + } + if {![info exists this]} return ;# static procedure, all objects can be accessed + if {![info exists identifier]} return ;# static data members can be accessed + if {$this!=$identifier} { ;# check that accessed data belongs to this object + error "object $identifier access violation in procedure $qualifiedProcedure acting on object $this" + } + } + + # gather accessed data member information, perform substitutions and output to trace channel + _proc ::stooop::traceData {array name operation} { + variable traceDataChannel + variable traceDataFormat + + scan $name %u,%s identifier member + if {[info exists member]&&([string compare $member _derived]==0)} return ;# ignore internally defined members + + # ignore internal destruction + if {![catch {lindex [info level -1] 0} procedure]&&([string compare ::stooop::deleteObject $procedure]==0)} return + set class {} ;# in case we are outside a class + set qualifiedClass {} + set procedure {} ;# in case we are outside a class procedure + set qualifiedProcedure {} + + debugInformation class qualifiedClass procedure qualifiedProcedure this + set text $traceDataFormat + regsub -all %C $text $qualifiedClass text ;# fully qualified class name + regsub -all %c $text $class text + if {[info exists member]} { + regsub -all %m $text $member text + } else { + regsub -all %m $text $name text ;# static member + } + regsub -all %P $text $qualifiedProcedure text ;# fully qualified procedure name + regsub -all %p $text $procedure text + # fully qualified array name with global qualifiers stripped + regsub -all %A $text [string trimleft [uplevel [list namespace which -variable $array]] :] text + if {[info exists this]} { ;# non static procedure + regsub -all %O $text $this text + } else { ;# static procedure + regsub -all %O $text {} text + } + array set string {r read w write u unset} + regsub -all %o $text $string($operation) text + if {[string compare $operation u]==0} { + regsub -all %v $text {} text ;# no value when unsetting + } else { + regsub -all %v $text [uplevel set ${array}($name)] text + } + puts $traceDataChannel $text + } +} diff --git a/PB16_1999_release/POSTBUILD/tcl/exe/tcl80.dll b/PB16_1999_release/POSTBUILD/tcl/exe/tcl80.dll new file mode 100644 index 0000000..d61392b Binary files /dev/null and b/PB16_1999_release/POSTBUILD/tcl/exe/tcl80.dll differ diff --git a/PB16_1999_release/POSTBUILD/tcl/exe/tix4180.dll b/PB16_1999_release/POSTBUILD/tcl/exe/tix4180.dll new file mode 100644 index 0000000..edee64a Binary files /dev/null and b/PB16_1999_release/POSTBUILD/tcl/exe/tix4180.dll differ diff --git a/PB16_1999_release/POSTBUILD/tcl/exe/tk80.dll b/PB16_1999_release/POSTBUILD/tcl/exe/tk80.dll new file mode 100644 index 0000000..267cb5d Binary files /dev/null and b/PB16_1999_release/POSTBUILD/tcl/exe/tk80.dll differ diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/history.tcl b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/history.tcl new file mode 100644 index 0000000..a6beb43 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/history.tcl @@ -0,0 +1,369 @@ +# history.tcl -- +# +# Implementation of the history command. +# +# SCCS: @(#) history.tcl 1.7 97/08/07 16:45:50 +# +# Copyright (c) 1997 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# + +# The tcl::history array holds the history list and +# some additional bookkeeping variables. +# +# nextid the index used for the next history list item. +# keep the max size of the history list +# oldest the index of the oldest item in the history. + +namespace eval tcl { + variable history + if ![info exists history] { + array set history { + nextid 0 + keep 20 + oldest -20 + } + } +} + +# history -- +# +# This is the main history command. See the man page for its interface. +# This does argument checking and calls helper procedures in the +# history namespace. + +proc history {args} { + set len [llength $args] + if {$len == 0} { + return [tcl::HistInfo] + } + set key [lindex $args 0] + set options "add, change, clear, event, info, keep, nextid, or redo" + switch -glob -- $key { + a* { # history add + + if {$len > 3} { + return -code error "wrong # args: should be \"history add event ?exec?\"" + } + if {![string match $key* add]} { + return -code error "bad option \"$key\": must be $options" + } + if {$len == 3} { + set arg [lindex $args 2] + if {! ([string match e* $arg] && [string match $arg* exec])} { + return -code error "bad argument \"$arg\": should be \"exec\"" + } + } + return [tcl::HistAdd [lindex $args 1] [lindex $args 2]] + } + ch* { # history change + + if {($len > 3) || ($len < 2)} { + return -code error "wrong # args: should be \"history change newValue ?event?\"" + } + if {![string match $key* change]} { + return -code error "bad option \"$key\": must be $options" + } + if {$len == 2} { + set event 0 + } else { + set event [lindex $args 2] + } + + return [tcl::HistChange [lindex $args 1] $event] + } + cl* { # history clear + + if {($len > 1)} { + return -code error "wrong # args: should be \"history clear\"" + } + if {![string match $key* clear]} { + return -code error "bad option \"$key\": must be $options" + } + return [tcl::HistClear] + } + e* { # history event + + if {$len > 2} { + return -code error "wrong # args: should be \"history event ?event?\"" + } + if {![string match $key* event]} { + return -code error "bad option \"$key\": must be $options" + } + if {$len == 1} { + set event -1 + } else { + set event [lindex $args 1] + } + return [tcl::HistEvent $event] + } + i* { # history info + + if {$len > 2} { + return -code error "wrong # args: should be \"history info ?count?\"" + } + if {![string match $key* info]} { + return -code error "bad option \"$key\": must be $options" + } + return [tcl::HistInfo [lindex $args 1]] + } + k* { # history keep + + if {$len > 2} { + return -code error "wrong # args: should be \"history keep ?count?\"" + } + if {$len == 1} { + return [tcl::HistKeep] + } else { + set limit [lindex $args 1] + if {[catch {expr $limit}] || ($limit < 0)} { + return -code error "illegal keep count \"$limit\"" + } + return [tcl::HistKeep $limit] + } + } + n* { # history nextid + + if {$len > 1} { + return -code error "wrong # args: should be \"history nextid\"" + } + if {![string match $key* nextid]} { + return -code error "bad option \"$key\": must be $options" + } + return [expr $tcl::history(nextid) + 1] + } + r* { # history redo + + if {$len > 2} { + return -code error "wrong # args: should be \"history redo ?event?\"" + } + if {![string match $key* redo]} { + return -code error "bad option \"$key\": must be $options" + } + return [tcl::HistRedo [lindex $args 1]] + } + default { + return -code error "bad option \"$key\": must be $options" + } + } +} + +# tcl::HistAdd -- +# +# Add an item to the history, and optionally eval it at the global scope +# +# Parameters: +# command the command to add +# exec (optional) a substring of "exec" causes the +# command to be evaled. +# Results: +# If executing, then the results of the command are returned +# +# Side Effects: +# Adds to the history list + + proc tcl::HistAdd {command {exec {}}} { + variable history + set i [incr history(nextid)] + set history($i) $command + set j [incr history(oldest)] + if {[info exists history($j)]} {unset history($j)} + if {[string match e* $exec]} { + return [uplevel #0 $command] + } else { + return {} + } +} + +# tcl::HistKeep -- +# +# Set or query the limit on the length of the history list +# +# Parameters: +# limit (optional) the length of the history list +# +# Results: +# If no limit is specified, the current limit is returned +# +# Side Effects: +# Updates history(keep) if a limit is specified + + proc tcl::HistKeep {{limit {}}} { + variable history + if {[string length $limit] == 0} { + return $history(keep) + } else { + set oldold $history(oldest) + set history(oldest) [expr $history(nextid) - $limit] + for {} {$oldold <= $history(oldest)} {incr oldold} { + if {[info exists history($oldold)]} {unset history($oldold)} + } + set history(keep) $limit + } +} + +# tcl::HistClear -- +# +# Erase the history list +# +# Parameters: +# none +# +# Results: +# none +# +# Side Effects: +# Resets the history array, except for the keep limit + + proc tcl::HistClear {} { + variable history + set keep $history(keep) + unset history + array set history [list \ + nextid 0 \ + keep $keep \ + oldest -$keep \ + ] +} + +# tcl::HistInfo -- +# +# Return a pretty-printed version of the history list +# +# Parameters: +# num (optional) the length of the history list to return +# +# Results: +# A formatted history list + + proc tcl::HistInfo {{num {}}} { + variable history + if {$num == {}} { + set num [expr $history(keep) + 1] + } + set result {} + set newline "" + for {set i [expr $history(nextid) - $num + 1]} \ + {$i <= $history(nextid)} {incr i} { + if ![info exists history($i)] { + continue + } + set cmd [string trimright $history($i) \ \n] + regsub -all \n $cmd "\n\t" cmd + append result $newline[format "%6d %s" $i $cmd] + set newline \n + } + return $result +} + +# tcl::HistRedo -- +# +# Fetch the previous or specified event, execute it, and then +# replace the current history item with that event. +# +# Parameters: +# event (optional) index of history item to redo. Defaults to -1, +# which means the previous event. +# +# Results: +# Those of the command being redone. +# +# Side Effects: +# Replaces the current history list item with the one being redone. + + proc tcl::HistRedo {{event -1}} { + variable history + if {[string length $event] == 0} { + set event -1 + } + set i [HistIndex $event] + if {$i == $history(nextid)} { + return -code error "cannot redo the current event" + } + set cmd $history($i) + HistChange $cmd 0 + uplevel #0 $cmd +} + +# tcl::HistIndex -- +# +# Map from an event specifier to an index in the history list. +# +# Parameters: +# event index of history item to redo. +# If this is a positive number, it is used directly. +# If it is a negative number, then it counts back to a previous +# event, where -1 is the most recent event. +# A string can be matched, either by being the prefix of +# a command or by matching a command with string match. +# +# Results: +# The index into history, or an error if the index didn't match. + + proc tcl::HistIndex {event} { + variable history + if {[catch {expr $event}]} { + for {set i $history(nextid)} {[info exists history($i)]} {incr i -1} { + if {[string match $event* $history($i)]} { + return $i; + } + if {[string match $event $history($i)]} { + return $i; + } + } + return -code error "no event matches \"$event\"" + } elseif {$event <= 0} { + set i [expr $history(nextid) + $event] + } else { + set i $event + } + if {$i <= $history(oldest)} { + return -code error "event \"$event\" is too far in the past" + } + if {$i > $history(nextid)} { + return -code error "event \"$event\" hasn't occured yet" + } + return $i +} + +# tcl::HistEvent -- +# +# Map from an event specifier to the value in the history list. +# +# Parameters: +# event index of history item to redo. See index for a +# description of possible event patterns. +# +# Results: +# The value from the history list. + + proc tcl::HistEvent {event} { + variable history + set i [HistIndex $event] + if {[info exists history($i)]} { + return [string trimright $history($i) \ \n] + } else { + return ""; + } +} + +# tcl::HistChange -- +# +# Replace a value in the history list. +# +# Parameters: +# cmd The new value to put into the history list. +# event (optional) index of history item to redo. See index for a +# description of possible event patterns. This defaults +# to 0, which specifies the current event. +# +# Side Effects: +# Changes the history list. + + proc tcl::HistChange {cmd {event 0}} { + variable history + set i [HistIndex $event] + set history($i) $cmd +} diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/init.tcl b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/init.tcl new file mode 100644 index 0000000..ebf1913 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/init.tcl @@ -0,0 +1,785 @@ +# init.tcl -- +# +# Default system startup file for Tcl-based applications. Defines +# "unknown" procedure and auto-load facilities. +# +# SCCS: @(#) init.tcl 1.95 97/11/19 17:16:34 +# +# Copyright (c) 1991-1993 The Regents of the University of California. +# Copyright (c) 1994-1996 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# + +if {[info commands package] == ""} { + error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" +} +package require -exact Tcl 8.0 + +# Compute the auto path to use in this interpreter. +# (auto_path could be already set, in safe interps for instance) + +if {![info exists auto_path]} { + if [catch {set auto_path $env(TCLLIBPATH)}] { + set auto_path "" + } +} +if {[lsearch -exact $auto_path [info library]] < 0} { + lappend auto_path [info library] +} +catch { + foreach __dir $tcl_pkgPath { + if {[lsearch -exact $auto_path $__dir] < 0} { + lappend auto_path $__dir + } + } + unset __dir +} + +# Setup the unknown package handler + +package unknown tclPkgUnknown + +# Conditionalize for presence of exec. + +if {[info commands exec] == ""} { + + # Some machines, such as the Macintosh, do not have exec. Also, on all + # platforms, safe interpreters do not have exec. + + set auto_noexec 1 +} +set errorCode "" +set errorInfo "" + +# Define a log command (which can be overwitten to log errors +# differently, specially when stderr is not available) + +if {[info commands tclLog] == ""} { + proc tclLog {string} { + catch {puts stderr $string} + } +} + +# The procs defined in this file that have a leading space +# are 'hidden' from auto_mkindex because they are not +# auto-loadable. + + +# unknown -- +# This procedure is called when a Tcl command is invoked that doesn't +# exist in the interpreter. It takes the following steps to make the +# command available: +# +# 1. See if the autoload facility can locate the command in a +# Tcl script file. If so, load it and execute it. +# 2. If the command was invoked interactively at top-level: +# (a) see if the command exists as an executable UNIX program. +# If so, "exec" the command. +# (b) see if the command requests csh-like history substitution +# in one of the common forms !!, !, or ^old^new. If +# so, emulate csh's history substitution. +# (c) see if the command is a unique abbreviation for another +# command. If so, invoke the command. +# +# Arguments: +# args - A list whose elements are the words of the original +# command, including the command name. + + proc unknown args { + global auto_noexec auto_noload env unknown_pending tcl_interactive + global errorCode errorInfo + + # Save the values of errorCode and errorInfo variables, since they + # may get modified if caught errors occur below. The variables will + # be restored just before re-executing the missing command. + + set savedErrorCode $errorCode + set savedErrorInfo $errorInfo + set name [lindex $args 0] + if ![info exists auto_noload] { + # + # Make sure we're not trying to load the same proc twice. + # + if [info exists unknown_pending($name)] { + return -code error "self-referential recursion in \"unknown\" for command \"$name\""; + } + set unknown_pending($name) pending; + set ret [catch {auto_load $name [uplevel 1 {namespace current}]} msg] + unset unknown_pending($name); + if {$ret != 0} { + return -code $ret -errorcode $errorCode \ + "error while autoloading \"$name\": $msg" + } + if ![array size unknown_pending] { + unset unknown_pending + } + if $msg { + set errorCode $savedErrorCode + set errorInfo $savedErrorInfo + set code [catch {uplevel 1 $args} msg] + if {$code == 1} { + # + # Strip the last five lines off the error stack (they're + # from the "uplevel" command). + # + + set new [split $errorInfo \n] + set new [join [lrange $new 0 [expr [llength $new] - 6]] \n] + return -code error -errorcode $errorCode \ + -errorinfo $new $msg + } else { + return -code $code $msg + } + } + } + + if {([info level] == 1) && ([info script] == "") \ + && [info exists tcl_interactive] && $tcl_interactive} { + if ![info exists auto_noexec] { + set new [auto_execok $name] + if {$new != ""} { + set errorCode $savedErrorCode + set errorInfo $savedErrorInfo + set redir "" + if {[info commands console] == ""} { + set redir ">&@stdout <@stdin" + } + return [uplevel exec $redir $new [lrange $args 1 end]] + } + } + set errorCode $savedErrorCode + set errorInfo $savedErrorInfo + if {$name == "!!"} { + set newcmd [history event] + } elseif {[regexp {^!(.+)$} $name dummy event]} { + set newcmd [history event $event] + } elseif {[regexp {^\^([^^]*)\^([^^]*)\^?$} $name dummy old new]} { + set newcmd [history event -1] + catch {regsub -all -- $old $newcmd $new newcmd} + } + if [info exists newcmd] { + tclLog $newcmd + history change $newcmd 0 + return [uplevel $newcmd] + } + + set ret [catch {set cmds [info commands $name*]} msg] + if {[string compare $name "::"] == 0} { + set name "" + } + if {$ret != 0} { + return -code $ret -errorcode $errorCode \ + "error in unknown while checking if \"$name\" is a unique command abbreviation: $msg" + } + if {[llength $cmds] == 1} { + return [uplevel [lreplace $args 0 0 $cmds]] + } + if {[llength $cmds] != 0} { + if {$name == ""} { + return -code error "empty command name \"\"" + } else { + return -code error \ + "ambiguous command name \"$name\": [lsort $cmds]" + } + } + } + return -code error "invalid command name \"$name\"" +} + +# auto_load -- +# Checks a collection of library directories to see if a procedure +# is defined in one of them. If so, it sources the appropriate +# library file to create the procedure. Returns 1 if it successfully +# loaded the procedure, 0 otherwise. +# +# Arguments: +# cmd - Name of the command to find and load. +# namespace (optional) The namespace where the command is being used - must be +# a canonical namespace as returned [namespace current] +# for instance. If not given, namespace current is used. + + proc auto_load {cmd {namespace {}}} { + global auto_index auto_oldpath auto_path env errorInfo errorCode + + if {[string length $namespace] == 0} { + set namespace [uplevel {namespace current}] + } + set nameList [auto_qualify $cmd $namespace] + # workaround non canonical auto_index entries that might be around + # from older auto_mkindex versions + lappend nameList $cmd + foreach name $nameList { + if [info exists auto_index($name)] { + uplevel #0 $auto_index($name) + return [expr {[info commands $name] != ""}] + } + } + if ![info exists auto_path] { + return 0 + } + if [info exists auto_oldpath] { + if {$auto_oldpath == $auto_path} { + return 0 + } + } + set auto_oldpath $auto_path + + # Check if we are a safe interpreter. In that case, we support only + # newer format tclIndex files. + + set issafe [interp issafe] + for {set i [expr [llength $auto_path] - 1]} {$i >= 0} {incr i -1} { + set dir [lindex $auto_path $i] + set f "" + if {$issafe} { + catch {source [file join $dir tclIndex]} + } elseif [catch {set f [open [file join $dir tclIndex]]}] { + continue + } else { + set error [catch { + set id [gets $f] + if {$id == "# Tcl autoload index file, version 2.0"} { + eval [read $f] + } elseif {$id == \ + "# Tcl autoload index file: each line identifies a Tcl"} { + while {[gets $f line] >= 0} { + if {([string index $line 0] == "#") + || ([llength $line] != 2)} { + continue + } + set name [lindex $line 0] + set auto_index($name) \ + "source [file join $dir [lindex $line 1]]" + } + } else { + error \ + "[file join $dir tclIndex] isn't a proper Tcl index file" + } + } msg] + if {$f != ""} { + close $f + } + if $error { + error $msg $errorInfo $errorCode + } + } + } + foreach name $nameList { + if [info exists auto_index($name)] { + uplevel #0 $auto_index($name) + if {[info commands $name] != ""} { + return 1 + } + } + } + return 0 +} + +# auto_qualify -- +# compute a fully qualified names list for use in the auto_index array. +# For historical reasons, commands in the global namespace do not have leading +# :: in the index key. The list has two elements when the command name is +# relative (no leading ::) and the namespace is not the global one. Otherwise +# only one name is returned (and searched in the auto_index). +# +# Arguments - +# cmd The command name. Can be any name accepted for command +# invocations (Like "foo::::bar"). +# namespace The namespace where the command is being used - must be +# a canonical namespace as returned by [namespace current] +# for instance. + + proc auto_qualify {cmd namespace} { + + # count separators and clean them up + # (making sure that foo:::::bar will be treated as foo::bar) + set n [regsub -all {::+} $cmd :: cmd] + + # Ignore namespace if the name starts with :: + # Handle special case of only leading :: + + # Before each return case we give an example of which category it is + # with the following form : + # ( inputCmd, inputNameSpace) -> output + + if {[regexp {^::(.*)$} $cmd x tail]} { + if {$n > 1} { + # ( ::foo::bar , * ) -> ::foo::bar + return [list $cmd] + } else { + # ( ::global , * ) -> global + return [list $tail] + } + } + + # Potentially returning 2 elements to try : + # (if the current namespace is not the global one) + + if {$n == 0} { + if {[string compare $namespace ::] == 0} { + # ( nocolons , :: ) -> nocolons + return [list $cmd] + } else { + # ( nocolons , ::sub ) -> ::sub::nocolons nocolons + return [list ${namespace}::$cmd $cmd] + } + } else { + if {[string compare $namespace ::] == 0} { + # ( foo::bar , :: ) -> ::foo::bar + return [list ::$cmd] + } else { + # ( foo::bar , ::sub ) -> ::sub::foo::bar ::foo::bar + return [list ${namespace}::$cmd ::$cmd] + } + } +} + +if {[string compare $tcl_platform(platform) windows] == 0} { + +# auto_execok -- +# +# Returns string that indicates name of program to execute if +# name corresponds to a shell builtin or an executable in the +# Windows search path, or "" otherwise. Builds an associative +# array auto_execs that caches information about previous checks, +# for speed. +# +# Arguments: +# name - Name of a command. + +# Windows version. +# +# Note that info executable doesn't work under Windows, so we have to +# look for files with .exe, .com, or .bat extensions. Also, the path +# may be in the Path or PATH environment variables, and path +# components are separated with semicolons, not colons as under Unix. +# +proc auto_execok name { + global auto_execs env tcl_platform + + if [info exists auto_execs($name)] { + return $auto_execs($name) + } + set auto_execs($name) "" + + if {[lsearch -exact {cls copy date del erase dir echo mkdir md rename + ren rmdir rd time type ver vol} $name] != -1} { + return [set auto_execs($name) [list $env(COMSPEC) /c $name]] + } + + if {[llength [file split $name]] != 1} { + foreach ext {{} .com .exe .bat} { + set file ${name}${ext} + if {[file exists $file] && ![file isdirectory $file]} { + return [set auto_execs($name) [list $file]] + } + } + return "" + } + + set path "[file dirname [info nameof]];.;" + if {[info exists env(WINDIR)]} { + set windir $env(WINDIR) + } + if {[info exists windir]} { + if {$tcl_platform(os) == "Windows NT"} { + append path "$windir/system32;" + } + append path "$windir/system;$windir;" + } + + if {[info exists env(PATH)]} { + append path $env(PATH) + } + + foreach dir [split $path {;}] { + if {$dir == ""} { + set dir . + } + foreach ext {{} .com .exe .bat} { + set file [file join $dir ${name}${ext}] + if {[file exists $file] && ![file isdirectory $file]} { + return [set auto_execs($name) [list $file]] + } + } + } + return "" +} + +} else { + +# auto_execok -- +# +# Returns string that indicates name of program to execute if +# name corresponds to an executable in the path. Builds an associative +# array auto_execs that caches information about previous checks, +# for speed. +# +# Arguments: +# name - Name of a command. + +# Unix version. +# +proc auto_execok name { + global auto_execs env + + if [info exists auto_execs($name)] { + return $auto_execs($name) + } + set auto_execs($name) "" + if {[llength [file split $name]] != 1} { + if {[file executable $name] && ![file isdirectory $name]} { + set auto_execs($name) [list $name] + } + return $auto_execs($name) + } + foreach dir [split $env(PATH) :] { + if {$dir == ""} { + set dir . + } + set file [file join $dir $name] + if {[file executable $file] && ![file isdirectory $file]} { + set auto_execs($name) [list $file] + return $auto_execs($name) + } + } + return "" +} + +} +# auto_reset -- +# Destroy all cached information for auto-loading and auto-execution, +# so that the information gets recomputed the next time it's needed. +# Also delete any procedures that are listed in the auto-load index +# except those defined in this file. +# +# Arguments: +# None. + +proc auto_reset {} { + global auto_execs auto_index auto_oldpath + foreach p [info procs] { + if {[info exists auto_index($p)] && ![string match auto_* $p] + && ([lsearch -exact {unknown pkg_mkIndex tclPkgSetup + tclMacPkgSearch tclPkgUnknown} $p] < 0)} { + rename $p {} + } + } + catch {unset auto_execs} + catch {unset auto_index} + catch {unset auto_oldpath} +} + +# auto_mkindex -- +# Regenerate a tclIndex file from Tcl source files. Takes as argument +# the name of the directory in which the tclIndex file is to be placed, +# followed by any number of glob patterns to use in that directory to +# locate all of the relevant files. It does not parse or source the file +# so the generated index will not contain the appropriate namespace qualifiers +# if you don't explicitly specify it. +# +# Arguments: +# dir - Name of the directory in which to create an index. +# args - Any number of additional arguments giving the +# names of files within dir. If no additional +# are given auto_mkindex will look for *.tcl. + +proc auto_mkindex {dir args} { + global errorCode errorInfo + set oldDir [pwd] + cd $dir + set dir [pwd] + append index "# Tcl autoload index file, version 2.0\n" + append index "# This file is generated by the \"auto_mkindex\" command\n" + append index "# and sourced to set up indexing information for one or\n" + append index "# more commands. Typically each line is a command that\n" + append index "# sets an element in the auto_index array, where the\n" + append index "# element name is the name of a command and the value is\n" + append index "# a script that loads the command.\n\n" + if {$args == ""} { + set args *.tcl + } + foreach file [eval glob $args] { + set f "" + set error [catch { + set f [open $file] + while {[gets $f line] >= 0} { + if [regexp {^proc[ ]+([^ ]*)} $line match procName] { + set procName [lindex [auto_qualify $procName "::"] 0] + append index "set [list auto_index($procName)]" + append index " \[list source \[file join \$dir [list $file]\]\]\n" + } + } + close $f + } msg] + if $error { + set code $errorCode + set info $errorInfo + catch {close $f} + cd $oldDir + error $msg $info $code + } + } + set f "" + set error [catch { + set f [open tclIndex w] + puts $f $index nonewline + close $f + cd $oldDir + } msg] + if $error { + set code $errorCode + set info $errorInfo + catch {close $f} + cd $oldDir + error $msg $info $code + } +} + +# pkg_mkIndex -- +# This procedure creates a package index in a given directory. The +# package index consists of a "pkgIndex.tcl" file whose contents are +# a Tcl script that sets up package information with "package require" +# commands. The commands describe all of the packages defined by the +# files given as arguments. +# +# Arguments: +# dir - Name of the directory in which to create the index. +# args - Any number of additional arguments, each giving +# a glob pattern that matches the names of one or +# more shared libraries or Tcl script files in +# dir. + +proc pkg_mkIndex {dir args} { + global errorCode errorInfo + if {[llength $args] == 0} { + return -code error "wrong # args: should be\ + \"pkg_mkIndex dir pattern ?pattern ...?\""; + } + append index "# Tcl package index file, version 1.0\n" + append index "# This file is generated by the \"pkg_mkIndex\" command\n" + append index "# and sourced either when an application starts up or\n" + append index "# by a \"package unknown\" script. It invokes the\n" + append index "# \"package ifneeded\" command to set up package-related\n" + append index "# information so that packages will be loaded automatically\n" + append index "# in response to \"package require\" commands. When this\n" + append index "# script is sourced, the variable \$dir must contain the\n" + append index "# full path name of this file's directory.\n" + set oldDir [pwd] + cd $dir + foreach file [eval glob $args] { + # For each file, figure out what commands and packages it provides. + # To do this, create a child interpreter, load the file into the + # interpreter, and get a list of the new commands and packages + # that are defined. Define an empty "package unknown" script so + # that there are no recursive package inclusions. + + set c [interp create] + + # If Tk is loaded in the parent interpreter, load it into the + # child also, in case the extension depends on it. + + foreach pkg [info loaded] { + if {[lindex $pkg 1] == "Tk"} { + $c eval {set argv {-geometry +0+0}} + load [lindex $pkg 0] Tk $c + break + } + } + $c eval [list set file $file] + if [catch { + $c eval { + proc dummy args {} + rename package package-orig + proc package {what args} { + switch -- $what { + require { return ; # ignore transitive requires } + default { eval package-orig {$what} $args } + } + } + proc pkgGetAllNamespaces {{root {}}} { + set list $root + foreach ns [namespace children $root] { + eval lappend list [pkgGetAllNamespaces $ns] + } + return $list + } + package unknown dummy + set origCmds [info commands] + set dir "" ;# in case file is pkgIndex.tcl + set pkgs "" + + # Try to load the file if it has the shared library extension, + # otherwise source it. It's important not to try to load + # files that aren't shared libraries, because on some systems + # (like SunOS) the loader will abort the whole application + # when it gets an error. + + if {[string compare [file extension $file] \ + [info sharedlibextension]] == 0} { + + # The "file join ." command below is necessary. Without + # it, if the file name has no \'s and we're on UNIX, the + # load command will invoke the LD_LIBRARY_PATH search + # mechanism, which could cause the wrong file to be used. + + load [file join . $file] + set type load + } else { + source $file + set type source + } + foreach ns [pkgGetAllNamespaces] { + namespace import ${ns}::* + } + foreach i [info commands] { + set cmds($i) 1 + } + foreach i $origCmds { + catch {unset cmds($i)} + + } + foreach i [array names cmds] { + # reverse engineer which namespace a command comes from + set absolute [namespace origin $i] + if {[string compare ::$i $absolute] != 0} { + set cmds($absolute) 1 + unset cmds($i) + } + } + foreach i [package names] { + if {([string compare [package provide $i] ""] != 0) + && ([string compare $i Tcl] != 0) + && ([string compare $i Tk] != 0)} { + lappend pkgs [list $i [package provide $i]] + } + } + } + } msg] { + tclLog "error while loading or sourcing $file: $msg" + } + foreach pkg [$c eval set pkgs] { + lappend files($pkg) [list $file [$c eval set type] \ + [lsort [$c eval array names cmds]]] + } + interp delete $c + } + foreach pkg [lsort [array names files]] { + append index "\npackage ifneeded $pkg\ + \[list tclPkgSetup \$dir [lrange $pkg 0 0] [lrange $pkg 1 1]\ + [list $files($pkg)]\]" + } + set f [open pkgIndex.tcl w] + puts $f $index + close $f + cd $oldDir +} + +# tclPkgSetup -- +# This is a utility procedure use by pkgIndex.tcl files. It is invoked +# as part of a "package ifneeded" script. It calls "package provide" +# to indicate that a package is available, then sets entries in the +# auto_index array so that the package's files will be auto-loaded when +# the commands are used. +# +# Arguments: +# dir - Directory containing all the files for this package. +# pkg - Name of the package (no version number). +# version - Version number for the package, such as 2.1.3. +# files - List of files that constitute the package. Each +# element is a sub-list with three elements. The first +# is the name of a file relative to $dir, the second is +# "load" or "source", indicating whether the file is a +# loadable binary or a script to source, and the third +# is a list of commands defined by this file. + +proc tclPkgSetup {dir pkg version files} { + global auto_index + + package provide $pkg $version + foreach fileInfo $files { + set f [lindex $fileInfo 0] + set type [lindex $fileInfo 1] + foreach cmd [lindex $fileInfo 2] { + if {$type == "load"} { + set auto_index($cmd) [list load [file join $dir $f] $pkg] + } else { + set auto_index($cmd) [list source [file join $dir $f]] + } + } + } +} + +# tclMacPkgSearch -- +# The procedure is used on the Macintosh to search a given directory for files +# with a TEXT resource named "pkgIndex". If it exists it is sourced in to the +# interpreter to setup the package database. + +proc tclMacPkgSearch {dir} { + foreach x [glob -nocomplain [file join $dir *.shlb]] { + if [file isfile $x] { + set res [resource open $x] + foreach y [resource list TEXT $res] { + if {$y == "pkgIndex"} {source -rsrc pkgIndex} + } + catch {resource close $res} + } + } +} + +# tclPkgUnknown -- +# This procedure provides the default for the "package unknown" function. +# It is invoked when a package that's needed can't be found. It scans +# the auto_path directories and their immediate children looking for +# pkgIndex.tcl files and sources any such files that are found to setup +# the package database. (On the Macintosh we also search for pkgIndex +# TEXT resources in all files.) +# +# Arguments: +# name - Name of desired package. Not used. +# version - Version of desired package. Not used. +# exact - Either "-exact" or omitted. Not used. + +proc tclPkgUnknown {name version {exact {}}} { + global auto_path tcl_platform env + + if ![info exists auto_path] { + return + } + for {set i [expr [llength $auto_path] - 1]} {$i >= 0} {incr i -1} { + # we can't use glob in safe interps, so enclose the following + # in a catch statement + catch { + foreach file [glob -nocomplain [file join [lindex $auto_path $i] \ + * pkgIndex.tcl]] { + set dir [file dirname $file] + if [catch {source $file} msg] { + tclLog "error reading package index file $file: $msg" + } + } + } + set dir [lindex $auto_path $i] + set file [file join $dir pkgIndex.tcl] + # safe interps usually don't have "file readable", nor stderr channel + if {[interp issafe] || [file readable $file]} { + if {[catch {source $file} msg] && ![interp issafe]} { + tclLog "error reading package index file $file: $msg" + } + } + # On the Macintosh we also look in the resource fork + # of shared libraries + # We can't use tclMacPkgSearch in safe interps because it uses glob + if {(![interp issafe]) && ($tcl_platform(platform) == "macintosh")} { + set dir [lindex $auto_path $i] + tclMacPkgSearch $dir + foreach x [glob -nocomplain [file join $dir *]] { + if [file isdirectory $x] { + set dir $x + tclMacPkgSearch $dir + } + } + } + } +} diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/ldAout.tcl b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/ldAout.tcl new file mode 100644 index 0000000..7914508 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/ldAout.tcl @@ -0,0 +1,240 @@ +# ldAout.tcl -- +# +# This "tclldAout" procedure in this script acts as a replacement +# for the "ld" command when linking an object file that will be +# loaded dynamically into Tcl or Tk using pseudo-static linking. +# +# Parameters: +# The arguments to the script are the command line options for +# an "ld" command. +# +# Results: +# The "ld" command is parsed, and the "-o" option determines the +# module name. ".a" and ".o" options are accumulated. +# The input archives and object files are examined with the "nm" +# command to determine whether the modules initialization +# entry and safe initialization entry are present. A trivial +# C function that locates the entries is composed, compiled, and +# its .o file placed before all others in the command; then +# "ld" is executed to bind the objects together. +# +# SCCS: @(#) ldAout.tcl 1.12 96/11/30 17:11:02 +# +# Copyright (c) 1995, by General Electric Company. All rights reserved. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# This work was supported in part by the ARPA Manufacturing Automation +# and Design Engineering (MADE) Initiative through ARPA contract +# F33615-94-C-4400. + +proc tclLdAout {{cc {}} {shlib_suffix {}} {shlib_cflags none}} { + global env + global argv + + if {$cc==""} { + set cc $env(CC) + } + + # if only two parameters are supplied there is assumed that the + # only shlib_suffix is missing. This parameter is anyway available + # as "info sharedlibextension" too, so there is no need to transfer + # 3 parameters to the function tclLdAout. For compatibility, this + # function now accepts both 2 and 3 parameters. + + if {$shlib_suffix==""} { + set shlib_cflags $env(SHLIB_CFLAGS) + } else { + if {$shlib_cflags=="none"} { + set shlib_cflags $shlib_suffix + } + } + + # seenDotO is nonzero if a .o or .a file has been seen + + set seenDotO 0 + + # minusO is nonzero if the last command line argument was "-o". + + set minusO 0 + + # head has command line arguments up to but not including the first + # .o or .a file. tail has the rest of the arguments. + + set head {} + set tail {} + + # nmCommand is the "nm" command that lists global symbols from the + # object files. + + set nmCommand {|nm -g} + + # entryProtos is the table of _Init and _SafeInit prototypes found in the + # module. + + set entryProtos {} + + # entryPoints is the table of _Init and _SafeInit entries found in the + # module. + + set entryPoints {} + + # libraries is the list of -L and -l flags to the linker. + + set libraries {} + set libdirs {} + + # Process command line arguments + + foreach a $argv { + if {!$minusO && [regexp {\.[ao]$} $a]} { + set seenDotO 1 + lappend nmCommand $a + } + if {$minusO} { + set outputFile $a + set minusO 0 + } elseif {![string compare $a -o]} { + set minusO 1 + } + if [regexp {^-[lL]} $a] { + lappend libraries $a + if [regexp {^-L} $a] { + lappend libdirs [string range $a 2 end] + } + } elseif {$seenDotO} { + lappend tail $a + } else { + lappend head $a + } + } + lappend libdirs /lib /usr/lib + + # MIPS -- If there are corresponding G0 libraries, replace the + # ordinary ones with the G0 ones. + + set libs {} + foreach lib $libraries { + if [regexp {^-l} $lib] { + set lname [string range $lib 2 end] + foreach dir $libdirs { + if [file exists [file join $dir lib${lname}_G0.a]] { + set lname ${lname}_G0 + break + } + } + lappend libs -l$lname + } else { + lappend libs $lib + } + } + set libraries $libs + + # Extract the module name from the "-o" option + + if {![info exists outputFile]} { + error "-o option must be supplied to link a Tcl load module" + } + set m [file tail $outputFile] + if [regexp {\.a$} $outputFile] { + set shlib_suffix .a + } else { + set shlib_suffix "" + } + if [regexp {\..*$} $outputFile match] { + set l [expr [string length $m] - [string length $match]] + } else { + error "Output file does not appear to have a suffix" + } + set modName [string tolower [string range $m 0 [expr $l-1]]] + if [regexp {^lib} $modName] { + set modName [string range $modName 3 end] + } + if [regexp {[0-9\.]*(_g0)?$} $modName match] { + set modName [string range $modName 0 [expr [string length $modName]-[string length $match]-1]] + } + set modName "[string toupper [string index $modName 0]][string range $modName 1 end]" + + # Catalog initialization entry points found in the module + + set f [open $nmCommand r] + while {[gets $f l] >= 0} { + if [regexp {T[ ]*_?([A-Z][a-z0-9_]*_(Safe)?Init(__FP10Tcl_Interp)?)$} $l trash symbol] { + if {![regexp {_?([A-Z][a-z0-9_]*_(Safe)?Init)} $symbol trash s]} { + set s $symbol + } + append entryProtos {extern int } $symbol { (); } \n + append entryPoints { } \{ { "} $s {", } $symbol { } \} , \n + } + } + close $f + + if {$entryPoints==""} { + error "No entry point found in objects" + } + + # Compose a C function that resolves the initialization entry points and + # embeds the required libraries in the object code. + + set C {#include } + append C \n + append C {char TclLoadLibraries_} $modName { [] =} \n + append C { "@LIBS: } $libraries {";} \n + append C $entryProtos + append C {static struct } \{ \n + append C { char * name;} \n + append C { int (*value)();} \n + append C \} {dictionary [] = } \{ \n + append C $entryPoints + append C { 0, 0 } \n \} \; \n + append C {typedef struct Tcl_Interp Tcl_Interp;} \n + append C {typedef int Tcl_PackageInitProc (Tcl_Interp *);} \n + append C {Tcl_PackageInitProc *} \n + append C TclLoadDictionary_ $modName { (symbol)} \n + append C { char * symbol;} \n + append C {{ + int i; + for (i = 0; dictionary [i] . name != 0; ++i) { + if (!strcmp (symbol, dictionary [i] . name)) { + return dictionary [i].value; + } + } + return 0; +}} \n + + # Write the C module and compile it + + set cFile tcl$modName.c + set f [open $cFile w] + puts -nonewline $f $C + close $f + set ccCommand "$cc -c $shlib_cflags $cFile" + puts stderr $ccCommand + eval exec $ccCommand + + # Now compose and execute the ld command that packages the module + + if {$shlib_suffix == ".a"} { + set ldCommand "ar cr $outputFile" + regsub { -o} $tail {} tail + } else { + set ldCommand ld + foreach item $head { + lappend ldCommand $item + } + } + lappend ldCommand tcl$modName.o + foreach item $tail { + lappend ldCommand $item + } + puts stderr $ldCommand + eval exec $ldCommand + if {$shlib_suffix == ".a"} { + exec ranlib $outputFile + } + + # Clean up working files + + exec /bin/rm $cFile [file rootname $cFile].o +} diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/license.terms b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/license.terms new file mode 100644 index 0000000..96ad966 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/license.terms @@ -0,0 +1,39 @@ +This software is copyrighted by the Regents of the University of +California, Sun Microsystems, Inc., and other parties. The following +terms apply to all files associated with the software unless explicitly +disclaimed in individual files. + +The authors hereby grant permission to use, copy, modify, distribute, +and license this software and its documentation for any purpose, provided +that existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written agreement, +license, or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their authors +and need not follow the licensing terms described here, provided that +the new terms are clearly indicated on the first page of each file where +they apply. + +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +MODIFICATIONS. + +GOVERNMENT USE: If you are acquiring this software on behalf of the +U.S. government, the Government shall have only "Restricted Rights" +in the software and related documentation as defined in the Federal +Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you +are acquiring the software on behalf of the Department of Defense, the +software shall be classified as "Commercial Computer Software" and the +Government shall have only "Restricted Rights" as defined in Clause +252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the +authors grant the U.S. Government and others acting in its behalf +permission to use and distribute the software in accordance with the +terms specified in this license. diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/parray.tcl b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/parray.tcl new file mode 100644 index 0000000..430e7ff --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/parray.tcl @@ -0,0 +1,29 @@ +# parray: +# Print the contents of a global array on stdout. +# +# SCCS: @(#) parray.tcl 1.9 96/02/16 08:56:44 +# +# Copyright (c) 1991-1993 The Regents of the University of California. +# Copyright (c) 1994 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# + +proc parray {a {pattern *}} { + upvar 1 $a array + if ![array exists array] { + error "\"$a\" isn't an array" + } + set maxl 0 + foreach name [lsort [array names array $pattern]] { + if {[string length $name] > $maxl} { + set maxl [string length $name] + } + } + set maxl [expr {$maxl + [string length $a] + 2}] + foreach name [lsort [array names array $pattern]] { + set nameString [format %s(%s) $a $name] + puts stdout [format "%-*s = %s" $maxl $nameString $array($name)] + } +} diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/safe.tcl b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/safe.tcl new file mode 100644 index 0000000..9b93523 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/safe.tcl @@ -0,0 +1,893 @@ +# safe.tcl -- +# +# This file provide a safe loading/sourcing mechanism for safe interpreters. +# It implements a virtual path mecanism to hide the real pathnames from the +# slave. It runs in a master interpreter and sets up data structure and +# aliases that will be invoked when used from a slave interpreter. +# +# See the safe.n man page for details. +# +# Copyright (c) 1996-1997 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# SCCS: @(#) safe.tcl 1.26 97/08/21 11:57:20 + +# +# The implementation is based on namespaces. These naming conventions +# are followed: +# Private procs starts with uppercase. +# Public procs are exported and starts with lowercase +# + +# Needed utilities package +package require opt 0.2; + +# Create the safe namespace +namespace eval ::safe { + + # Exported API: + namespace export interpCreate interpInit interpConfigure interpDelete \ + interpAddToAccessPath interpFindInAccessPath \ + setLogCmd ; + +# Proto/dummy declarations for auto_mkIndex +proc ::safe::interpCreate {} {} +proc ::safe::interpInit {} {} +proc ::safe::interpConfigure {} {} + + + #### + # + # Setup the arguments parsing + # + #### + + # Share the descriptions + set temp [::tcl::OptKeyRegister { + {-accessPath -list {} "access path for the slave"} + {-noStatics "prevent loading of statically linked pkgs"} + {-statics true "loading of statically linked pkgs"} + {-nestedLoadOk "allow nested loading"} + {-nested false "nested loading"} + {-deleteHook -script {} "delete hook"} + }] + + # create case (slave is optional) + ::tcl::OptKeyRegister { + {?slave? -name {} "name of the slave (optional)"} + } ::safe::interpCreate ; + # adding the flags sub programs to the command program + # (relying on Opt's internal implementation details) + lappend ::tcl::OptDesc(::safe::interpCreate) $::tcl::OptDesc($temp); + + # init and configure (slave is needed) + ::tcl::OptKeyRegister { + {slave -name {} "name of the slave"} + } ::safe::interpIC; + # adding the flags sub programs to the command program + # (relying on Opt's internal implementation details) + lappend ::tcl::OptDesc(::safe::interpIC) $::tcl::OptDesc($temp); + # temp not needed anymore + ::tcl::OptKeyDelete $temp; + + + # Helper function to resolve the dual way of specifying staticsok + # (either by -noStatics or -statics 0) + proc InterpStatics {} { + foreach v {Args statics noStatics} { + upvar $v $v + } + set flag [::tcl::OptProcArgGiven -noStatics]; + if {$flag && ($noStatics == $statics) + && ([::tcl::OptProcArgGiven -statics])} { + return -code error\ + "conflicting values given for -statics and -noStatics"; + } + if {$flag} { + return [expr {!$noStatics}]; + } else { + return $statics + } + } + + # Helper function to resolve the dual way of specifying nested loading + # (either by -nestedLoadOk or -nested 1) + proc InterpNested {} { + foreach v {Args nested nestedLoadOk} { + upvar $v $v + } + set flag [::tcl::OptProcArgGiven -nestedLoadOk]; + # note that the test here is the opposite of the "InterpStatics" + # one (it is not -noNested... because of the wanted default value) + if {$flag && ($nestedLoadOk != $nested) + && ([::tcl::OptProcArgGiven -nested])} { + return -code error\ + "conflicting values given for -nested and -nestedLoadOk"; + } + if {$flag} { + # another difference with "InterpStatics" + return $nestedLoadOk + } else { + return $nested + } + } + + #### + # + # API entry points that needs argument parsing : + # + #### + + + # Interface/entry point function and front end for "Create" + proc interpCreate {args} { + set Args [::tcl::OptKeyParse ::safe::interpCreate $args] + InterpCreate $slave $accessPath \ + [InterpStatics] [InterpNested] $deleteHook; + } + + proc interpInit {args} { + set Args [::tcl::OptKeyParse ::safe::interpIC $args] + if {![::interp exists $slave]} { + return -code error \ + "\"$slave\" is not an interpreter"; + } + InterpInit $slave $accessPath \ + [InterpStatics] [InterpNested] $deleteHook; + } + + proc CheckInterp {slave} { + if {![IsInterp $slave]} { + return -code error \ + "\"$slave\" is not an interpreter managed by ::safe::" ; + } + } + + # Interface/entry point function and front end for "Configure" + # This code is awfully pedestrian because it would need + # more coupling and support between the way we store the + # configuration values in safe::interp's and the Opt package + # Obviously we would like an OptConfigure + # to avoid duplicating all this code everywhere. -> TODO + # (the app should share or access easily the program/value + # stored by opt) + # This is even more complicated by the boolean flags with no values + # that we had the bad idea to support for the sake of user simplicity + # in create/init but which makes life hard in configure... + # So this will be hopefully written and some integrated with opt1.0 + # (hopefully for tcl8.1 ?) + proc interpConfigure {args} { + switch [llength $args] { + 1 { + # If we have exactly 1 argument + # the semantic is to return all the current configuration + # We still call OptKeyParse though we know that "slave" + # is our given argument because it also checks + # for the "-help" option. + set Args [::tcl::OptKeyParse ::safe::interpIC $args]; + CheckInterp $slave; + set res {} + lappend res [list -accessPath [Set [PathListName $slave]]] + lappend res [list -statics [Set [StaticsOkName $slave]]] + lappend res [list -nested [Set [NestedOkName $slave]]] + lappend res [list -deleteHook [Set [DeleteHookName $slave]]] + join $res + } + 2 { + # If we have exactly 2 arguments + # the semantic is a "configure get" + ::tcl::Lassign $args slave arg; + # get the flag sub program (we 'know' about Opt's internal + # representation of data) + set desc [lindex [::tcl::OptKeyGetDesc ::safe::interpIC] 2] + set hits [::tcl::OptHits desc $arg]; + if {$hits > 1} { + return -code error [::tcl::OptAmbigous $desc $arg] + } elseif {$hits == 0} { + return -code error [::tcl::OptFlagUsage $desc $arg] + } + CheckInterp $slave; + set item [::tcl::OptCurDesc $desc]; + set name [::tcl::OptName $item]; + switch -exact -- $name { + -accessPath { + return [list -accessPath [Set [PathListName $slave]]] + } + -statics { + return [list -statics [Set [StaticsOkName $slave]]] + } + -nested { + return [list -nested [Set [NestedOkName $slave]]] + } + -deleteHook { + return [list -deleteHook [Set [DeleteHookName $slave]]] + } + -noStatics { + # it is most probably a set in fact + # but we would need then to jump to the set part + # and it is not *sure* that it is a set action + # that the user want, so force it to use the + # unambigous -statics ?value? instead: + return -code error\ + "ambigous query (get or set -noStatics ?)\ + use -statics instead"; + } + -nestedLoadOk { + return -code error\ + "ambigous query (get or set -nestedLoadOk ?)\ + use -nested instead"; + } + default { + return -code error "unknown flag $name (bug)"; + } + } + } + default { + # Otherwise we want to parse the arguments like init and create + # did + set Args [::tcl::OptKeyParse ::safe::interpIC $args]; + CheckInterp $slave; + # Get the current (and not the default) values of + # whatever has not been given: + if {![::tcl::OptProcArgGiven -accessPath]} { + set doreset 1 + set accessPath [Set [PathListName $slave]] + } else { + set doreset 0 + } + if { (![::tcl::OptProcArgGiven -statics]) + && (![::tcl::OptProcArgGiven -noStatics]) } { + set statics [Set [StaticsOkName $slave]] + } else { + set statics [InterpStatics] + } + if { ([::tcl::OptProcArgGiven -nested]) + || ([::tcl::OptProcArgGiven -nestedLoadOk]) } { + set nested [InterpNested] + } else { + set nested [Set [NestedOkName $slave]] + } + if {![::tcl::OptProcArgGiven -deleteHook]} { + set deleteHook [Set [DeleteHookName $slave]] + } + # we can now reconfigure : + InterpSetConfig $slave $accessPath \ + $statics $nested $deleteHook; + # auto_reset the slave (to completly synch the new access_path) + if {$doreset} { + if {[catch {::interp eval $slave {auto_reset}} msg]} { + Log $slave "auto_reset failed: $msg"; + } else { + Log $slave "successful auto_reset" NOTICE; + } + } + } + } + } + + + #### + # + # Functions that actually implements the exported APIs + # + #### + + + # + # safe::InterpCreate : doing the real job + # + # This procedure creates a safe slave and initializes it with the + # safe base aliases. + # NB: slave name must be simple alphanumeric string, no spaces, + # no (), no {},... {because the state array is stored as part of the name} + # + # Returns the slave name. + # + # Optional Arguments : + # + slave name : if empty, generated name will be used + # + access_path: path list controlling where load/source can occur, + # if empty: the master auto_path will be used. + # + staticsok : flag, if 0 :no static package can be loaded (load {} Xxx) + # if 1 :static packages are ok. + # + nestedok: flag, if 0 :no loading to sub-sub interps (load xx xx sub) + # if 1 : multiple levels are ok. + + # use the full name and no indent so auto_mkIndex can find us + proc ::safe::InterpCreate { + slave + access_path + staticsok + nestedok + deletehook + } { + # Create the slave. + if {[string compare "" $slave]} { + ::interp create -safe $slave; + } else { + # empty argument: generate slave name + set slave [::interp create -safe]; + } + Log $slave "Created" NOTICE; + + # Initialize it. (returns slave name) + InterpInit $slave $access_path $staticsok $nestedok $deletehook; + } + + + # + # InterpSetConfig (was setAccessPath) : + # Sets up slave virtual auto_path and corresponding structure + # within the master. Also sets the tcl_library in the slave + # to be the first directory in the path. + # Nb: If you change the path after the slave has been initialized + # you probably need to call "auto_reset" in the slave in order that it + # gets the right auto_index() array values. + + proc ::safe::InterpSetConfig {slave access_path staticsok\ + nestedok deletehook} { + + # determine and store the access path if empty + if {[string match "" $access_path]} { + set access_path [uplevel #0 set auto_path]; + # Make sure that tcl_library is in auto_path + # and at the first position (needed by setAccessPath) + set where [lsearch -exact $access_path [info library]]; + if {$where == -1} { + # not found, add it. + set access_path [concat [list [info library]] $access_path]; + Log $slave "tcl_library was not in auto_path,\ + added it to slave's access_path" NOTICE; + } elseif {$where != 0} { + # not first, move it first + set access_path [concat [list [info library]]\ + [lreplace $access_path $where $where]]; + Log $slave "tcl_libray was not in first in auto_path,\ + moved it to front of slave's access_path" NOTICE; + + } + + # Add 1st level sub dirs (will searched by auto loading from tcl + # code in the slave using glob and thus fail, so we add them + # here so by default it works the same). + set access_path [AddSubDirs $access_path]; + } + + Log $slave "Setting accessPath=($access_path) staticsok=$staticsok\ + nestedok=$nestedok deletehook=($deletehook)" NOTICE; + + # clear old autopath if it existed + set nname [PathNumberName $slave]; + if {[Exists $nname]} { + set n [Set $nname]; + for {set i 0} {$i<$n} {incr i} { + Unset [PathToken $i $slave]; + } + } + + # build new one + set slave_auto_path {} + set i 0; + foreach dir $access_path { + Set [PathToken $i $slave] $dir; + lappend slave_auto_path "\$[PathToken $i]"; + incr i; + } + Set $nname $i; + Set [PathListName $slave] $access_path; + Set [VirtualPathListName $slave] $slave_auto_path; + + Set [StaticsOkName $slave] $staticsok + Set [NestedOkName $slave] $nestedok + Set [DeleteHookName $slave] $deletehook + + SyncAccessPath $slave; + } + + # + # + # FindInAccessPath: + # Search for a real directory and returns its virtual Id + # (including the "$") +proc ::safe::interpFindInAccessPath {slave path} { + set access_path [GetAccessPath $slave]; + set where [lsearch -exact $access_path $path]; + if {$where == -1} { + return -code error "$path not found in access path $access_path"; + } + return "\$[PathToken $where]"; + } + + # + # addToAccessPath: + # add (if needed) a real directory to access path + # and return its virtual token (including the "$"). +proc ::safe::interpAddToAccessPath {slave path} { + # first check if the directory is already in there + if {![catch {interpFindInAccessPath $slave $path} res]} { + return $res; + } + # new one, add it: + set nname [PathNumberName $slave]; + set n [Set $nname]; + Set [PathToken $n $slave] $path; + + set token "\$[PathToken $n]"; + + Lappend [VirtualPathListName $slave] $token; + Lappend [PathListName $slave] $path; + Set $nname [expr $n+1]; + + SyncAccessPath $slave; + + return $token; + } + + # This procedure applies the initializations to an already existing + # interpreter. It is useful when you want to install the safe base + # aliases into a preexisting safe interpreter. + proc ::safe::InterpInit { + slave + access_path + staticsok + nestedok + deletehook + } { + + # Configure will generate an access_path when access_path is + # empty. + InterpSetConfig $slave $access_path $staticsok $nestedok $deletehook; + + # These aliases let the slave load files to define new commands + + # NB we need to add [namespace current], aliases are always + # absolute paths. + ::interp alias $slave source {} [namespace current]::AliasSource $slave + ::interp alias $slave load {} [namespace current]::AliasLoad $slave + + # This alias lets the slave have access to a subset of the 'file' + # command functionality. + + AliasSubset $slave file file dir.* join root.* ext.* tail \ + path.* split + + # This alias interposes on the 'exit' command and cleanly terminates + # the slave. + + ::interp alias $slave exit {} [namespace current]::interpDelete $slave + + # The allowed slave variables already have been set + # by Tcl_MakeSafe(3) + + + # Source init.tcl into the slave, to get auto_load and other + # procedures defined: + + # We don't try to use the -rsrc on the mac because it would get + # confusing if you would want to customize init.tcl + # for a given set of safe slaves, on all the platforms + # you just need to give a specific access_path and + # the mac should be no exception. As there is no + # obvious full "safe ressources" design nor implementation + # for the mac, safe interps there will just don't + # have that ability. (A specific app can still reenable + # that using custom aliases if they want to). + # It would also make the security analysis and the Safe Tcl security + # model platform dependant and thus more error prone. + + if {[catch {::interp eval $slave\ + {source [file join $tcl_library init.tcl]}}\ + msg]} { + Log $slave "can't source init.tcl ($msg)"; + error "can't source init.tcl into slave $slave ($msg)" + } + + return $slave + } + + + # Add (only if needed, avoid duplicates) 1 level of + # sub directories to an existing path list. + # Also removes non directories from the returned list. + proc AddSubDirs {pathList} { + set res {} + foreach dir $pathList { + if {[file isdirectory $dir]} { + # check that we don't have it yet as a children + # of a previous dir + if {[lsearch -exact $res $dir]<0} { + lappend res $dir; + } + foreach sub [glob -nocomplain -- [file join $dir *]] { + if { ([file isdirectory $sub]) + && ([lsearch -exact $res $sub]<0) } { + # new sub dir, add it ! + lappend res $sub; + } + } + } + } + return $res; + } + + # This procedure deletes a safe slave managed by Safe Tcl and + # cleans up associated state: + +proc ::safe::interpDelete {slave} { + + Log $slave "About to delete" NOTICE; + + # If the slave has a cleanup hook registered, call it. + # check the existance because we might be called to delete an interp + # which has not been registered with us at all + set hookname [DeleteHookName $slave]; + if {[Exists $hookname]} { + set hook [Set $hookname]; + if {![::tcl::Lempty $hook]} { + # remove the hook now, otherwise if the hook + # calls us somehow, we'll loop + Unset $hookname; + if {[catch {eval $hook $slave} err]} { + Log $slave "Delete hook error ($err)"; + } + } + } + + # Discard the global array of state associated with the slave, and + # delete the interpreter. + + set statename [InterpStateName $slave]; + if {[Exists $statename]} { + Unset $statename; + } + + # if we have been called twice, the interp might have been deleted + # already + if {[::interp exists $slave]} { + ::interp delete $slave; + Log $slave "Deleted" NOTICE; + } + + return + } + + # Set (or get) the loging mecanism + +proc ::safe::setLogCmd {args} { + variable Log; + if {[llength $args] == 0} { + return $Log; + } else { + if {[llength $args] == 1} { + set Log [lindex $args 0]; + } else { + set Log $args + } + } +} + + # internal variable + variable Log {} + + # ------------------- END OF PUBLIC METHODS ------------ + + + # + # sets the slave auto_path to the master recorded value. + # also sets tcl_library to the first token of the virtual path. + # + proc SyncAccessPath {slave} { + set slave_auto_path [Set [VirtualPathListName $slave]]; + ::interp eval $slave [list set auto_path $slave_auto_path]; + Log $slave \ + "auto_path in $slave has been set to $slave_auto_path"\ + NOTICE; + ::interp eval $slave [list set tcl_library [lindex $slave_auto_path 0]]; + } + + # base name for storing all the slave states + # the array variable name for slave foo is thus "Sfoo" + # and for sub slave {foo bar} "Sfoo bar" (spaces are handled + # ok everywhere (or should)) + # We add the S prefix to avoid that a slave interp called "Log" + # would smash our "Log" variable. + proc InterpStateName {slave} { + return "S$slave"; + } + + # Check that the given slave is "one of us" + proc IsInterp {slave} { + expr { ([Exists [InterpStateName $slave]]) + && ([::interp exists $slave])} + } + + # returns the virtual token for directory number N + # if the slave argument is given, + # it will return the corresponding master global variable name + proc PathToken {n {slave ""}} { + if {[string compare "" $slave]} { + return "[InterpStateName $slave](access_path,$n)"; + } else { + # We need to have a ":" in the token string so + # [file join] on the mac won't turn it into a relative + # path. + return "p(:$n:)"; + } + } + # returns the variable name of the complete path list + proc PathListName {slave} { + return "[InterpStateName $slave](access_path)"; + } + # returns the variable name of the complete path list + proc VirtualPathListName {slave} { + return "[InterpStateName $slave](access_path_slave)"; + } + # returns the variable name of the number of items + proc PathNumberName {slave} { + return "[InterpStateName $slave](access_path,n)"; + } + # returns the staticsok flag var name + proc StaticsOkName {slave} { + return "[InterpStateName $slave](staticsok)"; + } + # returns the nestedok flag var name + proc NestedOkName {slave} { + return "[InterpStateName $slave](nestedok)"; + } + # Run some code at the namespace toplevel + proc Toplevel {args} { + namespace eval [namespace current] $args; + } + # set/get values + proc Set {args} { + eval Toplevel set $args; + } + # lappend on toplevel vars + proc Lappend {args} { + eval Toplevel lappend $args; + } + # unset a var/token (currently just an global level eval) + proc Unset {args} { + eval Toplevel unset $args; + } + # test existance + proc Exists {varname} { + Toplevel info exists $varname; + } + # short cut for access path getting + proc GetAccessPath {slave} { + Set [PathListName $slave] + } + # short cut for statics ok flag getting + proc StaticsOk {slave} { + Set [StaticsOkName $slave] + } + # short cut for getting the multiples interps sub loading ok flag + proc NestedOk {slave} { + Set [NestedOkName $slave] + } + # interp deletion storing hook name + proc DeleteHookName {slave} { + return [InterpStateName $slave](cleanupHook) + } + + # + # translate virtual path into real path + # + proc TranslatePath {slave path} { + # somehow strip the namespaces 'functionality' out (the danger + # is that we would strip valid macintosh "../" queries... : + if {[regexp {(::)|(\.\.)} $path]} { + error "invalid characters in path $path"; + } + set n [expr [Set [PathNumberName $slave]]-1]; + for {} {$n>=0} {incr n -1} { + # fill the token virtual names with their real value + set [PathToken $n] [Set [PathToken $n $slave]]; + } + # replaces the token by their value + subst -nobackslashes -nocommands $path; + } + + + # Log eventually log an error + # to enable error logging, set Log to {puts stderr} for instance + proc Log {slave msg {type ERROR}} { + variable Log; + if {[info exists Log] && [llength $Log]} { + eval $Log [list "$type for slave $slave : $msg"]; + } + } + + + # file name control (limit access to files/ressources that should be + # a valid tcl source file) + proc CheckFileName {slave file} { + # limit what can be sourced to .tcl + # and forbid files with more than 1 dot and + # longer than 14 chars + set ftail [file tail $file]; + if {[string length $ftail]>14} { + error "$ftail: filename too long"; + } + if {[regexp {\..*\.} $ftail]} { + error "$ftail: more than one dot is forbidden"; + } + if {[string compare $ftail "tclIndex"] && \ + [string compare [string tolower [file extension $ftail]]\ + ".tcl"]} { + error "$ftail: must be a *.tcl or tclIndex"; + } + + if {![file exists $file]} { + # don't tell the file path + error "no such file or directory"; + } + + if {![file readable $file]} { + # don't tell the file path + error "not readable"; + } + + } + + + # AliasSource is the target of the "source" alias in safe interpreters. + + proc AliasSource {slave args} { + + set argc [llength $args]; + # Allow only "source filename" + # (and not mac specific -rsrc for instance - see comment in ::init + # for current rationale) + if {$argc != 1} { + set msg "wrong # args: should be \"source fileName\"" + Log $slave "$msg ($args)"; + return -code error $msg; + } + set file [lindex $args 0] + + # get the real path from the virtual one. + if {[catch {set file [TranslatePath $slave $file]} msg]} { + Log $slave $msg; + return -code error "permission denied" + } + + # check that the path is in the access path of that slave + if {[catch {FileInAccessPath $slave $file} msg]} { + Log $slave $msg; + return -code error "permission denied" + } + + # do the checks on the filename : + if {[catch {CheckFileName $slave $file} msg]} { + Log $slave "$file:$msg"; + return -code error $msg; + } + + # passed all the tests , lets source it: + if {[catch {::interp invokehidden $slave source $file} msg]} { + Log $slave $msg; + return -code error "script error"; + } + return $msg + } + + # AliasLoad is the target of the "load" alias in safe interpreters. + + proc AliasLoad {slave file args} { + + set argc [llength $args]; + if {$argc > 2} { + set msg "load error: too many arguments"; + Log $slave "$msg ($argc) {$file $args}"; + return -code error $msg; + } + + # package name (can be empty if file is not). + set package [lindex $args 0]; + + # Determine where to load. load use a relative interp path + # and {} means self, so we can directly and safely use passed arg. + set target [lindex $args 1]; + if {[string length $target]} { + # we will try to load into a sub sub interp + # check that we want to authorize that. + if {![NestedOk $slave]} { + Log $slave "loading to a sub interp (nestedok)\ + disabled (trying to load $package to $target)"; + return -code error "permission denied (nested load)"; + } + + } + + # Determine what kind of load is requested + if {[string length $file] == 0} { + # static package loading + if {[string length $package] == 0} { + set msg "load error: empty filename and no package name"; + Log $slave $msg; + return -code error $msg; + } + if {![StaticsOk $slave]} { + Log $slave "static packages loading disabled\ + (trying to load $package to $target)"; + return -code error "permission denied (static package)"; + } + } else { + # file loading + + # get the real path from the virtual one. + if {[catch {set file [TranslatePath $slave $file]} msg]} { + Log $slave $msg; + return -code error "permission denied" + } + + # check the translated path + if {[catch {FileInAccessPath $slave $file} msg]} { + Log $slave $msg; + return -code error "permission denied (path)" + } + } + + if {[catch {::interp invokehidden\ + $slave load $file $package $target} msg]} { + Log $slave $msg; + return -code error $msg + } + + return $msg + } + + # FileInAccessPath raises an error if the file is not found in + # the list of directories contained in the (master side recorded) slave's + # access path. + + # the security here relies on "file dirname" answering the proper + # result.... needs checking ? + proc FileInAccessPath {slave file} { + + set access_path [GetAccessPath $slave]; + + if {[file isdirectory $file]} { + error "\"$file\": is a directory" + } + set parent [file dirname $file] + if {[lsearch -exact $access_path $parent] == -1} { + error "\"$file\": not in access_path"; + } + } + + # This procedure enables access from a safe interpreter to only a subset of + # the subcommands of a command: + + proc Subset {slave command okpat args} { + set subcommand [lindex $args 0] + if {[regexp $okpat $subcommand]} { + return [eval {$command $subcommand} [lrange $args 1 end]] + } + set msg "not allowed to invoke subcommand $subcommand of $command"; + Log $slave $msg; + error $msg; + } + + # This procedure installs an alias in a slave that invokes "safesubset" + # in the master to execute allowed subcommands. It precomputes the pattern + # of allowed subcommands; you can use wildcards in the pattern if you wish + # to allow subcommand abbreviation. + # + # Syntax is: AliasSubset slave alias target subcommand1 subcommand2... + + proc AliasSubset {slave alias target args} { + set pat ^(; set sep "" + foreach sub $args { + append pat $sep$sub + set sep | + } + append pat )\$ + ::interp alias $slave $alias {}\ + [namespace current]::Subset $slave $target $pat + } + +} diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/tclIndex b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/tclIndex new file mode 100644 index 0000000..e923ec9 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/tclIndex @@ -0,0 +1,30 @@ +# Tcl autoload index file, version 2.0 +# This file is generated by the "auto_mkindex" command +# and sourced to set up indexing information for one or +# more commands. Typically each line is a command that +# sets an element in the auto_index array, where the +# element name is the name of a command and the value is +# a script that loads the command. + +set auto_index(auto_execok) [list source [file join $dir init.tcl]] +set auto_index(auto_reset) [list source [file join $dir init.tcl]] +set auto_index(auto_mkindex) [list source [file join $dir init.tcl]] +set auto_index(pkg_mkIndex) [list source [file join $dir init.tcl]] +set auto_index(tclPkgSetup) [list source [file join $dir init.tcl]] +set auto_index(tclMacPkgSearch) [list source [file join $dir init.tcl]] +set auto_index(tclPkgUnknown) [list source [file join $dir init.tcl]] +set auto_index(parray) [list source [file join $dir parray.tcl]] +set auto_index(tclLdAout) [list source [file join $dir ldAout.tcl]] +set auto_index(tcl_wordBreakAfter) [list source [file join $dir word.tcl]] +set auto_index(tcl_wordBreakBefore) [list source [file join $dir word.tcl]] +set auto_index(tcl_endOfWord) [list source [file join $dir word.tcl]] +set auto_index(tcl_startOfNextWord) [list source [file join $dir word.tcl]] +set auto_index(tcl_startOfPreviousWord) [list source [file join $dir word.tcl]] +set auto_index(::safe::interpCreate) [list source [file join $dir safe.tcl]] +set auto_index(::safe::interpInit) [list source [file join $dir safe.tcl]] +set auto_index(::safe::interpConfigure) [list source [file join $dir safe.tcl]] +set auto_index(::safe::interpFindInAccessPath) [list source [file join $dir safe.tcl]] +set auto_index(::safe::interpAddToAccessPath) [list source [file join $dir safe.tcl]] +set auto_index(::safe::interpDelete) [list source [file join $dir safe.tcl]] +set auto_index(::safe::setLogCmd) [list source [file join $dir safe.tcl]] +set auto_index(history) [list source [file join $dir history.tcl]] diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/word.tcl b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/word.tcl new file mode 100644 index 0000000..64639f2 --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tcl8.0/word.tcl @@ -0,0 +1,135 @@ +# word.tcl -- +# +# This file defines various procedures for computing word boundaries +# in strings. This file is primarily needed so Tk text and entry +# widgets behave properly for different platforms. +# +# Copyright (c) 1996 by Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# SCCS: @(#) word.tcl 1.2 96/11/20 14:07:22 +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# + +# The following variables are used to determine which characters are +# interpreted as white space. + +if {$tcl_platform(platform) == "windows"} { + # Windows style - any but space, tab, or newline + set tcl_wordchars "\[^ \t\n\]" + set tcl_nonwordchars "\[ \t\n\]" +} else { + # Motif style - any number, letter, or underscore + set tcl_wordchars {[a-zA-Z0-9_]} + set tcl_nonwordchars {[^a-zA-Z0-9_]} +} + +# tcl_wordBreakAfter -- +# +# This procedure returns the index of the first word boundary +# after the starting point in the given string, or -1 if there +# are no more boundaries in the given string. The index returned refers +# to the first character of the pair that comprises a boundary. +# +# Arguments: +# str - String to search. +# start - Index into string specifying starting point. + +proc tcl_wordBreakAfter {str start} { + global tcl_nonwordchars tcl_wordchars + set str [string range $str $start end] + if [regexp -indices "$tcl_wordchars$tcl_nonwordchars|$tcl_nonwordchars$tcl_wordchars" $str result] { + return [expr [lindex $result 1] + $start] + } + return -1 +} + +# tcl_wordBreakBefore -- +# +# This procedure returns the index of the first word boundary +# before the starting point in the given string, or -1 if there +# are no more boundaries in the given string. The index returned +# refers to the second character of the pair that comprises a boundary. +# +# Arguments: +# str - String to search. +# start - Index into string specifying starting point. + +proc tcl_wordBreakBefore {str start} { + global tcl_nonwordchars tcl_wordchars + if {[string compare $start end] == 0} { + set start [string length $str] + } + if [regexp -indices "^.*($tcl_wordchars$tcl_nonwordchars|$tcl_nonwordchars$tcl_wordchars)" [string range $str 0 $start] result] { + return [lindex $result 1] + } + return -1 +} + +# tcl_endOfWord -- +# +# This procedure returns the index of the first end-of-word location +# after a starting index in the given string. An end-of-word location +# is defined to be the first whitespace character following the first +# non-whitespace character after the starting point. Returns -1 if +# there are no more words after the starting point. +# +# Arguments: +# str - String to search. +# start - Index into string specifying starting point. + +proc tcl_endOfWord {str start} { + global tcl_nonwordchars tcl_wordchars + if [regexp -indices "$tcl_nonwordchars*$tcl_wordchars+$tcl_nonwordchars" \ + [string range $str $start end] result] { + return [expr [lindex $result 1] + $start] + } + return -1 +} + +# tcl_startOfNextWord -- +# +# This procedure returns the index of the first start-of-word location +# after a starting index in the given string. A start-of-word +# location is defined to be a non-whitespace character following a +# whitespace character. Returns -1 if there are no more start-of-word +# locations after the starting point. +# +# Arguments: +# str - String to search. +# start - Index into string specifying starting point. + +proc tcl_startOfNextWord {str start} { + global tcl_nonwordchars tcl_wordchars + if [regexp -indices "$tcl_wordchars*$tcl_nonwordchars+$tcl_wordchars" \ + [string range $str $start end] result] { + return [expr [lindex $result 1] + $start] + } + return -1 +} + +# tcl_startOfPreviousWord -- +# +# This procedure returns the index of the first start-of-word location +# before a starting index in the given string. +# +# Arguments: +# str - String to search. +# start - Index into string specifying starting point. + +proc tcl_startOfPreviousWord {str start} { + global tcl_nonwordchars tcl_wordchars + if {[string compare $start end] == 0} { + set start [string length $str] + } + if [regexp -indices \ + "$tcl_nonwordchars*($tcl_wordchars+)$tcl_nonwordchars*\$" \ + [string range $str 0 [expr $start - 1]] result word] { + return [lindex $word 0] + } + return -1 +} diff --git a/PB16_1999_release/POSTBUILD/tcl/share/tix4.1/Balloon.tcl b/PB16_1999_release/POSTBUILD/tcl/share/tix4.1/Balloon.tcl new file mode 100644 index 0000000..bcc400f --- /dev/null +++ b/PB16_1999_release/POSTBUILD/tcl/share/tix4.1/Balloon.tcl @@ -0,0 +1,565 @@ +# Balloon.tcl -- +# +# The help widget. It provides both "balloon" type of help +# message and "status bar" type of help message. You can use +# this widget to indicate the function of the widgets inside +# your application. +# +# Copyright (c) 1996, Expert Interface Technologies +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# + + +tixWidgetClass tixBalloon { + -classname TixBalloon + -superclass tixShell + -method { + bind post unbind + } + -flag { + -installcolormap -initwait -state -statusbar + } + -configspec { + {-installcolormap installColormap InstallColormap false} + {-initwait initWait InitWait 1000} + {-state state State both} + {-statusbar statusBar StatusBar ""} + + {-cursor cursor Cursur left_ptr} + } + -default { + {*background #ffff60} + {*foreground black} + {*borderWidth 0} + {.borderWidth 1} + {.background black} + {*Label.anchor w} + {*Label.justify left} + } +} + +# Class Record +# +set tixBalloon(bals) "" + +proc tixBalloon:InitWidgetRec {w} { + upvar #0 $w data + global tixBalloon + + tixChainMethod $w InitWidgetRec + + set data(isActive) 0 + set data(client) "" + + lappend tixBalloon(bals) $w +} + +proc tixBalloon:ConstructWidget {w} { + upvar #0 $w data + + tixChainMethod $w ConstructWidget + + wm overrideredirect $w 1 + wm withdraw $w + + # Frame 1 : arrow + frame $w.f1 -bd 0 + set data(w:label) [label $w.f1.lab -bd 0 -relief flat \ + -bitmap [tix getbitmap balarrow]] + pack $data(w:label) -side left -padx 1 -pady 1 + + # Frame 2 : Message + frame $w.f2 -bd 0 + set data(w:message) [label $w.f2.message -padx 0 -pady 0 -bd 0] + pack $data(w:message) -side left -expand yes -fill both -padx 10 -pady 1 + + # Pack all + pack $w.f1 -fill both + pack $w.f2 -fill both + + # This is an event tag used by the clients + # + bind TixBal$w "tixBalloon:ClientDestroy $w %W" +} + +proc tixBalloon:Destructor {w} { + global tixBalloon + + set bals "" + foreach b $tixBalloon(bals) { + if {$w != $b} { + lappend bals $b + } + } + set tixBalloon(bals) $bals + + tixChainMethod $w Destructor +} + +#---------------------------------------------------------------------- +# Config: +#---------------------------------------------------------------------- +proc tixBalloon:config-state {w value} { + upvar #0 $w data + + case $value { + {none balloon status both} "" + default { + error "invalid value $value, must be none, balloon, status, or both" + } + } +} + +#---------------------------------------------------------------------- +# "RAW" event bindings: +#---------------------------------------------------------------------- + +bind all "+tixBalloon_XXMotion %X %Y 1" +bind all "+tixBalloon_XXMotion %X %Y 2" +bind all "+tixBalloon_XXMotion %X %Y 3" +bind all "+tixBalloon_XXMotion %X %Y 4" +bind all "+tixBalloon_XXMotion %X %Y 5" +bind all "+tixBalloon_XXMotion %X %Y 0" +bind all "+tixBalloon_XXMotion %X %Y %b" +bind all