Revert "Spruce up formatting and error messages"
This reverts commit adc60ac5c1
. We decided
that it would be better for me to request formatting changes one by one.
This commit is contained in:
parent
5ee24aa91d
commit
1f604eb29a
1 changed files with 14 additions and 28 deletions
|
@ -315,11 +315,10 @@ impl Element for Point {
|
||||||
|
|
||||||
fn default_regulators(self: Rc<Self>) -> Vec<Rc<dyn Regulator>> {
|
fn default_regulators(self: Rc<Self>) -> Vec<Rc<dyn Regulator>> {
|
||||||
all::<Axis>()
|
all::<Axis>()
|
||||||
.map(
|
.map(|axis| {
|
||||||
|axis| Rc::new(
|
Rc::new(PointCoordinateRegulator::new(self.clone(), axis))
|
||||||
PointCoordinateRegulator::new(self.clone(), axis)
|
as Rc::<dyn Regulator>
|
||||||
) as Rc::<dyn Regulator>
|
})
|
||||||
)
|
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,32 +543,19 @@ impl PointCoordinateRegulator {
|
||||||
let measurement = subject.representation().map(
|
let measurement = subject.representation().map(
|
||||||
move |rep| rep[axis as usize]
|
move |rep| rep[axis as usize]
|
||||||
);
|
);
|
||||||
|
|
||||||
let set_point = create_signal(SpecifiedValue::from_empty_spec());
|
let set_point = create_signal(SpecifiedValue::from_empty_spec());
|
||||||
let serial = Self::next_serial();
|
Self { subject, axis, measurement, set_point, serial: Self::next_serial() }
|
||||||
|
|
||||||
Self { subject, axis, measurement, set_point, serial }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Serial for PointCoordinateRegulator {
|
impl Serial for PointCoordinateRegulator {
|
||||||
fn serial(&self) -> u64 {
|
fn serial(&self) -> u64 { self.serial }
|
||||||
self.serial
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Regulator for PointCoordinateRegulator {
|
impl Regulator for PointCoordinateRegulator {
|
||||||
fn subjects(&self) -> Vec<Rc<dyn Element>> {
|
fn subjects(&self) -> Vec<Rc<dyn Element>> { vec![self.subject.clone()] }
|
||||||
vec![self.subject.clone()]
|
fn measurement(&self) -> ReadSignal<f64> { self.measurement }
|
||||||
}
|
fn set_point(&self) -> Signal<SpecifiedValue> { self.set_point }
|
||||||
|
|
||||||
fn measurement(&self) -> ReadSignal<f64> {
|
|
||||||
self.measurement
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_point(&self) -> Signal<SpecifiedValue> {
|
|
||||||
self.set_point
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ProblemPoser for PointCoordinateRegulator {
|
impl ProblemPoser for PointCoordinateRegulator {
|
||||||
|
@ -590,10 +576,10 @@ impl ProblemPoser for PointCoordinateRegulator {
|
||||||
coords[index.0] = value
|
coords[index.0] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if n_set == Axis::CARDINALITY {
|
if nset == Axis::CARDINALITY {
|
||||||
let [x, y, z] = coords_frozen;
|
let [x, y, z] = coords;
|
||||||
let norm = point(x, y, z)[Point::NORM_COMPONENT];
|
problem.frozen.push(
|
||||||
problem.frozen.push(Point::NORM_COMPONENT, col, norm);
|
Point::NORM_COMPONENT, col, point(x,y,z)[Point::NORM_COMPONENT]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue