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
3c321110
Commit
3c321110
authored
Nov 26, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-ordering restoration of saved parameters
parent
8536562f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
44 deletions
+53
-44
CalibrationHardwareInterface.java
src/main/java/CalibrationHardwareInterface.java
+53
-44
No files found.
src/main/java/CalibrationHardwareInterface.java
View file @
3c321110
...
@@ -412,30 +412,8 @@ public class CalibrationHardwareInterface {
...
@@ -412,30 +412,8 @@ public class CalibrationHardwareInterface {
}
}
}
}
public
void
getProperties
(
String
prefix
,
Properties
properties
){
public
void
getProperties
(
String
prefix
,
Properties
properties
){
if
(
properties
.
getProperty
(
prefix
+
"cameraSubnet"
)!=
null
)
this
.
cameraSubnet
=
properties
.
getProperty
(
prefix
+
"cameraSubnet"
);
if
(
properties
.
getProperty
(
prefix
+
"iBaseIP"
)!=
null
)
this
.
iBaseIP
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"iBaseIP"
));
if
(
properties
.
getProperty
(
prefix
+
"masterSubCamera"
)!=
null
)
this
.
masterSubCamera
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"masterSubCamera"
));
if
(
properties
.
getProperty
(
prefix
+
"masterPort"
)!=
null
)
this
.
masterPort
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"masterPort"
));
if
(
properties
.
getProperty
(
prefix
+
"cameraBootTimeSeconds"
)!=
null
)
this
.
cameraBootTimeSeconds
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cameraBootTimeSeconds"
));
if
(
properties
.
getProperty
(
prefix
+
"connectionTimeoutMilliseconds"
)!=
null
)
this
.
connectionTimeoutMilliseconds
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"connectionTimeoutMilliseconds"
));
if
(
properties
.
getProperty
(
prefix
+
"imgsrvPort"
)!=
null
)
this
.
imgsrvPort
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"imgsrvPort"
));
if
(
properties
.
getProperty
(
prefix
+
"resetURLcmd"
)!=
null
)
this
.
resetURLcmd
=
properties
.
getProperty
(
prefix
+
"resetURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"triggerURLcmd"
)!=
null
)
this
.
triggerURLcmd
=
properties
.
getProperty
(
prefix
+
"triggerURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"imageURLcmd"
)!=
null
)
this
.
imageURLcmd
=
properties
.
getProperty
(
prefix
+
"imageURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"metaURLcmd"
)!=
null
)
this
.
metaURLcmd
=
properties
.
getProperty
(
prefix
+
"metaURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"channelMap.length"
)!=
null
)
{
if
(
properties
.
getProperty
(
prefix
+
"channelMap.length"
)!=
null
)
{
// next initializes default values, so it should be before reading them from saved properties
initDefaultMap
(
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap.length"
)));
initDefaultMap
(
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap.length"
)));
this
.
flipImages
=
new
boolean
[
this
.
channelMap
.
length
];
this
.
flipImages
=
new
boolean
[
this
.
channelMap
.
length
];
for
(
int
i
=
0
;
i
<
this
.
channelMap
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
this
.
channelMap
.
length
;
i
++)
{
...
@@ -447,10 +425,9 @@ public class CalibrationHardwareInterface {
...
@@ -447,10 +425,9 @@ public class CalibrationHardwareInterface {
this
.
channelMap
[
i
][
2
]=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_port"
));
this
.
channelMap
[
i
][
2
]=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_port"
));
if
(
properties
.
getProperty
(
prefix
+
"flipImages_"
+
i
)!=
null
)
if
(
properties
.
getProperty
(
prefix
+
"flipImages_"
+
i
)!=
null
)
this
.
flipImages
[
i
]=(
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"flipImages_"
+
i
))>
0
);
this
.
flipImages
[
i
]=(
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"flipImages_"
+
i
))>
0
);
}
}
}
}
int
numCams
=
0
;
int
numCams
=
0
;
if
(
properties
.
getProperty
(
prefix
+
"cameraIPs.length"
)!=
null
)
{
if
(
properties
.
getProperty
(
prefix
+
"cameraIPs.length"
)!=
null
)
{
numCams
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cameraIPs.length"
));
numCams
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cameraIPs.length"
));
...
@@ -462,6 +439,35 @@ public class CalibrationHardwareInterface {
...
@@ -462,6 +439,35 @@ public class CalibrationHardwareInterface {
}
}
}
}
initCamParsDefaultArrays
(
numCams
);
initCamParsDefaultArrays
(
numCams
);
if
(
properties
.
getProperty
(
prefix
+
"cameraSubnet"
)!=
null
)
this
.
cameraSubnet
=
properties
.
getProperty
(
prefix
+
"cameraSubnet"
);
if
(
properties
.
getProperty
(
prefix
+
"iBaseIP"
)!=
null
)
this
.
iBaseIP
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"iBaseIP"
));
if
(
properties
.
getProperty
(
prefix
+
"masterSubCamera"
)!=
null
)
this
.
masterSubCamera
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"masterSubCamera"
));
if
(
properties
.
getProperty
(
prefix
+
"masterPort"
)!=
null
)
this
.
masterPort
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"masterPort"
));
if
(
properties
.
getProperty
(
prefix
+
"cameraBootTimeSeconds"
)!=
null
)
this
.
cameraBootTimeSeconds
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cameraBootTimeSeconds"
));
if
(
properties
.
getProperty
(
prefix
+
"connectionTimeoutMilliseconds"
)!=
null
)
this
.
connectionTimeoutMilliseconds
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"connectionTimeoutMilliseconds"
));
if
(
properties
.
getProperty
(
prefix
+
"imgsrvPort"
)!=
null
)
this
.
imgsrvPort
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"imgsrvPort"
));
if
(
properties
.
getProperty
(
prefix
+
"resetURLcmd"
)!=
null
)
this
.
resetURLcmd
=
properties
.
getProperty
(
prefix
+
"resetURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"triggerURLcmd"
)!=
null
)
this
.
triggerURLcmd
=
properties
.
getProperty
(
prefix
+
"triggerURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"imageURLcmd"
)!=
null
)
this
.
imageURLcmd
=
properties
.
getProperty
(
prefix
+
"imageURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"metaURLcmd"
)!=
null
)
this
.
metaURLcmd
=
properties
.
getProperty
(
prefix
+
"metaURLcmd"
);
// both defaults were here
if
(
properties
.
getProperty
(
prefix
+
"colorMode"
)!=
null
)
if
(
properties
.
getProperty
(
prefix
+
"colorMode"
)!=
null
)
this
.
colorMode
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"colorMode"
));
this
.
colorMode
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"colorMode"
));
...
@@ -1013,34 +1019,37 @@ public class CalibrationHardwareInterface {
...
@@ -1013,34 +1019,37 @@ public class CalibrationHardwareInterface {
String
triggerMode
=
""
;
String
triggerMode
=
""
;
if
(
this
.
setupTriggerMode
)
{
if
(
this
.
nc393
)
{
if
(
this
.
nc393
)
{
if
(
isMasterPort
)
{
if
(
isMasterPort
)
{
/*
/*
* P_TRIG_OUT (outputs):
* P_TRIG_OUT (outputs):
* off: 0x00000
* off: 0x00
000
* external: 0x02
000
* external: 0x02
000
* internal: 0x20
000
* internal: 0x20
000
* both: 0x22
000
* both: 0x22000
* P_TRIG_IN (inputs):
* P_TRIG_IN (inputs):
* off: 0x00000
* off: 0x0
0000
* external: 0x8
0000
* external: 0x80
000
* internal: 0x08
000
* internal: 0x0
8000
* both: 0x8
8000
* both: 0x88000
*/
*/
if
(
this
.
setupTriggerMode
){
triggerMode
+=
"&TRIG_CONDITION="
+(
this
.
noCabling
?(
0
):(
this
.
externalTriggerCabling
?
"0x80000"
:
"0x08000"
))+
"*0"
+
triggerMode
+=
"&TRIG_CONDITION="
+(
this
.
noCabling
?(
0
):(
this
.
externalTriggerCabling
?
"0x80000"
:
"0x08000"
))+
"*0"
+
"&TRIG_OUT="
+(
this
.
noCabling
?(
0
):(
this
.
externalTriggerCabling
?
"0x02000"
:
"0x20000"
))+
"*0"
+
"&TRIG_OUT="
+(
this
.
noCabling
?(
0
):(
this
.
externalTriggerCabling
?
"0x02000"
:
"0x20000"
))+
"*0"
+
"&TRIG=4*3"
;
"&TRIG=4*3"
;
if
(
this
.
triggerPeriod
[
chn
]>
1
)
triggerMode
+=
"&TRIG_PERIOD=0*1"
;
// just stop it if it wasn't already, imgsrv /trig does not set it, only FPGA register
}
}
}
else
{
if
(
this
.
triggerPeriod
[
chn
]>
1
)
triggerMode
+=
"&TRIG_PERIOD=0*1"
;
// just stop it if it wasn't already, imgsrv /trig does not set it, only FPGA register
}
}
else
{
if
(
this
.
setupTriggerMode
){
triggerMode
+=
"&TRIG_CONDITION="
+(
this
.
noCabling
?(
0
):(
this
.
externalTriggerCabling
?
"0x200000"
:
"0x20000"
))+
"*0"
+
triggerMode
+=
"&TRIG_CONDITION="
+(
this
.
noCabling
?(
0
):(
this
.
externalTriggerCabling
?
"0x200000"
:
"0x20000"
))+
"*0"
+
"&TRIG_OUT="
+(
this
.
noCabling
?(
0
):(
this
.
externalTriggerCabling
?
"0x800000"
:
"0x80000"
))+
"*0"
+
"&TRIG_OUT="
+(
this
.
noCabling
?(
0
):(
this
.
externalTriggerCabling
?
"0x800000"
:
"0x80000"
))+
"*0"
+
"&TRIG=4*3"
;
"&TRIG=4*3"
;
if
(
this
.
triggerPeriod
[
chn
]>
1
)
triggerMode
+=
"&TRIG_PERIOD=1*0"
;
// just imgsrv /trig does not set it, only FPGA register
}
}
if
(
this
.
triggerPeriod
[
chn
]>
1
)
triggerMode
+=
"&TRIG_PERIOD=1*0"
;
// just imgsrv /trig does not set it, only FPGA register
}
}
String
url
=
"http://"
+
ip
+
"/parsedit.php?immediate"
;
String
url
=
"http://"
+
ip
+
"/parsedit.php?immediate"
;
...
...
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