Commit 3c321110 authored by Andrey Filippov's avatar Andrey Filippov

re-ordering restoration of saved parameters

parent 8536562f
...@@ -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: 0x00000 * external: 0x02000
* external: 0x02000 * internal: 0x20000
* internal: 0x20000 * both: 0x22000
* both: 0x22000 * P_TRIG_IN (inputs):
* P_TRIG_IN (inputs): * off: 0x00000
* off: 0x00000 * external: 0x80000
* external: 0x80000 * 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
} }
}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";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment