pub struct SimSession {Show 15 fields
pub setup: String,
pub player: Player,
pub driver: SimDriver,
pub ranges: Vec<RangeTool>,
pub to_model: RigidTransform,
pub marks: Vec<Marker>,
pub collision_motions: BTreeSet<usize>,
pub collisions: Vec<(usize, String, String)>,
pub range_cutters: Vec<RangeCutter>,
pub remote: Option<RemoteSim>,
pub multi_axis: bool,
pub part: Option<MeshSnapshot>,
pub deviation: Option<DeviationMap>,
pub legend: Option<Value>,
pub remaining: Option<RemainingStockMesh>,
/* private fields */
}Expand description
A loaded simulation.
Fields§
§setup: String§player: Player§driver: SimDriver§ranges: Vec<RangeTool>§to_model: RigidTransform§marks: Vec<Marker>Collision and gouge markers found by C7’s checked simulation (3-axis streams) at load, with the motions they belong to.
collision_motions: BTreeSet<usize>§collisions: Vec<(usize, String, String)>Every collision found: (motion index in the program, part or body, against).
range_cutters: Vec<RangeCutter>The ranges with their cutters, as the stepping function takes them.
remote: Option<RemoteSim>Some when the background runner holds the stock (C17b); None
simulates inline on the UI thread in bounded chunks.
multi_axis: bool§part: Option<MeshSnapshot>The part in machine coordinates (deviation).
deviation: Option<DeviationMap>§legend: Option<Value>§remaining: Option<RemainingStockMesh>The stock coloured by remaining material (C7’s remaining_stock_mesh),
for the stock version and tolerance in remaining_key.
Implementations§
Source§impl SimSession
impl SimSession
Sourcepub fn mesh(&mut self) -> &StockMesh
pub fn mesh(&mut self) -> &StockMesh
The stock mesh for the driver’s current version (rebuilt on change).
Sourcepub fn range_of(&self, motion: usize) -> Option<&RangeTool>
pub fn range_of(&self, motion: usize) -> Option<&RangeTool>
The range (and its tool) a motion belongs to.
Sourcepub fn caught_up(&self) -> bool
pub fn caught_up(&self) -> bool
Whether the stock shows the player’s completed count with nothing in flight.
Sourcepub fn drive(
&mut self,
state: &mut EngineState,
budget: usize,
chunk: usize,
) -> Result<bool, String>
pub fn drive( &mut self, state: &mut EngineState, budget: usize, chunk: usize, ) -> Result<bool, String>
Bring the stock toward the player’s completed count: inline, at most
budget motions now; on the runner, fold landed replies and submit
the next chunk of at most chunk motions. true while not caught up.
Sourcepub fn cancel(&mut self, state: &mut EngineState) -> bool
pub fn cancel(&mut self, state: &mut EngineState) -> bool
Stop simulating: the chunk in flight is cancelled (between two motions on the native thread) and its reply dropped; the stock stays the last accepted one and the transport pauses there.
Sourcepub fn compare(
&mut self,
options: &DeviationOptions,
scale: f64,
) -> Result<(), String>
pub fn compare( &mut self, options: &DeviationOptions, scale: f64, ) -> Result<(), String>
Compare the stock with the part: the deviation map and its legend.
Sourcepub fn tolerance_here(&self) -> f64
pub fn tolerance_here(&self) -> f64
The tolerance of the operation at the playback position.
Sourcepub fn refresh_remaining(&mut self) -> Result<bool, String>
pub fn refresh_remaining(&mut self) -> Result<bool, String>
Colour the stock as it stands by remaining material against the part
(C7’s remaining_stock_mesh, band edges from the operation tolerance at
the playback position). Recomputed only when the stock version or the
tolerance changed; true when it was.
Sourcepub fn state_json(&self) -> Value
pub fn state_json(&self) -> Value
JSON for cam_sim_state.
Auto Trait Implementations§
impl Forget for SimSession
impl Freeze for SimSessionwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Motion>: Freeze,
PhantomData<OperationRange>: Freeze,
PhantomData<f64>: Freeze,
PhantomData<Column>: Freeze,
PhantomData<Loop>: Freeze,
PhantomData<(usize, StockModel)>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<(usize, Diagnostic)>: Freeze,
PhantomData<Joint>: Freeze,
PhantomData<RangeTool>: Freeze,
PhantomData<Marker>: Freeze,
*const LeafNode<usize, SetValZST> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(usize, SetValZST)>>: Freeze,
PhantomData<(usize, String, String)>: Freeze,
PhantomData<RangeCutter>: Freeze,
PhantomData<LinkSolid>: Freeze,
*const LeafNode<u64, SetValZST> is !null: Freeze,
PhantomData<Box<(u64, SetValZST)>>: Freeze,
PhantomData<FaceSource>: Freeze,
PhantomData<Triangle>: Freeze,
PhantomData<Option<f64>>: Freeze,
PhantomData<Option<u32>>: Freeze,
PhantomData<FaceDeviation>: Freeze,
PhantomData<Option<ColumnPlacement>>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<Point3>: Freeze,
PhantomData<u32>: Freeze,
PhantomData<Node>: Freeze,
PhantomData<Bounds3>: Freeze,
PhantomData<bool>: Freeze,
impl Move for SimSession
impl RefUnwindSafe for SimSession
impl Send for SimSession
impl Sync for SimSession
impl Unpin for SimSession
impl UnsafeUnpin for SimSessionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Motion>: UnsafeUnpin,
PhantomData<OperationRange>: UnsafeUnpin,
PhantomData<f64>: UnsafeUnpin,
PhantomData<Column>: UnsafeUnpin,
PhantomData<Loop>: UnsafeUnpin,
PhantomData<(usize, StockModel)>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<(usize, Diagnostic)>: UnsafeUnpin,
PhantomData<Joint>: UnsafeUnpin,
PhantomData<RangeTool>: UnsafeUnpin,
PhantomData<Marker>: UnsafeUnpin,
*const LeafNode<usize, SetValZST> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(usize, SetValZST)>>: UnsafeUnpin,
PhantomData<(usize, String, String)>: UnsafeUnpin,
PhantomData<RangeCutter>: UnsafeUnpin,
PhantomData<LinkSolid>: UnsafeUnpin,
*const LeafNode<u64, SetValZST> is !null: UnsafeUnpin,
PhantomData<Box<(u64, SetValZST)>>: UnsafeUnpin,
PhantomData<FaceSource>: UnsafeUnpin,
PhantomData<Triangle>: UnsafeUnpin,
PhantomData<Option<f64>>: UnsafeUnpin,
PhantomData<Option<u32>>: UnsafeUnpin,
PhantomData<FaceDeviation>: UnsafeUnpin,
PhantomData<Option<ColumnPlacement>>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<Point3>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
PhantomData<Node>: UnsafeUnpin,
PhantomData<Bounds3>: UnsafeUnpin,
PhantomData<bool>: UnsafeUnpin,
impl UnwindSafe for SimSessionwhere
RawVecInner: UnwindSafe,
BTreeMap<usize, SetValZST>: UnwindSafe,
BTreeMap<u64, SetValZST>: UnwindSafe,
NonNull<u8>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.