Hi Dave, all
I have a code to check footprint prints in our library. In my code i will output it into a log file called MCL log file.
In the code i have pass/fail messages in which for pass messages, i want to color it green & fail message as red.
How do i do that. Below is a portion of the code.Hope anyone can help.
Thanks
JerryWilson
defun( _mcl_start ()
let((errors overallerrors)
overallerrors=0
mcl_log.log=axlDMOpenLog("mcl")
fprintf(mcl_log.log " MCL CHECK LOG ............................... Created:")
Date=(getCurrentTime)
fprintf(mcl_log.log "%s\n\n" Date)
axlDBGetDesignUnits()
fprintf(mcl_log.log "\n-----------------------------CHECK DRAWING PARAMETERS----------------------------\n")
errors=0
let((y m p)
y = axlGetParam('paramDesign)
if(y->units=="millimeters" then
;fprintf(mcl_log.log "\nPASSED :USER UNITS." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID USER UNITS., %s" y->units)
)
if(y->accuracy==3 then
;fprintf(mcl_log.log "\nPASSED :ACCURACY." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID ACCURACY., %d" y->accuracy)
)
if(y->height==210 then
;fprintf(mcl_log.log "\nPASSED :DRAWING EXTENT HEIGHT." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID DRAWING EXTENT HEIIGHT., %f" y->height)
)
if(y->width==297 then
;fprintf(mcl_log.log "\nPASSED :DRAWING EXTENT WIDTH." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID DRAWING EXTENT WIDTH., %f" y->width)
)
if(y->xy==list(-150 -105) then
;fprintf(mcl_log.log "\nPASSED :DRAWING EXTENT LOWER X AND LOWER Y." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID DRAWING EXTENT LOWER X AND LOWER Y., %P\n" y->xy)
)
m = axlDesignType(t)
if( or( m=="PACKAGE" m=="SHAPE" m=="FLASH" ) then
;fprintf(mcl_log.log "\nPASSED :SYMBOL TYPE., %s\n" m)
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID SYMBOL TYPE., %s\n" m)
)
if(errors==0 then
fprintf(mcl_log.log "\n\t%d ERROR(S) ON DRAWING PARAMETERS SETTINGS.\n", errors)
else
fprintf(mcl_log.log "\n\t%d ERROR(S) ON DRAWING PARAMETERS SETTINGS\n", errors)
)
;fprintf(mcl_log.log "***CHECK DRAWING PARAMETERS-END*****\n\n")
)