Make constraints editable

This commit is contained in:
Aaron Fenyes 2024-10-29 22:32:00 -07:00
parent e5f4d523f9
commit e0880d2ad2
5 changed files with 49 additions and 13 deletions

View file

@ -22,7 +22,9 @@ pub struct Element {
#[derive(Clone)]
pub struct Constraint {
pub args: (usize, usize),
pub rep: f64,
pub rep: Signal<f64>,
pub rep_text: Signal<String>,
pub rep_valid: Signal<bool>,
pub active: Signal<bool>
}
@ -116,11 +118,11 @@ impl Assembly {
let mut gram_to_be = PartialMatrix::new();
self.constraints.with_untracked(|csts| {
for (_, cst) in csts {
if cst.active.get_untracked() {
if cst.active.get_untracked() && cst.rep_valid.get_untracked() {
let args = cst.args;
let row = elts[args.0].index;
let col = elts[args.1].index;
gram_to_be.push_sym(row, col, cst.rep);
gram_to_be.push_sym(row, col, cst.rep.get_untracked());
}
}
});