Home > Community > Forums > PCB SKILL > Example Skill Tutorial

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Example Skill Tutorial 

Last post Thu, Jun 27 2013 11:39 PM by joma. 6 replies.
Started by JuergenWeber 04 Jun 2013 02:37 AM. Topic has 6 replies and 1668 views
Page 1 of 1 (7 items)
Sort Posts:
  • Tue, Jun 4 2013 2:37 AM

    • JuergenWeber
    • Not Ranked
    • Joined on Thu, Feb 16 2012
    • Nuernberg, Bavaria
    • Posts 15
    • Points 255
    Example Skill Tutorial Reply

    Hi

    i have found following code on http://www.referencedesigner.com/tutorials/allegro/allegro_skill_76.php

    Is it possible to read the les4.form from the advanceform.il file?

    Thanks for your help

     

    Jürgen

     

     

     
    axlCmdRegister( "advanceform" `advanceform)
    ; -----------------------------------------------------------------
    procedure( advanceform()
    
    	les4_form = axlFormCreate( (gensym) "les4.form" nil 'les4_form_Action t)
    	axlFormDisplay(les4_form)
    
    ); end of procedure
    ; -----------------------------------------------------------------
    procedure( les4_form_Action(les4_form)
    	case( les4_form->curField
    
    		("Close_button"
            	axlFormClose( les4_form )
    		 	axlCancelEnterFun( )
          	); --------------------------
    
     		("Run_button"
    			les4_form_run()
          	); --------------------------	
    	); end case
    	
    ); end of procedure
    
    ; -----------------------------------------------------------------
    procedure( les4_form_run()
    	; Create output file to write report
    	cl_file = outfile("check_list.rpt" "w")
    
    		; ------ Print Header 
    		fprintf(cl_file "**********************\n")
    		fprintf(cl_file " Check List Report\n")
    		fprintf(cl_file "**********************\n\n")
    		
    		axlUIWPrint(les4_form getCurrentTime())
    
    		; ------  Print CurrentTime
    		fprintf(cl_file "CurrentTime : %s \n" getCurrentTime())
    
    		; ------  Print Designer Name
    		fprintf(cl_file "PCB Designer Name : %s \n" axlFormGetField( les4_form "name"))
    
    		; ------  Print Design Name
    		fprintf(cl_file "Design Name : %s \n" axlCurrentDesign())
    
    		; ------ Print value of check box
    		if( axlFormGetField(les4_form "check1") then check = "YES" else check = "NO" ); end if 
    		fprintf(cl_file "Do you check DRC? : %s \n" check)		
    
    		; ------ Print	value of popup
    		fprintf(cl_file "Exist SMD in this project : %s \n" axlFormGetField( les4_form "pop1"))
    
    		; ------ Print	value of slidebar
    		fprintf(cl_file "Layers number : %d \n" axlFormGetField( les4_form "slidebar1"))
    
    		; ------ Print value of group
    		if( axlFormGetField(les4_form "both") then 
    			silk_side = "Both" 
    		else 
    			if( axlFormGetField(les4_form "top") then silk_side = "Top" else silk_side = "Bottom" ); end if 
    		); end if 
    		
    		fprintf(cl_file "Silk exist on : %s \n" silk_side)
    		; ------
    		
    	close(cl_file)
    			
    ); end of procedure
    ; -----------------------------------------------------------------
    
    



    Now creat another file called les4.form with the following content
     
    
     FILE_TYPE=FORM_DEFN VERSION=2
    FORM
    FIXED
    PORT 40 40
    HEADER "Check List Report"
    
    #=== must define popup before using
    POPUP "Yes" "Yes" , "No" "No" .
    
    TILE
    #========== using STRFILLIN
    TEXT "PCB Designer Name"
    FLOC 1 1
    ENDTEXT
    
    FIELD name
    FLOC 20 1
    STRFILLIN 15 20
    ENDFIELD
    #========== using CHECKLIST
    TEXT "Do you checked  DRC?"
    FLOC 1 5
    ENDTEXT
    
    FIELD check1
    FLOC 20 5
    CHECKLIST "Yes"
    ENDFIELD
    #========== using POPUP
    TEXT "Exist SMD in this project"
    FLOC 1 10
    ENDTEXT
    
    FIELD pop1
    FLOC 20 10
    ENUMSET 6
    POP "pop1"
    ENDFIELD
    #========== using INTSLIDEBAR
    TEXT "Layers number"
    FLOC 1 15
    ENDTEXT
    
    FIELD slidebar1
    FLOC 20 15
    INTSLIDEBAR 2 2
    MIN 2
    MAX 30
    ENDFIELD
    #========== using GROUP
    TEXT "Silk exist on"
    FLOC 1 20
    ENDTEXT
    
    GROUP ""
    GLOC 18 18
    GSIZE 22 5 
    ENDGROUP
    
    FIELD top
    FLOC 19 20
    CHECKLIST"Top" "grp"
    ENDFIELD
    
    FIELD bottom
    FLOC 25 20
    CHECKLIST "Bottom" "grp"
    ENDFIELD
    
    FIELD both
    FLOC 33 20
    CHECKLIST "Both" "grp"
    ENDFIELD
    #========== using MENUBUTTON
    
    FIELD Run_button
    FLOC 2 27
    MENUBUTTON "Run" 7 3
    ENDFIELD
    
    FIELD Close_button
    FLOC 11 27
    MENUBUTTON "Close" 7 3
    ENDFIELD
    
    #======================
    ENDTILE
    
    ENDFORM
    
    Juergen Weber GCD Printlayout GmbH 91056 Erlangen Germany
    • Post Points: 50
  • Tue, Jun 4 2013 2:22 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Example Skill Tutorial Reply

    Hi Jurgen,

    I'm not sure I understand the question. You can use the enclosed text to create the form file using a simple copy and paste. 

    Dave Elder, Tait Communications
    • Post Points: 5
  • Tue, Jun 4 2013 10:11 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: Example Skill Tutorial Reply

    Hi

     If you're looking at making the form file generation part of the program, then you could do so

     

    (defun _mycreateform ()
    let((form_file myform)
    drain()
    form_file = "./les4.form"
    myform = outfile(form_file "w")

    In here you would have to put fprintf statements to print the above into the form file

     example for first line

    fprintf(myform "FILE_TYPE=FORM_DEFN VERSION=2\n")

     ))

    Best regards

    Ole

    Best regards Ole
    • Post Points: 5
  • Wed, Jun 26 2013 4:57 AM

    • joma
    • Top 500 Contributor
    • Joined on Thu, Jun 14 2012
    • Toulouse, Garonne (Haute)
    • Posts 29
    • Points 535
    Re: Example Skill Tutorial Reply

    Hi Jürgen,

     I don't know if you have found it already but there is an example skill form file at
    ...\share\pcb\examples\skill\form\basic\axlform.il

    The last part of this shows how to embed a form file within a skill file. I have not tried to use it yet so I
    can not give any feedback on how it works though.

    Jim O'Mahony

    Jim O'Mahony, Studiel Toulouse
    • Post Points: 20
  • Thu, Jun 27 2013 2:18 AM

    • JuergenWeber
    • Not Ranked
    • Joined on Thu, Feb 16 2012
    • Nuernberg, Bavaria
    • Posts 15
    • Points 255
    Re: Example Skill Tutorial Reply

    Hi all,

    after my vacation i have found the example and the script for a little readme.doc works now.

    This is not perfect but a little beginning for me.

    One question I have. How can I embed an image file (bitmap) . How can I embed an image file

    Thank for your advice.

     

    Form

    Juergen Weber GCD Printlayout GmbH 91056 Erlangen Germany
    • Post Points: 35
  • Thu, Jun 27 2013 8:22 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Example Skill Tutorial Reply
    See the documentation for axlGRPDrwBitmap
    Dave Elder, Tait Communications
    • Post Points: 5
  • Thu, Jun 27 2013 11:39 PM

    • joma
    • Top 500 Contributor
    • Joined on Thu, Jun 14 2012
    • Toulouse, Garonne (Haute)
    • Posts 29
    • Points 535
    Re: Example Skill Tutorial Reply

    The example axlform.il I mentioned above has examples of embedded bitmap files in it as well as many other
    controls and options.

    Jim O'Mahony, Studiel Toulouse
    • Post Points: 5
Page 1 of 1 (7 items)
Sort Posts:
Started by JuergenWeber at 04 Jun 2013 02:37 AM. Topic has 6 replies.