-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Egui editor #40
Egui editor #40
Conversation
…l as changing the id and position
Finally ci passes! The reason for not adding more components is if something seems wrong with the editor there's less to fix for all components. |
Bugs
A few suggestions:
|
Fixed
Added
Was already working, but fixed properties window bug and added so you can add/remove segments in there.
Not done, seems like a big feature, maybe for the future
|
impl Editor { | ||
pub fn gui(components: Components, _path: &Path) -> Self { | ||
let dummy_input = Input::new("id", "field"); | ||
let library: Components = vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be passed as an argument, allowing model crates (like riscv) to provide their own component libraries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using this now to create a better model view for the riscv, comments incoming...
Found a bug, the left side library view will not scroll when there are more elements than fit the screen. I've fixed it for now by just decreasing the render scale. |
This is now partly merged with #78 . Since the feature is still experimental (i.e. buggy), let's keep this issue around for tracking. |
(Moved from #19 accidentally used wrong remote)
Related #17
Todo (not all of these are in scope for this pr):
InputId
toInputPort
and theid
field toport_id
and all variables using itSave
,Save as
,Load
mem
testscommon.rs
common.rs
(to revert)Combinatorial
etc)Changes made:
ComponentStore
, this is required since we can only have ONE reference to adyn Component
to be able to edit it because ofRc
limitation (it is intended to work this way)::new
method since otherwise we don't conditionally create theEguiExtra
struct that egui needs for editor functionalityInputPort
wraps anInput
but also provides an id for a port,gui-egui
requires this to bind the ends of two wiresgui-egui
now also has arender_editor
function trait that requires thedyn Component
to be mutable and only runs during a specificEditorMode
in the editor.gui-egui
render function returnsOption<Vec<egui::Response>>
because of thewire
being multiple responses (the points)gui-egui
components now have tooltips (some are broken)Bugs:
ComponentStore
, there is auto-save.clicked_elsewhere
working on the individual part of the segmentsConstant
andProbe
to be able to show where the ports are locatedHow to use:
Ctrl+e
orFile
->Editor
Ctrl+s
(currently only saves tofile.json
)Escape
(orRight-click
w
to enter wire mode so you can connect multiple components with wires, it will automatically snap to open ports on the componentsI've been testing with
cargo run --no-default-features --features=gui-egui --example add -- --model mips