Class ClStripPos
- Namespace
- Hi.CutterLocations.ClStrips
- Assembly
- HiMech.dll
Represents a position in a cutter location strip, containing program coordinates and state information.
public class ClStripPos : CbtrPickable, IGetPickable, IDisposable, IGetProgramCl, IMotionStepIndex
- Inheritance
-
ClStripPos
- Implements
- Inherited Members
- Extension Methods
Remarks
On a canvas a position is selected by a click: the left button pressed and released on this position with the release within four panel pixels of the press on each axis. The selection happens at the release (it used to happen at the press, on any button): a camera drag that starts on the tool path or on a surface this step cut no longer selects the step, and a right or middle click does not select it. The judgement is the strip's, per engine; a click also raises PosClicked with the engine as sender.
Properties
Index
Gets the index of this position in the strip. This is also the step's execution-order ordinal — exposed via StepIndex.
public int Index { get; }
Property Value
MachiningStep
Gets or sets the milling step associated with this position. This is a convenience property that casts the State to MachiningStep.
public MachiningStep MachiningStep { get; set; }
Property Value
ProgramCl
Gets the program coordinates of this position. Never absent: a position constructed without a CL takes the previous position's, else NaN.
public dvec3d_t ProgramCl { get; }
Property Value
State
Gets or sets the state object associated with this position. When the state changes, the color is automatically refreshed.
public object State { get; set; }
Property Value
Methods
Display(Bind)
Draws the marker of the entered (hovered) position: an 8 px dot of the step's
colour at the cutter location, a 2 px segment from the position before it (its
colour fading into this one's), an arrowhead at the segment's end pointing into
this position, the @index label to the right of the location, the
cl:at pin, and a short grey stick along the tool axis, a line ending in a
dot. Sizes are canvas pixels at any zoom. The arrowhead and the label are drawn in
front of the whole scene; the step's dot, the segment and the stick take their
depth, so a workpiece or a tool can hide them.
public void Display(Bind bind)
Parameters
bindBindThe binding context to draw on.
Remarks
The arrowhead is a flat triangle facing the viewer, 14 px long and 12 px wide, its tip 6 px short of the location, white with a dark edge. There is none when the tool tip did not move into this position (the first position, a turn of the rotary axes alone under RTCP) or the move runs along the line of sight (a plunge seen from above): the one rule is the move's share in the screen plane, back in millimetres, reaching one millionth of a millimetre (Hi.CutterLocations.ClStrips.ClStripPos.MoveFloor_mm). A position the strip no longer lists draws nothing. Everything is drawn under this position's picking id.
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposingbool
GetLastTime(bool)
If time is not set, return the time from the last setted step.
public TimeSpan? GetLastTime(bool isLocked = false)
Parameters
isLockedbool
Returns
GetProgramCl()
public dvec3d_t? GetProgramCl()
Returns
- dvec3d_t?
CL; null when no CL is available (e.g. no workpiece or no tool is mounted).
Remarks
A strip position always holds a CL (an absent one is substituted at construction, see ProgramCl), so this never returns null; holders of a ClStripPos read ProgramCl directly.
OnKeyDown(key_event_t, DispEngine)
Behavior on key down.
public override void OnKeyDown(key_event_t e, DispEngine dispEngine)
Parameters
ekey_event_tevent
dispEngineDispEnginedisplay engine
OnKeyUp(key_event_t, DispEngine)
Behavior on key up
public override void OnKeyUp(key_event_t e, DispEngine dispEngine)
Parameters
ekey_event_tevent
dispEngineDispEnginedisplay engine
OnMouseDown(mouse_button_event_t, DispEngine)
Behavior on mouse down
public override void OnMouseDown(mouse_button_event_t e, DispEngine dispEngine)
Parameters
emouse_button_event_tevent
dispEngineDispEnginedisplay engine
Remarks
Selects nothing: the press is only recorded on the strip, for the engine it came from, and the release judges it (OnMouseUp(mouse_button_event_t, DispEngine)). The press point is the last move this engine delivered to this position; when there was none, the engine's cursor at the dispatch.
OnMouseEnter(ui_event_type, DispEngine)
Behavior on mouse enter
public override void OnMouseEnter(ui_event_type e, DispEngine dispEngine)
Parameters
eui_event_typeevent type
dispEngineDispEnginedisplay engine
OnMouseLeave(ui_event_type, DispEngine)
Behavior on mouse leave
public override void OnMouseLeave(ui_event_type e, DispEngine dispEngine)
Parameters
eui_event_typeevent type
dispEngineDispEnginedisplay engine
Remarks
Also drops a press this engine has waiting on this position: the pick pass sends the leave before a release can land anywhere else, so no stale press is ever paired with a later release.
OnMouseMove(mouse_move_event_t, DispEngine)
Behavior on mouse move
public override void OnMouseMove(mouse_move_event_t e, DispEngine dispEngine)
Parameters
emouse_move_event_tevent
dispEngineDispEnginedisplay engine
Remarks
The move's own coordinates are recorded on the strip for this engine; the last one before a left press on this position is that press's point.
OnMouseUp(mouse_button_event_t, DispEngine)
Behavior on mouse up
public override void OnMouseUp(mouse_button_event_t e, DispEngine dispEngine)
Parameters
emouse_button_event_tevent
dispEngineDispEnginedisplay engine
Remarks
A left release within four panel pixels of a left press on this same
position selects it (SetSelectedPos(ClStripPos, object), sender the
strip, which says nothing when it is already selected) and then raises
PosClicked with dispEngine as
sender, on every click. The release point is the engine's cursor at the
dispatch. A position the strip no longer lists - the strip was cleared
between the press and the release, and the pick pass, which reads the
previous frame's id buffer, still handed it the release - neither selects
nor reports a click: the check is on this very instance, not on an index
a new strip may have reused.
OnMouseWheel(mouse_wheel_event_t, DispEngine)
Behavior on mouse wheel
public override void OnMouseWheel(mouse_wheel_event_t e, DispEngine dispEngine)
Parameters
emouse_wheel_event_tevent
dispEngineDispEnginedisplay engine
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.