Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 235 → Rev 254

/DUBwise/tags/v0.52/android/AndroidManifest.xml
0,0 → 1,104
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ligi.android"
android:versionCode="1"
android:versionName="1.0">
 
<application android:label="@string/app_name">
 
<uses-library android:name="com.google.android.maps"/>
<activity android:name=".DUBwise"
android:label="@string/app_name"
android:icon="@drawable/icon">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
 
 
<activity android:name=".DUBwiseMapActivity"
android:label="@string/app_name"
>
<intent-filter>
 
<action android:name="android.intent.action.MAIN" />
 
</intent-filter>
</activity>
 
<activity android:name=".ConnectionActivity"
android:label="@string/app_name"
>
<intent-filter>
 
<action android:name="android.intent.action.MAIN" />
 
</intent-filter>
</activity>
 
 
<activity android:name=".MotorTestActivity"
android:label="@string/app_name"
>
<intent-filter>
 
<action android:name="android.intent.action.MAIN" />
 
</intent-filter>
</activity>
 
<activity android:name=".SettingsActivity"
android:label="@string/app_name"
>
<intent-filter>
 
<action android:name="android.intent.action.MAIN" />
 
</intent-filter>
</activity>
 
 
<activity android:name=".RCDataActivity"
android:label="@string/app_name"
>
<intent-filter>
 
<action android:name="android.intent.action.MAIN" />
 
</intent-filter>
</activity>
 
 
 
<activity android:name=".FlightSettingsActivity"
android:label="@string/app_name"
>
<intent-filter>
 
<action android:name="android.intent.action.MAIN" />
 
</intent-filter>
</activity>
 
 
<activity android:name=".FlightSettingsSettingSelect"
 
android:label="@string/app_name"
>
<intent-filter>
 
<action android:name="android.intent.action.MAIN" />
 
</intent-filter>
</activity>
 
</application>
 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
 
 
</manifest>
/DUBwise/tags/v0.52/android/build.xml
0,0 → 1,293
<?xml version="1.0" ?>
<project name="DUBwise" default="debug">
 
<!-- The build.properties file can be created by you and is never touched
by activitycreator. If you want to manually set properties, this is
the best place to set them. -->
<property file="build.properties"/>
 
<!-- The default.properties file is created and updated by activitycreator.
It will set any properties not already defined by build.properties. -->
<property file="default.properties"/>
 
<!-- ************************************************************************************* -->
<!-- These settings were written by activitycreator.
Do not change them unless you really know what you are doing. -->
 
<!-- Application Package Name -->
<property name="application-package" value="org.ligi.android" />
 
<!-- The intermediates directory, Eclipse uses "bin"
for its own output, so we do the same. -->
<property name="outdir" value="bin" />
<!-- ************************************************************************************* -->
<!-- No user servicable parts below. -->
 
<property name="android-tools" value="${sdk-folder}/tools" />
<property name="android-framework" value="${android-tools}/lib/framework.aidl" />
 
<!-- Input directories -->
<property name="resource-dir" value="res" />
<property name="asset-dir" value="assets" />
<property name="srcdir" value="src" />
<condition property="srcdir-ospath"
value="${basedir}\${srcdir}"
else="${basedir}/${srcdir}" >
<os family="windows"/>
</condition>
 
<!-- folder for the 3rd party java libraries -->
<property name="external-libs" value="libs" />
<condition property="external-libs-ospath"
value="${basedir}\${external-libs}"
else="${basedir}/${external-libs}" >
<os family="windows"/>
</condition>
 
<!-- folder for the native libraries -->
<property name="native-libs" value="libs" />
<condition property="native-libs-ospath"
value="${basedir}\${native-libs}"
else="${basedir}/${native-libs}" >
<os family="windows"/>
</condition>
 
<!-- Output directories -->
<property name="outdir-classes" value="${outdir}/classes" />
<condition property="outdir-classes-ospath"
value="${basedir}\${outdir-classes}"
else="${basedir}/${outdir-classes}" >
<os family="windows"/>
</condition>
 
<!-- Create R.java in the source directory -->
<property name="outdir-r" value="src" />
 
<!-- Intermediate files -->
<property name="dex-file" value="classes.dex" />
<property name="intermediate-dex" value="${outdir}/${dex-file}" />
<condition property="intermediate-dex-ospath"
value="${basedir}\${intermediate-dex}"
else="${basedir}/${intermediate-dex}" >
<os family="windows"/>
</condition>
 
<!-- The final package file to generate -->
<property name="resources-package" value="${outdir}/${ant.project.name}.ap_" />
<condition property="resources-package-ospath"
value="${basedir}\${resources-package}"
else="${basedir}/${resources-package}" >
<os family="windows"/>
</condition>
 
<property name="out-debug-package" value="${outdir}/${ant.project.name}-debug.apk" />
<condition property="out-debug-package-ospath"
value="${basedir}\${out-debug-package}"
else="${basedir}/${out-debug-package}" >
<os family="windows"/>
</condition>
 
<property name="out-unsigned-package" value="${outdir}/${ant.project.name}-unsigned.apk" />
<condition property="out-unsigned-package-ospath"
value="${basedir}\${out-unsigned-package}"
else="${basedir}/${out-unsigned-package}" >
<os family="windows"/>
</condition>
 
<!-- Tools -->
<condition property="aapt" value="${android-tools}/aapt.exe" else="${android-tools}/aapt" >
<os family="windows"/>
</condition>
<condition property="aidl" value="${android-tools}/aidl.exe" else="${android-tools}/aidl" >
<os family="windows"/>
</condition>
<condition property="adb" value="${android-tools}/adb.exe" else="${android-tools}/adb" >
<os family="windows"/>
</condition>
<condition property="dx" value="${android-tools}/dx.bat" else="${android-tools}/dx" >
<os family="windows"/>
</condition>
<condition property="apk-builder" value="${android-tools}/apkbuilder.bat" else="${android-tools}/apkbuilder" >
<os family="windows"/>
</condition>
 
<property name="android-jar" value="${sdk-folder}/android.jar" />
 
<!-- Rules -->
 
<!-- Create the output directories if they don't exist yet. -->
<target name="dirs">
<echo>Creating output directories if needed...</echo>
<mkdir dir="${outdir}" />
<mkdir dir="${outdir-classes}" />
</target>
 
<!-- Generate the R.java file for this project's resources. -->
<target name="resource-src" depends="dirs">
<echo>Generating R.java / Manifest.java from the resources...</echo>
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
<arg value="-m" />
<arg value="-J" />
<arg value="${outdir-r}" />
<arg value="-M" />
<arg value="AndroidManifest.xml" />
<arg value="-S" />
<arg value="${resource-dir}" />
<arg value="-I" />
<arg value="${android-jar}" />
</exec>
</target>
 
<!-- Generate java classes from .aidl files. -->
<target name="aidl" depends="dirs">
<echo>Compiling aidl files into Java classes...</echo>
<apply executable="${aidl}" failonerror="true">
<arg value="-p${android-framework}" />
<arg value="-I${srcdir}" />
<fileset dir="${srcdir}">
<include name="**/*.aidl"/>
</fileset>
</apply>
</target>
 
<!-- Compile this project's .java files into .class files. -->
<target name="compile" depends="dirs, resource-src, aidl">
<javac encoding="ascii" target="1.5" debug="true" extdirs=""
srcdir="."
destdir="${outdir-classes}"
bootclasspath="${android-jar}">
<classpath>
<fileset dir="${external-libs}" includes="*.jar"/>
</classpath>
</javac>
</target>
 
<!-- Convert this project's .class files into .dex files. -->
<target name="dex" depends="compile">
<echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo>
<apply executable="${dx}" failonerror="true" parallel="true">
<arg value="--dex" />
<arg value="--output=${intermediate-dex-ospath}" />
<arg path="${outdir-classes-ospath}" />
<fileset dir="${external-libs}" includes="*.jar"/>
</apply>
</target>
 
<!-- Put the project's resources into the output package file. -->
<target name="package-res-and-assets">
<echo>Packaging resources and assets...</echo>
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
<arg value="-f" />
<arg value="-M" />
<arg value="AndroidManifest.xml" />
<arg value="-S" />
<arg value="${resource-dir}" />
<arg value="-A" />
<arg value="${asset-dir}" />
<arg value="-I" />
<arg value="${android-jar}" />
<arg value="-F" />
<arg value="${resources-package}" />
</exec>
</target>
 
<!-- Same as package-res-and-assets, but without "-A ${asset-dir}" -->
<target name="package-res-no-assets">
<echo>Packaging resources...</echo>
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
<arg value="-f" />
<arg value="-M" />
<arg value="AndroidManifest.xml" />
<arg value="-S" />
<arg value="${resource-dir}" />
<!-- No assets directory -->
<arg value="-I" />
<arg value="${android-jar}" />
<arg value="-F" />
<arg value="${resources-package}" />
</exec>
</target>
 
<!-- Invoke the proper target depending on whether or not
an assets directory is present. -->
<!-- TODO: find a nicer way to include the "-A ${asset-dir}" argument
only when the assets dir exists. -->
<target name="package-res">
<available file="${asset-dir}" type="dir"
property="res-target" value="and-assets" />
<property name="res-target" value="no-assets" />
<antcall target="package-res-${res-target}" />
</target>
 
<!-- Package the application and sign it with a debug key.
This is the default target when building. It is used for debug. -->
<target name="debug" depends="dex, package-res">
<echo>Packaging ${out-debug-package}, and signing it with a debug key...</echo>
<exec executable="${apk-builder}" failonerror="true">
<arg value="${out-debug-package-ospath}" />
<arg value="-z" />
<arg value="${resources-package-ospath}" />
<arg value="-f" />
<arg value="${intermediate-dex-ospath}" />
<arg value="-rf" />
<arg value="${srcdir-ospath}" />
<arg value="-rj" />
<arg value="${external-libs-ospath}" />
<arg value="-nf" />
<arg value="${native-libs-ospath}" />
</exec>
</target>
 
<!-- Package the application without signing it.
This allows for the application to be signed later with an official publishing key. -->
<target name="release" depends="dex, package-res">
<echo>Packaging ${out-unsigned-package} for release...</echo>
<exec executable="${apk-builder}" failonerror="true">
<arg value="${out-unsigned-package-ospath}" />
<arg value="-u" />
<arg value="-z" />
<arg value="${resources-package-ospath}" />
<arg value="-f" />
<arg value="${intermediate-dex-ospath}" />
<arg value="-rf" />
<arg value="${srcdir-ospath}" />
<arg value="-rj" />
<arg value="${external-libs-ospath}" />
<arg value="-nf" />
<arg value="${native-libs-ospath}" />
</exec>
<echo>It will need to be signed with jarsigner before being published.</echo>
</target>
 
<!-- Install the package on the default emulator -->
<target name="install" depends="debug">
<echo>Installing ${out-debug-package} onto default emulator...</echo>
<exec executable="${adb}" failonerror="true">
<arg value="install" />
<arg value="${out-debug-package}" />
</exec>
</target>
 
<target name="reinstall" depends="debug">
<echo>Installing ${out-debug-package} onto default emulator...</echo>
<exec executable="${adb}" failonerror="true">
<arg value="install" />
<arg value="-r" />
<arg value="${out-debug-package}" />
</exec>
</target>
 
<!-- Uinstall the package from the default emulator -->
<target name="uninstall">
<echo>Uninstalling ${application-package} from the default emulator...</echo>
<exec executable="${adb}" failonerror="true">
<arg value="uninstall" />
<arg value="${application-package}" />
</exec>
</target>
 
</project>
/DUBwise/tags/v0.52/android/default.properties
0,0 → 1,5
# This file is automatically generated by activitycreator.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
# Instead customize values in a "build.properties" file.
 
sdk-folder=/home/ligi/bin/android-sdk-linux_x86-1.0_r2
/DUBwise/tags/v0.52/android/res/drawable/bt_off.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/drawable/bt_on.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/drawable/icon.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/drawable/lcd_green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/drawable/starfield.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/layout/connection.xml
0,0 → 1,78
<?xml version="1.0" encoding="utf-8"?>
 
 
 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
 
 
 
 
 
 
 
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Host:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
<EditText android:id="@+id/edit_host"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Port:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
 
<EditText android:id="@+id/edit_port"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
 
 
<CheckBox android:id="@+id/check_autoconn"
android:paddingBottom="24sp"
android:paddingTop="24sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Auto Connect " />
 
 
<Button android:id="@+id/save_btn"
android:text="Save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
 
<Button android:id="@+id/cancel_btn"
android:text="Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
 
</ScrollView>
 
 
 
 
 
 
 
/DUBwise/tags/v0.52/android/res/layout/motortest.xml
0,0 → 1,151
<?xml version="1.0" encoding="utf-8"?>
 
 
 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
 
 
 
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
 
 
 
<CheckBox android:id="@+id/check_fullspeed"
android:paddingBottom="24sp"
android:paddingTop="24sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Allow Full Speed" />
 
<View
 
android:layout_height="2px"
android:layout_width="fill_parent"
 
android:background="#DDFFDD"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"/>
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Front:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
 
<SeekBar android:id="@+id/seek_front"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="255"
android:focusable="true"
/>
 
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Back:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
 
<SeekBar android:id="@+id/seek_back"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="255" />
 
 
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Left:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
 
<SeekBar android:id="@+id/seek_left"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="255" />
 
 
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Right:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
 
<SeekBar android:id="@+id/seek_right"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="255" />
 
 
 
<View
 
android:layout_height="2px"
android:layout_width="fill_parent"
 
android:background="#DDFFDD"
android:layout_marginTop="15dip"
android:layout_marginBottom="5dip"/>
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="All:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
 
<SeekBar android:id="@+id/seek_all"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="255" />
</LinearLayout>
 
</ScrollView>
 
 
 
 
/DUBwise/tags/v0.52/android/res/layout/rcdata.xml
0,0 → 1,216
<?xml version="1.0" encoding="utf-8"?>
 
 
 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
 
 
 
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick0:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_0"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
 
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick 1:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
 
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick2:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_2"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick 3:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_3"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick 4:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_4"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick 5:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_5"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick 6:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_6"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick 7:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_7"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick 8:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_8"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Stick 9:"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="true"
/>
 
<ProgressBar android:id="@+id/stick_progress_9"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="255"
android:progress="0"
android:secondaryProgress="0" />
</LinearLayout>
 
 
</ScrollView>
 
 
 
 
/DUBwise/tags/v0.52/android/res/layout/settings.xml
0,0 → 1,52
<?xml version="1.0" encoding="utf-8"?>
 
 
 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
 
 
 
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
 
 
 
<CheckBox android:id="@+id/check_fullscreen"
android:paddingBottom="24sp"
android:paddingTop="24sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fullscreen" />
 
<View
 
android:layout_height="2px"
android:layout_width="fill_parent"
 
android:background="#DDFFDD"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"/>
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Front:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
</LinearLayout>
 
</ScrollView>
 
 
 
 
/DUBwise/tags/v0.52/android/res/raw/voice_sample_01.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_02.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_03.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_04.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_05.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_06.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_07.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_08.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_09.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_10.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_11.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_12.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_13.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_komma.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/raw/voice_sample_volt.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/android/res/values/strings.xml
0,0 → 1,10
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">DUBwise</string>
 
<string name="map_menu_zoom_in">Zoom in (Key: I)</string>
<string name="map_menu_zoom_out">Zoom out (Key: O)</string>
<string name="map_menu_back_to_list">Back to list</string>
<string name="map_menu_toggle_street_satellite">Toggle View: Street / Satellite (Key: T)</string>
 
</resources>
/DUBwise/tags/v0.52/android/shared_src
0,0 → 1,0
link ../shared/src/
Property changes:
Added: svn:special
+*
\ No newline at end of property
/DUBwise/tags/v0.52/android/src/org/ligi/android/AndroidMKCommunicator.java
0,0 → 1,20
package org.ligi.android;
 
import android.app.Activity;
import android.content.SharedPreferences;
 
public class AndroidMKCommunicator extends org.ligi.ufo.MKCommunicator
 
{
 
public AndroidMKCommunicator(android.content.Context ctx)
{
super();
SharedPreferences settings;
settings =ctx.getSharedPreferences("DUBwise", 0);
this.connect_to(settings.getString("conn_host","10.0.2.2")+":"+(settings.getString("conn_port","9876")),"unnamed");
}
 
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/ConnectionActivity.java
0,0 → 1,105
package org.ligi.android;
 
// Need the following import to get access to the app resources, since this
// class is in a sub-package.
 
 
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Button;
import android.text.method.NumberKeyListener;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.SharedPreferences;
/**
* Demonstrates wrapping a layout in a ScrollView.
*
*/
public class ConnectionActivity extends Activity {
 
 
EditText port_edit;
EditText host_edit;
 
Activity here;
 
DUBwise root;
 
 
 
 
 
 
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.connection);
here=this;
SharedPreferences settings = getSharedPreferences("DUBwise", 0);
 
port_edit=(EditText)findViewById( R.id.edit_port);
host_edit=(EditText)findViewById( R.id.edit_host);
 
port_edit.setKeyListener(new NumberKeyListener(){
@Override
protected char[] getAcceptedChars() {
 
return new char[]{'1','2','3','4','5','6','7','8','9','0'};
}
});
 
host_edit.setText(settings.getString("conn_host","10.0.2.2"));
port_edit.setText(settings.getString("conn_port","54321"));
 
Button save_btn=(Button)findViewById( R.id.save_btn);
 
save_btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
 
 
java.net.Socket connection;
java.io.InputStream reader;
java.io.OutputStream writer;
try {
connection = new java.net.Socket(host_edit.getText().toString(),Integer.parseInt(port_edit.getText().toString()));
 
 
SharedPreferences settings = getSharedPreferences("DUBwise", 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("conn_host", host_edit.getText().toString());
editor.putString("conn_port", port_edit.getText().toString());
// Don't forget to commit your edits!!!
editor.commit();
 
 
 
finish();
}
catch (Exception e) {
 
new AlertDialog.Builder(here).setTitle("Connection Problem").setMessage("" + e.toString()).setPositiveButton("OK",null).create().show();
 
}
}
});
 
 
Button cancel_btn=(Button)findViewById( R.id.cancel_btn);
 
cancel_btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
});
 
 
}
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/ConnectionView.java
0,0 → 1,62
package org.ligi.android;
 
 
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
 
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.View;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.SimpleAdapter;
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.ArrayAdapter;
import android.content.DialogInterface;
import android.content.Context.*;
import android.widget.EditText;
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
 
// not working atm - import org.bluez.*;
 
public class ConnectionView
extends ScrollView
{
 
 
public ConnectionView(DUBwise context) {
super(context);
// setContentView(R.layout.main);
}
 
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/DUBwise.java
0,0 → 1,193
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
 
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.ArrayAdapter;
import android.content.DialogInterface;
import android.content.Context.*;
import android.widget.EditText;
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.SharedPreferences;
 
import org.ligi.ufo.*;
 
public class DUBwise extends ListActivity
{
 
 
DUBwiseView canvas;
boolean do_sound;
boolean fullscreen;
MKCommunicator mk;
String[] menu_items = new String[]{"Settings","Connection", "Old Interface" , "View On Maps", "Flight Settings","RCData","Motor Test", "About","Quit"};
int[] menu_actions= new int[]{ACTIONID_SETTINGS,ACTIONID_CONN , ACTIONID_OLDINTERFACE , ACTIONID_MAPS ,ACTIONID_FLIGHTSETTINGS,ACTIONID_RCDATA,ACTIONID_MOTORTEST, ACTIONID_ABOUT , ACTIONID_QUIT };
 
public final static int ACTIONID_CONN=0;
public final static int ACTIONID_MAPS=1;
public final static int ACTIONID_ABOUT=2;
public final static int ACTIONID_OLDINTERFACE=3;
public final static int ACTIONID_FLIGHTSETTINGS=4;
public final static int ACTIONID_MOTORTEST=5;
public final static int ACTIONID_RCDATA=6;
public final static int ACTIONID_SETTINGS=7;
public final static int ACTIONID_QUIT=100;
 
SharedPreferences settings;
// public MapView map;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
 
settings = getSharedPreferences("DUBwise", 0);
// menu_items[0]=settings.getString("conn_host","--");
// mk=new MKCommunicator();
this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, menu_items));
}
 
 
 
 
public void log(String msg)
{
Log.d("DUWISE",msg);
}
 
public void quit()
{
this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, menu_items));
// setContentView(this);
}
 
@Override
protected void onListItemClick(ListView l, View v, int position, long id){
super.onListItemClick(l, v, position, id);
// Get the item that was clicked
Object o = this.getListAdapter().getItem(position);
//String keyword = o.toString();
 
// Create an VIEW intent
Intent myIntent = null;
 
try {
 
switch(menu_actions[position])
{
 
case ACTIONID_SETTINGS:
// setContentView(new ConnectionView(this));
 
startActivity(new Intent(this, SettingsActivity.class));
break;
 
case ACTIONID_CONN:
// setContentView(new ConnectionView(this));
 
startActivity(new Intent(this, ConnectionActivity.class));
break;
case ACTIONID_MOTORTEST:
// setContentView(new ConnectionView(this));
startActivity(new Intent(this, MotorTestActivity.class));
 
break;
 
case ACTIONID_RCDATA:
// setContentView(new ConnectionView(this));
startActivity(new Intent(this, RCDataActivity.class));
 
break;
case ACTIONID_FLIGHTSETTINGS:
// setContentView(new ConnectionView(this));
startActivity(new Intent(this, FlightSettingsActivity.class));
 
 
 
/* EditText edit_host=(EditText)findViewById( R.id.edit_host);
edit_host.setKeyListener(new NumberKeyListener(){
@Override
protected char[] getAcceptedChars() {
char[] numberChars = {'1','2','3'};
return numberChars;
}
});*/
 
// edit_host.setText("foobar");
break;
case ACTIONID_OLDINTERFACE:
mk.connect_to(settings.getString("conn_host","10.0.2.2")+":"+(settings.getString("conn_port","9876")),"unnamed");
canvas=new DUBwiseView(this);
setContentView(canvas);
break;
case ACTIONID_MAPS:
// setActivity(new DUBwiseMapActivity(this));
startActivity(new Intent(this, DUBwiseMapActivity.class));
 
 
// new AlertDialog.Builder(this).setTitle("foo").setMessage("bar").setPositiveButton("OK",null).create().show();
 
// showAlert("A funny title", "MessageBoxes rule extremely!", "Hit Me!", false);
/*
// The intent will open our anddev.org-board and search for the keyword clicked.
myIntent = new Intent("android.intent.action.DUBWISEMAP",
Uri.parse("http://www.ligi.de/"));
startActivity(myIntent);*/
break;
 
case ACTIONID_ABOUT:
startActivity( new Intent("android.intent.action.VIEW", Uri.parse("http://www.ligi.de/")));
break;
 
case ACTIONID_QUIT:
finish();
break;
}
} catch (Exception e) {
e.printStackTrace();
}
// Start the activity
 
}
 
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/DUBwiseMapActivity.java
0,0 → 1,141
package org.ligi.android;
import android.os.Bundle;
import com.google.android.maps.*;
 
import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;
import java.util.Map;
import android.view.Menu;
import android.view.MenuItem;
 
import android.view.*;
import android.content.SharedPreferences;
 
public class DUBwiseMapActivity extends MapActivity implements Runnable,MapKey
{
 
//MapView mMapView;
 
MapView map;
MapController mc ;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
boolean supRetVal = super.onCreateOptionsMenu(menu);
 
menu.add(0, 0,0, getString(R.string.map_menu_zoom_in));
menu.add(0, 1,0, getString(R.string.map_menu_zoom_out));
menu.add(0, 2,0, getString(R.string.map_menu_toggle_street_satellite));
menu.add(0, 3,0, R.string.map_menu_back_to_list);
return supRetVal;
}
 
 
 
 
@Override
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case 0:
// Zoom not closer than possible
this.mc.setZoom(Math.min(21, map.getZoomLevel() + 1));
// map.displayZoomControls(true);
return true;
case 1:
// Zoom not farer than possible
this.mc.setZoom(Math.max(1, map.getZoomLevel() - 1));
return true;
case 2:
// Switch to satellite view
map.setSatellite(!map.isSatellite());
return true;
case 3:
this.finish();
return true;
}
return false;
}
 
 
AndroidMKCommunicator mk;
 
 
public void run()
{
/*
int i=0;
while(true)
{
try {
 
this.setTitle("UBATT:no");
this.setTitle("UBATT:" + mk.UBatt() + " stats:" + mk.stats.debug_data_count + "--" + i);
i++;
// Thread.sleep(1000);
 
this.setTitle("UBATT2:" + mk.UBatt() + " stats:" + mk.stats.debug_data_count + "--" + i);
}
 
catch (Exception e)
{
this.setTitle(e.toString());
}
}
 
*/
}
 
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
 
this.setTitle("UBATT2:" + mk.UBatt() + " stats:" + mk.stats.version_data_count + "--" );
return true;
}
 
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 
map=new MapView(this,MapKey);
map.setClickable(true);
 
 
//////////////////////////////////////////////////////////////////////////////this.overlay = this.map.createOverlayController();
 
 
 
mc = map.getController();
//mc.setZoom(20);
setContentView(map);
 
mk=new AndroidMKCommunicator(this
);
 
// this.setTitle("test");
//
new Thread( this ).start(); // fire up main Thread
}
 
@Override
protected void onDestroy()
{
mk.close_connections(true);
mk=null;
super.onDestroy();
 
}
 
@Override
protected boolean isRouteDisplayed() {
return false;
}
 
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/DUBwiseMapView.java
0,0 → 1,17
package org.ligi.android;
 
import com.google.android.maps.MapView;
 
import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;
import java.util.Map;
 
public class DUBwiseMapView extends MapView
{
 
 
public DUBwiseMapView (Context context,String api_key) {
super(context,api_key);
}
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/DUBwiseStatusVoice.java
0,0 → 1,114
/**************************************
*
* Voice output
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
*
**************************************/
 
package org.ligi.android;
 
import android.media.*;
import android.media.MediaPlayer.*;
 
import org.ligi.ufo.*;
 
public class DUBwiseStatusVoice
implements Runnable
//,OnCompletionListener
{
 
MKCommunicator mk=null;
DUBwise root=null;
MediaPlayer player;
public final int PLAYERSTATE_IDLE=0;
public final int PLAYERSTATE_PLAYING=1;
public final int PLAYERSTATE_FIN=2;
 
int act_player_state=PLAYERSTATE_IDLE;
 
int last_sound=-1;
 
public DUBwiseStatusVoice(DUBwise _root)
{
 
root=_root;
 
new Thread( this ).start(); // fire up main Thread
}
 
public void start_playing(int resid)
{
last_sound=resid;
try {
player=MediaPlayer.create(root, R.raw.voice_sample_01-1+resid);
 
player.start();
 
}
catch (Exception e) {
}
 
}
 
public void wait_for_end()
{
while (player.isPlaying())
{
try { Thread.sleep(50); }
catch (Exception e) { }
}
try { Thread.sleep(50); }
catch (Exception e) { }
player.stop();
player.release();
 
player=null;
 
System.gc();
try { Thread.sleep(150); }
catch (Exception e) { }
}
 
public void run()
{
while(true)
{
 
if (root.mk.connected&&(root.do_sound)&&(root.mk.debug_data.UBatt()!=-1)&&(!root.mk.force_disconnect))
{
int ubatt=root.mk.debug_data.UBatt();
 
start_playing( (ubatt/10));
wait_for_end();
 
if((ubatt%10)!=0)
{
start_playing( 14);
wait_for_end();
start_playing((ubatt%10));
wait_for_end();
}
start_playing(15);
wait_for_end();
}
 
try { Thread.sleep(5000); }
catch (Exception e) { }
}
}
 
}
 
/DUBwise/tags/v0.52/android/src/org/ligi/android/DUBwiseUIDefinitions.java
0,0 → 1,71
package org.ligi.android;
 
public interface DUBwiseUIDefinitions
{
// id for each state - must just be uniq - order isnt important
public final static byte STATEID_SCANNING =0;
public final static byte STATEID_DEVICESELECT =1;
public final static byte STATEID_MAINMENU =2;
public final static byte STATEID_MOTORTEST =3;
public final static byte STATEID_SELECT_PARAMSET =4;
public final static byte STATEID_EDIT_PARAMS =5;
public final static byte STATEID_HANDLE_PARAMS =6;
public final static byte STATEID_FLIGHTVIEW =7;
public final static byte STATEID_RAWDEBUG =8;
public final static byte STATEID_KEYCONTROL =9;
public final static byte STATEID_SETTINGSMENU =10;
public final static byte STATEID_STICKVIEW =11;
public final static byte STATEID_CAMMODE =12;
public final static byte STATEID_READ_PARAMS =13;
public final static byte STATEID_GPSVIEW =14;
public final static byte STATEID_FILEOPEN =15;
public final static byte STATEID_GRAPH =16;
public final static byte STATEID_CONN_DETAILS =17;
public final static byte STATEID_IPINPUT =18;
public final static byte STATEID_PROXY =19;
public final static byte STATEID_TRAFFIC =20;
public final static byte STATEID_SELECT_COMPORT =21;
public final static byte STATEID_ABOUT =22;
public final static byte STATEID_NC_ERRORS =23;
public final static byte STATEID_FLASHING =24;
public final static byte STATEID_NAMEINPUT =25;
public final static byte STATEID_DATABUFF =26;
 
 
 
public final static int MAINMENU_TELEMETRY =0;
public final static int MAINMENU_RAWDEBUG =1+MAINMENU_TELEMETRY;
public final static int MAINMENU_STICKS =1+MAINMENU_RAWDEBUG;
public final static int MAINMENU_KEYCONTROL =1+MAINMENU_STICKS;
public final static int MAINMENU_MOTORTEST =1+MAINMENU_KEYCONTROL;
public final static int MAINMENU_PARAMS =1+MAINMENU_MOTORTEST;
public final static int MAINMENU_SETTINGSMENU =1+MAINMENU_PARAMS;
public final static int MAINMENU_CAMMODE =1+MAINMENU_SETTINGSMENU;
public final static int MAINMENU_PROXY =1+MAINMENU_CAMMODE;
public final static int MAINMENU_DEVICESELECT =1+MAINMENU_PROXY;
public final static int MAINMENU_QUIT =1+MAINMENU_DEVICESELECT;
 
public String[] main_menu_items={"Telemetry","Raw Debug-Values", "RC-Data", "pilot UFO", "Motor Test" , "Flight Settings","(NA)Tool Settings","(NA)Remote Camera","(NA)Relay","(NA)Change Device" , "Quit " };
 
 
public final static String[] settings_menu_items={"Skin ","Sound ","Vibra " ,"Scrolling BG ","FullScreen " , "Back" };
 
 
 
// public String[] settings_menu_items={"Skin ","Sound ","Vibra " ,"Graph ","FullScreen " ,"Keep BGLight " ,"Back" };
public final static int SETTINGSMENU_CHANGESKIN =0;
public final static int SETTINGSMENU_SOUNDTOGGLE =1;
public final static int SETTINGSMENU_VIBRATOGGLE =2;
public final static int SETTINGSMENU_GRAPHTOGGLE =3;
public final static int SETTINGSMENU_FULLSCREENTOGGLE =4;
public final static int SETTINGSMENU_LIGHTTOGGLE =5;
public final static int SETTINGSMENU_BACK =6;
 
 
 
 
 
 
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/DUBwiseView.java
0,0 → 1,663
package org.ligi.android;
 
 
import android.app.Activity;
import android.os.Bundle;
 
import android.app.Activity;
import android.os.Bundle;
 
import android.view.View;
import android.widget.TextView;
 
 
import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.os.*;
import android.view.View;
import android.util.Log;
import android.media.*;
import java.util.Random;
import java.net.*;
import java.io.*;
 
 
import android.view.*;
 
import android.graphics.Region.Op;
import android.graphics.Bitmap.*;
 
// not working atm - import org.bluez.*;
import org.ligi.ufo.*;
public class DUBwiseView
extends View
implements DUBwiseDefinitions,DUBwiseUIDefinitions
{
 
 
int state=0;
 
 
int state_intro_frame=0;
 
boolean do_sound=true;
boolean do_vibra=true;
boolean do_graph=true;
boolean menu_active=true;
 
public final int SKINID_DARK=0;
public final int SKINID_LIGHT=0;
int act_skin=0;
boolean keep_lighton=true;
 
private Paint mPaint = new Paint();
 
// chars in bitmap
public static int LCD_CHAR_COUNT=222;
 
// some images we need
private Bitmap icon_img,bg_img,lcd_tiles_img,bt_on_img,bt_off_img;
private Bitmap lcd_img=null;
// pos for scrolling
private int pos=0;
 
String str1="";
String[] lcd_lines;
String[] menu_items;
long last_run=0;
int last_key=0;
 
 
int auto_next_state=-1;
 
int wi,he;
// Activity context;
 
DUBwise root;
MKParamEditor param_editor;
// Activity root;
int lcd_top;
int act_menu_select=0;
int[] motortest_vals={0,0,0,0};
 
public DUBwiseView(DUBwise context) {
super(context);
root=context;
param_editor=new MKParamEditor(root);
chg_state_(STATEID_MAINMENU);
 
// needed to get Key Events
setFocusable(true);
 
 
}
 
 
public void chg_state(int next_state)
{
auto_next_state=next_state;
}
 
public void chg_state_(int next_state)
{
auto_next_state=-1;
menu_active=false;
state_intro_frame=0;
if (next_state!=state)act_menu_select=0;
// prepare next state
switch(next_state)
{
case STATEID_STICKVIEW:
// root.mk.user_intent=USER_INTENT_RCDATA;
break;
case STATEID_FLIGHTVIEW:
//root.mk.user_intent=USER_INTENT_LCD;
break;
case STATEID_EDIT_PARAMS:
lcd_lines=param_editor.public_lcd_lines;
calc_lcd();
break;
 
case STATEID_HANDLE_PARAMS:
menu_items=new String[2];
menu_items[0]="write to MK";
menu_items[1]="Discard";
lcd_lines=new String[2];
 
break;
 
case STATEID_SELECT_PARAMSET:
menu_items=new String[5];
for (int i=0;i<5;i++)
menu_items[i]=root.mk.params.names[i];
 
lcd_lines=new String[5];
break;
 
case STATEID_MAINMENU:
menu_active=true;
menu_items=main_menu_items;
lcd_lines=new String[menu_items.length];
for (int y=0;y<main_menu_items.length;y++)
lcd_lines[y]=" " + main_menu_items[y];
break;
 
case STATEID_SETTINGSMENU:
menu_items=new String[settings_menu_items.length];
for(int cnt=0;cnt<settings_menu_items.length;cnt++)
menu_items[cnt]=settings_menu_items[cnt];
 
menu_items[0]+=(act_skin==SKINID_DARK)?"Dark":"Light";
menu_items[1]+=(!do_sound)?"Off":"On";
menu_items[2]+=(!do_vibra)?"Off":"On";
menu_items[3]+=(!do_graph)?"Off":"On";
menu_items[4]+=(!root.fullscreen)?"Off":"On";
menu_items[5]+=(!keep_lighton)?"Off":"On";
 
lcd_lines=new String[menu_items.length];
break;
 
}
// switch state
if (lcd_img!=null)calc_lcd();
state=next_state;
}
 
public Bitmap resize_to_screen(Bitmap orig,float x_scale_,float y_scale_)
{
// createa matrix for the manipulation
Matrix matrix = new Matrix();
float x_scale,y_scale;
if (y_scale_!=0f)
y_scale= (getHeight()*y_scale_ )/orig.getHeight();
else // take x_scale
y_scale=(getWidth()*x_scale_ )/orig.getWidth();
 
if (x_scale_!=0f)
x_scale= (getWidth()*x_scale_ )/orig.getWidth();
else
x_scale= (getHeight()*y_scale_ )/orig.getHeight();
 
matrix.postScale(x_scale , y_scale);
return Bitmap.createBitmap(orig, 0, 0,(int)( orig.getWidth()),(int)( orig.getHeight()), matrix,true);//BitmapContfig.ARGB_8888 );
}
 
 
public boolean onKeyDown(int keyCode, KeyEvent event)
{
 
if ( keyCode==KeyEvent.KEYCODE_BACK)
{
if ( state==STATEID_MAINMENU)
root.finish();
else
chg_state(STATEID_MAINMENU);
}
switch (state)
{
case STATEID_EDIT_PARAMS:
param_editor.keypress(keyCode,keyCode);
lcd_lines=param_editor.public_lcd_lines;
calc_lcd();
break;
case STATEID_MAINMENU:
switch ( keyCode)
{
case KeyEvent.KEYCODE_DPAD_DOWN :
act_menu_select++;
break;
case KeyEvent.KEYCODE_DPAD_UP :
act_menu_select--;
break;
 
case KeyEvent.KEYCODE_DPAD_CENTER :
menu_reaction();
break;
}
break;
case STATEID_FLIGHTVIEW:
switch ( keyCode)
{
 
case KeyEvent.KEYCODE_DPAD_DOWN :
root.mk.LCD.LCD_NEXTPAGE();
lcd_lines=root.mk.LCD.get_act_page();
 
break;
case KeyEvent.KEYCODE_DPAD_UP :
root.mk.LCD.LCD_PREVPAGE();
lcd_lines=root.mk.LCD.get_act_page();
 
break;
 
}
calc_lcd();
break;
}
 
// last_key=keyCode;
// if(lcd_img!=null)
calc_lcd();
invalidate();
return true;
}
 
public void menu_reaction()
{
switch (act_menu_select)
{
case MAINMENU_PARAMS:
chg_state(STATEID_EDIT_PARAMS);
break;
 
case MAINMENU_STICKS:
chg_state(STATEID_STICKVIEW);
break;
 
case MAINMENU_TELEMETRY:
chg_state(STATEID_FLIGHTVIEW);
// root.setContentView(new DUBwiseMapView(root));
break;
case MAINMENU_RAWDEBUG:
chg_state(STATEID_RAWDEBUG);
break;
 
case MAINMENU_KEYCONTROL:
chg_state(STATEID_KEYCONTROL);
break;
 
 
case MAINMENU_MOTORTEST:
// root.mk.motor_test( motortest_vals);
chg_state(STATEID_MOTORTEST);
break;
 
case MAINMENU_QUIT:
root.mk.close_connections(true);
root.quit();
break;
}
}
 
 
 
 
int flight_x,flight_y;
 
@Override public boolean onTouchEvent(MotionEvent event) {
 
 
if ((event.getAction() ==MotionEvent.ACTION_UP)&&(event.getY()<bt_on_img.getHeight()))
{
if ( state==STATEID_MAINMENU)
root.finish();
else
chg_state(STATEID_MAINMENU);
}
 
switch(state)
{
case STATEID_KEYCONTROL:
if (event.getAction() ==MotionEvent.ACTION_UP)
{
flight_x=getWidth()/2-getWidth()/8;
flight_y=getHeight()/2-getWidth()/8;
}
else
{
if(new RectF(getWidth()/8,(getHeight()-getWidth())/2-getWidth()/8,getWidth()-getWidth()/8,getHeight()-getWidth()/8).contains(event.getX(),event.getY()))
{
flight_x=(int)event.getX();
flight_y=(int)event.getY();
 
}
}
break;
case STATEID_MAINMENU:
if ((event.getAction() ==MotionEvent.ACTION_DOWN)||(event.getAction() ==MotionEvent.ACTION_MOVE))
{
if (event.getY()>lcd_top)
{
act_menu_select=(int)((event.getY()-lcd_top)/lcd_tiles_img.getHeight());
calc_lcd();
}
}
if (event.getAction() ==MotionEvent.ACTION_UP)
{
if (event.getY()>lcd_top)
{
act_menu_select=(int)((event.getY()-lcd_top)/lcd_tiles_img.getHeight());
menu_reaction();
}
}
calc_lcd();
break;
 
 
case STATEID_MOTORTEST:
if (new RectF(getWidth()/2 - getWidth()/8,getHeight()/2 -getWidth()/8 - (getWidth()/2 - getWidth()/8),getWidth()/2 + getWidth()/8,getHeight()/2 -getWidth()/8).contains(event.getX(),event.getY()))
motortest_vals[0]= (int)(event.getY()-getHeight()/2+getWidth()/8)*(-1)-5;
 
if (new RectF(getWidth()/2 - getWidth()/8,getHeight()/2 + getWidth()/8,getWidth()/2 + getWidth()/8,getHeight()/2+getWidth()/8 + (getWidth()/2 - getWidth()/8)).contains(event.getX(),event.getY()))
motortest_vals[1]= (int)(event.getY()-getHeight()/2-getWidth()/8)-5;
// left
if (new RectF(0,getHeight()/2 - getWidth()/8,getWidth()/2 - getWidth()/8,getHeight()/2+getWidth()/8).contains(event.getX(),event.getY()))
motortest_vals[2]= (int)(event.getX()-getWidth()/2+getWidth()/8)*(-1)-5;
if (new RectF(getWidth()/2+getWidth()/8,getHeight()/2 - getWidth()/8,getWidth(),getHeight()/2+getWidth()/8).contains(event.getX(),event.getY()))
motortest_vals[3]= (int)(event.getX()-getWidth()/2-getWidth()/8)-5;
 
for (int tmp=0;tmp<4;tmp++)
if (motortest_vals[tmp]<0)motortest_vals[tmp]=0;
 
root.mk.motor_test( motortest_vals);
break;
}
 
 
return true;
 
}
 
 
 
 
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh)
{
 
bg_img = resize_to_screen(BitmapFactory.decodeResource(getResources(), R.drawable.starfield),0f,1f);
lcd_tiles_img = resize_to_screen(BitmapFactory.decodeResource(getResources(), R.drawable.lcd_green),0.05f*LCD_CHAR_COUNT,0f);
icon_img = resize_to_screen(BitmapFactory.decodeResource(getResources(), R.drawable.icon),0.15f,0f);
 
bt_off_img = resize_to_screen(BitmapFactory.decodeResource(getResources(), R.drawable.bt_off),0.06f,0f);
bt_on_img = resize_to_screen(BitmapFactory.decodeResource(getResources(), R.drawable.bt_on),0.06f,0f);
calc_lcd();
 
}
 
 
public void calc_lcd()
{
 
lcd_top=getHeight()-lcd_lines.length*lcd_tiles_img.getHeight();
Paint paint = mPaint;
lcd_img= Bitmap.createBitmap(getWidth(),lcd_lines.length*lcd_tiles_img.getHeight()+100,Bitmap.Config.ARGB_8888);
Canvas lcd_canvas=new Canvas();
 
lcd_canvas.setBitmap(lcd_img);
lcd_canvas.drawColor(Color.WHITE);
int char_width=(int)(lcd_tiles_img.getWidth()/LCD_CHAR_COUNT);
for ( int lcd_line=0 ; lcd_line < lcd_lines.length ; lcd_line++)
for (int char_pos=0;char_pos<20;char_pos++)
{
int act_char=0;
if (char_pos<lcd_lines[lcd_line].length())
act_char=lcd_lines[lcd_line].charAt(char_pos)-32;
if ((menu_active)&&(act_menu_select==lcd_line)&& (char_pos==0))
act_char=30;
lcd_canvas.clipRect(new RectF(char_pos*char_width,lcd_tiles_img.getHeight()*lcd_line,(char_pos+1)*char_width,lcd_tiles_img.getHeight()*(lcd_line+1)),Op.REPLACE );
lcd_canvas.drawBitmap(lcd_tiles_img,(char_pos-act_char)*(char_width),lcd_tiles_img.getHeight()*(lcd_line) , paint);
 
}
}
boolean init_bootloader;
int user_intent;
// fixme -> put in own timed thread - not in draw invalidate loop
public void tick()
{
pos--;
pos%=bg_img.getWidth();
//SystemClock.sleep(50);
if (auto_next_state==-1)
switch(state)
{
case STATEID_FLIGHTVIEW:
// root.mk.trigger_debug_data();
lcd_lines=root.mk.LCD.get_act_page();
calc_lcd();
if (state_intro_frame<200)
state_intro_frame+=5;
break;
case STATEID_EDIT_PARAMS:
 
case STATEID_MAINMENU:
if (state_intro_frame<200)
state_intro_frame+=5;
break;
 
case STATEID_RAWDEBUG:
case STATEID_MOTORTEST:
if (state_intro_frame<150)
state_intro_frame+=5;
break;
case STATEID_KEYCONTROL:
case STATEID_STICKVIEW:
if (state_intro_frame<100)
state_intro_frame+=3;
break;
}
else
{
if (state_intro_frame>10)
state_intro_frame-=7;
else
{
state_intro_frame=0;
chg_state_(auto_next_state);
}
 
}
}
 
 
@Override protected void onDraw(Canvas canvas) {
 
 
tick();
 
Paint paint = mPaint;
paint.setAntiAlias(true);
 
paint.setARGB(255,0,0,0);
canvas.drawBitmap(bg_img,pos,0 , paint);
 
if ((bg_img.getWidth()+pos)<(getWidth()))
canvas.drawBitmap(bg_img,pos+bg_img.getWidth(),0 , paint);
 
 
switch ( state )
{
case STATEID_EDIT_PARAMS:
case STATEID_FLIGHTVIEW:
 
paint.setARGB(state_intro_frame ,0,0,0);
canvas.drawBitmap(lcd_img,0,lcd_top , paint);
break;
 
case STATEID_MOTORTEST:
 
paint.setARGB(state_intro_frame,100,100,100);
 
 
//front
 
canvas.drawRoundRect(new RectF(getWidth()/2 - getWidth()/8,getHeight()/2 -getWidth()/8 - (getWidth()/2 - getWidth()/8),getWidth()/2 + getWidth()/8,getHeight()/2 -getWidth()/8),5,5,paint);
 
// back
canvas.drawRoundRect(new RectF(getWidth()/2 - getWidth()/8,getHeight()/2 + getWidth()/8,getWidth()/2 + getWidth()/8,getHeight()/2+getWidth()/8 + (getWidth()/2 - getWidth()/8)),5,5,paint);
 
// left
canvas.drawRoundRect(new RectF(0,getHeight()/2 - getWidth()/8,getWidth()/2 - getWidth()/8,getHeight()/2+getWidth()/8),5,5,paint);
 
canvas.drawRoundRect(new RectF(getWidth()/2+getWidth()/8,getHeight()/2 - getWidth()/8,getWidth(),getHeight()/2+getWidth()/8),5,5,paint);
 
 
paint.setARGB(100,30,30,255);
 
canvas.drawRoundRect(new RectF(getWidth()/2 - getWidth()/8,getHeight()/2 -getWidth()/8 - motortest_vals[0],getWidth()/2 + getWidth()/8,getHeight()/2 -getWidth()/8),5,5,paint);
 
// back
canvas.drawRoundRect(new RectF(getWidth()/2 - getWidth()/8,getHeight()/2 + getWidth()/8,getWidth()/2 + getWidth()/8,getHeight()/2+getWidth()/8 + motortest_vals[1]),5,5,paint);
 
// left
canvas.drawRoundRect(new RectF(getWidth()/2-getWidth()/8- motortest_vals[2],getHeight()/2 - getWidth()/8,getWidth()/2 - getWidth()/8,getHeight()/2+getWidth()/8),5,5,paint);
 
canvas.drawRoundRect(new RectF(getWidth()/2+getWidth()/8,getHeight()/2 - getWidth()/8,getWidth()/2+getWidth()/8+ motortest_vals[3],getHeight()/2+getWidth()/8),5,5,paint);
 
 
paint.setARGB(state_intro_frame+70,0,250,0);
paint.setTextAlign(Paint.Align.CENTER);
 
canvas.drawText("Front:"+ motortest_vals[0],getWidth()/2 ,getHeight()/2 -getWidth()/8-10,paint);
 
canvas.drawText("Back:"+ motortest_vals[1],getWidth()/2 ,getHeight()/2 +getWidth()/8+15,paint);
 
canvas.drawText("Left:"+ motortest_vals[2],getWidth()/4 ,getHeight()/2 ,paint);
canvas.drawText("Right:"+ motortest_vals[3],3*getWidth()/4 ,getHeight()/2 ,paint);
break;
 
case STATEID_RAWDEBUG:
paint.setARGB(state_intro_frame,50,50,200);
 
for(int y_p=0;y_p<16;y_p++)
canvas.drawRoundRect(new RectF(0,(getHeight()/32)*y_p*2,getWidth(),(getHeight()/32)*(y_p*2+1)),5,5,paint);
 
 
 
paint.setARGB(state_intro_frame,0,250,0);
for(int y_p=0;y_p<32;y_p++)
{
canvas.drawText( root.mk.debug_data.names[y_p],0,(getHeight()/32)*(y_p+1)-2,paint);
canvas.drawText( ""+root.mk.debug_data.analog[y_p],getWidth()/3,(getHeight()/32)*(y_p+1)-2,paint);
}
 
 
 
 
break;
 
case STATEID_KEYCONTROL:
canvas.rotate((root.mk.debug_data.analog[18]*(-90))/3000,getWidth()/2,getHeight()/2);
paint.setARGB(state_intro_frame,177,129,0);
// roll rect
canvas.drawRect(-getWidth(),getHeight()/2,2*getWidth(),3*getHeight()/2,paint);
 
int bar_height=20;
// nick rect
paint.setARGB(state_intro_frame,0,200,0);
canvas.drawRoundRect(new RectF(getWidth()/3,getHeight()/2 -bar_height/2 + root.mk.debug_data.analog[17]*getHeight()/(3*3000) ,2*getWidth()/3, getHeight()/2+ root.mk.debug_data.analog[17]*getHeight()/(3*3000)+bar_height),5,5,paint);
 
 
 
canvas.restore();
 
paint.setARGB(state_intro_frame,0,0,255);
// canvas.drawRoundRect(new RectF(getWidth()/2-getWidth()/8,getHeight()/2-getWidth()/8,getWidth()/2+getWidth()/8,getHeight()/2+getWidth()/8),5,5,paint);
 
canvas.drawRoundRect(new RectF(flight_x,flight_y,flight_x+getWidth()/8,flight_y+getWidth()/8),5,5,paint);
paint.setARGB(255,0,0,0);
break;
 
case STATEID_STICKVIEW:
paint.setARGB(state_intro_frame,50,50,200);
for(int y_p=0;y_p<10;y_p++)
canvas.drawRoundRect(new RectF(getWidth()/3 +((root.mk.stick_data.stick[y_p]<0)?(((root.mk.stick_data.stick[y_p]*getWidth()/3)/127)):0) ,(getHeight()/10)*y_p,getWidth()-getWidth()/3+((root.mk.stick_data.stick[y_p]>0)?(((root.mk.stick_data.stick[y_p]*getWidth()/3)/127)):0) ,(getHeight()/10)*(y_p+1)),15,15,paint);
paint.setARGB(state_intro_frame*2+50,0,255,0);
paint.setTextAlign(Paint.Align.CENTER);
for(int y_p=0;y_p<10;y_p++)
canvas.drawText("Chan " + (y_p+1) + "("+root.mk.stick_data.stick[y_p]+")",getWidth()/2,(getHeight()/20)*(y_p*2+1),paint);
paint.setTextAlign(Paint.Align.LEFT);
 
 
canvas.drawText("RC-Signal: " + root.mk.debug_data.SenderOkay(),0,10,paint);
break;
 
case STATEID_MAINMENU:
paint.setARGB(state_intro_frame ,0,0,0);
canvas.drawBitmap(lcd_img,0,lcd_top , paint);
 
int spacer=15;
int y_pos=10;
paint.setColor(Color.GREEN);
// canvas.drawText("LastKeyCode:"+last_key,0,10,paint);
paint.setTextAlign(Paint.Align.LEFT);
if (root.mk.connected)
{
canvas.drawText("Connected to MK with Version:"+root.mk.version.major+"."+root.mk.version.minor,0,y_pos,paint);
y_pos+=spacer;
canvas.drawText(" Power Source: " +( root.mk.debug_data.UBatt()/10) + "." + ( root.mk.debug_data.UBatt()%10) + " Volts | RC-Signal: " + root.mk.debug_data.SenderOkay(),0,y_pos,paint);
y_pos+=spacer;
canvas.drawText(" debug:"+root.mk.stats.debug_data_count+ " LCD:" + root.mk.stats.lcd_data_count + "(Pages:" + root.mk.LCD.pages + ") vers:" + root.mk.stats.version_data_count,0,y_pos,paint);
y_pos+=spacer;
canvas.drawText(" other:"+root.mk.stats.other_data_count+" params:"+root.mk.stats.params_data_count,0,y_pos,paint);
}
else
{
canvas.drawText("No QuadroKopter Communication established.",0,y_pos,paint);
y_pos+=spacer;
}
break;
}
 
 
 
paint.setARGB(255,255,255,255);
// icon indicating QC is connected
// !!FIXME!! -10 by screensize
canvas.drawBitmap(icon_img,getWidth()-icon_img.getWidth(),-10 , paint);
if (root.mk.ready())
canvas.drawBitmap(bt_on_img,getWidth()-icon_img.getWidth()-bt_on_img.getWidth()-5,5 , paint);
else
canvas.drawBitmap(bt_off_img,getWidth()-icon_img.getWidth()-bt_on_img.getWidth()-5,5 , paint);
 
 
paint.setARGB(255,0,0,0);
invalidate();
}
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/FlightSettingsActivity.java
0,0 → 1,97
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
import android.view.ViewGroup.*;
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.*;
import android.widget.*;
 
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.ArrayAdapter;
 
 
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.*;
 
import org.ligi.ufo.*;
 
public class FlightSettingsActivity extends Activity
// extends ListActivity
 
{
 
String[] menu_items = new String[]{"Stick","Navi"};
 
 
 
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent i=new Intent(this, FlightSettingsSettingSelect.class);
i.putExtra("items",menu_items);
 
startActivityForResult(i,0);
}
@Override
protected void onActivityResult(int requestCode,int resultCode, Intent intent)
{
if ( resultCode!=RESULT_CANCELED)
{
Bundle extras = intent.getExtras();
if (extras!=null)
{
LinearLayout lin = new LinearLayout(this);
lin.setOrientation(LinearLayout.VERTICAL);
LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT);
TextView t1 = new TextView(this);
t1.setText("Here is the first textbox" + extras.getInt("pos"));
lin.addView(t1, params);
setContentView(lin);
}
}
else
finish();
}
 
 
 
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/FlightSettingsSettingSelect.java
0,0 → 1,122
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
import android.view.ViewGroup.*;
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.*;
import android.widget.*;
 
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.ArrayAdapter;
 
 
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.*;
 
import org.ligi.ufo.*;
 
public class FlightSettingsSettingSelect extends ListActivity
{
 
// String[] menu_items = new String[]{"Stick","Navi"};
 
 
@Override
protected void onCreate(Bundle savedInstanceState) {
Bundle extras = getIntent().getExtras();
 
// Bundle extras = intent.getExtras();
 
String[] menu_items=extras.getStringArray("items");
super.onCreate(savedInstanceState);
//setContentView(R.layout.motortest);
 
this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, menu_items));
// setContentView(list_act);
 
 
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id){
super.onListItemClick(l, v, position, id);
// Get the item that was clicked
Object o = this.getListAdapter().getItem(position);
//String keyword = o.toString();
 
Intent mIntent = new Intent();
mIntent.putExtra("pos",position);
setResult(RESULT_OK, mIntent);
finish();
 
 
 
// Create an VIEW intent
try {
switch(position)
{
case 0:
/*
// ListActivity Lis= new ListActivity(this);
is_list=false;
LinearLayout lin = new LinearLayout(this);
lin.setOrientation(LinearLayout.VERTICAL);
LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT);
TextView t1 = new TextView(this);
t1.setText("Here is the first textbox");
lin.addView(t1, params);
setContentView(lin);
*/
break;
}
} catch (Exception e) {
e.printStackTrace();
}
// Start the activity
}
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/MKParamEditor.java
0,0 → 1,205
/**************************************************
*
* class to handle Editing of MK Params
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
*************************************************/
 
package org.ligi.android;
 
import android.view.*;
 
import org.ligi.ufo.*;
 
public class MKParamEditor
implements MKParamDefinitions
{
 
 
private int act_tab=0;
private int act_y=0;
private int act_lcd_lines=10;
 
DUBwise root;
 
public String[] lcd_lines;
 
public String[] public_lcd_lines;
public MKParamEditor(DUBwise _root)
{
root=_root;
lcd_lines=new String[40];
// refresh_lcd();
}
/*
public void paint ( Graphics g)
{
refresh_lcd();
canvas.paint_lcd(g,false);
}
*/
public void refresh_lcd()
{
// try
{
 
if (root.mk!=null)
{
act_lcd_lines=root.mk.params.field_names[act_tab].length*2+1;
for ( int i=0;i<act_lcd_lines;i++)
lcd_lines[i]="";
 
 
try
{
 
lcd_lines[0]=(act_tab==0?" ":"< ") + root.mk.params.tab_names[act_tab] + (act_tab==(root.mk.params.tab_names.length-1)?" ":" >");
 
for (int i=0;i<root.mk.params.field_names[act_tab].length;i++)
{
lcd_lines[1+2*i]=root.mk.params.field_names[act_tab][i];
if (root.mk.params.field_types[act_tab][i]== root.mk.params.PARAMTYPE_BITSWITCH)
lcd_lines[2+2*i]=(((root.mk.params.get_field_from_act(root.mk.params.field_positions[act_tab][i]/8)&(1<<root.mk.params.field_positions[act_tab][i]%8))==0)?"off":"on" ) ;
if (root.mk.params.field_types[act_tab][i]== root.mk.params.PARAMTYPE_BYTE)
{
lcd_lines[2+2*i]=""+root.mk.params.get_field_from_act(root.mk.params.field_positions[act_tab][i]);
if ((root.mk.params.get_field_from_act(root.mk.params.field_positions[act_tab][i])>250)&&(root.mk.params.get_field_from_act(root.mk.params.field_positions[act_tab][i])<256))
lcd_lines[2+2*i]+="[Poti"+(root.mk.params.get_field_from_act(root.mk.params.field_positions[act_tab][i])-250) +"]";
}
 
if (root.mk.params.field_types[act_tab][i]== root.mk.params.PARAMTYPE_STICK)
{
lcd_lines[2+2*i]=""+root.mk.params.get_field_from_act(root.mk.params.field_positions[act_tab][i]);
}
 
 
}
for (int i=0;i<act_lcd_lines;i++)
{
lcd_lines[i]=(act_y==i?"#":" ")+lcd_lines[i];
}
 
for ( int i=0;i<act_lcd_lines;i++)
while(lcd_lines[i].length()<20)
{
lcd_lines[i]+=" ";
}
}
catch (Exception e){}
public_lcd_lines=new String[act_lcd_lines];
for(int i=0;i<act_lcd_lines;i++)
public_lcd_lines[i]=lcd_lines[i];
}
else
{
public_lcd_lines=new String[1];
public_lcd_lines[0]="reading params";
}
 
}
// catch (Exception e){}
}
 
 
public final static int KEYCODE_CLEAR=-8;
public boolean editing_number=false;
 
public void keypress (int keyCode,int action)
{
if (act_y==0) switch (action)
{
case KeyEvent.KEYCODE_DPAD_RIGHT:
if (act_tab<root.mk.params.tab_names.length-1) act_tab++;
break;
 
case KeyEvent.KEYCODE_DPAD_LEFT:
if (act_tab!=0) act_tab--;
break;
}
else
{
if(root.mk.params.field_types[act_tab][act_y/2-1]==root.mk.params.PARAMTYPE_BYTE)
{
if ((keyCode >=KeyEvent.KEYCODE_0) && (keyCode <=KeyEvent.KEYCODE_9))
{
if((editing_number)&&( Math.abs(root.mk.params.get_field_from_act(root.mk.params.field_positions[act_tab][act_y/2-1]))*10+(keyCode -KeyEvent.KEYCODE_0)<1000))
root.mk.params.set_field_from_act(root.mk.params.field_positions[act_tab][act_y/2-1] , Math.abs(root.mk.params.get_field_from_act(root.mk.params.field_positions[act_tab][act_y/2-1]))*10+(keyCode -KeyEvent.KEYCODE_0));
else
root.mk.params.set_field_from_act(root.mk.params.field_positions[act_tab][act_y/2-1] , (keyCode -KeyEvent.KEYCODE_0));
editing_number=true;
return;
}
else
if ( keyCode==KEYCODE_CLEAR)
root.mk.params.set_field_from_act(root.mk.params.field_positions[act_tab][act_y/2-1],0);
}
editing_number=false;
switch (action)
{
case KeyEvent.KEYCODE_DPAD_RIGHT:
switch(root.mk.params.field_types[act_tab][act_y/2-1])
{
case PARAMTYPE_BITSWITCH:
root.mk.params.field_from_act_xor((root.mk.params.field_positions[act_tab][act_y/2-1]/8),1<<(root.mk.params.field_positions[act_tab][act_y/2-1]%8));
break;
case PARAMTYPE_BYTE:
case PARAMTYPE_STICK:
root.mk.params.field_from_act_add(root.mk.params.field_positions[act_tab][act_y/2-1],1);
break;
}
break;
case KeyEvent.KEYCODE_DPAD_LEFT:
switch(root.mk.params.field_types[act_tab][act_y/2-1])
{
case PARAMTYPE_BITSWITCH:
root.mk.params.field_from_act_xor((root.mk.params.field_positions[act_tab][act_y/2-1]/8),1<<(root.mk.params.field_positions[act_tab][act_y/2-1]%8));
break;
case PARAMTYPE_BYTE:
case PARAMTYPE_STICK:
root.mk.params.field_from_act_add(root.mk.params.field_positions[act_tab][act_y/2-1],-1);
break;
}
break;
}
}
switch (action)
{
 
case KeyEvent.KEYCODE_DPAD_DOWN:
if (act_y<(act_lcd_lines-2)) act_y+=2;
else act_y=0;
break;
 
case KeyEvent.KEYCODE_DPAD_UP :
if (act_y!=0) act_y-=2;
else act_y=act_lcd_lines-1;
break;
}
 
refresh_lcd();
 
 
}
}
 
/DUBwise/tags/v0.52/android/src/org/ligi/android/MapKey.java.skeleton
0,0 → 1,8
package org.ligi.android;
 
public interface MapKey
{
 
public final String MapKey=INSERT_YOUR_MAP_API_KEY;
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/MotorTestActivity.java
0,0 → 1,138
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
 
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.*;
import android.content.DialogInterface;
import android.content.Context.*;
import android.widget.EditText;
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.SharedPreferences;
 
import org.ligi.ufo.*;
 
public class MotorTestActivity extends Activity
implements SeekBar.OnSeekBarChangeListener
{
 
SeekBar seek_right,seek_left,seek_front,seek_back,seek_all;
CheckBox full_speed;
boolean toasted=false;
 
AndroidMKCommunicator mk;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 
mk= new AndroidMKCommunicator(this);
setContentView(R.layout.motortest);
 
seek_right=(SeekBar)findViewById( R.id.seek_right);
seek_left=(SeekBar)findViewById( R.id.seek_left);
seek_front=(SeekBar)findViewById( R.id.seek_front);
seek_back=(SeekBar)findViewById( R.id.seek_back);
seek_all=(SeekBar)findViewById( R.id.seek_all);
full_speed=(CheckBox)findViewById( R.id.check_fullspeed);
seek_right.setOnSeekBarChangeListener(this);
seek_left.setOnSeekBarChangeListener(this);
seek_front.setOnSeekBarChangeListener(this);
seek_back.setOnSeekBarChangeListener(this);
seek_all.setOnSeekBarChangeListener(this);
// toast=Toast;
toast=toast.makeText(this, "Value too Dangerous - Clipping! Activate 'Allow Full Speed' to Override" + mk.stats.debug_data_count,Toast.LENGTH_LONG );
}
@Override
protected void onDestroy()
{
mk.close_connections(true);
mk=null;
super.onDestroy();
 
}
 
Toast toast;
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) {
// mProgressText.setText(progress + " " +
// getString(R.string.seekbar_from_touch) + "=" + fromTouch);
if (( progress>50)&&(!full_speed.isChecked()))
{
seekBar.setProgress(50);
progress=50;
toast.show ();
}
else
{
toast.cancel();
}
if (seekBar==seek_all)
{
seek_right.setProgress(progress);
seek_left.setProgress(progress);
seek_front.setProgress(progress);
seek_back.setProgress(progress);
}
 
 
int[] params=new int[4];
params[0] = seek_right.getProgress();
params[1] = seek_left.getProgress();
params[2] = seek_front.getProgress();
params[3] = seek_back.getProgress();
 
 
params[3] = seek_right.getProgress();
params[2] = seek_left.getProgress();
params[0] = seek_front.getProgress();
params[1] = seek_back.getProgress();
 
mk.motor_test(params);
}
 
 
public void onStartTrackingTouch(SeekBar seekBar) {
//mTrackingText.setText(getString(R.string.seekbar_tracking_on));
}
 
public void onStopTrackingTouch(SeekBar seekBar) {
// mTrackingText.setText(getString(R.string.seekbar_tracking_off));
}
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/R.java
0,0 → 1,74
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
 
package org.ligi.android;
 
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int bt_off=0x7f020000;
public static final int bt_on=0x7f020001;
public static final int icon=0x7f020002;
public static final int lcd_green=0x7f020003;
public static final int starfield=0x7f020004;
}
public static final class id {
public static final int cancel_btn=0x7f060004;
public static final int check_autoconn=0x7f060002;
public static final int check_fullscreen=0x7f060015;
public static final int check_fullspeed=0x7f060005;
public static final int edit_host=0x7f060000;
public static final int edit_port=0x7f060001;
public static final int save_btn=0x7f060003;
public static final int seek_all=0x7f06000a;
public static final int seek_back=0x7f060007;
public static final int seek_front=0x7f060006;
public static final int seek_left=0x7f060008;
public static final int seek_right=0x7f060009;
public static final int stick_progress_0=0x7f06000b;
public static final int stick_progress_1=0x7f06000c;
public static final int stick_progress_2=0x7f06000d;
public static final int stick_progress_3=0x7f06000e;
public static final int stick_progress_4=0x7f06000f;
public static final int stick_progress_5=0x7f060010;
public static final int stick_progress_6=0x7f060011;
public static final int stick_progress_7=0x7f060012;
public static final int stick_progress_8=0x7f060013;
public static final int stick_progress_9=0x7f060014;
}
public static final class layout {
public static final int connection=0x7f030000;
public static final int motortest=0x7f030001;
public static final int rcdata=0x7f030002;
public static final int settings=0x7f030003;
}
public static final class raw {
public static final int voice_sample_01=0x7f040000;
public static final int voice_sample_02=0x7f040001;
public static final int voice_sample_03=0x7f040002;
public static final int voice_sample_04=0x7f040003;
public static final int voice_sample_05=0x7f040004;
public static final int voice_sample_06=0x7f040005;
public static final int voice_sample_07=0x7f040006;
public static final int voice_sample_08=0x7f040007;
public static final int voice_sample_09=0x7f040008;
public static final int voice_sample_10=0x7f040009;
public static final int voice_sample_11=0x7f04000a;
public static final int voice_sample_12=0x7f04000b;
public static final int voice_sample_13=0x7f04000c;
public static final int voice_sample_komma=0x7f04000d;
public static final int voice_sample_volt=0x7f04000e;
}
public static final class string {
public static final int app_name=0x7f050000;
public static final int map_menu_back_to_list=0x7f050003;
public static final int map_menu_toggle_street_satellite=0x7f050004;
public static final int map_menu_zoom_in=0x7f050001;
public static final int map_menu_zoom_out=0x7f050002;
}
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/RCDataActivity.java
0,0 → 1,120
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
 
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.*;
import android.content.DialogInterface;
import android.content.Context.*;
import android.widget.EditText;
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.SharedPreferences;
 
 
import android.view.*;
import android.content.*;
import android.view.ViewGroup.*;
 
import org.ligi.ufo.*;
 
public class RCDataActivity extends Activity
implements DUBwiseDefinitions,Runnable
{
 
 
 
AndroidMKCommunicator mk;
 
ProgressBar[] bars;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 
 
bars=new ProgressBar[10];
 
mk= new AndroidMKCommunicator(this);
mk.user_intent=USER_INTENT_RCDATA;
setContentView(R.layout.rcdata);
 
bars[0]= (ProgressBar)findViewById( R.id.stick_progress_0);
bars[1]= (ProgressBar)findViewById( R.id.stick_progress_1);
bars[2]= (ProgressBar)findViewById( R.id.stick_progress_2);
bars[3]= (ProgressBar)findViewById( R.id.stick_progress_3);
bars[4]= (ProgressBar)findViewById( R.id.stick_progress_4);
bars[5]= (ProgressBar)findViewById( R.id.stick_progress_5);
bars[6]= (ProgressBar)findViewById( R.id.stick_progress_6);
bars[7]= (ProgressBar)findViewById( R.id.stick_progress_7);
bars[8]= (ProgressBar)findViewById( R.id.stick_progress_8);
bars[9]= (ProgressBar)findViewById( R.id.stick_progress_9);
 
new Thread( this ).start(); // fire up main Thread
}
 
public void run()
{
while(true)
{
try{
Thread.sleep(50);
for (int i=0;i<10;i++)
bars[i].setProgress(mk.stick_data.stick[i]+127);
}
catch(Exception e)
{
 
mk.log(e.toString());
}
 
}
 
 
 
}
@Override
protected void onDestroy()
{
mk.close_connections(true);
mk=null;
super.onDestroy();
 
}
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/SettingsActivity.java
0,0 → 1,79
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
 
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.*;
import android.content.DialogInterface;
import android.content.Context.*;
import android.widget.EditText;
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.SharedPreferences;
 
import org.ligi.ufo.*;
 
public class SettingsActivity extends Activity
 
{
 
 
CheckBox fullscreen;
 
 
AndroidMKCommunicator mk;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 
setContentView(R.layout.settings);
 
 
fullscreen=(CheckBox)findViewById( R.id.check_fullscreen);
 
}
@Override
protected void onDestroy()
{
 
super.onDestroy();
 
}
 
 
}
/DUBwise/tags/v0.52/android/src/org/ligi/android/SettingsActivity.xml
0,0 → 1,138
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
 
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.*;
import android.content.DialogInterface;
import android.content.Context.*;
import android.widget.EditText;
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.SharedPreferences;
 
import org.ligi.ufo.*;
 
public class MotorTestActivity extends Activity
implements SeekBar.OnSeekBarChangeListener
{
 
SeekBar seek_right,seek_left,seek_front,seek_back,seek_all;
CheckBox full_speed;
boolean toasted=false;
 
AndroidMKCommunicator mk;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 
mk= new AndroidMKCommunicator(this);
setContentView(R.layout.motortest);
 
seek_right=(SeekBar)findViewById( R.id.seek_right);
seek_left=(SeekBar)findViewById( R.id.seek_left);
seek_front=(SeekBar)findViewById( R.id.seek_front);
seek_back=(SeekBar)findViewById( R.id.seek_back);
seek_all=(SeekBar)findViewById( R.id.seek_all);
full_speed=(CheckBox)findViewById( R.id.check_fullspeed);
seek_right.setOnSeekBarChangeListener(this);
seek_left.setOnSeekBarChangeListener(this);
seek_front.setOnSeekBarChangeListener(this);
seek_back.setOnSeekBarChangeListener(this);
seek_all.setOnSeekBarChangeListener(this);
// toast=Toast;
toast=toast.makeText(this, "Value too Dangerous - Clipping! Activate 'Allow Full Speed' to Override" + mk.stats.debug_data_count,Toast.LENGTH_LONG );
}
@Override
protected void onDestroy()
{
mk.close_connections(true);
mk=null;
super.onDestroy();
 
}
 
Toast toast;
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) {
// mProgressText.setText(progress + " " +
// getString(R.string.seekbar_from_touch) + "=" + fromTouch);
if (( progress>50)&&(!full_speed.isChecked()))
{
seekBar.setProgress(50);
progress=50;
toast.show ();
}
else
{
toast.cancel();
}
if (seekBar==seek_all)
{
seek_right.setProgress(progress);
seek_left.setProgress(progress);
seek_front.setProgress(progress);
seek_back.setProgress(progress);
}
 
 
int[] params=new int[4];
params[0] = seek_right.getProgress();
params[1] = seek_left.getProgress();
params[2] = seek_front.getProgress();
params[3] = seek_back.getProgress();
 
 
params[3] = seek_right.getProgress();
params[2] = seek_left.getProgress();
params[0] = seek_front.getProgress();
params[1] = seek_back.getProgress();
 
mk.motor_test(params);
}
 
 
public void onStartTrackingTouch(SeekBar seekBar) {
//mTrackingText.setText(getString(R.string.seekbar_tracking_on));
}
 
public void onStopTrackingTouch(SeekBar seekBar) {
// mTrackingText.setText(getString(R.string.seekbar_tracking_off));
}
 
}
/DUBwise/tags/v0.52/android
Property changes:
Added: svn:ignore
+bin
+
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-128x128-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 260957
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-128x128-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 234221
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-128x128-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 437213
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-128x128-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 246888
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-128x128-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 584403
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-128x128-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 208178
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-128x128-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 437068
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/128x128/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-176x220-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 303170
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-176x220-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 276434
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-176x220-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 479426
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-176x220-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 289101
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-176x220-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 626616
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-176x220-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 250391
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-176x220-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 479281
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/176x220/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-200x300-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 335055
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-200x300-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 308319
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-200x300-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 511311
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-200x300-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 320986
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-200x300-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 658501
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-200x300-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 282276
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-200x300-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 510932
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/200x300/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-240x320-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 305733
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-240x320-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 278997
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-240x320-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 481989
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-240x320-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 291664
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-240x320-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 629179
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-240x320-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 252954
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-240x320-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 481610
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/240x320/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-340x400-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 404282
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-340x400-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 377546
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-340x400-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 580538
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-340x400-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 390213
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-340x400-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 727728
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-340x400-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 351503
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-340x400-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 580159
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/340x400/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-480x640-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 549063
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-480x640-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 522327
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-480x640-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 725319
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/de_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-480x640-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 534994
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-480x640-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 872509
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/en_wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-en_wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-480x640-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 496284
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
0,0 → 1,8
MIDlet-Jar-URL: DUBwise-480x640-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 724940
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.52
MIDlet-1: DUBwise, i.png, DUBwise
MIDletX-No-Command: true
MIDlet-Icon: i.png
/DUBwise/tags/v0.52/j2me/bin/480x640/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/build.props
0,0 → 1,7
devicecontrol=on
cldc11=on
fileapi=on
screensize=128x128
bluetooth=on
voice_mode=no_voice
basename=DUBwise-128x128-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on
/DUBwise/tags/v0.52/j2me/build.rb
0,0 → 1,183
#!/usr/bin/env ruby
# little ruby script to build DUBwise
#
# Author: Marcus -LiGi- Bueschleb
#
# see README for further Infos
 
 
resdir="res/"
 
 
if ARGV.length==2
bindir=ARGV[1]
puts `rm -rf #{bindir}`
else
bindir="bin"
end
 
 
ARGV<<"" if ARGV==[]
case ARGV[0]
when "p910"
screensizes=["200x300"]
voice_modes=["en_speedy"]
bluetooth_modes=["off"]
devicecontrol_modes=["off"]
fileapi_modes=["off"]
cldc11_modes=["off"]
 
when "test"
screensizes=["240x320"]
voice_modes=["en_speedy"]
bluetooth_modes=["on"]
devicecontrol_modes=["on"]
fileapi_modes=["on"]
cldc11_modes=["on"]
#firmware_modes=["fc_mk3mag_firmwares"]
#firmware_modes=["all_firmwares"]
firmware_modes=["no_firmwares"]
 
when "wtk"
screensizes=["240x320"]
voice_modes=["en_wav"]
bluetooth_modes=["on"]
devicecontrol_modes=["on"]
fileapi_modes=["on"]
cldc11_modes=["on"]
#firmware_modes=["fc_mk3mag_firmwares"]
#firmware_modes=["all_firmwares"]
firmware_modes=["all_firmwares"]
 
when "bltest"
screensizes=["240x320"]
voice_modes=["en_speedy"]
bluetooth_modes=["on"]
devicecontrol_modes=["on"]
fileapi_modes=["on"]
cldc11_modes=["on"]
firmware_modes=["all_firmwares"]
 
when "test2"
screensizes=["176x220"]
voice_modes=["en_speedy"]
bluetooth_modes=["on"]
devicecontrol_modes=["on"]
fileapi_modes=["on"]
cldc11_modes=["on"]
firmware_modes=["all_firmwares"]
 
when "off"
screensizes=["240x320"]
voice_modes=["en_speedy"]
bluetooth_modes=["off"]
devicecontrol_modes=["off"]
fileapi_modes=["off"]
cldc11_modes=["off"]
 
when "alloff"
screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"]
voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"]
bluetooth_modes=["off"]
devicecontrol_modes=["off"]
fileapi_modes=["off"]
cldc11_modes=["off"]
 
when "n80"
bluetooth_modes=["on"]
screensizes=["340x400"]
voice_modes=["en_speedy"]
fileapi_modes=["on"]
devicecontrol_modes=["on"]
cldc11_modes=["on"]
firmware_modes=["all_firmwares"]
when "common"
screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"]
voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"]
bluetooth_modes=["on"]
fileapi_modes=["on"]
devicecontrol_modes=["on"]
cldc11_modes=["on"]
firmware_modes=["all_firmwares"]
 
else
# screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"]
# voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"]
# bluetooth_modes=["on","off"]
# fileapi_modes=["on","off"]
# devicecontrol_modes=["on","off"]
# cldc11_modes=["on","off"]
# firmware_modes=["no_firmwares","fc_mk3mag_firmware","all_firmwares"]
puts "no valid profile given"
exit
end
 
 
puts `mv build.props build.props.bak`
puts `ant clean`
puts `mkdir #{bindir}`
 
 
propertys={}
 
firmware_modes.each {|firmware|
cldc11_modes.each { |cldc11|
devicecontrol_modes.each { |devicecontrol|
fileapi_modes.each { |fileapi|
bluetooth_modes.each { |bluetooth|
screensizes.each { |screensize|
voice_modes.each { |voice_mode|
 
p "cleaning ressources"
p `rm -rf tmp/res`
p `mkdir tmp/res`
 
p `cp -v res/images_by_screensize/#{screensize}/* tmp/res/`
p `cp -v res/firmwares/#{firmware}/* tmp/res/`
 
propertys["screensize"]=screensize
p "voice_mode" + voice_mode
p "Screensize " + screensize
 
propertys["voice_mode"]=voice_mode
propertys["bluetooth"]=bluetooth
propertys["fileapi"]=fileapi
propertys["devicecontrol"]=devicecontrol
propertys["cldc11"]=cldc11
 
 
propertys["basename"]="DUBwise-#{screensize}-#{cldc11=="on"?"cldc11":"cldc10"}-#{voice_mode}-#{firmware}-bluetooth_#{bluetooth}-fileapi_#{fileapi}-devicecontrol_#{devicecontrol}"
p `cp -v res/voice_samples_by_name/#{voice_mode}/* tmp/res/`
 
prefs_file= File.new("build.props","w")
propertys.each_pair {|name,value|
p "writing props " + name+"="+value+"\n"
prefs_file << name+"="+value+"\n"
}
prefs_file.close
 
`ant build`.each_line { |l| puts l }
 
`mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
 
# `mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
 
 
 
`mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
 
`mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
}
 
 
}
}
}
}
}
}
puts `mv -v build.props.bak build.props`
 
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/build.xml
0,0 → 1,78
<project name="DUBwise" basedir=".">
<property name="wtk.home" value="/home/ligi/tools/WTK2.2/"/>
 
<property name="project_name" value="DUBwise"/> <!-- jar filename -->
<property name="project_version" value="0.52"/>
 
<property file="build.props"/>
 
<property name="res_dir" location="tmp/res"/>
<property name="build_dir" location="${basedir}/build/"/>
<property name="lib_dir" location="${basedir}/lib/"/>
<property name="src_dir" location="${basedir}/src/"/>
<property name="shrared_src_dir" location="${basedir}/../shared/src/"/>
 
<property name="preprocessed_src_dir" location="${basedir}/tmp/pp_src/"/>
 
<taskdef resource="antenna.properties" classpath="${lib_dir}/antenna.jar"/>
 
<property name="wtk.midp.version" value="2.0"/>
<property name="wtk.cldc.version" value="1.0"/>
 
<property name="wtk.midpapi" value="${lib_dir}/classes_with_fileapi.zip"/>
<target name="build">
<wtkpreprocess version="2" srcdir="${src_dir}" destdir="${preprocessed_src_dir}" symbols="VERSION=${project_version},voice_mode=${voice_mode},bluetooth=${bluetooth},fileapi=${fileapi},devicecontrol=${devicecontrol},cldc11=${cldc11},j2me=true" verbose="false"/>
<wtkpreprocess version="2" srcdir="${shrared_src_dir}" destdir="${preprocessed_src_dir}" symbols="VERSION=${project_version},voice_mode=${voice_mode},bluetooth=${bluetooth},fileapi=${fileapi},devicecontrol=${devicecontrol},cldc11=${cldc11},j2me=true" verbose="false"/>
 
 
 
<wtkbuild destdir="${build_dir}/classes" srcdir="${preprocessed_src_dir}" target="1.1" preverify="true"/>
<wtkjad
jadfile="${build_dir}/bin/${basename}.jad"
jarfile="${build_dir}/bin/${basename}.jar"
update="false"
manifest="${build_dir}/bin/MANIFEST.MF"
name="${project_name}"
vendor="LiGi"
version="${project_version}">
<attribute name="MIDletX-No-Command" value="true"/>
<attribute name="MIDlet-Icon" value="i.png"/>
<midlet name="${project_name}" class="${project_name}" icon="i.png" />
<!-- !!TODO!! Remove Icon JAD entry if no icon is there -->
</wtkjad>
<wtkpackage
jarfile="${build_dir}/bin/${basename}.jar"
jadfile="${build_dir}/bin/${basename}.jad"
basedir="${build_dir}/classes"
manifest="${build_dir}/bin/MANIFEST.MF"
obfuscate="false"
preverify="true">
<fileset dir="${res_dir}/">
<include name="*"/>
</fileset>
</wtkpackage>
 
<!-- !!TODO!! just zip if flag set -->
<zip destfile="${build_dir}/deploy.zip" basedir="${build_dir}/bin/" includes="**/*"/>
</target>
 
<target name="clean">
 
<delete dir="${build_dir}"/>
<delete dir="${preprocessed_src_dir}"/>
<tstamp/>
<mkdir dir="${preprocessed_src_dir}"/>
<mkdir dir="${build_dir}"/>
<mkdir dir="${build_dir}/classes"/>
<mkdir dir="${build_dir}/bin"/>
</target>
 
</project>
/DUBwise/tags/v0.52/j2me/lib/antenna.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/lib/antenna.jar.bak
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/lib/classes.zip
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/lib/classes_with_fileapi.zip
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/firmwares/all_firmwares/fc.bin
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/firmwares/all_firmwares/mk3.bin
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/firmwares/all_firmwares/navi.bin
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/firmwares/fc_mk3mag_firmwares/fc.bin
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/firmwares/fc_mk3mag_firmwares/mk3.bin
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/128x128/clouds.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/128x128/i.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/128x128/lcd_blue.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/128x128/lcd_green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/128x128/preflight.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/128x128/starfield.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/128x128/symbols.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/176x220/clouds.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/176x220/i.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/176x220/lcd_blue.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/176x220/lcd_green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/176x220/preflight.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/176x220/starfield.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/176x220/symbols.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/200x300/clouds.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/200x300/i.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/200x300/lcd_blue.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/200x300/lcd_green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/200x300/preflight.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/200x300/starfield.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/200x300/symbols.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/240x320/clouds.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/240x320/i.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/240x320/lcd_blue.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/240x320/lcd_green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/240x320/preflight.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/240x320/starfield.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/240x320/symbols.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/340x400/clouds.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/340x400/i.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/340x400/lcd_blue.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/340x400/lcd_green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/340x400/preflight.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/340x400/starfield.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/340x400/symbols.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/480x640/clouds.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/480x640/i.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/480x640/lcd_blue.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/480x640/lcd_green.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/480x640/preflight.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/480x640/starfield.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/images_by_screensize/480x640/symbols.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/symbols.xcf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/symbols_new.xcf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/symbols_sans_bold.xcf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/1.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/10.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/11.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/12.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/13.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/2.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/3.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/4.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/5.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/6.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/7.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/8.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/9.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/komma.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_64kbit_tts/volt.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/1.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/10.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/11.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/12.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/13.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/2.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/3.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/4.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/5.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/6.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/7.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/8.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/9.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/komma.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_tts/volt.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/1.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/10.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/11.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/12.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/13.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/2.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/3.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/4.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/5.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/6.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/7.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/8.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/9.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/komma.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav/volt.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/de_wav
Property changes:
Added: svn:mergeinfo
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/1.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/10.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/11.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/12.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/13.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/2.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/3.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/4.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/5.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/6.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/7.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/8.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/9.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/komma.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_speedy/volt.mp3
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/1.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/10.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/11.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/12.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/13.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/2.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/3.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/4.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/5.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/6.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/7.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/8.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/9.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/komma.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/res/voice_samples_by_name/en_wav/volt.wav
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/DUBwise/tags/v0.52/j2me/src/BTSearcher.java
0,0 → 1,140
/***************************************
*
* searches 4 Bluetooth Devices
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
****************************************/
 
//package org.ligi.dubwise;
//#if bluetooth=="on"
import javax.bluetooth.*;
 
public class BTSearcher
implements DiscoveryListener
{
private LocalDevice m_LclDevice = null;
private DiscoveryAgent m_DscrAgent=null;
 
 
 
public boolean searching=true;
public boolean error=false;
public String err_log="none";
 
 
public void log(String err_str)
{
 
err_log+=err_str;
System.out.println(err_str);
}
 
public final int MAX_DEVICES=10;
 
public RemoteDevice[] remote_devices;
public int remote_device_count=0;
public String[] remote_device_name;
public String[] remote_device_mac;
 
 
public BTSearcher()
{
 
remote_devices=new RemoteDevice[MAX_DEVICES];
remote_device_name=new String[MAX_DEVICES];
remote_device_mac=new String[MAX_DEVICES];
 
remote_device_count=0;
}
 
public void search()
{
searching=true;
remote_device_count=0;
try
{
//First get the local device and obtain the discovery agent.
m_LclDevice = LocalDevice.getLocalDevice();
m_DscrAgent= m_LclDevice.getDiscoveryAgent();
m_DscrAgent.startInquiry(DiscoveryAgent.GIAC,this);
}
catch (BluetoothStateException ex)
{
error=true;
log("Problem in searching the blue tooth devices\n" + ex);
}
 
}
 
public void inquiryCompleted(int transID) {
 
try {
log("search complete with " + remote_device_count + " devices");
for(int i=0;i<remote_device_count;i++)
{
log("#" + i + " -> addr: " + remote_devices[i].getBluetoothAddress());
remote_device_mac[i]=remote_devices[i].getBluetoothAddress();
 
remote_device_name[i]=remote_devices[i].getBluetoothAddress();
try {
log("#" + i + "name:" + remote_devices[i].getFriendlyName(true));
remote_device_name[i]=remote_devices[i].getFriendlyName(true);
}
catch (Exception e)
{
log("Problem getting name of BT-Device( -> taking mac as name): " + e);
}
 
 
}
}
catch (Exception e)
{
log("Problem in searching the blue tooth devices" + e);
}
searching=false;
}
 
 
public void search_again()
{
}
 
//Called when device is found during inquiry
public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod)
{
log("found device ");
try
{
if (remote_device_count!=(MAX_DEVICES-1))
{
remote_devices[remote_device_count]=btDevice;
remote_device_count++;
}
}
catch (Exception e)
{
log("Device Discovered Error: " + e);
}
 
}
 
 
public void serviceSearchCompleted(int transID, int respCode)
{ }
 
public void servicesDiscovered(int transID, ServiceRecord[] records)
{ }
 
 
 
}
 
//#endif
/DUBwise/tags/v0.52/j2me/src/DUBwise.java
0,0 → 1,50
/***********************************************************************
*
* DUBwise == Digital UFO Broadcasting with intelligent service equipment
* main MIDLet Source file
*
* Author: Marcus -LiGi- Bueschleb
* Mailto: LiGi @at@ LiGi DOTT de
*
************************************************************************/
 
 
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
 
public class DUBwise
extends MIDlet
 
{
public Display display;
public DUBwiseCanvas canvas;
public boolean loaded=false;
 
public void log(String str)
{
// canvas.debug.log(str);
}
public void vibrate(int duration)
{
display.vibrate(duration);
}
 
protected void startApp()
throws MIDletStateChangeException
{
 
if (loaded)return;
display = Display.getDisplay(this);
canvas=new DUBwiseCanvas(this);
 
// fire up canvas
display.setCurrent(canvas);
loaded=true;
}
 
public void quit() { notifyDestroyed(); }
protected void pauseApp() {} // not needed right now
protected void destroyApp(boolean arg0) { }
 
}
/DUBwise/tags/v0.52/j2me/src/DUBwiseCanvas.java
0,0 → 1,2704
/***************************************************************
*
* User Interface ( Canvas ) of DUBwise
*
* Author: Marcus -LiGi- Bueschleb
* Mailto: LiGi @at@ LiGi DOTT de
*
***************************************************************/
 
import javax.microedition.lcdui.*;
 
import javax.microedition.media.*;
import javax.microedition.media.control.*;
 
 
import javax.microedition.rms.*;
import java.io.*;
 
public class DUBwiseCanvas
extends Canvas
implements Runnable,org.ligi.ufo.DUBwiseDefinitions , DUBwiseUIDefinitions
{
 
//#if fileapi=="on"
DUBwiseFileAccess file_access;
//#endif
 
String act_input_str=" ";
// for dual use of states
boolean select_paramset4edit;
 
boolean read_paramset_intension_save;
boolean ipinput4proxy;
 
 
byte ipinput_pos=0;
int[] act_edit_ip;
 
int canvas_width=100;
int canvas_height=100;
 
 
int heading_offset=0;
int act_wp;
 
//#if bluetooth=="on"
private BTSearcher bt_scanner;
//#endif
 
public org.ligi.ufo.MKCommunicator mk=null;
// private MKStatistics mk_stat=null;
private MKParamsEditor params_editor=null;
private MKParamsEditor settings_editor=null;
public DUBwiseDebug debug=null;
 
 
 
//#if voice_mode!="no_voice"
public MKStatusVoice status_voice;
//#endif
 
 
private DUBwise root;
public DUBwiseSettings settings;
// public UFOProber mk.ufo_prober;
 
private Image bg_img;
private Image lcd_img;
private Image symbols_img;
private int symbols_img_tile_height;
private int symbols_img_tile_width;
 
 
private Image err_img;
 
 
int max_lines;
 
 
public byte act_motor=0;
public byte act_motor_increase=0;
public boolean motor_test_sel_all=false;
 
 
/* Graph Vars */
public final static int GRAPH_COUNT=4;
public final static int[] graph_colors={0x156315,0xCC1315,0xf8ef02,0x19194d};
public int[] graph_sources={0,1,2,3};
public String[] graph_names={"nick int","roll int","nick acc","roll acc"};
public int[][] graph_data;
public int graph_offset=0;
// public int lcd_char_width=0;
public int lcd_char_height=0;
 
public int frame_pos=0;
 
// public byte mk.user_intent=USER_INTENT_NONE;
int line_scaler=20;
 
int rawdebug_cursor_y=0;
int rawdebug_off_y=0;
 
public int line_middle_y;
public int graph_height;
 
 
boolean quit=false;
 
int bg_offset=0;
 
// variable to hold the current state
public byte state=STATEID_INITIAL;
public byte nextstate=STATEID_INITIAL;
int local_max=-1;
 
int y_off=0;
int spacer=0;
int spacer1=0;
 
int[] motor_test = {0,0,0,0};
 
String[] menu_items;
byte[] menu_actions;
int act_menu_select=0;
int[] act_menu_select_bak;
String[] lcd_lines =null;
 
 
// to check if 2 keys are pressed
byte keycontrol_exit=0;
 
 
byte setup_pos;
byte[] tmp_actions;
String[] tmp_items;
// boolean expert_mode=false;
 
public void tmp_menu_init(int max_items)
{
setup_pos=0;
tmp_actions=new byte[max_items];
tmp_items=new String[max_items];
}
 
public void tmp_menu_add(String label,byte action)
{
tmp_actions[setup_pos] = action;
tmp_items[setup_pos] = label;
setup_pos++;
}
 
public void tmp_menu_use()
{
byte[] tmp_actions_fin=new byte[setup_pos];
String[] tmp_items_fin=new String[setup_pos];
 
if (setup_pos<act_menu_select)
act_menu_select=0;
for ( int tmp_p=0;tmp_p<setup_pos;tmp_p++)
{
tmp_actions_fin[tmp_p]=tmp_actions[tmp_p];
tmp_items_fin[tmp_p] =tmp_items[tmp_p];
}
 
setup_menu(tmp_items_fin,tmp_actions_fin);
}
public void setup_conn_menu()
{
tmp_menu_init(7);
tmp_menu_add("Packet Traffic",ACTIONID_TRAFFIC);
tmp_menu_add("view Data",ACTIONID_DATABUFF);
//#if bluetooth=="on"
tmp_menu_add("connect via BT",ACTIONID_SCAN_BT);
//#endif
tmp_menu_add("connect via TCP/IP",ACTIONID_CONNECT_TCP);
 
if ((System.getProperty("microedition.commports")!=null)&&(!System.getProperty("microedition.commports").equals("")))
tmp_menu_add("connect via COM",ACTIONID_SELECT_COM);
tmp_menu_add("set Proxy",ACTIONID_PROXY_INPUT);
tmp_menu_add("back",ACTIONID_MAINMENU);
tmp_menu_use();
 
}
 
 
public void setup_main_menu()
{
tmp_menu_init(20);
tmp_menu_add("Tool Settings",ACTIONID_SETTINGS);
tmp_menu_add("Connection",ACTIONID_CONN_DETAILS);
 
if (settings.expert_mode)
tmp_menu_add("Debug",ACTIONID_DEBUG);
if (mk.ufo_prober.is_mk())
{
tmp_menu_add("Motor Test",ACTIONID_MOTORTEST);
tmp_menu_add("Key-Control",ACTIONID_KEYCONTROL);
tmp_menu_add("view RC-data",ACTIONID_RCDATA);
tmp_menu_add("Flight Settings",ACTIONID_PARAM_MENU);
tmp_menu_add("Artificial Horizon",ACTIONID_HORIZON);
}
 
 
 
if ( mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk() )
tmp_menu_add("LCD",ACTIONID_LCD);
 
if ( mk.ufo_prober.is_mk() )
tmp_menu_add("Graph",ACTIONID_GRAPH);
 
if (( mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()||mk.ufo_prober.is_mk3mag() ))
tmp_menu_add("Debug Values",ACTIONID_RAWDEBUG);
 
 
if ( mk.ufo_prober.is_navi())
{
tmp_menu_add("view GPS-Data",ACTIONID_GPSDATA);
tmp_menu_add("view Errors",ACTIONID_NC_ERRORS);
tmp_menu_add("switch to FC",ACTIONID_SWITCH_FC);
tmp_menu_add("switch to MK3MAG",ACTIONID_SWITCH_MK3MAG);
 
}
 
if (mk.ufo_prober.is_mk()||mk.ufo_prober.is_mk3mag() )
tmp_menu_add("switch to navi",ACTIONID_SWITCH_NC);
 
 
//if ((settings.expert_mode)&& ( mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()||mk.ufo_prober.is_mk3mag()||mk.ufo_prober.is_incompatible() ))
if (settings.expert_mode)
tmp_menu_add("Flash Firmware",ACTIONID_FLASH);
if (settings.expert_mode&& mk.ufo_prober.is_mk() )
tmp_menu_add("Remote Cam",ACTIONID_CAM);
 
if (!settings.expert_mode)
tmp_menu_add("About",ACTIONID_ABOUT);
 
tmp_menu_add("Quit",ACTIONID_QUIT);
 
tmp_menu_use();
}
 
 
public void setup_menu(String[] items , byte[] actions)
{
menu_items=items;
menu_actions=actions;
lcd_lines=new String[menu_items.length];
}
 
public void paint_menu(Graphics g)
{
for ( int i=0;i<menu_items.length;i++)
{
if ((frame_pos%3)!=0)
{
lcd_lines[i]=(act_menu_select==i?">":" ") + menu_items[i];
for ( int ii=0;ii<(18-menu_items[i].length());ii++)
lcd_lines[i]+=" ";
if (act_menu_select==i)
lcd_lines[i]+="<";
}
else
lcd_lines[i]=" " + menu_items[i];
 
}
paint_lcd(g);
}
 
public void menu_keypress(int keyCode)
{
debug.log("Menu with KeyCode:"+keyCode);
switch (getGameAction (keyCode))
{
case UP:
if (act_menu_select!=0)
act_menu_select--;
else
act_menu_select=menu_items.length-1;
break;
case DOWN:
if (act_menu_select<(menu_items.length-1))
act_menu_select++;
else
act_menu_select=0;
break;
}
 
}
 
public boolean cam_condition()
{
return (mk.stick_data.stick[settings.remote_cam_stick]>100);
}
 
// int lcd_top=25;
int lcd_off;
public void paint_lcd(Graphics g)
{
int y;
// int lcd_top= (state==STATEID_EDIT_PARAMS?0:25);
//int lcd_top= 25;
max_lines=(canvas_height-25/*lcd_top*/)/lcd_char_height;
int spacer_left_right=(canvas_width-(20*(lcd_img.getWidth()/222)))/2;
// for(int i=0;i<lcd_lines.length;i++)
 
int display_lines=(lcd_lines.length>max_lines?max_lines:lcd_lines.length);
 
 
lcd_off= (((state==STATEID_EDIT_PARAMS)&&(!params_editor.select_mode))?params_editor.act_y:act_menu_select)-display_lines+1;
if ( lcd_off<0) lcd_off=0;
 
for(int i=0;i<display_lines;i++)
for (int pos=0;pos<20;pos++)
{
/*if (!bottomup)
y=i*lcd_char_height;
else*/
y=canvas_height-(display_lines-i)*lcd_char_height;
 
g.setClip((lcd_img.getWidth()/222)*pos+spacer_left_right,y,(lcd_img.getWidth()/222),lcd_img.getHeight());
g.drawImage(lcd_img,spacer_left_right+(lcd_img.getWidth()/222)*pos-((pos<lcd_lines[i+lcd_off].length()?lcd_lines[i+lcd_off].charAt(pos):' ')-' ')*(lcd_img.getWidth()/222),y,g.TOP | g.LEFT);
}
}
 
public void load_skin_images()
{
try
{
bg_img=null;
lcd_img=null;
 
// load all needed images
switch (settings.act_skin)
{
case SKINID_DARK:
lcd_img=Image.createImage("/lcd_green.png");
if (settings.do_scrollbg) bg_img=Image.createImage("/starfield.jpg");
break;
case SKINID_LIGHT:
lcd_img=Image.createImage("/lcd_blue.png");
if (settings.do_scrollbg) bg_img=Image.createImage("/clouds.jpg");
break;
}
// lcd_char_width=lcd_img.getWidth()/222;
lcd_char_height=lcd_img.getHeight();
}
 
catch (Exception e)
{
debug.err(e.toString());
}
 
}
public void load_global_images()
{
try
{
symbols_img=Image.createImage("/symbols.png");
symbols_img_tile_height=symbols_img.getHeight()/2;
symbols_img_tile_width=symbols_img.getWidth()/10;
 
/* if (bg_img!=null)
graph_data=new int[GRAPH_COUNT][bg_img.getWidth()];
else
*/
 
}
catch (Exception e)
{
debug.err(e.toString());
}
}
 
// construct
public DUBwiseCanvas(DUBwise _root)
{
 
act_menu_select_bak=new int[STATEID_COUNT];
for (int i=0;i<STATEID_COUNT;i++)
act_menu_select_bak[i]=0;
//#if fileapi=="on"
file_access=new DUBwiseFileAccess(this);
//#endif
 
root=_root;
 
mk = new org.ligi.ufo.MKCommunicator();
 
 
//#if voice_mode!="no_voice"
status_voice=new MKStatusVoice(mk,this);
//#endif
 
settings = new DUBwiseSettings(this);
settings.load();
load_global_images();
debug = new DUBwiseDebug(this);
 
//#if bluetooth=="on"
bt_scanner = new BTSearcher();
//#endif
 
 
mk.gps_position.act_speed_format=settings.speed_format;
mk.gps_position.act_gps_format= settings.gps_format;
 
chg_state(STATEID_MAINMENU);
 
new Thread(this).start();
 
if (settings.connection_url!="")
connect_mk(settings.connection_url,settings.connection_name);
}
 
/****************************** Thread ******************/
// ticking runnable Section
public void run()
{
while(true)
{
try {
 
 
repaint();
serviceRepaints();
 
System.gc();
long loopStartTime = System.currentTimeMillis();
long sleeptime=0;
// ticked thing
frame_pos++;
 
// handle Device Change
if (mk.ufo_prober.change_notify)
{
mk.ufo_prober.change_notify=false;
if (mk.ufo_prober.is_incompatible())
{
mk.error_str="incompatible Device";
chg_state(STATEID_ERROR_MSG);
}
else
if (state==STATEID_MAINMENU)
chg_state(STATEID_MAINMENU); // reload mainmenu ( changed content )
}
 
switch(state)
{
case STATEID_RESET_PARAMS:
 
if (mk.bootloader_finish_ok)
{
mk.params.reset();
mk.watchdog.act_paramset=0;
nextstate=STATEID_PARAM_MENU;
success_msg="Param Reset Success!";
chg_state(STATEID_SUCCESS_MSG);
}
break;
case STATEID_GRAPH:
graph_offset--;
if (graph_offset==-graph_data[0].length)
graph_offset=0;
break;
 
case STATEID_CAMMODE:
try
{
if(cam_condition())
{
cam_img=null;
debug.log("get snap\n");
cam_raw = mVideoControl.getSnapshot(null);
try { Thread.sleep(4000); }
catch (Exception e)
{
debug.log("Problem Sleeping ");
}
cam_img = Image.createImage(cam_raw, 0, cam_raw.length);
}
else
{
if (cam_img==null)
;;
}
}
catch ( Exception e)
{
debug.log(e.toString());
}
break;
case STATEID_KEYCONTROL:
//mk.send_keys(keycontrol_bitfield);
break;
 
case STATEID_ERROR_MSG:
lcd_lines[0]=""+mk.error_str;
break;
 
case STATEID_PARAM_MASSWRITE:
 
if (param_masswrite_write_pos==5)
{
nextstate=STATEID_PARAM_MENU;
success_msg="Parameter Write OK";
chg_state(STATEID_SUCCESS_MSG);
}
else
{
if (param_masswrite_write_pos!=0)
try { Thread.sleep(2000); }
catch (Exception e)
{debug.log("Problem Sleeping "); }
lcd_lines[0]="Writing Params";
lcd_lines[1]=DUBwiseHelper.pound_progress(param_masswrite_write_pos,5);
 
mk.params.set_by_mk_data(params2masswrite[param_masswrite_write_pos]);
mk.params.act_paramset=param_masswrite_write_pos;
mk.write_params(mk.params.act_paramset);
param_masswrite_write_pos++;
}
break;
case STATEID_READ_PARAMS:
if (mk.watchdog.act_paramset==5)
{
if (read_paramset_intension_save)
{
try
{
RecordStore.deleteRecordStore( PARAM_SAVE_STORE_NAME);
}
catch (Exception e)
{ }
try {
RecordStore recStore = RecordStore.openRecordStore( PARAM_SAVE_STORE_NAME, true );
ByteArrayOutputStream bout = new ByteArrayOutputStream();
DataOutputStream dout = new DataOutputStream( bout );
// params_version
dout.writeInt(mk.params.params_version);
// params_length
dout.writeInt(mk.params.field_bak[0].length);
for (int p=0;p<5;p++)
for (int i=0;i<mk.params.field_bak[0].length;i++)
dout.writeInt(mk.params.field_bak[p][i]);
 
recStore.addRecord(bout.toByteArray(),0,bout.size());
recStore.closeRecordStore();
}
catch (Exception e)
{ }
// chg_state(STATEID_COPY_PARAMS);
 
nextstate=STATEID_PARAM_MENU;
success_msg="Parameter Copy OK";
chg_state(STATEID_SUCCESS_MSG);
}
else
{
select_paramset4edit=true;
chg_state(STATEID_SELECT_PARAMSET);
 
}
 
}
else
{
lcd_lines[0]="Reading Settings ";
lcd_lines[1]=DUBwiseHelper.pound_progress(mk.watchdog.act_paramset,5);
if (mk.params.found_incompatible)
{
mk.error_str="incompatible params";
chg_state(STATEID_ERROR_MSG);
}
}
break;
 
case STATEID_MOTORTEST:
 
if (motor_test_sel_all)
for (int m=0;m<4;m++)
{
motor_test[m]+=act_motor_increase;
if (motor_test[m]<0)motor_test[m]=0;
if (motor_test[m]>255)motor_test[m]=255;
}
else
{
motor_test[act_motor]+=act_motor_increase;
if (motor_test[act_motor]<0) motor_test[act_motor]=0;
if (motor_test[act_motor]>255) motor_test[act_motor]=255;
}
 
mk.motor_test(motor_test);
break;
 
case STATEID_STRINGINPUT:
lcd_lines[0]=act_input_str;
for(int tmp_i=act_input_str.length();tmp_i<20;tmp_i++)
lcd_lines[0]+=(char)(0);
 
lcd_lines[1]="";
for(int foo=0;foo<20;foo++)
{
if (foo==ipinput_pos)
lcd_lines[1]+="^";
else
lcd_lines[1]+=" ";
}
break;
 
 
case STATEID_IPINPUT:
if (ipinput4proxy)
act_edit_ip=settings.act_proxy_ip;
else
act_edit_ip=settings.act_conn_ip;
lcd_lines[1]=DUBwiseHelper.ip_str(act_edit_ip,true);
 
lcd_lines[2]="";
for(int foo=0;foo<20;foo++)
{
if (foo==ipinput_pos)
lcd_lines[2]+="^";
else
lcd_lines[2]+=" ";
}
break;
 
case STATEID_MAINMENU:
 
break;
 
//#if bluetooth=="on"
case STATEID_SCANNING:
 
lcd_lines[1]="Bluetooth Devices " + idle_seq[(((frame_pos/5)%idle_seq.length))];
lcd_lines[2]="found " + bt_scanner.remote_device_count;
if (!bt_scanner.searching)
chg_state(STATEID_DEVICESELECT);
break;
//#endif
 
}
 
if (quit)
{
settings.speed_format=mk.gps_position.act_speed_format;
settings.gps_format=mk.gps_position.act_gps_format;
settings.save();
root.quit();
}
 
 
//rescan=false;
 
if (bg_img!=null)
{
bg_offset--;
if (bg_offset==-bg_img.getWidth())
bg_offset=0;
}
 
 
 
//#if devicecontrol=="on"
 
try {
if (settings.keep_lighton) com.nokia.mid.ui.DeviceControl.setLights(0,100);
//#endif
}
catch (Exception e) { }
sleeptime=1000/ 15 - (int) (System.currentTimeMillis()- loopStartTime);
 
if (sleeptime<0)
sleeptime=100; // everyone has fi sleep
try { Thread.sleep(sleeptime); }
catch (Exception e)
{
debug.log("Problem Sleeping ");
}
 
}
catch (Exception e)
{
debug.log("E!:"+e.getMessage());
 
}
}
}
 
 
boolean firstrun=true;
 
public int skin_bg_color()
{
switch (settings.act_skin)
{
case SKINID_DARK:
return BG_COLOR_SKIN_DARK;
 
default:
case SKINID_LIGHT:
return BG_COLOR_SKIN_LIGHT;
}
}
 
 
public int skin_fg_color()
{
switch (settings.act_skin)
{
case SKINID_DARK:
return FG_COLOR_SKIN_DARK;
default:
case SKINID_LIGHT:
return FG_COLOR_SKIN_LIGHT;
}
}
 
 
public int check_local_max(int val)
{
if ( val>local_max)
local_max=val;
else if (-val>local_max)
local_max=-val;
return val;
}
 
 
 
 
public void symbol_paint(Graphics g,int x,int tile,int row)
{
g.setClip(x,0,(symbols_img_tile_width),symbols_img_tile_height);;
g.drawImage(symbols_img,x+(-tile)*(symbols_img_tile_width),row*(-symbols_img_tile_height), g.TOP | g.LEFT);
}
 
 
 
 
// drawing sections
public void paint(Graphics g) {
canvas_width=this.getWidth();
canvas_height=this.getHeight();
 
 
if (debug.showing)
{
debug.paint(g);
return;
}
 
if (firstrun)
{
if (settings.fullscreen) setFullScreenMode(settings.fullscreen);
firstrun=false;
}
y_off=0;
try {
 
 
 
Font f1 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM);
Font f2 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL);
 
spacer=(f1.getHeight());
spacer1=(f2.getHeight());
 
//default Font
g.setFont(f1);
 
 
//draw background
if (settings.do_scrollbg)
{
g.setColor(0xFFFFFF);
g.fillRect(0,0,canvas_width,canvas_height);
g.drawImage(bg_img,bg_offset,0, g.TOP | g.LEFT);
if (bg_offset+bg_img.getWidth()<canvas_width)
g.drawImage(bg_img,bg_offset+bg_img.getWidth(),0, g.TOP | g.LEFT);
 
}
else
{
g.setColor(0xdedfff);
g.fillRect(0,0,canvas_width,symbols_img_tile_height);
 
g.setColor(skin_bg_color());
g.fillRect(0,symbols_img_tile_height,canvas_width,canvas_height-symbols_img.getHeight());
}
 
 
//int bar=0;
// for ( int bar=0;bar<3;bar++)
if (settings.do_scrollbg)
for ( int bar=0;bar<canvas_width/(symbols_img.getWidth()/10)+1;bar++)
{
g.setClip(bar*(symbols_img_tile_width),0,(symbols_img_tile_width),symbols_img_tile_height);;
g.drawImage(symbols_img,bar*(symbols_img_tile_width),0, g.TOP | g.LEFT);
}
 
int symbol_left=0;
int symbol_spacer=5;
 
g.setClip(symbol_left,0,symbols_img_tile_width,symbols_img_tile_height);;
if (mk.connected)
symbol_paint(g,symbol_left,(((mk.stats.bytes_in>>3)&1)==1)?2:3,0);
 
else
{
if (mk.mk_url.startsWith("btspp://"))
symbol_paint(g,symbol_left,1,0);
 
}
// g.drawImage(symbols_img,(-1)*(symbols_img.getWidth()/10),0, g.TOP | g.LEFT);
 
 
 
symbol_left+=6*(symbols_img_tile_width)/4;
 
 
if ((mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()))
{
 
symbol_paint(g,symbol_left,4,0);
symbol_left+=5 *(symbols_img_tile_width)/4;
 
if ((mk.UBatt()/100)!=0)
{
symbol_paint(g,symbol_left,(mk.UBatt()/100),1);
symbol_left+=(symbols_img_tile_width);
}
 
symbol_paint(g,symbol_left,(mk.UBatt()/10)%10,1);
symbol_left+=(2*symbols_img_tile_width/3);
symbol_paint(g,symbol_left,9,0);
symbol_left+=(2*symbols_img_tile_width/3);
symbol_paint(g,symbol_left,(mk.UBatt())%10,1);
symbol_left+=6*(symbols_img_tile_width)/4;
 
 
// g.drawString("" + (mk.UBatt()/10) + "," +(mk.UBatt()%10)+"V" , symbol_left,y_off,Graphics.TOP | Graphics.LEFT);
 
 
//symbol_left+= g.getFont().stringWidth("88,8V");//;
/*
symbol_paint(g,symbol_left,6,0);
symbol_left+=5*(symbols_img_tile_width)/4;
*/
if (mk.SenderOkay()>0)
{
symbol_paint(g,symbol_left,6,0);
symbol_left+=5*(symbols_img_tile_width)/4;
/*symbol_paint(g,symbol_left,(mk.SenderOkay())/100,1);
symbol_left+=(symbols_img_tile_width);
 
symbol_paint(g,symbol_left,(mk.SenderOkay()/10)%10,1);
symbol_left+=(symbols_img_tile_width);*/
}
// symbol_paint(g,symbol_left,(mk.SenderOkay())%10,1);
//symbol_left+=6*(symbols_img_tile_width)/4;
 
// g.drawString(""+mk.SenderOkay() ,symbol_left,y_off,Graphics.TOP | Graphics.LEFT);
 
//symbol_left+= g.getFont().stringWidth("8")+symbol_spacer; //,0,(symbols_img.getWidth()/10)+2;
 
 
 
 
if (mk.ufo_prober.is_navi())
{
symbol_paint(g,symbol_left,5,0);
symbol_left+=5*(symbols_img_tile_width)/4;
 
symbol_paint(g,symbol_left,(mk.gps_position.SatsInUse)%10,1);
symbol_left+=6*(symbols_img_tile_width)/4;
 
 
g.setClip(symbol_left,0,(symbols_img.getWidth()/10),symbols_img.getHeight());
g.drawImage(symbols_img,(-5)*(symbols_img.getWidth()/10) + symbol_left,0, g.TOP | g.LEFT);
g.setClip(0,0,canvas_width,canvas_height);
symbol_left+=2+(symbols_img.getWidth()/10);
g.drawString(""+mk.gps_position.SatsInUse ,symbol_left,y_off,Graphics.TOP | Graphics.LEFT);
 
}
 
}
 
 
// unclip
g.setClip(0,0,canvas_width,canvas_height);
 
y_off+=symbols_img_tile_height;
graph_height=(canvas_height-y_off)/2;
line_middle_y=graph_height+y_off;
g.setColor(skin_fg_color());
switch(state)
{
case STATEID_HORIZON:
 
g.setStrokeStyle(Graphics.SOLID);
g.setColor(0x6e4e1d);
 
int horizon_height=(canvas_height-y_off)/2;
int horizon_middle=y_off+horizon_height;
 
int horizon_roll_pixels= (mk.angle_roll*horizon_height)/600;
int horizon_roll_pixels_=horizon_roll_pixels;
 
 
int nick_bar_width=canvas_width/4;
int nick_bar_height= nick_bar_width/2;
 
int nick_size=canvas_width/4;
int nick_pixels_y=(mk.angle_nick*horizon_height)/900;
int nick_pixels_x;
if ((mk.angle_roll*mk.angle_nick)>1)
nick_pixels_x=-((int)Math.sqrt(mk.angle_roll*mk.angle_nick)*(canvas_width/2))/(900);
else
nick_pixels_x=((int)Math.sqrt(-mk.angle_roll*mk.angle_nick)*(canvas_width/2))/(900);
while (horizon_roll_pixels!=0)
{
if (horizon_roll_pixels_>0)
{
g.drawLine(0,horizon_middle+horizon_roll_pixels_,canvas_width,horizon_middle-horizon_roll_pixels);
g.drawLine(0,horizon_middle+horizon_roll_pixels_,canvas_width,horizon_middle+horizon_roll_pixels);
}
else
{
g.drawLine(0,horizon_middle+horizon_roll_pixels,canvas_width,horizon_middle-horizon_roll_pixels_);
g.drawLine(0,horizon_middle-horizon_roll_pixels,canvas_width,horizon_middle-horizon_roll_pixels_);
}
// g.drawLine(0,horizon_middle-horizon_roll_pixels_,canvas_width,horizon_middle-horizon_roll_pixels);
horizon_roll_pixels+=(horizon_roll_pixels<0)?1:-1; // go to 0
 
/*g.drawLine(0,horizon_middle-horizon_roll_pixels,canvas_width,horizon_middle+horizon_roll_pixels);
if (horizon_roll_pixels<0)
g.drawLine(0,horizon_middle-horizon_roll_pixels_,canvas_width,horizon_middle-horizon_roll_pixels);
else
g.drawLine(0,horizon_middle+horizon_roll_pixels,canvas_width,horizon_middle+horizon_roll_pixels_);
horizon_roll_pixels+=(horizon_roll_pixels<0)?1:-1; // go to 0
*/
}
 
if (horizon_roll_pixels_>0)
{
g.drawLine(0,horizon_middle+horizon_roll_pixels_,canvas_width,horizon_middle-horizon_roll_pixels);
g.drawLine(0,horizon_middle+horizon_roll_pixels_,canvas_width,horizon_middle+horizon_roll_pixels);
g.fillRect(0,horizon_middle+horizon_roll_pixels_,canvas_width,canvas_height-(horizon_middle+horizon_roll_pixels_));
}
else
{
g.drawLine(0,horizon_middle+horizon_roll_pixels,canvas_width,horizon_middle-horizon_roll_pixels_);
g.drawLine(0,horizon_middle-horizon_roll_pixels,canvas_width,horizon_middle-horizon_roll_pixels_);
g.fillRect(0,horizon_middle-horizon_roll_pixels_,canvas_width,canvas_height-(horizon_middle-horizon_roll_pixels_));
}
 
 
g.setColor(0x254d9e);
g.fillArc((canvas_width-nick_size)/2- nick_pixels_x, horizon_middle-nick_size/2+ nick_pixels_y, nick_size, nick_size, 0,360);
 
// for (i=0;i<horizon_roll_pixels
// g.fillArc(0, 0, canvas_width, canvas_width, 0,45);
/*
int start_angle=(360+mk.gps_position.angle2wp(act_wp) - ((360+mk.debug_data.analog[26]-heading_offset)%360))%360;
// start_angle=0;
start_angle=(360-start_angle +90 -(45/2))%360;
 
g.fillArc(0, 0, canvas_width, canvas_width, start_angle,45);
*/
// g.drawArc(1, 1, canvas_width-2, canvas_width-2, start_angle,45);
// g.drawArc(2, 2, canvas_width-4, canvas_width-4, start_angle ,45);
 
 
g.setColor(skin_fg_color());
 
 
 
if (settings.expert_mode)
{
g.drawString("nick => " + mk.angle_nick,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
 
g.drawString("roll => " + mk.angle_roll,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
}
break;
 
case STATEID_DATABUFF:
g.setFont(f2);
 
int lines2paint=(((canvas_height-y_off)/spacer1));
y_off=canvas_height-spacer1;
 
for (int pos_y=0;pos_y<lines2paint;pos_y++)
{
g.drawString(mk.get_buff(pos_y) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off-=spacer1;
}
break;
 
case STATEID_SUCCESS_MSG:
case STATEID_ERROR_MSG:
if (err_img!=null)
{
int err_img_left=(canvas_width-err_img.getWidth()/2)/2;
int err_img_top=(canvas_height-err_img.getHeight())/2;
if (err_img_top<0)err_img_top=0;
g.setClip(err_img_left,err_img_top,err_img.getWidth()/2,err_img.getHeight());
g.drawImage(err_img,err_img_left-((state==STATEID_SUCCESS_MSG)?0:(err_img.getWidth()/2)),err_img_top, g.TOP | g.LEFT);
}
paint_lcd(g);
 
break;
 
case STATEID_GPSVIEW:
 
g.setFont(f2);
 
g.setStrokeStyle(Graphics.SOLID);
g.setColor(0x0000ff);
 
 
// g.fillArc(0, 0, canvas_width, canvas_width, 0,45);
 
/*
int start_angle=(360+mk.gps_position.angle2wp(act_wp) - ((360+mk.debug_data.analog[26]-heading_offset)%360))%360;
// start_angle=0;
start_angle=(360-start_angle +90 -(45/2))%360;
 
g.fillArc(0, 0, canvas_width, canvas_width, start_angle,45);
*/
// g.drawArc(1, 1, canvas_width-2, canvas_width-2, start_angle,45);
// g.drawArc(2, 2, canvas_width-4, canvas_width-4, start_angle ,45);
 
 
g.setColor(skin_fg_color());
 
g.drawString("Used Sats: " + mk.gps_position.SatsInUse + " | Packages: " + mk.stats.navi_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("Lat: " + mk.gps_position.Latitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("Long: " + mk.gps_position.Longitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("Altitude: " + mk.gps_position.Altitude ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("GrSpeed: " + mk.gps_position.GroundSpeed_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("Heading: " + mk.gps_position.Heading ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("CompasHeading: " + mk.gps_position.CompasHeading ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("Target-Lat: " + mk.gps_position.TargetLatitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString("Target-Long: " + mk.gps_position.TargetLongitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("Target-Alt: " + mk.gps_position.TargetAltitude ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
 
g.drawString("Home-Lat: " + mk.gps_position.HomeLatitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("Home-Long: " + mk.gps_position.HomeLongitude_str() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("Home-Alt: " + mk.gps_position.HomeAltitude ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer1;
g.drawString("Distance : " + mk.gps_position.Distance2Target ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString("Angle: " + mk.gps_position.Angle2Target ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString("WayPoints: " + mk.gps_position.WayPointNumber + "/" + mk.gps_position.WayPointIndex ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
 
 
 
/*
g.drawString("" + mk.gps_position.NameWP[act_wp] ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
 
g.drawString("Lat: " + mk.gps_position.WP_Latitude_str(act_wp) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
 
g.drawString("Long: " + mk.gps_position.WP_Longitude_str(act_wp) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
 
 
g.drawString("Distance: " + mk.gps_position.distance2wp(act_wp) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
 
g.drawString("Angle: " + mk.gps_position.angle2wp(act_wp) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
 
g.drawString("Compas Heading: " + (360+mk.debug_data.analog[26]-heading_offset)%360) + "(" +mk.debug_data.analog[26] +")" ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
*/
 
break;
 
case STATEID_RESET_PARAMS:
case STATEID_FLASHING:
g.setFont(f2);
int msg_pos=0;
while (mk.flash_msgs[msg_pos]!=null)
{
g.drawString(mk.flash_msgs[msg_pos] ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
msg_pos++;
}
break;
 
case STATEID_CAMMODE:
 
if (cam_img!=null)
g.drawImage(cam_img,0,0,g.TOP | g.LEFT);
g.drawString("condition: " + cam_condition() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("width " + cam_img.getWidth(),0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("height " + cam_img.getHeight(),0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
break;
 
case STATEID_STICKVIEW:
 
for(int tmp_y=0;tmp_y<10;tmp_y++)
{
g.drawString(""+tmp_y+"(" + mk.params.stick_names[tmp_y] + ")=>"+mk.stick_data.stick[tmp_y],0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
}
break;
 
case STATEID_KEYCONTROL:
 
y_off+=spacer;
g.drawString("UP or DOWN =>nick " + mk.extern_control[EXTERN_CONTROL_NICK],0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("LEFT or RIGHT =>roll " + mk.extern_control[EXTERN_CONTROL_ROLL],0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("1 or 4 =>altitude " + mk.extern_control[EXTERN_CONTROL_HIGHT],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
g.drawString("2 or 3 =>gier " + mk.extern_control[EXTERN_CONTROL_GIER],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
g.drawString("6 or 9 =>gas " + mk.extern_control[EXTERN_CONTROL_GAS],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
g.drawString("* and # =>exit",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
/* g.drawString("* and Fire =>Start Engines",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("* and 0 =>Stop Engines",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
*/
g.drawString("sent:" + mk.stats.external_control_request_count +"confirm:" + mk.stats.external_control_confirm_frame_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
// g.drawString("bf1:"+ keycontrol_bitfield[0] ,0,y_off,Graphics.TOP | Graphics.LEFT);
//g.drawString("bf2:"+ keycontrol_bitfield[1] ,canvas_width/2,y_off,Graphics.TOP | Graphics.LEFT);
break;
 
case STATEID_MOTORTEST:
for (int bar=0;bar<4;bar++)
 
{
g.setColor(((bar==act_motor)|motor_test_sel_all)?0x44CC44:0x4444DD);
g.fillRect(canvas_width/(8*2)+bar*2*canvas_width/8,y_off+10,canvas_width/8,y_off+20+motor_test[bar]);
g.setColor(0x000000);
g.drawString(""+motor_test[bar] ,canvas_width/8+bar*2*canvas_width/8,y_off+10,Graphics.TOP | Graphics.HCENTER);
g.drawString(""+mk.debug_data.motor_val(bar) ,canvas_width/8+bar*2*canvas_width/8,y_off+25,Graphics.TOP | Graphics.HCENTER);
}
g.setColor(skin_fg_color());
g.drawString(""+mk.debug_data.analog[2]+"<->"+mk.debug_data.analog[3] ,0,canvas_height-30,Graphics.TOP | Graphics.LEFT);
break;
 
case STATEID_EDIT_PARAMS:
params_editor.paint(g);
break;
 
 
 
//#if fileapi=="on"
case STATEID_FILEOPEN:
y_off+=spacer;
g.drawString("act_path" + file_access.act_path() ,0,y_off,Graphics.TOP | Graphics.LEFT);
paint_menu(g);
break;
//#endif
 
 
case STATEID_SELECT_COMPORT:
case STATEID_PARAM_MENU:
paint_menu(g);
break;
case STATEID_STRINGINPUT:
case STATEID_ABOUT:
case STATEID_IPINPUT:
case STATEID_PARAM_MASSWRITE:
case STATEID_READ_PARAMS:
//#if bluetooth=="on"
case STATEID_SCANNING:
//#endif
paint_lcd(g);
break;
 
 
 
case STATEID_RAWDEBUG:
g.setFont(f2);
rawdebug_off_y=0;
if ((rawdebug_cursor_y+3)*spacer1>canvas_height)
rawdebug_off_y=((rawdebug_cursor_y+3)*spacer1-canvas_height)/spacer1;
for (int i=0;i<(canvas_height/spacer1)-1;i++)
{
if (i+rawdebug_off_y==rawdebug_cursor_y)
{
g.setColor(0x0000CC);
g.fillRect(0,y_off,canvas_width,spacer1);
 
g.setColor(skin_fg_color());
 
 
}
if (i+rawdebug_off_y<32) //todo better style
g.drawString(mk.debug_data.names[i+rawdebug_off_y] + mk.debug_data.analog[i+rawdebug_off_y] ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
}
 
 
 
break;
 
case STATEID_CONN_DETAILS:
g.setFont(f1);
g.drawString("Connection::",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.setFont(f2);
 
g.drawString(" URL:" + mk.mk_url,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString(" Name:" + mk.name,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString(" "+mk.ufo_prober.extended_name()+ " (" + (mk.connected?("open"+((System.currentTimeMillis()- mk.connection_start_time)/1000)+"s"):"closed")+"):",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString(" Version:" + mk.version.str ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString(" Slave-Addr:" + mk.slave_addr,0,y_off,Graphics.TOP | Graphics.LEFT);
 
paint_menu(g);
 
break;
 
case STATEID_TRAFFIC:
g.setFont(f1);
g.drawString("Packet Traffic (over "+mk.conn_time_in_s()+"s):",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.setFont(f2);
g.drawString( ">>in:"+mk.stats.bytes_in+ " bytes => " + mk.stats.bytes_in/mk.conn_time_in_s() + " bytes/s",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
 
 
 
g.drawString( " debug:"+mk.stats.debug_data_count+ " LCD:" + mk.stats.lcd_data_count + " vers:" + mk.stats.version_data_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString( " rc:"+mk.stats.stick_data_count+" params:"+mk.stats.params_data_count + " GPS:"+mk.stats.navi_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString( " debug_names:" + mk.stats.debug_names_count + " angles:" + mk.stats.angle_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer1;
g.drawString( " other:"+mk.stats.other_data_count,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer1+3;
g.drawString( "<<out:"+mk.stats.bytes_out + " bytes =>" + mk.stats.bytes_out/mk.conn_time_in_s() + "bytes/s", 0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString( " LCD:" + mk.stats.lcd_data_request_count + " vers:" + mk.stats.version_data_request_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString( " params:"+mk.stats.params_data_request_count +" rc:" + mk.stats.stick_data_request_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString( " resend:"+mk.stats.resend_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
paint_menu(g);
break;
 
case STATEID_PROXY:
g.setFont(f1);
g.drawString("Host:",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.setFont(f2);
g.drawString(" " + mk.proxy.url + "("+((mk.proxy.connected)?"open":"closed") +")",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
 
break;
 
case STATEID_SETTINGSMENU:
 
settings_editor.paint(g);
break;
// falltru wanted
// case STATEID_SELECT_SPEED_FORMAT:
// case STATEID_SELECT_GPS_FORMAT:
case STATEID_MAINMENU:
 
 
 
case STATEID_SELECT_PARAMSET:
case STATEID_HANDLE_PARAMS:
case STATEID_DEVICESELECT:
 
paint_menu(g);
break;
 
case STATEID_GRAPH:
g.setClip(0,0,canvas_width,canvas_height);
 
g.setStrokeStyle(Graphics.DOTTED);
g.setColor(0xe1dddd);
g.setFont(f2);
// LEGEND
if (settings.graph_legend) for (int d=0;d<GRAPH_COUNT;d++)
{/*
g.setColor(graph_colors[d]);
g.fillRect(0,y_off +spacer1/2-2 ,20,4);
g.setColor(skin_fg_color());
g.drawString(graph_names[d] + mk.debug_data.analog[graph_sources[d]],23,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
*/
g.setColor(graph_colors[d]);
g.fillRect(canvas_width-20,canvas_height-spacer*(d+1)+(spacer)/2-2 ,20,4);
g.setColor(skin_fg_color());
g.drawString(graph_names[d] /*+ mk.debug_data.analog[graph_sources[d]]*/,canvas_width-23,canvas_height-spacer*(d+1),Graphics.TOP | Graphics.RIGHT);
// y_off+=spacer1;
 
}
 
if (settings.graph_scale)
{
int scale=10;
// if ((10/line_scaler)<5)scale =1;
if (((10/line_scaler)*2)<(canvas_height/2) )scale =10;
if (((50/line_scaler)*2)<(canvas_height/2) )scale =50;
if (((100/line_scaler)*2)<(canvas_height/2) )scale =100;
if (((250/line_scaler)*2)<(canvas_height/2) )scale =250;
if (((500/line_scaler)*2)<(canvas_height/2) )scale =500;
if (((1000/line_scaler)*2)<(canvas_height/2) )scale =1000;
if (((10000/line_scaler)*2)<(canvas_height/2) )scale =10000;
 
 
 
 
// g.drawString("scale:"+scale + "line scaler" + line_scaler,0,y_off,Graphics.TOP | Graphics.LEFT);
 
 
int jump=0;
 
g.drawLine(0,line_middle_y,canvas_width,line_middle_y);
while ((jump/line_scaler)<graph_height)
{
g.drawString(""+jump,0,line_middle_y - jump/line_scaler,Graphics.TOP | Graphics.LEFT);
if (jump!=0)g.drawString("-"+jump,0,line_middle_y + jump/line_scaler,Graphics.TOP | Graphics.LEFT);
g.drawLine(0,line_middle_y - jump/line_scaler,canvas_width,line_middle_y - jump/line_scaler);
g.drawLine(0,line_middle_y + jump/line_scaler,canvas_width,line_middle_y + jump/line_scaler);
jump+=scale;
}
}
 
 
 
for (int gr=0;gr<GRAPH_COUNT;gr++)
{
 
 
// !!TODO checkme
g.setColor(graph_colors[gr]);
 
graph_data[gr][-graph_offset]=check_local_max(mk.debug_data.analog[graph_sources[gr]]);
 
line_scaler= local_max/graph_height+1;
 
 
for ( int x=0;x<canvas_width;x++)
{
int p= (((-graph_offset+x-canvas_width-5)));
if (p<1)
p+=graph_data[0].length;
p%=(graph_data[0].length-1);
draw_graph_part(g,x,graph_data[gr][p]/line_scaler,graph_data[gr][p+1]/line_scaler);
}
}
 
 
 
break;
 
case STATEID_LCD:
/*
g.setClip(canvas_width/2-load_img.getWidth()/6+1,canvas_height/2-load_img.getHeight()/8+1, load_img.getWidth()/4,load_img.getHeight()/3);;
if (( mk.LCD.init_state!=-1)||(mk.LCD.act_mk_page!=mk.LCD.act_user_page)) g.drawImage(load_img,canvas_width/2-load_img.getWidth()/8 - ((((frame_pos/3)%12)%4)*(load_img.getWidth()/4)) ,canvas_height/2-load_img.getHeight()/6- ((((frame_pos/3)%12)/4)*(load_img.getHeight()/3)), g.TOP | g.LEFT);
 
*/
/*
// !!TODO!! check exactly which version those Datas where introduced
if (mk.version.compare(0,60)==mk.version.VERSION_PREVIOUS)
{
g.drawString("Voltage: " + (mk.debug_data.UBatt()/10) + "," +(mk.debug_data.UBatt()%10)+"V" ,0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString("Sender: " + mk.debug_data.SenderOkay(),canvas_width/2,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
}
 
g.drawString(mk.version.str+"(d"+mk.debug_data_count+ "l" + mk.lcd_data_count+ "v" + mk.version_data_count+"o"+mk.other_data_count+"p"+mk.params_data_count+")",0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
 
g.drawString("n:"+mk.debug_data.nick_int() + " r:"+mk.debug_data.roll_int() + " an:"+mk.debug_data.accnick() + " ar:"+mk.debug_data.accroll() ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("m1:"+mk.debug_data.motor_val(0) + " m2:"+mk.debug_data.motor_val(1)+" m3:"+mk.debug_data.motor_val(2) + " m4:"+mk.debug_data.motor_val(3) ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
if (mk.connected)
{
g.drawString("time conn:" +((System.currentTimeMillis()- mk.connection_start_time)/1000)+"s" ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("time motor>15:" +(mk_stat.motor_on_time/1000) +"s" ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("time motor=15:" +(mk_stat.motor_stand_time/1000) +"s" ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("lcd:" + mk.LCD.act_mk_page + "/" + mk.LCD.pages + " ( wanted: " + mk.LCD.act_user_page + "state:" + mk.LCD.init_state +")" ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
g.drawString("lcd-key:" + mk.LCD.act_key ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
}
*/
int spacer_left_right=(canvas_width-(20*(lcd_img.getWidth()/222)))/2;
 
y_off=canvas_height-4*lcd_img.getHeight();
for ( int foo=0;foo<4;foo++)
{
for (int x=0;x<20;x++)
{
g.setClip(spacer_left_right+(lcd_img.getWidth()/222)*x,y_off,(lcd_img.getWidth()/222),lcd_img.getHeight());
g.drawImage(lcd_img,spacer_left_right+(lcd_img.getWidth()/222)*x-(mk.LCD.get_act_page()[foo].charAt(x)-' ')*(lcd_img.getWidth()/222),y_off, g.TOP | g.LEFT);
 
}
y_off+=lcd_img.getHeight();
}
 
g.setClip(0,0,canvas_width,canvas_height);
 
}
 
 
} catch (Exception e) {}
 
}
Player mPlayer;
VideoControl mVideoControl;
Image cam_img;
Image last_cam_img;
int cam_img_seq=0;
byte[] cam_raw;
 
private void connect_mk(String url,String name)
{
// mk.ufo_prober.bluetooth_probe(url);
settings.connection_url=url;
settings.connection_name=name;
mk.connect_to(url,name);
}
 
public void draw_graph_part(Graphics g,int x,int y1,int y2)
{
if ( canvas_width>200)
{
g.fillRect(x,line_middle_y-y1,1,1 );
if (y1>y2)
g.fillRect(x,line_middle_y-y1,1,y1-y2);
else
g.fillRect(x,line_middle_y-y2,1,y2-y1);
 
}
else
{
g.fillRect(x,line_middle_y-y1,1,1 );
if (y1>y2)
g.fillRect(x,line_middle_y-y1,1,y1-y2);
else
g.fillRect(x,line_middle_y-y2,1,y2-y1);
}
}
 
 
/*********************************************** input Section **********************************************/
 
 
 
// public final String intro_str=" Digital Ufo Broadcasting with intelligent service equipment by Marcus -LiGi- Bueschleb ; Big Up Holger&Ingo for the MikroKopter Project (http://www.mikrokopter.de) ";
 
// int intro_str_pos=0;
// int intro_str_delay=3;
// boolean init_bootloader=false;
String success_msg="";
 
public void chg_state(byte next_state)
{
settings_editor = null;
params_editor = null;
err_img=null;
graph_data=null;
 
act_menu_select_bak[state]=act_menu_select;
act_menu_select=act_menu_select_bak[next_state];
 
 
/*
// tasks on state exit
switch(next_state)
{
case STATEID_SETTINGSMENU:
 
break;
}
*/
// prepare next state
switch(next_state)
 
{
// case STATEID_COPY_PARAMS:
//break;
case STATEID_SUCCESS_MSG:
case STATEID_ERROR_MSG:
lcd_lines=new String[1];
lcd_lines[0]=""+((next_state==STATEID_SUCCESS_MSG)?success_msg:mk.error_str);
try
{
err_img=Image.createImage("/preflight.jpg");
}
catch (Exception e)
{
debug.log("problem loading error image");
}
break;
case STATEID_EDIT_PARAMS:
params_editor = new MKParamsEditor(this,mk.params,STATEID_HANDLE_PARAMS);
break;
case STATEID_STRINGINPUT:
lcd_lines=new String[2];
lcd_lines[0]=act_input_str;
lcd_lines[1]="^";
break;
case STATEID_LCD:
mk.user_intent=USER_INTENT_LCD;
break;
case STATEID_RESET_PARAMS:
 
mk.bootloader_intension_flash=false;
mk.bl_retrys=0;
mk.init_bootloader=true;
break;
 
case STATEID_FLASHING:
mk.bootloader_intension_flash=true;
mk.bl_retrys=0;
mk.init_bootloader=true;
break;
 
//#if fileapi=="on"
case STATEID_FILEOPEN:
file_access.trigger();
break;
//#endif
 
case STATEID_STICKVIEW:
mk.user_intent=USER_INTENT_RCDATA;
break;
case STATEID_SELECT_COMPORT:
menu_items=DUBwiseHelper.split_str(System.getProperty("microedition.commports")+",back",",");
setup_menu(menu_items,null);
break;
 
 
case STATEID_ABOUT:
lcd_lines=credits;
lcd_lines[1]=" ufo-lib: " + mk.lib_version_str();
act_menu_select=max_lines-1;
break;
case STATEID_CONN_DETAILS:
setup_conn_menu();//conn_details_menu_items,conn_details_menu_actions);
break;
 
 
case STATEID_PARAM_MENU:
setup_menu(param_menu_items,param_menu_actions);
break;
case STATEID_TRAFFIC:
setup_menu(onlyback_menu_items,back_to_conndetails_actions);
break;
case STATEID_CAMMODE:
mk.user_intent=USER_INTENT_RCDATA;
if (mVideoControl==null)
try
{
debug.log("creating player\n");
mPlayer = Manager.createPlayer("capture://video?encoding=png&width=2048&height=1536");
debug.log("realizing player\n");
mPlayer.realize();
debug.log("get_videocontrol\n");
mVideoControl = (VideoControl)mPlayer.getControl("VideoControl");
debug.log("switching Canvas\n");
mVideoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
debug.log("get snap\n");
byte[] raw = mVideoControl.getSnapshot(null);
}
catch ( Exception e)
{
debug.log(e.toString());
}
 
 
break;
case STATEID_KEYCONTROL:
mk.user_intent= USER_INTENT_EXTERNAL_CONTROL;
keycontrol_exit=0;
break;
 
 
case STATEID_PARAM_MASSWRITE:
mk.user_intent=USER_INTENT_PARAMS;
lcd_lines=new String[2];
lcd_lines[0]="";
lcd_lines[1]="";
break;
 
case STATEID_READ_PARAMS:
mk.user_intent=USER_INTENT_PARAMS;
lcd_lines=new String[2];
lcd_lines[0]="Reading Settings ";
lcd_lines[1]=DUBwiseHelper.pound_progress(mk.watchdog.act_paramset,5);
 
break;
 
case STATEID_IPINPUT:
lcd_lines=new String[3];
lcd_lines[0]="Address (IP:Port): ";
break;
 
//#if bluetooth=="on"
case STATEID_SCANNING:
lcd_lines=new String[3];
lcd_lines[0]="Searching for";
lcd_lines[1]="Bluetooth Devices";
lcd_lines[2]="found";
 
mk.close_connections(true);
bt_scanner.search();
break;
//#endif
 
case STATEID_HANDLE_PARAMS:
menu_items=handle_params_menu_items;
menu_actions=handle_params_menu_actions;
lcd_lines=new String[menu_items.length];
 
break;
 
case STATEID_SELECT_PARAMSET:
menu_items=new String[6];
for (int i=0;i<5;i++)
menu_items[i]=""+(i+1)+": " + mk.params.getParamName(i) + ((i==mk.params.active_paramset)?"*":"");
 
menu_items[5]="back";
lcd_lines=new String[6];
break;
 
//#if bluetooth=="on"
case STATEID_DEVICESELECT:
menu_items=new String[bt_scanner.remote_device_count+2];
lcd_lines=new String[bt_scanner.remote_device_count+2];
 
for (int i=0;i<bt_scanner.remote_device_count;i++)
menu_items[i]=bt_scanner.remote_device_name[i];
menu_items[bt_scanner.remote_device_count]="scan again";
menu_items[bt_scanner.remote_device_count+1]="cancel";
 
break;
//#endif
 
case STATEID_MAINMENU:
setup_main_menu();
 
break;
 
case STATEID_SETTINGSMENU:
settings_editor = new MKParamsEditor(this,settings,STATEID_MAINMENU);
/*
menu_items=new String[settings_menu_items.length];
for(int cnt=0;cnt<settings_menu_items.length;cnt++)
menu_items[cnt]=settings_menu_items[cnt];
 
menu_items[0]+=(settings.act_skin==SKINID_DARK)?"Dark":"Light";
menu_items[1]+=(!settings.do_sound)?"Off":"On";
menu_items[2]+=(!settings.do_vibra)?"Off":"On";
menu_items[3]+=(!settings.do_scrollbg)?"Off":"On";
menu_items[4]+=(!settings.fullscreen)?"Off":"On";
menu_items[5]+=(mk.gps_position.act_gps_format==0)?" Decimal":" MinSec";
menu_items[6]+=(mk.gps_position.act_speed_format==0)?" KM/H":((mk.gps_position.act_speed_format==1)?" MP/H":"CM/S");
 
//#if devicecontrol=="on"
menu_items[7]+=(!settings.keep_lighton)?"Off":"On";
//#endif
menu_items[8]+=(!settings.expert_mode)?" Off":" On";
menu_actions=settings_menu_actions;
lcd_lines=new String[menu_items.length];*/
break;
 
case STATEID_RAWDEBUG:
mk.user_intent=USER_INTENT_RAWDEBUG;
break;
 
 
case STATEID_GRAPH:
graph_data=new int[GRAPH_COUNT][this.getWidth()*2];
for (int c=0;c<graph_data[0].length;c++)
for (int d=0;d<GRAPH_COUNT;d++)
graph_data[d][c]=-1;
mk.user_intent=USER_INTENT_GRAPH;
local_max=1;
break;
 
}
mk.watchdog.resend_timeout=0;
 
// switch state
state=next_state;
} // void chg_state
 
 
public void keyReleased(int keyCode)
{
switch(state)
{
case STATEID_MOTORTEST:
act_motor_increase=0;
break;
case STATEID_KEYCONTROL:
if (keyCode==KEY_POUND)
keycontrol_exit &= 255^1;
else
if (keyCode==KEY_STAR)
keycontrol_exit &= 255^2;
else
mod_external_control_by_keycode(keyCode,(byte)0);
 
/*
mk.send_keys(keycontrol_bitfield);
*/
break;
}
 
}
 
 
public void mod_external_control_by_keycode(int keyCode,byte mul)
{
 
if (keyCode==this.KEY_NUM2)
mk.extern_control[EXTERN_CONTROL_GIER]=(byte)(-mul*settings.default_extern_control[EXTERN_CONTROL_GIER]);
else if (keyCode==this.KEY_NUM3)
mk.extern_control[EXTERN_CONTROL_GIER]=(byte)(mul*settings.default_extern_control[EXTERN_CONTROL_GIER]);
 
else if (keyCode==this.KEY_NUM1)
mk.extern_control[EXTERN_CONTROL_HIGHT]+=mul*settings.default_extern_control[EXTERN_CONTROL_HIGHT];
else if (keyCode==this.KEY_NUM4)
mk.extern_control[EXTERN_CONTROL_HIGHT]-=mul*settings.default_extern_control[EXTERN_CONTROL_HIGHT];
 
 
else if (keyCode==this.KEY_NUM6)
{ if ( mk.extern_control[EXTERN_CONTROL_GAS]<255) mk.extern_control[EXTERN_CONTROL_GAS]+=mul*settings.default_extern_control[EXTERN_CONTROL_GAS]; }
else if (keyCode==this.KEY_NUM9)
{ if ( mk.extern_control[EXTERN_CONTROL_GAS]>0) mk.extern_control[EXTERN_CONTROL_GAS]-=mul*settings.default_extern_control[EXTERN_CONTROL_GAS]; }
 
else switch (getGameAction (keyCode))
{
case UP:
mk.extern_control[EXTERN_CONTROL_NICK]=(byte)(mul*settings.default_extern_control[EXTERN_CONTROL_NICK]);
break;
case DOWN:
mk.extern_control[EXTERN_CONTROL_NICK]=(byte)(-mul*settings.default_extern_control[EXTERN_CONTROL_NICK]);
 
break;
case LEFT:
mk.extern_control[EXTERN_CONTROL_ROLL]=(byte)(mul*settings.default_extern_control[EXTERN_CONTROL_ROLL]);
break;
case RIGHT:
mk.extern_control[EXTERN_CONTROL_ROLL]=(byte)(-mul*settings.default_extern_control[EXTERN_CONTROL_ROLL]);
break;
case FIRE:
 
break;
}
 
}
 
 
public final static String PARAM_SAVE_STORE_NAME="MKParamsV1";
 
int[][] params2masswrite;
int param_masswrite_write_pos;
public void process_action(byte actionid)
{
switch(actionid)
{
case ACTIONID_PARAM_LOAD_MOBILE:
try
{
RecordStore recStore = RecordStore.openRecordStore(PARAM_SAVE_STORE_NAME , true );
if (recStore.getNumRecords()==1)
{
ByteArrayInputStream bin = new ByteArrayInputStream(recStore.getRecord(1));
DataInputStream din = new DataInputStream( bin );
 
 
// params_version
if ( mk.params.params_version!=din.readInt())
{
mk.error_str="Params Incompatible";
chg_state(STATEID_ERROR_MSG);
break;
}
 
int p_length=din.readInt();
params2masswrite=new int[5][p_length];
 
for ( int p=0;p<5;p++)
for ( int p_pos=0;p_pos<p_length;p_pos++)
params2masswrite[p][p_pos]=din.readInt();
 
param_masswrite_write_pos=0;
chg_state(STATEID_PARAM_MASSWRITE);
}
else throw(new Exception("rms err"));
recStore.closeRecordStore();
}
catch (Exception e)
{
mk.error_str="No Params on Mobile";
chg_state(STATEID_ERROR_MSG);
}
 
 
break;
case ACTIONID_PARAM_COPY_MOBILE:
read_paramset_intension_save=true;
chg_state(STATEID_READ_PARAMS);
break;
 
case ACTIONID_PARAM_MENU:
chg_state(STATEID_PARAM_MENU);
break;
case ACTIONID_PARAM_WRITE_OK:
success_msg="Parameter Write OK";
chg_state(STATEID_SUCCESS_MSG);
break;
case ACTIONID_HORIZON:
chg_state(STATEID_HORIZON);
break;
 
case ACTIONID_RENAME_PARAMS:
act_input_str=mk.params.getParamName(mk.params.act_paramset);
ipinput_pos=0;
chg_state(STATEID_STRINGINPUT);
break;
 
 
case ACTIONID_BACK_TO_CONNDETAILS:
chg_state(STATEID_CONN_DETAILS);
break;
 
case ACTIONID_RESET_PARAMS:
chg_state(STATEID_RESET_PARAMS);
// state=STATEID_FLASHING;
 
break;
 
case ACTIONID_FLASH:
chg_state(STATEID_FLASHING);
break;
case ACTIONID_DATABUFF:
chg_state(STATEID_DATABUFF);
break;
case ACTIONID_NC_ERRORS:
chg_state(STATEID_ERROR_MSG);
break;
 
case ACTIONID_ABOUT:
chg_state(STATEID_ABOUT);
break;
 
case ACTIONID_CONN_DETAILS:
chg_state(STATEID_CONN_DETAILS);
break;
case ACTIONID_QUIT:
quit=true;
break;
 
case ACTIONID_SWITCH_NC:
mk.switch_to_navi();
break;
 
case ACTIONID_SWITCH_FC:
mk.switch_to_fc();
break;
 
case ACTIONID_SWITCH_MK3MAG:
mk.switch_to_mk3mag();
break;
case ACTIONID_GRAPH:
chg_state(STATEID_GRAPH);
break;
case ACTIONID_KEYCONTROL:
chg_state(STATEID_KEYCONTROL);
break;
case ACTIONID_LCD :
chg_state(STATEID_LCD);
break;
 
case ACTIONID_PROXY:
 
chg_state(STATEID_IPINPUT);
break;
case ACTIONID_DEVICESELECT:
chg_state(STATEID_SCANNING);
break;
case ACTIONID_RAWDEBUG:
chg_state(STATEID_RAWDEBUG);
break;
case ACTIONID_SETTINGS:
chg_state(STATEID_SETTINGSMENU);
break;
 
case ACTIONID_RCDATA:
chg_state(STATEID_STICKVIEW);
break;
 
case ACTIONID_CAM:
chg_state(STATEID_CAMMODE);
break;
 
case ACTIONID_GPSDATA:
chg_state(STATEID_GPSVIEW);
break;
 
 
case ACTIONID_MOTORTEST :
chg_state(STATEID_MOTORTEST);
break;
 
case ACTIONID_EDIT_PARAMS:
chg_state(STATEID_EDIT_PARAMS);
break;
case ACTIONID_SELECT_PARAMS:
select_paramset4edit=true;
read_paramset_intension_save=false;
if (settings.reload_settings)
{
 
mk.watchdog.act_paramset=0;
mk.params.reset();
 
chg_state(STATEID_READ_PARAMS);
}
else
{
if (mk.watchdog.act_paramset!=5)
chg_state(STATEID_READ_PARAMS);
else
chg_state(STATEID_SELECT_PARAMSET);
}
break;
 
 
case ACTIONID_WRITE_PARAM_AS:
select_paramset4edit=false;
chg_state(STATEID_SELECT_PARAMSET);
break;
 
case ACTIONID_WRITE_PARAMS:
mk.write_params(mk.params.act_paramset);
success_msg="Saved Settings"; // too optimistic
nextstate=STATEID_HANDLE_PARAMS;
chg_state(STATEID_SUCCESS_MSG);
break;
 
case ACTIONID_UNDO_PARAMS:
mk.params.use_backup();
success_msg="Settings Undo OK"; // too optimistic
nextstate=STATEID_HANDLE_PARAMS;
chg_state(STATEID_SUCCESS_MSG);
 
break;
 
case ACTIONID_MAINMENU:
chg_state(STATEID_MAINMENU);
break;
 
case ACTIONID_DEBUG:
debug.showing=true;
break;
 
case ACTIONID_TRAFFIC:
chg_state(STATEID_TRAFFIC);
break;
 
case ACTIONID_CONNECT_TCP:
ipinput4proxy=false;
chg_state(STATEID_IPINPUT);
break;
 
case ACTIONID_SCAN_BT:
chg_state(STATEID_SCANNING);
break;
 
case ACTIONID_SELECT_COM:
chg_state(STATEID_SELECT_COMPORT);
break;
 
case ACTIONID_PROXY_INPUT:
ipinput4proxy=true;
chg_state(STATEID_IPINPUT);
break;
 
}
}
 
 
public void pointerPressed (int pointer_x, int pointer_y)
{
 
if (pointer_y<lcd_img.getHeight())
keyPressed(KEY_STAR);
else
if (pointer_y>canvas_height-lcd_img.getHeight()*lcd_lines.length)
switch(state)
{
case STATEID_SETTINGSMENU:
 
settings_editor.pointer_press(pointer_x,(pointer_y-(canvas_height-lcd_img.getHeight()*lcd_lines.length))/lcd_img.getHeight()) ;
break;
 
case STATEID_EDIT_PARAMS:
params_editor.pointer_press(pointer_x,(pointer_y-(canvas_height-lcd_img.getHeight()*lcd_lines.length))/lcd_img.getHeight()) ;
 
break;
 
case STATEID_LCD:
if (pointer_x<(canvas_width/2))
keyPressed(getKeyCode(LEFT));
else
keyPressed(getKeyCode(RIGHT));
break;
case STATEID_PARAM_MENU:
case STATEID_CONN_DETAILS:
case STATEID_HANDLE_PARAMS:
case STATEID_FILEOPEN:
case STATEID_TRAFFIC:
case STATEID_SELECT_COMPORT:
case STATEID_MAINMENU:
case STATEID_SELECT_PARAMSET:
case STATEID_DEVICESELECT:
 
// if (pointer_y>canvas_height-lcd_img.getHeight()*menu_items.length)
// {
if (lcd_lines.length>max_lines)
act_menu_select=(pointer_y-(canvas_height-lcd_img.getHeight()*max_lines))/lcd_img.getHeight() +lcd_off ;
else
act_menu_select=(pointer_y-(canvas_height-lcd_img.getHeight()*lcd_lines.length))/lcd_img.getHeight() ;
keyPressed(getKeyCode(FIRE));
//}
break;
}
}
 
 
int last_keycode=-1;
int repeat_keycode=0;
public void keyPressed(int keyCode)
{
if (last_keycode==keyCode)
repeat_keycode++;
else
{
repeat_keycode=0;
last_keycode=keyCode;
}
debug.log("KeyCode:"+keyCode);
// key-actions common in all states
debug.process_key(keyCode);
if (((keyCode==KEY_STAR) || (keyCode==settings.key_back) )&&(state!=STATEID_KEYCONTROL))//&&(state!= STATEID_STRINGINPUT))
{
chg_state(STATEID_MAINMENU);
return;
}
 
 
if (((keyCode==KEY_POUND)||(keyCode==settings.key_fullscreen))&&(state!=STATEID_KEYCONTROL))
{
settings.toggle_fullscreen();
 
return;
}
 
// key actions per state
switch(state)
{
 
case STATEID_SUCCESS_MSG:
chg_state(nextstate);
break;
case STATEID_ERROR_MSG:
chg_state(STATEID_MAINMENU);
break;
case STATEID_STRINGINPUT:
if ((keyCode>=KEY_NUM2)&&(keyCode<=KEY_NUM9))
{
act_input_str=act_input_str.substring(0,ipinput_pos) +
 
 
(char)( 97 + (keyCode-KEY_NUM2)*3 + ((keyCode>KEY_NUM7)?1:0) +(repeat_keycode%(((keyCode==KEY_NUM7)||(keyCode==KEY_NUM9))?4:3)))
 
+ act_input_str.substring(ipinput_pos+1,act_input_str.length());
}
else if ((keyCode==KEY_NUM0))
{
act_input_str=act_input_str.substring(0,ipinput_pos) +
act_input_str.substring(ipinput_pos+1,act_input_str.length());
}
else
{
switch (getGameAction (keyCode))
{
 
case LEFT:
if(ipinput_pos>0) ipinput_pos--;
break;
case RIGHT:
if(ipinput_pos<19) ipinput_pos++;
break;
 
case UP:
act_input_str=act_input_str.substring(0,ipinput_pos) +
(char)((byte) act_input_str.charAt(ipinput_pos)-1) + act_input_str.substring(ipinput_pos+1,act_input_str.length());
 
break;
case DOWN:
act_input_str=act_input_str.substring(0,ipinput_pos) +
(char)((byte) act_input_str.charAt(ipinput_pos)+1) + act_input_str.substring(ipinput_pos+1,act_input_str.length());
 
break;
 
 
case FIRE:
mk.params.set_name(act_input_str);
chg_state(STATEID_HANDLE_PARAMS);
break;
}
}
if (act_input_str.length()<=ipinput_pos) act_input_str+=" ";
break;
case STATEID_IPINPUT:
if ((keyCode>=KEY_NUM0)&&(keyCode<=KEY_NUM9))
{
act_edit_ip[ipinput_pos/4]=DUBwiseHelper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),0,(keyCode-KEY_NUM0),9);
 
if(ipinput_pos<19) ipinput_pos++;
if ((ipinput_pos<18)&&(((ipinput_pos+1)%4)==0))ipinput_pos++;
}
else
switch (getGameAction (keyCode))
{
case LEFT:
if(ipinput_pos>0) ipinput_pos--;
if (((ipinput_pos+1)%4)==0)ipinput_pos--;
break;
case RIGHT:
if(ipinput_pos<19) ipinput_pos++;
if(ipinput_pos<18)if (((ipinput_pos+1)%4)==0)ipinput_pos++;
break;
 
case UP:
act_edit_ip[ipinput_pos/4]=DUBwiseHelper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),1,-1,9);
 
break;
 
case DOWN:
act_edit_ip[ipinput_pos/4]=DUBwiseHelper.mod_decimal(act_edit_ip[ipinput_pos/4],(ipinput_pos<15?2:3)-(ipinput_pos%4),-1,-1,9);
 
 
case FIRE:
if (ipinput4proxy)
{
settings.act_proxy_ip=act_edit_ip;
mk.do_proxy("socket://"+DUBwiseHelper.ip_str(settings.act_proxy_ip,false));
chg_state(STATEID_PROXY);
}
else
{
settings.act_conn_ip=act_edit_ip;
connect_mk("socket://"+DUBwiseHelper.ip_str(settings.act_conn_ip,false),"TCP/IP Connection");
chg_state(STATEID_CONN_DETAILS);
}
 
break;
 
}
break;
 
case STATEID_GPSVIEW:
if (keyCode == this.KEY_NUM0)
mk.set_gps_target(mk.gps_position.Latitude,mk.gps_position.Longitude);
if (keyCode == this.KEY_NUM1)
mk.gps_position.push_wp();
if (keyCode == this.KEY_NUM2)
chg_state(STATEID_FILEOPEN);
if (keyCode == this.KEY_NUM3)
mk.set_gps_target(mk.gps_position.LatWP[act_wp],mk.gps_position.LongWP[act_wp]);
 
 
if (keyCode == this.KEY_NUM5)
heading_offset= mk.debug_data.analog[26];
 
switch (getGameAction (keyCode))
{
case UP:
if (act_wp!=0) act_wp--;
break;
case DOWN:
if (act_wp<mk.gps_position.last_wp) act_wp++;
 
break;
 
 
}
 
break;
 
case STATEID_ABOUT:
switch (getGameAction (keyCode))
{
case UP:
if (act_menu_select>=max_lines)
act_menu_select--;
break;
case DOWN:
if (act_menu_select<lcd_lines.length-1)
act_menu_select++;
 
break;
 
 
}
 
break;
 
case STATEID_RAWDEBUG:
switch (getGameAction (keyCode))
{
case UP:
if (rawdebug_cursor_y==0)
rawdebug_cursor_y=31;
else
rawdebug_cursor_y--;
break;
case DOWN:
if (rawdebug_cursor_y==31)
rawdebug_cursor_y=0;
else
rawdebug_cursor_y++;
break;
 
 
}
break;
case STATEID_KEYCONTROL:
if (keyCode==KEY_POUND)
keycontrol_exit |= 1;
else
if (keyCode==KEY_STAR)
keycontrol_exit |= 2;
else
mod_external_control_by_keycode(keyCode,(byte)1);
 
 
 
if (keycontrol_exit==3)
chg_state(STATEID_MAINMENU);
 
/*
if ((keyCode >= this.KEY_NUM0) && (keyCode < this.KEY_NUM8))
keycontrol_bitfield[0]|=1<<(keyCode-this.KEY_NUM0);
else
if ((keyCode >= this.KEY_NUM8) && (keyCode <= this.KEY_NUM9))
keycontrol_bitfield[1]|=1<<(keyCode-this.KEY_NUM8);
else
switch (getGameAction (keyCode))
{
case UP:
keycontrol_bitfield[1]|=4;
break;
case DOWN:
keycontrol_bitfield[1]|=8;
break;
 
case LEFT:
keycontrol_bitfield[1]|=16;
break;
 
case RIGHT:
keycontrol_bitfield[1]|=32;
break;
case FIRE:
keycontrol_bitfield[1]|=64;
break;
 
}
else
mk.send_keys(keycontrol_bitfield);
*/
break;
 
 
case STATEID_MOTORTEST:
switch (getGameAction (keyCode))
{
case UP:
act_motor_increase=-1;
break;
case DOWN:
act_motor_increase=1;
break;
 
case FIRE:
motor_test_sel_all=!motor_test_sel_all;
break;
 
case LEFT:
act_motor--;
if (act_motor<0) {act_motor=0; chg_state(STATEID_MAINMENU); }
break;
 
case RIGHT:
act_motor++;
act_motor%=4;
break;
}
 
break;
 
case STATEID_SELECT_COMPORT:
if ( getGameAction (keyCode)==FIRE )
{
 
if (act_menu_select<menu_items.length)
connect_mk("comm:"+menu_items[act_menu_select]+";baudrate=57600","com"+act_menu_select);
chg_state(STATEID_CONN_DETAILS);
}
else
menu_keypress(keyCode);
break;
 
/*
case STATEID_HANDLsE_PARAMS:
menu_keypress(keyCode);
break;
*/
/*
case STATEID_TRAFFIC:
if ( getGameAction (keyCode)==FIRE )
chg_state(STATEID_CONN_DETAILS);
else
menu_keypress(keyCode);
break;
*/
//#if fileapi=="on"
case STATEID_FILEOPEN:
if ( getGameAction (keyCode)==FIRE )
{
file_access.fire();
}
else
menu_keypress(keyCode);
break;
 
//#endif
 
case STATEID_SETTINGSMENU:
settings_editor.keypress(keyCode,getGameAction (keyCode)) ;
break;
 
// handle menue
// case STATEID_SELECT_SPEED_FORMAT:
// case STATEID_SELECT_GPS_FORMAT:
case STATEID_PARAM_MENU:
case STATEID_TRAFFIC:
case STATEID_CONN_DETAILS:
case STATEID_HANDLE_PARAMS:
 
case STATEID_MAINMENU:
 
if ( getGameAction (keyCode)==FIRE )
process_action(menu_actions[act_menu_select]);
else
menu_keypress(keyCode);
 
break;
 
case STATEID_SELECT_PARAMSET:
if ( getGameAction (keyCode)==FIRE )
{
if (act_menu_select==5) // back
{
if (select_paramset4edit)
chg_state(STATEID_PARAM_MENU);
else
chg_state(STATEID_HANDLE_PARAMS); // from save as
}
else
{
if (select_paramset4edit)
// if ( mk.params.field[act_menu_select]!=null)
{
mk.params.act_paramset=act_menu_select;
chg_state(STATEID_HANDLE_PARAMS);
//success_msg="Params saved";
}
else
{
mk.write_params(act_menu_select);
nextstate=STATEID_HANDLE_PARAMS;
success_msg="saved in slot " + (act_menu_select+1) ;
chg_state(STATEID_SUCCESS_MSG); // TODO - ground too optimistic way ;-)
}
 
}
}
else menu_keypress(keyCode);
break;
 
//#if bluetooth=="on"
case STATEID_DEVICESELECT:
if ( getGameAction (keyCode)==FIRE )
{
 
if (bt_scanner.remote_device_count > act_menu_select)
{
connect_mk("btspp://"+bt_scanner.remote_device_mac[act_menu_select] + ":1",bt_scanner.remote_device_name[act_menu_select]);
chg_state(STATEID_CONN_DETAILS);
}
else
{
if (bt_scanner.remote_device_count == act_menu_select)
chg_state(STATEID_SCANNING);
else
chg_state(STATEID_CONN_DETAILS);
}
}
else menu_keypress(keyCode);
break;
//#endif
 
 
case STATEID_EDIT_PARAMS:
params_editor.keypress(keyCode,getGameAction (keyCode)) ;
break;
 
case STATEID_LCD:
 
if ((keyCode >= this.KEY_NUM0) && (keyCode <= this.KEY_NUM9))
mk.LCD.set_page(keyCode-this.KEY_NUM0);
else
switch (getGameAction (keyCode))
{
case LEFT:
case UP:
mk.LCD.LCD_PREVPAGE();
break;
case RIGHT:
case DOWN:
mk.LCD.LCD_NEXTPAGE();
break;
 
 
}
break;
}
 
}
 
 
 
 
 
 
 
}
 
 
/DUBwise/tags/v0.52/j2me/src/DUBwiseDebug.java
0,0 → 1,155
/***************************************************************
*
* Code for on Device Debugging of DUBwise
*
* Author: Marcus -LiGi- Bueschleb
* Mailto: LiGi @at@ LiGi DOTT de
*
***************************************************************/
 
import javax.microedition.lcdui.*;
 
 
public class DUBwiseDebug
extends Canvas
{
 
 
public boolean showing=false;
public boolean paused=false;
 
public String debug_msg="";
 
private byte[] debug_screen_sequence={KEY_POUND,KEY_NUM4,KEY_NUM2};
private byte debug_screen_sequence_pos=0;
 
public final static int DEBUG_HISTORY_LENGTH=100;
 
public String[] debug_msgs;
 
public int debug_pos=0;
public int debug_paused_pos=0;
 
 
int y_off=0;
 
 
public DUBwiseCanvas canvas;
 
public DUBwiseDebug(DUBwiseCanvas canvas_)
{
canvas=canvas_;
 
debug_msgs=new String[DEBUG_HISTORY_LENGTH];
for (int tmp_i=0;tmp_i<DEBUG_HISTORY_LENGTH;tmp_i++)
debug_msgs[tmp_i]="";
}
 
public void log(String str)
{
if (debug_pos==DEBUG_HISTORY_LENGTH)
debug_pos=0;
 
debug_msgs[debug_pos]=str;
debug_pos++;
// debug_msgs[debug_pos]=str;
}
 
 
public void err(String str)
{
if (debug_pos==DEBUG_HISTORY_LENGTH)
debug_pos=0;
 
debug_msgs[debug_pos]=str;
debug_pos++;
showing=false;
paused=true;
// debug_msgs[debug_pos]=str;
}
 
public void paint (Graphics g)
{
 
Font debug_font= Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL);
 
g.setFont(debug_font);
 
g.setColor(0x0000FF);
g.fillRect(0,0,canvas.getWidth(),canvas.getHeight());
g.setColor(0xFFFFFF);
 
y_off=0;
if (!paused) debug_paused_pos=debug_pos;
for (int tmp_pos=debug_paused_pos;((tmp_pos>0)&&(y_off<canvas.getHeight()));tmp_pos--)
{
debug_msg=debug_msgs[tmp_pos];
String tmp_str="";
 
for(int tmp_i=0;tmp_i<debug_msg.length();tmp_i++)
{
if ((debug_msg.charAt(tmp_i)=='\r')||(debug_msg.charAt(tmp_i)=='\n'))
{
g.drawString(tmp_str,5,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=debug_font.getHeight();
tmp_str="";
}
else
tmp_str+=debug_msg.charAt(tmp_i);
}
g.drawString(tmp_pos+" "+tmp_str,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=debug_font.getHeight();
}
 
}
public void process_key(int keyCode)
{
 
 
if (!showing)
{
if (keyCode==debug_screen_sequence[debug_screen_sequence_pos])
{
debug_screen_sequence_pos++;
if(debug_screen_sequence_pos==debug_screen_sequence.length)
{
showing=true;
debug_screen_sequence_pos=0;
}
}
else
debug_screen_sequence_pos=0;
}
else
{
if (keyCode==KEY_STAR)
showing=false;
 
if (keyCode==KEY_NUM0)
paused=!paused;
 
 
switch (getGameAction (keyCode))
{
case UP:
debug_paused_pos++;
break;
case DOWN:
debug_paused_pos--;
break;
 
}
 
}
 
 
}
 
 
}
/DUBwise/tags/v0.52/j2me/src/DUBwiseDefinitions.java
0,0 → 1,194
 
public interface DUBwiseDefinitions
{
 
// id for each state - must just be uniq - order isnt important
public final static byte STATEID_SCANNING =0;
public final static byte STATEID_DEVICESELECT =1;
public final static byte STATEID_MAINMENU =2;
public final static byte STATEID_MOTORTEST =3;
public final static byte STATEID_SELECT_PARAMSET =4;
public final static byte STATEID_EDIT_PARAMS =5;
public final static byte STATEID_HANDLE_PARAMS =6;
public final static byte STATEID_FLIGHTVIEW =7;
public final static byte STATEID_RAWDEBUG =8;
public final static byte STATEID_KEYCONTROL =9;
public final static byte STATEID_SETTINGSMENU =10;
public final static byte STATEID_STICKVIEW =11;
public final static byte STATEID_CAMMODE =12;
public final static byte STATEID_READ_PARAMS =13;
public final static byte STATEID_GPSVIEW =14;
public final static byte STATEID_FILEOPEN =15;
public final static byte STATEID_GRAPH =16;
public final static byte STATEID_CONN_DETAILS =17;
public final static byte STATEID_IPINPUT =18;
public final static byte STATEID_PROXY =19;
public final static byte STATEID_TRAFFIC =20;
public final static byte STATEID_SELECT_COMPORT =21;
public final static byte STATEID_ABOUT =22;
public final static byte STATEID_NC_ERRORS =23;
public final static byte STATEID_FLASHING =24;
public final static byte STATEID_NAMEINPUT =25;
public final static byte STATEID_DATABUFF =26;
 
public final static byte STATEID_STRINGINPUT =27;
 
 
public boolean fullscreen=false;
public byte act_motor=0;
public byte act_motor_increase=0;
public boolean motor_test_sel_all=false;
 
 
 
public final static byte ACTIONID_SETTINGS = 0;
public final static byte ACTIONID_DEVICESELECT = 1;
public final static byte ACTIONID_DEBUG = 2;
public final static byte ACTIONID_CONN_DETAILS = 3;
public final static byte ACTIONID_SWITCH_NC = 4;
public final static byte ACTIONID_SWITCH_FC = 5;
 
public final static byte ACTIONID_GRAPH = 6;
public final static byte ACTIONID_LCD = 7;
public final static byte ACTIONID_RAWDEBUG = 8;
public final static byte ACTIONID_RCDATA = 9;
public final static byte ACTIONID_KEYCONTROL = 10;
public final static byte ACTIONID_MOTORTEST = 11;
public final static byte ACTIONID_EDIT_PARAMS = 12;
public final static byte ACTIONID_CAM = 13;
public final static byte ACTIONID_PROXY = 14;
public final static byte ACTIONID_GPSDATA = 15;
public final static byte ACTIONID_TRAFFIC = 16;
public final static byte ACTIONID_ABOUT = 17;
public final static byte ACTIONID_NC_ERRORS = 18;
 
 
public final static byte ACTIONID_WRITE_PARAMS = 19;
public final static byte ACTIONID_UNDO_PARAMS = 20;
public final static byte ACTIONID_MAINMENU = 21;
 
public final static byte ACTIONID_CHANGESKIN = 22;
public final static byte ACTIONID_SOUNDTOGGLE = 23;
public final static byte ACTIONID_VIBRATOGGLE = 24;
public final static byte ACTIONID_GRAPHTOGGLE = 25;
public final static byte ACTIONID_FULLSCREENTOGGLE = 26;
public final static byte ACTIONID_LIGHTTOGGLE =27;
public final static byte ACTIONID_DATABUFF =28;
 
 
public final static byte ACTIONID_SWITCH_MK3MAG = 29;
public final static byte ACTIONID_CONNECT_TCP =30;
public final static byte ACTIONID_SCAN_BT =31;
public final static byte ACTIONID_SELECT_COM =32;
public final static byte ACTIONID_PROXY_INPUT =33;
public final static byte ACTIONID_FLASH =34;
public final static byte ACTIONID_RESET_PARAMS =35;
 
public final static byte ACTIONID_BACK_TO_CONNDETAILS=36;
 
 
public final static byte ACTIONID_QUIT = 100;
 
 
public final static String[] main_menu_items_no_connection = { "Tool Settings" , "Connection" , "Debug DUBwise" , "About","Quit " };
public final static byte[] main_menu_actions_no_connection= { ACTIONID_SETTINGS , ACTIONID_CONN_DETAILS, ACTIONID_DEBUG , ACTIONID_ABOUT, ACTIONID_QUIT};
 
 
public final static String[] main_menu_items_incompatible = { "Tool Settings" , "Connection" , "Debug DUBwise" ,"Flash Firmware", "About","Quit " };
public final static byte[] main_menu_actions_incompatible= { ACTIONID_SETTINGS , ACTIONID_CONN_DETAILS, ACTIONID_DEBUG ,ACTIONID_FLASH , ACTIONID_ABOUT, ACTIONID_QUIT};
 
 
 
public final static String[] main_menu_items_mk3mag = { "Tool Settings" , "Connection" , "Flash Firmware" , "switch to NC","Debug DUBwise" , "About","Quit " };
public final static byte[] main_menu_actions_mk3mag= { ACTIONID_SETTINGS , ACTIONID_CONN_DETAILS, ACTIONID_FLASH, ACTIONID_SWITCH_NC, ACTIONID_DEBUG , ACTIONID_ABOUT, ACTIONID_QUIT};
 
 
public final static String[] main_menu_items_mk ={"Connection", "switch to NC","Sensor Graph" , "LCD","Raw Debug", "view RC-data", "MK-KeyControl", "Motor Test" , "Flight Settings","Flash Firmware","Tool Settings","Remote Cam", "Debug" ,"About", "Quit" };
 
public final static byte[] main_menu_actions_mk = { ACTIONID_CONN_DETAILS , ACTIONID_SWITCH_NC , ACTIONID_GRAPH , ACTIONID_LCD , ACTIONID_RAWDEBUG , ACTIONID_RCDATA , ACTIONID_KEYCONTROL , ACTIONID_MOTORTEST , ACTIONID_EDIT_PARAMS,ACTIONID_FLASH , ACTIONID_SETTINGS , ACTIONID_CAM , ACTIONID_DEBUG , ACTIONID_ABOUT , ACTIONID_QUIT};
 
 
public final static String[] main_menu_items_navi={"Connection" , "view Errors", "switch to FC","switch to MK3MAG","LCD","Raw Debug", "view GPS-Data" ,"Flash Firmware","Tool Settings", "Debug" ,"About", "Quit" };
 
public final static byte[] main_menu_actions_navi = { ACTIONID_CONN_DETAILS , ACTIONID_NC_ERRORS , ACTIONID_SWITCH_FC , ACTIONID_SWITCH_MK3MAG, ACTIONID_LCD , ACTIONID_RAWDEBUG , ACTIONID_GPSDATA , ACTIONID_FLASH , ACTIONID_SETTINGS , ACTIONID_DEBUG , ACTIONID_ABOUT, ACTIONID_QUIT};
 
 
 
public final static String[] handle_params_menu_items={"write to MK","don't write to MK","discard/read again","all to default"};
public final static byte[] handle_params_menu_actions={ACTIONID_WRITE_PARAMS,ACTIONID_MAINMENU,ACTIONID_UNDO_PARAMS,ACTIONID_RESET_PARAMS};
 
 
public final static String[] conn_details_menu_items={ "packet Traffic","view Data","connect via TCP/IP","connect via BT","connect via COM","set Proxy","back" };
 
 
public final static byte[] conn_details_menu_actions={ ACTIONID_TRAFFIC,ACTIONID_DATABUFF,ACTIONID_CONNECT_TCP,ACTIONID_SCAN_BT, ACTIONID_SELECT_COM,ACTIONID_PROXY_INPUT,ACTIONID_MAINMENU};
 
 
public final static String[] settings_menu_items={"Skin ","Sound ","Vibra " ,"Scrolling_BG ","FullScreen " ,
//#if devicecontrol=="on"
"Keep_BGLight " ,
//#endif
"Back" };
public final static byte SETTINGSMENU_CHANGESKIN =0;
 
public final static byte[] settings_menu_actions={ ACTIONID_CHANGESKIN,ACTIONID_SOUNDTOGGLE, ACTIONID_VIBRATOGGLE , ACTIONID_GRAPHTOGGLE , ACTIONID_FULLSCREENTOGGLE ,
//#if devicecontrol=="on"
ACTIONID_LIGHTTOGGLE,
//#endif
ACTIONID_MAINMENU };
 
 
 
public final static String[] onlyback_menu_items={"back" };
public final static byte[] back_to_conndetails_actions={ACTIONID_BACK_TO_CONNDETAILS};
 
 
public final static byte USER_INTENT_NONE=0;
public final static byte USER_INTENT_RAWDEBUG=1;
public final static byte USER_INTENT_PARAMS=2;
public final static byte USER_INTENT_GRAPH=3;
public final static byte USER_INTENT_RCDATA=4;
public final static byte USER_INTENT_LCD=5;
 
final static byte SKINID_DARK= 0;
final static byte SKINID_LIGHT = 1;
 
 
 
final static String[] credits= {
//#expand "About DUBwise v%VERSION%",
"",
"",
"Digital UFO",
"Broadcasting With ",
"Byteelligent Service",
"Equipment",
"",
"2007-2008 by ",
"Marcus LiGi B"+(char)(252)+"schleb",
"mailto:ligi"+"@"+"ligi.de",
"",
"Licence:",
"Creative Commons(CC)",
" -Attribution",
" -Noncommercial",
" -Share Alike",
" -No Violence",
" ",
"Credits: ",
" -HolgerB&IngoB",
" -CaScAdE",
" -Orion8",
" -Joko",
" -Speedy",
" -Jamiro",
"",
"More Infos:",
" www.ligi.de",
" www.mikrokopter.com"};
 
public final static int[] default_ip={192,168,1,42,4242};
}
/DUBwise/tags/v0.52/j2me/src/DUBwiseFileAccess.java
0,0 → 1,139
/***************************************************************
*
* File Access of DUBwise
*
* Author: Marcus -LiGi- Bueschleb
* Mailto: LiGi @at@ LiGi DOTT de
*
***************************************************************/
 
//#if fileapi=="on"
import javax.microedition.io.*;
import javax.microedition.midlet.*;
import javax.microedition.io.file.*;
 
import java.io.*;
import java.util.*;
 
 
public class DUBwiseFileAccess
{
public final static int MAX_FILELIST_LENGTH=100;
public final static int MAX_PATH_DEPTH=10;
 
byte act_path_depth=0;
String[] act_path_arr;
 
 
public String act_path()
{
String res="";
for (int i=0;i<act_path_depth;i++)
res+=act_path_arr[i];
return res;
}
 
String[] file_list;
int file_list_length=0;
 
DUBwiseCanvas canvas ;
public DUBwiseFileAccess(DUBwiseCanvas _canvas )
{
canvas=_canvas;
file_list= new String[MAX_FILELIST_LENGTH];
act_path_arr=new String[MAX_PATH_DEPTH];
}
 
public void fire()
{
 
if ((canvas.act_menu_select==0)&&(act_path_depth!=0))
{
act_path_depth--;
//act_path=act_path.substring(0,act_path.substring(0,act_path.length()-2).indexOf('/') );
 
//act_path=last_path;
}
else
{
//last_path=act_path;
if (act_path_depth==0)
act_path_arr[act_path_depth++]=file_list[canvas.act_menu_select];
else
act_path_arr[act_path_depth++]=file_list[canvas.act_menu_select-1];
}
canvas.act_menu_select=0;
//chg_state(STATEID_FILEOPEN);
trigger();
}
 
 
public void trigger()
{
if (act_path_depth==0)
{
Enumeration drives = FileSystemRegistry.listRoots();
int tmp_i=0;
while(drives.hasMoreElements())
{
file_list[tmp_i]= (String) drives.nextElement();
tmp_i++;
if (MAX_FILELIST_LENGTH<tmp_i)
break;
}
file_list_length=tmp_i;
String[] menu_items=new String[tmp_i];
// lcd_lines=new String[tmp_i];
for(tmp_i=0;tmp_i<file_list_length;tmp_i++)
menu_items[tmp_i]=file_list[tmp_i];
 
canvas.setup_menu(menu_items,null);
}
else
{
 
try {
FileConnection fc = (FileConnection) Connector.open("file:///"+act_path());
Enumeration filelist = fc.list("*", true);
int tmp_i=0;
while(filelist.hasMoreElements()) {
file_list[tmp_i] = (String) filelist.nextElement();
tmp_i++;
/* fc = (FileConnection)
Connector.open("file:///CFCard/" + fileName);
if(fc.isDirectory()) {
System.out.println("\tDirectory Name: " + fileName);
} else {
System.out.println
("\tFile Name: " + fileName +
"\tSize: "+fc.fileSize());
}*/
}
String[] menu_items=new String[tmp_i+1];
// lcd_lines=new String[tmp_i+1];
file_list_length=tmp_i+1;
menu_items[0]="..";
for(tmp_i=1;tmp_i<file_list_length;tmp_i++)
menu_items[tmp_i]=file_list[tmp_i-1];
 
canvas.setup_menu(menu_items,null);
fc.close();
} catch (IOException ioe) {
System.out.println(ioe.getMessage());
}
}
 
 
}
}
//#endif
/DUBwise/tags/v0.52/j2me/src/DUBwiseHelper.java
0,0 → 1,107
import java.util.Vector;
 
public final class DUBwiseHelper
{
public final static String ip_digit_zeroes(int digit)
{ return "" + digit/100 + "" + (digit/10)%10 + "" + (digit)%10; }
 
 
public final static String pound_progress(int val,int max)
{
String res="" + (val+1) + "/" + max + " |";
for (int i=0;i<max;i++)
res+=(i<(val+1))?"#":"_";
res+="|";
return res;
}
 
 
public final static String ip_str(int[] ip,boolean with_zeroes)
{
if(with_zeroes)
return ip_digit_zeroes(ip[0]) + "." +ip_digit_zeroes(ip[1]) + "."+ip_digit_zeroes(ip[2]) + "."+ip_digit_zeroes(ip[3]) + ":"+ip_digit_zeroes(ip[4]) ;
else
return ip[0]+"."+ip[1]+"."+ip[2]+"."+ip[3]+":"+ip[4];
}
 
public final static int pow(int val,int pow)
{
int res=1;
 
for (int p=0;p<pow;p++)
res*=val;
 
return res;
}
 
 
public final static String[] split_str(String str,String sep)
{
 
Vector nodes = new Vector();
 
// Parse nodes into vector
int index = str.indexOf(sep);
while(index>=0) {
nodes.addElement( str.substring(0, index) );
str = str.substring(index+sep.length());
index = str.indexOf(sep);
}
// add last element
nodes.addElement( str );
// Create splitted string array
String[] result = new String[ nodes.size() ];
if( nodes.size()>0 ) {
for(int loop=0; loop<nodes.size(); loop++)
{
result[loop] = (String)nodes.elementAt(loop);
System.out.println(result[loop]);
}
}
 
return result;
}
 
 
 
public final static int mod_decimal(int val,int mod_power,int modder,int setter,int clipper)
{
 
int res=0;
 
for (int power=0;power<4;power++)
{
 
int act_digit=(val/pow(10,power))%10;
 
int new_digit=act_digit;
if (power==mod_power)
{
if (setter!=-1)
new_digit=setter;
new_digit+=modder;
if(new_digit<0)
new_digit=0;
 
if(new_digit>clipper)
new_digit=clipper;
 
}
 
// new_digit=1;
res+=new_digit*pow(10,power);
}
return res;
 
 
}
 
}
/DUBwise/tags/v0.52/j2me/src/DUBwiseSettings.java
0,0 → 1,351
/***************************************************************
*
* Settings related Part of DUBwise
* ( e.g. saving to / reading from RMS )
*
* Author: Marcus -LiGi- Bueschleb
* Mailto: LiGi @at@ LiGi DOTT de
*
***************************************************************/
 
import javax.microedition.rms.*;
 
import java.io.*;
 
public class DUBwiseSettings
extends org.ligi.ufo.ParamsClass
implements org.ligi.ufo.DUBwiseDefinitions,DUBwiseUIDefinitions
{
// name/handle for the recordStore to memorize some stuff
private final static String RECORD_STORE_NAME="DUBSETT_V4";
 
/* all settings hold here */
//holds id of actual skin
public byte act_skin=SKINID_DARK;
 
 
 
public int key_back;
public int key_fullscreen;
public int key_clear;
 
public int voice_delay;
public int voice_volume;
 
 
 
public int remote_cam_stick;
 
public String connection_name="";
public String connection_url="";
 
public boolean do_vibra=true;
public boolean do_sound=true;
public boolean fullscreen=false;
public boolean do_scrollbg=false;
public boolean expert_mode=false;
 
public boolean reload_settings=false;
 
 
public boolean graph_legend;
public boolean graph_scale;
 
//#if devicecontrol=="on"
public boolean keep_lighton=false;
//#endif
 
int[] act_proxy_ip=default_ip; // { ip , ip , ip , ip , port }
int[] act_conn_ip=default_ip; // { ip , ip , ip , ip , port }
 
 
public byte gps_format=GPS_FORMAT_DECIMAL;
public byte speed_format=SPEED_FORMAT_KMH;
 
 
int[] settings_field;
 
public int get_field_from_act(int pos) { return settings_field[pos];}
public void set_field_from_act(int pos,int val){
 
settings_field[pos]=val;
field2setting(pos,val);
}
 
public void toggle_fullscreen()
{
// fullscreen=!fullscreen;
set_field_from_act(1,settings_field[1]^1);
// if (fullscreen)canvas.setFullScreenMode(true);
}
 
public final static int SETTINGS_POS_SKIN=0;
public final static int SETTINGS_POS_BITFIELD1=1;
public final static int SETTINGS_POS_GPS_FORMAT=2;
public final static int SETTINGS_POS_SPEED_FORMAT=3;
public final static int SETTINGS_POS_EXTERN_NICK=4;
public final static int SETTINGS_POS_EXTERN_ROLL=5;
public final static int SETTINGS_POS_EXTERN_GIER=6;
public final static int SETTINGS_POS_EXTERN_GAS=7;
public final static int SETTINGS_POS_EXTERN_HIGHT=8;
public final static int SETTINGS_POS_KEY_BACK=9;
public final static int SETTINGS_POS_KEY_FULL=10;
public final static int SETTINGS_POS_KEY_CLEAR=11;
public final static int SETTINGS_POS_VOICEVOLUME=12;
public final static int SETTINGS_POS_VOICEDELAY=13;
public final static int SETTINGS_POS_BITFIELD2=14;
 
 
public void field2setting(int pos,int val)
{
if (pos==SETTINGS_POS_SKIN)
{
act_skin=(byte)val;
canvas.load_skin_images();
}
 
if ((pos==SETTINGS_POS_BITFIELD1)&&((val&1)==1)&&(!fullscreen))
{
fullscreen=true;
canvas.setFullScreenMode(fullscreen);
}
 
if ((pos==SETTINGS_POS_BITFIELD1)&&((val&1)==0)&&(fullscreen))
{
fullscreen=false;
canvas.setFullScreenMode(fullscreen);
}
 
if ((pos==SETTINGS_POS_BITFIELD1)&&((val&2)==2)&&(!do_scrollbg))
{
do_scrollbg=true;
canvas.load_skin_images();
}
 
if ((pos==SETTINGS_POS_BITFIELD1)&&((val&2)==0)&&(do_scrollbg))
{
do_scrollbg=false;
canvas.load_skin_images();
}
 
if (pos==SETTINGS_POS_BITFIELD1)
do_sound=((val&4)!=0);
 
if (pos==SETTINGS_POS_BITFIELD1)
do_vibra=((val&8)!=0);
 
if (pos==SETTINGS_POS_BITFIELD1)
expert_mode=((val&16)!=0);
 
if (pos==SETTINGS_POS_BITFIELD1)
keep_lighton=((val&32)!=0);
 
if (pos==SETTINGS_POS_BITFIELD1)
graph_legend=((val&64)!=0);
 
if (pos==SETTINGS_POS_BITFIELD1)
graph_scale=((val&128)!=0);
 
 
 
if (pos==SETTINGS_POS_GPS_FORMAT)
gps_format=(byte)val;
 
if (pos==SETTINGS_POS_SPEED_FORMAT)
speed_format=(byte)val;
 
if (pos==SETTINGS_POS_EXTERN_NICK)
default_extern_control[EXTERN_CONTROL_NICK]=(byte)val;
 
if (pos==SETTINGS_POS_EXTERN_ROLL)
default_extern_control[EXTERN_CONTROL_ROLL]=(byte)val;
 
if (pos==SETTINGS_POS_EXTERN_GIER)
default_extern_control[EXTERN_CONTROL_GIER]=(byte)val;
 
if (pos==SETTINGS_POS_EXTERN_GAS)
default_extern_control[EXTERN_CONTROL_GAS]=(byte)val;
 
if (pos==SETTINGS_POS_EXTERN_HIGHT)
default_extern_control[EXTERN_CONTROL_HIGHT]=(byte)val;
 
 
if (pos==SETTINGS_POS_KEY_BACK)
key_back=val;
 
if (pos==SETTINGS_POS_KEY_FULL)
key_fullscreen=val;
 
if (pos==SETTINGS_POS_KEY_CLEAR)
key_clear=val;
 
if (pos==12)
remote_cam_stick=val;
 
 
if(pos==SETTINGS_POS_VOICEVOLUME)
{
voice_volume=val;
//#if voice_mode!="no_voice"
canvas.status_voice.volume=voice_volume;
//#endif
}
if(pos==SETTINGS_POS_VOICEDELAY)
{
voice_delay=val;
//#if voice_mode!="no_voice"
canvas.status_voice.delay=voice_delay;
//#endif
}
 
if (pos==SETTINGS_POS_BITFIELD2)
do_sound=((val&1)!=0); // TODO: FIXME - extra var
 
if (pos==SETTINGS_POS_BITFIELD2)
reload_settings=((val&2)!=0);
}
 
 
public byte[] default_extern_control;//=default_extern_keycontrol ;
 
 
/* end of all settings hold here */
 
public String[] _tab_names={"User Interface","GPS","Keycontrol","Special Keys","Graph","Voice","Other" };
 
public String[][] _field_names={ { "Skin","Fullscreen","Scroll Background"
//#if devicecontrol=="on"
,"Permanent Light"
//#endif
} , {"GPS Format","Speed Format"},{"Nick","Roll","Gier","Gas Increase","Height Increase"},{"Back to Main-Menu","Fullscreen","Clear"},{"Legend","Scale-Grid"},{"Volts Output","Delay in Seconds","Volume"},{"Sound","Vibra","Remote Cam Stick","Always Reload Params","Expert-Mode"} };
 
public String[][] _choice_strings={ { "Dark","Light" } , {"km/h","mp/h","cm/s"},{"decimal","min sec"}} ;
public int[][] _field_positions={ {SETTINGS_POS_SKIN,8,9
//#if devicecontrol=="on"
,13
//#endif
} , {2,3} , {4,5,6,7,8} , {9,10,11},{SETTINGS_POS_BITFIELD1*8 +6,SETTINGS_POS_BITFIELD1*8 +7} ,{SETTINGS_POS_BITFIELD2*8+0,SETTINGS_POS_VOICEDELAY,SETTINGS_POS_VOICEVOLUME }, {10,11,12,SETTINGS_POS_BITFIELD2*8+1,12}};
public int[][] _field_types={ {PARAMTYPE_CHOICE+0,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH
//#if devicecontrol=="on"
,PARAMTYPE_BITSWITCH
//#endif
} , {PARAMTYPE_CHOICE+1,PARAMTYPE_CHOICE+2} , {PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE,PARAMTYPE_BYTE}, {PARAMTYPE_KEY,PARAMTYPE_KEY,PARAMTYPE_KEY} , {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH}, {PARAMTYPE_BITSWITCH,PARAMTYPE_BYTE,PARAMTYPE_BYTE}, {PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_STICK,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH}};
DUBwiseCanvas canvas;
 
 
 
public final static int SETTINGS_FIELD_LENGTH=42;
public DUBwiseSettings(DUBwiseCanvas _canvas)
{
canvas= _canvas;
settings_field=new int[SETTINGS_FIELD_LENGTH];
default_extern_control=new byte[11];
// set defaults
settings_field[4]=42; // nick
settings_field[5]=42; // roll
settings_field[6]=42; // gier
settings_field[7]=1; // gas
settings_field[8]=1; // hight
 
settings_field[9]=-4242; // no key
settings_field[10]=-4242; // no key
settings_field[11]=-4242; // no key
 
}
public void load()
{
 
tab_names=_tab_names;
field_names=_field_names;
field_positions=_field_positions;
field_types=_field_types;
choice_strings=_choice_strings;
try
{
RecordStore recStore = RecordStore.openRecordStore(RECORD_STORE_NAME , true );
 
if (recStore.getNumRecords()==1)
{
ByteArrayInputStream bin = new ByteArrayInputStream(recStore.getRecord(1));
DataInputStream din = new DataInputStream( bin );
 
 
connection_url=din.readUTF();
connection_name=din.readUTF();
// reserve utf's
din.readUTF();
din.readUTF();
din.readUTF();
 
 
 
for ( int i=0;i<SETTINGS_FIELD_LENGTH;i++)
settings_field[i]=din.readInt();
 
for ( int i=0;i<5;i++)
 
{
act_proxy_ip[i]=din.readInt();
act_conn_ip[i]=din.readInt();
}
 
}
recStore.closeRecordStore();
}
catch (Exception e)
{ }
 
 
for ( int i=0;i<SETTINGS_FIELD_LENGTH;i++)
field2setting(i,settings_field[i]);
 
}
 
 
public void save()
{
try
{
RecordStore.deleteRecordStore(RECORD_STORE_NAME);
}
catch (Exception e)
{ }
 
try {
RecordStore recStore = RecordStore.openRecordStore(RECORD_STORE_NAME, true );
 
ByteArrayOutputStream bout = new ByteArrayOutputStream();
DataOutputStream dout = new DataOutputStream( bout );
 
dout.writeUTF(connection_url);
dout.writeUTF(connection_name);
 
dout.writeUTF("");
dout.writeUTF("");
dout.writeUTF("");
 
 
for ( int i=0;i<SETTINGS_FIELD_LENGTH;i++)
dout.writeInt(settings_field[i]);
for ( int i=0;i<5;i++)
{
dout.writeInt(act_proxy_ip[i]);
dout.writeInt(act_conn_ip[i]);
}
recStore.addRecord(bout.toByteArray(),0,bout.size());
 
recStore.closeRecordStore();
 
 
}
catch (Exception e)
{ }
 
}
 
}
/DUBwise/tags/v0.52/j2me/src/DUBwiseUIDefinitions.java
0,0 → 1,158
public interface DUBwiseUIDefinitions
{
 
// colors
public final static int BG_COLOR_SKIN_DARK = 0x000000;
public final static int BG_COLOR_SKIN_LIGHT = 0xFFFFFF;
public final static int FG_COLOR_SKIN_DARK = 0xFFFFFF;
public final static int FG_COLOR_SKIN_LIGHT = 0x000000;
 
 
 
// id for each state - must just be uniq - order isnt important
public final static byte STATEID_INITIAL =0;
public final static byte STATEID_DEVICESELECT =1;
public final static byte STATEID_MAINMENU =2;
public final static byte STATEID_MOTORTEST =3;
public final static byte STATEID_SELECT_PARAMSET =4;
public final static byte STATEID_EDIT_PARAMS =5;
public final static byte STATEID_HANDLE_PARAMS =6;
public final static byte STATEID_LCD =7;
public final static byte STATEID_RAWDEBUG =8;
public final static byte STATEID_KEYCONTROL =9;
public final static byte STATEID_SETTINGSMENU =10;
public final static byte STATEID_STICKVIEW =11;
public final static byte STATEID_CAMMODE =12;
public final static byte STATEID_READ_PARAMS =13;
public final static byte STATEID_GPSVIEW =14;
public final static byte STATEID_FILEOPEN =15;
public final static byte STATEID_GRAPH =16;
public final static byte STATEID_CONN_DETAILS =17;
public final static byte STATEID_IPINPUT =18;
public final static byte STATEID_PROXY =19;
public final static byte STATEID_TRAFFIC =20;
public final static byte STATEID_SELECT_COMPORT =21;
public final static byte STATEID_ABOUT =22;
public final static byte STATEID_ERROR_MSG =23;
public final static byte STATEID_FLASHING =24;
public final static byte STATEID_NAMEINPUT =25;
public final static byte STATEID_DATABUFF =26;
public final static byte STATEID_HORIZON =27;
public final static byte STATEID_SUCCESS_MSG =28;
public final static byte STATEID_STRINGINPUT =29;
public final static byte STATEID_SCANNING =30;
public final static byte STATEID_RESET_PARAMS =31;
public final static byte STATEID_PARAM_MENU =32;
public final static byte STATEID_PARAM_MASSWRITE =33;
public final static byte STATEID_COUNT =34;
 
 
 
public final static byte ACTIONID_SETTINGS = 0;
public final static byte ACTIONID_DEVICESELECT = 1;
public final static byte ACTIONID_DEBUG = 2;
public final static byte ACTIONID_CONN_DETAILS = 3;
public final static byte ACTIONID_SWITCH_NC = 4;
public final static byte ACTIONID_SWITCH_FC = 5;
public final static byte ACTIONID_GRAPH = 6;
public final static byte ACTIONID_LCD = 7;
public final static byte ACTIONID_RAWDEBUG = 8;
public final static byte ACTIONID_RCDATA = 9;
public final static byte ACTIONID_KEYCONTROL = 10;
public final static byte ACTIONID_MOTORTEST = 11;
public final static byte ACTIONID_EDIT_PARAMS = 12;
public final static byte ACTIONID_CAM = 13;
public final static byte ACTIONID_PROXY = 14;
public final static byte ACTIONID_GPSDATA = 15;
public final static byte ACTIONID_TRAFFIC = 16;
public final static byte ACTIONID_ABOUT = 17;
public final static byte ACTIONID_NC_ERRORS = 18;
public final static byte ACTIONID_WRITE_PARAMS = 19;
public final static byte ACTIONID_UNDO_PARAMS = 20;
public final static byte ACTIONID_MAINMENU = 21;
public final static byte ACTIONID_HORIZON = 22;
public final static byte ACTIONID_WRITE_PARAM_AS = 23;
public final static byte ACTIONID_PARAM_WRITE_OK = 24;
public final static byte ACTIONID_PARAM_MENU = 25;
public final static byte ACTIONID_PARAM_LOAD_MOBILE = 26;
public final static byte ACTIONID_PARAM_COPY_MOBILE = 27;
public final static byte ACTIONID_DATABUFF = 28;
public final static byte ACTIONID_SWITCH_MK3MAG = 29;
public final static byte ACTIONID_CONNECT_TCP = 30;
public final static byte ACTIONID_SCAN_BT = 31;
public final static byte ACTIONID_SELECT_COM = 32;
public final static byte ACTIONID_PROXY_INPUT = 33;
public final static byte ACTIONID_FLASH = 34;
public final static byte ACTIONID_RESET_PARAMS = 35;
public final static byte ACTIONID_BACK_TO_CONNDETAILS = 36;
public final static byte ACTIONID_SELECT_PARAMS = 37;
public final static byte ACTIONID_RENAME_PARAMS = 38;
public final static byte ACTIONID_QUIT = 100;
 
 
 
 
public final static String[] param_menu_items={"Edit Settings","Copy all to Mobile","Load from Mobile","Reinitialize all","back"};
public final static byte[] param_menu_actions={ACTIONID_SELECT_PARAMS,ACTIONID_PARAM_COPY_MOBILE,ACTIONID_PARAM_LOAD_MOBILE,ACTIONID_RESET_PARAMS,ACTIONID_MAINMENU};
 
 
public final static String[] handle_params_menu_items={"Edit Content","Rename","Save AS","Save","Read Again","back"};
public final static byte[] handle_params_menu_actions={ACTIONID_EDIT_PARAMS,ACTIONID_RENAME_PARAMS,ACTIONID_WRITE_PARAM_AS,ACTIONID_WRITE_PARAMS,ACTIONID_UNDO_PARAMS,ACTIONID_SELECT_PARAMS };
 
 
/*
public final static String[] conn_details_menu_items={ "packet Traffic","view Data","connect via TCP/IP","connect via BT","connect via COM","set Proxy","back" };
public final static byte[] conn_details_menu_actions={ ACTIONID_TRAFFIC,ACTIONID_DATABUFF,ACTIONID_CONNECT_TCP,ACTIONID_SCAN_BT, ACTIONID_SELECT_COM,ACTIONID_PROXY_INPUT,ACTIONID_MAINMENU};
*/
 
public final static String[] onlyback_menu_items={"back" };
public final static byte[] back_to_conndetails_actions={ACTIONID_BACK_TO_CONNDETAILS};
 
 
final static byte SKINID_DARK= 0;
final static byte SKINID_LIGHT = 1;
 
 
 
final static String[] credits= {
//#expand "About DUBwise v%VERSION%",
"",
"",
"Digital UFO",
"Broadcasting With ",
"Byteelligent Service",
"Equipment",
"",
"2007-2008 by ",
"Marcus LiGi B"+(char)(252)+"schleb",
"mailto:ligi"+"@"+"ligi.de",
"",
"Licence:",
"Creative Commons(CC)",
" -Attribution",
" -Noncommercial",
" -Share Alike",
" -No Violence",
" ",
"Credits: ",
" -HolgerB&IngoB",
" -CaScAdE",
" -Orion8",
" -Joko",
" -Speedy",
" -Jamiro",
"",
"More Infos:",
" www.ligi.de",
" www.mikrokopter.com"};
 
public final static char[] idle_seq={'.','_','-','='};
 
 
public final static int[] default_ip={192,168,1,42,4242};
 
 
 
 
}
/DUBwise/tags/v0.52/j2me/src/MKParamsEditor.java
0,0 → 1,343
/********************************************************
*
* class to handle Editing of MK Params via MIDP / J2ME
*
* Author: Marcus -LiGi- Bueschleb
*
********************************************************/
 
import javax.microedition.lcdui.*;
 
public class MKParamsEditor
implements org.ligi.ufo.MKParamDefinitions
{
 
public byte nextstate;
 
private int act_tab=0;
public int act_y=1;
private int act_lcd_lines=10;
 
DUBwiseCanvas canvas;
 
public String[] lcd_lines;
 
public String[] menu_items;
 
org.ligi.ufo.ParamsClass edit_source;
 
 
public MKParamsEditor(DUBwiseCanvas _canvas,org.ligi.ufo.ParamsClass _edit_source,byte _nextstate)
{
nextstate=_nextstate;
edit_source=_edit_source;
 
canvas=_canvas;
lcd_lines=new String[40];
// refresh_lcd();
}
 
 
boolean select_mode=true;
 
 
public void paint ( Graphics g)
{
if (select_mode)
{
if (canvas.menu_items[0]!=edit_source.tab_names[0]) // usefull?
{
act_y=1;
menu_items=new String[edit_source.tab_names.length+1];
for(int p=0;p<edit_source.tab_names.length;p++)
menu_items[p]=edit_source.tab_names[p];
menu_items[edit_source.tab_names.length]="back";
canvas.setup_menu(menu_items,null);
}
canvas.paint_menu(g);
}
 
else
{
refresh_lcd();
// canvas.paint_lcd(g,false);
canvas.paint_lcd(g);
}
}
 
public void refresh_lcd()
{
 
try {
act_lcd_lines=edit_source.field_names[act_tab].length*2+2;
for ( int i=0;i<act_lcd_lines;i++)
lcd_lines[i]="";
// lcd_lines[0]=(act_tab==0?" ":"< ") + edit_source.tab_names[act_tab] + (act_tab==(edit_source.tab_names.length-1)?" ":" >");
for (int i=0;i<edit_source.field_names[act_tab].length;i++)
{
lcd_lines[2*i]=edit_source.field_names[act_tab][i];
switch(edit_source.field_types[act_tab][i])
{
case PARAMTYPE_BITSWITCH:
lcd_lines[1+2*i]=" " + (((edit_source.get_field_from_act(edit_source.field_positions[act_tab][i]/8)&(1<<edit_source.field_positions[act_tab][i]%8))==0)?"off":"on" ) ;
break;
 
case PARAMTYPE_BYTE:
lcd_lines[1+2*i]=" "+edit_source.get_field_from_act(edit_source.field_positions[act_tab][i]);
 
break;
 
case PARAMTYPE_BITMASK:
lcd_lines[1+2*i]=" "+edit_source.get_field_from_act(edit_source.field_positions[act_tab][i]);
if ((edit_source.get_field_from_act(edit_source.field_positions[act_tab][i])>250)&&(edit_source.get_field_from_act(edit_source.field_positions[act_tab][i])<256))
lcd_lines[1+2*i]+="[Poti"+(edit_source.get_field_from_act(edit_source.field_positions[act_tab][i])-250) +"]";
else
{
lcd_lines[1+2*i]+=" [";
for (int bit=0;bit<8;bit++)
lcd_lines[1+2*i]+=((edit_source.get_field_from_act(edit_source.field_positions[act_tab][i]) & ( 1<<bit)) !=0)?"+":"-";
lcd_lines[1+2*i]+="]";
}
break;
 
case PARAMTYPE_MKBYTE:
lcd_lines[1+2*i]=" "+edit_source.get_field_from_act(edit_source.field_positions[act_tab][i]);
if ((edit_source.get_field_from_act(edit_source.field_positions[act_tab][i])>250)&&(edit_source.get_field_from_act(edit_source.field_positions[act_tab][i])<256))
lcd_lines[1+2*i]+=" [Poti"+(edit_source.get_field_from_act(edit_source.field_positions[act_tab][i])-250) +"]";
break;
 
 
case PARAMTYPE_KEY:
if (edit_source.get_field_from_act(edit_source.field_positions[act_tab][i])==-4242)
lcd_lines[1+2*i]="none";
else
lcd_lines[1+2*i]=" "+edit_source.get_field_from_act(edit_source.field_positions[act_tab][i]);
break;
case PARAMTYPE_STICK:
lcd_lines[1+2*i]=" "+edit_source.get_field_from_act(edit_source.field_positions[act_tab][i]);
break;
default:
lcd_lines[1+2*i]=" "+edit_source.choice_strings[edit_source.field_types[act_tab][i]-PARAMTYPE_CHOICE][edit_source.get_field_from_act(edit_source.field_positions[act_tab][i])];
}
}
lcd_lines[act_lcd_lines-1]="back";
canvas.lcd_lines=new String[act_lcd_lines];
for ( int i=0;i<act_lcd_lines;i++)
{
lcd_lines[i]=(act_y==i?"#":" ")+lcd_lines[i];
while(lcd_lines[i].length()<20)
lcd_lines[i]+=" ";
 
canvas.lcd_lines[i]=lcd_lines[i];
}
 
}
 
catch (Exception e){}
// for(int i=0;i<act_lcd_lines;i++)
 
/*
}
else
{
canvas.lcd_lines=new String[1];
canvas.lcd_lines[0]="reading params";
}
*/
}
 
 
public final static int KEYCODE_CLEAR=-8;
public boolean editing_number=false;
 
public void pointer_press(int x,int row)
{
 
System.out.println("!!!!!!!!!!!!!!row:"+row);
if (select_mode)
{
canvas.act_menu_select=row;
keypress (-4242,Canvas.FIRE);
 
}
else
{
if ((row%2)==0)
act_y=row+1;
else
{
act_y=row;
 
if (act_y==(canvas.lcd_lines.length-1))
keypress (-4242,Canvas.FIRE);
else
{
if (x<(canvas.canvas_width/2))
keypress (-4242,Canvas.LEFT);
else
keypress (-4242,Canvas.RIGHT);
}
}
}
}
 
 
public void keypress (int keyCode,int action)
{
 
if (select_mode)
{
if (action== Canvas.FIRE)
{
 
if (canvas.act_menu_select==(menu_items.length-1))
canvas.chg_state(nextstate);
else
 
{
act_tab=canvas.act_menu_select;
select_mode=false;
act_y=1;
}
}
else
canvas.menu_keypress(keyCode);
}
else
{
 
 
if ((act_y!=(act_lcd_lines-1))&&(((keyCode >= Canvas.KEY_NUM0) && (keyCode <= Canvas.KEY_NUM9))|| ( keyCode==KEYCODE_CLEAR)))
{
int act_pos=act_y/2;
if((edit_source.field_types[act_tab][act_pos]==edit_source.PARAMTYPE_BYTE)||(edit_source.field_types[act_tab][act_pos]==edit_source.PARAMTYPE_MKBYTE) ||(edit_source.field_types[act_tab][act_pos]==edit_source.PARAMTYPE_BITMASK))
{
if ((keyCode >= Canvas.KEY_NUM0) && (keyCode <= Canvas.KEY_NUM9))
{
if((editing_number)&&( Math.abs(edit_source.get_field_from_act(edit_source.field_positions[act_tab][act_pos]))*10+(keyCode - Canvas.KEY_NUM0)<1000))
edit_source.set_field_from_act(edit_source.field_positions[act_tab][act_pos] , Math.abs(edit_source.get_field_from_act(edit_source.field_positions[act_tab][act_pos]))*10+(keyCode - Canvas.KEY_NUM0));
else
edit_source.set_field_from_act(edit_source.field_positions[act_tab][act_pos] , (keyCode - Canvas.KEY_NUM0));
editing_number=true;
return;
}
else
if ( keyCode==KEYCODE_CLEAR)
edit_source.set_field_from_act(edit_source.field_positions[act_tab][act_pos],0);
}
editing_number=false;
}
 
switch (action)
{
case Canvas.DOWN:
if (act_y<(act_lcd_lines-2)) act_y+=2;
else act_y=1;
break;
case Canvas.UP:
if (act_y!=1) act_y-=2;
else act_y=act_lcd_lines-1;
break;
default:
 
 
 
if (act_y!=(act_lcd_lines-1))
{
 
//
 
int act_pos=act_y/2;
 
if((edit_source.field_types[act_tab][act_pos]==edit_source.PARAMTYPE_KEY))
edit_source.set_field_from_act(edit_source.field_positions[act_tab][act_pos],keyCode);
switch (action)
{
case Canvas.RIGHT:
switch(edit_source.field_types[act_tab][act_pos])
{
case PARAMTYPE_BITSWITCH:
edit_source.field_from_act_xor((edit_source.field_positions[act_tab][act_pos]/8),1<<(edit_source.field_positions[act_tab][act_pos]%8));
break;
case PARAMTYPE_BITMASK:
case PARAMTYPE_MKBYTE:
case PARAMTYPE_BYTE:
 
edit_source.field_from_act_add_min_max(edit_source.field_positions[act_tab][act_pos],1,0,255);
break;
case PARAMTYPE_STICK:
edit_source.field_from_act_add_min_max(edit_source.field_positions[act_tab][act_pos],1,0,10);
break;
default:
edit_source.field_from_act_add_mod(edit_source.field_positions[act_tab][act_pos],1,edit_source.choice_strings[edit_source.field_types[act_tab][act_pos]-PARAMTYPE_CHOICE].length);
break;
}
break;
case Canvas.LEFT:
switch(edit_source.field_types[act_tab][act_pos])
{
case PARAMTYPE_BITSWITCH:
edit_source.field_from_act_xor((edit_source.field_positions[act_tab][act_pos]/8),1<<(edit_source.field_positions[act_tab][act_pos]%8));
break;
case PARAMTYPE_BITMASK:
case PARAMTYPE_MKBYTE:
case PARAMTYPE_BYTE:
edit_source.field_from_act_add_min_max(edit_source.field_positions[act_tab][act_pos],-1,0,255);
break;
case PARAMTYPE_STICK:
edit_source.field_from_act_add_min_max(edit_source.field_positions[act_tab][act_pos],-1,0,10);
break;
default:
edit_source.field_from_act_add_mod(edit_source.field_positions[act_tab][act_pos],1,edit_source.choice_strings[edit_source.field_types[act_tab][act_pos]-PARAMTYPE_CHOICE].length);
break;
}
break;
}
}
else
if (action== Canvas.FIRE)
{
act_y=1;
// canvas.act_menu_select=0;
canvas.menu_items[0]="";
select_mode=true;
 
}
}
// if (!select_mode)refresh_lcd();
}
} // keypress
}
 
/DUBwise/tags/v0.52/j2me/src/MKStatusVoice.java
0,0 → 1,149
/******************************************
*
* Voice output for MK
*
* Author: Marcus -LiGi- Bueschleb
*
*******************************************/
 
import javax.microedition.media.*;
import javax.microedition.media.control.*;
import java.util.*;
import java.io.*;
 
 
public class MKStatusVoice
implements Runnable,PlayerListener
{
 
org.ligi.ufo.MKCommunicator mk=null;
DUBwiseCanvas canvas=null;
Player player;
public final int PLAYERSTATE_IDLE=0;
public final int PLAYERSTATE_PLAYING=1;
public final int PLAYERSTATE_FIN=2;
 
 
public int volume=100;
public int delay=5;
 
int act_player_state=PLAYERSTATE_IDLE;
VolumeControl vc;
 
public MKStatusVoice(org.ligi.ufo.MKCommunicator _mk,DUBwiseCanvas _canvas)
{
canvas=_canvas;
mk=_mk;
new Thread( this ).start(); // fire up main Thread
}
 
public void playerUpdate(Player player, String event, Object data)
{
if(event == PlayerListener.END_OF_MEDIA) {
try {
defplayer();
}
catch(MediaException me) { }
act_player_state=PLAYERSTATE_FIN;
player=null;
 
}
}
void defplayer() throws MediaException {
if (player != null) {
if(player.getState() == Player.STARTED) {
player.stop();
}
if(player.getState() == Player.PREFETCHED) {
player.deallocate();
}
if(player.getState() == Player.REALIZED || player.getState() == Player.UNREALIZED) {
player.close();
}
}
player = null;
}
 
 
public void start_playing(String name)
{
try {
try {
player = Manager.createPlayer(getClass().getResourceAsStream(name+".mp3"), "audio/mp3");
}
catch (Exception e) {
player = Manager.createPlayer(getClass().getResourceAsStream(name+".wav"), "audio/x-wav");
}
player.addPlayerListener(this);
player.realize();
act_player_state=PLAYERSTATE_PLAYING;
 
vc = (VolumeControl) player.getControl("VolumeControl");
if(vc != null) {
vc.setLevel(volume);
}
 
player.prefetch();
player.setLoopCount(1);
player.start();
}
catch (Exception e) {
}
}
public void wait_for_end()
{
while (act_player_state!=PLAYERSTATE_FIN)
{
try { Thread.sleep(5); }
catch (Exception e) { }
}
 
}
 
int info_from_debug_set=-1;
public void run()
{
while(true)
{
if (mk.connected&&(canvas.settings.do_sound)&&(mk.debug_data.UBatt()!=-1)&&(!mk.force_disconnect))
{
int ubatt=mk.debug_data.UBatt();
if (info_from_debug_set!=mk.stats.debug_data_count)
{
info_from_debug_set=mk.stats.debug_data_count;
start_playing(""+(ubatt/10));
wait_for_end();
if((ubatt%10)!=0)
{
start_playing("komma");
wait_for_end();
start_playing(""+(ubatt%10));
wait_for_end();
}
start_playing("volt");
}
}
 
try {
if (delay<1)
Thread.sleep(1000);
else
Thread.sleep(delay*1000);
}
catch (Exception e) { }
}
}
 
}
/DUBwise/tags/v0.52/j2me
Property changes:
Added: svn:ignore
+tmp
+build
+bin_tmp
+*.tmp
+
/DUBwise/tags/v0.52/misc/firmware_prepare/hex2bin.rb
0,0 → 1,35
require 'rio'
 
plain_str=""
rio(ARGV[0]).read.each_line {|l|
# plain_str << l[11..-3].delete("\n\r")
 
puts l
l.delete!("\n\r")
plain_str<< l[9,(l.length-11)]
puts ">"+ l[9,(l.length-11)]
}
 
 
puts plain_str.length/2.0
 
#return
new = []
(plain_str.length/2).times {|i|
new << (plain_str[(i*2)..(i*2+1)].to_i(16))
}
 
 
foo=rio(ARGV[1])
foo.write( ((new.length >> 24 )&0xff).chr)
foo.write( ((new.length >> 16 )&0xff).chr)
foo.write( ((new.length >> 8 )&0xff).chr)
foo.write( ((new.length&0xff)).chr)
new.each { |c|
foo.write( c.chr)
}
 
puts new.length
 
 
 
/DUBwise/tags/v0.52/misc/firmware_prepare/prepare_all.rb
0,0 → 1,24
 
Dir["*.hex"].each { |f|
 
case
when f=~ /Navi/
`ruby hex2bin.rb #{f} /home/ligi/prj/DUBwise/j2me/res/firmwares/all_firmwares/navi.bin`
 
p "written nc"
 
 
when f =~ /Flight/
`ruby hex2bin.rb #{f} /home/ligi/prj/DUBwise/j2me/res/firmwares/all_firmwares/fc.bin`
p "written fc"
 
when f =~ /MK3Ma/
`ruby hex2bin.rb #{f} /home/ligi/prj/DUBwise/j2me/res/firmwares/all_firmwares/mk3.bin`
p "written mk3"
 
else
p "cant handle" + f
 
end
 
}
/DUBwise/tags/v0.52/misc/firmwares/list
0,0 → 1,2
0.71h:fc.bin
0.71h_ligi:fc_ligi.bin
/DUBwise/tags/v0.52/misc/messenger.rb
0,0 → 1,135
# mailto: ligi atttt ligi dotttt de
require 'socket'
require 'fcntl'
 
class IPSocket
def portInfo(out = STDOUT)
out.puts "local: #{addr[1]}\n" +
"remote: #{peeraddr[1]}"
end
end
 
 
 
if ARGV.length!=1 || !ARGV[0].include?(":")
puts "USAGE:"
puts "$> ruby messenger.rb [ip:port]"
puts ""
puts "using default address"
host="0"
port=9876
else
host=ARGV[0].split(":").first
port=ARGV[0].split(":").last.to_i
end
 
 
 
puts "starting server at ip " + host + " port:" + port.to_s
serverSocket = TCPServer.new(host,port)
 
slots={ }
server = Thread.start {
while (clientSocket = serverSocket.accept)
Thread.start {
clientSocket_= clientSocket
clientSocket_.portInfo
 
 
while true
 
begin
 
command=clientSocket_.gets
puts command
case
when command =~ /new/
clientSocket_.puts "new"
if slots[command.delete("\r\n").split(":").last].nil?
slots[command.delete("\r\n").split(":").last]={:from=>clientSocket_ , :to=>nil}
break
else
clientSocket_.puts "slot exists"
end
when command =~ /conn/
 
case
when slots[command.delete("\r\n").split(":").last].nil?
clientSocket_.puts "slot not found"
when !slots[command.delete("\r\n").split(":").last][:to].nil?
clientSocket_.puts "slot has partner"
else
clientSocket_.puts "conn"
slots[command.delete("\r\n").split(":").last][:to]=clientSocket_
 
break
end
 
when command =~ /all/
# clientSocket_.puts slots.keys
if slots=={}
clientSocket_.puts "none"
else
slots.keys.each_with_index {|slot,i|
clientSocket_.puts i.to_s + " | " + slot + ((slots[slot][:to].nil?)?"| free":"| connected")
}
end
 
else
clientSocket_.puts "Unknown command"
 
end
 
rescue =>e
puts "err" + e
end
end
}
end
}
 
while true
slots.each { |slot_name,hash|
 
#puts " processing " + slot_name
 
 
if !hash[:to].nil?
begin
 
got=hash[:to].read_nonblock(3000)
puts slot_name +"<"+ got
hash[:from].write got
hash[:to].flush
 
rescue Errno::EAGAIN => e
rescue =>e
slots[slot_name][:to]=nil
p e
 
end
end
 
begin
 
got=hash[:from].read_nonblock(3000)
puts slot_name +">"+ got
hash[:to].write got if !hash[:to].nil?
hash[:to].flush if !hash[:to].nil?
 
rescue Errno::EAGAIN => e
rescue =>e
hash[:to].close if !hash[:to].nil?
slots.delete(slot_name)
p e
 
end
 
#
}
sleep 0.00005
 
 
 
end
/DUBwise/tags/v0.52/misc/pc-komp-ref/definitions
0,0 → 1,299
--Kanalbelegung[8]
to_cat("Channels", [
 
{:pos=>act_pos , :name=>"Nick" , :typ=>"STICK" },
{:pos=>act_pos+1 , :name=>"Roll" , :typ=>"STICK" },
{:pos=>act_pos+2 , :name=>"Accelerate" , :typ=>"STICK" },
{:pos=>act_pos+3 , :name=>"Gier" , :typ=>"STICK" },
{:pos=>act_pos+4 , :name=>"POTI1" , :typ=>"STICK" },
{:pos=>act_pos+5 , :name=>"POTI2" , :typ=>"STICK" },
{:pos=>act_pos+6 , :name=>"POTI3" , :typ=>"STICK" },
{:pos=>act_pos+7 , :name=>"POTI4" , :typ=>"STICK" },
])
 
act_pos+=8
 
--GlobalConfigOld;
 
to_cat("Configuration", [
{:pos=>act_pos*8 , :name=>"ALTITUDE_CONTROL" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+1 , :name=>"Switch for Setpoint" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+2 , :name=>"Heading Hold" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+3 , :name=>"Compas Active" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+5 , :name=>"GPS" , :typ=>"BITSWITCH" },
])
 
 
act_pos+=1
 
--GlobalConfig;
 
to_cat("Configuration", [
{:pos=>act_pos*8 , :name=>"ALTITUDE_CONTROL" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+1 , :name=>"Switch for Setpoint" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+2 , :name=>"Heading Hold" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+3 , :name=>"Compas Active" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+4 , :name=>"Compas Fix" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+5 , :name=>"GPS" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+6 , :name=>"Coupling" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+7 , :name=>"Yaw Rate Limiter" , :typ=>"BITSWITCH" }
])
 
 
act_pos+=1
 
--Hoehe_MinGas;
to_cat("Altitude", [{ :pos=>act_pos , :name=>"Min. Accelerate" , :typ=>"MKBYTE" }] )
act_pos+=1
--Luftdruck_D;
to_cat("Altitude", [{ :pos=>act_pos , :name=>"Barometric D" , :typ=>"MKBYTE" }] )
act_pos+=1
--MaxHoehe;
to_cat("Altitude", [{ :pos=>act_pos , :name=>"Setpoint" , :typ=>"MKBYTE" }] )
act_pos+=1
--Hoehe_P;
to_cat("Altitude", [{ :pos=>act_pos , :name=>"Altitude P" , :typ=>"MKBYTE" }] )
act_pos+=1
--Hoehe_Verstaerkung;
to_cat("Altitude", [{ :pos=>act_pos , :name=>"Gain" , :typ=>"MKBYTE" }] )
act_pos+=1
--Hoehe_ACC_Wirkung;
to_cat("Altitude", [{ :pos=>act_pos , :name=>"Z-ACC" , :typ=>"MKBYTE" }] )
act_pos+=1
--Stick_P;
to_cat("Stick", [{ :pos=>act_pos , :name=>"Nick/Roll P" , :typ=>"MKBYTE" }] )
act_pos+=1
--Stick_D;
to_cat("Stick", [{ :pos=>act_pos , :name=>"Nick/Roll D" , :typ=>"MKBYTE" }] )
act_pos+=1
--Gier_P;
to_cat("Stick", [{ :pos=>act_pos , :name=>"Gier P" , :typ=>"MKBYTE" }] )
act_pos+=1
--Gas_Min;
to_cat("Other", [{ :pos=>act_pos , :name=>"Min Gas" , :typ=>"MKBYTE" }] )
act_pos+=1
--Gas_Max;
to_cat("Other", [{ :pos=>act_pos , :name=>"Max Gas" , :typ=>"MKBYTE" }] )
act_pos+=1
--GyroAccFaktor;
to_cat("Gyro", [{ :pos=>act_pos , :name=>"ACC/Gyro Factor" , :typ=>"MKBYTE" }] )
act_pos+=1
--KompassWirkung;
to_cat("Other", [{ :pos=>act_pos , :name=>"Compass Effect" , :typ=>"MKBYTE" }] )
act_pos+=1
--Gyro_P;
to_cat("Gyro", [{ :pos=>act_pos , :name=>"P-Rate" , :typ=>"MKBYTE" }] )
act_pos+=1
--Gyro_I;
to_cat("Gyro", [{ :pos=>act_pos , :name=>"I-Rate" , :typ=>"MKBYTE" }] )
act_pos+=1
--Gyro_D;
to_cat("Gyro", [{ :pos=>act_pos , :name=>"D-Rate" , :typ=>"MKBYTE" }] )
act_pos+=1
 
--UnterspannungsWarnung;
to_cat("Other", [{ :pos=>act_pos , :name=>"Voltage Warning" , :typ=>"MKBYTE" }] )
act_pos+=1
--NotGas;
to_cat("Other", [{ :pos=>act_pos , :name=>"Distress Gas" , :typ=>"MKBYTE" }] )
act_pos+=1
--NotGasZeit;
to_cat("Other", [{ :pos=>act_pos , :name=>"Distress Gas Time" , :typ=>"MKBYTE" }] )
act_pos+=1
--UfoAusrichtung;
act_pos+=1
--I_Faktor;
act_pos+=1
--UserParam1;
to_cat("User", [{ :pos=>act_pos , :name=>"Param 1" , :typ=>"MKBYTE" }] )
act_pos+=1
--UserParam2;
to_cat("User", [{ :pos=>act_pos , :name=>"Param 2" , :typ=>"MKBYTE" }] )
act_pos+=1
--UserParam3;
to_cat("User", [{ :pos=>act_pos , :name=>"Param 3" , :typ=>"MKBYTE" }] )
act_pos+=1
--UserParam4;
to_cat("User", [{ :pos=>act_pos , :name=>"Param 4" , :typ=>"MKBYTE" }] )
act_pos+=1
--ServoNickControl;
to_cat("Camera", [{ :pos=>act_pos , :name=>"Servo control" , :typ=>"MKBYTE" }] )
act_pos+=1
--ServoNickComp;
to_cat("Camera", [{ :pos=>act_pos , :name=>"Nick compensation" , :typ=>"MKBYTE" }] )
act_pos+=1
--ServoNickMin;
to_cat("Camera", [{ :pos=>act_pos , :name=>"Servo min" , :typ=>"MKBYTE" }] )
act_pos+=1
--ServoNickMax;
to_cat("Camera", [{ :pos=>act_pos , :name=>"Servo max" , :typ=>"MKBYTE" }] )
act_pos+=1
--ServoNickRefresh;
to_cat("Camera", [{ :pos=>act_pos , :name=>"Refresh rate" , :typ=>"MKBYTE" }] )
act_pos+=1
--LoopGasLimit;
to_cat("Looping", [{ :pos=>act_pos , :name=>"Gas Limit" , :typ=>"MKBYTE" }] )
act_pos+=1
--LoopThreshold;
to_cat("Looping", [{ :pos=>act_pos , :name=>"Threshold" , :typ=>"MKBYTE" }] )
act_pos+=1
--LoopHysterese;
to_cat("Looping", [{ :pos=>act_pos , :name=>"Hysterese" , :typ=>"MKBYTE" }] )
act_pos+=1
--AchsKopplung1;
to_cat("Coupling", [{ :pos=>act_pos , :name=>"Yaw pos. feedback" , :typ=>"MKBYTE" }] )
act_pos+=1
 
--AchsKopplung2;
to_cat("Coupling", [{ :pos=>act_pos , :name=>"Coupling2" , :typ=>"MKBYTE" }] )
act_pos+=1
 
--CouplingYawCorrection;
to_cat("Coupling", [{ :pos=>act_pos , :name=>"Coupling YawCorrect" , :typ=>"MKBYTE" }] )
act_pos+=1
 
 
--AchsGegenKopplung1;
to_cat("Coupling", [{ :pos=>act_pos , :name=>"Yaw neg. feedback" , :typ=>"MKBYTE" }] )
act_pos+=1
--WinkelUmschlagNick;
to_cat("Looping", [{ :pos=>act_pos , :name=>"TurnOver Nick" , :typ=>"MKBYTE" }] )
act_pos+=1
--WinkelUmschlagRoll;
to_cat("Looping", [{ :pos=>act_pos , :name=>"TurnOver Roll" , :typ=>"MKBYTE" }] )
act_pos+=1
--GyroAccAbgleich;
to_cat("Gyro", [{ :pos=>act_pos , :name=>"ACC/Gyro Comp" , :typ=>"MKBYTE" }] )
act_pos+=1
--Driftkomp;
to_cat("Gyro", [{ :pos=>act_pos , :name=>"Drift-Compensation" , :typ=>"MKBYTE" }] )
act_pos+=1
--DynamicStability;
to_cat("Gyro", [{ :pos=>act_pos , :name=>"Dynamic stability" , :typ=>"MKBYTE" }] )
act_pos+=1
--UserParam5;
to_cat("User", [{ :pos=>act_pos , :name=>"Param 5" , :typ=>"MKBYTE" }] )
act_pos+=1
--UserParam6;
to_cat("User", [{ :pos=>act_pos , :name=>"Param 6" , :typ=>"MKBYTE" }] )
act_pos+=1
--UserParam7;
to_cat("User", [{ :pos=>act_pos , :name=>"Param 7" , :typ=>"MKBYTE" }] )
act_pos+=1
--UserParam8;
to_cat("User", [{ :pos=>act_pos , :name=>"Param 8" , :typ=>"MKBYTE" }] )
act_pos+=1
--LoopConfig;
 
to_cat("Looping", [
{:pos=>act_pos*8 , :name=>"UP" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+1 , :name=>"DOWN" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+2 , :name=>"LEFT" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+3 , :name=>"RIGHT" , :typ=>"BITSWITCH" }
])
act_pos+=1
--ServoNickCompInvert;
to_cat("Camera", [{ :pos=>act_pos*8 , :name=>"Invert Direction" , :typ=>"BITSWITCH" }] )
act_pos+=1
--J16Bitmask;
to_cat("Output", [{ :pos=>act_pos , :name=>"J16 Bitmask" , :typ=>"BITMASK" }] )
act_pos+=1
--J16Timing;
to_cat("Output", [{ :pos=>act_pos , :name=>"J16 Timing" , :typ=>"MKBYTE" }] )
act_pos+=1
--J17Bitmask;
to_cat("Output", [{ :pos=>act_pos , :name=>"J17 Bitmask" , :typ=>"BITMASK" }] )
act_pos+=1
--J17Timing;
to_cat("Output", [{ :pos=>act_pos , :name=>"J17 Timing" , :typ=>"MKBYTE" }] )
act_pos+=1
--NaviGpsModeControl;
to_cat("Navi", [{ :pos=>act_pos , :name=>"Mode Control" , :typ=>"MKBYTE" }] )
act_pos+=1
--NaviGpsGain;
to_cat("Navi", [{ :pos=>act_pos , :name=>"GPS-Gain" , :typ=>"MKBYTE" }] )
act_pos+=1
--NaviGpsP;
to_cat("Navi", [{ :pos=>act_pos , :name=>"GPS-P" , :typ=>"MKBYTE" }] )
act_pos+=1
 
--NaviGpsPLimit;
to_cat("Navi", [{ :pos=>act_pos , :name=>"GPS-P Limit" , :typ=>"MKBYTE" }] )
act_pos+=1
 
 
--NaviGpsI;
to_cat("Navi", [{ :pos=>act_pos , :name=>"GPS-I" , :typ=>"MKBYTE" }] )
act_pos+=1
 
--NaviGpsILimit;
to_cat("Navi", [{ :pos=>act_pos , :name=>"GPS-I Limit" , :typ=>"MKBYTE" }] )
act_pos+=1
--NaviGpsD;
to_cat("Navi", [{ :pos=>act_pos , :name=>"GPS-D" , :typ=>"MKBYTE" }] )
act_pos+=1
--NaviGpsDLimit;
to_cat("Navi", [{ :pos=>act_pos , :name=>"GPS-D Limit" , :typ=>"MKBYTE" }] )
act_pos+=1
--NaviGpsACC;
to_cat("Navi", [{ :pos=>act_pos , :name=>"GPS-ACC" , :typ=>"MKBYTE" }] )
act_pos+=1
--NaviGpsMinSat;
to_cat("Navi", [{ :pos=>act_pos , :name=>"Satelite Minimum" , :typ=>"MKBYTE" }] )
act_pos+=1
--NaviStickThreshold;
to_cat("Navi", [{ :pos=>act_pos , :name=>"Stick Threhsold" , :typ=>"MKBYTE" }] )
act_pos+=1
--ExternalControl;
to_cat("Stick", [{ :pos=>act_pos , :name=>"External Control" , :typ=>"MKBYTE" }] )
act_pos+=1
 
 
--NaviWindCorrection;
to_cat("Navi", [{ :pos=>act_pos , :name=>"Wind Correction" , :typ=>"MKBYTE" }] )
act_pos+=1
 
 
--NaviSpeedCompensation;
to_cat("Navi", [{ :pos=>act_pos , :name=>"Speed Compensation" , :typ=>"MKBYTE" }] )
act_pos+=1
 
--NaviOperatingRadius;
to_cat("Navi", [{ :pos=>act_pos , :name=>"Operating Radius" , :typ=>"MKBYTE" }] )
act_pos+=1
 
 
--BitConfig;
 
to_cat("Looping", [
{:pos=>act_pos*8 , :name=>"UP" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+1 , :name=>"DOWN" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+2 , :name=>"LEFT" , :typ=>"BITSWITCH" },
{:pos=>act_pos*8+3 , :name=>"RIGHT" , :typ=>"BITSWITCH" }
])
 
to_cat("Altitude", [
{:pos=>act_pos*8+4 , :name=>"3-Way switch" , :typ=>"BITSWITCH" }
])
 
 
act_pos+=1
 
--NaviAngleLimitation;
to_cat("Navi", [{ :pos=>act_pos , :name=>"Angle Limit" , :typ=>"MKBYTE" }] )
act_pos+=1
 
--Reserved[4]
act_pos+=4
--Reserved[7]
act_pos+=7
--Name[12]
name_pos=act_pos
act_pos+=12
end_pos=act_pos
 
--NaviPH_LoginTime;
to_cat("Navi", [{ :pos=>act_pos , :name=>"PH LoginTime" , :typ=>"MKBYTE" }] )
act_pos+=1
 
/DUBwise/tags/v0.52/misc/pc-komp-ref/generate.rb
0,0 → 1,121
require 'rio'
 
 
all_tabs=[]
 
all_names=[]
all_positions=[]
all_types=[]
 
all_namestarts=[]
all_lengths=[]
 
function_hash={}
act_name=""
rio("definitions").read.each_line { |line|
 
if line =~ /--/
act_name=line.split("--")[1].delete!("\r\n")
function_hash[act_name]=""
else
function_hash[act_name] << line
end
}
 
#puts function_hash.inspect
#exit
 
Dir["header_files/*.h"].sort.each { |e|
puts "----------------" + e
new=""
start=false
rio(e).each_line { |l|
start=true if l =~ /struct\r/
start=true if l =~ /struct\n/
start=false if l =~ /\}/
if (l =~ /;/ ) && start
new << l
end
 
}
 
act_pos=0
name_pos=0
end_pos=0
@categorys=[]
@category={}
def to_cat(name,items)
@categorys << name
@category[name]=[] if !@category[name]
@category[name] |= items
end
 
 
 
new.each_line { |l|
found=false
function_hash.each_pair { |k,v|
if l.scan(k)!=[]
found=true
p "found" + k
puts v
puts act_pos
instance_eval(v)
end
}
if !found
p "Fatal: line not found " + l
p "stopping process"
exit
end
}
#p @category
@categorys.uniq!
@categorys.sort!
all_tabs << ["{\"" + @categorys.join("\",\"") + "\"}"]
puts "[\"" + @categorys.join("\",\"") + "\"]"
 
 
all_names << ["{"+@categorys.map { |c|
"{\"" + @category[c].map { |e|
e[:name]
}.join("\",\"") + "\"}"
}.join(",")+"}"]
 
all_positions << ["{"+@categorys.map { |c|
"{" + @category[c].map { |e|
e[:pos]
}.join(",") + "}"
}.join(",")+"}"]
 
all_types << ["{"+ @categorys.map { |c|
"{PARAMTYPE_" + @category[c].map { |e|
e[:typ]
}.join(",PARAMTYPE_") + "}"
}.join(",") + "}"]
 
all_namestarts << name_pos
all_lengths << end_pos
#rio(e+".new") <new
 
 
 
 
 
}
 
puts "// -- start generated code --"
puts "public final static String[][] all_tab_names={"+all_tabs.join(",")+"};"
puts "public final static String[][][] all_field_names={"+all_names.join(",")+"};"
puts "public final static int[][][] all_field_positions={"+all_positions.join(",")+"};"
puts "public final static int[][][] all_field_types={"+all_types.join(",")+"};"
 
 
puts "public final static int[] all_name_positions={"+all_namestarts.join(",")+"};"
puts "public final static int[] all_lengths={"+all_lengths.join(",")+"};"
puts "// -- end generated code --"
/DUBwise/tags/v0.52/misc/pc-komp-ref/header_files/73.h
0,0 → 1,170
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
//#define GIER_GRAD_FAKTOR 1450L // Abhängigkeit zwischen GyroIntegral und Winkel
//#define GIER_GRAD_FAKTOR 1550L // Abhängigkeit zwischen GyroIntegral und Winkel
#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel
#define STICK_GAIN 4
 
#define FLAG_MOTOR_RUN 1
#define FLAG_FLY 2
#define FLAG_CALIBRATE 4
#define FLAG_START 8
extern unsigned char MikroKopterFlags;
 
extern volatile unsigned int I2CTimeout;
extern unsigned char Sekunde,Minute;
extern long IntegralNick,IntegralNick2;
extern long IntegralRoll,IntegralRoll2;
extern long Mess_IntegralNick,Mess_IntegralNick2;
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
extern long IntegralAccNick,IntegralAccRoll;
extern volatile long Mess_Integral_Hoch;
extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern volatile int KompassValue;
extern volatile int KompassStartwert;
extern volatile int KompassRichtung;
extern long ErsatzKompass;
extern int ErsatzKompassInGrad; // Kompasswert in Grad
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
extern long Umschlag180Nick, Umschlag180Roll;
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
extern unsigned int modell_fliegt;
void MotorRegler(void);
void SendMotorData(void);
void CalibrierMittelwert(void);
void Mittelwert(void);
void SetNeutral(void);
void Piep(unsigned char Anzahl);
extern void DefaultKonstanten(void);
void DefaultKonstanten1(void);
void DefaultKonstanten2(void);
 
extern unsigned char h,m,s;
extern volatile unsigned char Timeout ;
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
extern volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4;
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
extern volatile unsigned char SenderOkay;
extern int StickNick,StickRoll,StickGier;
extern char MotorenEin;
extern void DefaultKonstanten1(void);
extern void DefaultKonstanten2(void);
 
#define STRUCT_PARAM_LAENGE 86
struct mk_param_struct
{
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char MaxHoehe; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char Gier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char UfoAusrichtung; // X oder + Formation
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsGegenKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick Gegenkoppelt (NickRollGegenkopplung)
unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp;
unsigned char DynamicStability;
unsigned char UserParam5; // Wert : 0-250
unsigned char UserParam6; // Wert : 0-250
unsigned char UserParam7; // Wert : 0-250
unsigned char UserParam8; // Wert : 0-250
//---Output ---------------------------------------------
unsigned char J16Bitmask; // for the J16 Output
unsigned char J16Timing; // for the J16 Output
unsigned char J17Bitmask; // for the J17 Output
unsigned char J17Timing; // for the J17 Output
//---NaviCtrl---------------------------------------------
unsigned char NaviGpsModeControl; // Parameters for the Naviboard
unsigned char NaviGpsGain;
unsigned char NaviGpsP;
unsigned char NaviGpsI;
unsigned char NaviGpsD;
unsigned char NaviGpsACC;
unsigned char NaviGpsMinSat;
unsigned char NaviStickThreshold;
unsigned char NaviWindCorrection;
unsigned char NaviSpeedCompensation;
unsigned char NaviOperatingRadius;
unsigned char NaviAngleLimitation;
//---Ext.Ctrl---------------------------------------------
unsigned char ExternalControl; // for serial Control
//------------------------------------------------
unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
};
 
extern struct mk_param_struct EE_Parameter;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
extern unsigned char Parameter_KompassWirkung;
extern unsigned char Parameter_Gyro_P;
extern unsigned char Parameter_Gyro_I;
extern unsigned char Parameter_Gier_P;
extern unsigned char Parameter_ServoNickControl;
extern unsigned char Parameter_AchsKopplung1;
extern unsigned char Parameter_AchsGegenKopplung1;
extern unsigned char Parameter_J16Bitmask; // for the J16 Output
extern unsigned char Parameter_J16Timing; // for the J16 Output
extern unsigned char Parameter_J17Bitmask; // for the J17 Output
extern unsigned char Parameter_J17Timing; // for the J17 Output
/*
extern unsigned char Parameter_NaviGpsModeControl; // Parameters for the Naviboard
extern unsigned char Parameter_NaviGpsGain;
extern unsigned char Parameter_NaviGpsP;
extern unsigned char Parameter_NaviGpsI;
extern unsigned char Parameter_NaviGpsD;
extern unsigned char Parameter_NaviGpsACC;
extern unsigned char Parameter_NaviOperatingRadius;
extern unsigned char Parameter_NaviWindCorrection;
extern unsigned char Parameter_NaviSpeedCompensation;
*/
#endif //_FC_H
 
/DUBwise/tags/v0.52/misc/pc-komp-ref/header_files/74.h
0,0 → 1,179
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
//#define GIER_GRAD_FAKTOR 1291L // Abhängigkeit zwischen GyroIntegral und Winkel
//#define GIER_GRAD_FAKTOR 1160L
extern unsigned long GIER_GRAD_FAKTOR; // Abhängigkeit zwischen GyroIntegral und Winkel
#define STICK_GAIN 4
 
#define FLAG_MOTOR_RUN 1
#define FLAG_FLY 2
#define FLAG_CALIBRATE 4
#define FLAG_START 8
extern unsigned char MikroKopterFlags;
 
extern volatile unsigned int I2CTimeout;
extern unsigned char Sekunde,Minute;
extern long IntegralNick,IntegralNick2;
extern long IntegralRoll,IntegralRoll2;
extern long Mess_IntegralNick,Mess_IntegralNick2;
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
extern long IntegralAccNick,IntegralAccRoll;
extern volatile long Mess_Integral_Hoch;
extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern volatile int KompassValue;
extern volatile int KompassStartwert;
extern volatile int KompassRichtung;
extern long ErsatzKompass;
extern int ErsatzKompassInGrad; // Kompasswert in Grad
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
extern long Umschlag180Nick, Umschlag180Roll;
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
extern unsigned int modell_fliegt;
void MotorRegler(void);
void SendMotorData(void);
void CalibrierMittelwert(void);
void Mittelwert(void);
void SetNeutral(void);
void Piep(unsigned char Anzahl);
extern void DefaultKonstanten(void);
void DefaultKonstanten1(void);
void DefaultKonstanten2(void);
 
extern unsigned char h,m,s;
extern volatile unsigned char Timeout ;
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
extern volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4;
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
extern volatile unsigned char Motor1, Motor2,Motor3,Motor4,Motor5,Motor6,Motor7,Motor8;
extern volatile unsigned char SenderOkay;
extern int StickNick,StickRoll,StickGier;
extern char MotorenEin;
extern void DefaultKonstanten1(void);
extern void DefaultKonstanten2(void);
 
 
#define STRUCT_PARAM_LAENGE 92
struct mk_param_struct
{
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char MaxHoehe; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char Gier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char Gyro_D; // Wert : 0-250
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char UfoAusrichtung; // X oder + Formation
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsKopplung2; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden
unsigned char CouplingYawCorrection; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden
unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp;
unsigned char DynamicStability;
unsigned char UserParam5; // Wert : 0-250
unsigned char UserParam6; // Wert : 0-250
unsigned char UserParam7; // Wert : 0-250
unsigned char UserParam8; // Wert : 0-250
//---Output ---------------------------------------------
unsigned char J16Bitmask; // for the J16 Output
unsigned char J16Timing; // for the J16 Output
unsigned char J17Bitmask; // for the J17 Output
unsigned char J17Timing; // for the J17 Output
//---NaviCtrl---------------------------------------------
unsigned char NaviGpsModeControl; // Parameters for the Naviboard
unsigned char NaviGpsGain;
unsigned char NaviGpsP;
unsigned char NaviGpsI;
unsigned char NaviGpsD;
unsigned char NaviGpsPLimit;
unsigned char NaviGpsILimit;
unsigned char NaviGpsDLimit;
unsigned char NaviGpsACC;
unsigned char NaviGpsMinSat;
unsigned char NaviStickThreshold;
unsigned char NaviWindCorrection;
unsigned char NaviSpeedCompensation;
unsigned char NaviOperatingRadius;
unsigned char NaviAngleLimitation;
unsigned char NaviPH_LoginTime;
//---Ext.Ctrl---------------------------------------------
unsigned char ExternalControl; // for serial Control
//------------------------------------------------
unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
};
 
extern struct mk_param_struct EE_Parameter;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
extern unsigned char Parameter_KompassWirkung;
extern unsigned char Parameter_Gyro_P;
extern unsigned char Parameter_Gyro_I;
extern unsigned char Parameter_Gier_P;
extern unsigned char Parameter_ServoNickControl;
extern unsigned char Parameter_AchsKopplung1;
extern unsigned char Parameter_AchsKopplung2;
//extern unsigned char Parameter_AchsGegenKopplung1;
extern unsigned char Parameter_J16Bitmask; // for the J16 Output
extern unsigned char Parameter_J16Timing; // for the J16 Output
extern unsigned char Parameter_J17Bitmask; // for the J17 Output
extern unsigned char Parameter_J17Timing; // for the J17 Output
/*
extern unsigned char Parameter_NaviGpsModeControl; // Parameters for the Naviboard
extern unsigned char Parameter_NaviGpsGain;
extern unsigned char Parameter_NaviGpsP;
extern unsigned char Parameter_NaviGpsI;
extern unsigned char Parameter_NaviGpsD;
extern unsigned char Parameter_NaviGpsACC;
extern unsigned char Parameter_NaviOperatingRadius;
extern unsigned char Parameter_NaviWindCorrection;
extern unsigned char Parameter_NaviSpeedCompensation;
*/
#endif //_FC_H
 
/DUBwise/tags/v0.52/misc/pc-komp-ref/header_files/old/4.h
0,0 → 1,106
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
 
extern volatile unsigned char Timeout;
extern unsigned char Sekunde,Minute;
extern volatile long IntegralNick,IntegralNick2;
extern volatile long IntegralRoll,IntegralRoll2;
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
extern volatile long Mess_Integral_Hoch;
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern volatile int KompassValue;
extern volatile int KompassStartwert;
extern volatile int KompassRichtung;
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
 
 
void MotorRegler(void);
void SendMotorData(void);
void CalibrierMittelwert(void);
void Mittelwert(void);
void SetNeutral(void);
 
unsigned char h,m,s;
volatile unsigned char Timeout ;
unsigned char CosinusNickWinkel, CosinusRollWinkel;
volatile long IntegralNick,IntegralNick2;
volatile long IntegralRoll,IntegralRoll2;
volatile long Integral_Gier;
volatile long Mess_IntegralNick,Mess_IntegralNick2;
volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
volatile long Mess_Integral_Gier;
volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4;
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
unsigned char MotorWert[5];
volatile unsigned char SenderOkay;
int StickNick,StickRoll,StickGier;
char MotorenEin;
extern void DefaultKonstanten(void);
 
#define STRUCT_PARAM_LAENGE 58
struct mk_param_struct
{
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfigOld; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char MaxHoehe; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char Gier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char UfoAusrichtung; // X oder + Formation
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
unsigned char ServoNickRefresh; // Wert : 0-250 // Richtung Einfluss Gyro/Servo
unsigned char ServoNickCompInvert; // Wert : 0-250 // Richtung Einfluss Gyro/Servo
unsigned char Reserved[7];
char Name[12];
};
 
 
 
 
extern struct mk_param_struct EE_Parameter;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
extern unsigned char Parameter_KompassWirkung;
extern unsigned char Parameter_Gyro_P;
extern unsigned char Parameter_Gyro_I;
extern unsigned char Parameter_Gier_P;
extern unsigned char Parameter_ServoNickControl;
 
#endif //_FC_H
 
/DUBwise/tags/v0.52/misc/pc-komp-ref/header_files/old/5.h
0,0 → 1,119
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
 
extern volatile unsigned int I2CTimeout;
extern unsigned char Sekunde,Minute;
extern volatile long IntegralNick,IntegralNick2;
extern volatile long IntegralRoll,IntegralRoll2;
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
extern volatile long Mess_Integral_Hoch;
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern volatile int KompassValue;
extern volatile int KompassStartwert;
extern volatile int KompassRichtung;
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
 
 
void MotorRegler(void);
void SendMotorData(void);
void CalibrierMittelwert(void);
void Mittelwert(void);
void SetNeutral(void);
 
unsigned char h,m,s;
volatile unsigned char Timeout ;
unsigned char CosinusNickWinkel, CosinusRollWinkel;
volatile long IntegralNick,IntegralNick2;
volatile long IntegralRoll,IntegralRoll2;
volatile long Integral_Gier;
volatile long Mess_IntegralNick,Mess_IntegralNick2;
volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
volatile long Mess_Integral_Gier;
volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4;
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
unsigned char MotorWert[5];
volatile unsigned char SenderOkay;
int StickNick,StickRoll,StickGier;
char MotorenEin;
extern void DefaultKonstanten(void);
 
#define STRUCT_PARAM_LAENGE 58
struct mk_param_struct
{
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfigOld; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char MaxHoehe; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char Gier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char UfoAusrichtung; // X oder + Formation
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
};
 
/*
unsigned char ServoNickMax; // Wert : 0-250
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
*/
extern struct mk_param_struct EE_Parameter;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
extern unsigned char Parameter_KompassWirkung;
extern unsigned char Parameter_Gyro_P;
extern unsigned char Parameter_Gyro_I;
extern unsigned char Parameter_Gier_P;
extern unsigned char Parameter_ServoNickControl;
 
#endif //_FC_H
 
/DUBwise/tags/v0.52/misc/pc-komp-ref/header_files/old/6.h
0,0 → 1,137
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
 
extern volatile unsigned int I2CTimeout;
extern unsigned char Sekunde,Minute;
extern volatile long IntegralNick,IntegralNick2;
extern volatile long IntegralRoll,IntegralRoll2;
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
extern volatile long IntegralAccNick,IntegralAccRoll;
extern volatile long Mess_Integral_Hoch;
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern volatile int KompassValue;
extern volatile int KompassStartwert;
extern volatile int KompassRichtung;
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
extern long Umschlag180Nick, Umschlag180Roll;
 
void MotorRegler(void);
void SendMotorData(void);
void CalibrierMittelwert(void);
void Mittelwert(void);
void SetNeutral(void);
void Piep(unsigned char Anzahl);
extern void DefaultKonstanten(void);
void DefaultKonstanten1(void);
void DefaultKonstanten2(void);
 
extern unsigned char h,m,s;
extern volatile unsigned char Timeout ;
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
extern volatile long IntegralNick,IntegralNick2;
extern volatile long IntegralRoll,IntegralRoll2;
extern volatile long Integral_Gier;
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
extern volatile long Mess_Integral_Gier;
extern volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4;
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
extern unsigned char MotorWert[5];
extern volatile unsigned char SenderOkay;
extern int StickNick,StickRoll,StickGier;
extern char MotorenEin;
extern void DefaultKonstanten1(void);
extern void DefaultKonstanten2(void);
 
#define STRUCT_PARAM_LAENGE 65
struct mk_param_struct
{
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char MaxHoehe; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char Gier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char UfoAusrichtung; // X oder + Formation
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsGegenKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick Gegenkoppelt (NickRollGegenkopplung)
unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp;
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
};
 
 
/*
unsigned char ServoNickMax; // Wert : 0-250
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
*/
extern struct mk_param_struct EE_Parameter;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
extern unsigned char Parameter_KompassWirkung;
extern unsigned char Parameter_Gyro_P;
extern unsigned char Parameter_Gyro_I;
extern unsigned char Parameter_Gier_P;
extern unsigned char Parameter_ServoNickControl;
extern unsigned char Parameter_AchsKopplung1;
extern unsigned char Parameter_AchsGegenKopplung1;
 
 
#endif //_FC_H
 
/DUBwise/tags/v0.52/misc/pc-komp-ref/header_files/old/7.h
0,0 → 1,144
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
 
extern volatile unsigned int I2CTimeout;
extern unsigned char Sekunde,Minute;
extern volatile long IntegralNick,IntegralNick2;
extern volatile long IntegralRoll,IntegralRoll2;
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
extern volatile long IntegralAccNick,IntegralAccRoll;
extern volatile long Mess_Integral_Hoch;
extern volatile long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern volatile int KompassValue;
extern volatile int KompassStartwert;
extern volatile int KompassRichtung;
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
extern long Umschlag180Nick, Umschlag180Roll;
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
 
void MotorRegler(void);
void SendMotorData(void);
void CalibrierMittelwert(void);
void Mittelwert(void);
void SetNeutral(void);
void Piep(unsigned char Anzahl);
extern void DefaultKonstanten(void);
void DefaultKonstanten1(void);
void DefaultKonstanten2(void);
 
extern unsigned char h,m,s;
extern volatile unsigned char Timeout ;
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
extern volatile long IntegralNick,IntegralNick2;
extern volatile long IntegralRoll,IntegralRoll2;
extern volatile long Integral_Gier;
extern volatile long Mess_IntegralNick,Mess_IntegralNick2;
extern volatile long Mess_IntegralRoll,Mess_IntegralRoll2;
extern volatile long Mess_Integral_Gier;
extern volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4;
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
extern unsigned char MotorWert[5];
extern volatile unsigned char SenderOkay;
extern int StickNick,StickRoll,StickGier;
extern char MotorenEin;
extern void DefaultKonstanten1(void);
extern void DefaultKonstanten2(void);
 
#define STRUCT_PARAM_LAENGE 71
struct mk_param_struct
{
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char MaxHoehe; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char Gier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char UfoAusrichtung; // X oder + Formation
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsGegenKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick Gegenkoppelt (NickRollGegenkopplung)
unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp;
unsigned char DynamicStability;
unsigned char UserParam5; // Wert : 0-250
unsigned char UserParam6; // Wert : 0-250
unsigned char UserParam7; // Wert : 0-250
unsigned char UserParam8; // Wert : 0-250
 
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
};
 
 
/*
unsigned char ServoNickMax; // Wert : 0-250
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
*/
extern struct mk_param_struct EE_Parameter;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
extern unsigned char Parameter_KompassWirkung;
extern unsigned char Parameter_Gyro_P;
extern unsigned char Parameter_Gyro_I;
extern unsigned char Parameter_Gier_P;
extern unsigned char Parameter_ServoNickControl;
extern unsigned char Parameter_AchsKopplung1;
extern unsigned char Parameter_AchsGegenKopplung1;
 
 
#endif //_FC_H
 
/DUBwise/tags/v0.52/misc/pc-komp-ref/header_files/old/8.h
0,0 → 1,172
/*#######################################################################################
Flight Control
#######################################################################################*/
 
#ifndef _FC_H
#define _FC_H
//#define GIER_GRAD_FAKTOR 1450L // Abhängigkeit wzischen GyroIntegral und Winkel
#define GIER_GRAD_FAKTOR 1550L // Abhängigkeit wzischen GyroIntegral und Winkel
#define STICK_GAIN 4
 
#define FLAG_MOTOR_RUN 1
#define FLAG_FLY 2
#define FLAG_CALIBRATE 4
#define FLAG_START 8
extern unsigned char MikroKopterFlags;
 
extern volatile unsigned int I2CTimeout;
extern unsigned char Sekunde,Minute;
extern long IntegralNick,IntegralNick2;
extern long IntegralRoll,IntegralRoll2;
extern long Mess_IntegralNick,Mess_IntegralNick2;
extern long Mess_IntegralRoll,Mess_IntegralRoll2;
extern long IntegralAccNick,IntegralAccRoll;
extern volatile long Mess_Integral_Hoch;
extern long Integral_Gier,Mess_Integral_Gier,Mess_Integral_Gier2;
extern volatile int KompassValue;
extern volatile int KompassStartwert;
extern volatile int KompassRichtung;
extern long ErsatzKompass;
extern int ErsatzKompassInGrad; // Kompasswert in Grad
extern int HoehenWert;
extern int SollHoehe;
extern volatile int MesswertNick,MesswertRoll,MesswertGier;
extern volatile int AdNeutralNick,AdNeutralRoll,AdNeutralGier, Mittelwert_AccNick, Mittelwert_AccRoll;
extern volatile int NeutralAccX, NeutralAccY,Mittelwert_AccHoch;
extern volatile float NeutralAccZ;
extern long Umschlag180Nick, Umschlag180Roll;
extern signed int ExternStickNick,ExternStickRoll,ExternStickGier;
extern unsigned char Parameter_UserParam1,Parameter_UserParam2,Parameter_UserParam3,Parameter_UserParam4,Parameter_UserParam5,Parameter_UserParam6,Parameter_UserParam7,Parameter_UserParam8;
extern int NaviAccNick,NaviAccRoll,NaviCntAcc;
extern unsigned int modell_fliegt;
void MotorRegler(void);
void SendMotorData(void);
void CalibrierMittelwert(void);
void Mittelwert(void);
void SetNeutral(void);
void Piep(unsigned char Anzahl);
extern void DefaultKonstanten(void);
void DefaultKonstanten1(void);
void DefaultKonstanten2(void);
 
extern unsigned char h,m,s;
extern volatile unsigned char Timeout ;
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
extern volatile int DiffNick,DiffRoll;
extern int Poti1, Poti2, Poti3, Poti4;
extern volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links, Count;
extern volatile unsigned char SenderOkay;
extern int StickNick,StickRoll,StickGier;
extern char MotorenEin;
extern void DefaultKonstanten1(void);
extern void DefaultKonstanten2(void);
 
#define STRUCT_PARAM_LAENGE 83
struct mk_param_struct
{
unsigned char Kanalbelegung[8]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char MaxHoehe; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char Gier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char UfoAusrichtung; // X oder + Formation
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsGegenKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick Gegenkoppelt (NickRollGegenkopplung)
unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp;
unsigned char DynamicStability;
unsigned char UserParam5; // Wert : 0-250
unsigned char UserParam6; // Wert : 0-250
unsigned char UserParam7; // Wert : 0-250
unsigned char UserParam8; // Wert : 0-250
//---Output ---------------------------------------------
unsigned char J16Bitmask; // for the J16 Output
unsigned char J16Timing; // for the J16 Output
unsigned char J17Bitmask; // for the J17 Output
unsigned char J17Timing; // for the J17 Output
//---NaviCtrl---------------------------------------------
unsigned char NaviGpsModeControl; // Parameters for the Naviboard
unsigned char NaviGpsGain;
unsigned char NaviGpsP;
unsigned char NaviGpsI;
unsigned char NaviGpsD;
unsigned char NaviGpsACC;
unsigned char NaviGpsMinSat;
unsigned char NaviStickThreshold;
//---Ext.Ctrl---------------------------------------------
unsigned char ExternalControl; // for serial Control
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
};
 
 
/*
unsigned char ServoNickMax; // Wert : 0-250
unsigned char ServoNickRefresh; //
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
//------------------------------------------------
unsigned char LoopConfig; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoNickCompInvert; // Wert : 0-250 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char Reserved[4];
char Name[12];
*/
extern struct mk_param_struct EE_Parameter;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
extern unsigned char Parameter_Hoehe_ACC_Wirkung;
extern unsigned char Parameter_KompassWirkung;
extern unsigned char Parameter_Gyro_P;
extern unsigned char Parameter_Gyro_I;
extern unsigned char Parameter_Gier_P;
extern unsigned char Parameter_ServoNickControl;
extern unsigned char Parameter_AchsKopplung1;
extern unsigned char Parameter_AchsGegenKopplung1;
extern unsigned char Parameter_J16Bitmask; // for the J16 Output
extern unsigned char Parameter_J16Timing; // for the J16 Output
extern unsigned char Parameter_J17Bitmask; // for the J17 Output
extern unsigned char Parameter_J17Timing; // for the J17 Output
extern unsigned char Parameter_NaviGpsModeControl; // Parameters for the Naviboard
extern unsigned char Parameter_NaviGpsGain;
extern unsigned char Parameter_NaviGpsP;
extern unsigned char Parameter_NaviGpsI;
extern unsigned char Parameter_NaviGpsD;
extern unsigned char Parameter_NaviGpsACC;
#endif //_FC_H
 
/DUBwise/tags/v0.52/shared/src/DUBwiseDefinitions.java
0,0 → 1,52
package org.ligi.ufo;
 
 
public interface DUBwiseDefinitions
{
 
public final static byte USER_INTENT_NONE =0;
public final static byte USER_INTENT_RAWDEBUG =1;
public final static byte USER_INTENT_PARAMS =2;
public final static byte USER_INTENT_GRAPH =3;
public final static byte USER_INTENT_RCDATA =4;
public final static byte USER_INTENT_LCD =5;
public final static byte USER_INTENT_EXTERNAL_CONTROL =6;
 
 
public final static byte GPS_FORMAT_DECIMAL =0;
public final static byte GPS_FORMAT_MINSEC =1;
 
 
public final static byte SPEED_FORMAT_KMH =0; // km/h
public final static byte SPEED_FORMAT_MPH =1; // miles/h
public final static byte SPEED_FORMAT_CMS =2; // cm/s
 
 
 
/* from uart.h
unsigned char Digital[2];
unsigned char RemoteTasten;
signed char Nick;
signed char Roll;
signed char Gier;
unsigned char Gas;
signed char Hight;
unsigned char free;
unsigned char Frame;
unsigned char Config;
*/
 
public final static byte EXTERN_CONTROL_NICK =3;
public final static byte EXTERN_CONTROL_ROLL =4;
public final static byte EXTERN_CONTROL_GIER =5;
public final static byte EXTERN_CONTROL_GAS =6;
public final static byte EXTERN_CONTROL_HIGHT =7;
public final static byte EXTERN_CONTROL_FRAME =9;
public final static byte EXTERN_CONTROL_CONFIG =10;
 
public final static byte EXTERN_CONTROL_LENGTH =11;
 
public final static byte EXTERN_CONTROL_DEFAULT =42;
 
public final static byte[] default_extern_keycontrol = { (byte)0, (byte)0, (byte)0, (byte)EXTERN_CONTROL_DEFAULT, (byte)EXTERN_CONTROL_DEFAULT, (byte)EXTERN_CONTROL_DEFAULT, (byte)255 , (byte)0, (byte)0, (byte)1, (byte)1 };
}
/DUBwise/tags/v0.52/shared/src/MKCommunicator.java
0,0 → 1,1235
/********************************************************************************************************************************
*
* Abstaction Layer to Communicate via J2ME and Bluetooth with the FlightCtrl of the MikroKopter Project (www.mikrokopter.de )
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
*
*******************************************************************************************************************************/
 
package org.ligi.ufo;
 
 
//#ifdef j2me
//# import javax.microedition.io.*;
//#endif
 
//#ifdef android
import android.util.Log;
//#endif
 
 
 
import java.io.*;
 
 
public class MKCommunicator
implements Runnable,DUBwiseDefinitions
{
 
public int angle_nick=-4242;
public int angle_roll=-4242;
public byte bl_retrys=0;
public boolean init_bootloader=false;
 
public byte lib_version_major=0;
public byte lib_version_minor=5;
 
public String lib_version_str()
{
return "V"+lib_version_major+"."+lib_version_minor;
}
 
/***************** Section: public Attributes **********************************************/
public boolean connected=false; // flag for the connection state
 
public String mk_url=""; // buffer the url which is given in the constuctor for reconnectin purposes
 
public final static int DATA_BUFF_LEN = 20; // in lines
 
public String[] data_buff;
 
// boolean do_log=false;
boolean do_log=true;
 
int data_buff_pos=0;
 
public byte user_intent=0;
public final static int[] crc16_table = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
};
 
public void log(String str)
{
//#ifdef android
if (do_log) Log.d("MK-Comm",str);
//#endif
System.out.println(str);
}
 
public int CRC16(int ch, int crc)
{
return crc16_table[((crc >> 8) ^ (ch)) & 0xFF] ^ (crc << 8);
}
 
 
public int conn_time_in_s()
{
if (connected)
return (int)((System.currentTimeMillis()-connection_start_time)/1000);
else
return 0;
}
public final static byte BOOTLOADER_STAGE_NONE=0;
public final static byte BOOTLOADER_STAGE_GOT_MKBL=1;
 
byte bootloader_stage= BOOTLOADER_STAGE_NONE;
 
public MKLCD LCD;
public MKVersion version;
public MKDebugData debug_data;
 
public int[] extern_control;
 
public MKGPSPosition gps_position;
 
public MKStickData stick_data;
public MKParamsParser params;
public MKWatchDog watchdog;
public MKProxy proxy=null;
public MKStatistics stats ;
// public DUBwiseDebug debug;
 
public UFOProber ufo_prober;
public long connection_start_time=-1;
 
 
public String error_str = null;
 
public final static int FC_SLAVE_ADDR = 'a'+1;
public final static int NAVI_SLAVE_ADDR = 'a'+2;
public final static int MK3MAG_SLAVE_ADDR = 'a'+3;
 
 
 
 
/****************** Section: private Attributes **********************************************/
//#ifdef j2me
//# private javax.microedition.io.StreamConnection connection;
//#endif
 
//#ifdef android
// java.net.Socket connection;
java.net.Socket connection;
//#endif
 
 
private java.io.InputStream reader;
private java.io.OutputStream writer;
 
 
 
public String name;
// DUBwise root;
 
 
private boolean sending=false;
private boolean recieving=false;
 
 
 
/****************** Section: public Methods ************************************************/
public MKCommunicator()
{
 
data_buff=new String[DATA_BUFF_LEN];
for (int i=0;i<DATA_BUFF_LEN;i++)
data_buff[i]="";
// debug=debug_;
// root=root_;
version=new MKVersion();
debug_data=new MKDebugData();
stick_data=new MKStickData();
params=new MKParamsParser();
extern_control=new int[EXTERN_CONTROL_LENGTH];
extern_control[EXTERN_CONTROL_CONFIG]=1;
extern_control[EXTERN_CONTROL_FRAME]=1;
LCD= new MKLCD(this);
watchdog=new MKWatchDog(this);
gps_position=new MKGPSPosition();
stats = new MKStatistics();
proxy =new MKProxy(this);
ufo_prober=new UFOProber();
new Thread( this ).start(); // fire up main Thread
}
 
 
 
public void write_raw(byte[] _data)
{
wait4send();
sending=true;
try {
writer.write(_data,0,_data.length);
writer.flush();
 
stats.bytes_out+=_data.length;
}
catch ( Exception e){}
sending=false;
}
 
public void do_proxy(String proxy_url)
{
proxy.connect(proxy_url);
}
// int port;
 
// URL string: "btspp://XXXXXXXXXXXX:1" - the X-Part is the MAC-Adress of the Bluetooth-Device connected to the Fligth-Control
public void connect_to(String _url,String _name)
{
// port=_port;
mk_url=_url; // remember URL for connecting / reconnecting later
name=_name;
force_disconnect=false;
connected=false;
}
 
public boolean ready()
{
return (connected&&(version.major!=-1));
}
 
 
public String get_buff(int age)
{
 
age%=DATA_BUFF_LEN;
if (age<=data_buff_pos)
return ""+data_buff[data_buff_pos-age];
else
return ""+data_buff[DATA_BUFF_LEN+data_buff_pos-age];
 
}
/****************** Section: private Methods ************************************************/
private void connect()
{
log("trying to connect to" + mk_url);
try{
// old call
// connection = (StreamConnection) Connector.open(mk_url, Connector.READ_WRITE);
//#ifdef android
connection = (new java.net.Socket(mk_url.split(":")[0],Integer.parseInt(mk_url.split(":")[1])));
//.Socket
 
reader=connection.getInputStream();
writer=connection.getOutputStream();
 
String magic="conn:foo bar\r\n";
writer.write(magic.getBytes());
writer.flush();
 
//#else
 
//# connection = (StreamConnection) Connector.open(mk_url);
 
//# reader=connection.openInputStream();
//# writer=connection.openOutputStream();
 
//#endif
connection_start_time=System.currentTimeMillis();
connected=true; // if we get here everything seems to be OK
 
stats.reset();
 
log("connecting OK");
}
catch (Exception ex)
{
// TODO difference fatal errors from those which will lead to reconnection
log("Problem connecting" + "\n" + ex);
}
}
 
public int[] Decode64(byte[] in_arr, int offset,int len)
{
int ptrIn=offset;
int a,b,c,d,x,y,z;
int ptr=0;
int[] out_arr=new int[len];
 
while(len!=0)
{
a=0;
b=0;
c=0;
d=0;
try {
a = in_arr[ptrIn++] - '=';
b = in_arr[ptrIn++] - '=';
c = in_arr[ptrIn++] - '=';
d = in_arr[ptrIn++] - '=';
}
catch (Exception e) {}
//if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden
 
x = (a << 2) | (b >> 4);
y = ((b & 0x0f) << 4) | (c >> 2);
z = ((c & 0x03) << 6) | d;
 
if((len--)!=0) out_arr[ptr++] = x; else break;
if((len--)!=0) out_arr[ptr++] = y; else break;
if((len--)!=0) out_arr[ptr++] = z; else break;
}
return out_arr;
 
}
 
public void wait4send()
{
while(sending) //||recieving)
sleep(50);
}
 
 
public void sleep(int time)
{
try { Thread.sleep(time); }
catch (Exception e) { }
}
 
// FC - Function Mappers
 
// send a version Request to the FC - the reply to this request will be processed in process_data when it arrives
public void get_version()
{
stats.version_data_request_count++;
send_command(0,'v');
}
 
public void set_gps_target(int longitude,int latitude)
{
int[] target=new int[8];
target[0]= (0xFF)&(longitude<<24);
target[1]= (0xFF)&(longitude<<16);
target[2]= (0xFF)&(longitude<<8);
target[3]= (0xFF)&(longitude);
// send_command(0,'s',target);
}
 
// send a MotorTest request - params are the speed for each Motor
public void motor_test(int[] params)
{
stats.motortest_request_count++;
send_command(FC_SLAVE_ADDR,'t',params);
}
 
 
public void send_extern_control()
{
 
stats.external_control_request_count++;
send_command(FC_SLAVE_ADDR,'b',extern_control);
}
 
/* public void send_keys(int[] params)
{
send_command(FC_SLAVE_ADDR,'k',params);
}*/
// get params
public void get_params(int id)
{
wait4send();
send_command(FC_SLAVE_ADDR,'q',id+1);
stats.params_data_request_count++;
}
 
public void get_debug_name(int id)
{
 
wait4send();
send_command(0,'a',id);
}
 
public void trigger_LCD_by_page(int page)
{
wait4send();
send_command(0,'l',page);
stats.lcd_data_request_count++;
}
 
public void trigger_debug()
{
if (sending||recieving) return; // its not that important - can be dropped
send_command(0,'c');
}
 
 
public void switch_todo()
{
sleep(50);
version=new MKVersion();
LCD= new MKLCD(this);
debug_data=new MKDebugData();
 
}
 
public void switch_to_fc()
{
wait4send();
send_command(NAVI_SLAVE_ADDR,'u',0);
switch_todo();
 
}
 
 
public void switch_to_mk3mag()
{
wait4send();
send_command(NAVI_SLAVE_ADDR ,'u',1);
switch_todo();
}
 
public final static byte[] navi_switch_magic={27,27,0x55,(byte)0xAA,0,(byte)'\r'};
public void switch_to_navi()
{
wait4send();
sending=true;
try
{
writer.write(navi_switch_magic);
stats.bytes_out+=6;
writer.flush();
}
catch (Exception e) { }
sending=false;
switch_todo();
 
}
 
public String[] flash_msgs;
int msg_pos=0;
 
 
public boolean bootloader_intension_flash=false;
 
public boolean bootloader_finish_ok=false;
 
public void jump_bootloader()
{
 
bootloader_finish_ok=false;
msg_pos=0;
bootloader_stage= BOOTLOADER_STAGE_NONE;
flash_msgs=new String[100];
flash_msgs[msg_pos++]="Initiializing Bootloader";
wait4send();
sending=true;
try
{
int attempt=0;
 
while(bootloader_stage!= BOOTLOADER_STAGE_GOT_MKBL)
{
flash_msgs[msg_pos]="attempt "+attempt;
attempt++;
send_command_nocheck((byte)FC_SLAVE_ADDR,'R',new int[0]);
try{
writer.write( 27);
writer.flush();
 
sleep(20);
writer.write( 0xAA);
writer.flush();
}
catch (Exception e) { }
sleep((attempt%2==0)?80:800); //800
}
msg_pos++;
}
 
catch (Exception e) {
flash_msgs[msg_pos++]="Exception:" +e.getMessage() ;
flash_msgs[msg_pos++]=e.toString() ;
}
 
new Thread( this ).start(); // fire up main Thread
}
 
 
public void get_error_str()
{
send_command(NAVI_SLAVE_ADDR,'e');
}
 
public void trigger_rcdata()
{
send_command(FC_SLAVE_ADDR,'p');
}
 
 
public void write_params(int to)
{
params.update_backup(to);
write_params_(to) ;
}
 
public void write_params_(int to)
{
wait4send();
params.active_paramset=to;
send_command(FC_SLAVE_ADDR,'s',params.field_bak[to]);
}
 
public void send_command(int modul,char cmd)
{
send_command(modul,cmd,new int[0]);
}
 
public void send_command(int modul,char cmd,int param)
{
int[] params=new int[1];
params[0]=param;
send_command(modul,cmd,params);
}
 
public void send_command_nocheck(byte modul,char cmd,int[] params)
{
// char[] send_buff=new char[5 + (params.length/3 + (params.length%3==0?0:1) )*4]; // 5=1*start_char+1*addr+1*cmd+2*crc
 
byte[] send_buff=new byte[3 + (params.length/3 + (params.length%3==0?0:1) )*4]; // 5=1*start_char+1*addr+1*cmd+2*crc
send_buff[0]='#';
send_buff[1]=modul;
send_buff[2]=(byte)cmd;
for(int param_pos=0;param_pos<(params.length/3 + (params.length%3==0?0:1)) ;param_pos++)
{
int a = (param_pos*3<params.length)?params[param_pos*3]:0;
int b = ((param_pos*3+1)<params.length)?params[param_pos*3+1]:0;
int c = ((param_pos*3+2)<params.length)?params[param_pos*3+2]:0;
 
send_buff[3+param_pos*4] = (byte)((a >> 2)+'=' );
send_buff[3+param_pos*4+1] = (byte)('=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)));
send_buff[3+param_pos*4+2] = (byte)('=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)));
send_buff[3+param_pos*4+3] = (byte)('=' + ( c & 0x3f));
 
//send_buff[3+foo]='=';
}
 
/* for(int foo=0;foo<(params.length/3 + (params.length%3==0?0:1) )*4;foo++)
{
int a = (foo<params.length) params[foo];
int a = params[foo];
//send_buff[3+foo]='=';
}
*/
try
{
int tmp_crc=0;
for ( int tmp_i=0; tmp_i<send_buff.length;tmp_i++)
tmp_crc+=(int)send_buff[tmp_i];
writer.write(send_buff,0,send_buff.length);
tmp_crc%=4096;
 
writer.write( (char)(tmp_crc/64 + '='));
writer.write( (char)(tmp_crc%64 + '='));
writer.write('\r');
stats.bytes_out+=send_buff.length+3;
writer.flush();
}
catch (Exception e)
{ // problem sending data to FC
}
 
}
// send command to FC ( add crc and pack into pseudo Base64
public void send_command(int modul,char cmd,int[] params)
{
// if (modul==0) return;
sending=true;
send_command_nocheck((byte)modul,cmd,params);
sending=false;
}
 
 
public int slave_addr=-1;
 
 
public int UBatt()
{
if (ufo_prober.is_mk())
return debug_data.UBatt();
else if (ufo_prober.is_navi())
return gps_position.UBatt;
return -1;
 
}
 
 
 
public int SenderOkay()
{
if (ufo_prober.is_mk())
return debug_data.SenderOkay();
else if (ufo_prober.is_navi())
return gps_position.SenderOkay;
return -1;
 
}
 
 
public void process_data(byte[] data,int len)
{
 
 
log("command " +(char)data[2] );
switch((char)data[2])
{
 
case 'A': // debug Data Names
stats.debug_names_count++;
debug_data.set_names_by_mk_data(Decode64(data,3,len-3));
break;
 
case 'B': // external_control confirm frames
stats.external_control_confirm_frame_count++;
break;
 
case 'L': // LCD Data
stats.lcd_data_count++;
LCD.handle_lcd_data(Decode64(data,3,len-3));
 
break;
 
case 'D': // debug Data
log("got debug data");
stats.debug_data_count++;
debug_data.set_by_mk_data(Decode64(data,3,len-3),version);
log("processed debug data");
break;
case 'V': // Version Info
stats.version_data_count++;
slave_addr=data[1];
 
switch(slave_addr)
{
case FC_SLAVE_ADDR:
ufo_prober.set_to_mk();
break;
 
case NAVI_SLAVE_ADDR:
ufo_prober.set_to_navi();
break;
 
case MK3MAG_SLAVE_ADDR:
// ufo_prober.set_to_mk();
ufo_prober.set_to_mk3mag();
break;
 
default:
ufo_prober.set_to_incompatible();
break;
}
 
 
version.set_by_mk_data(Decode64(data,3,len-3));
break;
 
case 'w':
int[] dec=Decode64(data,3,len-3);
angle_nick=MKHelper.parse_signed_int_2(dec[0],dec[1]);
angle_roll=MKHelper.parse_signed_int_2(dec[2],dec[3]);
stats.angle_data_count++;
 
break;
 
 
case 'Q':
if (ufo_prober.is_mk())
{
stats.params_data_count++;
params.set_by_mk_data(Decode64(data,3,len-3));
}
break;
case 'P':
stats.stick_data_count++;
stick_data.set_by_mk_data(Decode64(data,3,20));
break;
 
 
case 'E':
int[] dec_data=Decode64(data,3,len-3);
error_str="";
for(int foo=0;foo<20;foo++)
if (dec_data[foo]!=0)
error_str+=(char)dec_data[foo];
break;
 
 
case 'O':
stats.navi_data_count++;
log("got navi data(" + len +"):");
gps_position.set_by_mk_data(Decode64(data,3,len-3),version);
 
log("long:" + gps_position.Longitude);
log("lat:" + gps_position.Latitude);
 
break;
 
 
// Error from Navi
 
 
default:
stats.other_data_count++;
break;
 
}
}
 
public boolean force_disconnect=true;
 
public void close_connections(boolean force)
{
// if ((!force)&&root.canvas.do_vibra) root.vibrate(500);
force_disconnect=force;
try{ reader.close(); }
catch (Exception inner_ex) { }
 
try{ writer.close(); }
catch (Exception inner_ex) { }
//#ifdef j2me
//# try{ connection.close(); }
//# catch (Exception inner_ex) { }
//#endif
ufo_prober.set_to_none();
stats.reset();
connected=false;
version=new MKVersion();
}
 
// Thread to recieve data from Connection
public void run()
{
boolean sigfail=false;
if (bootloader_stage==BOOTLOADER_STAGE_GOT_MKBL)
{
try {
flash_msgs[msg_pos++]="reading avr_sig";
 
writer.write( 't');
writer.flush();
int avr_sig=reader.read();
 
//while (avr_sig==63)
// avr_sig=reader.read();
 
flash_msgs[msg_pos++]="got avr sig " + avr_sig;
 
int avrsig_suff=reader.read();
if (avrsig_suff!=0)
throw new Exception("val after avrsig is" +avrsig_suff +"should b 0");
 
if ((avr_sig!=0x74)&&(avr_sig!=224)&&(avr_sig!=120))
{
sigfail=true;
throw new Exception("avr sig" + avr_sig + " unknown");
}
writer.write('T');
// writer.flush();
writer.write(avr_sig); // set devicetyp = 0x74 oder 0x76
writer.flush();
 
if (reader.read()!=0x0d)
throw new Exception("cant get buffer size");
writer.write('V');
writer.flush();
 
int bl_version_major=reader.read();
int bl_version_minor=reader.read();
 
flash_msgs[msg_pos++]="BL Version " + bl_version_major+"."+bl_version_minor;
writer.write('b');
writer.flush();
 
if (reader.read()!='Y')
throw new Exception("cant get buffer size");
 
int send_buff_size1=reader.read();
int send_buff_size2=reader.read();
int send_buff_size=send_buff_size1*0x100+send_buff_size2;
flash_msgs[msg_pos++]="BUFF Size:" + send_buff_size;
// if (send_buff_size>128)
// send_buff_size=128;
 
// if (!bootloader_intension
if (bootloader_intension_flash)
{
byte[] flash_buff =new byte[send_buff_size]; ///!!
String firmware_filename=(avr_sig==224)?"/navi.bin":((avr_sig==120)?"/mk3.bin":"/fc.bin");
flash_msgs[msg_pos++]="Opening firmware " + firmware_filename + "..";
InputStream in;
try {
in=this.getClass().getResourceAsStream(firmware_filename);
}
catch (Exception e) { throw new Exception(" .. cant open firmware"); }
int firmware_size=-1;
try {
firmware_size= ((int)in.read()<<24) |((int)in.read()<<16) | ((int)in.read()<<8) | ((int)in.read()&0xff) ;
}
catch (Exception e) { throw new Exception(" .. cant read size"); }
int blocks2write=((firmware_size/send_buff_size));
flash_msgs[msg_pos++]=".. open("+blocks2write+" blocks," + firmware_size + "bytes)";
// if (true) throw new Exception("before erasing");
// if (true) throw new Exception("before erasing" );
flash_msgs[msg_pos++]="Erasing Flash ..";
writer.write('e');
writer.flush();
if (reader.read()!=0x0d)
throw new Exception("cant erase flash");
flash_msgs[msg_pos]+="OK";
writer.write('A');
writer.write(0);
writer.write(0);
writer.flush();
if (reader.read()!=0x0d)
throw new Exception("cant set addr");
flash_msgs[msg_pos++]="addr set";
// int blocks2write=((firmware_size/send_buff_size));
if ((firmware_size%send_buff_size)>0)
blocks2write++;
for ( int block=0; block<blocks2write; block ++)
{
int hex_bytes_read=in.read(flash_buff,0,send_buff_size);
flash_msgs[msg_pos]="bl:" + block + "/" + blocks2write + " si:"+hex_bytes_read ;
writer.write('B');
writer.write((hex_bytes_read>>8)& 0xFF);
writer.write((hex_bytes_read)& 0xFF);
writer.write('F');
writer.flush();
writer.write(flash_buff,0,hex_bytes_read);
writer.flush();
if (avr_sig==224)
{
int crc=0xFFFF;
for (int crc_pos=0;crc_pos<hex_bytes_read;crc_pos++)
crc=CRC16(flash_buff[crc_pos],crc);
writer.write(crc>>8);
writer.write(crc&0xff);
writer.flush();
}
// flash_msgs[msg_pos]+="ok";
// writer.flush();
if (reader.read()!=0x0d)
throw new Exception("abort write at block"+block);
// sleep(1000);
}
// flash_msgs[msg_pos]="bl:" + block + "/" + blocks2write + " si:"+hex_bytes_read ;
/*
int inp=0;
int block=0;
while (inp!=-1)
{
int flash_buff_pos=0;
int crc=0xFFFF;
while ((flash_buff_pos<send_buff_size)&&(inp!=-1))
{
inp=in.read();
if (inp!=-1)
{
crc=CRC16(inp,crc);
flash_buff[flash_buff_pos++]=(byte)inp;
}
}
// flash_msgs[msg_pos]="block" + block + "size:"+flash_buff_pos;
block++;
boolean block_fin=false;
 
 
while(!block_fin)
{
writer.write('B');
writer.write((flash_buff_pos>>8)& 0xFF);
writer.write((flash_buff_pos)& 0xFF);
writer.write('F');
writer.flush();
 
// int ret_v=-1;
writer.write(flash_buff,0,flash_buff_pos);
flash_msgs[msg_pos]="bl:" + block + "si:"+flash_buff_pos ;
writer.flush();
// flash_msgs[msg_pos]+="wtc";
// append crc if navi
if (avr_sig==224)
{
writer.write(crc>>8);
writer.write(crc&0xff);
writer.flush();
}
// flash_msgs[msg_pos]+="ok";
// writer.flush();
// if (reader.read()!=0x0d)
// throw new Exception("abort write at block"+block);
//ret_v=reader.read();
// flash_msgs[msg_pos]="ret"+ret_v + "crc"+crc;
if (reader.read()==0x0d)
block_fin=true;
}
 
}
*/
flash_msgs[++msg_pos]="written last block ";
msg_pos++;
flash_buff=null;
 
ufo_prober.set_to_none();
stats.reset();
version=new MKVersion();
System.gc();
}
else // bootloader intension clear settings
{
 
flash_msgs[msg_pos]="reset params ..";
writer.write('B');
writer.write(0);
writer.write(4);
writer.write('E');
writer.flush();
writer.write(0xFF);
writer.write(0xFF);
writer.write(0xFF);
writer.write(0xFF);
writer.flush();
flash_msgs[msg_pos++]+=" done";
}
 
flash_msgs[msg_pos++]="Exiting Bootloader" ;
params=new MKParamsParser();
try{
writer.write('E');
writer.flush();
}
catch (Exception e) {
flash_msgs[msg_pos++]="cant exit bootloader" ;
}
flash_msgs[msg_pos++]="Exit BL done" ;
 
bootloader_finish_ok=true;
}
catch (Exception e) {
flash_msgs[msg_pos++]="Fail:" +e.getMessage() ;
 
 
flash_msgs[msg_pos++]="Exiting Bootloader" ;
params=new MKParamsParser();
try{
writer.write('E');
writer.flush();
}
catch (Exception e2) {
flash_msgs[msg_pos++]="cant exit bootloader" ;
}
flash_msgs[msg_pos++]="Exit BL done" ;
if (sigfail&&(bl_retrys<3))
{
bl_retrys++;
init_bootloader=true;
}
close_connections(false);
}
 
 
sending=false;
}
 
 
byte[] data_set=new byte[1024];
int data_set_pos=0;
byte[] data_in_buff=new byte[2048];
int input;
int pos=0;
 
 
 
 
 
log("Thread started");
while(true)
{
if (!connected)
{
if (!force_disconnect) connect();
sleep(100);
}
else
try{
/*
while(sending)
{try { Thread.sleep(50); }
catch (Exception e) { }
}
*/
recieving=true;
int read_count =reader.read(data_in_buff,0,reader.available());
log("Connected - reading data " + read_count);
// pos=0;
input=0;
//data_buff[data_buff_pos]="";
// recieve data-set
if (read_count==0) sleep(50);
 
// int read_count =reader.read(data_in_buff,0,reader.available());
stats.bytes_in+=read_count;
if (read_count>0)
{
log("read" + read_count + " ds_pos" + data_set_pos);
for ( pos=0;pos<read_count;pos++)
{
if (data_in_buff[pos]==13)
{
data_buff[data_buff_pos]=new String(data_set, 0, data_set_pos);
data_buff_pos++;
data_buff_pos%=DATA_BUFF_LEN;
 
try{process_data(data_set,data_set_pos); }
catch (Exception e)
{
log(".. problem processing");
log(e.toString());
}
 
 
 
 
proxy.write(data_set,0,data_set_pos);
// proxy.writer.write('\r');
//proxy.writer.write('\n');
//proxy.writer.flush();
/*
if (proxy!=null)
{
 
 
}
*/
data_set_pos=0;
 
}
else
{
data_set[data_set_pos++]=data_in_buff[pos];
 
if ( (data_set_pos>4) && (data_set[data_set_pos-4]==(byte)'M') && (data_set[data_set_pos-3]==(byte)'K') && (data_set[data_set_pos-2]==(byte)'B') && (data_set[data_set_pos-1]==(byte)'L'))
{
bootloader_stage= BOOTLOADER_STAGE_GOT_MKBL;
return;
}
}
 
}
}
else
sleep(50);
/*
while ((input != 13)) //&&(input!=-1))
{
{
//log("pre read");
log(""+reader.available());
input = reader.read() ;
log("Byte rcv" + input +"pos"+ pos);
proxy.write(input);
data_buff[data_buff_pos]+=(char)input;
if ((data_buff[data_buff_pos].length()>3)&&(data_buff[data_buff_pos].substring(data_buff[data_buff_pos].length()-4,data_buff[data_buff_pos].length()).equals("MKBL")))
{
bootloader_stage= BOOTLOADER_STAGE_GOT_MKBL;
return;
}
if (input==-1) throw new Exception("disconnect");
else
{
stats.bytes_in++;
data_set[pos]=input;
pos++;
}
}
}
 
data_buff_pos++;
data_buff_pos%=DATA_BUFF_LEN;
recieving=false;
log("Data recieved (" + pos + "Bytes)");
log("processing ..");
*/
 
/*
if (proxy!=null)
{
proxy.writer.write('\r');
proxy.writer.write('\n');
proxy.writer.flush();
}
*/
/*if (pos>5)
{
try{process_data(data_set,pos); }
catch (Exception e)
{
log(".. problem processing");
log(e.toString());
}
log(".. processing done");
}
*/
}
catch (Exception ex)
{
log("Problem reading from MK -> closing conn");
log(ex.toString());
// close the connection
close_connections(false);
}
// sleep a bit to get someting more done
// sleep(5); //50
} // while
// log("Leaving Communicator thread");
} // run()
}
/DUBwise/tags/v0.52/shared/src/MKDebugData.java
0,0 → 1,83
/*********************************************
*
* class representing the DebugData Structure
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
********************************************/
 
package org.ligi.ufo;
 
public class MKDebugData
{
 
public int[] analog;
public String[] names;
public boolean[] got_name;
public int motor_complete=-1;
 
private int i;
 
public int motor_val(int id) { return analog[12+id]; }
public int nick_int() { return analog[0]; }
public int roll_int() { return analog[1]; }
public int accnick() { return analog[2]; }
public int accroll() { return analog[3]; }
 
 
public int UBatt() { return analog[9]; }
public int SenderOkay() { return analog[10]; }
 
 
 
public MKDebugData()
{
names=new String[32];
analog=new int[32];
got_name=new boolean[32];
for (i=0;i<32;i++)
{
analog[i]=-1;
names[i]="-#"+i+"->";
got_name[i]=false;
}
 
}
 
public void set_names_by_mk_data(int[] in_arr)
{
int id=in_arr[0];
names[id]="";
for (i=0;i<16;i++)
{
if ((char)in_arr[i+1]!=' ')
names[id]+=(char)in_arr[i+1];
got_name[id]=true;
}
names[id]+=":";
}
 
 
public void set_by_mk_data(int[] in_arr,MKVersion version)
{
 
for (i=0;i<32;i++)
// {
analog[i]=MKHelper.parse_signed_int_2( in_arr[2+i*2], in_arr[3+i*2] );
//(int)((in_arr[3+i*2]<<8) | in_arr[2+i*2]);
// if ((analog[i]&(1<<15))!=0)
//analog[i]=-(analog[i]&(0xFFFF-1))^(0xFFFF-1);
// }
motor_complete=motor_val(0)+motor_val(1)+motor_val(2)+motor_val(3);
 
 
}
 
 
 
}
/DUBwise/tags/v0.52/shared/src/MKGPSPosition.java
0,0 → 1,407
/*********************************************
*
* class representing the DebugData Structure
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
* Some code taken from here:
* http://www.koders.com/java/fidFC75A641A87B51BB757E9CD3136C7886C491487F.aspx
*
* and
* http://www.movable-type.co.uk/scripts/latlong.html
*
* thanx a lot for sharing!
*
********************************************/
 
package org.ligi.ufo;
 
 
import java.lang.Math;
public class MKGPSPosition
implements DUBwiseDefinitions
{
 
public byte act_gps_format=GPS_FORMAT_DECIMAL;
public byte act_speed_format=SPEED_FORMAT_KMH;
 
public final static int MAX_WAYPOINTS=100;
 
public int[] LongWP;
public int[] LatWP;
public String[] NameWP;
 
int UBatt;
 
public int last_wp=0;
 
public int Longitude;
public int Latitude;
public int Altitude;
 
public int TargetLongitude;
public int TargetLatitude;
public int TargetAltitude;
 
public int HomeLongitude;
public int HomeLatitude;
public int HomeAltitude;
 
public int Distance2Target;
public int Angle2Target;
 
public int Distance2Home;
public int Angle2Home;
 
public byte SatsInUse=-1;
public byte WayPointNumber=-1;
public byte WayPointIndex=-1;
public int AngleNick = -1;
public int AngleRoll = -1;
public int SenderOkay = -1;
public int MKFlags= -1;
public int NCFlags= -1;
public int ErrorCode= -1;
 
 
 
public int Altimeter=-1; // hight according to air pressure
public int Variometer=-1; // climb(+) and sink(-) rate
public int FlyingTime=-1;
 
public int GroundSpeed=-1;
public int Heading=-1;
public int CompasHeading=-1;
 
 
 
//#if cldc11=="on"
public static final double PI = Math.PI;
public static final double PI_div2 = PI / 2.0;
public static final double PI_div4 = PI / 4.0;
public static final double RADIANS = PI / 180.0;
public static final double DEGREES = 180.0 / PI;
 
private static final double p4 = 0.161536412982230228262e2;
private static final double p3 = 0.26842548195503973794141e3;
private static final double p2 = 0.11530293515404850115428136e4;
private static final double p1 = 0.178040631643319697105464587e4;
private static final double p0 = 0.89678597403663861959987488e3;
private static final double q4 = 0.5895697050844462222791e2;
private static final double q3 = 0.536265374031215315104235e3;
private static final double q2 = 0.16667838148816337184521798e4;
private static final double q1 = 0.207933497444540981287275926e4;
private static final double q0 = 0.89678597403663861962481162e3;
 
 
 
private static double _ATAN(double X)
{
if (X < 0.414213562373095048802)
return _ATANX(X);
else if (X > 2.414213562373095048802)
return PI_div2 - _ATANX(1.0 / X);
else
return PI_div4 + _ATANX((X - 1.0) / (X + 1.0));
}
 
 
private static double _ATANX(double X)
{
double XX = X * X;
return X * ((((p4 * XX + p3) * XX + p2) * XX + p1) * XX + p0)/ (((((XX + q4) * XX + q3) * XX + q2) * XX + q1) * XX + q0);
}
 
 
 
public double aTan2(double Y, double X)
{
 
if (X == 0.0) {
if (Y > 0.0)
return PI_div2;
else if (Y < 0.0)
return -PI_div2;
else
return 0.0;
}
 
// X<0
else if (X < 0.0) {
if (Y >= 0.0)
return (PI - _ATAN(Y / -X)); // Y>=0,X<0 |Y/X|
else
return -(PI - _ATAN(Y / X)); // Y<0,X<0 |Y/X|
}
 
// X>0
else if (X > 0.0)
{
if (Y > 0.0)
return _ATAN(Y / X);
else
return -_ATAN(-Y / X);
}
 
return 0.0;
 
}
 
public int distance2wp(int id)
{
double lat1=(Latitude/10000000.0)*RADIANS;
double long1=(Longitude/10000000.0)*RADIANS;
 
double lat2=(LatWP[id]/10000000.0)*RADIANS;
double long2=(LongWP[id]/10000000.0)*RADIANS;
 
 
double dLat= (lat2-lat1);
double dLon= (long2-long1);
 
double a = Math.sin(dLat/2.0) * Math.sin(dLat/2.0) +
Math.cos(lat1) * Math.cos(lat2) *
Math.sin(dLon/2.0) * Math.sin(dLon/2.0);
 
return (int)(( 2.0 * aTan2(Math.sqrt(a), Math.sqrt(1.0-a)) )*6371008.8);
}
 
 
 
 
public int angle2wp(int id)
{
// TODO reuse from distance
double lat1=(Latitude/10000000.0)*RADIANS;
double long1=(Longitude/10000000.0)*RADIANS;
 
double lat2=(LatWP[id]/10000000.0)*RADIANS;
double long2=(LongWP[id]/10000000.0)*RADIANS;
 
 
double dLat= (lat2-lat1);
double dLon= (long2-long1);
 
 
double y = Math.sin(dLon) * Math.cos(lat2);
double x = Math.cos(lat1)*Math.sin(lat2) - Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);
return ((int)(aTan2(y, x)*DEGREES)+360)%360;
 
}
 
 
//#endif
 
//#if cldc11!="on"
//# public int distance2wp(int id)
//# {
//# return -1;
//# }
 
//# public int angle2wp(int id)
//# {
//# return -1;
//# }
//#endif
 
public void push_wp()
{
LongWP[last_wp]=Longitude;
LatWP[last_wp]=Latitude;
 
last_wp++;
}
 
/* public void next_gps_format()
{
act_gps_format=(byte)((act_gps_format+1)%GPS_FORMAT_COUNT);
}*/
 
public String act_gps_format_str(int val)
{
switch(act_gps_format)
{
case GPS_FORMAT_DECIMAL:
return "" + val/10000000 + "." +val%10000000 ;
case GPS_FORMAT_MINSEC:
return "" + val/10000000 + "^" + ((val%10000000)*60)/10000000 + "'" + ((((val%10000000)*60)%10000000)*60)/10000000 + "." + ((((val%10000000)*60)%10000000)*60)%10000000;
default:
return "invalid format";
}
}
 
 
public String act_speed_format_str(int val)
{
switch(act_speed_format)
{
case SPEED_FORMAT_KMH:
return "" + ((((val*60)/100)*60)/1000) + " km/h";
 
case SPEED_FORMAT_MPH:
return "" + (((((val*60)/100)*60)/1000)*10)/16 + " m/h";
 
case SPEED_FORMAT_CMS:
return "" + val+ " cm/s";
default:
return "invalid speed format";
}
}
 
public String GroundSpeed_str()
{
return act_speed_format_str(GroundSpeed);
 
}
 
public String WP_Latitude_str(int id)
{
return act_gps_format_str(LatWP[id]); //+ "''N" ;
}
 
public String WP_Longitude_str(int id)
{
return act_gps_format_str(LongWP[id]); //+ "''E" ;
 
}
 
public String Latitude_str()
{
return act_gps_format_str(Latitude) ;
}
 
public String Longitude_str()
{
return act_gps_format_str(Longitude) ;
}
 
 
public String TargetLatitude_str()
{
return act_gps_format_str(TargetLatitude) ;
}
 
public String TargetLongitude_str()
{
return act_gps_format_str(TargetLongitude) ;
}
 
public String HomeLatitude_str()
{
return act_gps_format_str(HomeLatitude) ;
}
 
public String HomeLongitude_str()
{
return act_gps_format_str(HomeLongitude) ;
}
 
 
// Constructor
public MKGPSPosition()
{
 
LongWP=new int[MAX_WAYPOINTS];
LatWP=new int[MAX_WAYPOINTS];
 
NameWP=new String[MAX_WAYPOINTS];
// predefined waypoints
 
/*
LongWP[0]=123230170;
LatWP[0]= 513600170 ;
NameWP[0]="Sicherer PC1";
 
LongWP[1]=123269000;
LatWP[1]= 513662670;
NameWP[1]="Sicherer PC2";
 
LongWP[2]=123475570;
LatWP[2]= 513569750 ;
NameWP[2]="Treffpunkt Seba";
*/
 
last_wp=0;
}
private int parse_arr_4(int offset,int[] in_arr)
{
return ((in_arr[offset+3]<<24) |
(in_arr[offset+2]<<16) |
(in_arr[offset+1]<<8) |
(in_arr[offset+0]));
}
 
private int parse_arr_2(int offset,int[] in_arr)
{
return (((in_arr[offset+1]&0xFF)<<8) |
(in_arr[offset+0]&0xFF ));
}
 
 
 
public void set_by_mk_data(int[] in_arr,MKVersion version)
{
Longitude=parse_arr_4(0,in_arr);
Latitude=parse_arr_4(4,in_arr);
Altitude=parse_arr_4(8,in_arr);
//status=in_arr[12];
 
TargetLongitude=parse_arr_4(13,in_arr);
TargetLatitude=parse_arr_4(17,in_arr);
TargetAltitude=parse_arr_4(21,in_arr);
//Targetstatus=in_arr[25];
 
Distance2Target=parse_arr_2(26,in_arr);
Angle2Target=parse_arr_2(28,in_arr);
 
HomeLongitude=parse_arr_4(30,in_arr);
HomeLatitude=parse_arr_4(34,in_arr);
HomeAltitude=parse_arr_4(38,in_arr);
//Targetstatus=in_arr[42];
 
Distance2Home=parse_arr_2(43,in_arr);
Angle2Home=parse_arr_2(45,in_arr);
 
WayPointIndex=(byte)in_arr[47];
WayPointNumber=(byte)in_arr[48];
 
SatsInUse=(byte)in_arr[49];
Altimeter=parse_arr_2(50,in_arr); // hight according to air pressure
Variometer=parse_arr_2(52,in_arr);; // climb(+) and sink(-) rate
FlyingTime=parse_arr_2(54,in_arr);;
UBatt= in_arr[56];
 
 
GroundSpeed= parse_arr_2(57,in_arr);
Heading= parse_arr_2(59,in_arr);
CompasHeading= parse_arr_2(61,in_arr);
AngleNick = in_arr[63];
AngleRoll = in_arr[64];
SenderOkay = in_arr[65];
 
MKFlags=in_arr[66];
NCFlags=in_arr[67];
 
ErrorCode=in_arr[67];
 
 
}
 
 
 
}
/DUBwise/tags/v0.52/shared/src/MKHelper.java
0,0 → 1,21
package org.ligi.ufo;
 
public final class MKHelper
{
public final static int parse_signed_int_2(int i1,int i2)
{
int res=(int)((i2<<8)|i1);
if ((res&(1<<15))!=0)
return -(res&(0xFFFF-1))^(0xFFFF-1);
else
return res;
 
}
 
 
public final static int parse_unsigned_int_2(int i1,int i2)
{
return (int)((i2<<8)|i1);
}
 
}
/DUBwise/tags/v0.52/shared/src/MKLCD.java
0,0 → 1,85
/*******************************************
*
* Handling of MK LCD
*
* Author: Marcus -LiGi- Bueschleb
* see README for further Infos
*
*
*******************************************/
 
package org.ligi.ufo;
 
public class MKLCD
// implements Runnable
{
 
MKCommunicator mk=null;
 
int last_recieved_page=0;
int act_page=0;
public int pages=-1;
 
private String[] lcd_buf;
private String[] lcd_buf_;
 
public String[] get_act_page()
{ return lcd_buf; }
 
public MKLCD(MKCommunicator _mk)
{
lcd_buf=new String[4];
 
lcd_buf[0]="no ";
lcd_buf[1]="DisplayData " ;
lcd_buf[2]="read ";
lcd_buf[3]="yet ";
mk=_mk;
}
 
public void set_page(int page)
{
act_page=page;
}
 
public void handle_lcd_data(int[] data)
{
 
lcd_buf_=new String[4];
last_recieved_page=data[0];
pages=data[1];
 
for(int row=0;row<4;row++)
{
lcd_buf_[row]="";
for(int col=0;col<20;col++)
lcd_buf_[row]+=(char)data[row*20+col+2];
}
lcd_buf=lcd_buf_;
}
 
public void trigger_LCD()
{
mk.trigger_LCD_by_page(act_page);
}
 
 
public void LCD_NEXTPAGE()
{
if (act_page!=pages)
act_page++;
else
act_page=0;
 
}
 
public void LCD_PREVPAGE()
{
if (act_page!=0)
act_page--;
else
act_page=pages;
}
}
/DUBwise/tags/v0.52/shared/src/MKParamDefinitions.java
0,0 → 1,17
package org.ligi.ufo;
 
public interface MKParamDefinitions
{
 
public final static int PARAMTYPE_BYTE=0;
public final static int PARAMTYPE_MKBYTE=1; // has potis @ end
public final static int PARAMTYPE_BITSWITCH=2;
public final static int PARAMTYPE_STICK=3;
public final static int PARAMTYPE_KEY=4;
public final static int PARAMTYPE_BITMASK=5;
 
public final static int PARAMTYPE_CHOICE=6;
 
// choice must be last!
 
}
/DUBwise/tags/v0.52/shared/src/MKParamsParser.java
0,0 → 1,207
/**************************************************
*
* class representing the Params Structure
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
*************************************************/
 
package org.ligi.ufo;
 
 
 
public class MKParamsParser extends ParamsClass
implements MKParamDefinitions
 
{
// -- start generated code --
public final static String[][] all_tab_names={{"Altitude","Camera","Channels","Configuration","Coupling","Gyro","Looping","Navi","Other","Output","Stick","User"},{"Altitude","Camera","Channels","Configuration","Coupling","Gyro","Looping","Navi","Other","Output","Stick","User"}};
public final static String[][][] all_field_names={{{"Min. Accelerate","Barometric D","Setpoint","Altitude P","Gain","Z-ACC","3-Way switch"},{"Servo control","Nick compensation","Servo min","Servo max","Refresh rate","Invert Direction"},{"Nick","Roll","Accelerate","Gier","POTI1","POTI2","POTI3","POTI4"},{"ALTITUDE_CONTROL","Switch for Setpoint","Heading Hold","Compas Active","Compas Fix","GPS","Coupling","Yaw Rate Limiter"},{"Yaw pos. feedback","Yaw neg. feedback"},{"ACC/Gyro Factor","P-Rate","I-Rate","ACC/Gyro Comp","Drift-Compensation","Dynamic stability"},{"Gas Limit","Threshold","Hysterese","TurnOver Nick","TurnOver Roll","UP","DOWN","LEFT","RIGHT"},{"Mode Control","GPS-Gain","GPS-P","GPS-I","GPS-D","GPS-ACC","Satelite Minimum","Stick Threhsold","Wind Correction","Speed Compensation","Operating Radius","Angle Limit"},{"Min Gas","Max Gas","Compass Effect","Voltage Warning","Distress Gas","Distress Gas Time"},{"J16 Bitmask","J16 Timing","J17 Bitmask","J17 Timing"},{"Nick/Roll P","Nick/Roll D","Gier P","External Control"},{"Param 1","Param 2","Param 3","Param 4","Param 5","Param 6","Param 7","Param 8"}},{{"Min. Accelerate","Barometric D","Setpoint","Altitude P","Gain","Z-ACC","3-Way switch"},{"Servo control","Nick compensation","Servo min","Servo max","Refresh rate","Invert Direction"},{"Nick","Roll","Accelerate","Gier","POTI1","POTI2","POTI3","POTI4"},{"ALTITUDE_CONTROL","Switch for Setpoint","Heading Hold","Compas Active","Compas Fix","GPS","Coupling","Yaw Rate Limiter"},{"Yaw pos. feedback","Coupling2","Coupling YawCorrect"},{"ACC/Gyro Factor","P-Rate","I-Rate","D-Rate","ACC/Gyro Comp","Drift-Compensation","Dynamic stability"},{"Gas Limit","Threshold","Hysterese","TurnOver Nick","TurnOver Roll","UP","DOWN","LEFT","RIGHT"},{"Mode Control","GPS-Gain","GPS-P","GPS-I","GPS-D","GPS-P Limit","GPS-I Limit","GPS-D Limit","GPS-ACC","Satelite Minimum","Stick Threhsold","Wind Correction","Speed Compensation","Operating Radius","Angle Limit","PH LoginTime"},{"Min Gas","Max Gas","Compass Effect","Voltage Warning","Distress Gas","Distress Gas Time"},{"J16 Bitmask","J16 Timing","J17 Bitmask","J17 Timing"},{"Nick/Roll P","Nick/Roll D","Gier P","External Control"},{"Param 1","Param 2","Param 3","Param 4","Param 5","Param 6","Param 7","Param 8"}}};
public final static int[][][] all_field_positions={{{9,10,11,12,13,14,556},{33,34,35,36,37,560},{0,1,2,3,4,5,6,7},{64,65,66,67,68,69,70,71},{41,42},{20,22,23,45,46,47},{38,39,40,43,44,552,553,554,555},{56,57,58,59,60,61,62,63,64,65,66,67},{18,19,21,24,25,26},{52,53,54,55},{15,16,17,68},{29,30,31,32,48,49,50,51}},{{9,10,11,12,13,14,604},{34,35,36,37,38,608},{0,1,2,3,4,5,6,7},{64,65,66,67,68,69,70,71},{42,43,44},{20,22,23,24,47,48,49},{39,40,41,45,46,600,601,602,603},{58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73},{18,19,21,25,26,27},{54,55,56,57},{15,16,17,74},{30,31,32,33,50,51,52,53}}};
public final static int[][][] all_field_types={{{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK},{PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE,PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE}},{{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH},{PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK,PARAMTYPE_STICK},{PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH,PARAMTYPE_BITSWITCH},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE,PARAMTYPE_BITMASK,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE},{PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE,PARAMTYPE_MKBYTE}}};
public final static int[] all_name_positions={75,81};
public final static int[] all_lengths={87,93};
// -- end generated code --
 
 
public final static int MAX_PARAMSETS=5;
// public final static int MAX_PARAMLENGTH=100;
 
public int[][] field;
public int[][] field_bak;
// public String[] names={"","","","",""};
 
public int act_paramset=0;
 
 
public int params_version=-1;
public int last_parsed_paramset=-1;
public int active_paramset=-1;
public boolean found_incompatible=false;
 
public String[] stick_names;
 
public int get_field_from_act(int pos)
{ return field[act_paramset][pos]; }
 
public void set_field_from_act(int pos,int val)
{
if (val>255) val=255;
if (val<0) val=255;
field[act_paramset][pos]=val;
}
 
 
/* public void field_from_act_add(int pos,int val)
{
set_field_from_act(pos , get_field_from_act(pos)+val);
}
 
// for boolean Flags
public void field_from_act_xor(int pos,int val)
{
field[act_paramset][pos]^=val;
}
 
*/
 
public void set_name(String nme)
{
if (nme.length()>10)
nme=nme.substring(0,10);
// names[act_paramset]=nme;
int nme_pos=0;
while(nme_pos<nme.length())
{
field[act_paramset][name_start+nme_pos]=(byte)nme.charAt(nme_pos);
nme_pos++;
}
field[act_paramset][name_start+nme_pos]=0;
}
 
public MKParamsParser()
{
field=new int[MAX_PARAMSETS][];
field_bak=new int[MAX_PARAMSETS][];
for (int ii=0;ii<MAX_PARAMSETS;ii++)
{
field[ii]=null;
field_bak[ii]=null;
}
 
stick_names=new String[10];
for (int i=0;i<10;i++)
stick_names[i]="not read yet";
}
 
public int length=0;
public int name_start=0;
/*
public int[] param_type;
public int[] param_pos;
public int[] param_innerpos;
 
public String[] tab_names;
public String[][] field_names;
public int[][] field_positions;
public int[][] field_types;
 
public int length;
public int name_start;
*/
 
 
public void use_backup()
{
set_by_mk_data(field_bak[act_paramset]);
}
 
public void update_backup(int to)
{
for ( int i=0 ; i<field[act_paramset].length;i++)
{
field_bak[to][i+2]=field[act_paramset][i];
field[to][i]=field[act_paramset][i];
}
 
field_bak[to][0]=to+1;
field_bak[to][1]=params_version;
 
}
 
public void reset()
{
last_parsed_paramset=-1;
 
for (int ii=0;ii<MAX_PARAMSETS;ii++)
field[ii]=null;
}
public String getParamName(int paramset)
{
String res="";
for ( int i=name_start;i<length;i++)
{
if(field[paramset][i]==0)break;
res+=(char)field[paramset][i];
}
return res;
}
 
public void set_by_mk_data(int[] in_arr)
{
params_version=in_arr[1];
int definition_pos=params_version-73;
 
 
if ((definition_pos<0)||( (definition_pos>=all_tab_names.length)))
{
found_incompatible=true;
return;
}
 
 
 
last_parsed_paramset=in_arr[0]-1;
 
if (active_paramset==-1)active_paramset=last_parsed_paramset;
 
tab_names=all_tab_names[definition_pos];
field_names=all_field_names[definition_pos];
field_positions=all_field_positions[definition_pos];
field_types=all_field_types[definition_pos];
 
name_start=all_name_positions[definition_pos];
length=all_lengths[definition_pos];
 
field[last_parsed_paramset]=new int[length];
field_bak[last_parsed_paramset]=new int[length+2];
 
// names[last_parsed_paramset]="";
for ( int i=0;i<length+2;i++)
{
if (i<length)
field[last_parsed_paramset][i]=in_arr[i+2];
field_bak[last_parsed_paramset][i]=in_arr[i];
}
 
 
for (int i=0;i<10;i++)
stick_names[i]="not associated";
 
for (int tab=0;tab<tab_names.length;tab++)
for (int item=0;item<field_types[tab].length;item++)
if (field_types[tab][item]==PARAMTYPE_STICK)
stick_names[ field[last_parsed_paramset][field_positions[tab][item]] ] = field_names[tab][item];
}
 
 
 
}
/DUBwise/tags/v0.52/shared/src/MKProxy.java
0,0 → 1,122
package org.ligi.ufo;
 
 
import java.io.*;
//import javax.microedition.io.*;
 
//#ifdef j2me
//# import javax.microedition.io.*;
//#endif
 
public class MKProxy
implements Runnable
{
 
public boolean connected;
public String url;
public String err_str="none";
 
//#ifdef j2me
//# StreamConnection connection;
//#endif
 
//#ifdef android
java.net.Socket connection;
//#endif
 
public java.io.InputStream reader;
public java.io.OutputStream writer;
 
MKCommunicator mk;
 
 
public MKProxy(MKCommunicator _mk)
{
mk=_mk;
new Thread( this ).start(); // fire up main Thread
}
 
public void connect(String url_)
{
url=url_;
 
try
{
//
 
//#ifdef android
connection = new java.net.Socket(url_,9876);
 
reader=connection.getInputStream();
writer=connection.getOutputStream();
//#endif
 
//#ifdef j2me
//# connection = (StreamConnection) Connector.open(url, Connector.READ_WRITE);
//# reader=connection.openInputStream();
//# writer=connection.openOutputStream();
 
//#endif
 
String init="new:foo bar\r\n";
writer.write(init.getBytes());
writer.flush();
connected=true;
}
catch (Exception e)
{
// err_str=e.toString();
// this=null;
 
connected=false;
}
 
}
 
public void write(byte[] input,int off,int len)
{
if (connected)
try{ writer.write(input,off,len);
writer.write(13);
writer.flush();
// if (input==13) writer.flush();
 
}
catch(Exception e) { connected=false; }
}
public void sleep(int time)
{
try { Thread.sleep(time); }
catch (Exception e) { }
}
 
 
 
public void run()
{
 
while(true)
{
 
try {
if (connected)
{
byte[] data_in_buff=new byte[reader.available()];
int read_count =reader.read(data_in_buff,0,reader.available());
if (read_count>0) mk.write_raw(data_in_buff);
sleep(30);
}
else
sleep(300);
}
catch ( Exception e){}
}
 
}
 
 
 
}
/DUBwise/tags/v0.52/shared/src/MKStatistics.java
0,0 → 1,72
/********************************************************************************
* Statistics from MK-Connection ( needed for 2. Thread and Readability of Code )
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
********************************************************************************/
 
package org.ligi.ufo;
 
public class MKStatistics
 
{
 
public int bytes_in=0;
public int bytes_out=0;
 
 
public int resend_count=0;
 
public int debug_data_count=0;
public int debug_names_count=0;
public int angle_data_count=0;
public int version_data_count=0;
public int other_data_count=0;
public int lcd_data_count=0;
public int params_data_count=0;
public int navi_data_count=0;
public int stick_data_count=0;
public int external_control_confirm_frame_count=0;
 
 
public int debug_data_request_count=0;
public int debug_name_request_count=0;
public int version_data_request_count=0;
public int lcd_data_request_count=0;
public int params_data_request_count=0;
// public int navi_data_count=0;
public int stick_data_request_count=0;
public int motortest_request_count=0;
public int external_control_request_count=0;
 
 
public void reset()
{
 
debug_data_count=0;
debug_names_count=0;
angle_data_count=0;
version_data_count=0;
other_data_count=0;
lcd_data_count=0;
params_data_count=0;
navi_data_count=0;
bytes_in=0;
bytes_out=0;
stick_data_count=0;
 
 
debug_data_request_count=0;
debug_name_request_count=0;
version_data_request_count=0;
lcd_data_request_count=0; //
params_data_request_count=0; //
stick_data_request_count=0;
motortest_request_count=0; //
 
 
}
}
/DUBwise/tags/v0.52/shared/src/MKStickData.java
0,0 → 1,44
/*********************************************
*
* class representing the StickData Structure
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
********************************************/
 
package org.ligi.ufo;
 
public class MKStickData
{
// holing stick data
public int[] stick;
 
// general counter
private int i;
 
public MKStickData()
{
 
stick=new int[10];
for (i=0;i<10;i++)
stick[i]=-1;
 
}
 
public void set_by_mk_data(int[] in_arr)
{
 
for (i=0;i<10;i++)
{
stick[i]=(int)((in_arr[1+i*2]<<8) | in_arr[i*2]);
if ((stick[i]&(1<<15))!=0)
stick[i]=-(stick[i]&(0xFFFF-1))^(0xFFFF-1);
}
 
}
 
 
 
}
/DUBwise/tags/v0.52/shared/src/MKVersion.java
0,0 → 1,48
/************************************
*
* class representing the MK-Version
* Author: Marcus -LiGi- Bueschleb
* Project-Start: 9/2007 *
*
* see README for further Infos
*
****************************************/
package org.ligi.ufo;
 
public class MKVersion
 
{
public int major=-1;
public int minor=-1;
public int compatible=-1;
public String str="--";
 
// version known?
public boolean known=false;
 
public final byte VERSION_AFTER=0;
public final byte VERSION_EQUAL=1;
public final byte VERSION_PREVIOUS=2;
 
 
public void set_by_mk_data(int[] data)
{
major=data[0];
minor=data[1];
compatible=data[2];
str="v"+major+"."+minor+"/"+compatible;
known=true;
}
public byte compare(int major_c,int minor_c)
{
if ((major_c==major)&&(minor_c==minor))
return VERSION_EQUAL;
// TODO - compare major - PC-COMPATIBLE
else if (minor_c>minor) return VERSION_AFTER;
return VERSION_PREVIOUS;
}
 
}
/DUBwise/tags/v0.52/shared/src/MKWatchDog.java
0,0 → 1,254
/**************************************
*
* WatchDog for MK-Connection
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
*
 
**************************************/
package org.ligi.ufo;
 
public class MKWatchDog
implements Runnable,DUBwiseDefinitions
{
MKCommunicator mk=null;
 
int debug_data_count_buff=-123;
 
public MKWatchDog(MKCommunicator _mk)
{
 
mk=_mk;
new Thread( this ).start(); // fire up main Thread
}
 
 
public int act_paramset=0;
int conn_check_timeout=0;
 
 
public byte resend_timeout=0;
int last_count=0;
 
 
public boolean resend_check(int ref_count)
{
if (( last_count!=ref_count)||(resend_timeout<0))
{
if (resend_timeout<0) mk.stats.resend_count++;
last_count=ref_count;
resend_timeout=20;
return true;
}
else
resend_timeout--;
return false;
}
 
//#ifdef android
// public final static int BASE_SLEEP=50;
//#else
public final static int BASE_SLEEP=10;
//#endif
 
public void run()
{
mk.log("starting Watchdog");
// get all params
int act_debug_name=0;
// int sleeper=BASE_SLEEP;
while(true)
{
try {
Thread.sleep(BASE_SLEEP);
// sleeper=BASE_SLEEP;
if (mk.connected&&(!mk.force_disconnect))
{
 
mk.log("watchdog pre main loop");
if (mk.init_bootloader)
{
mk.jump_bootloader();
mk.init_bootloader=false;
}
else if ( mk.version.major==-1 )
mk.get_version();
else if (mk.ufo_prober.is_navi()&&(mk.error_str==null))
mk.get_error_str();
 
else if (mk.ufo_prober.is_mk()&&(mk.params.last_parsed_paramset==-1))
{
mk.get_params(0xFF-1);
Thread.sleep(150);
 
act_paramset=0; // warning - if dropped problem
}
else switch (mk.user_intent)
{
case USER_INTENT_PARAMS:
 
if ((act_paramset<5))
{
 
if (resend_timeout==0) {
mk.get_params(act_paramset);
resend_timeout=120;
}
if(mk.params.field[act_paramset]!=null)
{
mk.get_params(++act_paramset);
resend_timeout=120;
}
else
resend_timeout--;
/*
// act_paramset++;
else
mk.get_params(act_paramset);
sleeper+=1200;
*/
}
break;
case USER_INTENT_RAWDEBUG:
if (act_debug_name<32)
{
 
if (resend_timeout==0) {
mk.get_debug_name(act_debug_name);
resend_timeout=50;
}
//sleeper+=100;
if (mk.debug_data.got_name[act_debug_name])
{
mk.get_debug_name(++act_debug_name);
resend_timeout=50;
}
else
resend_timeout--;
 
}
else
if (!(mk.debug_data.got_name[0]))
act_debug_name=0;
 
break;
 
case USER_INTENT_RCDATA:
if ( resend_check(mk.stats.stick_data_count) )
mk.trigger_rcdata();
break;
 
case USER_INTENT_EXTERNAL_CONTROL:
if (resend_check(mk.stats.external_control_confirm_frame_count))
{
mk.send_extern_control();
mk.send_extern_control();
mk.send_extern_control();
mk.send_extern_control();
}
 
break;
 
case USER_INTENT_LCD:
if (resend_check(mk.stats.lcd_data_count))
mk.LCD.trigger_LCD();
 
break;
 
default:
// mk.log("uncactched intent " +mk.root.canvas.user_intent );
break;
}
 
// if ((!mk.ufo_prober.is_incompatible()))
{/*
mk.log("watchdog after main loop");
if (debug_data_count_buff==mk.stats.debug_data_count)
{
mk.log("timeout:" +conn_check_timeout );
conn_check_timeout++;
if (conn_check_timeout==1000)
{
mk.log("disconnecting");
mk.close_connections(false);
conn_check_timeout=0;
}
debug_data_count_buff=mk.stats.debug_data_count;
}
else
conn_check_timeout=0;
 
*/
/*else if ((mk.root.canvas.user_intent==USER_INTENT_RAWDEBUG) || (mk.root.canvas.user_intent==USER_INTENT_GRAPH) )
{
mk.trigger_debug();
try { Thread.sleep(100); }
catch (Exception e) { }
}
*/
 
 
 
 
/*
 
 
if (debug_data_count_buff==mk.debug_data_count)
{
// mk.close_connections(false);
}
 
*/
 
/*if (mk.version.major==-1)
mk.get_version();
else
*/
/*for ( int cnt=0;cnt<5;cnt++)
if (mk.params.field[cnt]==null)
{
mk.get_params(cnt+1);
break;
}*/
/*
for (int c=0;c<32;c++)
if (!mk.debug_data.got_name[c])
{
mk.get_debug_name(c);
break;
}
*/
 
}
}
 
} // 3000
catch (Exception e) {
mk.log("err in watchdog:");
mk.log(e.toString());
 
}
}
 
 
// mk.log("watchdog quit");
}
 
}
/DUBwise/tags/v0.52/shared/src/ParamsClass.java
0,0 → 1,55
/**************************************************
*
* class representing the Params Structure
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
*************************************************/
 
package org.ligi.ufo;
 
 
 
public abstract class ParamsClass
implements MKParamDefinitions
{
 
public String[] tab_names;
public String[][] field_names;
public int[][] field_positions;
public int[][] field_types;
public String[][] choice_strings;
 
abstract public int get_field_from_act(int pos);
 
 
abstract public void set_field_from_act(int pos,int val);
 
 
public void field_from_act_add_min_max(int pos,int val,int min,int max)
{
if (((get_field_from_act(pos)+val)>=min)&&((get_field_from_act(pos)+val)<=max))
set_field_from_act(pos , get_field_from_act(pos)+val);
}
 
public void field_from_act_add(int pos,int val)
{
set_field_from_act(pos , get_field_from_act(pos)+val);
}
 
public void field_from_act_add_mod(int pos,int val,int mod)
{
int res=(get_field_from_act(pos)+val)%mod;
if ( (res)<0) res=mod-1;
set_field_from_act(pos , res);
}
 
public void field_from_act_xor(int pos,int val)
{
set_field_from_act(pos , get_field_from_act(pos)^val);
}
 
}
/DUBwise/tags/v0.52/shared/src/UFOProber.java
0,0 → 1,161
/**********************************************************************************
*
* Probe which type of UFO we talk to
*
* Author: Marcus -LiGi- Bueschleb
*
* see README for further Infos
*
*
**********************************************************************************/
 
package org.ligi.ufo;
 
//#ifdef j2me
//# import javax.microedition.io.*;
//#endif
 
import java.io.*;
 
public class UFOProber
 
{
public final static int PROBE_RESULT_NONE =0;
public final static int PROBE_RESULT_INCOMPATIBLE =1;
public final static int PROBE_RESULT_MK =2;
public final static int PROBE_RESULT_NG =3;
public final static int PROBE_RESULT_NAVCTRL =4;
public final static int PROBE_RESULT_MK3MAG =5;
 
 
 
 
public boolean change_notify=false;
 
public String[] extended_names= { "No Device" , "Inkompatible Device","MK-Connection" , "NG-Connection" , "NavCtrl-Connection","MK3Mag Connection" };
 
public int probe_result=PROBE_RESULT_NONE;
 
 
public void set_to(int _probe_result)
{
if (_probe_result!=probe_result)
{
probe_result=_probe_result;
change_notify=true;
}
}
public void set_to_navi()
{
set_to(PROBE_RESULT_NAVCTRL);
}
 
public void set_to_mk3mag()
{
set_to(PROBE_RESULT_MK3MAG);
}
 
public void set_to_mk()
{
set_to(PROBE_RESULT_MK);
}
 
 
public void set_to_none()
{
set_to(PROBE_RESULT_NONE);
}
 
public void set_to_incompatible()
{
set_to(PROBE_RESULT_INCOMPATIBLE);
}
 
public boolean is_navi()
{
return (probe_result==PROBE_RESULT_NAVCTRL);
}
 
public boolean is_mk()
{
return (probe_result==PROBE_RESULT_MK);
}
 
public boolean is_mk3mag()
{
return (probe_result==PROBE_RESULT_MK3MAG);
}
 
public boolean is_incompatible()
{
return (probe_result==PROBE_RESULT_INCOMPATIBLE);
}
 
 
public String extended_name()
{
return extended_names[probe_result];
}
 
String reply="";
public boolean probe_error=false;
 
// j2me
// private javax.microedition.io.StreamConnection connection;
// ej2me
 
 
// private java.io.InputStream reader;
//private java.io.OutputStream writer;
public void bluetooth_probe(String url)
{
try{
/*
connection = (StreamConnection) Connector.open(url);
reader=connection.openInputStream();
writer=connection.openOutputStream();
String magic="\rmk-mode\r";
writer.write(magic.getBytes());
writer.flush();
*/
 
/*
int input=0;
// recieve data-set
 
// the 1st line is the echo of the command when ng
while ((input != 13) &&(input!=-1))
{
input = reader.read() ;
reply+=(char)input;
}
reply="";
input=0;
while ((input != 13) &&(input!=-1))
if (input!=10){
input = reader.read() ;
reply+=(char)input;
}
 
if (reply=="NG here\r")
probe_result=PROBE_RESULT_NG;
 
probe_result=PROBE_RESULT_MK;
*/
// writer.close();
// reader.close();
// connection.close();
}
catch (Exception ex)
{
probe_error=true;
}
 
 
}
 
}