forked from StudioInfinity/dyna3
Compare commits
No commits in common. "08ec838334a5fc1bfe7961ba7047c3b60c8e70fb" and "6eeeb1c6fddc2c4122ec2eaf9146a0c839bf7def" have entirely different histories.
08ec838334
...
6eeeb1c6fd
3 changed files with 10 additions and 3 deletions
|
@ -4,7 +4,10 @@ use web_sys::{console, wasm_bindgen::JsValue};
|
||||||
use crate::{
|
use crate::{
|
||||||
engine,
|
engine,
|
||||||
AppState,
|
AppState,
|
||||||
assembly::{Assembly, Element}
|
assembly::{
|
||||||
|
Assembly,
|
||||||
|
Element
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* DEBUG */
|
/* DEBUG */
|
||||||
|
|
|
@ -9,7 +9,11 @@ use web_sys::{
|
||||||
use crate::{
|
use crate::{
|
||||||
AppState,
|
AppState,
|
||||||
assembly,
|
assembly,
|
||||||
assembly::{ElementKey, Regulator, RegulatorKey},
|
assembly::{
|
||||||
|
ElementKey,
|
||||||
|
Regulator,
|
||||||
|
RegulatorKey
|
||||||
|
},
|
||||||
specified::SpecifiedValue
|
specified::SpecifiedValue
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ impl TryFrom<String> for SpecifiedValue {
|
||||||
|
|
||||||
fn try_from(spec: String) -> Result<Self, Self::Error> {
|
fn try_from(spec: String) -> Result<Self, Self::Error> {
|
||||||
if spec.is_empty() {
|
if spec.is_empty() {
|
||||||
Ok(SpecifiedValue::from_empty_spec())
|
Ok(SpecifiedValue { spec: spec, value: None })
|
||||||
} else {
|
} else {
|
||||||
spec.parse::<f64>().map(
|
spec.parse::<f64>().map(
|
||||||
|value| SpecifiedValue { spec: spec, value: Some(value) }
|
|value| SpecifiedValue { spec: spec, value: Some(value) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue