Skip to content

Collection of functions to work with the Analyzer4D Software

License

Notifications You must be signed in to change notification settings

ossmos/analyzer4d.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

analyzer4d.nvim

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!

Installation

return ({
    "ossmos/analyzer4d.nvim",
    config = function()
        require("analyzer4d").setup({
            host = "127.0.0.1"
        })
    end
})

Extended config

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,
})

User-Commands

The plugin adds a couple of user commands. All of the commands have an "Analyzer"-prefix.

AnalyzerToggleLog

Toggles the buffer containing the log messages of the Analyzer4D software.

AnalyzerQmlReload

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.

AnalyzerSetAppVar

This commands sets an application variable (AppVar) in the Analyzer4D software. You can view those variables under ToolsGlobal Application Variable Monitor in the software.

Note

All appvars in the software are strings!

StartMeasuring

Starts a measurement in the Analyzer4D software.

StopMeasuring

Stops a running measurement in the Analyzer4D software.

AnalyzerSubscribeLog

Subscribe to the log of the Analyzer4D software.

AnalyzerConnect

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.

AnalyzerRestart

Restarts the Analyzer software after 1 second of idle time.

Features

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

Acknowledgements

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.

About

Collection of functions to work with the Analyzer4D Software

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages