30#include <wx/filename.h> 
   43#include <wx/filedlg.h> 
   46using json = nlohmann::json;
 
  108   FILE* jobFile = wxFopen( 
m_filename.GetFullPath(), wxT( 
"rt" ) );
 
  110    if( jobFile == 
nullptr )
 
  118    bool json_format = 
false;
 
  120    char* line = jobfileReader.
ReadLine();
 
  127    if( data.Contains( wxT( 
"{" ) ) )
 
  132        while( ( line = jobfileReader.
ReadLine() ) != 
nullptr )
 
  133            data << 
'\n' << line;
 
  139            for( 
json& entry : js[
"FilesAttributes"] )
 
  141                std::string 
name = entry[
"Path"].get<std::string>();
 
  153            m_reporter->ReportTail( 
_( 
"This job file uses an outdated format. Please recreate it." ),
 
 
  177    wxFileName filename = aFullFileName;
 
  178    wxString currentPath;
 
  181    if( !filename.IsOk() )
 
  184        if( filename.DirExists() )
 
  185            currentPath = filename.GetPath();
 
  189        wxFileDialog dlg( 
this, 
_( 
"Open Gerber Job File" ),
 
  191                          filename.GetFullName(),
 
  193                          wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR );
 
  195        if( dlg.ShowModal() == wxID_CANCEL )
 
  198        filename = dlg.GetPath();
 
  199        currentPath = filename.GetPath();
 
  204        currentPath = filename.GetPath();
 
  210    if( filename.IsOk() )
 
  225            std::vector<int> fileTypesVec( gbrfiles.Count(), 0 );
 
 
void UpdateFileHistory(const wxString &FullFileName, FILE_HISTORY *aFileHistory=nullptr)
Update the list of recently opened files.
 
virtual void ClearMsgPanel()
Clear all messages from the message panel.
 
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
 
A LINE_READER that reads from an open file.
 
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
 
this class read and parse a Gerber job file to extract useful info for GerbView
 
GERBER_JOBFILE_READER(const wxString &aFileName, REPORTER *aReporter)
 
wxArrayString m_GerberFiles
 
wxArrayString & GetGerberFiles()
read a .gbrjob file
 
wxString formatStringFromJSON(const std::string &name)
 
void SortLayersByX2Attributes()
 
bool LoadGerberJobFile(const wxString &aFileName)
Load a Gerber job file, and load gerber files found in job files.
 
FILE_HISTORY m_jobFileHistory
 
bool Clear_DrawLayers(bool query)
 
bool LoadListOfGerberAndDrillFiles(const wxString &aPath, const wxArrayString &aFilenameList, std::vector< int > *aFileType)
Load a list of Gerber and NC drill files and updates the view based on them.
 
void ListSet(const wxString &aList)
Add a list of items.
 
A pure virtual class used to derive REPORTER objects from.
 
virtual bool HasMessage() const
Returns true if any messages were reported.
 
A wrapper for reporting to a wxString object.
 
const wxString & GetMessages() const
 
static wxString GerberJobFileWildcard()
 
wxString From_UTF8(const char *cstring)
 
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
 
Definition of file extensions used in Kicad.