Commit c1f185a6 authored by Andrey Filippov's avatar Andrey Filippov

acquired all channel images

parent d93d350f
...@@ -287,7 +287,7 @@ public class CalibrationHardwareInterface { ...@@ -287,7 +287,7 @@ public class CalibrationHardwareInterface {
for (int i = 0; i<this.cameraIPs.length; i++){ for (int i = 0; i<this.cameraIPs.length; i++){
int ip_index= ip_ports_list.get(i)>>2; int ip_index= ip_ports_list.get(i)>>2;
int sensor_port = ip_ports_list.get(i) & 3; int sensor_port = ip_ports_list.get(i) & 3;
this.cameraIPs[i] = this.cameraSubnet+(this.iBaseIP + ip_index) + ":"+ sensor_port; this.cameraIPs[i] = this.cameraSubnet+(this.iBaseIP + ip_index) + ":"+ (this.imgsrvPort+sensor_port);
for (int j = 0; j<this.channelMap.length; j++){ for (int j = 0; j<this.channelMap.length; j++){
if ((this.channelMap[j][0] == ip_index) && (this.channelMap[j][2] == sensor_port)) { if ((this.channelMap[j][0] == ip_index) && (this.channelMap[j][2] == sensor_port)) {
this.channelIPPort[j] = i; this.channelIPPort[j] = i;
...@@ -1258,7 +1258,8 @@ public class CalibrationHardwareInterface { ...@@ -1258,7 +1258,8 @@ public class CalibrationHardwareInterface {
boolean [] IPs= new boolean[this.cameraIPs.length]; boolean [] IPs= new boolean[this.cameraIPs.length];
for (int i=0;i<IPs.length;i++) IPs[i]=false; for (int i=0;i<IPs.length;i++) IPs[i]=false;
for (int i=0;i<selectCameras.length;i++) if (i<this.channelMap.length) { for (int i=0;i<selectCameras.length;i++) if (i<this.channelMap.length) {
IPs[this.channelMap[i][0]]=true; // IPs[this.channelMap[i][0]]=true;
IPs[this.channelIPPort[i]] = true; // since NC393
} }
return IPs; return IPs;
} }
...@@ -1439,7 +1440,7 @@ public class CalibrationHardwareInterface { ...@@ -1439,7 +1440,7 @@ public class CalibrationHardwareInterface {
public void run() { public void run() {
for (int ipIndex=ipIndexAtomic.getAndIncrement(); ipIndex<ipLength;ipIndex=ipIndexAtomic.getAndIncrement()){ for (int ipIndex=ipIndexAtomic.getAndIncrement(); ipIndex<ipLength;ipIndex=ipIndexAtomic.getAndIncrement()){
// for (int i=0;i<this.imagesIP.length;i++){ // for (int i=0;i<this.imagesIP.length;i++){
if (debugLevel>2) System.out.println("getImages()3: ipIndex="+ipIndex+" acquireIPs.length=" +acquireIPs.length+ if (debugLevel>1/*2*/) System.out.println("getImages()3: ipIndex="+ipIndex+" acquireIPs.length=" +acquireIPs.length+
((ipIndex<acquireIPs.length)? (" acquireIPs[ipIndex]="+acquireIPs[ipIndex]):"")); ((ipIndex<acquireIPs.length)? (" acquireIPs[ipIndex]="+acquireIPs[ipIndex]):""));
if ((ipIndex<acquireIPs.length) && acquireIPs[ipIndex]) { if ((ipIndex<acquireIPs.length) && acquireIPs[ipIndex]) {
if (debugLevel>2) System.out.println("getImages:" + imageURLs[ipIndex] ); if (debugLevel>2) System.out.println("getImages:" + imageURLs[ipIndex] );
...@@ -1480,6 +1481,7 @@ public class CalibrationHardwareInterface { ...@@ -1480,6 +1481,7 @@ public class CalibrationHardwareInterface {
final int [] channelIPPort = this.channelIPPort; final int [] channelIPPort = this.channelIPPort;
final AtomicInteger imageIndexAtomic = new AtomicInteger(0); final AtomicInteger imageIndexAtomic = new AtomicInteger(0);
final int [] motorsPosition=this.motorsPosition; final int [] motorsPosition=this.motorsPosition;
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
public void run() { public void run() {
...@@ -1497,6 +1499,7 @@ public class CalibrationHardwareInterface { ...@@ -1497,6 +1499,7 @@ public class CalibrationHardwareInterface {
boolean singleSensor=true; boolean singleSensor=true;
for (int s=0;s<sensorPresent[iIP].length;s++) singleSensor&= !sensorPresent[iIP][s]; for (int s=0;s<sensorPresent[iIP].length;s++) singleSensor&= !sensorPresent[iIP][s];
if (singleSensor){ // no 10359 multiplexor if (singleSensor){ // no 10359 multiplexor
if (debugLevel>1) System.out.println("DEBUG393: demuxing single sensor imageIndex="+imageIndex+" iIP="+iIP);
images[imageIndex]=jp4_Instance.demuxClone(imagesIP[iIP]); images[imageIndex]=jp4_Instance.demuxClone(imagesIP[iIP]);
} else { } else {
int subCam=channelMap[imageIndex][1]; int subCam=channelMap[imageIndex][1];
...@@ -1506,6 +1509,7 @@ public class CalibrationHardwareInterface { ...@@ -1506,6 +1509,7 @@ public class CalibrationHardwareInterface {
} }
// skip missing channels, then demux // skip missing channels, then demux
for (int s=0;s<channelMap[imageIndex][1];s++) if (!sensorPresent[iIP][s]) subCam--; for (int s=0;s<channelMap[imageIndex][1];s++) if (!sensorPresent[iIP][s]) subCam--;
if (debugLevel>1) System.out.println("DEBUG393: demuxing imageIndex="+imageIndex+" iIP="+iIP+" subCam="+subCam);
images[imageIndex]=jp4_Instance.demuxImage(imagesIP[iIP],subCam); images[imageIndex]=jp4_Instance.demuxImage(imagesIP[iIP],subCam);
} }
// this.images[i]=this.jp4_Instances[j].demuxImageOrClone(this.imagesIP[j],this.channelMap[i][1]); // this.images[i]=this.jp4_Instances[j].demuxImageOrClone(this.imagesIP[j],this.channelMap[i][1]);
......
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