TS plugin

This commit is contained in:
rusefi 2020-06-16 23:52:07 -04:00
parent 948b086c96
commit 52dc0000f6
9 changed files with 27 additions and 15 deletions

View File

@ -1,7 +1,8 @@
<project default="jar">
<property name="jar_file_folder" value="build/jar"/>
<property name="jar_file" value="${jar_file_folder}/rusefi_plugin_launcher.jar"/>
<property name="jar_file" value="${jar_file_folder}/rusefi_plugin_body.jar"/>
<property name="console_path" value="../../java_console"/>
<property name="launcher_path" value="../ts_plugin_launcher"/>
<target name="clean">
<delete dir="build"/>
@ -12,12 +13,14 @@
<javac debug="yes"
destdir="build/classes"
classpath="${console_path}/lib/junit.jar:${console_path}/lib/annotations.jar:lib/TunerStudioPluginAPI.jar:${console_path}/lib/httpclient.jar:${console_path}/lib/httpmime.jar:${console_path}/lib/httpcore.jar"
classpath="${console_path}/lib/junit.jar:${console_path}/lib/annotations.jar:${launcher_path}/lib/TunerStudioPluginAPI.jar:${console_path}/lib/httpclient.jar:${console_path}/lib/httpmime.jar:${console_path}/lib/httpcore.jar"
>
<src path="${console_path}/shared_ui/src"/>
<src path="${console_path}/autoupdate/src"/>
<src path="${console_path}/inifile/src"/>
<src path="${console_path}/logging/src"/>
<src path="${console_path}/models/src"/>
<src path="${launcher_path}/src"/>
<src path="src"/>
</javac>
@ -35,18 +38,17 @@
<manifest>
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Signature-Vendor" value="rusEFI LLC"/>
<attribute name="ApplicationPlugin" value="com.rusefi.TsPlugin"/>
</manifest>
<zipfileset src="../../java_console/lib/httpclient.jar" includes="**/*.class"/>
<zipfileset src="../../java_console/lib/httpcore.jar" includes="**/*.class"/>
<zipfileset src="../../java_console/lib/httpmime.jar" includes="**/*.class"/>
<zipfileset src="lib/commons-logging.jar" includes="**/*.class"/>
<!-- <zipfileset src="lib/commons-logging.jar" includes="**/*.class"/>-->
</jar>
</target>
<target name="local_install" depends="jar">
<target name="body_local_install" depends="jar">
<copy file="${jar_file}" todir="${user.home}/.efianalytics/TunerStudio/plugins"/>
</target>
</project>

View File

@ -1,9 +1,10 @@
package com.rusefi;
package com.rusefi.ts_plugin;
import com.efiAnalytics.plugin.ecu.ControllerAccess;
import com.efiAnalytics.plugin.ecu.ControllerException;
import com.efiAnalytics.plugin.ecu.ControllerParameter;
import com.efiAnalytics.plugin.ecu.servers.ControllerParameterServer;
import com.rusefi.TsTuneReader;
import com.rusefi.tools.online.Online;
import com.rusefi.tune.xml.Constant;
import com.rusefi.tune.xml.Msq;
@ -17,13 +18,13 @@ import java.io.IOException;
import java.util.Map;
import java.util.TreeMap;
public class Content {
public class PluginEntry implements TsPluginBody {
private final AuthTokenPanel tokenPanel = new AuthTokenPanel();
private final JComponent content = new JPanel();
private ControllerAccess controllerAccess;
public Content() {
public PluginEntry() {
content.add(tokenPanel.getContent());
JButton upload = new JButton("Upload Tune");

View File

@ -10,5 +10,6 @@
<orderEntry type="module" module-name="inifile" />
<orderEntry type="module" module-name="shared_ui" />
<orderEntry type="library" name="TunerStudioPluginAPI" level="project" />
<orderEntry type="module" module-name="ts_plugin_launcher" />
</component>
</module>

View File

@ -2,5 +2,6 @@
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/build.xml" />
<buildFile url="file://$PROJECT_DIR$/../ts_plugin/build.xml" />
</component>
</project>

View File

@ -31,7 +31,7 @@
<manifest>
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Signature-Vendor" value="rusEFI LLC"/>
<attribute name="ApplicationPlugin" value="com.rusefi.TsPlugin"/>
<attribute name="ApplicationPlugin" value="com.rusefi.ts_plugin.TsPluginLauncher"/>
</manifest>
<zipfileset src="../../java_console/lib/httpclient.jar" includes="**/*.class"/>
@ -42,7 +42,7 @@
</target>
<target name="local_install" depends="jar">
<target name="launcher_local_install" depends="jar">
<copy file="${jar_file}" todir="${user.home}/.efianalytics/TunerStudio/plugins"/>
</target>
</project>

View File

@ -1,4 +1,6 @@
package com.rusefi;
package com.rusefi.ts_plugin;
import com.rusefi.ts_plugin.TsPluginLauncher;
import javax.swing.*;
@ -8,7 +10,7 @@ public class Sandbox {
frame.setSize(800, 500);
frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
frame.add(new TsPlugin().getPluginPanel());
frame.add(new TsPluginLauncher().getPluginPanel());
frame.setVisible(true);
}

View File

@ -0,0 +1,5 @@
package com.rusefi.ts_plugin;
public interface TsPluginBody {
void close();
}

View File

@ -1,4 +1,4 @@
package com.rusefi;
package com.rusefi.ts_plugin;
import com.efiAnalytics.plugin.ApplicationPlugin;
import com.efiAnalytics.plugin.ecu.ControllerAccess;
@ -9,11 +9,11 @@ import javax.swing.*;
/**
* by the way TS installs stuff into %user%\.efianalytics\TunerStudio\plugins folder
*/
public class TsPlugin implements ApplicationPlugin {
public class TsPluginLauncher implements ApplicationPlugin {
private static final String VERSION = "alpha2020";
private final JPanel content = new JPanel(new VerticalFlowLayout());
public TsPlugin() {
public TsPluginLauncher() {
content.add(new JLabel("" + VERSION));
}