Eeschema Eagle Import: Assign timestamps for modules
This commit is contained in:
+22
-7
@@ -26,13 +26,9 @@
|
||||
|
||||
#include <eagle_parser.h>
|
||||
|
||||
#include <wx/xml/xml.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/filename.h>
|
||||
|
||||
#include <convert_to_biu.h>
|
||||
|
||||
using std::string;
|
||||
#include <functional>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
// Template specializations below parse wxString to the used types:
|
||||
// - string
|
||||
@@ -175,6 +171,25 @@ unsigned long timeStamp( wxXmlNode* aTree )
|
||||
}
|
||||
|
||||
|
||||
time_t moduleTstamp( const string& aName, const string& aValue )
|
||||
{
|
||||
std::size_t h1 = std::hash<string>{}( aName );
|
||||
std::size_t h2 = std::hash<string>{}( aValue );
|
||||
return ((h1 ^ h2 << 1) & 0xffffffff);
|
||||
}
|
||||
|
||||
|
||||
string modulePath( const string& aName, const string& aValue )
|
||||
{
|
||||
std::ostringstream s;
|
||||
|
||||
s << '/' << std::setfill('0') << std::uppercase << std::hex << std::setw(8)
|
||||
<< moduleTstamp( aName, aValue );
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
|
||||
wxPoint kicad_arc_center( const wxPoint& aStart, const wxPoint& aEnd, double aAngle )
|
||||
{
|
||||
// Eagle give us start and end.
|
||||
|
||||
Reference in New Issue
Block a user