dialog_build_BOM.h 2.47 KB
Newer Older
1 2 3 4 5 6 7 8 9
/////////////////////////////////////////////////////////////////////////////
// Name:        dialog_build_BOM.h
// Copyright:   GNU license
// Licence:
/////////////////////////////////////////////////////////////////////////////

#ifndef _DIALOG_BUILD_BOM_H_
#define _DIALOG_BUILD_BOM_H_

10
#include <dialog_build_BOM_base.h>
11 12


13
class EDA_DRAW_FRAME;
14 15 16 17 18 19 20
class SCH_COMPONENT;
class wxConfig;


class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE
{
private:
21 22
    EDA_DRAW_FRAME* m_Parent;
    wxConfig*       m_Config;
23
    wxString        m_ListFileName;     // The full filename of the file report.
24 25 26 27 28 29 30 31 32 33 34 35 36

private:
    void    OnRadioboxSelectFormatSelected( wxCommandEvent& event );
    void    OnOkClick( wxCommandEvent& event );
    void    OnCancelClick( wxCommandEvent& event );

    void    SavePreferences();
    void    Init();
    void    Create_BOM_Lists( int   aTypeFile,
                              bool  aIncludeSubComponents,
                              char  aExportSeparatorSymbol,
                              bool  aRunBrowser );

37
    void    GenereListeOfItems( bool aIncludeSubComponents );
38 39

    /**
40
     * Function CreateExportList
41 42
     * prints a list of components, in a form which can be imported by a
     * spreadsheet.  Form is:
43 44
     *  reference; cmp value; \<footprint\>; \<field1\>; ...;
     * Components are sorted by reference
45
     */
46 47 48 49 50 51 52 53 54 55 56 57
    void    CreateExportList( bool aIncludeSubComponents );

    /**
     * Function CreatePartsList
     * prints a list of components, in a form which can be imported by a spreadsheet.
     * components having the same value and the same footprint
     * are grouped on the same line
     * Form is:
     *  value; number of components; list of references; \<footprint\>; \<field1\>; ...;
     * list is sorted by values
     */
    void    CreatePartsList();
58

59
    int     PrintComponentsListByRef( FILE* f, SCH_REFERENCE_LIST& aList,
60 61
                                      bool CompactForm, bool aIncludeSubComponents );

62
    int     PrintComponentsListByVal( FILE* f, SCH_REFERENCE_LIST& aList,
63 64
                                      bool aIncludeSubComponents );

65
    int     PrintComponentsListByPart( FILE* f, SCH_REFERENCE_LIST& aList,
66 67
                                       bool aIncludeSubComponents );

68
    wxString PrintFieldData( SCH_COMPONENT* DrawLibItem, bool CompactForm = false );
69 70 71 72

    bool    IsFieldChecked( int aFieldId );

public:
73
    DIALOG_BUILD_BOM( EDA_DRAW_FRAME* parent );
74 75 76 77 78

    // ~DIALOG_BUILD_BOM() {};
};

#endif  // _DIALOG_BUILD_BOM_H_