Skip to content

Commit 377a510

Browse files
authored
Add files via upload
1 parent b9dc5f0 commit 377a510

File tree

90 files changed

+10242
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+10242
-0
lines changed

EmbroideryIO.iml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id="EmbroideryIO" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="java-gradle" name="Java-Gradle">
5+
<configuration>
6+
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
7+
<option name="BUILDABLE" value="false" />
8+
</configuration>
9+
</facet>
10+
</component>
11+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
12+
<exclude-output />
13+
<content url="file://$MODULE_DIR$">
14+
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
15+
</content>
16+
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
17+
<orderEntry type="sourceFolder" forTests="false" />
18+
</component>
19+
</module>

app/app.iml

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android-gradle" name="Android-Gradle">
5+
<configuration>
6+
<option name="GRADLE_PROJECT_PATH" value=":app" />
7+
</configuration>
8+
</facet>
9+
<facet type="android" name="Android">
10+
<configuration>
11+
<option name="SELECTED_BUILD_VARIANT" value="debug" />
12+
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
13+
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
14+
<afterSyncTasks>
15+
<task>generateDebugSources</task>
16+
</afterSyncTasks>
17+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
18+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
19+
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
20+
<option name="RES_FOLDERS_RELATIVE_PATH" value="" />
21+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
22+
<option name="PROJECT_TYPE" value="1" />
23+
</configuration>
24+
</facet>
25+
</component>
26+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
27+
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes" />
28+
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes" />
29+
<exclude-output />
30+
<content url="file://$MODULE_DIR$">
31+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
32+
<sourceFolder url="file://$MODULE_DIR$/build/generated/not_namespaced_r_class_sources/debug/generateDebugRFile/out" isTestSource="false" generated="true" />
33+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
34+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
35+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
36+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
37+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
38+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
39+
<sourceFolder url="file://$MODULE_DIR$/build/generated/not_namespaced_r_class_sources/debugAndroidTest/processDebugAndroidTestResources/r" isTestSource="true" generated="true" />
40+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
41+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
42+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
43+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
44+
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
45+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
46+
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
47+
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
48+
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
49+
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
50+
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
51+
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
52+
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
53+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
54+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
55+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
56+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
57+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
58+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
59+
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
60+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
61+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
62+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
63+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
64+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
65+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
66+
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
67+
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
68+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
69+
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
70+
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
71+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
72+
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
73+
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
74+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
75+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
76+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
77+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
78+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
79+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
80+
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
81+
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
82+
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
83+
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
84+
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
85+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
86+
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
87+
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
88+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/aapt_friendly_merged_manifests" />
89+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/apk_list" />
90+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
91+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
92+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkDebugClasspath" />
93+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest" />
94+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
95+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
96+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint_jar" />
97+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
98+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/packaged_res" />
99+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
100+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
101+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/public_res" />
102+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
103+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
104+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split_list" />
105+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
106+
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
107+
</content>
108+
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
109+
<orderEntry type="sourceFolder" forTests="false" />
110+
<orderEntry type="library" name="Gradle: com.android.support:customview-28.0.0" level="project" />
111+
<orderEntry type="library" name="Gradle: com.android.support:localbroadcastmanager-28.0.0" level="project" />
112+
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test:runner-1.0.2" level="project" />
113+
<orderEntry type="library" name="Gradle: com.android.support:support-vector-drawable-28.0.0" level="project" />
114+
<orderEntry type="library" name="Gradle: com.android.support:interpolator-28.0.0" level="project" />
115+
<orderEntry type="library" name="Gradle: com.android.support:support-core-utils-28.0.0" level="project" />
116+
<orderEntry type="library" name="Gradle: com.android.support:support-core-ui-28.0.0" level="project" />
117+
<orderEntry type="library" name="Gradle: com.android.support:slidingpanelayout-28.0.0" level="project" />
118+
<orderEntry type="library" name="Gradle: android.arch.lifecycle:viewmodel-1.1.1" level="project" />
119+
<orderEntry type="library" name="Gradle: com.android.support:drawerlayout-28.0.0" level="project" />
120+
<orderEntry type="library" name="Gradle: com.android.support:coordinatorlayout-28.0.0" level="project" />
121+
<orderEntry type="library" name="Gradle: com.android.support:collections:28.0.0@jar" level="project" />
122+
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup:javawriter:2.1.1@jar" level="project" />
123+
<orderEntry type="library" name="Gradle: com.android.support:documentfile-28.0.0" level="project" />
124+
<orderEntry type="library" name="Gradle: com.android.support:swiperefreshlayout-28.0.0" level="project" />
125+
<orderEntry type="library" name="Gradle: com.android.support:cursoradapter-28.0.0" level="project" />
126+
<orderEntry type="library" name="Gradle: com.android.support:asynclayoutinflater-28.0.0" level="project" />
127+
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata-1.1.1" level="project" />
128+
<orderEntry type="library" scope="TEST" name="Gradle: com.google.code.findbugs:jsr305:2.0.1@jar" level="project" />
129+
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test.espresso:espresso-core-3.0.2" level="project" />
130+
<orderEntry type="library" scope="TEST" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
131+
<orderEntry type="library" name="Gradle: android.arch.core:common:1.1.1@jar" level="project" />
132+
<orderEntry type="library" name="Gradle: com.android.support:versionedparcelable-28.0.0" level="project" />
133+
<orderEntry type="library" scope="TEST" name="Gradle: junit:junit:4.12@jar" level="project" />
134+
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-core:1.3@jar" level="project" />
135+
<orderEntry type="library" name="Gradle: android.arch.core:runtime-1.1.1" level="project" />
136+
<orderEntry type="library" name="Gradle: com.android.support:print-28.0.0" level="project" />
137+
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test:monitor-1.0.2" level="project" />
138+
<orderEntry type="library" name="Gradle: com.android.support:loader-28.0.0" level="project" />
139+
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test.espresso:espresso-idling-resource-3.0.2" level="project" />
140+
<orderEntry type="library" name="Gradle: com.android.support:viewpager-28.0.0" level="project" />
141+
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-library:1.3@jar" level="project" />
142+
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-integration:1.3@jar" level="project" />
143+
<orderEntry type="library" name="Gradle: com.android.support:support-fragment-28.0.0" level="project" />
144+
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:28.0.0@jar" level="project" />
145+
<orderEntry type="library" name="Gradle: android.arch.lifecycle:common:1.1.1@jar" level="project" />
146+
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata-core-1.1.1" level="project" />
147+
<orderEntry type="library" name="Gradle: com.android.support:support-compat-28.0.0" level="project" />
148+
<orderEntry type="library" name="Gradle: com.android.support:animated-vector-drawable-28.0.0" level="project" />
149+
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7-28.0.0" level="project" />
150+
<orderEntry type="library" name="Gradle: android.arch.lifecycle:runtime-1.1.1" level="project" />
151+
<orderEntry type="library" scope="TEST" name="Gradle: net.sf.kxml:kxml2:2.3.0@jar" level="project" />
152+
<orderEntry type="library" name="Gradle: android-android-28" level="project" />
153+
</component>
154+
</module>

app/build.gradle

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 28
5+
defaultConfig {
6+
7+
minSdkVersion 14
8+
targetSdkVersion 28
9+
versionCode 1
10+
versionName "1.0"
11+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
}
20+
21+
dependencies {
22+
implementation fileTree(dir: 'libs', include: ['*.jar'])
23+
implementation 'com.android.support:appcompat-v7:28.0.0'
24+
testImplementation 'junit:junit:4.12'
25+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
26+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
27+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.embroideryio.embroideryio;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("org.embroideryio.embroideryio", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="org.embroideryio.embroideryio">
3+
4+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package org.embroideryio.embroideryio;
2+
3+
import java.io.IOException;
4+
5+
public class A100Reader extends EmbReader {
6+
7+
private final static int COMMANDSIZE = 4;
8+
9+
public void read_100_stitches() throws IOException {
10+
byte[] b = new byte[COMMANDSIZE];
11+
while (true) {
12+
if (readFully(b) != b.length) {
13+
break;
14+
}
15+
int x = b[2] & 0xFF;
16+
int y = b[3] & 0xFF;
17+
if (x > 0x80) {
18+
x -= 0x80;
19+
x = -x;
20+
}
21+
if (y > 0x80) {
22+
y -= 0x80;
23+
y = -y;
24+
}
25+
if (b[0] == 0x61) {
26+
pattern.stitch(x, -y);
27+
continue;
28+
} else if ((b[0] & 0x01) != 0) {
29+
pattern.move(x, -y);
30+
continue;
31+
} else {
32+
pattern.color_change();
33+
continue;
34+
} //this catch is too broad.
35+
//break;
36+
}
37+
pattern.end();
38+
}
39+
40+
@Override
41+
public void read() throws IOException {
42+
read_100_stitches();
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package org.embroideryio.embroideryio;
2+
3+
import java.io.IOException;
4+
5+
public class A10oReader extends EmbReader {
6+
7+
private final static int COMMANDSIZE = 3;
8+
9+
public void read_10o_stitches() throws IOException {
10+
byte[] b = new byte[COMMANDSIZE];
11+
while (true) {
12+
if (readFully(b) != b.length) {
13+
break;
14+
}
15+
int ctrl = b[0] & 0xFF;
16+
int y = -(b[1] & 0xFF);
17+
int x = b[2] & 0xFF;
18+
if ((ctrl & 0x20) != 0) {
19+
x = -x;
20+
}
21+
if ((ctrl & 0x40) != 0) {
22+
y = -y;
23+
}
24+
if ((ctrl & 0b11111) == 0) {
25+
pattern.stitch(x, y);
26+
continue;
27+
}
28+
if ((ctrl & 0xb11111) == 0x10) {
29+
pattern.move(x, y);
30+
continue;
31+
}
32+
switch (ctrl) {
33+
case 0x8A:
34+
//Start
35+
continue;
36+
case 0x85:
37+
pattern.color_change();
38+
continue;
39+
case 0x82:
40+
pattern.stop();
41+
continue;
42+
case 0x81:
43+
pattern.trim();
44+
continue;
45+
case 0x87:
46+
break;
47+
}
48+
break;
49+
}
50+
pattern.end();
51+
}
52+
53+
@Override
54+
public void read() throws IOException {
55+
read_10o_stitches();
56+
}
57+
}

0 commit comments

Comments
 (0)