Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
364 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="test"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry combineaccessrules="false" kind="src" path="/org.mavlink.util"/> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.mavlink.generator</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?> | ||
<jardesc> | ||
<jar path="org.mavlink.generator/Java/lib/org.mavlink.generator-1.0.5.jar"/> | ||
<options buildIfNeeded="true" compress="true" descriptionLocation="/org.mavlink.generator/org.mavlink.generator.jardesc" exportErrors="false" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/> | ||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/> | ||
<selectedProjects/> | ||
<manifest generateManifest="true" mainClassHandleIdentifier="=org.mavlink.generator/src<org.mavlink.generator{MAVLinkGenerator.java[MAVLinkGenerator" manifestLocation="/org.mavlink.library/resources/MANIFEST.MF" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true"> | ||
<sealing sealJar="false"> | ||
<packagesToSeal/> | ||
<packagesToUnSeal/> | ||
</sealing> | ||
</manifest> | ||
<selectedElements exportClassFiles="true" exportJavaFiles="true" exportOutputFolder="false"> | ||
<file path="/org.mavlink.generator/.pmd"/> | ||
<file path="/org.mavlink.generator/build.xml"/> | ||
<file path="/org.mavlink.generator/makedistrib.bat"/> | ||
<file path="/org.mavlink.generator/.project"/> | ||
<javaElement handleIdentifier="=org.mavlink.generator/test"/> | ||
<file path="/org.mavlink.generator/generator_readme.txt"/> | ||
<file path="/org.mavlink.generator/pom.xml"/> | ||
<folder path="/org.mavlink.generator/Java"/> | ||
<file path="/org.mavlink.generator/makedistrib.sh"/> | ||
<file path="/org.mavlink.generator/org.mavlink.generator.doxyfile"/> | ||
<javaElement handleIdentifier="=org.mavlink.generator/src"/> | ||
<folder path="/org.mavlink.generator/target"/> | ||
<file path="/org.mavlink.generator/.classpath"/> | ||
</selectedElements> | ||
</jardesc> | ||
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?> | ||
<jardesc> | ||
<jar path="org.mavlink.generator/Java/lib/org.mavlink.generator-1.0.6.jar"/> | ||
<options buildIfNeeded="true" compress="true" descriptionLocation="/org.mavlink.generator/org.mavlink.generator.jardesc" exportErrors="false" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/> | ||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/> | ||
<selectedProjects/> | ||
<manifest generateManifest="true" mainClassHandleIdentifier="=org.mavlink.generator/src<org.mavlink.generator{MAVLinkGenerator.java[MAVLinkGenerator" manifestLocation="/org.mavlink.library/resources/MANIFEST.MF" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true"> | ||
<sealing sealJar="false"> | ||
<packagesToSeal/> | ||
<packagesToUnSeal/> | ||
</sealing> | ||
</manifest> | ||
<selectedElements exportClassFiles="true" exportJavaFiles="true" exportOutputFolder="false"> | ||
<file path="/org.mavlink.generator/.pmd"/> | ||
<folder path="/org.mavlink.generator/target"/> | ||
<javaElement handleIdentifier="=org.mavlink.generator/src"/> | ||
<file path="/org.mavlink.generator/generator_readme.txt"/> | ||
<file path="/org.mavlink.generator/pom.xml"/> | ||
<file path="/org.mavlink.generator/makedistrib.bat"/> | ||
<file path="/org.mavlink.generator/makedistrib.sh"/> | ||
<file path="/org.mavlink.generator/org.mavlink.generator.doxyfile"/> | ||
<file path="/org.mavlink.generator/.classpath"/> | ||
<javaElement handleIdentifier="=org.mavlink.generator/test"/> | ||
<file path="/org.mavlink.generator/build.xml"/> | ||
<folder path="/org.mavlink.generator/Java"/> | ||
<file path="/org.mavlink.generator/.project"/> | ||
</selectedElements> | ||
</jardesc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.mavlink</groupId> | ||
<artifactId>org.mavlink.maven</artifactId> | ||
<version>1.0.5</version> | ||
<relativePath>../org.mavlink.maven</relativePath> | ||
</parent> | ||
<artifactId>org.mavlink.generator</artifactId> | ||
<version>1.0.5</version> | ||
<packaging>jar</packaging> | ||
<name>MAVLink Java Generator</name> | ||
<description>MAVLink Java code generator for embedded devices or Ground Stations</description> | ||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
<testSourceDirectory>test</testSourceDirectory> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.mavlink</groupId> | ||
<artifactId>org.mavlink.util</artifactId> | ||
<version>1.0.4</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.11</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<url>https://code.google.com/p/mavlinkjava</url> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.mavlink</groupId> | ||
<artifactId>org.mavlink.maven</artifactId> | ||
<version>1.0.5</version> | ||
<relativePath>../org.mavlink.maven</relativePath> | ||
</parent> | ||
<artifactId>org.mavlink.generator</artifactId> | ||
<version>1.0.5</version> | ||
<packaging>jar</packaging> | ||
<name>MAVLink Java Generator</name> | ||
<description>MAVLink Java code generator for embedded devices or Ground Stations</description> | ||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
<testSourceDirectory>test</testSourceDirectory> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.mavlink</groupId> | ||
<artifactId>org.mavlink.util</artifactId> | ||
<version>1.0.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.11</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<url>https://code.google.com/p/mavlinkjava</url> | ||
</project> |
99 changes: 47 additions & 52 deletions
99
org.mavlink.generator/src/org/mavlink/generator/FieldCompare.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,47 @@ | ||
/** | ||
* $Id: FieldCompare.java 4 2013-04-11 14:04:50Z ghelle31@gmail.com $ | ||
* $Date: 2013-04-11 16:04:50 +0200 (jeu., 11 avr. 2013) $ | ||
* | ||
* ====================================================== | ||
* Copyright (C) 2012 Guillaume Helle. | ||
* Project : MAVLINK Java | ||
* Module : org.mavlink.generator | ||
* File : org.mavlink.generator.FieldCompare.java | ||
* Author : Guillaume Helle | ||
* | ||
* ====================================================== | ||
* HISTORY | ||
* Who yyyy/mm/dd Action | ||
* -------- ---------- ------ | ||
* ghelle 7 sept. 2012 Create | ||
* | ||
* ==================================================================== | ||
* Licence: MAVLink LGPL | ||
* ==================================================================== | ||
*/ | ||
|
||
package org.mavlink.generator; | ||
|
||
import java.util.Comparator; | ||
|
||
/** | ||
* Comparator to sort field in MAVLink messages. | ||
* Sort only on the size of field type and ignore array size | ||
* @author ghelle | ||
* @version $Rev: 4 $ | ||
* | ||
*/ | ||
public class FieldCompare implements Comparator<MAVLinkField> { | ||
|
||
/** | ||
* {@inheritDoc} | ||
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) | ||
*/ | ||
@Override | ||
public int compare(MAVLinkField field2, MAVLinkField field1) { | ||
//Sort on type size | ||
if (field1.getType().getTypeSize() > field2.getType().getTypeSize()) { | ||
return 1; | ||
} | ||
else if (field1.getType().getTypeSize() < field2.getType().getTypeSize()) { | ||
return -1; | ||
} | ||
return 0; | ||
} | ||
|
||
} | ||
/** | ||
* $Id: FieldCompare.java 4 2013-04-11 14:04:50Z ghelle31@gmail.com $ | ||
* $Date: 2013-04-11 16:04:50 +0200 (jeu., 11 avr. 2013) $ | ||
* | ||
* ====================================================== | ||
* Copyright (C) 2012 Guillaume Helle. | ||
* Project : MAVLINK Java | ||
* Module : org.mavlink.generator | ||
* File : org.mavlink.generator.FieldCompare.java | ||
* Author : Guillaume Helle | ||
* | ||
* ====================================================== | ||
* HISTORY | ||
* Who yyyy/mm/dd Action | ||
* -------- ---------- ------ | ||
* ghelle 7 sept. 2012 Create | ||
* | ||
* ==================================================================== | ||
* Licence: MAVLink LGPL | ||
* ==================================================================== | ||
*/ | ||
|
||
package org.mavlink.generator; | ||
|
||
import java.util.Comparator; | ||
|
||
/** | ||
* Comparator to sort field in MAVLink messages. | ||
* Sort only on the size of field type and ignore array size | ||
* @author ghelle | ||
* @version $Rev: 4 $ | ||
* | ||
*/ | ||
public class FieldCompare implements Comparator<MAVLinkField> { | ||
|
||
public int compare(MAVLinkField field2, MAVLinkField field1) { | ||
//Sort on type size | ||
if (field1.getType().getTypeSize() > field2.getType().getTypeSize()) { | ||
return 1; | ||
} | ||
else if (field1.getType().getTypeSize() < field2.getType().getTypeSize()) { | ||
return -1; | ||
} | ||
return 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/classes" path="generated"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" path="test"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/org.mavlink.util"/> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/generated | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.mavlink.library</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?> | ||
<jardesc> | ||
<jar path="org.mavlink.generator/Java/lib/org.mavlink.library-1.0.5.jar"/> | ||
<options buildIfNeeded="true" compress="true" descriptionLocation="/org.mavlink.library/org.mavlink.library.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/> | ||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/> | ||
<selectedProjects/> | ||
<manifest generateManifest="true" manifestLocation="/org.mavlink.library/resources/MANIFEST.MF" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true"> | ||
<sealing sealJar="false"> | ||
<packagesToSeal/> | ||
<packagesToUnSeal/> | ||
</sealing> | ||
</manifest> | ||
<selectedElements exportClassFiles="true" exportJavaFiles="true" exportOutputFolder="false"> | ||
<file path="/org.mavlink.library/.project"/> | ||
<javaElement handleIdentifier="=org.mavlink.library/src"/> | ||
<javaElement handleIdentifier="=org.mavlink.library/test"/> | ||
<file path="/org.mavlink.library/.pmd"/> | ||
<javaElement handleIdentifier="=org.mavlink.library/generated"/> | ||
<file path="/org.mavlink.library/.classpath"/> | ||
</selectedElements> | ||
</jardesc> | ||
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?> | ||
<jardesc> | ||
<jar path="org.mavlink.generator/Java/lib/org.mavlink.library-1.0.6.jar"/> | ||
<options buildIfNeeded="true" compress="true" descriptionLocation="/org.mavlink.library/org.mavlink.library.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/> | ||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/> | ||
<selectedProjects/> | ||
<manifest generateManifest="true" manifestLocation="/org.mavlink.library/resources/MANIFEST.MF" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true"> | ||
<sealing sealJar="false"> | ||
<packagesToSeal/> | ||
<packagesToUnSeal/> | ||
</sealing> | ||
</manifest> | ||
<selectedElements exportClassFiles="true" exportJavaFiles="true" exportOutputFolder="false"> | ||
<javaElement handleIdentifier="=org.mavlink.library/generated"/> | ||
<file path="/org.mavlink.library/.pmd"/> | ||
<file path="/org.mavlink.library/.classpath"/> | ||
<javaElement handleIdentifier="=org.mavlink.library/src"/> | ||
<file path="/org.mavlink.library/.project"/> | ||
<javaElement handleIdentifier="=org.mavlink.library/test"/> | ||
</selectedElements> | ||
</jardesc> |
Oops, something went wrong.