|
From: <and...@us...> - 2017-06-19 18:10:41
|
Revision: 1457
http://sourceforge.net/p/ggc/code/1457
Author: andyrozman
Date: 2017-06-19 18:10:37 +0000 (Mon, 19 Jun 2017)
Log Message:
-----------
0.8.0
- added few enums
- fixed configuration
- fixed Hibernate classes (and hbm configuration)
- added classes for DbTool integration
- refactoring database
- moved classes to different package (from shared)
Modified Paths:
--------------
trunk/ggc-core-app/ggc-core/docs/Changelog
trunk/ggc-core-app/ggc-core/pom.xml
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/CollectionValues.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyValues.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyValuesRow.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/ExtendedRatioCollection.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/GlucoValues.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigCellRenderer.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigurationManager.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigurationManagerWrapper.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/GlucoseUnitType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/StockTypeBase.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/graph/v1/GGCGraphUtil.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/graph/v1/gui/HbA1cDialog.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/graph/v1/view/GraphViewCourse.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/graph/v1/view/GraphViewDaily.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/GGCDb.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/GGCDbConfig.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/GGCDbLoader.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/DailyValue.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/Settings.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/SettingsColorScheme.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/StockBaseType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/StockSubType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/DbInfoH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/StockH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/StockSubTypeH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/cgms/CGMSDataExtendedH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/cgms/CGMSDataH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/doc/DoctorAppointmentH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/doc/DoctorH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/doc/DoctorTypeH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/food/FoodDescriptionH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/food/FoodGroupH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/food/FoodUserDescriptionH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/food/FoodUserGroupH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/food/MealGroupH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/food/MealH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/food/NutritionDefinitionH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/food/NutritionHomeWeightTypeH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/inet/InetGroupH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/inet/InetLinkGroupH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/inet/InetLinkH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/inet/InetTypeH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/pump/PumpDataExtendedH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/pump/PumpDataH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/pump/PumpProfileH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/DbToolApplicationGGC.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/InitDb.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/data/GGCDatabaseTableConfiguration.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/data/GGCDatabaseVersionConfiguration.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/defs/GGCImportExportContext.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/impexp/GGCDbExportConverter.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/impexp/GGCDbImportConverter.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/impexp/GGCDbImporter.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/init/GGCCustomDbInitTasks.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/init/GGCDbToolInitDbRunner.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/init/InitDb2.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ExportDailyValues.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ExportNutritionDb.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ExportSettings.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/GGCBackupRestoreRunner.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/GGCExporter.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/GGCImporter.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ImportDailyValues.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ImportNutrition.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ImportSettings.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/RestoreGGCDialog.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/plugins/CGMSPlugIn.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/plugins/ConnectPlugIn.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/plugins/GGCDataWriter.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/plugins/GGCPluginClient.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/plugins/GGCPluginType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/plugins/MetersPlugIn.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/plugins/NutriPlugIn.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/plugins/PumpsPlugIn.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/test/ImportDacioDb.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/util/DataAccess.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/util/GGCProperties.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/util/GGCSoftwareMode.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/util/upgrade/GGCUpgradeApplicationContext.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/util/upgrade/UpgradeChecker.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/bolushelper/BolusHelper.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/fooddesc/FoodDescriptionDialog.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/ratio/RatioBaseDialog.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/ratio/RatioCalculatorDialog.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/ratio/RatioEntry.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/ratio/RatioEntryDialog.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/ratio/RatioEntryDisplay.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/ratio/RatioEntryPanel.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/ratio/RatioExtendedDialog.java
trunk/ggc-core-app/ggc-core/src/main/resources/GGC_CGMS.hbm.xml
trunk/ggc-core-app/ggc-core/src/main/resources/GGC_Main.hbm.xml
trunk/ggc-core-app/ggc-core/src/main/resources/GGC_New.hbm.xml
trunk/ggc-core-app/ggc-core/src/main/resources/GGC_Nutrition.hbm.xml
trunk/ggc-core-app/ggc-core/src/main/resources/GGC_Other.hbm.xml
trunk/ggc-core-app/ggc-core/src/main/resources/GGC_Pump.hbm.xml
trunk/ggc-core-app/ggc-core/src/main/resources/GGC_en.properties
Added Paths:
-----------
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DataValuesInterface.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/DatabaseStatusType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/GGCObservableType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryGroupType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryItemUnit.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryItemUsageUnit.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/RefreshInfoType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/ReturnActionType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/GGCDataTransformer.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/dto/StockSubTypeDto.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/GGCDataDefinitionTable.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/GGCHibernateBackupSelectableObject.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/GGCHibernateSelectableObject.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/inventory/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/inventory/InventoryH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/inventory/InventoryItemH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/inventory/InventoryItemTypeH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/pen/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/pen/DayValueH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/settings/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/settings/ColorSchemeH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/settings/SettingsH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/enums/GGCFunctionality.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/enums/GGCInternalSettings.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/enums/PropertiesDialogType.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/gui/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/gui/GGCGuiHelper.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/gui/UserManagement.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/gui/dialogs/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/gui/dialogs/selector/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/util/inventory/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/util/inventory/InventoryUtil.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/Important.txt
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/bolushelper/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/fooddesc/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/ratio/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/selector/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/selector/GGCSelectorConfiguration.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/selector/GGCSelectorDialog.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/selector/GGCSelectorType.java
trunk/ggc-core-app/ggc-core/src/main/templates/
trunk/ggc-core-app/ggc-core/src/main/templates/Version.java.template
trunk/ggc-core-app/ggc-core/src/test/
trunk/ggc-core-app/ggc-core/src/test/java/
trunk/ggc-core-app/ggc-core/src/test/java/ggc/
trunk/ggc-core-app/ggc-core/src/test/java/ggc/misc/
trunk/ggc-core-app/ggc-core/src/test/java/ggc/misc/Test.java
trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/
trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/core/
trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/core/doc/
trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/core/doc/util/
trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/core/doc/util/DataAccessDoc.java
Removed Paths:
-------------
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/StockUsageUnit.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/doc/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/ColorSchemeH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/DayValueH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/SettingsH.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/stocks/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/impexp/DbImportExportDto.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/impexp/GGCDbExporter.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/doc/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/shared/Test.java
trunk/ggc-core-app/ggc-core/src/main/java/ggc/shared/bolushelper/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/shared/fooddesc/
trunk/ggc-core-app/ggc-core/src/main/java/ggc/shared/ratio/
trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/DoctorTypeSelector.java
Property Changed:
----------------
trunk/ggc-core-app/
Index: trunk/ggc-core-app
===================================================================
--- trunk/ggc-core-app 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app 2017-06-19 18:10:37 UTC (rev 1457)
Property changes on: trunk/ggc-core-app
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+*.iml
Modified: trunk/ggc-core-app/ggc-core/docs/Changelog
===================================================================
--- trunk/ggc-core-app/ggc-core/docs/Changelog 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/docs/Changelog 2017-06-19 18:10:37 UTC (rev 1457)
@@ -6,6 +6,15 @@
--------------------------------------------------------------------------------------------------
+0.8 [19.6.2017] [Andy]
+- added few enums
+- fixed configuration
+- fixed Hibernate classes (and hbm configuration)
+- added classes for DbTool integration
+- refactoring database
+- moved classes to different package (from shared)
+
+
0.7 [18.5.2016] [Andy]
- started implementation of graph v2
- fixing graph v1 and extending it to be used by pump also
Modified: trunk/ggc-core-app/ggc-core/pom.xml
===================================================================
--- trunk/ggc-core-app/ggc-core/pom.xml 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/pom.xml 2017-06-19 18:10:37 UTC (rev 1457)
@@ -14,6 +14,36 @@
<artifactId>ggc-core</artifactId>
<version>${ggc-core.version}</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>maven-replacer-plugin</artifactId>
+ </plugin>
+
+ <!--
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources/ggc/core/util/</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin> -->
+ </plugins>
+ </build>
+
+
<dependencies>
<dependency>
<groupId>com.atech-software</groupId>
@@ -102,6 +132,12 @@
<version>8.4-702.jdbc3</version>
</dependency>
+ </dependencies>
- </dependencies>
+ <properties>
+ <version.file>
+ ${project.build.directory}/generated-sources/ggc/core/util/Version.java
+ </version.file>
+ </properties>
+
</project>
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/CollectionValues.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/CollectionValues.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/CollectionValues.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -1,12 +1,13 @@
package ggc.core.data;
-import ggc.core.util.DataAccess;
-
import java.util.ArrayList;
import java.util.GregorianCalendar;
+import java.util.List;
import com.atech.utils.data.ATechDate;
+import ggc.core.util.DataAccess;
+
/**
* Application: GGC - GNU Gluco Control
*
@@ -39,12 +40,12 @@
{
// private boolean debug = false;
- // private I18nControlAbstract m_ic =
+ // private I18nControlAbstract i18nControl =
// DataAccess.getInstance().getI18nControlInstance();
private static final long serialVersionUID = 4415864395080066275L;
- ArrayList<DailyValuesRow> dataRows = new ArrayList<DailyValuesRow>();
+ List<DailyValuesRow> dataRows = new ArrayList<DailyValuesRow>();
long date = 0;
@@ -71,6 +72,7 @@
DataAccess m_da = DataAccess.getInstance();
+
// Hashtable<String,ArrayList>
/**
@@ -85,6 +87,7 @@
setDayRange(sDay, eDay);
}
+
/**
* Set Day Range
*
@@ -95,7 +98,7 @@
{
// long diff = eDay.getTimeInMillis() - sDay.getTimeInMillis();
- ArrayList<DailyValuesRow> lst = DataAccess.getInstance().getDb().getDayValuesRange(sDay, eDay);
+ List<DailyValuesRow> lst = DataAccess.getInstance().getDb().getDayValuesRange(sDay, eDay);
for (int i = 0; i < lst.size(); i++)
{
@@ -104,6 +107,7 @@
}
+
/**
* Reset Changed
*/
@@ -113,6 +117,7 @@
changed = false;
}
+
/**
* Set Date
*
@@ -124,6 +129,7 @@
this.date = date;
}
+
/**
* Set Std Dev
* @param stdDev
@@ -134,6 +140,7 @@
this.stdDev = stdDev;
}
+
/**
* Add Row
*
@@ -149,6 +156,7 @@
refreshStatData();
}
+
/**
* Delete Row
* @param i
@@ -181,6 +189,7 @@
}
+
/**
* Get Row Count
*
@@ -195,6 +204,7 @@
return dataRows.size();
}
+
/**
* Get Row
*
@@ -207,6 +217,7 @@
return this.dataRows.get(index);
}
+
/**
* Get Value At
*
@@ -220,6 +231,7 @@
return getRow(row).getValueAt(column);
}
+
/**
* Get Day And Month As String
*
@@ -234,6 +246,7 @@
return String.format("%1$02d.%2$02d.", day, month);
}
+
/**
* Get Date
*
@@ -245,6 +258,7 @@
return date;
}
+
/**
* Get Date As Localized String
*
@@ -262,6 +276,7 @@
new ATechDate(ATechDate.FORMAT_DATE_AND_TIME_MIN, this.date).getGregorianCalendar(), 4);
}
+
/**
* Get Date As String
*
@@ -273,6 +288,7 @@
return getDateAsLocalizedString();
}
+
/**
* Get Changed
*
@@ -285,6 +301,7 @@
return getRow(row).hasChanged();
}
+
/**
* Get Sum CH Per Day
*
@@ -298,6 +315,7 @@
return this.getSumCH() / this.day_count.size();
}
+
/**
* Get CH Count Per Day
*
@@ -311,6 +329,7 @@
return this.getCHCount() / this.day_count.size();
}
+
/**
* Get Sum Bolus Per Day
*
@@ -324,6 +343,7 @@
return this.getSumBolus() / this.day_count.size();
}
+
/**
* Get Bolus Count Per Day
*
@@ -337,6 +357,7 @@
return this.getBolusCount() / this.day_count.size();
}
+
/**
* Get Sum Basal Per Day
*
@@ -350,6 +371,7 @@
return this.getSumBasal() / this.day_count.size();
}
+
/**
* Get Basal Count Per Day
*
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyValues.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyValues.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyValues.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -9,7 +9,7 @@
import com.atech.utils.data.ATechDate;
import ggc.core.data.defs.GlucoseUnitType;
-import ggc.core.db.hibernate.DayValueH;
+import ggc.core.db.hibernate.pen.DayValueH;
import ggc.core.util.DataAccess;
/**
@@ -40,7 +40,7 @@
* @author Andy {an...@at...}
*/
-public class DailyValues implements Serializable
+public class DailyValues implements Serializable, DataValuesInterface
{
private static final long serialVersionUID = -375771912636631298L;
@@ -434,6 +434,18 @@
}
+ public Class<?> getColumnClass(int row)
+ {
+ return String.class;
+ }
+
+
+ public boolean isCellEditable(int row, int col)
+ {
+ return false;
+ }
+
+
/**
* Get Average BG Raw (mg/dL)
*
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyValuesRow.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyValuesRow.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyValuesRow.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -17,7 +17,7 @@
import ggc.core.data.cfg.ConfigurationManagerWrapper;
import ggc.core.data.defs.GlucoseUnitType;
-import ggc.core.db.hibernate.DayValueH;
+import ggc.core.db.hibernate.pen.DayValueH;
import ggc.core.util.DataAccess;
/**
@@ -76,10 +76,10 @@
private boolean changed = false;
DayValueH m_dv = null;
- DataAccess m_da = DataAccess.getInstance();
+ DataAccess dataAccess = DataAccess.getInstance();
// GGCProperties props = dataAccess.getSettings();
- ConfigurationManagerWrapper configurationManagerWrapper = m_da.getConfigurationManagerWrapper();
+ ConfigurationManagerWrapper configurationManagerWrapper = dataAccess.getConfigurationManagerWrapper();
boolean debug = false;
ExtendedEnumHandler extendedHandler = null;
@@ -130,12 +130,12 @@
public DailyValuesRow(DayValueH dv)
{
- this.datetime = new ATechDate(ATechDateType.DateAndTimeMin, dv.getDt_info());
+ this.datetime = new ATechDate(ATechDateType.DateAndTimeMin, dv.getDtInfo());
this.bg = dv.getBg();
this.ins1 = dv.getIns1();
this.ins2 = dv.getIns2();
this.ch = dv.getCh();
- this.meals = dv.getMeals_ids();
+ this.meals = dv.getMealsIds();
this.extended = dv.getExtended();
this.comment = dv.getComment();
@@ -160,7 +160,7 @@
// this.setExtendedValue(ExtendedDailyValueType.Activity, act, false);
// this.setExtendedValue(ExtendedDailyValueType.Urine, urine, false);
//
- // // this.meals = dv.getMeals_ids();
+ // // this.meals = dv.getMealsIds();
// // this.extended = dv.getExtended();
// this.comment = Comment;
//
@@ -168,13 +168,13 @@
private void setExtendedHandler()
{
- this.extendedHandler = (ExtendedEnumHandler) m_da.getExtendedHandler("DailyValuesRow");
+ this.extendedHandler = (ExtendedEnumHandler) dataAccess.getExtendedHandler("DailyValuesRow");
}
public boolean areMealsSet()
{
- if (m_da.isValueSet(this.meals) || this.isExtendedValueSet(ExtendedDailyValueType.FoodDescription))
+ if (dataAccess.isValueSet(this.meals) || this.isExtendedValueSet(ExtendedDailyValueType.FoodDescription))
return true;
else
return false;
@@ -188,7 +188,7 @@
*/
public int areMealsSetType()
{
- if (m_da.isValueSet(this.meals))
+ if (dataAccess.isValueSet(this.meals))
return 1;
else if (this.isExtendedValueSet(ExtendedDailyValueType.FoodDescription))
return 2;
@@ -228,8 +228,8 @@
dt[3] = strtok.nextToken(); // hour
dt[4] = strtok.nextToken(); // minute
- String dt_out = dt[0] + m_da.getLeadingZero(dt[1], 2) + m_da.getLeadingZero(dt[2], 2)
- + m_da.getLeadingZero(dt[3], 2) + m_da.getLeadingZero(dt[4], 2);
+ String dt_out = dt[0] + dataAccess.getLeadingZero(dt[1], 2) + dataAccess.getLeadingZero(dt[2], 2)
+ + dataAccess.getLeadingZero(dt[3], 2) + dataAccess.getLeadingZero(dt[4], 2);
return new ATechDate(ATechDateType.DateAndTimeMin, Long.parseLong(dt_out));
}
@@ -366,7 +366,7 @@
if (configurationManagerWrapper.getGlucoseUnit() == GlucoseUnitType.mmol_L)
{
- float v = m_da.getBGValueByTypeFromDefault(GlucoseUnitType.mmol_L, bg);
+ float v = dataAccess.getBGValueByTypeFromDefault(GlucoseUnitType.mmol_L, bg);
if (debug)
{
@@ -405,7 +405,7 @@
if (configurationManagerWrapper.getGlucoseUnit() == GlucoseUnitType.mmol_L)
{
- float v = m_da.getBGValueByTypeFromDefault(GlucoseUnitType.mmol_L, bg);
+ float v = dataAccess.getBGValueByTypeFromDefault(GlucoseUnitType.mmol_L, bg);
if (debug)
{
@@ -412,7 +412,7 @@
System.out.println("getBgAsString [type=2,return=" + v + "]");
}
- return DataAccess.getFloatAsString(v, 1);
+ return dataAccess.getFloatAsString(v, 1);
}
else
{
@@ -437,7 +437,7 @@
if (glucoseUnitType == GlucoseUnitType.mmol_L)
{
- float v = m_da.getBGValueByTypeFromDefault(GlucoseUnitType.mmol_L, bg);
+ float v = dataAccess.getBGValueByTypeFromDefault(GlucoseUnitType.mmol_L, bg);
if (debug)
{
@@ -444,7 +444,7 @@
System.out.println("getBgAsString [type=2,return=" + v + "]");
}
- return DataAccess.getFloatAsString(v, 1);
+ return dataAccess.getFloatAsString(v, 1);
}
else
{
@@ -484,7 +484,7 @@
System.out.println("Internal value: " + this.bg);
}
- return m_da.getBGValueByTypeFromDefault(GlucoseUnitType.getByCode(type), bg);
+ return dataAccess.getBGValueByTypeFromDefault(GlucoseUnitType.getByCode(type), bg);
}
@@ -501,7 +501,7 @@
System.out.println("Internal value: " + this.bg);
}
- return m_da.getBGValueByTypeFromDefault(type, bg);
+ return dataAccess.getBGValueByTypeFromDefault(type, bg);
}
@@ -525,10 +525,10 @@
if (debug)
{
System.out.println("SET BG :: MMOL");
- System.out.println(" " + (int) m_da.getBGValueDifferent(type, val));
+ System.out.println(" " + (int) dataAccess.getBGValueDifferent(type, val));
}
- this.setBG((int) m_da.getBGValueDifferent(type, val));
+ this.setBG((int) dataAccess.getBGValueDifferent(type, val));
}
else
{
@@ -644,7 +644,7 @@
if (dec == 0)
return "" + val;
else
- return DataAccess.getFloatAsString(val + 0.1f * dec, 1);
+ return dataAccess.getFloatAsString(val + 0.1f * dec, 1);
}
@@ -654,7 +654,7 @@
float val = 0.0f;
val += value;
- val += 0.1f * m_da.getFloatValueFromString(decimal_part, 0.0f);
+ val += 0.1f * dataAccess.getFloatValueFromString(decimal_part, 0.0f);
return val;
}
@@ -669,7 +669,7 @@
{
if (!ATDataAccessAbstract.isEmptyOrUnset(val))
{
- setIns1(m_da.getIntValue(val));
+ setIns1(dataAccess.getIntValue(val));
}
}
@@ -718,7 +718,7 @@
{
if (!ATDataAccessAbstract.isEmptyOrUnset(val))
{
- setIns2(m_da.getIntValue(val));
+ setIns2(dataAccess.getIntValue(val));
}
else
{
@@ -771,7 +771,7 @@
*/
public void setCH(String val)
{
- setCH(m_da.getFloatValue(val));
+ setCH(dataAccess.getFloatValue(val));
}
@@ -808,7 +808,7 @@
*/
public float getIns3()
{
- return m_da.getFloatValueFromString(this.getExtendedValue(ExtendedDailyValueType.Insulin3), 0.0f);
+ return dataAccess.getFloatValueFromString(this.getExtendedValue(ExtendedDailyValueType.Insulin3), 0.0f);
}
@@ -859,7 +859,7 @@
public String getBasalInsulinAsString()
{
- return m_da.getDecimalHandler().getDecimalNumberAsString(this.getBasalInsulin(), 1);
+ return dataAccess.getDecimalHandler().getDecimalNumberAsString(this.getBasalInsulin(), 1);
}
@@ -888,7 +888,7 @@
public String getBolusInsulinAsString()
{
- return m_da.getDecimalHandler().getDecimalNumberAsString(this.getBolusInsulin(), 1);
+ return dataAccess.getDecimalHandler().getDecimalNumberAsString(this.getBolusInsulin(), 1);
}
@@ -1041,12 +1041,12 @@
m_dv.setBg(bg);
m_dv.setCh(ch);
m_dv.setComment(comment);
- m_dv.setDt_info(datetime.getATDateTimeAsLong());
+ m_dv.setDtInfo(datetime.getATDateTimeAsLong());
m_dv.setIns1(ins1);
m_dv.setIns2(ins2);
m_dv.setExtended(this.getExtendedHandler().saveExtended(mapExtended));
- m_dv.setPerson_id((int) m_da.getCurrentUserId());
- m_dv.setMeals_ids(this.meals);
+ m_dv.setPersonId((int) dataAccess.getCurrentUserId());
+ m_dv.setMealsIds(this.meals);
}
else
{
@@ -1053,12 +1053,12 @@
m_dv.setBg(bg);
m_dv.setCh(ch);
m_dv.setComment(comment);
- m_dv.setDt_info(datetime.getATDateTimeAsLong());
+ m_dv.setDtInfo(datetime.getATDateTimeAsLong());
m_dv.setIns1(ins1);
m_dv.setIns2(ins2);
m_dv.setExtended(this.getExtendedHandler().saveExtended(mapExtended));
- m_dv.setPerson_id((int) m_da.getCurrentUserId());
- m_dv.setMeals_ids(this.meals);
+ m_dv.setPersonId((int) dataAccess.getCurrentUserId());
+ m_dv.setMealsIds(this.meals);
}
return m_dv;
@@ -1088,7 +1088,7 @@
if (fl == 0.0)
return "";
else
- return DataAccess.Decimal1Format.format(fl);
+ return dataAccess.getFloatAsString(fl, 1);
}
@@ -1097,7 +1097,7 @@
if (fl == 0.0)
return "";
else
- return DataAccess.Decimal2Format.format(fl);
+ return dataAccess.getFloatAsString(fl, 2);
}
@@ -1122,9 +1122,9 @@
return "";
return this.getBGAsString();
case 2:
- return DataAccess.getFloatAsString(this.getBolusInsulin(), 1);
+ return dataAccess.getFloatAsString(this.getBolusInsulin(), 1);
case 3:
- return DataAccess.getFloatAsString(this.getBasalInsulin(), 1);
+ return dataAccess.getFloatAsString(this.getBasalInsulin(), 1);
case 4:
return this.getFloat2AsString(ch);
case 5:
@@ -1173,7 +1173,7 @@
public ExtendedEnumHandler getExtendedHandler()
{
- return (ExtendedEnumHandler) m_da.getExtendedHandler("DailyValuesRow");
+ return (ExtendedEnumHandler) dataAccess.getExtendedHandler("DailyValuesRow");
}
Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DataValuesInterface.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DataValuesInterface.java (rev 0)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DataValuesInterface.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -0,0 +1,26 @@
+package ggc.core.data;
+
+/**
+ * Created by andy on 28.01.17.
+ */
+public interface DataValuesInterface
+{
+
+ int getColumnCount();
+
+
+ int getRowCount();
+
+
+ Object getValueAt(int row, int column);
+
+
+ String getColumnName(int column);
+
+
+ Class<?> getColumnClass(int row);
+
+
+ boolean isCellEditable(int row, int col);
+
+}
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/ExtendedRatioCollection.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/ExtendedRatioCollection.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/ExtendedRatioCollection.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -4,7 +4,7 @@
import java.util.Hashtable;
import ggc.core.util.DataAccess;
-import ggc.shared.ratio.RatioEntry;
+import ggc.gui.dialogs.ratio.RatioEntry;
/**
* Application: GGC - GNU Gluco Control
@@ -36,11 +36,13 @@
DataAccess m_da = DataAccess.getInstance();
+
public ExtendedRatioCollection()
{
super();
}
+
public void load()
{
@@ -75,6 +77,7 @@
}
}
+
public RatioEntry getRatioEntryByTime(String time)
{
long t = Long.parseLong(time.replace(":", ""));
@@ -88,6 +91,7 @@
return null;
}
+
public boolean save()
{
return m_da.getDb().saveExtendedRatioEntries(this);
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/GlucoValues.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/GlucoValues.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/GlucoValues.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -4,6 +4,7 @@
import com.atech.utils.data.ATechDate;
import com.atech.utils.data.TimeZoneUtil;
+
import ggc.core.util.DataAccess;
/**
@@ -38,7 +39,7 @@
// private static final long serialVersionUID = 3904480643937213485L;
Vector<DailyValues> dayValues = null;
- ArrayList<DailyValuesRow> dayValuesRows = null;
+ List<DailyValuesRow> dayValuesRows = null;
// private DataAccess dataAccess = DataAccess.getInstance();
GregorianCalendar from_date;
GregorianCalendar to_date;
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigCellRenderer.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigCellRenderer.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigCellRenderer.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -1,12 +1,11 @@
package ggc.core.data.cfg;
-import ggc.core.util.DataAccess;
+import java.awt.*;
-import java.awt.Component;
+import javax.swing.*;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JList;
-import javax.swing.SwingConstants;
+import ggc.core.enums.PropertiesDialogType;
+import ggc.core.util.DataAccess;
/**
* Application: GGC - GNU Gluco Control
@@ -38,7 +37,16 @@
private static final long serialVersionUID = -2728552153803274776L;
DataAccess da = DataAccess.getInstance();
+ PropertiesDialogType propertiesDialogType;
+
+ public ConfigCellRenderer(PropertiesDialogType propertiesDialogType)
+ {
+ super();
+ this.propertiesDialogType = propertiesDialogType;
+ }
+
+
@Override
@SuppressWarnings("rawtypes")
public Component getListCellRendererComponent(JList list, Object value, // value
@@ -49,7 +57,11 @@
boolean chf) // the list and the cell have the focus
{
super.getListCellRendererComponent(list, value, index, iss, chf);
- setIcon(da.config_icons[index]);
+ if (propertiesDialogType == PropertiesDialogType.Standard)
+ setIcon(da.config_icons[index]);
+ else
+ setIcon(da.config_icons[index == 1 ? 10 : 0]); // we have only two
+ // icons here
this.setHorizontalTextPosition(SwingConstants.CENTER);
this.setHorizontalAlignment(SwingConstants.CENTER);
this.setVerticalTextPosition(SwingConstants.BOTTOM);
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigurationManager.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigurationManager.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigurationManager.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -1,7 +1,7 @@
package ggc.core.data.cfg;
-import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -119,7 +119,7 @@
"USE_CGMS_DATA_IN_DAILY_PEN_DISPLAY", "false", //
};
- Hashtable<String, Settings> cfg_values = new Hashtable<String, Settings>();
+ Map<String, Settings> cfg_values = new HashMap<String, Settings>();
DataAccess m_da = null;
@@ -130,7 +130,7 @@
}
- public void checkConfiguration(Hashtable<String, Settings> values, GGCDb db)
+ public void checkConfiguration(Map<String, Settings> values, GGCDb db)
{
this.cfg_values = values;
@@ -192,7 +192,7 @@
s.setDescription(m_da.getI18nControlInstance().getMessage("CFG_" + name));
s.setType(parameterType);
s.setValue(defaultValue);
- s.setPerson_id((int) m_da.getCurrentUserId());
+ s.setPersonId((int) m_da.getCurrentUserId());
db.add(s);
@@ -382,19 +382,15 @@
GGCDb db = this.m_da.getDb();
- for (Enumeration<String> en = this.cfg_values.keys(); en.hasMoreElements();)
+ for (Settings setting : this.cfg_values.values())
{
- String key = en.nextElement();
-
- Settings s = this.cfg_values.get(key);
-
- if (s.isElementAdded())
+ if (setting.isElementAdded())
{
- db.add(s);
+ db.add(setting);
}
- else if (s.isElementEdited())
+ else if (setting.isElementEdited())
{
- db.edit(s);
+ db.edit(setting);
}
}
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigurationManagerWrapper.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigurationManagerWrapper.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/cfg/ConfigurationManagerWrapper.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -7,7 +7,9 @@
import org.slf4j.LoggerFactory;
import com.atech.graphics.graphs.GraphConfigProperties;
+
import ggc.core.data.defs.GlucoseUnitType;
+import ggc.core.util.GGCSoftwareMode;
/**
* Created by andy on 10.10.15.
@@ -1079,6 +1081,12 @@
}
+ public GGCSoftwareMode getSoftwareModeType()
+ {
+ return GGCSoftwareMode.getEnum(getIntValue("SW_MODE"));
+ }
+
+
public float getPenMaxBasal()
{
return getFloatValue("PEN_MAX_BASAL");
Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/DatabaseStatusType.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/DatabaseStatusType.java (rev 0)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/DatabaseStatusType.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -0,0 +1,51 @@
+package ggc.core.data.defs;
+
+public enum DatabaseStatusType
+{
+ Stopped(0), // 0 - NU
+ InitDone(1), // 1
+ BaseDone(2), // 2
+ ExtendedDone(3), // 3 - NU
+ Loaded(3), // 3
+
+ ;
+
+ int code;
+
+
+ DatabaseStatusType(int code)
+ {
+ this.code = code;
+ }
+
+
+ public int getCode()
+ {
+ return this.code;
+ }
+
+ /**
+ * Db Status: Stopped
+ */
+ public static final int DB_STOPPED = 0;
+
+ /**
+ * Db Status: Init done
+ */
+ public static final int DB_INIT_DONE = 1;
+
+ /**
+ * Db Status: Base done
+ */
+ public static final int DB_BASE_DONE = 2;
+
+ /**
+ * Db Status: Extended done
+ */
+ public static final int DB_EXTENDED_DONE = 3;
+
+ /**
+ * Db Status: Loaded
+ */
+ public static final int DB_LOADED = 3;
+}
Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/GGCObservableType.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/GGCObservableType.java (rev 0)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/GGCObservableType.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -0,0 +1,35 @@
+package ggc.core.data.defs;
+
+import com.atech.graphics.observe.ObservableType;
+
+/**
+ * Created by andy on 04.01.17.
+ */
+public enum GGCObservableType implements ObservableType
+{
+ InfoPanels, //
+ Status, //
+ Database, //
+ ;
+
+ public String getKey()
+ {
+ return this.name();
+ }
+
+ /**
+ * Observable: Panels
+ */
+ public static final int OBSERVABLE_PANELS = 1;
+
+ /**
+ * Observable: Status
+ */
+ public static final int OBSERVABLE_STATUS = 2;
+
+ /**
+ * Observable: Db
+ */
+ public static final int OBSERVABLE_DB = 3;
+
+}
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/GlucoseUnitType.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/GlucoseUnitType.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/GlucoseUnitType.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -41,6 +41,7 @@
int code;
String i18nKey;
String translation;
+ static String[] descriptions;
static Hashtable<Integer, GlucoseUnitType> codeMapping = new Hashtable<Integer, GlucoseUnitType>();
@@ -59,10 +60,16 @@
{
pbt.setTranslation(ic.getMessage(pbt.i18nKey));
}
+
+ String[] unitDescriptions = { ic.getMessage("GLUCOSE_UNIT_MGDL"), //
+ ic.getMessage("GLUCOSE_UNIT_MMOLL"), //
+ };
+
+ descriptions = unitDescriptions;
}
- private GlucoseUnitType(int code, String i18nKey)
+ GlucoseUnitType(int code, String i18nKey)
{
this.code = code;
this.i18nKey = i18nKey;
@@ -111,4 +118,10 @@
}
}
+
+ public static String[] getDescriptions()
+ {
+ return descriptions;
+ }
+
}
Copied: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryGroupType.java (from rev 1456, trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/StockTypeBase.java)
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryGroupType.java (rev 0)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryGroupType.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -0,0 +1,169 @@
+package ggc.core.data.defs;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.atech.i18n.I18nControlAbstract;
+import com.atech.utils.ATDataAccessAbstract;
+import com.atech.utils.data.CodeEnumWithTranslation;
+
+/**
+ * Application: GGC - GNU Gluco Control
+ *
+ * See AUTHORS for copyright information.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Filename: StockTypeBase
+ * Description: Stock Type Base
+ *
+ * Author: Andy {an...@at...}
+ */
+
+public enum InventoryGroupType implements CodeEnumWithTranslation
+{
+ None(0, "NONE"), //
+ Insulin(1, "STOCKTYPE_INSULIN"), //
+ BG(2, "STOCKTYPE_BG"), //
+ Pen(3, "STOCKTYPE_PEN"), //
+ Pump(4, "STOCKTYPE_PUMP"), //
+ CGMS(5, "STOCKTYPE_CGMS");
+
+ static String[] descriptions;
+
+ static Map<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>();
+ static Map<Integer, InventoryGroupType> codeMapping = new HashMap<Integer, InventoryGroupType>();
+
+ static
+ {
+ for (InventoryGroupType pbt : values())
+ {
+ codeMapping.put(pbt.code, pbt);
+ }
+
+ }
+
+ int code;
+ String i18nKey;
+ String translation;
+
+
+ InventoryGroupType(int code, String i18nKey)
+ {
+ this.code = code;
+ this.i18nKey = i18nKey;
+ }
+
+
+ public static void translateKeywords(I18nControlAbstract ic)
+ {
+ for (InventoryGroupType pbt : values())
+ {
+ pbt.setTranslation(ic.getMessage(pbt.i18nKey));
+ translationMapping.put(pbt.getTranslation(), pbt);
+ }
+
+ String[] stockTypeDescriptions = { ic.getMessage("STOCKTYPE_ANY"), //
+ ic.getMessage("STOCKTYPE_INSULIN"), //
+ ic.getMessage("STOCKTYPE_BG"), //
+ ic.getMessage("STOCKTYPE_PEN"), //
+ ic.getMessage("STOCKTYPE_PUMP"), //
+ ic.getMessage("STOCKTYPE_CGMS"), //
+ };
+
+ descriptions = stockTypeDescriptions;
+ }
+
+
+ public String getTranslation()
+ {
+ return translation;
+ }
+
+
+ public void setTranslation(String translation)
+ {
+ this.translation = translation;
+ }
+
+
+ public int getCode()
+ {
+ return code;
+ }
+
+
+ public String getI18nKey()
+ {
+ return i18nKey;
+ }
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+
+
+ /**
+ * Get Type from Description
+ *
+ * @param str
+ * type as string
+ * @return type as int
+ */
+ public static int getTypeFromDescription(String str)
+ {
+ return ATDataAccessAbstract.getTypeFromDescription(str, translationMapping);
+ }
+
+
+ public static InventoryGroupType getByCode(int code)
+ {
+ if (codeMapping.containsKey(code))
+ {
+ return codeMapping.get(code);
+ }
+ else
+ {
+ return InventoryGroupType.None;
+ }
+ }
+
+
+ /**
+ * Get Type from Description
+ *
+ * @param str
+ * type as string
+ * @return type as int
+ */
+ public static InventoryGroupType getByDescription(String str)
+ {
+ return getByCode(ATDataAccessAbstract.getTypeFromDescription(str, translationMapping));
+ }
+
+
+ /**
+ * Get Descriptions (array)
+ *
+ * @return array of strings with description
+ */
+ public static String[] getDescriptions()
+ {
+ return descriptions;
+ }
+
+}
Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryItemUnit.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryItemUnit.java (rev 0)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryItemUnit.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -0,0 +1,149 @@
+package ggc.core.data.defs;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.atech.i18n.I18nControlAbstract;
+import com.atech.utils.ATDataAccessAbstract;
+import com.atech.utils.data.CodeEnumWithTranslation;
+
+public enum InventoryItemUnit implements CodeEnumWithTranslation
+{
+
+ None(0, "NONE"), //
+ Unit(1, "UNIT_UNIT"), //
+ ML(2, "UNIT_ML"), //
+ Pieces(3, "UNIT_PIECES"), //
+ ;
+
+ static String[] descriptions;
+
+ static Map<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>();
+ static Map<Integer, InventoryItemUnit> codeMapping = new HashMap<Integer, InventoryItemUnit>();
+ static Map<String, CodeEnumWithTranslation> keyMapping = new HashMap<String, CodeEnumWithTranslation>();
+
+ static
+ {
+ for (InventoryItemUnit pbt : values())
+ {
+ keyMapping.put(pbt.i18nKey, pbt);
+ codeMapping.put(pbt.code, pbt);
+ }
+ }
+
+ int code;
+ String i18nKey;
+ String translation;
+
+
+ InventoryItemUnit(int code, String i18nKey)
+ {
+ this.code = code;
+ this.i18nKey = i18nKey;
+ }
+
+
+ public static void translateKeywords(I18nControlAbstract ic)
+ {
+ for (InventoryItemUnit pbt : values())
+ {
+ pbt.setTranslation(ic.getMessage(pbt.i18nKey));
+ translationMapping.put(pbt.getTranslation(), pbt);
+ }
+
+ String[] stockUnitDescriptions = { ic.getMessage("SELECT"), //
+ ic.getMessage("UNIT_UNIT"), //
+ ic.getMessage("UNIT_ML"), //
+ ic.getMessage("UNIT_PIECES"), //
+ };
+
+ descriptions = stockUnitDescriptions;
+ }
+
+
+ public String getTranslation()
+ {
+ return translation;
+ }
+
+
+ public void setTranslation(String translation)
+ {
+ this.translation = translation;
+ }
+
+
+ public int getCode()
+ {
+ return code;
+ }
+
+
+ public String getI18nKey()
+ {
+ return i18nKey;
+ }
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+
+
+ /**
+ * Get Type from Description
+ *
+ * @param str
+ * type as string
+ * @return type as int
+ */
+ public static int getTypeFromDescription(String str)
+ {
+ return ATDataAccessAbstract.getTypeFromDescription(str, translationMapping);
+ }
+
+
+ public static InventoryItemUnit getByCode(int code)
+ {
+ if (codeMapping.containsKey(code))
+ {
+ return codeMapping.get(code);
+ }
+ else
+ {
+ return InventoryItemUnit.None;
+ }
+ }
+
+
+ /**
+ * Get Type from Description
+ *
+ * @param str
+ * type as string
+ * @return type as int
+ */
+ public static InventoryItemUnit getByDescription(String str)
+ {
+ return getByCode(ATDataAccessAbstract.getTypeFromDescription(str, translationMapping));
+ }
+
+
+ public static InventoryItemUnit getByI18nKey(String str)
+ {
+ return getByCode(ATDataAccessAbstract.getTypeFromDescription(str, keyMapping));
+ }
+
+
+ /**
+ * Get Descriptions (array)
+ *
+ * @return array of strings with description
+ */
+ public static String[] getDescriptions()
+ {
+ return descriptions;
+ }
+
+}
Copied: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryItemUsageUnit.java (from rev 1456, trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/StockUsageUnit.java)
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryItemUsageUnit.java (rev 0)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/InventoryItemUsageUnit.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -0,0 +1,155 @@
+package ggc.core.data.defs;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.atech.i18n.I18nControlAbstract;
+import com.atech.utils.ATDataAccessAbstract;
+import com.atech.utils.data.CodeEnumWithTranslation;
+
+import ggc.core.util.DataAccess;
+
+/**
+ * Application: GGC - GNU Gluco Control
+ *
+ * See AUTHORS for copyright information.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Filename: InventoryItemUsageUnit
+ * Description: Stock Usage Unit
+ *
+ * Author: Andy {an...@at...}
+ */
+
+public enum InventoryItemUsageUnit implements CodeEnumWithTranslation
+{
+ None(0, "NONE"), //
+ Day(1, "TIME_DAY"), //
+ Week(2, "TIME_WEEK"), //
+ Month(3, "TIME_MONTH"), //
+
+ ;
+
+ static String[] descriptions;
+
+ static Map<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>();
+ static Map<Integer, InventoryItemUsageUnit> codeMapping = new HashMap<Integer, InventoryItemUsageUnit>();
+
+ static
+ {
+ I18nControlAbstract ic = DataAccess.getInstance().getI18nControlInstance();
+
+ for (InventoryItemUsageUnit pbt : values())
+ {
+ pbt.setTranslation(ic.getMessage(pbt.i18nKey));
+ translationMapping.put(pbt.getTranslation(), pbt);
+ codeMapping.put(pbt.code, pbt);
+ }
+
+ String[] basal_desc_lcl = { ic.getMessage("SELECT"), //
+ ic.getMessage("TIME_DAY"), //
+ ic.getMessage("TIME_WEEK"), //
+ ic.getMessage("TIME_MONTH"), //
+ };
+
+ descriptions = basal_desc_lcl;
+ }
+
+ int code;
+ String i18nKey;
+ String translation;
+
+
+ private InventoryItemUsageUnit(int code, String i18nKey)
+ {
+ this.code = code;
+ this.i18nKey = i18nKey;
+ }
+
+
+ public String getTranslation()
+ {
+ return translation;
+ }
+
+
+ public void setTranslation(String translation)
+ {
+ this.translation = translation;
+ }
+
+
+ public int getCode()
+ {
+ return code;
+ }
+
+
+ public String getI18nKey()
+ {
+ return i18nKey;
+ }
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+
+
+ /**
+ * Get Type from Description
+ *
+ * @param str
+ * type as string
+ * @return type as int
+ */
+ public static int getTypeFromDescription(String str)
+ {
+ return ATDataAccessAbstract.getTypeFromDescription(str, translationMapping);
+ }
+
+
+ public static InventoryItemUsageUnit getByCode(int code)
+ {
+ if (codeMapping.containsKey(code))
+ {
+ return codeMapping.get(code);
+ }
+ else
+ {
+ return InventoryItemUsageUnit.Day;
+ }
+ }
+
+
+ public static InventoryItemUsageUnit getByDescription(String description)
+ {
+ return getByCode(getTypeFromDescription(description));
+ }
+
+
+ /**
+ * Get Descriptions (array)
+ *
+ * @return array of strings with description
+ */
+ public static String[] getDescriptions()
+ {
+ return descriptions;
+ }
+
+}
Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/RefreshInfoType.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/RefreshInfoType.java (rev 0)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/RefreshInfoType.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -0,0 +1,52 @@
+package ggc.core.data.defs;
+
+/**
+ * Created by andy on 04.01.17.
+ */
+public enum RefreshInfoType
+{
+ DevicesConfiguration(1), // PANEL_GROUP_PLUGINS_DEVICES
+ DeviceDataAll(2), // PANEL_GROUP_ALL_DATA
+ GeneralInfo(3), // PANEL_GROUP_GENERAL_INFO
+ PluginsAll(4), // PANEL_GROUP_PLUGINS_ALL
+ DeviceDataMeter(2), //
+ DeviceDataCGMS(2), //
+ DeviceDataPump(2), //
+ Appointments(5), //
+ Inventory(6);
+
+ int code;
+
+
+ RefreshInfoType(int code)
+ {
+ this.code = code;
+ }
+
+
+ public int getCode()
+ {
+ return this.code;
+ }
+
+ /**
+ * Panel Group - Plugins Devices
+ */
+ public static final int PANEL_GROUP_PLUGINS_DEVICES = 1;
+
+ /**
+ * Panel Group - All Data (HbA1c and Statistics)
+ */
+ public static final int PANEL_GROUP_ALL_DATA = 2;
+
+ /**
+ * Panel Group - General Info
+ */
+ public static final int PANEL_GROUP_GENERAL_INFO = 3;
+
+ /**
+ * Panel Group - Plugins All
+ */
+ public static final int PANEL_GROUP_PLUGINS_ALL = 4;
+
+}
Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/ReturnActionType.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/ReturnActionType.java (rev 0)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/ReturnActionType.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -0,0 +1,12 @@
+package ggc.core.data.defs;
+
+import com.atech.plugin.PluginActionType;
+
+/**
+ * Created by andy on 04.01.17.
+ */
+public enum ReturnActionType implements PluginActionType
+{
+ ReadData, //
+ ChangeConfig, //
+}
Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/StockTypeBase.java
===================================================================
--- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/StockTypeBase.java 2016-12-26 14:02:38 UTC (rev 1456)
+++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/StockTypeBase.java 2017-06-19 18:10:37 UTC (rev 1457)
@@ -6,7 +6,6 @@
import com.atech.i18n.I18nControlAbstract;
import com.atech.utils.ATDataAccessAbstract;
import com.atech.utils.data.CodeEnumWithTranslation;
-import ggc.core.util.DataAccess;
/**
* Application: GGC - GNU Gluco Control
@@ -32,7 +31,7 @@
*
* Author: Andy {an...@at...}
*/
-
+@Deprecated
public enum StockTypeBase implements CodeEnumWithTranslation
{
None(0, "NONE"), //
@@ -49,24 +48,11 @@
static
{
- I18nControlAbstract ic = DataAccess.getInstance().getI18nControlInstance();
-
...
[truncated message content] |