egui

package
v1.1.53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2022 License: BSD-3-Clause Imports: 10 Imported by: 31

README

Docs: GoDoc

egui handles all the GUI elements for a typical simulation, reducing boilerplate code in models.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KiT_ToolGhosting = kit.Enums.AddEnum(ToolGhostingN, kit.BitFlag, nil)

Functions

This section is empty.

Types

type GUI

type GUI struct {
	NetViewText         string `desc:"text to display at bottom of the NetView -- has relevant network state"`
	CycleUpdateInterval int    `desc:"how many cycles between updates of cycle-level plots"`
	Active              bool   `view:"-" desc:"true if the GUI is configured and running"`
	IsRunning           bool   `view:"-" desc:"true if sim is running"`
	StopNow             bool   `view:"-" desc:"flag to stop running"`

	Plots       map[elog.ScopeKey]*eplot.Plot2D `desc:"plots by scope"`
	RasterGrids map[string]*etview.TensorGrid   `desc:"spike raster grid views, by layer name"`

	NetView    *netview.NetView `view:"-" desc:"the network viewer"`
	ToolBar    *gi.ToolBar      `view:"-" desc:"the master toolbar"`
	StructView *giv.StructView  `view:"-" desc:"displays Sim fields on left"`
	TabView    *gi.TabView      `view:"-" desc:"tabs for different view elements: plots, rasters"`
	Win        *gi.Window       `view:"-" desc:"main GUI gui.Window"`
	ViewPort   *gi.Viewport2D   `view:"-" desc:"main viewport for Window"`
}

GUI manages all standard elements of a simulation Graphical User Interface

func (*GUI) AddPlots

func (gui *GUI) AddPlots(title string, lg *elog.Logs)

AddPlots adds plots based on the unique tables we have, currently assumes they should always be plotted

func (*GUI) AddToolbarItem

func (gui *GUI) AddToolbarItem(item ToolbarItem)

AddToolbarItem adds a toolbar item but also checks when it be active in the UI

func (*GUI) ConfigRasterGrid

func (gui *GUI) ConfigRasterGrid(tg *etview.TensorGrid, sr *etensor.Float32)

ConfigRasterGrid configures the raster grid

func (*GUI) FinalizeGUI

func (gui *GUI) FinalizeGUI(closePrompt bool)

FinalizeGUI wraps the end functionality of the GUI

func (*GUI) MakeWindow

func (gui *GUI) MakeWindow(sim interface{}, appname, title, about string)

MakeWindow specifies default window settings that are largely used in all windwos

func (*GUI) Plot

func (gui *GUI) Plot(mode elog.EvalModes, time elog.Times) *eplot.Plot2D

Plot returns plot for mode, time scope

func (*GUI) PlotScope

func (gui *GUI) PlotScope(scope elog.ScopeKey) *eplot.Plot2D

PlotScope returns plot for given scope

func (*GUI) RasterGrid

func (gui *GUI) RasterGrid(name string) *etview.TensorGrid

RasterGrid gets spike raster grid of given name, creating if not yet made

func (*GUI) Stopped

func (gui *GUI) Stopped()

Stopped is called when a run method stops running -- updates the IsRunning flag and toolbar

func (*GUI) UpdateCyclePlot

func (gui *GUI) UpdateCyclePlot(mode elog.EvalModes, cycle int) *eplot.Plot2D

UpdateCyclePlot updates cycle plot for given mode. only updates every CycleUpdateInterval

func (*GUI) UpdateNetView

func (gui *GUI) UpdateNetView()

UpdateNetView updates the gui visualization of the network set the NetViewText field prior to updating

func (*GUI) UpdatePlot

func (gui *GUI) UpdatePlot(mode elog.EvalModes, time elog.Times) *eplot.Plot2D

UpdatePlot updates plot for given mode, time scope

func (*GUI) UpdatePlotScope

func (gui *GUI) UpdatePlotScope(scope elog.ScopeKey) *eplot.Plot2D

UpdatePlotScope updates plot at given scope

func (*GUI) UpdateWindow

func (gui *GUI) UpdateWindow()

UpdateWindow renders the viewport associated with the main window

type ToolGhosting

type ToolGhosting int32

ToolGhosting the mode enum

const (
	ActiveStopped ToolGhosting = iota

	ActiveRunning

	ActiveAlways

	ToolGhostingN
)

The evaluation modes for when a tool bar can be clicked

func (ToolGhosting) MarshalJSON

func (ev ToolGhosting) MarshalJSON() ([]byte, error)

func (*ToolGhosting) UnmarshalJSON

func (ev *ToolGhosting) UnmarshalJSON(b []byte) error

type ToolbarItem

type ToolbarItem struct {
	Label   string
	Icon    string
	Tooltip string
	Active  ToolGhosting
	Func    func()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL