backup
This commit is contained in:
parent
8490f3967d
commit
5176af2409
@ -1021,244 +1021,6 @@ else:
|
|||||||
|
|
||||||
self.droid.fullSetProperty("in_options", "text", self.save.options)
|
self.droid.fullSetProperty("in_options", "text", self.save.options)
|
||||||
|
|
||||||
lay = '''<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" >
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent" >
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/launcher"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tx_Versions"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:text="Version"/>
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/sp_version"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_below="@+id/tx_Versions" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tx_language"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_below="@+id/sp_version"
|
|
||||||
android:text="DB language" />
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/sp_language"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/tx_language"/>
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tx_elm"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_below="@+id/sp_language"
|
|
||||||
android:text="ELM327" />
|
|
||||||
<RadioGroup
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_below="@id/tx_elm"
|
|
||||||
android:id="@+id/radioGroup">
|
|
||||||
<RadioButton
|
|
||||||
android:id="@id/rb_bt"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:checked="true"
|
|
||||||
android:text="BT" />
|
|
||||||
<RadioButton
|
|
||||||
android:id="@id/rb_wifi"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:checked="false"
|
|
||||||
android:text="WiFi" />
|
|
||||||
</RadioGroup>
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/in_wifi"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_below="@id/tx_elm"
|
|
||||||
android:layout_toRightOf="@id/radioGroup"
|
|
||||||
android:layout_marginLeft="20dp"
|
|
||||||
android:ems="10"
|
|
||||||
android:text="192.168.0.10:35000" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tx_log"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_below="@+id/radioGroup"
|
|
||||||
android:text="Log" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/cb_log"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/tx_log"
|
|
||||||
android:layout_marginLeft="20dp"
|
|
||||||
android:layout_marginRight="20dp"
|
|
||||||
android:layout_toRightOf="@+id/tx_log"/>
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/in_logname"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/tx_log"
|
|
||||||
android:layout_toRightOf="@+id/cb_log"
|
|
||||||
android:ems="10"
|
|
||||||
android:text="log.txt" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tx_csv"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_below="@+id/in_logname"
|
|
||||||
android:text="Data logging" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/cb_csv"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/tx_csv"
|
|
||||||
android:layout_marginRight="20dp"
|
|
||||||
android:layout_alignLeft="@+id/cb_log" />
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/sp_csv"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/tx_csv"
|
|
||||||
android:layout_toRightOf="@+id/cb_csv" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tx_can"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/sp_csv"
|
|
||||||
android:text="CAN parameters" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/cb_cfc"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/tx_can"
|
|
||||||
android:layout_toRightOf="@id/tx_can"
|
|
||||||
android:text="--cfc" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/cb_n1c"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignBottom="@id/cb_cfc"
|
|
||||||
android:layout_toRightOf="@id/cb_cfc"
|
|
||||||
android:layout_marginLeft="40dp"
|
|
||||||
android:text="--n1c" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tx_iso"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/cb_cfc"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:text="K-line parameters" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/cb_si"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/tx_iso"
|
|
||||||
android:layout_alignLeft="@id/cb_cfc"
|
|
||||||
android:text="--si (Prefer SlowInit)" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tx_options"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/cb_si"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:text="Other options" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/cb_dump"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/tx_options"
|
|
||||||
android:layout_toRightOf="@id/tx_options"
|
|
||||||
android:text="Dump" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/cb_can2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_toRightOf="@id/cb_dump"
|
|
||||||
android:layout_alignBottom="@id/cb_dump"
|
|
||||||
android:layout_marginLeft="60dp"
|
|
||||||
android:text="CAN2" />
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/in_options"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/cb_dump"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:ems="10"
|
|
||||||
android:inputType="textPersonName" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/bt_start"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_below="@id/in_options"
|
|
||||||
android:text="Start" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/bt_scan"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_toRightOf="@id/bt_start"
|
|
||||||
android:layout_below="@id/in_options"
|
|
||||||
android:text="Scan" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/bt_demo"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/in_options"
|
|
||||||
android:layout_toRightOf="@id/bt_scan"
|
|
||||||
android:text="Demo" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/bt_check"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/bt_start"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:text="ChkELM" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/bt_mon"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/bt_start"
|
|
||||||
android:layout_toLeftOf="@id/bt_check"
|
|
||||||
android:text="Monitor" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/bt_term"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/bt_start"
|
|
||||||
android:layout_toLeftOf="@+id/bt_mon"
|
|
||||||
android:text="Macro" />
|
|
||||||
<Button
|
|
||||||
android:id="@+id/bt_update"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_below="@id/in_options"
|
|
||||||
android:text="Update" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
</RelativeLayout>'''
|
|
||||||
|
|
||||||
def eventloop(self):
|
def eventloop(self):
|
||||||
while True:
|
while True:
|
||||||
event = self.droid.eventWait(50).result
|
event = self.droid.eventWait(50).result
|
||||||
@ -1280,23 +1042,6 @@ else:
|
|||||||
elif id == "bt_update":
|
elif id == "bt_update":
|
||||||
self.cmd_Update()
|
self.cmd_Update()
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.save = settings()
|
|
||||||
try:
|
|
||||||
self.droid = android.Android()
|
|
||||||
self.droid.fullShow(self.lay)
|
|
||||||
self.loadSettings()
|
|
||||||
self.eventloop()
|
|
||||||
finally:
|
|
||||||
self.droid.fullDismiss()
|
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self.droid.fullDismiss()
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
gui = androidGUI()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
@ -113,8 +113,8 @@ def find_DBs():
|
|||||||
def saveDBver(verfilename):
|
def saveDBver(verfilename):
|
||||||
# create new version file
|
# create new version file
|
||||||
verfile = open(verfilename, "wb")
|
verfile = open(verfilename, "wb")
|
||||||
verfile.write(':'.join([mod_globals.cliproot, mod_globals.ddtroot]) + '\n')
|
verfile.write((':'.join([mod_globals.cliproot, mod_globals.ddtroot]) + '\n').encode("utf-8"))
|
||||||
verfile.write("Do not remove me if you have v0.9.q or above.\n")
|
verfile.write(("Do not remove me if you have v0.9.q or above.\n").encode("utf-8"))
|
||||||
verfile.close()
|
verfile.close()
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,6 @@ def optParser():
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
#usage = "%prog -p <port> [options]",
|
#usage = "%prog -p <port> [options]",
|
||||||
version="pyRen Version 0.9.q",
|
|
||||||
description = "pyRen - python program for diagnostic Renault cars"
|
description = "pyRen - python program for diagnostic Renault cars"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user