kopia lustrzana https://github.com/Reenforcements/PES-Embroidery
Updates
rodzic
92048a6fc7
commit
f3181f0e29
|
@ -2,8 +2,7 @@
|
|||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="0b5af789-e47c-4138-bdb9-8fa765481e1e" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/LOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/LOG.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/PES.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/PES.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/PECRender/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/PECRender/main.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -14,7 +13,7 @@
|
|||
<component name="CoverageDataManager">
|
||||
<SUITE FILE_PATH="coverage/PES_Embroidery$svgImport.coverage" NAME="svgImport Coverage Results" MODIFIED="1541478220694" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src/learning" />
|
||||
<SUITE FILE_PATH="coverage/PES_Embroidery$main.coverage" NAME="main Coverage Results" MODIFIED="1542424584074" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/src" />
|
||||
<SUITE FILE_PATH="coverage/PES_Embroidery$main__1_.coverage" NAME="PECRender-main Coverage Results" MODIFIED="1542495693188" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/PECRender" />
|
||||
<SUITE FILE_PATH="coverage/PES_Embroidery$main__1_.coverage" NAME="PECRender-main Coverage Results" MODIFIED="1542505781253" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/PECRender" />
|
||||
</component>
|
||||
<component name="FUSProjectUsageTrigger">
|
||||
<session id="-1920598427">
|
||||
|
@ -31,7 +30,7 @@
|
|||
<usages-collector id="statistics.vcs.git.usages" />
|
||||
<usages-collector id="statistics.file.types.edit">
|
||||
<counts>
|
||||
<entry key="Python" value="10864" />
|
||||
<entry key="Python" value="13231" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
<usages-collector id="statistics.js.language.service.starts" />
|
||||
|
@ -49,7 +48,7 @@
|
|||
</usages-collector>
|
||||
<usages-collector id="statistics.file.extensions.edit">
|
||||
<counts>
|
||||
<entry key="py" value="10864" />
|
||||
<entry key="py" value="13231" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
</session>
|
||||
|
@ -88,14 +87,15 @@
|
|||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/PECRender/main.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="187">
|
||||
<caret line="35" column="8" selection-start-line="35" selection-start-column="8" selection-end-line="35" selection-end-column="8" />
|
||||
<state relative-caret-position="150">
|
||||
<caret line="66" column="50" selection-start-line="66" selection-start-column="50" selection-end-line="66" selection-end-column="50" />
|
||||
<folding>
|
||||
<element signature="e#0#10#0" expanded="true" />
|
||||
<marker date="1542495737701" expanded="true" signature="213:310" ph="..." />
|
||||
<marker date="1542495737701" expanded="true" signature="815:819" ph="..." />
|
||||
<marker date="1542495737701" expanded="true" signature="896:1045" ph="..." />
|
||||
<marker date="1542495737701" expanded="true" signature="1066:1379" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="213:310" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="2120:2425" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="2664:2668" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="2745:2894" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="2915:3228" ph="..." />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
|
@ -150,6 +150,14 @@
|
|||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>DIFF</find>
|
||||
<find>color</find>
|
||||
<find>Big:</find>
|
||||
<find>starting</find>
|
||||
</findStrings>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
|
@ -470,14 +478,15 @@
|
|||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/PECRender/main.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="187">
|
||||
<caret line="35" column="8" selection-start-line="35" selection-start-column="8" selection-end-line="35" selection-end-column="8" />
|
||||
<state relative-caret-position="150">
|
||||
<caret line="66" column="50" selection-start-line="66" selection-start-column="50" selection-end-line="66" selection-end-column="50" />
|
||||
<folding>
|
||||
<element signature="e#0#10#0" expanded="true" />
|
||||
<marker date="1542495737701" expanded="true" signature="213:310" ph="..." />
|
||||
<marker date="1542495737701" expanded="true" signature="815:819" ph="..." />
|
||||
<marker date="1542495737701" expanded="true" signature="896:1045" ph="..." />
|
||||
<marker date="1542495737701" expanded="true" signature="1066:1379" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="213:310" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="2120:2425" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="2664:2668" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="2745:2894" ph="..." />
|
||||
<marker date="1542506203085" expanded="true" signature="2915:3228" ph="..." />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
|
|
|
@ -15,25 +15,80 @@ filepath = "/Users/imaustyn/Documents/MiamiUniversity/ECE 487/Project/Understand
|
|||
class Global:
|
||||
pauseEmbroidery = False
|
||||
batch = pyglet.graphics.Batch()
|
||||
x1 = 0
|
||||
y1 = 0
|
||||
x2 = 0
|
||||
y2 = 0
|
||||
x = 0
|
||||
y = 0
|
||||
file = None
|
||||
scale = 1.0
|
||||
|
||||
@classmethod
|
||||
def addLine(cls, x1, y1, x2, y2, r, g, b):
|
||||
cls.batch.add(2, pyglet.gl.GL_LINES, None,
|
||||
('v2i', (x1, y1, x2, y2)),
|
||||
('v2f', (x1 / cls.scale, y1 / cls.scale, x2 / cls.scale, y2 / cls.scale)),
|
||||
('c3B', (r,g,b, r,g,b))
|
||||
)
|
||||
print("Stitch from ({}, {}) to ({}, {})".format(x1, y1, x2, y2) )
|
||||
cls.x = x2
|
||||
cls.y = y2
|
||||
|
||||
@classmethod
|
||||
def readPECHeader(cls):
|
||||
if cls.file is None:
|
||||
return
|
||||
|
||||
|
||||
f = cls.file # type: file
|
||||
print(f.read(8))
|
||||
PECOffset = struct.unpack("<I", f.read(4))[0]
|
||||
f.seek(PECOffset)
|
||||
# Skip stuff
|
||||
cls.label = f.read(20)
|
||||
print("Label: {}".format(cls.label))
|
||||
f.read(28)
|
||||
cls.numberOfColors = struct.unpack("B", f.read(1))[0] + 1
|
||||
print("Number of colors: {}".format(cls.numberOfColors))
|
||||
|
||||
cls.colors = []
|
||||
for c in range(0, cls.numberOfColors):
|
||||
color = struct.unpack("B", f.read(1))[0]
|
||||
cls.colors.append(color)
|
||||
print(" Color {}: {}".format(c, color))
|
||||
|
||||
|
||||
f.read(462 - cls.numberOfColors)
|
||||
# blank = struct.unpack("BB", f.read(2))
|
||||
# if blank is not (0,0):
|
||||
# print("nope: {}".format(blank) )
|
||||
# sys.exit(0)
|
||||
f.read(20)
|
||||
print("Starting stitches at location: {}".format(f.tell()))
|
||||
|
||||
# I'm pretty sure one coordinate can be the long form
|
||||
# and the second one is short or vice versa. I initially
|
||||
# thought they had to come in pairs but that didn't seem
|
||||
# to be working so let's try it this way.
|
||||
def getCoordinate():
|
||||
peek = f.read(1)
|
||||
f.seek(f.tell() - 1)
|
||||
if peek is None:
|
||||
break
|
||||
|
||||
peekByte = struct.unpack("B", peek)[0]
|
||||
if (peekByte & 0x80) > 0:
|
||||
|
||||
if single == 0xFF:
|
||||
print("End stitches")
|
||||
break
|
||||
|
||||
while True:
|
||||
x = getCoordinate()
|
||||
y = getCoordinate()
|
||||
|
||||
cls.addLine(Global.x, Global.y, Global.x + x, Global.y + y, int(random.uniform(0,255)), int(random.uniform(0,255)), int(random.uniform(0,255)))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue