diff --git a/.gitignore b/.gitignore
index deb2f7f..b7074c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,4 +8,5 @@ src/functions/__pycache__/
.vscode/
/build/
/dist/
-/logs/*.log
\ No newline at end of file
+/logs/*.log
+.env
\ No newline at end of file
diff --git a/NewBuild.txt b/NewBuild.txt
deleted file mode 100644
index 6e428d3..0000000
--- a/NewBuild.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-cxfreeze .\joystick-diagram.py --target-dir dist --include-files='C:\Users\RCox\Documents\GitHub\joystick-diagrams\logo.ico','C:\Users\RCox\Documents\GitHub\joystick-diagrams\images/','C:\Users\RCox\Documents\GitHub\joystick-diagrams\templates/' --icon='C:\Users\RCox\Documents\GitHub\joystick-diagrams\logo.ico' --base='Win32GUI'
-
-
diff --git a/config.cfg b/config.cfg
index 9bbc733..a3e318b 100644
--- a/config.cfg
+++ b/config.cfg
@@ -1,7 +1,7 @@
[DEFAULT]
EnableLogging = 1
# 1 = Minimum, 3 = Full Debug
-LogLevel = 2
+LogLevel = 1
[BROWSER]
OpenTemplatesInBrowser = 0
diff --git a/readme.md b/readme.md
index 690635b..33c1093 100644
--- a/readme.md
+++ b/readme.md
@@ -11,13 +11,12 @@ Learning flight simulators is a daunting task, with lots of buttons to remember.
### Joystick Gremlin
- Custom SVG templates can be built to suit your joystick, throttle, custom HID device
-- Importing/inheriance of base templates into button profile exports (In progress)
+- Importing/inheriance of base templates into button profile exports
- Support for multiple profiles in Joystick Gremlin
## What's not supported (yet)
-
-### Joystick Gremlin
-- POV hats (In POV mode) - If your POV is configured for button outputs, then it will work
+- POV hats (In POV mode)
+- AXIS support
### Support for other programs/games (yet)
I'm currently working on DCS World - if you have a game you think will benefit from this, let me know and I might add it.
@@ -47,8 +46,12 @@ I'm expecting issues with the Virpil templates, as don't have the logical button
[Please read](templates/readme.md)
# Support / Beer fund
-I plan to expand this out and continue on this journey. I'd appreciate any donations for time saved and to help me continue to support this program.
+## Discord
+If you have any issues/questions, pop along to discord - https://discord.gg/JC5QFMB
+
+## Beer
+I plan to expand this out and continue on this journey. I'd appreciate any donations for time saved and to help me continue to support this program.
[Donate via Paypal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WLLDYGQM5Z39W&source=url)
diff --git a/samples/DCS_mode_new_cm2_2.xml b/samples/DCS_mode_new_cm2_2.xml
deleted file mode 100644
index 307f852..0000000
--- a/samples/DCS_mode_new_cm2_2.xml
+++ /dev/null
@@ -1,3002 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0.05
-
-
-
diff --git a/src/functions/helper.py b/src/functions/helper.py
index 4d1c8b4..de92ba8 100644
--- a/src/functions/helper.py
+++ b/src/functions/helper.py
@@ -11,21 +11,6 @@
logDir = './logs/'
logFile = 'jv.log'
logger = logging.getLogger('jv')
-if not os.path.exists(logDir):
- createDirectory(logDir)
-hdlr = logging.FileHandler(logDir + logFile)
-formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
-hdlr.setFormatter(formatter)
-logger.addHandler(hdlr)
-if config.debugLevel == 1:
- logger.setLevel(logging.WARNING)
-elif config.debugLevel == 2:
- logger.setLevel(logging.ERROR)
-elif config.debugLevel == 3:
- logger.setLevel(logging.DEBUG)
-else:
- logger.setLevel(logging.WARNING)
-
webbrowser.register('chrome', None,webbrowser.BackgroundBrowser(config.chrome_path))
tempFilesDirectory = './temp/'
diagramFilesDirectory = './diagrams/'
@@ -52,7 +37,6 @@ def updateDeviceArray(deviceArray, device, mode, inherit, buttons):
}
})
-
def createDirectory(directory):
if not os.path.exists(directory):
return os.makedirs(directory)
@@ -125,25 +109,17 @@ def log(text, level='info'):
def getVersion():
return "Version: " + version.VERSION
-#TODO
-# # https://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth
-
-# def nested_update(d, u):
-# for k, v in u.items():
-# if isinstance(v, collections.abc.Mapping):
-# d[k] = nested_update(d.get(k, {}), v)
-# else:
-# d[k] = v
-# return d
-
-# def updateDeviceArray(deviceArray, device, mode, buttons):
-# data = {
-# device: {
-# mode: {
-# "Buttons": buttons,
-# "Axis": ""
-# }
-# }
-# }
-
-# nested_update(deviceArray, data)
\ No newline at end of file
+if not os.path.exists(logDir):
+ createDirectory(logDir)
+hdlr = logging.FileHandler(logDir + logFile)
+formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
+hdlr.setFormatter(formatter)
+logger.addHandler(hdlr)
+if config.debugLevel == 1:
+ logger.setLevel(logging.WARNING)
+elif config.debugLevel == 2:
+ logger.setLevel(logging.ERROR)
+elif config.debugLevel == 3:
+ logger.setLevel(logging.DEBUG)
+else:
+ logger.setLevel(logging.WARNING)
\ No newline at end of file
diff --git a/src/joystick-diagram.py b/src/joystick-diagram.py
index 192c3ac..e85c78e 100644
--- a/src/joystick-diagram.py
+++ b/src/joystick-diagram.py
@@ -15,6 +15,7 @@
root = tk.Tk()
text = tk.Text(root)
root.wm_minsize(600,400)
+root.wm_maxsize(600,400)
root.title("Joystick Visualiser - github.com/Rexeh/joystick-diagrams")
root.iconbitmap('./images/logo.ico')
root.config(bg="white")
@@ -42,7 +43,7 @@
# Functions
def exportGremlin():
- parsedConfig = gremlin.Gremlin(selectedFile.cget('text'))
+ parsedConfig = gremlin.Gremlin(selectedFile)
devices = parsedConfig.createDictionary()
@@ -97,14 +98,15 @@ def chooseFile():
filetypes=[("Gremlin Config Files" , '*.xml')]
)
global selectedFile
- selectedFile = tk.Label(jg_tab, text=file,font=buttonFont)
- selectedFile.grid(row=2, column=0)
+ selectedFile = file
+ step_2_secondary.config(text=file)
+ #selectedFile.grid(row=3, column=0)
step_2_button.config(state="active")
-
def openDiagramsDirectory():
- path = os.path.dirname(__file__) + '/diagrams'
- helper.log(path)
+ helper.log(os.getcwd(), 'error')
+ path = os.path.join(os.getcwd(), 'diagrams' )
+ helper.log(path, 'error')
FILEBROWSER_PATH = os.path.join(os.getenv('WINDIR'), 'explorer.exe')
subprocess.run([FILEBROWSER_PATH, path])
@@ -138,7 +140,7 @@ def openDiagramsDirectory():
gremlinLogo = tk.Button(topFrame, text="Support us on GitHub", image=photo, bg="white",anchor="e",padx=(15), font=buttonFont,command=openLink,compound = "left", width=160)
bugLogo = tk.Button(topFrame, text="Got a Bug? Feature?", image=bug,bg="white",anchor="e", padx=(15), font=buttonFont, command=openBugs,compound = "left", width=160)
-step_1_info = tk.Label(jg_tab, text="Step 1: Select your Gremlin .XML File",anchor="w",font=largeFont, compound = "left", state="disabled",bg="white", pady=20)
+step_1_info = tk.Label(jg_tab, text="Step 1: Select your Gremlin .XML File",anchor="e",font=largeFont, compound = "left", state="disabled",bg="white", pady=20)
chooseFile = tk.Button(jg_tab, text="Choose Gremlin File",font=buttonFont, command=chooseFile,bg="white")
## LISTBOX TEST
@@ -166,7 +168,6 @@ def openDiagramsDirectory():
bg="white"
)
-### END
step_2_info = tk.Label(
jg_tab,
text="Step 2: Run Export",
@@ -182,7 +183,7 @@ def openDiagramsDirectory():
jg_tab,
text="Export profiles",
bg="white",
- anchor="w",
+ anchor="e",
padx=(15),
font=buttonFont,
command=exportGremlin,
@@ -208,11 +209,19 @@ def openDiagramsDirectory():
pady=20
)
+step_3_secondary = tk.Label(
+ jg_tab,
+ text="View your exported diagrams in the Diagrams folder",
+ font=buttonFont,
+ compound = "left",
+ bg="white",
+ )
+
step_3_button = tk.Button(
jg_tab,
text="Open diagrams folder",
bg="white",
- anchor="w",
+ anchor="e",
padx=(15),
font=buttonFont,
command=openDiagramsDirectory,
@@ -223,7 +232,6 @@ def openDiagramsDirectory():
selected_item_button.pack()
selected_item_label.pack()
-
gremlinLogo.grid(row=0, column=3)
bugLogo.grid(row=0, column=2)
@@ -235,7 +243,8 @@ def openDiagramsDirectory():
step_2_secondary.grid(row=3, column=0)
step_3_info.grid(row=4, column=0, sticky="W")
-step_3_button.grid(row=4, column=1)
+step_3_button.grid(row=4, column=1, sticky="W")
+step_3_secondary.grid(row=5, column=0, sticky="W")
version.grid(row=5,column=3, sticky="E")
info.grid(row=5,column=1)