Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
8816cfb2
Commit
8816cfb2
authored
Oct 18, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more fixing power control
parent
1bd52d1c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
CalibrationHardwareInterface.java
src/main/java/CalibrationHardwareInterface.java
+18
-16
No files found.
src/main/java/CalibrationHardwareInterface.java
View file @
8816cfb2
...
@@ -1802,7 +1802,9 @@ public class CalibrationHardwareInterface {
...
@@ -1802,7 +1802,9 @@ public class CalibrationHardwareInterface {
public
static
class
PowerControl
{
public
static
class
PowerControl
{
public
boolean
[]
states
={
false
,
false
,
false
,
false
,
false
};
public
boolean
[]
states
={
false
,
false
,
false
,
false
,
false
};
public
int
[]
lightsChannels
={
/*2,*/
3
,
4
};
// which lights to control on on/off
public
boolean
[]
useControl
={
true
,
true
,
false
,
true
,
true
};
// public int [] lightsChannels={2,3,4}; // which lights to control on on/off
public
int
[]
lightsChannels
={
3
,
4
};
// which lights to control on on/off
public
String
[]
groups
={
"heater"
,
"fan"
,
"light"
,
"light1"
,
"light2"
};
public
String
[]
groups
={
"heater"
,
"fan"
,
"light"
,
"light1"
,
"light2"
};
public
int
debugLevel
=
1
;
public
int
debugLevel
=
1
;
private
String
powerIP
=
"192.168.0.80"
;
private
String
powerIP
=
"192.168.0.80"
;
...
@@ -1879,11 +1881,11 @@ public class CalibrationHardwareInterface {
...
@@ -1879,11 +1881,11 @@ public class CalibrationHardwareInterface {
gd
.
addNumericField
(
"Delay after lights on"
,
this
.
lightsDelay
,
1
,
4
,
"sec"
);
gd
.
addNumericField
(
"Delay after lights on"
,
this
.
lightsDelay
,
1
,
4
,
"sec"
);
if
(
control
){
if
(
control
){
gd
.
addCheckbox
(
"Heater On"
,
heaterOn
);
if
(
useControl
[
0
])
gd
.
addCheckbox
(
"Heater On"
,
heaterOn
);
gd
.
addCheckbox
(
"Fan On"
,
fanOn
);
if
(
useControl
[
1
])
gd
.
addCheckbox
(
"Fan On"
,
fanOn
);
gd
.
addCheckbox
(
"Lights Top On"
,
light1
On
);
if
(
useControl
[
2
])
gd
.
addCheckbox
(
"Lights On"
,
light
On
);
gd
.
addCheckbox
(
"Lights Bottom On"
,
light2
On
);
if
(
useControl
[
3
])
gd
.
addCheckbox
(
"Lights Top On"
,
light1
On
);
gd
.
addCheckbox
(
"Lights On"
,
light
On
);
if
(
useControl
[
4
])
gd
.
addCheckbox
(
"Lights Bottom On"
,
light2
On
);
}
}
WindowTools
.
addScrollBars
(
gd
);
WindowTools
.
addScrollBars
(
gd
);
if
(
control
)
gd
.
enableYesNoCancel
(
"OK"
,
"Control Power"
);
if
(
control
)
gd
.
enableYesNoCancel
(
"OK"
,
"Control Power"
);
...
@@ -1893,17 +1895,17 @@ public class CalibrationHardwareInterface {
...
@@ -1893,17 +1895,17 @@ public class CalibrationHardwareInterface {
this
.
powerIP
=
gd
.
getNextString
();
this
.
powerIP
=
gd
.
getNextString
();
this
.
lightsDelay
=
gd
.
getNextNumber
();
this
.
lightsDelay
=
gd
.
getNextNumber
();
if
(
control
){
if
(
control
){
heaterOn
=
gd
.
getNextBoolean
();
if
(
useControl
[
0
])
heaterOn
=
gd
.
getNextBoolean
();
fanOn
=
gd
.
getNextBoolean
();
if
(
useControl
[
1
])
fanOn
=
gd
.
getNextBoolean
();
light1
On
=
gd
.
getNextBoolean
();
if
(
useControl
[
2
])
light
On
=
gd
.
getNextBoolean
();
light2
On
=
gd
.
getNextBoolean
();
if
(
useControl
[
3
])
light1
On
=
gd
.
getNextBoolean
();
light
On
=
gd
.
getNextBoolean
();
if
(
useControl
[
4
])
light2
On
=
gd
.
getNextBoolean
();
if
(!
gd
.
wasOKed
())
{
if
(!
gd
.
wasOKed
())
{
setPower
(
"heater"
,
heaterOn
?
"on"
:
"off"
);
setPower
(
"heater"
,
"state"
);
if
(
useControl
[
0
])
setPower
(
"heater"
,
heaterOn
?
"on"
:
"off"
);
//
setPower("heater","state");
setPower
(
"fan"
,
fanOn
?
"on"
:
"off"
);
setPower
(
"fan"
,
"state"
);
if
(
useControl
[
1
])
setPower
(
"fan"
,
fanOn
?
"on"
:
"off"
);
//
setPower("fan","state");
setPower
(
"light1"
,
light1On
?
"on"
:
"off"
);
setPower
(
"light1
"
,
"state"
);
if
(
useControl
[
2
])
setPower
(
"light"
,
lightOn
?
"on"
:
"off"
);
// setPower("light
","state");
setPower
(
"light2"
,
light2On
?
"on"
:
"off"
);
setPower
(
"light2
"
,
"state"
);
if
(
useControl
[
3
])
setPower
(
"light1"
,
light1On
?
"on"
:
"off"
);
// setPower("light1
","state");
// setPower("light",lightOn?"on":"off"); setPower("light
","state");
if
(
useControl
[
4
])
setPower
(
"light2"
,
light2On
?
"on"
:
"off"
);
// setPower("light2
","state");
}
}
}
}
return
true
;
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment