blob: c1862e3a71916f91fd376ac442c68ef019c62bb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
/*
* StraightProbeSettings.h
*
* Created on: 4 Oct 2019
* Author: manuel
*
* This class holds information for G38 Straight Probe that otherwise would no longer be available
* since the GCodeBuffer can be overwritten when probe is deployed.
*/
#ifndef SRC_MOVEMENT_STRAIGHTPROBESETTINGS_H_
#define SRC_MOVEMENT_STRAIGHTPROBESETTINGS_H_
#include "RepRapFirmware.h"
enum class StraightProbeType : uint8_t {
unset,
towardsWorkpieceErrorOnFailure, // probe toward workpiece, stop on contact, signal error if failure
towardsWorkpiece, // probe toward workpiece, stop on contact
awayFromWorkpieceErrorOnFailure, // probe away from workpiece, stop on loss of contact, signal error if failure
awayFromWorkpiece // probe away from workpiece, stop on loss of contact
};
class StraightProbeSettings
{
public:
StraightProbeSettings() noexcept;
void Reset() noexcept;
void SetCoordsToTarget(float[MaxAxes]) const noexcept;
float* GetTarget() noexcept { return target; };
const StraightProbeType GetType() const noexcept { return type; }
void SetStraightProbeType(const StraightProbeType t) noexcept { type = t; }
const AxesBitmap GetMovingAxes() const noexcept { return movingAxes; }
void AddMovingAxis(const size_t) noexcept;
const size_t GetZProbeToUse() const noexcept { return probeToUse; }
void SetZProbeToUse(const size_t probeNumber) noexcept { probeToUse = probeNumber; }
const bool ProbingAway() const noexcept;
const bool SignalError() const noexcept;
private:
AxesBitmap movingAxes; // Axes supposed to move - this is only used for manual probing
size_t probeToUse; // Use this ZProbe
float target[MaxAxes]; // G38 target coordinates for straight probe moves
StraightProbeType type; // Type of move
};
inline void StraightProbeSettings::AddMovingAxis(const size_t axis) noexcept
{
movingAxes.SetBit(axis);
}
inline const bool StraightProbeSettings::ProbingAway() const noexcept
{
return type == StraightProbeType::awayFromWorkpieceErrorOnFailure || type == StraightProbeType::awayFromWorkpiece;
}
inline const bool StraightProbeSettings::SignalError() const noexcept
{
return type == StraightProbeType::awayFromWorkpieceErrorOnFailure || type == StraightProbeType::towardsWorkpieceErrorOnFailure;
}
#endif /* SRC_MOVEMENT_STRAIGHTPROBESETTINGS_H_ */
|