Newer
Older
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/**
* This file is part of VisiCut.
* Copyright (C) 2011 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
* VisiCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VisiCut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
**/
package com.t_oster.liblasercut;
/**
* The LaserProperty holds all the parameters for parts of the LaserJob.
* The Frequency value is ignored for Engraving operations
*
* @author oster
*/
public class PowerSpeedFocusFrequencyProperty extends PowerSpeedFocusProperty
{
private int frequency = 5000;
public PowerSpeedFocusFrequencyProperty()
{
}
public PowerSpeedFocusFrequencyProperty(int power, int speed)
{
this(power, speed, 0, 5000);
}
public PowerSpeedFocusFrequencyProperty(int power, int speed, float focus)
{
this(power, speed, focus, 5000);
}
public PowerSpeedFocusFrequencyProperty(int power, int speed, float focus, int frequency)
{
super(power, speed, focus);
this.frequency = frequency;
}
public void setFrequency(int frequency)
{
frequency = frequency < 100 ? 100 : frequency;
frequency = frequency > 5000 ? 5000 : frequency;
this.frequency = frequency;
}
public int getFrequency()
{
return frequency;
}
private static String[] propertyNames = new String[]{"power", "speed", "focus", "frequency"};
@Override
public String[] getPropertyNames()
{
return propertyNames;
}
@Override
public Object getProperty(String name)
{
if ("frequency".equals(name))
{
return this.getFrequency();
}
else
{
return super.getProperty(name);
}
}
@Override
public void setProperty(String name, Object value)
{
if ("frequency".equals(name))
{
this.setFrequency((Integer) value);
}
else
{
super.setProperty(name, value);
}
}
@Override
public Object getMinimumValue(String name)
{
if ("frequency".equals(name))
{
return (Integer) 100;
}
else
{
return super.getMinimumValue(name);
}
}
@Override
public Object getMaximumValue(String name)
{
if ("frequency".equals(name))
{
return (Integer) 5000;
}
else
{
return super.getMaximumValue(name);
}
}
@Override
public Object[] getPossibleValues(String name)
{
if ("frequency".equals(name))
{
return null;
}
else
{
return super.getPossibleValues(name);
}
}
@Override
public PowerSpeedFocusFrequencyProperty clone()
{
return new PowerSpeedFocusFrequencyProperty(this.getPower(), this.getSpeed(), this.getFocus(), frequency);
}
}