#!/bin/csh
# This is a program for the example Genesis Tooling Forms.
# This file will exist in form 1.
# The purpose of this program is to prompt the user to check the layer to layer
# alignment.
# It is called by the "Check Layer Align." button.
#
# Written by Ian Ticehurst (Autom8 Ltd.)
# Version 1A. 11.09.00 - Initial design and development.
# Version 1B. 11.12.00 - Add source of info. file to support gui creation.
# Version 1C. 12.12.00 - Re-write the gui windows to use the sourced font and colours.
# Version 1D. 12.12.00 - Re-write the gui functions to allow copper weight selection.
# Version 1E. 13.12.00 - Re-write the code to update information on forms (allow for different user config.).
# Version 1F. 05.02.01 - Modify to only check job path if job moved from original location.
#                      - Text change to ensure abbreviations are not used.
#                      - Add save time update to forms.
# Version 1G. 09.02.01 - Modify the setting and useage of $TMP.
# Version 1H. 10.02.01 - Remove gui for finish and copper weight updates (now just prompt user).
# Version 1I. 14.03.01 - Check how "$GENESIS_EDIR" is set to ensure paths are set correctly.
# Version 1J. 23.07.01 - Revamped (Ben)
#########################################################################################################

source $_genesis_root/sys/scripts/include_me

set_in_progress genform1 aln

# Close Form
COM close_form,job=$JOB,form=genform1

# Open editor on step "pcb".
COM open_entity,job=$JOB,type=step,name=pcb
set group=$COMANS
AUX set_group,group=$group

# Display all layers.
COM clear_layers
COM multi_layer_disp,mode=many,show_board=no
@ COUNT = 1
DO_INFO -t matrix -e $JOB/matrix
foreach LAYER ($gROWname)
   COM display_layer,name=$LAYER,display=yes,number=$COUNT
   @ COUNT ++
end
COM zoom_home

# Put window on screen asking user to action registration.
o_tooling
o FONT $NORM_FNT
o BG $NORM_COL
o BW 0
o LABEL Job Registration Popup
o LABEL Graphic editor is open.
o LABEL Program will pause. Complete layer registration.
o LABEL Close Pause Box When Registration Finished
o FONT $HINT_FNT
o BG $HINT_COL
o LABEL Hint: Remember the auto-register function
o LABEL Use right mouse button on layer stack.
o BG $NORM_COL
o END

do_gui

# Pause script and ask user to align layers.
PAUSE Press continue when layer alignment is complete

COM multi_layer_disp,mode=default,show_board=no
COM clear_layers

 # Ask user to gather copper weight and finish information.
o_tooling
o FONT $NORM_FNT
o BG $NORM_COL
o BW 0
o LABEL Manufacturing Information Pop-up
o LABEL Graphic editor is open.
o LABEL Program will pause.
o LABEL Check data package for:
o LABEL Copper weights
o LABEL Board finish
o LABEL Close pause box when information available.
o FONT $HINT_FNT
o BG $HINT_COL
o LABEL Hint: This information may be on drawing layers
o LABEL or in text files / paper documentation.
o BG $NORM_COL
o END

do_gui

# Pause script and ask user to get manufacturing information.
PAUSE Press continue when copper weight and finish is known

COM editor_page_close

# Open Form
COM show_form,job=$JOB,form=genform1

# Ask user to update copper weight and finish information.
o_tooling
o FONT $NORM_FNT
o BG $NORM_COL
o BW 0
o LABEL Manufacturing Information Update Pop-up
o LABEL Set copper weight and finish information on the form.
o FONT $HINT_FNT
o BG $HINT_COL
o LABEL Note: Form 2 will automatically be updated
o BG $NORM_COL
o END

do_gui

set_complete genform1 aln

save_job

exit 0
