Neovim plugin that brings some of the functionality of the Analyzer4D software to Neovim.
At the moment this is just a convenience project for myself to improve the developer experience in the Analyzer4D software.
Important
I am new to neovim plugin development so I might make some changes to the underlying structure which can break things. Sorry in advance for that!
return ({
"ossmos/analyzer4d.nvim",
config = function()
require("analyzer4d").setup({
host = "127.0.0.1"
})
end
})
require("analyzer4d").setup({
-- the ip address of the Optimizer4D running the Analyzer4D software
-- If this value is set to nil, the ANALYZER_HOST env variable is used instead
host = nil,
-- the port of the json communication server
port = 17000,
-- tries to auto connect to the Analyzer4D if there is no connection yet
-- and a command is executed
auto_connect = true,
-- automatically connect to the log of the Analyzer4D
subscribe_log = false,
-- clear the buffer containing the Analyzer4D logs on exection of analyzer4d.reload_qml()
clear_log_on_qml_reload = false,
-- Automatically set the position of the cursor to the bottom of the log buffer when new entries come in if the cursor is not in the log window
auto_scroll_log = true,
-- Automatically attempt to reconnect after the connection has been lost
reconnect = true,
})
The plugin adds a couple of user commands. All of the commands have an "Analyzer"-prefix.
Toggles the buffer containing the log messages of the Analyzer4D software.
This command reloads the PenGUI (QML-GUI) of the Analyzer4D software.
This will immediately display the GUI even if it was prior set to hidden
.
This commands sets an application variable (AppVar) in the Analyzer4D software.
You can view those variables under Tools
→ Global Application Variable Monitor
in the software.
Note
All appvars in the software are strings!
Starts a measurement in the Analyzer4D software.
Stops a running measurement in the Analyzer4D software.
Subscribe to the log of the Analyzer4D software.
Creates the connection to the Analyzer4D json communication server.
This only has to be called if the always_connect
option is set to false
,
or if the Analyzer4D software has been restarted.
At the moment there is no automatic reconnect.
The command first checks for the host
option and then the ANALYZER_HOST
environment
variable of host
is not specified. If both are not present, the user is prompted for an ip address.
Restarts the Analyzer software after 1 second of idle time.
Stuff that is already implemented and things that are on my todo list for the near future. If you have any suggestions feel free to let me know!
- Reload the PenGUI (QML) UI
- Set AppVars
- Start Measurement
- Stop Measurement
- Display Analyzer4D log file
- Automatic reconnect after Analyzer4D restart
- Get AppVars
- User Callbacks
This plugin is just another wrapper around the JSON communication server of the Analyzer4D software. The credit for that goes to Qass GmbH and their python qass-tools-networking project.