Browse Source

Fix translation offset.

Neal Wilson 11 years ago
parent
commit
fe9062299e
1 changed files with 11 additions and 2 deletions
  1. 11
    2
      config/Windows/productionroaster.xml

+ 11
- 2
config/Windows/productionroaster.xml View File

@@ -633,6 +633,15 @@
633 633
 				channelSkip++;
634 634
 			}
635 635
 		}
636
+		var offsetForChannel = function(c) {
637
+			var retval = -1;
638
+			for(var i = 0; i <= c; i++) {
639
+				if(channelVisibility[i]) {
640
+					retval++;
641
+				}
642
+			}
643
+			return retval;
644
+		};
636 645
         start.clicked.connect(function() {
637 646
 			start.enabled = false;
638 647
 			hasTranslated = false;
@@ -663,7 +672,7 @@
663 672
             }
664 673
 			if(translationChannel >= 0)
665 674
 			{
666
-				offsets[translationChannel].measurement.connect(currentDetector.newMeasurement);
675
+				offsets[offsetForChannel(translationChannel)].measurement.connect(currentDetector.newMeasurement);
667 676
 			}
668 677
 			if(typeof(externtrans) != 'undefined') {
669 678
 				externtrans.display(0);
@@ -725,7 +734,7 @@
725 734
             }
726 735
 			if(translationChannel >= 0)
727 736
 			{
728
-				offsets[translationChannel].measurement.disconnect(currentDetector.newMeasurement);
737
+				offsets[offsetForChannel(translationChannel)].measurement.disconnect(currentDetector.newMeasurement);
729 738
 			}
730 739
 			start.enabled = true;
731 740
 			window.windowModified = false;

Loading…
Cancel
Save