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
 				channelSkip++;
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
         start.clicked.connect(function() {
645
         start.clicked.connect(function() {
637
 			start.enabled = false;
646
 			start.enabled = false;
638
 			hasTranslated = false;
647
 			hasTranslated = false;
663
             }
672
             }
664
 			if(translationChannel >= 0)
673
 			if(translationChannel >= 0)
665
 			{
674
 			{
666
-				offsets[translationChannel].measurement.connect(currentDetector.newMeasurement);
675
+				offsets[offsetForChannel(translationChannel)].measurement.connect(currentDetector.newMeasurement);
667
 			}
676
 			}
668
 			if(typeof(externtrans) != 'undefined') {
677
 			if(typeof(externtrans) != 'undefined') {
669
 				externtrans.display(0);
678
 				externtrans.display(0);
725
             }
734
             }
726
 			if(translationChannel >= 0)
735
 			if(translationChannel >= 0)
727
 			{
736
 			{
728
-				offsets[translationChannel].measurement.disconnect(currentDetector.newMeasurement);
737
+				offsets[offsetForChannel(translationChannel)].measurement.disconnect(currentDetector.newMeasurement);
729
 			}
738
 			}
730
 			start.enabled = true;
739
 			start.enabled = true;
731
 			window.windowModified = false;
740
 			window.windowModified = false;

Loading…
Cancel
Save