forked from Ultimaker/CuraEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.cpp
103 lines (91 loc) · 2.78 KB
/
settings.cpp
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#include <stdio.h>
#include "settings.h"
#define STRINGIFY(_s) #_s
#define SETTING(name) _index.push_back(_ConfigSettingIndex(STRINGIFY(name), &name))
#define SETTING2(name, altName) _index.push_back(_ConfigSettingIndex(STRINGIFY(name), &name)); _index.push_back(_ConfigSettingIndex(STRINGIFY(altName), &name))
ConfigSettings::ConfigSettings()
{
SETTING(layerThickness);
SETTING(initialLayerThickness);
SETTING(filamentDiameter);
SETTING(filamentFlow);
SETTING(extrusionWidth);
SETTING(insetCount);
SETTING(downSkinCount);
SETTING(upSkinCount);
SETTING(sparseInfillLineDistance);
SETTING(infillOverlap);
SETTING(skirtDistance);
SETTING(skirtLineCount);
SETTING(skirtMinLength);
SETTING(initialSpeedupLayers);
SETTING(initialLayerSpeed);
SETTING(printSpeed);
SETTING(infillSpeed);
SETTING(inset0Speed);
SETTING(insetXSpeed);
SETTING(moveSpeed);
SETTING(fanFullOnLayerNr);
SETTING(supportAngle);
SETTING(supportEverywhere);
SETTING(supportLineDistance);
SETTING(supportXYDistance);
SETTING(supportZDistance);
SETTING(supportExtruder);
SETTING(retractionAmount);
SETTING(retractionSpeed);
SETTING(retractionAmountExtruderSwitch);
SETTING(retractionMinimalDistance);
SETTING(minimalExtrusionBeforeRetraction);
SETTING(enableCombing);
SETTING(enableOozeShield);
SETTING(wipeTowerSize);
SETTING(multiVolumeOverlap);
SETTING2(objectPosition.X, posx);
SETTING2(objectPosition.Y, posy);
SETTING(objectSink);
SETTING(raftMargin);
SETTING(raftLineSpacing);
SETTING(raftBaseThickness);
SETTING(raftBaseLinewidth);
SETTING(raftInterfaceThickness);
SETTING(raftInterfaceLinewidth);
SETTING(minimalLayerTime);
SETTING(minimalFeedrate);
SETTING(coolHeadLift);
SETTING(fanSpeedMin);
SETTING(fanSpeedMax);
SETTING(fixHorrible);
SETTING(spiralizeMode);
SETTING(gcodeFlavor);
SETTING(extruderOffset[1].X);
SETTING(extruderOffset[1].Y);
SETTING(extruderOffset[2].X);
SETTING(extruderOffset[2].Y);
SETTING(extruderOffset[3].X);
SETTING(extruderOffset[3].Y);
}
#undef STRINGIFY
#undef SETTING
bool ConfigSettings::setSetting(const char* key, const char* value)
{
for(unsigned int n=0; n < _index.size(); n++)
{
if (strcasecmp(key, _index[n].key) == 0)
{
*_index[n].ptr = atoi(value);
return true;
}
}
if (strcasecmp(key, "startCode") == 0)
{
this->startCode = value;
return true;
}
if (strcasecmp(key, "endCode") == 0)
{
this->endCode = value;
return true;
}
return false;
}