SCTDBAssemblyInfo.java

00001 package DisplayGUI;
00002 
00003 
00010 public class SCTDBAssemblyInfo {
00011 
00014     int index, row, pos;
00015     // index - SCTDB position index
00016     // row - barrle row
00017     // pos - module position -6 to -1 and 1 to 6
00018     // view - SCT component 0-3 barrels 3-6, 4-12 endcaps -1 to -9, 13-21 encaps 1 to 9
00019 
00020     public SCTDBAssemblyInfo(String sIndex) {
00021        init(Integer.parseInt(sIndex));
00022        }
00023 
00024     public SCTDBAssemblyInfo(int index) {
00025       init(index);
00026       }
00027     private void init(int index) {
00028       this.index=index;
00029       int thisIndex=index-1;
00030       row = thisIndex/12;
00031       int thisPos = thisIndex%12;
00032       pos = (thisPos<6) ? thisPos-6 : thisPos-5;
00033       }
00034 
00035     public SCTDBAssemblyInfo(int row, int pos) {
00036        this.row=row;
00037        this.pos=pos;
00038 
00039        int mpos = pos+6;
00040        if(mpos<6) mpos++;
00041        index = row*12 + mpos;
00042        }
00043 
00044 
00045     public int getIndex() {
00046         return index;
00047         }
00048     public int getRow() {
00049         return row;
00050         }
00051 
00052     public int getPos() {
00053         return pos;
00054         }
00055 }

Generated on Mon Feb 6 14:12:18 2006 for SCT DAQ/DCS Software - Java by  doxygen 1.4.6