| android:layout_gravity="center" | android:layout_gravity="center" | ||||
| android:layout_margin="4dp" > | android:layout_margin="4dp" > | ||||
| <ch.spherIC.recurvebowsight.components.FontTextView | |||||
| android:id="@+id/arrowBowParmsLbl" | |||||
| android:layout_width="fill_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="right|center_vertical" | |||||
| android:gravity="right" | |||||
| android:lines="2" | |||||
| android:text="@string/bowParamsLbl" | |||||
| android:textColor="@color/black" | |||||
| app:font="@string/TitilliumWeb_Regular" /> | |||||
| <ch.spherIC.recurvebowsight.components.FontEditText | |||||
| android:id="@+id/hNAFld" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="40dp" | |||||
| android:layout_marginLeft="4dp" | |||||
| android:layout_weight="1" | |||||
| android:ems="10" | |||||
| android:gravity="center_vertical" | |||||
| android:inputType="numberDecimal" | |||||
| android:paddingBottom="9dp" | |||||
| android:paddingTop="9dp" | |||||
| android:selectAllOnFocus="true" | |||||
| android:textSize="18sp" | |||||
| android:nextFocusDown="@+id/nockRaisingFld" | |||||
| app:txtFont="@string/TitilliumWeb_Regular" /> | |||||
| <ch.spherIC.recurvebowsight.components.FontEditText | |||||
| android:id="@+id/nockRaisingFld" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="40dp" | |||||
| android:layout_marginLeft="4dp" | |||||
| android:layout_weight="1" | |||||
| android:ems="10" | |||||
| android:gravity="center_vertical" | |||||
| android:inputType="numberDecimal" | |||||
| android:paddingBottom="9dp" | |||||
| android:paddingTop="9dp" | |||||
| android:selectAllOnFocus="true" | |||||
| android:textSize="18sp" | |||||
| android:nextFocusDown="@+id/braceHeightFld" | |||||
| app:txtFont="@string/TitilliumWeb_Regular" /> | |||||
| <ch.spherIC.recurvebowsight.components.FontEditText | |||||
| android:id="@+id/braceHeightFld" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="40dp" | |||||
| android:layout_marginLeft="4dp" | |||||
| android:layout_weight="1" | |||||
| android:ems="10" | |||||
| android:gravity="center_vertical" | |||||
| android:inputType="numberDecimal" | |||||
| android:paddingBottom="9dp" | |||||
| android:paddingTop="9dp" | |||||
| android:selectAllOnFocus="true" | |||||
| android:textSize="18sp" | |||||
| android:nextFocusDown="@+id/airTemperatureTxtFld" | |||||
| app:txtFont="@string/TitilliumWeb_Regular" /> | |||||
| </TableRow> | |||||
| <TableRow | |||||
| android:id="@+id/tableRow7" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="center" | |||||
| android:layout_margin="4dp" > | |||||
| <ch.spherIC.recurvebowsight.components.FontTextView | <ch.spherIC.recurvebowsight.components.FontTextView | ||||
| android:id="@+id/atmosphericalParams" | android:id="@+id/atmosphericalParams" | ||||
| android:layout_width="fill_parent" | android:layout_width="fill_parent" | ||||
| </TableRow> | </TableRow> | ||||
| <TableRow | <TableRow | ||||
| android:id="@+id/tableRow7" | |||||
| android:id="@+id/tableRow8" | |||||
| android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:layout_gravity="center" | android:layout_gravity="center" |
| <string name="arrowV0Lbl">Pfeilanfangsgeschw. V0 [m/s]</string> | <string name="arrowV0Lbl">Pfeilanfangsgeschw. V0 [m/s]</string> | ||||
| <string name="bowPulloutLbl">Auszug Bogen [cm]</string> | <string name="bowPulloutLbl">Auszug Bogen [cm]</string> | ||||
| <string name="arrowWeightLbl">Gewicht Pfeil [g]</string> | <string name="arrowWeightLbl">Gewicht Pfeil [g]</string> | ||||
| <string name="bowParamsLbl">hNA / Überh. Nockpkt. /\nStandhöhe [mm]</string> | |||||
| <!-- --> | <!-- --> | ||||
| <string name="titleAtmosphericalParams">Atmosphärische Parameter</string> | <string name="titleAtmosphericalParams">Atmosphärische Parameter</string> | ||||
| <string name="airTemperatureLbl">Lufttemperatur [°Celsius]</string> | <string name="airTemperatureLbl">Lufttemperatur [°Celsius]</string> |
| <string name="arrowV0Lbl">Arrow initial velocity V0 [m/s]</string> | <string name="arrowV0Lbl">Arrow initial velocity V0 [m/s]</string> | ||||
| <string name="bowPulloutLbl">Bow Pullout [cm]</string> | <string name="bowPulloutLbl">Bow Pullout [cm]</string> | ||||
| <string name="arrowWeightLbl">Arrow Weight [g]</string> | <string name="arrowWeightLbl">Arrow Weight [g]</string> | ||||
| <string name="bowParamsLbl">hNA / Nock Raising /\nBrace Height [mm]</string> | |||||
| <!-- --> | <!-- --> | ||||
| <string name="titleAtmosphericalParams">Atmospherical Parameters</string> | <string name="titleAtmosphericalParams">Atmospherical Parameters</string> | ||||
| <string name="airTemperatureLbl">Air Temperatur [°Celsius]</string> | <string name="airTemperatureLbl">Air Temperatur [°Celsius]</string> |
| private TextView arrowWeightTxtFld; | private TextView arrowWeightTxtFld; | ||||
| private TextView bowPulloutTxtFld; | private TextView bowPulloutTxtFld; | ||||
| private TextView arrowV0TxtFld; | private TextView arrowV0TxtFld; | ||||
| private TextView hNATxtFld; | |||||
| private TextView nockRaisingTxtFld; | |||||
| private TextView braceHeightTxtFld; | |||||
| private TextView airTemperatureTxtFld; | private TextView airTemperatureTxtFld; | ||||
| private TextView airRelativeHumidityTxtFld; | private TextView airRelativeHumidityTxtFld; | ||||
| private TextView shootingDistanzTxtFld; | private TextView shootingDistanzTxtFld; | ||||
| this.arrowWeightTxtFld = (TextView) findViewById(R.id.arrowWeightTxtFld); | this.arrowWeightTxtFld = (TextView) findViewById(R.id.arrowWeightTxtFld); | ||||
| this.bowPulloutTxtFld = (TextView) findViewById(R.id.bowPulloutTxtFld); | this.bowPulloutTxtFld = (TextView) findViewById(R.id.bowPulloutTxtFld); | ||||
| this.arrowV0TxtFld = (TextView) findViewById(R.id.arrowV0TxtFld); | this.arrowV0TxtFld = (TextView) findViewById(R.id.arrowV0TxtFld); | ||||
| this.hNATxtFld = (TextView) findViewById(R.id.hNAFld); | |||||
| this.nockRaisingTxtFld = (TextView) findViewById(R.id.nockRaisingFld); | |||||
| this.braceHeightTxtFld = (TextView) findViewById(R.id.braceHeightFld); | |||||
| this.airTemperatureTxtFld = (TextView) findViewById(R.id.airTemperatureTxtFld); | this.airTemperatureTxtFld = (TextView) findViewById(R.id.airTemperatureTxtFld); | ||||
| this.airRelativeHumidityTxtFld = (TextView) findViewById(R.id.airRelativeHumidityTxtFld); | this.airRelativeHumidityTxtFld = (TextView) findViewById(R.id.airRelativeHumidityTxtFld); | ||||
| this.shootingDistanzTxtFld = (TextView) findViewById(R.id.shootingDistanzTxtFld); | this.shootingDistanzTxtFld = (TextView) findViewById(R.id.shootingDistanzTxtFld); | ||||
| this.arrowWeightTxtFld.setText(DF.format(archerySetup.getArrowWeight())); | this.arrowWeightTxtFld.setText(DF.format(archerySetup.getArrowWeight())); | ||||
| this.bowPulloutTxtFld.setText(DF.format(archerySetup.getBowPullout())); | this.bowPulloutTxtFld.setText(DF.format(archerySetup.getBowPullout())); | ||||
| this.arrowV0TxtFld.setText(DF.format(archerySetup.getArrowV0())); | this.arrowV0TxtFld.setText(DF.format(archerySetup.getArrowV0())); | ||||
| this.hNATxtFld.setText(DF.format(archerySetup.getHNA())); | |||||
| this.nockRaisingTxtFld.setText(DF.format(archerySetup.getNockRaising())); | |||||
| this.braceHeightTxtFld.setText(DF.format(archerySetup.getBraceHeight())); | |||||
| this.arrowNockHeightTxtFld.setText(DF_1.format(archerySetup.getArrowNockHeight())); | this.arrowNockHeightTxtFld.setText(DF_1.format(archerySetup.getArrowNockHeight())); | ||||
| this.targetCenterHeightTxtFld.setText(DF_1.format(archerySetup.getArrowCenterHeight())); | this.targetCenterHeightTxtFld.setText(DF_1.format(archerySetup.getArrowCenterHeight())); | ||||
| this.calcTimeIntervalCboBox.setSelectionByVal(archerySetup.getDeltaTime().toString()); | this.calcTimeIntervalCboBox.setSelectionByVal(archerySetup.getDeltaTime().toString()); | ||||
| this.arrowWeightTxtFld.setText(""); | this.arrowWeightTxtFld.setText(""); | ||||
| this.bowPulloutTxtFld.setText(""); | this.bowPulloutTxtFld.setText(""); | ||||
| this.arrowV0TxtFld.setText(""); | this.arrowV0TxtFld.setText(""); | ||||
| this.hNATxtFld.setText(""); | |||||
| this.nockRaisingTxtFld.setText(""); | |||||
| this.braceHeightTxtFld.setText(""); | |||||
| this.arrowNockHeightTxtFld.setText(""); | this.arrowNockHeightTxtFld.setText(""); | ||||
| this.targetCenterHeightTxtFld.setText(""); | this.targetCenterHeightTxtFld.setText(""); | ||||
| this.calcTimeIntervalCboBox.setSelectionByVal(""); | this.calcTimeIntervalCboBox.setSelectionByVal(""); | ||||
| && !this.arrowWeightTxtFld.getText().toString().isEmpty() | && !this.arrowWeightTxtFld.getText().toString().isEmpty() | ||||
| && !this.bowPulloutTxtFld.getText().toString().isEmpty() | && !this.bowPulloutTxtFld.getText().toString().isEmpty() | ||||
| && !this.arrowV0TxtFld.getText().toString().isEmpty() | && !this.arrowV0TxtFld.getText().toString().isEmpty() | ||||
| && !this.hNATxtFld.getText().toString().isEmpty() | |||||
| && !this.nockRaisingTxtFld.getText().toString().isEmpty() | |||||
| && !this.braceHeightTxtFld.getText().toString().isEmpty() | |||||
| && !this.airTemperatureTxtFld.getText().toString().isEmpty() | && !this.airTemperatureTxtFld.getText().toString().isEmpty() | ||||
| && !this.airRelativeHumidityTxtFld.getText().toString().isEmpty() | && !this.airRelativeHumidityTxtFld.getText().toString().isEmpty() | ||||
| && !this.shootingDistanzTxtFld.getText().toString().isEmpty() | && !this.shootingDistanzTxtFld.getText().toString().isEmpty() | ||||
| Double a = Double.valueOf(this.bowPulloutTxtFld.getText().toString()) * 10; | Double a = Double.valueOf(this.bowPulloutTxtFld.getText().toString()) * 10; | ||||
| Double heVs = this.scHeVSSpinner.getVisibility() == View.VISIBLE ? Double.valueOf(this.scHeVSSpinner.getSelectedItem().toString()) | Double heVs = this.scHeVSSpinner.getVisibility() == View.VISIBLE ? Double.valueOf(this.scHeVSSpinner.getSelectedItem().toString()) | ||||
| : Double.valueOf(this.scHeVSTxtFld.getText().toString()); | : Double.valueOf(this.scHeVSTxtFld.getText().toString()); | ||||
| Double lhNA = this.selectedArcherySetup.getHNA() * 10; | |||||
| Double lhNA = this.selectedArcherySetup.getHNA(); | |||||
| Double dltH = (Double.valueOf(this.targetCenterHeightTxtFld.getText().toString()) | Double dltH = (Double.valueOf(this.targetCenterHeightTxtFld.getText().toString()) | ||||
| - Double.valueOf(this.arrowNockHeightTxtFld.getText().toString())) * Math.pow(10, 3); | - Double.valueOf(this.arrowNockHeightTxtFld.getText().toString())) * Math.pow(10, 3); | ||||
| Double ldistH = Double.valueOf(this.shootingDistanzTxtFld.getText().toString()) * Math.pow(10, 3); | Double ldistH = Double.valueOf(this.shootingDistanzTxtFld.getText().toString()) * Math.pow(10, 3); | ||||
| .indexOf('-') + 1, | .indexOf('-') + 1, | ||||
| this.scVertScaleRngTxtFld.getText().toString() | this.scVertScaleRngTxtFld.getText().toString() | ||||
| .length())) : 0d; | .length())) : 0d; | ||||
| Double nockRaising = Double.valueOf(this.nockRaisingTxtFld.getText().toString()) | |||||
| - Double.valueOf(this.arrowDiameterTxtFld.getText().toString()); | |||||
| Double braceHeight = Double.valueOf(this.braceHeightTxtFld.getText().toString()); | |||||
| Double phi = -Math.atan(nockRaising / braceHeight); // Winkel des Pfeils zur Auflage infolge Nockpunktüberhöhung | |||||
| // PIN auf Höhe UK Vertikalskala Visier, gedreht um den Abschusswinkel... | |||||
| Double x01 = a * Math.cos(phi) + vVh + heVs; | |||||
| Double y01 = a * Math.sin(phi) + vVv - maxSkala / 2; | |||||
| x0 = Math.cos(Math.toRadians(this.startAngle)) * x01 - Math.sin(Math.toRadians(this.startAngle)) * y01; | |||||
| y0 = Math.sin(Math.toRadians(this.startAngle)) * x01 + Math.cos(Math.toRadians(this.startAngle)) * y01; | |||||
| // PIN auf Höhe Horizontalschlitten Visier, gedreht um den Abschusswinkel... | |||||
| Double x02 = a * Math.cos(phi) + vVh + heVs; | |||||
| Double y02 = a * Math.sin(phi) + vVv; | |||||
| x2 = Math.cos(Math.toRadians(this.startAngle)) * x02 - Math.sin(Math.toRadians(this.startAngle)) * y02; | |||||
| y2 = Math.sin(Math.toRadians(this.startAngle)) * x02 + Math.cos(Math.toRadians(this.startAngle)) * y02; | |||||
| // Schnittpunkt der Achse Horizontalschlitten Visier mit Achse Befestigungslöcher Visier, gedreht um den Abschusswinkel... | |||||
| Double x03 = a * Math.cos(phi) + vVh; | |||||
| Double y03 = a * Math.sin(phi) + vVv; | |||||
| x3 = Math.cos(Math.toRadians(this.startAngle)) * x03 - Math.sin(Math.toRadians(this.startAngle)) * y03; | |||||
| y3 = Math.sin(Math.toRadians(this.startAngle)) * x03 + Math.cos(Math.toRadians(this.startAngle)) * y03; | |||||
| // PIN auf Höhe Pfeil | |||||
| x0 = (a + vVh + heVs) * Math.cos(Math.toRadians(this.startAngle)); | |||||
| y0 = (a + vVh + heVs) * Math.sin(Math.toRadians(this.startAngle)); | |||||
| // PIN auf Höhe Horizontalschlitten Visier | |||||
| x2 = x0 + vVv * Math.cos(Math.toRadians(ANGLE_90 + this.startAngle)); | |||||
| y2 = y0 + vVv * Math.sin(Math.toRadians(ANGLE_90 + this.startAngle)); | |||||
| // Schnittpunkt der Achse Horizontalschlitten Visier mit Achse Befestigungslöcher Visier | |||||
| x3 = (a + vVh) * Math.cos(Math.toRadians(this.startAngle)) + vVv * Math.cos(Math.toRadians(ANGLE_90 + this.startAngle)); | |||||
| y3 = (a + vVh) * Math.sin(Math.toRadians(this.startAngle)) + vVv * Math.sin(Math.toRadians(ANGLE_90 + this.startAngle)); | |||||
| // Unbekannte der Vektorgeradengleichung | // Unbekannte der Vektorgeradengleichung | ||||
| r = (lhNA * (x0 - x2) - x0 * y2 + x2 * y0) / (ldistH * (y0 - y2) + (dltH - lhNA) * (x2 - x0)); | r = (lhNA * (x0 - x2) - x0 * y2 + x2 * y0) / (ldistH * (y0 - y2) + (dltH - lhNA) * (x2 - x0)); |
| List<ISight> sights = SightDao.getInstance().loadAll(); | List<ISight> sights = SightDao.getInstance().loadAll(); | ||||
| List<IRiser> risers = RiserDao.getInstance().loadAll(); | List<IRiser> risers = RiserDao.getInstance().loadAll(); | ||||
| this.asSightSpinner.setAdapter(new FontArrayAdapter<ISight>(this, R.layout.rbs_spinner, sights, | |||||
| this.asSightSpinner)); | |||||
| this.asRiserSpinner.setAdapter(new FontArrayAdapter<IRiser>(this, R.layout.rbs_spinner, risers, | |||||
| this.asRiserSpinner)); | |||||
| this.asSightSpinner.setAdapter(new FontArrayAdapter<ISight>(this, R.layout.rbs_spinner, sights, this.asSightSpinner)); | |||||
| this.asRiserSpinner.setAdapter(new FontArrayAdapter<IRiser>(this, R.layout.rbs_spinner, risers, this.asRiserSpinner)); | |||||
| } | } | ||||
| private void loadArcherySetupSpinner() { | private void loadArcherySetupSpinner() { | ||||
| List<IArcherySetup> archerySetups = ArcherySetupDao.getInstance().loadAll(); | List<IArcherySetup> archerySetups = ArcherySetupDao.getInstance().loadAll(); | ||||
| this.asArcherySetupSpinner.setAdapter(new FontArrayAdapter<IArcherySetup>(this, R.layout.rbs_spinner, | |||||
| archerySetups, | |||||
| this.asArcherySetupSpinner.setAdapter(new FontArrayAdapter<IArcherySetup>(this, R.layout.rbs_spinner, archerySetups, | |||||
| this.asArcherySetupSpinner)); | this.asArcherySetupSpinner)); | ||||
| } | } | ||||
| */ | */ | ||||
| @SuppressWarnings("unchecked") | @SuppressWarnings("unchecked") | ||||
| protected void onNewArcherySetup() { | protected void onNewArcherySetup() { | ||||
| IArcherySetup newArcherySetup = new ArcherySetup(0, "*", null, null, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, | |||||
| 0d); | |||||
| IArcherySetup newArcherySetup = new ArcherySetup(0, "*", null, null, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d, 0d); | |||||
| this.selectedArcherySetup = newArcherySetup; | this.selectedArcherySetup = newArcherySetup; | ||||
| ((FontArrayAdapter<IArcherySetup>) this.asArcherySetupSpinner.getAdapter()).add(newArcherySetup); | ((FontArrayAdapter<IArcherySetup>) this.asArcherySetupSpinner.getAdapter()).add(newArcherySetup); | ||||
| this.asArcherySetupSpinner.setSelectionByVal(newArcherySetup.getName()); | this.asArcherySetupSpinner.setSelectionByVal(newArcherySetup.getName()); | ||||
| this.asCalcPrecisionTxtFld.setText(""); | this.asCalcPrecisionTxtFld.setText(""); | ||||
| this.asSightVertScaleMiddleTxtFld.setText(""); | this.asSightVertScaleMiddleTxtFld.setText(""); | ||||
| this.asSightHorzSettingTxtFld.setText(""); | this.asSightHorzSettingTxtFld.setText(""); | ||||
| } | } | ||||
| @Override | @Override |
| List<ISight> sights = new ArrayList<ISight>(); | List<ISight> sights = new ArrayList<ISight>(); | ||||
| sights.add(new Sight(0, "Avalon", "Tec One", 17.5, -12d, "260,250,240,230,220,210,200,190,180,170,160", 0d, 110d)); | |||||
| sights.add(new Sight(0, "Avalon", "Tec One", 17.5, -12d, "260,250,240,230,220,210,200,190,180,170,160", 5d, 105d)); | |||||
| return sights; | return sights; | ||||
| } | } | ||||
| private IArcherySetup getArcherySetupMasterData() { | private IArcherySetup getArcherySetupMasterData() { | ||||
| return new ArcherySetup(0, "FITA Indoor FS", null, null, 5.8, 3.10, 21d, 57.60, 1.30, 71d, 1.57, 14.5, 0.001, 0.1, 55d, 260d); | |||||
| return new ArcherySetup(0, "FITA Indoor FS", null, null, 5.8, 3.10, 21d, 57.60, 1.30, 71d, 1.57, 135d, 0.001, 0.1, 55d, 260d, 11d, 195d); | |||||
| } | } | ||||
| } | } |
| IArcherySetup archerySetup = new ArcherySetup(cursor.getLong(0), cursor.getString(1), sight, riser, cursor.getDouble(4), // | IArcherySetup archerySetup = new ArcherySetup(cursor.getLong(0), cursor.getString(1), sight, riser, cursor.getDouble(4), // | ||||
| cursor.getDouble(5), cursor.getDouble(6), cursor.getDouble(7), cursor.getDouble(8), | cursor.getDouble(5), cursor.getDouble(6), cursor.getDouble(7), cursor.getDouble(8), | ||||
| cursor.getDouble(9), cursor.getDouble(10), cursor.getDouble(11), cursor.getDouble(12), | cursor.getDouble(9), cursor.getDouble(10), cursor.getDouble(11), cursor.getDouble(12), | ||||
| cursor.getDouble(13), cursor.getDouble(14), cursor.getDouble(15)); | |||||
| cursor.getDouble(13), cursor.getDouble(14), cursor.getDouble(15), cursor.getDouble(16), | |||||
| cursor.getDouble(17)); | |||||
| return archerySetup; | return archerySetup; | ||||
| } | } | ||||
| values.put(TblRBSArcherySetup.COL_CALCPRECISION, entity.getCalcPrecision() != null ? entity.getCalcPrecision() : 0d); | values.put(TblRBSArcherySetup.COL_CALCPRECISION, entity.getCalcPrecision() != null ? entity.getCalcPrecision() : 0d); | ||||
| values.put(TblRBSArcherySetup.COL_SIGHTVERTSKALAMIDDLE, entity.getSightVertSkalaMiddle() != null ? entity.getSightVertSkalaMiddle() : 0d); | values.put(TblRBSArcherySetup.COL_SIGHTVERTSKALAMIDDLE, entity.getSightVertSkalaMiddle() != null ? entity.getSightVertSkalaMiddle() : 0d); | ||||
| values.put(TblRBSArcherySetup.COL_SIGHTHORSETTING, entity.getSightHorzSetting() != null ? entity.getSightHorzSetting() : 0d); | values.put(TblRBSArcherySetup.COL_SIGHTHORSETTING, entity.getSightHorzSetting() != null ? entity.getSightHorzSetting() : 0d); | ||||
| values.put(TblRBSArcherySetup.COL_NOCKRAISING, entity.getNockRaising() != null ? entity.getNockRaising() : 0d); | |||||
| values.put(TblRBSArcherySetup.COL_BRACEHEIGHT, entity.getBraceHeight() != null ? entity.getBraceHeight() : 0d); | |||||
| return values; | return values; | ||||
| } | } |
| public static final String COL_CALCPRECISION = "ARCHERYSETUP_CALCPRECISION"; | public static final String COL_CALCPRECISION = "ARCHERYSETUP_CALCPRECISION"; | ||||
| public static final String COL_SIGHTVERTSKALAMIDDLE = "ARCHERYSETUP_SIGHTVERTSKALAMIDDLE"; | public static final String COL_SIGHTVERTSKALAMIDDLE = "ARCHERYSETUP_SIGHTVERTSKALAMIDDLE"; | ||||
| public static final String COL_SIGHTHORSETTING = "ARCHERYSETUP_SIGHTHORSETTING"; | public static final String COL_SIGHTHORSETTING = "ARCHERYSETUP_SIGHTHORSETTING"; | ||||
| public static final String COL_NOCKRAISING = "ARCHERYSETUP_NOCKRAISING"; | |||||
| public static final String COL_BRACEHEIGHT = "ARCHERYSETUP_BRACEHEIGHT"; | |||||
| private TblRBSArcherySetup() { } | private TblRBSArcherySetup() { } | ||||
| + COL_CALCPRECISION + " Real NOT NULL, " | + COL_CALCPRECISION + " Real NOT NULL, " | ||||
| + COL_SIGHTVERTSKALAMIDDLE + " Real NOT NULL, " | + COL_SIGHTVERTSKALAMIDDLE + " Real NOT NULL, " | ||||
| + COL_SIGHTHORSETTING + " Real NOT NULL, " | + COL_SIGHTHORSETTING + " Real NOT NULL, " | ||||
| + COL_NOCKRAISING + " Real NOT NULL, " | |||||
| + COL_BRACEHEIGHT + " Real NOT NULL, " | |||||
| + "constraint UNIQUE_ARCHERYSETUP_NAME UNIQUE (" + COL_NAME + "), " | + "constraint UNIQUE_ARCHERYSETUP_NAME UNIQUE (" + COL_NAME + "), " | ||||
| + "constraint UNIQUE_ARCHERYSETUP_SIGHT_RISER UNIQUE (" + COL_SIGHT + "," + COL_RISER + ")," | + "constraint UNIQUE_ARCHERYSETUP_SIGHT_RISER UNIQUE (" + COL_SIGHT + "," + COL_RISER + ")," | ||||
| + "FOREIGN KEY(" + COL_SIGHT + ") REFERENCES RBS_SIGHT (" + TblRBSSight.COL_ID + "), " | + "FOREIGN KEY(" + COL_SIGHT + ") REFERENCES RBS_SIGHT (" + TblRBSSight.COL_ID + "), " |
| List<IArcherySetup> setups = new ArrayList<IArcherySetup>(); | List<IArcherySetup> setups = new ArrayList<IArcherySetup>(); | ||||
| this.archerySetup = null; | this.archerySetup = null; | ||||
| setups.add(new ArcherySetup(-999, "", null, null, null, null, null, null, null, null, null, null, null, null, null, null)); | |||||
| setups.add(new ArcherySetup(-999, "", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null)); | |||||
| setups.addAll(ArcherySetupDao.getInstance().loadAll()); | setups.addAll(ArcherySetupDao.getInstance().loadAll()); | ||||
| listView.setAdapter(new ArcerySetupArrayAdapter(getContext(), R.layout.rbs_archerysetup_item, setups)); | listView.setAdapter(new ArcerySetupArrayAdapter(getContext(), R.layout.rbs_archerysetup_item, setups)); |
| private Double deltaTime; | private Double deltaTime; | ||||
| private Double calcPrecision; | private Double calcPrecision; | ||||
| private Double sightVertSkalaMiddle; | private Double sightVertSkalaMiddle; | ||||
| private Double sightHorSetting; | |||||
| private Double sightHorzSetting; | |||||
| private Double nockRaising; | |||||
| private Double braceHeight; | |||||
| /** | /** | ||||
| * Konstruktor. | * Konstruktor. | ||||
| * @param calcPrecision | * @param calcPrecision | ||||
| * @param sightVertSkalaMiddle | * @param sightVertSkalaMiddle | ||||
| * @param sightHorSetting | * @param sightHorSetting | ||||
| * @param nockRaising | |||||
| * @param braceHeight | |||||
| */ | */ | ||||
| public ArcherySetup(final long id, final String name, final ISight sight, final IRiser riser, | public ArcherySetup(final long id, final String name, final ISight sight, final IRiser riser, | ||||
| final Double arrowDiameter, final Double arrowCw, final Double arrowWeight, | final Double arrowDiameter, final Double arrowCw, final Double arrowWeight, | ||||
| final Double arrowV0, final Double arrowCenterHeight, final Double bowPullout, | final Double arrowV0, final Double arrowCenterHeight, final Double bowPullout, | ||||
| final Double arrowNockHeight, final Double hNA, final Double deltaTime, | final Double arrowNockHeight, final Double hNA, final Double deltaTime, | ||||
| final Double calcPrecision, final Double sightVertSkalaMiddle, | final Double calcPrecision, final Double sightVertSkalaMiddle, | ||||
| final Double sightHorSetting) { | |||||
| final Double sightHorSetting, final Double nockRaising, final Double braceHeight) { | |||||
| super(); | super(); | ||||
| this.id = id; | this.id = id; | ||||
| this.name = name; | this.name = name; | ||||
| this.deltaTime = deltaTime; | this.deltaTime = deltaTime; | ||||
| this.calcPrecision = calcPrecision; | this.calcPrecision = calcPrecision; | ||||
| this.sightVertSkalaMiddle = sightVertSkalaMiddle; | this.sightVertSkalaMiddle = sightVertSkalaMiddle; | ||||
| this.sightHorSetting = sightHorSetting; | |||||
| this.sightHorzSetting = sightHorSetting; | |||||
| this.nockRaising = nockRaising; | |||||
| this.braceHeight = braceHeight; | |||||
| } | } | ||||
| /** | /** | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Double getSightHorzSetting() { | public Double getSightHorzSetting() { | ||||
| return this.sightHorSetting; | |||||
| return this.sightHorzSetting; | |||||
| } | } | ||||
| /** | /** | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setSightHorzSetting(final Double sightHorSetting) { | public void setSightHorzSetting(final Double sightHorSetting) { | ||||
| this.sightHorSetting = sightHorSetting; | |||||
| this.sightHorzSetting = sightHorSetting; | |||||
| } | } | ||||
| @Override | @Override | ||||
| public String toString() { | public String toString() { | ||||
| return getName(); | return getName(); | ||||
| } | } | ||||
| @Override | |||||
| public Double getNockRaising() { | |||||
| return this.nockRaising; | |||||
| } | |||||
| @Override | |||||
| public void setNockRaising(final Double nockRaising) { | |||||
| this.nockRaising = nockRaising; | |||||
| } | |||||
| @Override | |||||
| public Double getBraceHeight() { | |||||
| return this.braceHeight; | |||||
| } | |||||
| @Override | |||||
| public void setBraceHeight(final Double braceHeight) { | |||||
| this.braceHeight = braceHeight; | |||||
| } | |||||
| } | } |
| String getName(); | String getName(); | ||||
| void setName(String name); | void setName(String name); | ||||
| Double getNockRaising(); | |||||
| void setNockRaising(Double nockRaising); | |||||
| Double getBraceHeight(); | |||||
| void setBraceHeight(Double braceHeight); | |||||
| } | } |