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
Show 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,6 +412,34 @@ public class CalibrationHardwareInterface {
...
@@ -412,6 +412,34 @@ public class CalibrationHardwareInterface {
}
}
}
}
public
void
getProperties
(
String
prefix
,
Properties
properties
){
public
void
getProperties
(
String
prefix
,
Properties
properties
){
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"
)));
this
.
flipImages
=
new
boolean
[
this
.
channelMap
.
length
];
for
(
int
i
=
0
;
i
<
this
.
channelMap
.
length
;
i
++)
{
if
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_IPindex"
)!=
null
)
this
.
channelMap
[
i
][
0
]=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_IPindex"
));
if
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_subchannel"
)!=
null
)
this
.
channelMap
[
i
][
1
]=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_subchannel"
));
if
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_port"
)!=
null
)
this
.
channelMap
[
i
][
2
]=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_port"
));
if
(
properties
.
getProperty
(
prefix
+
"flipImages_"
+
i
)!=
null
)
this
.
flipImages
[
i
]=(
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"flipImages_"
+
i
))>
0
);
}
}
int
numCams
=
0
;
if
(
properties
.
getProperty
(
prefix
+
"cameraIPs.length"
)!=
null
)
{
numCams
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cameraIPs.length"
));
this
.
cameraIPs
=
new
String
[
numCams
];
for
(
int
i
=
0
;
i
<
numCams
;
i
++)
{
if
(
properties
.
getProperty
(
prefix
+
"cameraIPs_"
+
i
)!=
null
)
this
.
cameraIPs
[
i
]=
properties
.
getProperty
(
prefix
+
"cameraIPs_"
+
i
);
}
}
initCamParsDefaultArrays
(
numCams
);
if
(
properties
.
getProperty
(
prefix
+
"cameraSubnet"
)!=
null
)
if
(
properties
.
getProperty
(
prefix
+
"cameraSubnet"
)!=
null
)
this
.
cameraSubnet
=
properties
.
getProperty
(
prefix
+
"cameraSubnet"
);
this
.
cameraSubnet
=
properties
.
getProperty
(
prefix
+
"cameraSubnet"
);
if
(
properties
.
getProperty
(
prefix
+
"iBaseIP"
)!=
null
)
if
(
properties
.
getProperty
(
prefix
+
"iBaseIP"
)!=
null
)
...
@@ -435,33 +463,11 @@ public class CalibrationHardwareInterface {
...
@@ -435,33 +463,11 @@ public class CalibrationHardwareInterface {
this
.
imageURLcmd
=
properties
.
getProperty
(
prefix
+
"imageURLcmd"
);
this
.
imageURLcmd
=
properties
.
getProperty
(
prefix
+
"imageURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"metaURLcmd"
)!=
null
)
if
(
properties
.
getProperty
(
prefix
+
"metaURLcmd"
)!=
null
)
this
.
metaURLcmd
=
properties
.
getProperty
(
prefix
+
"metaURLcmd"
);
this
.
metaURLcmd
=
properties
.
getProperty
(
prefix
+
"metaURLcmd"
);
if
(
properties
.
getProperty
(
prefix
+
"channelMap.length"
)!=
null
)
{
initDefaultMap
(
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap.length"
)));
this
.
flipImages
=
new
boolean
[
this
.
channelMap
.
length
];
for
(
int
i
=
0
;
i
<
this
.
channelMap
.
length
;
i
++)
{
if
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_IPindex"
)!=
null
)
this
.
channelMap
[
i
][
0
]=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_IPindex"
));
if
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_subchannel"
)!=
null
)
this
.
channelMap
[
i
][
1
]=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_subchannel"
));
if
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_port"
)!=
null
)
this
.
channelMap
[
i
][
2
]=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"channelMap_"
+
i
+
"_port"
));
if
(
properties
.
getProperty
(
prefix
+
"flipImages_"
+
i
)!=
null
)
this
.
flipImages
[
i
]=(
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"flipImages_"
+
i
))>
0
);
}
}
// both defaults were here
int
numCams
=
0
;
if
(
properties
.
getProperty
(
prefix
+
"cameraIPs.length"
)!=
null
)
{
numCams
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cameraIPs.length"
));
this
.
cameraIPs
=
new
String
[
numCams
];
for
(
int
i
=
0
;
i
<
numCams
;
i
++)
{
if
(
properties
.
getProperty
(
prefix
+
"cameraIPs_"
+
i
)!=
null
)
this
.
cameraIPs
[
i
]=
properties
.
getProperty
(
prefix
+
"cameraIPs_"
+
i
);
}
}
initCamParsDefaultArrays
(
numCams
);
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,10 +1019,9 @@ public class CalibrationHardwareInterface {
...
@@ -1013,10 +1019,9 @@ 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: 0x00000
* external: 0x02000
* external: 0x02000
...
@@ -1028,20 +1033,24 @@ public class CalibrationHardwareInterface {
...
@@ -1028,20 +1033,24 @@ public class CalibrationHardwareInterface {
* internal: 0x08000
* internal: 0x08000
* both: 0x88000
* 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
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
{
}
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"
;
if
(
this
.
nc393
)
{
if
(
this
.
nc393
)
{
...
...
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