You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(74) |
Aug
(72) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(21) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
(1) |
Mar
(122) |
Apr
(93) |
May
(5) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
|
Nov
|
Dec
(18) |
2007 |
Jan
(5) |
Feb
|
Mar
(29) |
Apr
(11) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(29) |
Feb
(24) |
Mar
(7) |
Apr
(33) |
May
(30) |
Jun
(29) |
Jul
(38) |
Aug
(57) |
Sep
(33) |
Oct
(22) |
Nov
(39) |
Dec
(27) |
2009 |
Jan
(15) |
Feb
(21) |
Mar
(44) |
Apr
(43) |
May
(13) |
Jun
(52) |
Jul
(40) |
Aug
(30) |
Sep
(1) |
Oct
(12) |
Nov
(7) |
Dec
(14) |
2010 |
Jan
(24) |
Feb
(44) |
Mar
(24) |
Apr
(14) |
May
(15) |
Jun
(32) |
Jul
(7) |
Aug
(18) |
Sep
(1) |
Oct
(21) |
Nov
|
Dec
(19) |
2011 |
Jan
(12) |
Feb
(9) |
Mar
(4) |
Apr
|
May
(1) |
Jun
|
Jul
(15) |
Aug
(6) |
Sep
(8) |
Oct
(3) |
Nov
|
Dec
(8) |
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(18) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(7) |
2013 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(16) |
Jun
(19) |
Jul
(1) |
Aug
(10) |
Sep
(29) |
Oct
(12) |
Nov
(4) |
Dec
(1) |
2015 |
Jan
|
Feb
(9) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(28) |
Nov
|
Dec
(3) |
2016 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(9) |
Jun
(6) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(45) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
|
Aug
|
Sep
(11) |
Oct
(1) |
Nov
|
Dec
|
From: <and...@us...> - 2017-10-14 17:53:21
|
Revision: 1478 http://sourceforge.net/p/ggc/code/1478 Author: andyrozman Date: 2017-10-14 17:53:18 +0000 (Sat, 14 Oct 2017) Log Message: ----------- - Libre changes Modified Paths: -------------- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSDataReader.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSHandler.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreHidReportDto.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/plugin/CGMSPlugInServer.java Added Paths: ----------- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/util/ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/util/LibreUtil.java Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSDataReader.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSDataReader.java 2017-09-20 18:35:58 UTC (rev 1477) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSDataReader.java 2017-10-14 17:53:18 UTC (rev 1478) @@ -2,6 +2,7 @@ import java.util.GregorianCalendar; +import ggc.cgms.device.abbott.libre.enums.BaseCommand; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,7 +13,7 @@ import ggc.cgms.defs.device.CGMSDeviceDefinition; import ggc.cgms.device.abbott.libre.data.LibreDataConverter; import ggc.cgms.device.abbott.libre.data.LibreHidReportDto; -import ggc.cgms.device.abbott.libre.enums.Command; + import ggc.cgms.device.abbott.libre.enums.LibreTextCommand; import ggc.cgms.device.abbott.libre.util.LibreUtil; import ggc.cgms.util.DataAccessCGMS; @@ -135,22 +136,23 @@ drainDevice(); // init 1 - sendToDeviceAndCheckResponse(Command.INIT_REQUEST_1, new byte[] { 0xc }); + sendToDeviceAndCheckResponse( + BaseCommand.INIT_REQUEST_1, new byte[] { 0xc }); addToStaticProgress(5); // init 2 - read serialNumber - writeReport(Command.INIT_REQUEST_2, ""); - serialNumber = readTextResponse(Command.INIT_REQUEST_2).trim(); + writeReport(BaseCommand.INIT_REQUEST_2, ""); + serialNumber = readTextResponse(BaseCommand.INIT_REQUEST_2).trim(); addToStaticProgress(5); // init 3 - read software version - writeReport(Command.INIT_REQUEST_3, ""); - softwareVersion = readTextResponse(Command.INIT_REQUEST_3).trim(); + writeReport(BaseCommand.INIT_REQUEST_3, ""); + softwareVersion = readTextResponse(BaseCommand.INIT_REQUEST_3).trim(); addToStaticProgress(5); // System.out.println("Software Version: " + softwareVersion); - byte[] response = sendToDeviceAndReceiveResponse(Command.INIT_REQUEST_4); + byte[] response = sendToDeviceAndReceiveResponse(BaseCommand.INIT_REQUEST_4); addToStaticProgress(5); // System.out.println("Response: " + bitUtils.getDebugByteArray(response)); @@ -186,7 +188,7 @@ } - public boolean sendToDeviceAndCheckResponse(Command command, byte[] expectedResponse) throws PlugInBaseException + public boolean sendToDeviceAndCheckResponse(BaseCommand command, byte[] expectedResponse) throws PlugInBaseException { writeReport(command, ""); byte[] response = readByteResponse(command); @@ -204,7 +206,7 @@ } - public byte[] sendToDeviceAndReceiveResponse(Command command) throws PlugInBaseException + public byte[] sendToDeviceAndReceiveResponse(BaseCommand command) throws PlugInBaseException { writeReport(command, ""); byte[] response = readByteResponse(command); @@ -289,7 +291,7 @@ } - private void writeReport(Command command, String s) throws PlugInBaseException + private void writeReport(BaseCommand command, String s) throws PlugInBaseException { LOG.debug("writeReport: command={}, value={}", command, s); @@ -337,11 +339,11 @@ private void writeReport(LibreTextCommand libreTextCommand) throws PlugInBaseException { - writeReport(Command.TEXT_COMMAND, libreTextCommand.getCommandText()); + writeReport(BaseCommand.TEXT_COMMAND, libreTextCommand.getCommandText()); } - private byte[] readByteResponse(Command command) throws PlugInBaseException + private byte[] readByteResponse(BaseCommand command) throws PlugInBaseException { LibreHidReportDto report = readReport(); @@ -361,7 +363,7 @@ } - private void checkIfCorrectResponse(Command expectedCommand, Command receivedCommandResponse) + private void checkIfCorrectResponse(BaseCommand expectedCommand, BaseCommand receivedCommandResponse) throws PlugInBaseException { if (expectedCommand != receivedCommandResponse) @@ -372,7 +374,7 @@ } - private String readTextResponse(Command command) throws PlugInBaseException + private String readTextResponse(BaseCommand command) throws PlugInBaseException { LibreHidReportDto report = readReport(); @@ -384,7 +386,7 @@ public String readTextResponse() throws PlugInBaseException { - return readTextResponse(Command.TEXT_COMMAND); + return readTextResponse(BaseCommand.TEXT_COMMAND); } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSHandler.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSHandler.java 2017-09-20 18:35:58 UTC (rev 1477) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSHandler.java 2017-10-14 17:53:18 UTC (rev 1478) @@ -41,7 +41,7 @@ public DeviceHandlerType getDeviceHandlerKey() { - return DeviceHandlerType.ArkrayMeterHandler; + return DeviceHandlerType.AbbottLibreHandler; } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreHidReportDto.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreHidReportDto.java 2017-09-20 18:35:58 UTC (rev 1477) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreHidReportDto.java 2017-10-14 17:53:18 UTC (rev 1478) @@ -1,11 +1,12 @@ package ggc.cgms.device.abbott.libre.data; +import ggc.cgms.device.abbott.libre.enums.BaseCommand; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.atech.utils.data.BitUtils; -import ggc.cgms.device.abbott.libre.enums.Command; + import ggc.cgms.device.abbott.libre.util.LibreUtil; import ggc.plugin.device.PlugInBaseException; @@ -49,9 +50,9 @@ } - public Command getMessageType() + public BaseCommand getMessageType() { - return Command.getByResponseCode(this.messageTypeRaw); + return BaseCommand.getByResponseCode(this.messageTypeRaw); } Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/util/LibreUtil.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/util/LibreUtil.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/util/LibreUtil.java 2017-10-14 17:53:18 UTC (rev 1478) @@ -0,0 +1,167 @@ +package ggc.cgms.device.abbott.libre.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.atech.utils.data.BitUtils; + +import ggc.plugin.data.enums.PlugInExceptionType; +import ggc.plugin.device.PlugInBaseException; +import ggc.plugin.output.OutputWriter; + +/** + * Created by andy on 28/08/17. + */ +public class LibreUtil +{ + + private static final Logger LOG = LoggerFactory.getLogger(LibreUtil.class); + + static BitUtils bitUtils = new BitUtils(); + + int[] CRC32_TABLE = { 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, + 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, + 0x3c8ea00a, 0x384fbdbd, }; + + String DEVICE_MODEL_NAME = "FreeStyle Libre"; + + Float KETONE_VALUE_FACTOR = 18.0f; // according to specs + Float KETONE_HI = 8.0f; + Float KETONE_LO = null; // ketone value cannot be low + + Integer GLUCOSE_HI = 500; + Integer GLUCOSE_LO = 40; + private static OutputWriter outputWriter; + + static boolean debug = true; + static boolean currentDebug = false; + + + // Map<> + // + // export const DB_WRAP_RECORDS= + // {};DB_WRAP_RECORDS[DB_RECORD_TYPE.RESULT_RECORD_WRAP]=DB_TABLE_ID.GLUCOSE_RESULT; // + // DB_WRAP_RECORDS[DB_RECORD_TYPE.INSULIN_WRAP]=DB_TABLE_ID.RAPID_ACTING_INSULIN; // + // DB_WRAP_RECORDS[DB_RECORD_TYPE.HISTORICAL_WRAP]=DB_TABLE_ID.HISTORICAL_DATA; // + // DB_WRAP_RECORDS[DB_RECORD_TYPE.EVENT_DATABASE_RECORD_NUMBER_WRAP]=DB_TABLE_ID.EVENT; + // + + public static void setUp() + { + // FIXME DB_WRAP_RECORDS + } + + + public static BitUtils getBitUtils() + { + return bitUtils; + } + + + public static void setOutputWriter(OutputWriter outputWriter) + { + LibreUtil.outputWriter = outputWriter; + } + + + public static OutputWriter getOutputWriter() + { + return outputWriter; + } + + + // FIXME + public static String validateTextResponse(String outText, boolean singleResponse, boolean ignoreCRC) + throws PlugInBaseException + { + String splitedString[] = outText.split("CMD "); + // LOG.error("extractText not processing full data....\n"); + + // LOG.debug("F: {}", splitedString[0]); + // LOG.debug("S: {}", splitedString[1]); + + if (!splitedString[1].contains("OK\r\n")) + { + String responseResult = removeEndingCRLF(splitedString[1]).trim(); + + LOG.error("Invalid response: {}. Whole message:\n{}", responseResult, outText); + throw new PlugInBaseException(PlugInExceptionType.DeviceInvalidResponse, // + new Object[] { "OK", removeEndingCRLF(splitedString[1]).trim() }); + } + + splitedString = splitedString[0].split("CKSM:"); + + try + { + validateChecksum(splitedString[0], splitedString[1]); + } + catch (PlugInBaseException ex) + { + LOG.error("{}. Whole message:\n{}", ex.getMessage(), outText); + + if (!ignoreCRC) + throw ex; + } + + if (singleResponse) + { + outText = removeEndingCRLF(splitedString[0]); + } + else + { + outText = splitedString[0]; + } + + return outText; + } + + + private static String removeEndingCRLF(String text) + { + return text.split("\r\n")[0]; + } + + + public static boolean validateChecksum(String text, String expectedChecksum) throws PlugInBaseException + { + int sum = 0; + for (byte c : text.getBytes()) + { + sum += c; + } + + expectedChecksum = removeEndingCRLF(expectedChecksum); + + long targetChecksum = Long.parseLong(expectedChecksum, 16); + + // LOG.debug("expected Checksum: {}, targetChecksum {}.", expectedChecksum, targetChecksum); + + if (targetChecksum != sum) + { + throw new PlugInBaseException(PlugInExceptionType.FailedCRCCheck, // + new Object[] { targetChecksum, sum }); + } + + return true; + + } + + + public static void setCurrentDebug(boolean debugIn) + { + currentDebug = debugIn; + } + + + public static boolean getCurrentDebug() + { + return currentDebug; + } + + + public static void resetDebug() + { + currentDebug = debug; + } + +} Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/plugin/CGMSPlugInServer.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/plugin/CGMSPlugInServer.java 2017-09-20 18:35:58 UTC (rev 1477) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/plugin/CGMSPlugInServer.java 2017-10-14 17:53:18 UTC (rev 1478) @@ -125,7 +125,7 @@ @Override public String getName() { - return ic.getMessage("CGMS_PLUGIN"); + return i18nControl.getMessage("CGMS_PLUGIN"); } @@ -145,7 +145,7 @@ @Override public void initPlugIn() { - ic = dataAccess.getI18nControlInstance(); + i18nControl = dataAccess.getI18nControlInstance(); if (dataAccessCGMS == null) { @@ -226,19 +226,19 @@ @Override public JMenu getPlugInMainMenu() { - JMenu menu_cgms = ATSwingUtils.createMenu("MN_CGMS", null, ic_local); + JMenu menu_cgms = ATSwingUtils.createMenu("MN_CGMS", null, i18nControlLocal); JMenuItem menu = ATSwingUtils.createMenuItem(menu_cgms, "MN_CGMS_READ", // "MN_CGMS_READ_DESC", "plugin_read_data", // - this, null, ic_local, DataAccessCGMS.getInstance(), parent); + this, null, i18nControlLocal, DataAccessCGMS.getInstance(), parent); menus[0] = menu; - menus[0].setEnabled(DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), - DownloadSupportType.DownloadData)); + menus[0].setEnabled( + DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), DownloadSupportType.DownloadData)); menu = ATSwingUtils.createMenuItem(menu_cgms, "MN_CGMS_READ_CONFIG", // "MN_CGMS_READ_CONFIG_DESC", "plugin_read_config", // - this, null, ic_local, DataAccessCGMS.getInstance(), parent); + this, null, i18nControlLocal, DataAccessCGMS.getInstance(), parent); menus[1] = menu; menus[1].setEnabled(DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), @@ -246,34 +246,34 @@ menu = ATSwingUtils.createMenuItem(menu_cgms, "MN_CGMS_READ_FILE", // "MN_CGMS_READ_FILE_DESC", "plugin_read_data_file", // - this, null, ic_local, DataAccessCGMS.getInstance(), parent); + this, null, i18nControlLocal, DataAccessCGMS.getInstance(), parent); menus[2] = menu; - menus[2].setEnabled(DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), - DownloadSupportType.DownloadDataFile)); + menus[2].setEnabled( + DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), DownloadSupportType.DownloadDataFile)); menu_cgms.addSeparator(); ATSwingUtils.createMenuItem(menu_cgms, "MN_CGMS_VIEW_DATA", // "MN_CGMS_VIEW_DATA_DESC", "cgms_view_data", // - this, null, ic_local, DataAccessCGMS.getInstance(), parent); + this, null, i18nControlLocal, DataAccessCGMS.getInstance(), parent); menu_cgms.addSeparator(); ATSwingUtils.createMenuItem(menu_cgms, "MN_CGMS_LIST", // "MN_CGMS_LIST_DESC", "plugin_list", // - this, null, ic_local, DataAccessCGMS.getInstance(), parent); + this, null, i18nControlLocal, DataAccessCGMS.getInstance(), parent); menu_cgms.addSeparator(); ATSwingUtils.createMenuItem(menu_cgms, "MN_CGMS_CONFIG", // "MN_CGMS_CONFIG_DESC", "plugin_config", // - this, null, ic_local, DataAccessCGMS.getInstance(), parent); + this, null, i18nControlLocal, DataAccessCGMS.getInstance(), parent); menu_cgms.addSeparator(); ATSwingUtils.createMenuItem(menu_cgms, "MN_CGMS_ABOUT", // - "MN_CGMS_ABOUT_DESC", "plugin_about", this, null, ic_local, DataAccessCGMS.getInstance(), parent); + "MN_CGMS_ABOUT_DESC", "plugin_about", this, null, i18nControlLocal, DataAccessCGMS.getInstance(), parent); return menu_cgms; } @@ -284,12 +284,12 @@ */ public void refreshMenusAfterConfig() { - menus[0].setEnabled(DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), - DownloadSupportType.DownloadData)); - menus[1].setEnabled(DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), - DownloadSupportType.DownloadConfig)); - menus[2].setEnabled(DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), - DownloadSupportType.DownloadDataFile)); + menus[0].setEnabled( + DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), DownloadSupportType.DownloadData)); + menus[1].setEnabled( + DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), DownloadSupportType.DownloadConfig)); + menus[2].setEnabled( + DownloadSupportType.isOptionSet(dataAccessCGMS.getDownloadStatus(), DownloadSupportType.DownloadDataFile)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-09-20 18:36:01
|
Revision: 1477 http://sourceforge.net/p/ggc/code/1477 Author: andyrozman Date: 2017-09-20 18:35:58 +0000 (Wed, 20 Sep 2017) Log Message: ----------- ggc support changes Modified Paths: -------------- trunk/ggc-support/ggc-support/eclipse/ggc profile.xml trunk/ggc-support/web_page/docs/Changelog trunk/ggc-support/web_page/docs/How_Can_I_Help.txt trunk/ggc-support/web_page/docs/README.de trunk/ggc-support/web_page/docs/README.en trunk/ggc-support/web_page/docs/README.si trunk/ggc-support/web_page/inc_download.inc trunk/ggc-support/web_page/inc_news.inc trunk/ggc-support/web_page/index.php Added Paths: ----------- trunk/ggc-support/ggc-assembly/ trunk/ggc-support/ggc-assembly/pom.xml trunk/ggc-support/ggc-assembly/src/ trunk/ggc-support/ggc-assembly/src/assembly/ trunk/ggc-support/ggc-assembly/src/assembly/ggc-release.xml trunk/ggc-support/ggc-support/template_root/ Added: trunk/ggc-support/ggc-assembly/pom.xml =================================================================== --- trunk/ggc-support/ggc-assembly/pom.xml (rev 0) +++ trunk/ggc-support/ggc-assembly/pom.xml 2017-09-20 18:35:58 UTC (rev 1477) @@ -0,0 +1,40 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-assembly</artifactId> + <version>0.8-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <packaging>pom</packaging> + <name>GGC Assembly</name> + <artifactId>ggc-assembly</artifactId> + <version>0.1</version> + + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distro-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/assembly/bin.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> + Added: trunk/ggc-support/ggc-assembly/src/assembly/ggc-release.xml =================================================================== --- trunk/ggc-support/ggc-assembly/src/assembly/ggc-release.xml (rev 0) +++ trunk/ggc-support/ggc-assembly/src/assembly/ggc-release.xml 2017-09-20 18:35:58 UTC (rev 1477) @@ -0,0 +1,29 @@ +<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> + <id>bin</id> + <formats> + <format>dir</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <moduleSets> + <moduleSet> + + <!-- Enable access to all projects in the current multimodule build! --> + <useAllReactorProjects>true</useAllReactorProjects> + + <!-- Now, select which projects to include in this module-set. --> + <includes> + <include>atech-tools</include> + <include>ggc-core-app</include> + <include>ggc-plugins</include> + + <include>ggc-desktop-app</include> + </includes> + <binaries> + <outputDirectory>target/maven-assembly-plugin</outputDirectory> + <unpack>false</unpack> + </binaries> + </moduleSet> + </moduleSets> +</assembly> \ No newline at end of file Modified: trunk/ggc-support/ggc-support/eclipse/ggc profile.xml =================================================================== --- trunk/ggc-support/ggc-support/eclipse/ggc profile.xml 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/ggc-support/eclipse/ggc profile.xml 2017-09-20 18:35:58 UTC (rev 1477) @@ -205,7 +205,7 @@ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> Modified: trunk/ggc-support/web_page/docs/Changelog =================================================================== --- trunk/ggc-support/web_page/docs/Changelog 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/web_page/docs/Changelog 2017-09-20 18:35:58 UTC (rev 1477) @@ -603,7 +603,7 @@ all texts for check and select elements were displayed to close to control 2006-04-14 (v0.2.1.10) Andy Rozman <and...@us...> - * moved ggc.gui.PropertiesFrame to ggc.gui.cfg.PropertiesDialog, and changed internal + * moved ggc.gui.PropertiesFrame to ggc.gui.dialogs.config.PropertiesDialog, and changed internal workings, so that after properties are done, we can save all setting and not just the current as it was till now. * changed DailyStatsDialog to display graph and ti display error if no row was selected. Modified: trunk/ggc-support/web_page/docs/How_Can_I_Help.txt =================================================================== --- trunk/ggc-support/web_page/docs/How_Can_I_Help.txt 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/web_page/docs/How_Can_I_Help.txt 2017-09-20 18:35:58 UTC (rev 1477) @@ -32,7 +32,7 @@ a.) Visit the bug reporting site for our project and enter the bug by yourself. Please attach the zipped log. The site is (data should be entered in English): - http://sourceforge.net/tracker/?group_id=49749&atid=457319 + http://sourceforge.net/tracker/?groupId=49749&atid=457319 You don't need to be member at sourceforge to add this information, if you are not please, write your email address somewhere in the error report. Describe exactly what you were doing when the exception occurred and how the problem @@ -58,7 +58,7 @@ know. If you find that some functionality is missing, again, let us know. You can use either email, or you can use the following form (data should be entered in English): -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-support/web_page/docs/README.de =================================================================== --- trunk/ggc-support/web_page/docs/README.de 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/web_page/docs/README.de 2017-09-20 18:35:58 UTC (rev 1477) @@ -1,3 +1,6 @@ +NOT UPDATED, PLEASE LOOK AT README.en instead. + + GNU Gluco Control (GGC) ======================= @@ -192,7 +195,7 @@ a) Gehen Sie zur Fehlerberichtserstattungsseite für dieses Projekt und geben Sie den Fehler selbst ein. Bitte fügen Sie das gepackte Protokoll bei. Die - Seite ist: http://sourceforge.net/tracker/?group_id=49749&atid=457319 (Bitte + Seite ist: http://sourceforge.net/tracker/?groupId=49749&atid=457319 (Bitte geben Sie Fehlerberichte nur auf Englisch ein!) Sie müssen kein Sourceforge-Mitglied sein, um Fehler zu berichten. Sofern Sie kein Mitglied sind, vermerken Sie bitte Ihre E-Mail-Adresse im @@ -221,7 +224,7 @@ nicht? Bitte berichten Sie über Ihre Erfahrungen (vor allem negative). Sie können entweder E-Mail schreiben oder oder folgendes Formular (Englisch) ausfüllen: -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-support/web_page/docs/README.en =================================================================== --- trunk/ggc-support/web_page/docs/README.en 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/web_page/docs/README.en 2017-09-20 18:35:58 UTC (rev 1477) @@ -26,32 +26,28 @@ 2. CURRENT VERSION AND STATUS ============================= -This is version 0.4 of GGC. +This is version 0.8 of GGC. -At this point we are at version 0.4, which is second public release. If you have -installed version 0.3, you can either deinstall and install 0.4 or do updates -(you will need to apply two of them (0.3.1 and 0.4): instructions are Update package. +We are now few years in the "production", which means that most parts of software +are quite stable, and in last few years we mostly concentrated on adding different +devices into our numerous plugins. -If you used any of "preview" versions (before 0.3), you will need to uninstall. -We made a lot of changes in database and application itself, so you can't update -old version (if you already have data in old application contact us, and we will -help you migrate it to new version). +Overall arhitecture changed few years ago, so we now have base (desktop) application +which calls several plugins (tools), which handle different type of areas (Meter, Pump, +Nutrition and CGMS). -Updates are now possible, but so far only manual updates. We are working on -automatic updates, but we are still far from working model. +Application is by default limited to internal database, but with little work, you +can get it working with almost any database on market. We are still working on +Database Tool, which will help user to create new instance of GGC database in any +JDBC supported database system, but there are several utilities available even now, +that you could manually do this (see file 'How_Can_I_Help.txt'). -In this public release you can still only use the internal database. If you have -little above average computer knowledge (read 'if you like to dabble'), you can -try to make it work with any database (see file 'How_Can_I_Help.txt') with just a -little work. +We usually produce 1-2 updates pro year, so you could expect next release at end of +2017. -New (major) releases are planned to occur in 6 month intervals (we almost managed -that one). This means that you can expect release 0.5 somewhere in June 2009. +We also switched to maven build system, which helps our developers, so that they are +not limited to one editor anymore. -A minor release will be done, when functionality has been changed in such a way -that it is beneficial to user to be released (major functionality changes and -bug fixes) - For now you need to update files manually, which means exactly following the instructions supplied with the release (there will be a file called 'How To Upgrade.txt' supplied with each upgrade release). @@ -66,27 +62,43 @@ 3. WHAT FUNCTIONALITY IS AVAILABLE ================================== -- Adding Daily data about Insulin, BG entries, activity, urine, comments -- Display graphs for this Pen/Injection therapy (new framework, still work in progress) +- Adding Daily data about Insulin, BG entries, activity, urine, comments (in Pen/Injection + mode) +- Same functionalities are also available in Pump mode +- Display graphs - Food databases for "Carb Counting": USDA Nutrition DB, User Nutrition DB and Meals database or foods and CH as free text -- Printing reports +- Printing reports (with several types of data Pen/Injection, Pump data, together with + CGMS data - Update mechanism (client side only), this means that until the server side of update is done, you won't be able to update, but as soon as that works you will have the option to update. - Backup mechanism (and restore) - Bolus Helper and Simple Ratio Settings -- Meter Tool finished. Now we just have to add more devices. -- Pump Tool: Framework is work in progress, almost finished. Added is Manual adding of - data which is important pre-step, for actual reading and import from devices +- Meter plugin: all functionalities there, added several families of meters: + Ascensia, Accu-chek, One Touch, Menarini, Arkray, Abbott +- Pump Tool: all functionalities there, added several families of pumps: + Accu-Chek, Animas, Dana and Insulet +- CGMS Tool: all functionalities there, added some families of CGMS: + Dexcom G4, Animas Vibe (G4) support +- and more... - 4. PLANNED FUNCTIONALITY ======================== -Version 0.5 +Version 0.9 ------------ +- Db Update +- Doctors/Appointments functionality integration +- Crowdsourcing Translation (integration of current TranslationTool into application and + implementation of server side tool OR perhaps use of some external crowdsourcing app) +- Medical inventory - Listing of everything that patient has, and what he needs to + get to handle diabetes (and also any other condition) +- Basic Minimed Pump support via Contour Next Link + +Version 0.10 +------------ - DB Tool (for using other databases and install of initial data) (**) - Multi person instance - Finalization of GGC Little, which is used as a resident application for adding @@ -94,24 +106,19 @@ - Update mechanism (server side) (**) - Fully write English help files and add help through application (English version so far) (**) - Add some functionality to food databases -- Extended Ratio Settings, Ratio Helper -- New Graphs for Pen/Injection theraphy -Version 0.6 + +Version 0.xx ------------ -- Automatic DB Update - GGC Network (running several instances of GGC on several computers) - I18n Help Files -- CGMS Tool: <Basic CGMS support> + - Synchronization (for GGC network) - Links to data about diabetes on internet -- GGC PPC - the version of the application to be used by the Pocket PC (not all the +- GGC Android - the version of the application to be used by the Android (not all the functionality of the full version will be available) -- Appointments (adding appointment, adding data from doctor's visit), Doctors - management (adding) -- Medical stock - Listing of everything that patient has, and what he needs to - get to handle diabetes (and also any other condition) + - Remote Food database functionality @@ -130,30 +137,42 @@ Currently supported devices: - Bayer/Ascensia: whole family - Roche/Accu-chek: all devices supported by Accu-Chek Pix device + - Menarini, + - Arkray, + - Abbott - LifeScan: OT Ultra/2, OT UltraSmart, OT Ultra Mini/Easy -Current version of plugin: 1.0.5 +Current version of plugin: 2.4.2 + PUMP-TOOL ---------- This is plug-in for entering, retrieving and handling data from Insulin Pumps. -We have already started with development and most of framework is ready for Pump -data. For now we have added Manual adding of Pump Data and next step is retrieval -of data from Pumps. First supported Pumps will be those of Roche and Minimed (at -first through CareLink export file) and we have some developers also working on -Animas. +Currently supported devices: + - Roche/Accu-chek: all devices through Smart Pix + - Animas: All newer devices + - Minimed: no support yet, but in work + - Dana +Current version of plugin: 2.0.3 - CGMS-TOOL ---------- -This is a plug-in for retrieving data from CGMS device and viewing of this data. This -project is still in the planning phase. The project will move into the development phase -by end of 2009. The first supported CGMS will be that of Minimed through export file from -CareLink. +This is a plug-in for retrieving data from CGMS device and viewing of this data. +Currently supported devices: + - Dexcom G4 + - Animas Vibe (G4) Support +Current version of plugin: 1.5.3 +NUTRITION TOOL +-------------- + +Plugin for Nutrition databases. +Current version of plugin: 1.4.2 + + 6. HOW CAN I HELP AS REGULAR USER ================================== @@ -181,7 +200,7 @@ a.) Visit the bug reporting site for our project and enter the bug by yourself. Please attach the zipped log. The site is (data should be entered in English): - http://sourceforge.net/tracker/?group_id=49749&atid=457319 + http://sourceforge.net/tracker/?groupId=49749&atid=457319 You don't need to be member at sourceforge to add this information, if you are not please, write your email address somewhere in the error report. Describe exactly what you were doing when the exception occurred and how the problem @@ -208,7 +227,7 @@ know. If you find that some functionality is missing, again, let us know. You can use either email, or you can use the following form (data should be entered in English): -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-support/web_page/docs/README.si =================================================================== --- trunk/ggc-support/web_page/docs/README.si 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/web_page/docs/README.si 2017-09-20 18:35:58 UTC (rev 1477) @@ -1,4 +1,7 @@ +NOT UPDATED, PLEASE LOOK AT README.en instead. + + GNU Gluco Control (GGC) ======================= @@ -185,7 +188,7 @@ a.) Obiščite spletno stran za poročanje hroščev in vnesite hrošča. Prosim pripnite arhivirano dnevniško datoteko. Spletna stran je (podatki morajo biti vnešeni - v angleščini) http://sourceforge.net/tracker/?group_id=49749&atid=457319 + v angleščini) http://sourceforge.net/tracker/?groupId=49749&atid=457319 Za vpis teh podatkov ne rabite biti član portala sourceforge.net. Če niste član prosim pustite svoj e-mail naslov nekje v poročilu. Čim bolj natančno opišite kaj ste delali, ko je prišlo do napake in kako se je aplikacija obnašala po @@ -211,7 +214,7 @@ malo manj. Če ste našli dele GGC za katere mislite, da bi lahko delovali boljše, nam prosim sporočite to. Lahko uporabite email, ali pa uporabite naslednjo spletno stran (na tej strani morajo biti podatki vpisani v angleščini): -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-support/web_page/inc_download.inc =================================================================== --- trunk/ggc-support/web_page/inc_download.inc 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/web_page/inc_download.inc 2017-09-20 18:35:58 UTC (rev 1477) @@ -315,7 +315,7 @@ compiled files will be stored into ggc-support\bin folder from where you can directly run it.<br> Here is the link to the Sourceforge SVN Page:<br> - <a href="http://sourceforge.net/svn/?group_id=49749">http://sourceforge.net/svn/?group_id=49749</a> <br><br> + <a href="http://sourceforge.net/svn/?groupId=49749">http://sourceforge.net/svn/?groupId=49749</a> <br><br> For details on how to check out sources see the Sourceforge SVN page.<br><br> <li>CVS:</li> @@ -322,7 +322,7 @@ <br> CVS system was deprecated (there are still old file there) when Sourceforge installed SVN, which is now the way to get sources.<br><br> - <a href="http://sourceforge.net/cvs/?group_id=49749">http://sourceforge.net/cvs/?group_id=49749</a> <br><br> + <a href="http://sourceforge.net/cvs/?groupId=49749">http://sourceforge.net/cvs/?groupId=49749</a> <br><br> </ul> @@ -330,7 +330,7 @@ <h2>Link to sourceforge files download area</h2> - <a href="http://sourceforge.net/project/showfiles.php?group_id=49749">http://sourceforge.net/project/showfiles.php?group_id=49749</a><br> + <a href="http://sourceforge.net/project/showfiles.php?groupId=49749">http://sourceforge.net/project/showfiles.php?groupId=49749</a><br> </ul> Modified: trunk/ggc-support/web_page/inc_news.inc =================================================================== --- trunk/ggc-support/web_page/inc_news.inc 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/web_page/inc_news.inc 2017-09-20 18:35:58 UTC (rev 1477) @@ -3,9 +3,75 @@ <h2 class="head">News</h2> + + + + + <table cellpadding="3" cellspacing="0" align="center" width="100%" summary="" class="container"> <tr class="newsheader"> + <td width="150">2017-07-25</td> + <td>Translations using Crowdsource Translations - Crowdin</td> + </tr> + <tr> + <td colspan="2"> + Since Crowdsourced Translation are new hit lately, we decided to put our project + up on crowdin, so that you could more easily help to translate the project.<br><br> + + We put all files up there, so you can start working on translations if you would + like to have application available in your language and are prepared to put in + some work. I have enabled some of the languages, and if your language is not one + of enabled ones, please contact me, and I will enable your language.<br><br> + + Here is invite link, please click and follow instructions. + <a href="https://crowdin.com/project/gnu-gluco-control-core/invite">Crowdin GGC Invite</a><br><br> + + We are also working on integration of our own translation tool into application, but that will have + to wait, for few more months. + <br><br> + Andy<br> + Project Manager/Lead Developer + </tr> + </table> + + <br><br> + + +<!-- + <table cellpadding="3" cellspacing="0" align="center" width="100%" summary="" class="container"> + <tr class="newsheader"> <td width="150">2016-06-29</td> + <td>Release 0.8.0</td> + </tr> + <tr> + <td colspan="2"> + It's been long time again... my "real" life is throwing me for loops lately, so GGC has to suffer + because of it.<BR> + This release contains mostly bug fixes and we added two new meter families: Menarini and Arkray. There + are about 10 new devices there, they are not tested, so please be careful with it and let us know if + something doesn't work.<BR> + Most of development, was done on Doctor's Appointments and Inventory handling. But since both this + changes also require changes to database, some of work was also done on Update functionality, which + is requirement for new two functionalities, so you will have to wait for all 3 of them to be there + (I hope it will come out in 0.9).<BR> + + + + + If you find some problems please report and I will try to make a fix release if needed.<br> + <br> + Next release is planned for end of year 2017. + <br> + Any help from any of you is greatly appreciated... I try to reply to each mail I get... + </tr> + </table> + + <br><br> +--> + + <table cellpadding="3" cellspacing="0" align="center" width="100%" summary="" class="container"> + <tr class="newsheader"> + <td width="150">2016-06-29</td> <td>Release 0.7.0</td> </tr> <tr> Modified: trunk/ggc-support/web_page/index.php =================================================================== --- trunk/ggc-support/web_page/index.php 2017-09-20 18:33:02 UTC (rev 1476) +++ trunk/ggc-support/web_page/index.php 2017-09-20 18:35:58 UTC (rev 1477) @@ -61,11 +61,11 @@ <td align="center" valign="bottom"> This site is hosted on:<br> - <a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=49749&type=4" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a><br> + <a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?groupId=49749&type=4" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a><br> <!-- <a href="http://sourceforge.net"> - <img src="http://sourceforge.net/sflogo.php?group_id=49749&type=5" width="210" height="62" border="0" alt="SourceForge Logo"> --> + <img src="http://sourceforge.net/sflogo.php?groupId=49749&type=5" width="210" height="62" border="0" alt="SourceForge Logo"> --> </a> <br> <font size="-2"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-09-20 18:33:05
|
Revision: 1476 http://sourceforge.net/p/ggc/code/1476 Author: andyrozman Date: 2017-09-20 18:33:02 +0000 (Wed, 20 Sep 2017) Log Message: ----------- - Small changes Modified Paths: -------------- trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/GGCLittle.java Modified: trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/GGCLittle.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/GGCLittle.java 2017-09-20 18:31:17 UTC (rev 1475) +++ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/GGCLittle.java 2017-09-20 18:33:02 UTC (rev 1476) @@ -598,8 +598,10 @@ private void showFunctionalityNotAvailableYet(String functionality) { - dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, - functionality + " is not working in this application yet. Please use full version of GGC instead."); + ATSwingUtils.showMessageDialog(this, // + ATSwingUtils.DialogType.Error, // + functionality + " is not working in this application yet. Please use full version of GGC instead.", // + i18nControl); } @@ -607,8 +609,12 @@ { if (dataAccess.isPumpMode()) { - dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, - errorDescriptionTarget + " for Pump is not working in this application yet. Please use GGC instead."); + ATSwingUtils.showMessageDialog(this, // + ATSwingUtils.DialogType.Error, // + errorDescriptionTarget + + " for Pump is not working in this application yet. Please use full version of GGC instead.", // + i18nControl); + return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-09-20 18:31:20
|
Revision: 1475 http://sourceforge.net/p/ggc/code/1475 Author: andyrozman Date: 2017-09-20 18:31:17 +0000 (Wed, 20 Sep 2017) Log Message: ----------- - Small changes Modified Paths: -------------- trunk/ggc-doctor-app/ggc-desktop-doctor/src/main/java/ggc/doc/DocMainFrame.java trunk/ggc-doctor-app/ggc-desktop-doctor/src/main/java/ggc/gui/dialogs/DailyRowDialog.java Modified: trunk/ggc-doctor-app/ggc-desktop-doctor/src/main/java/ggc/doc/DocMainFrame.java =================================================================== --- trunk/ggc-doctor-app/ggc-desktop-doctor/src/main/java/ggc/doc/DocMainFrame.java 2017-09-20 18:30:21 UTC (rev 1474) +++ trunk/ggc-doctor-app/ggc-desktop-doctor/src/main/java/ggc/doc/DocMainFrame.java 2017-09-20 18:31:17 UTC (rev 1475) @@ -33,9 +33,9 @@ import ggc.core.util.DataAccess; import ggc.core.util.RefreshInfo; import ggc.gui.dialogs.defs.StockListDef; +import ggc.gui.dialogs.ratio.RatioBaseDialog; +import ggc.gui.dialogs.ratio.RatioExtendedDialog; import ggc.gui.panels.info.InfoPanel; -import ggc.shared.ratio.RatioBaseDialog; -import ggc.shared.ratio.RatioExtendedDialog; /** * Application: GGC - GNU Gluco Control @@ -118,7 +118,6 @@ */ public InfoPanel informationPanel; - /** * Static definitions (Look and Feel) */ @@ -1245,8 +1244,8 @@ } else // if ((command.equals("report_pdf_extended")) || - if ((command.equals("file_login")) || (command.equals("report_foodmenu_ext3")) - || (command.equals("file_logout"))) + if ((command.equals("file_login")) || (command.equals("report_foodmenu_ext3")) + || (command.equals("file_logout"))) { featureNotImplemented(command, "0.5"); } Modified: trunk/ggc-doctor-app/ggc-desktop-doctor/src/main/java/ggc/gui/dialogs/DailyRowDialog.java =================================================================== --- trunk/ggc-doctor-app/ggc-desktop-doctor/src/main/java/ggc/gui/dialogs/DailyRowDialog.java 2017-09-20 18:30:21 UTC (rev 1474) +++ trunk/ggc-doctor-app/ggc-desktop-doctor/src/main/java/ggc/gui/dialogs/DailyRowDialog.java 2017-09-20 18:31:17 UTC (rev 1475) @@ -6,8 +6,8 @@ import ggc.core.data.ExtendedDailyValue; import ggc.core.plugins.NutriPlugIn; import ggc.core.util.DataAccess; -import ggc.shared.bolushelper.BolusHelper; -import ggc.shared.fooddesc.FoodDescriptionDialog; +import ggc.gui.dialogs.bolushelper.BolusHelper; +import ggc.gui.dialogs.fooddesc.FoodDescriptionDialog; import java.awt.Component; import java.awt.Container; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-09-20 18:30:24
|
Revision: 1474 http://sourceforge.net/p/ggc/code/1474 Author: andyrozman Date: 2017-09-20 18:30:21 +0000 (Wed, 20 Sep 2017) Log Message: ----------- - Small change Modified Paths: -------------- trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/core/doc/util/DataAccessDoc.java Modified: trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/core/doc/util/DataAccessDoc.java =================================================================== --- trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/core/doc/util/DataAccessDoc.java 2017-09-17 22:59:45 UTC (rev 1473) +++ trunk/ggc-core-app/ggc-doctor-core/src/main/java/ggc/core/doc/util/DataAccessDoc.java 2017-09-20 18:30:21 UTC (rev 1474) @@ -217,7 +217,7 @@ // Help Context Init // HelpContext hc = new HelpContext("../data/help/en/GGC.hs"); - HelpContext hc = new HelpContext("../data/" + this.lang_mgr.getHelpSet()); + HelpContext hc = new HelpContext("../data/" + this.languageManager.getHelpSet()); this.setHelpContext(hc); this.helpEnabled = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-09-17 22:59:47
|
Revision: 1473 http://sourceforge.net/p/ggc/code/1473 Author: andyrozman Date: 2017-09-17 22:59:45 +0000 (Sun, 17 Sep 2017) Log Message: ----------- - some minor meter plugin changes Modified Paths: -------------- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntryDataType.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/db/GGCMeterDb.java Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntryDataType.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntryDataType.java 2017-09-17 22:53:33 UTC (rev 1472) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntryDataType.java 2017-09-17 22:59:45 UTC (rev 1473) @@ -1,6 +1,8 @@ package ggc.meter.data; import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; import com.atech.i18n.I18nControlAbstract; @@ -19,7 +21,7 @@ String description; Integer pumpExtCode; - static HashMap<Integer, String> allowedPumpTypes; + static Set<Integer> allowedPumpTypes; static HashMap<MeterValuesEntryDataType, String> processorTypes; boolean isProcessor; String translation; @@ -48,17 +50,17 @@ } - public static HashMap<Integer, String> getAllowedPumpTypes() + public static Set<Integer> getAllowedPumpTypes() { if (allowedPumpTypes == null) { - allowedPumpTypes = new HashMap<Integer, String>(); + allowedPumpTypes = new HashSet<Integer>(); for (MeterValuesEntryDataType mpid : values()) { if (mpid.pumpExtCode != null) { - allowedPumpTypes.put(mpid.pumpExtCode, null); + allowedPumpTypes.add(mpid.pumpExtCode); } } } Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/db/GGCMeterDb.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/db/GGCMeterDb.java 2017-09-17 22:53:33 UTC (rev 1472) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/db/GGCMeterDb.java 2017-09-17 22:59:45 UTC (rev 1473) @@ -2,7 +2,7 @@ import java.util.*; -import org.hibernate.Query; +import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.slf4j.Logger; @@ -158,21 +158,17 @@ { LOG.debug("getPumpData() - Process"); - // FIXME - Query q = this.getSession().createQuery( - " SELECT dv FROM ggc.core.db.hibernate.pump.PumpDataExtendedH as dv " + " WHERE dv.person_id=" - + m_da.getCurrentUserId() + " AND dv.dt_info IN " + getDataListForSQL(timeMarks) - + " AND dv.type IN " + getDataListForSQL(MeterValuesEntryDataType.getAllowedPumpTypes()) - + " ORDER BY dv.dt_info"); + List<PumpDataExtendedH> pumpDataSource = getHibernateData(PumpDataExtendedH.class, + Arrays.asList(getPersonCriterion(), // + getDataListForCriteria("dtInfo", timeMarks.keySet()), // + getDataListForCriteria("type", MeterValuesEntryDataType.getAllowedPumpTypes()) // + ), // + Arrays.asList(Order.asc("dtInfo")) // + ); - Iterator<?> it = q.list().iterator(); - - while (it.hasNext()) + for (PumpDataExtendedH pde : pumpDataSource) { - PumpDataExtendedH pde = (PumpDataExtendedH) it.next(); - - int time = (int) (pde.getDtInfo() / 100); // same time as in - // DailyValueH + int time = (int) (pde.getDtInfo() / 100); // same time as in DailyValueH pumpData.put(time + "_" + pde.getType(), pde); } @@ -185,51 +181,50 @@ return pumpData; } + // /** + // * Get Meter Data (with help of time marks) + // * + // * @param timeMarks + // * @return + // * @deprecated + // */ + // public Map<Long, MeterValuesEntry> getMeterData(Hashtable<Long, String> timeMarks) + // { + // + // Map<Long, MeterValuesEntry> meter_data = new HashMap<Long, MeterValuesEntry>(); + // + // if (timeMarks.size() == 0) + // return meter_data; + // + // try + // { + // LOG.debug("getMeterData() - Process"); + // + // Query q = this.getSession().createQuery( // + // " SELECT dv from ggc.core.db.hibernate.pen.DayValueH as dv " + // + // " WHERE person_id=" + m_da.getCurrentUserId() + // + // " AND dv.dt_info IN " + getDataListForSQL(timeMarks) + // + // " ORDER BY dv.dt_info ASC"); + // + // Iterator<?> it = q.list().iterator(); + // + // while (it.hasNext()) + // { + // MeterValuesEntry mve = new MeterValuesEntry((DayValueH) it.next()); + // meter_data.put(mve.getDateTime(), mve); + // } + // + // } + // catch (Exception ex) + // { + // LOG.error("Error getting meter data: " + ex, ex); + // } + // + // return meter_data; + // + // } - /** - * Get Meter Data (with help of time marks) - * - * @param timeMarks - * @return - * @deprecated - */ - public Map<Long, MeterValuesEntry> getMeterData(Hashtable<Long, String> timeMarks) - { - Map<Long, MeterValuesEntry> meter_data = new HashMap<Long, MeterValuesEntry>(); - - if (timeMarks.size() == 0) - return meter_data; - - try - { - LOG.debug("getMeterData() - Process"); - - Query q = this.getSession().createQuery( // - " SELECT dv from ggc.core.db.hibernate.pen.DayValueH as dv " + // - " WHERE person_id=" + m_da.getCurrentUserId() + // - " AND dv.dt_info IN " + getDataListForSQL(timeMarks) + // - " ORDER BY dv.dt_info ASC"); - - Iterator<?> it = q.list().iterator(); - - while (it.hasNext()) - { - MeterValuesEntry mve = new MeterValuesEntry((DayValueH) it.next()); - meter_data.put(mve.getDateTime(), mve); - } - - } - catch (Exception ex) - { - LOG.error("Error getting meter data: " + ex, ex); - } - - return meter_data; - - } - - // private String getDataListForSQL(Map<?, ?> ht) // { // StringBuffer sb = new StringBuffer(); @@ -257,6 +252,12 @@ } + private Criterion getDataListForCriteria(String parameterName, Set<?> data) + { + return Restrictions.in(parameterName, data); + } + + public GraphTimeDataCollection getGraphTimeData(GregorianCalendar gcFrom, GregorianCalendar gcTill, GraphDefinitionDto definitionDto) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-09-17 22:53:36
|
Revision: 1472 http://sourceforge.net/p/ggc/code/1472 Author: andyrozman Date: 2017-09-17 22:53:33 +0000 (Sun, 17 Sep 2017) Log Message: ----------- - future template Added Paths: ----------- trunk/ggc-future/docs/ trunk/ggc-future/docs/Hardware_Devices_Future.txt trunk/ggc-future/ggc-future-template/ trunk/ggc-future/ggc-future-template/pom.xml trunk/ggc-future/ggc-future-template/src/ trunk/ggc-future/ggc-future-template/src/main/ trunk/ggc-future/ggc-future-template/src/main/java/ trunk/ggc-future/ggc-future-template/src/main/java/ggc/ trunk/ggc-future/ggc-future-template/src/main/java/ggc/cgms/ trunk/ggc-future/ggc-future-template/src/main/java/ggc/cgms/device/ trunk/ggc-future/ggc-future-template/src/main/java/ggc/meter/ trunk/ggc-future/ggc-future-template/src/main/java/ggc/meter/device/ trunk/ggc-future/ggc-future-template/src/main/java/ggc/pump/ trunk/ggc-future/ggc-future-template/src/main/java/ggc/pump/device/ trunk/ggc-future/ggc-future-template/src/main/resources/ trunk/ggc-future/ggc-future-template/src/main/resources/icons/ trunk/ggc-future/ggc-future-template/src/main/resources/icons/icons/ trunk/ggc-future/ggc-future-template/src/main/resources/icons/icons/cgms/ trunk/ggc-future/ggc-future-template/src/main/resources/icons/icons/meters/ trunk/ggc-future/ggc-future-template/src/main/resources/icons/icons/pumps/ trunk/ggc-future/ggc-future-template/src/main/resources/log4j.properties trunk/ggc-future/ggc-future-template/src/test/ trunk/ggc-future/ggc-future-template/src/test/java/ trunk/ggc-future/ggc-future-template/src/test/resources/ Added: trunk/ggc-future/docs/Hardware_Devices_Future.txt =================================================================== --- trunk/ggc-future/docs/Hardware_Devices_Future.txt (rev 0) +++ trunk/ggc-future/docs/Hardware_Devices_Future.txt 2017-09-17 22:53:33 UTC (rev 1472) @@ -0,0 +1,65 @@ +DIABETES HARDWARE DEVICES - PLANNING LIST +========================================== + +Meter +------ + +NAME Status COMMENT +------------------------------------------------------------------------- +Arkray TESTING Need to test with devices +Menarini TESTING Need to test with devices +Contour Next One TESTING Bug found: progress problem +Wellion/Calla ANALYSIS Request for protocols sent (10%) + + + +Pump +------ + +NAME Status COMMENT +------------------------------------------------------------------------- +Minimed 5xx DEVELOPMENT Working on solution (20%) +Minimed 6xx ANALYSIS Waiting for hardware/have some code that can be used +Tandem ON LIST ? 2020 (depending if they come in EU) +Cellnovo ON LIST 2020 + + + +CGMS +------ + +NAME Status COMMENT +------------------------------------------------------------------------- +Abbott Libre DEVELOPMENT Working on solution (10%) +Minimed 5xx ON LIST 2018 +Minimed 6xx ON LIST ? 2019 +Tandem (G4) ON LIST ? 2020 +Roche Eversense ON LIST ? + + + +TIMELINE +========= + +Project Expected Comment +-------------------------------------------------------------------------------- +Libre 30.11. +Arkray 30.12. Test with real device +Menarini 30.12. + + + + + + + + + + +Legend of phases: +ON LIST - considered for implementation +ANALYSIS - gatering information about protocol +DEVELOPMENT - working on solution +TESTING - development done +DONE - development done, but not in release yet +RELEASED - done and released Added: trunk/ggc-future/ggc-future-template/pom.xml =================================================================== --- trunk/ggc-future/ggc-future-template/pom.xml (rev 0) +++ trunk/ggc-future/ggc-future-template/pom.xml 2017-09-17 22:53:33 UTC (rev 1472) @@ -0,0 +1,73 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-future</artifactId> + <version>0.8-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + + <name>GGC Future - XYX (Device)</name> + <artifactId>ggc-device-xyz</artifactId> + <version>0.1-SNAPSHOT</version> + + + <dependencies> + + <dependency> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-core</artifactId> + </dependency> + + <dependency> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-plugins-base</artifactId> + </dependency> + + <!-- If device support is for Meters --> + <dependency> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-meter-tool</artifactId> + </dependency> + + <!-- If device support is for Pumps --> + <dependency> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-pump-tool</artifactId> + </dependency> + + <!-- If device support is for CGMS --> + <dependency> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-cgms-tool</artifactId> + </dependency> + + + <dependency> + <groupId>com.atech-software</groupId> + <artifactId>atech-tools</artifactId> + </dependency> + + <!-- + Any additional libraries - don't forget to copy them in correct project afterwards + + --> + + + </dependencies> + <!-- + <repositories> + <repository> + <id>The Buzz Media Maven Repository</id> + <url>http://maven.thebuzzmedia.com</url> + </repository> + </repositories> + --> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + +</project> Property changes on: trunk/ggc-future/ggc-future-template/pom.xml ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: trunk/ggc-future/ggc-future-template/src/main/resources/log4j.properties =================================================================== --- trunk/ggc-future/ggc-future-template/src/main/resources/log4j.properties (rev 0) +++ trunk/ggc-future/ggc-future-template/src/main/resources/log4j.properties 2017-09-17 22:53:33 UTC (rev 1472) @@ -0,0 +1,59 @@ +### direct log messages to stdout ### +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +#log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +#log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n +#log4j.appender.stdout.layout.ConversionPattern=%d %5p [%c{1}:%L] - %m%n +log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p [%c{1}:%L] - %m%n +#log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p - %m%n + +#log4j.appender.stderr=org.apache.log4j.ConsoleAppender +#log4j.appender.stderr.layout=org.apache.log4j.PatternLayout +##log4j.appender.stderr.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p [%c{1}:%L] - %m%n +#log4j.appender.stderr.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p - %m%n + + +### direct messages to file hibernate.log ### +log4j.appender.file=org.apache.log4j.DailyRollingFileAppender +log4j.appender.file.File=../data/log/GGC.log +log4j.appender.file.DatePattern='.'yyyy-MM-dd +log4j.appender.file.layout=org.apache.log4j.PatternLayout +#log4j.appender.file.layout.ConversionPattern=%d %5p [%c{1}:%L] - %m%n +log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p [%c{1}:%L] - %m%n + + + + +### set log levels - for more verbose logging change 'info' to 'debug' ### + +log4j.rootLogger=debug, stdout, file + +### log just the SQL + +log4j.logger.org.hibernate=info +log4j.logger.org.hibernate.SQL=info + +log4j.logger.ggc.core.db.GGCDb=info + + +### log JDBC bind parameters ### +log4j.logger.org.hibernate.type=info + +### log schema export/update ### +log4j.logger.net.sf.hibernate.tool.hbm2ddl=info +log4j.logger.net.sf.hibernate.tool.hbm2java=info + +### log cache activity ### +#log4j.logger.net.sf.hibernate.cache=debug + +### enable the following line if you want to track down connection ### +### leakages when using DriverManagerConnectionProvider ### +#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace + + +### Redirect needs another formatting +#log4j.logger.com.atech.utils.logs=debug +#log4j.logger.com.atech.utils.logs.layout=org.apache.log4j.PatternLayout +#log4j.logger.com.atech.utils.logs.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p - %m%n + + Property changes on: trunk/ggc-future/ggc-future-template/src/main/resources/log4j.properties ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-09-17 22:50:34
|
Revision: 1471 http://sourceforge.net/p/ggc/code/1471 Author: andyrozman Date: 2017-09-17 22:50:31 +0000 (Sun, 17 Sep 2017) Log Message: ----------- 0.8.0 - AppointmentDialog, WorkingTImeDialog, DoctorDialog Modified Paths: -------------- trunk/ggc-desktop-app/ggc-desktop/data/update/GGC_Update.properties trunk/ggc-desktop-app/ggc-desktop/data/update/version/Versions.txt trunk/ggc-desktop-app/ggc-desktop/doc/Changelog trunk/ggc-desktop-app/ggc-desktop/pom.xml trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/DoctorDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/appointment/AppointmentDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/worktime/WorkingTimeDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/def/StockTypeListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/MainFrame.java Added Paths: ----------- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/test/TestTranslationTool.java Modified: trunk/ggc-desktop-app/ggc-desktop/data/update/GGC_Update.properties =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/data/update/GGC_Update.properties 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/data/update/GGC_Update.properties 2017-09-17 22:50:31 UTC (rev 1471) @@ -102,10 +102,11 @@ COMPONENT_3_GROUP=1 COMPONENT_3_NAME=GGC Little -COMPONENT_3_VERSION=0.2.3 -COMPONENT_3_VERSION_NUM=2 +COMPONENT_3_VERSION=0.3.1 +COMPONENT_3_VERSION_NUM=3 COMPONENT_3_ROOT_DIR=/lib/ggc -COMPONENT_3_FILES=%ROOT%/ggc-little-0.2.3.jar +COMPONENT_3_FILES=%ROOT%/ggc-desktop-little-0.3.1.jar +# v3: new name and new version # Removed: COMPONENT_4_NAME=GGC Lang @@ -113,10 +114,11 @@ COMPONENT_27_GROUP=1 COMPONENT_27_NAME=GGC Help -COMPONENT_27_VERSION=0.2.2 -COMPONENT_27_VERSION_NUM=2 +COMPONENT_27_VERSION=0.2.3 +COMPONENT_27_VERSION_NUM=3 COMPONENT_27_ROOT_DIR=/lib/ggc -COMPONENT_27_FILES=%ROOT%/ggc-help-0.2.2.jar +COMPONENT_27_FILES=%ROOT%/ggc-help-0.2.3.jar +# v3: added doctors help pages COMPONENT_5_GROUP=2 @@ -125,8 +127,8 @@ COMPONENT_5_VERSION_NUM=12 COMPONENT_5_ROOT_DIR=/lib/ggc COMPONENT_5_FILES=%ROOT%/ggc-plugin-base-1.2.2.jar +# ggc-plugins-base - COMPONENT_20_GROUP=2 COMPONENT_20_NAME=Nutrition Tool COMPONENT_20_VERSION=1.4.1 @@ -133,6 +135,7 @@ COMPONENT_20_VERSION_NUM=8 COMPONENT_20_ROOT_DIR=/lib/ggc COMPONENT_20_FILES=%ROOT%/ggc-nutri-tool-1.4.1.jar +# ggc-nutrition-tool COMPONENT_6_GROUP=2 COMPONENT_6_NAME=Meter Tool @@ -160,11 +163,12 @@ COMPONENT_9_NAME=Hibernate Framework COMPONENT_9_VERSION=3.1.3 #COMPONENT_7_VERSION=3.2.6 GA -COMPONENT_9_VERSION_NUM=3 +COMPONENT_9_VERSION_NUM=4 COMPONENT_9_ROOT_DIR=/lib/hibernate3 -COMPONENT_9_FILES=%ROOT%/antlr-2.7.6rc1.jar;%ROOT%/asm-1.5.3.jar;%ROOT%/asm-attrs-1.5.3.jar;%ROOT%/c3p0-0.9.0.jar;%ROOT%/cglib-2.1.3.jar;%ROOT%/commons-logging-1.0.4.jar;%ROOT%/ehcache-1.1.jar;%ROOT%/hibernate3.jar;%ROOT%/jdbc2_0-stdext.jar;%ROOT%/jta-1.0.1B.jar +COMPONENT_9_FILES=%ROOT%/antlr-2.7.6rc1.jar;%ROOT%/asm-1.5.3.jar;%ROOT%/asm-attrs-1.5.3.jar;%ROOT%/c3p0-0.9.0.jar;%ROOT%/cglib-2.1_3.jar;%ROOT%/commons-logging-1.0.4.jar;%ROOT%/ehcache-1.1.jar;%ROOT%/hibernate3.jar;%ROOT%/jdbc2_0-stdext.jar;%ROOT%/jta-1.0.1B.jar # version 2 because component_files changed (removed some old versions) : commons-lang # version 3 removed: ROOT%/commons-collections-2.1.1.jar +# version 4: cglib has different name COMPONENT_10_GROUP=3 COMPONENT_10_NAME=Internal Database [H2] @@ -209,11 +213,11 @@ COMPONENT_16_GROUP=3 COMPONENT_16_NAME=Java Help COMPONENT_16_VERSION=2.0.5 -COMPONENT_16_VERSION_NUM=1 +COMPONENT_16_VERSION_NUM=2 COMPONENT_16_ROOT_DIR=/lib/utils -COMPONENT_16_FILES=%ROOT%/jhall-2.0.5.jar +COMPONENT_16_FILES=%ROOT%/javahelp-2.0.05.jar +# v2: change name - COMPONENT_17_GROUP=3 COMPONENT_17_NAME=Log4j COMPONENT_17_VERSION=1.2.16 Modified: trunk/ggc-desktop-app/ggc-desktop/data/update/version/Versions.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/data/update/version/Versions.txt 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/data/update/version/Versions.txt 2017-09-17 22:50:31 UTC (rev 1471) @@ -19,4 +19,5 @@ 0.5.0.3-2 | [12] 0.6 | [13] 8.2015 0.6.1 | [14] 10.2015 +0.7 | [15] Modified: trunk/ggc-desktop-app/ggc-desktop/doc/Changelog =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/Changelog 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/doc/Changelog 2017-09-17 22:50:31 UTC (rev 1471) @@ -13,9 +13,9 @@ - Stock/Inventory implementation started - refactoring a little - added DialogCreator +- AppointmentDialog, WorkingTImeDialog, DoctorDialog - 0.7.0 [2.2.2016] [Andy] - table layout: - refactoring of info panels Modified: trunk/ggc-desktop-app/ggc-desktop/pom.xml =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/pom.xml 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/pom.xml 2017-09-17 22:50:31 UTC (rev 1471) @@ -62,16 +62,19 @@ <dependency> <groupId>net.sf.ggc</groupId> - <artifactId>ggc-connect-tool</artifactId> + <artifactId>ggc-plugins-connect</artifactId> </dependency> - + + + <!-- GGC Temporary Dependecies (testing only) --> - + <!-- <dependency> <groupId>net.sf.ggc</groupId> <artifactId>ggc-device-menarini</artifactId> </dependency> + --> <!-- Support Libraries --> Modified: trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/DoctorDialog.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/DoctorDialog.java 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/DoctorDialog.java 2017-09-17 22:50:31 UTC (rev 1471) @@ -145,7 +145,10 @@ if (this.doctorType == null) { - dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, "SELECT_DOCTOR_TYPE"); + ATSwingUtils.showMessageDialog(this, // + ATSwingUtils.DialogType.Error, // + "SELECT_DOCTOR_TYPE", // + i18nControl); return false; } Modified: trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/appointment/AppointmentDialog.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/appointment/AppointmentDialog.java 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/appointment/AppointmentDialog.java 2017-09-17 22:50:31 UTC (rev 1471) @@ -223,19 +223,31 @@ if (this.doctorH == null) { - dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, "SELECT_DOCTOR"); + ATSwingUtils.showMessageDialog(this, // + ATSwingUtils.DialogType.Error, // + "SELECT_DOCTOR", // + i18nControl); + return false; } if (StringUtils.isBlank(this.tfAppointment.getText())) { - dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, "ENTER_APPOINTMENT_TEXT"); + ATSwingUtils.showMessageDialog(this, // + ATSwingUtils.DialogType.Error, // + "ENTER_APPOINTMENT_TEXT", // + i18nControl); + return false; } if (this.dtAppointment.getDateTime() == currentTime) { - dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, "ENTER_APPOINTMENT_TIME"); + ATSwingUtils.showMessageDialog(this, // + ATSwingUtils.DialogType.Error, // + "ENTER_APPOINTMENT_TIME", // + i18nControl); + return false; } Modified: trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/worktime/WorkingTimeDialog.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/worktime/WorkingTimeDialog.java 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/worktime/WorkingTimeDialog.java 2017-09-17 22:50:31 UTC (rev 1471) @@ -105,7 +105,11 @@ if (selectedDays.size() == 0) { - dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, "SELECT_DAYS"); + ATSwingUtils.showMessageDialog(this, // + ATSwingUtils.DialogType.Error, // + "SELECT_DAYS", // + i18nControl); + return false; } @@ -113,7 +117,11 @@ if (timeEntries.size() == 0) { - dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, "ADD_TIMES"); + ATSwingUtils.showMessageDialog(this, // + ATSwingUtils.DialogType.Error, // + "ADD_TIMES", // + i18nControl); + return false; } @@ -244,7 +252,8 @@ // { // if (this.listTimes.isSelectionEmpty()) // { - // JOptionPane.showConfirmDialog(this, i18nControl.getMessage("SELECT_ITEM_FIRST"), + // JOptionPane.showConfirmDialog(this, + // i18nControl.getMessage("SELECT_ITEM_FIRST"), // i18nControl.getMessage("ERROR"), // JOptionPane.CLOSED_OPTION); // return; @@ -256,7 +265,8 @@ // { // if (this.m_list_data.isSelectionEmpty()) // { - // JOptionPane.showConfirmDialog(this, i18nControl.getMessage("SELECT_ITEM_FIRST"), + // JOptionPane.showConfirmDialog(this, + // i18nControl.getMessage("SELECT_ITEM_FIRST"), // i18nControl.getMessage("ERROR"), // JOptionPane.CLOSED_OPTION); // return; Modified: trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/def/StockTypeListDef.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/def/StockTypeListDef.java 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/def/StockTypeListDef.java 2017-09-17 22:50:31 UTC (rev 1471) @@ -117,8 +117,8 @@ if (database.isStockSubTypeUsed(stockType)) { - dataAccess.showMessageDialog(this.getParentDialog(), ATSwingUtils.DialogType.Error, - "STOCK_SUB_TYPE_IN_USE"); + ATSwingUtils.showMessageDialog(this.getParentDialog(), ATSwingUtils.DialogType.Error, + "STOCK_SUB_TYPE_IN_USE", i18nControl); } else { Modified: trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/MainFrame.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/MainFrame.java 2017-09-17 22:46:34 UTC (rev 1470) +++ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/MainFrame.java 2017-09-17 22:50:31 UTC (rev 1471) @@ -232,6 +232,17 @@ i18nControl = dataAccess.getI18nControlInstance(); + try + { + LOG.info("dataAccess.getI18nControlRunner(): " + dataAccess.getI18nControlRunner()); + // System.out.println("Exported file: " + + // dataAccess.getI18nControlRunner().exportLanguageFile("en")); + } + catch (Exception e) + { + LOG.error("Problem Test: {}", e.getMessage(), e); + } + dataAccess.addComponent(this); dataAccess.setDeveloperMode(developer_version); Added: trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/test/TestTranslationTool.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/test/TestTranslationTool.java (rev 0) +++ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/test/TestTranslationTool.java 2017-09-17 22:50:31 UTC (rev 1471) @@ -0,0 +1,191 @@ +package ggc.gui.test; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.util.*; + +import javax.swing.*; + +import org.apache.commons.lang.StringEscapeUtils; + +import com.atech.i18n.tool.simple.data.TranslationToolConfigurationDto; +import com.atech.i18n.tool.simple.data.TranslationToolSettingsDto; +import com.atech.i18n.tool.simple.internal.TranslationToolInternalWizard1_ConfigurationCheck; +import com.atech.i18n.tool.simple.internal.TranslationToolInternalWizard2_LanguageSelector; +import com.atech.i18n.tool.simple.internal.TranslationToolInternalWizard3_NewLanguage; + +import ggc.core.util.DataAccess; + +/** + * Created by andy on 29.06.17. + */ +public class TestTranslationTool +{ + + public static void testLocale() + { + Locale.setDefault(Locale.ENGLISH); + + Locale[] availableLocales = Locale.getAvailableLocales(); + + Map<String, Set<Locale>> filterLocales = new HashMap<String, Set<Locale>>(); + + for (Locale locale : availableLocales) + { + // if (StringUtils.isBlank(locale.getDisplayCountry()) && + // StringUtils.isBlank(locale.getVariant())) + + // if (locale.getVariant() != null || + // !locale.getVariant().equals("") ) + // { + // continue; + // } + + if (filterLocales.containsKey(locale.getLanguage())) + { + filterLocales.get(locale.getLanguage()).add(locale); + } + else + { + Set<Locale> newLang = new HashSet<Locale>(); + newLang.add(locale); + + filterLocales.put(locale.getLanguage(), newLang); + } + + // System.out.println("L: " + locale.getLanguage() + "\t V:" + + // locale.getVariant() + "\t " + locale.getDisplayName() + "\t C:" + + // locale.getDisplayCountry()); + } + + for (String localeStr : filterLocales.keySet()) + { + + Set<Locale> locales = filterLocales.get(localeStr); + + for (Locale lcl : locales) + { + System.out.println("" + lcl.getDisplayLanguage()); + break; + } + + for (Locale locale : locales) + { + System.out.println(" " + locale.getLanguage() + "\t V:" + locale.getVariant() + "\t " + + locale.getDisplayName() + "\t C:" + locale.getDisplayCountry()); + } + + } + + System.out.println("Found locale count " + filterLocales.size()); + + } + + + public static void readLanguages() + { + File f = new File("."); + + System.out.println("Current: " + f.getAbsolutePath()); + + try + { + BufferedReader reader = new BufferedReader(new FileReader(new File("./list_of_iso_codes-934j.csv"))); + + String line = ""; + + while ((line = reader.readLine()) != null) + { + // System.out.println("L: " + line); + + String[] entries = line.split(","); + + String languageName = entries[2]; + String languageFamily = entries[1]; + String languageNameNative = entries[3]; + String languageCode1 = entries[4]; + String languageCode2 = entries[5]; + // String languageName = entries[2]; + + System.out.println(String.format(" Name: %s,\t Description: %s,\t Family: %s, Code-1: %s", // + languageName, // + StringEscapeUtils.escapeCsv(languageName) + " (" + StringEscapeUtils.escapeJava(languageNameNative) + + ")", // + languageFamily, // + languageCode1 + + )); + + // StringEscapeUtils.escapeC//v() + + // System.out.println(String.format("\t%s(\"%s\", \"%s\", + // \"%s\", \"%s\"), //", // + // languageName, // + // languageName, // + // languageFamily, // + // languageCode1, // + // languageCode2 + // + // )); + + // StringEscapeUtils.escapeJava(languageNameNative); + + } + + } + catch (Exception e) + { + e.printStackTrace(); + } + + } + + + public static void testLangugaeSelector() + { + JFrame frame = new JFrame(); + + DataAccess dataAccess = DataAccess.createInstance(frame); + + TranslationToolConfigurationDto translationToolConfiguration = dataAccess.getTranslationToolConfiguration(); + translationToolConfiguration.setSettings(new TranslationToolSettingsDto()); + + TranslationToolInternalWizard2_LanguageSelector newLang = new TranslationToolInternalWizard2_LanguageSelector( + frame, dataAccess, translationToolConfiguration); + + newLang.setVisible(true); + + } + + + public static void testNewLanguega() + { + JFrame frame = new JFrame(); + + DataAccess dataAccess = DataAccess.createInstance(frame); + + TranslationToolInternalWizard3_NewLanguage newLang = new TranslationToolInternalWizard3_NewLanguage(frame, + dataAccess, null); + + } + + + public static void testConfigurationCheck() + { + JFrame frame = new JFrame(); + + DataAccess dataAccess = DataAccess.createInstance(frame); + + TranslationToolInternalWizard1_ConfigurationCheck tt = new TranslationToolInternalWizard1_ConfigurationCheck( + frame, dataAccess); + tt.setVisible(true); + } + + + public static void main(String[] args) + { + testLangugaeSelector(); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-09-17 22:46:38
|
Revision: 1470 http://sourceforge.net/p/ggc/code/1470 Author: andyrozman Date: 2017-09-17 22:46:34 +0000 (Sun, 17 Sep 2017) Log Message: ----------- 2.0.4 - some new DTO's for Pump data - added new pump definitions - Animas changes to Dto - changes to Minimed5xxConverters - Fixed: PumpDataRowDialog - PrintPumpDataDailyTimeSheet, BackupRestorePumpHandler Modified Paths: -------------- trunk/ggc-plugins/ggc-pump/docs/Changelog trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHourProcessor.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/GGCPumpDb.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpDeviceDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/converter/AnimasBaseDataV2Converter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/AnimasPumpDeviceData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed511PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed512PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed515PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed523PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataRowDialog.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/plugin/BackupRestorePumpHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataDailyTimeSheet.java Added Paths: ----------- trunk/ggc-plugins/ggc-pump/docs/devices/ trunk/ggc-plugins/ggc-pump/docs/devices/Medtronic_Minimed.txt trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpSettingsType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalPatternDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalPatternEntryDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/PumpSettingsDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed640PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/MinimedPumpDataConverterAbstract.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/minimed/MinimedContourNextLinkTest.java trunk/ggc-plugins/ggc-pump/src/main/resources/icons/pumps/ac_insight.jpg trunk/ggc-plugins/ggc-pump/src/main/resources/icons/pumps/cel_celnovo1.png Removed Paths: ------------- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/PumpSettings.java Modified: trunk/ggc-plugins/ggc-pump/docs/Changelog =================================================================== --- trunk/ggc-plugins/ggc-pump/docs/Changelog 2017-09-17 22:37:54 UTC (rev 1469) +++ trunk/ggc-plugins/ggc-pump/docs/Changelog 2017-09-17 22:46:34 UTC (rev 1470) @@ -2,6 +2,15 @@ Changes file for GGC Pump Tool ============================== +2.0.4 [17.9.2017] +- some new DTO's for Pump data +- added new pump definitions +- Animas changes to Dto +- changes to Minimed5xxConverters +- Fixed: PumpDataRowDialog +- PrintPumpDataDailyTimeSheet, BackupRestorePumpHandler + + 2.0.3 [26.6.2017] - changed enums, so that translation are changed from withing DataAccess - refactorings Added: trunk/ggc-plugins/ggc-pump/docs/devices/Medtronic_Minimed.txt =================================================================== --- trunk/ggc-plugins/ggc-pump/docs/devices/Medtronic_Minimed.txt (rev 0) +++ trunk/ggc-plugins/ggc-pump/docs/devices/Medtronic_Minimed.txt 2017-09-17 22:46:34 UTC (rev 1470) @@ -0,0 +1,50 @@ + +MEDTRONIC (previously known as Minimed) +======================================== + +Medtronic is one of bigest manufacturers of Insulin pumps, but they are keeping their protocols under lock and +key, so all implementations (here and anywhere else) are merely experimental. + + +HISTORY IN GGC +--------------- + +We started with support in 2009, and I think we were one of the first projects having at least some support +at that time. After that we came to problem how to decode History data... Sometime later first project +trying to decode that information was born (Bewest's decoding-carelink). About year after I finally came back +trying to use what was discovered by Bewest... + +But I had to start from zero, because at that time supported ComLink, was no longer available (and mine went kaput +(read dead)), so I had to again go and try to invent hot water... + +I was lucky at that time that Nightscout project created Android-uploader, which I used to compare my implementation +against, so I got it working... So at that time code for History decoding was also implemented and gotten ready for +testing... Few months past and all OS disable all USB legacy support, which made my support for CareLink USB again +useless... + +Now fast forward to 2017... I came accross Lennart Goedhart implementation of 600SeriesAndroidUploader... I got +permission to use it, which is now base for next implementation, support for Contour Next Link 1/2 +(CNL for 5xx devices), and will be also base for 6xx implementation, which will probably come in 2018. + + + +CURRENT STATUS +--------------- + +5xx Devices: Not supported yet, working on support, planned for end 2017 (Core implementation and Pump support). + CGMS in 2018, if we get Core and Pump running by end of 2017. + +6xx Devices: Not supported yet. Pump support planned for 2018. + + +CHANGE LOG +----------- + +31.5.2017 +- initial import +- packages changed from info.nightscout.android.medtronic to ggc.plugin.device.impl.minimed.comm.usb.contournext + + +20.6.2017 +- created message.series5xx and message.series6xx package + Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHourProcessor.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHourProcessor.java 2017-09-17 22:37:54 UTC (rev 1469) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHourProcessor.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -129,11 +129,19 @@ for (String entry : listComms) { + if ("null".equals(entry)) + continue; + sb.append(entry); sb.append(","); } - return sb.toString().substring(0, sb.length() - 1); + if (sb.length() > 0) + { + return sb.toString().substring(0, sb.length() - 1); + } + else + return ""; } else return ""; Copied: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpSettingsType.java (from rev 1456, trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/animas/enums/AnimasDataType.java) =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpSettingsType.java (rev 0) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpSettingsType.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -0,0 +1,238 @@ +package ggc.pump.data.defs; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import com.atech.utils.data.CodeEnum; + +import ggc.plugin.device.impl.animas.enums.AnimasDeviceType; +import ggc.plugin.device.impl.animas.enums.AnimasTransferType; + +/** + * Application: GGC - GNU Gluco Control + * Plug-in: GGC PlugIn Base (base class for all plugins) + * <p/> + * See AUTHORS for copyright information. + * <p/> + * 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. + * <p/> + * 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. + * <p/> + * 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 + * <p/> + * Filename: AnimasDataType + * Description: Animas Data Type enum, with all important settings for type. + * <p/> + * Author: Andy Rozman {an...@at...} + */ + +public enum PumpSettingsType implements CodeEnum +{ + UnknownDataType(0), // + SerialNumber(8, "Serial Number", false, 1, AnimasTransferType.All), // + BasalProfile(11, "Basal Profile", false, 4, AnimasTransferType.DownloadPumpSettings), // + ActiveBasal(12, "Active Basal", false, 1, AnimasTransferType.DownloadPumpSettings), // + AdvancedSettings(13, "Advanced Settings", false, 1, AnimasTransferType.DownloadPumpSettings), // + SoundSettings(14, "Sound settings", false, 1, AnimasTransferType.DownloadPumpSettings), // + BasalProfileName(18, "Basal Profile Name", false, 4, AnimasTransferType.DownloadPumpSettings), // + PumpSettings1_Pre2020(19, "Pump Name (pre 2020)", false, 1, AnimasTransferType.DownloadPumpSettings, // + Arrays.asList(AnimasDeviceType.Animas_Family_Pre2200)), // + PumpSettings2_Pre2020(20, "Pump Profile Name (pre 2020)", false, 4, AnimasTransferType.DownloadPumpSettings, // + Arrays.asList(AnimasDeviceType.Animas_Family_Pre2200)), + + // 21 - 26 + BolusHistory(21, "Bolus History", true, 500, AnimasTransferType.DownloadPumpData), // 500? + TotalDailyDoseHistory(22, "Total Daily Dose History", true, 120, AnimasTransferType.DownloadPumpData), // + AlarmHistory(23, "Alarm History", true, 30, AnimasTransferType.DownloadPumpData), // + PrimeHistory(24, "Prime History", true, 60, AnimasTransferType.DownloadPumpData), // + SuspendHistory(25, "Suspend/Resume History", true, 30, AnimasTransferType.DownloadPumpData), // + BasalRateHistory(26, "Basal Rate History", true, 270, AnimasTransferType.DownloadPumpData), // + + ClockMode(28, "Clock Mode", false, 1, AnimasTransferType.All), // + BGUnit(29, "BG Unit", false, 1, AnimasTransferType.All), // + SoftwareCode(30, "Software Code", false, 1, AnimasTransferType.All), // + + FontTableIndex(34, "Font Table Index", false, 1, AnimasTransferType.UploadFoodDb), // + LanguageIndex(35, "Language Font Index", false, 1, AnimasTransferType.UploadFoodDb), // + FoodDbSize(36, "Food Db Size", false, 1, AnimasTransferType.All), // + + DosingSettings(37, "Dosing Settings (pre 2020)", false, 1, AnimasTransferType.DownloadPumpSettings, // + Arrays.asList(AnimasDeviceType.Animas_Family_Pre2200)), // pre 2002 + + BolusHistoryExt(38, "BolusHistoryExt", false, 500, AnimasTransferType.DownloadPumpData, Arrays.asList(// + AnimasDeviceType.Animas_Family_2200, // + AnimasDeviceType.Animas_Family_Ping, // + AnimasDeviceType.Animas_Family_Vibe)), // + + // SETTINGS_ALL(39), // + InsulinCarbRatio, // + InsulinBGRatio, // + BGTargets, // + BasalPatterns, // + FriendlyName, DeviceSerialAndVersion(), GlucoseUnit(), ActiveBasalPattern(); + + // 33215 + + static HashMap<Integer, PumpSettingsType> mappingWithId = new HashMap<Integer, PumpSettingsType>(); + + static + { + for (PumpSettingsType adt : values()) + { + mappingWithId.put(adt.getCode(), adt); + } + } + + int code; + private boolean isDateInDataType = false; + AnimasTransferType baseTransferType; + boolean postProcessing = false; + private int entriesCount; + private String debugDescription; + + /** + * Allowed Device Types. Commands are mostly ties to specific AnimasDeviceType. If this list is null, all devices (1000 is here excluded) can + * issue the command, if this is set only specific devices will be allowed to issue commands. + */ + private HashMap<AnimasDeviceType, Object> allowedDeviceTypes = null; + + + private PumpSettingsType(int code) + { + this.code = code; + } + + + PumpSettingsType() + { + } + + + private PumpSettingsType(int code, String debugDescription, boolean isDateInDataType, int entriesCount, AnimasTransferType baseTransferType) + { + this(code, debugDescription, isDateInDataType, entriesCount, baseTransferType, null); + } + + + private PumpSettingsType(int code, String debugDescription, boolean isDateInDataType, int entriesCount, AnimasTransferType baseTransferType, List<AnimasDeviceType> allowedDevices) + { + this(code, debugDescription, isDateInDataType, entriesCount, baseTransferType, allowedDevices, false); + } + + + private PumpSettingsType(int code, String debugDescription, boolean isDateInDataType, int entriesCount, AnimasTransferType baseTransferType, List<AnimasDeviceType> allowedDevices, boolean postProcessing) + { + this.code = code; + this.isDateInDataType = isDateInDataType; + this.debugDescription = debugDescription; + this.baseTransferType = baseTransferType; + this.entriesCount = entriesCount; + this.postProcessing = postProcessing; + + processDevices(allowedDevices); + } + + + private void processDevices(List<AnimasDeviceType> allowedDevices) + { + if (allowedDevices == null) + return; + + allowedDeviceTypes = new HashMap<AnimasDeviceType, Object>(); + + for (AnimasDeviceType adt : allowedDevices) + { + if (adt.isFamily()) + { + for (AnimasDeviceType adt2 : adt.getFamilyMembers()) + { + allowedDeviceTypes.put(adt2, null); + } + } + else + { + allowedDeviceTypes.put(adt, null); + } + } + } + + + public int getEntriesCount() + { + return entriesCount; + } + + + public AnimasTransferType getBaseTransferType() + { + return baseTransferType; + } + + + public static PumpSettingsType getAnimasDataTypeById(int code) + { + if (mappingWithId.containsKey(code)) + { + return mappingWithId.get(code); + } + else + { + return PumpSettingsType.UnknownDataType; + } + } + + + public boolean isDateInDataType() + { + return isDateInDataType; + } + + + public int getCode() + { + return code; + } + + + public String getDebugDescription() + { + return debugDescription; + } + + + public void setDebugDescription(String debugDescription) + { + this.debugDescription = debugDescription; + } + + + public boolean isCommandAllowedForDeviceType(AnimasDeviceType deviceType) + { + if (this.allowedDeviceTypes == null) + { + return true; + } + else + { + return this.allowedDeviceTypes.containsKey(deviceType); + } + } + + + public boolean hasPostProcessing() + { + return this.postProcessing; + } + + // (dataType >= 21) && (dataType <= 26) + +} Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java 2017-09-17 22:37:54 UTC (rev 1469) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -1,5 +1,8 @@ package ggc.pump.data.defs; +import java.util.Arrays; +import java.util.List; + import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.CodeEnumWithTranslation; @@ -25,8 +28,8 @@ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * - * Filename: AnimasSettingSubType - * Description: Animas Settings Sub Type + * Filename: RatioType + * Description: Ratio Type * * Author: Andy Rozman {an...@at...} */ @@ -33,6 +36,9 @@ public enum RatioType implements CodeEnumWithTranslation { + // Insulin CH Ratio = Carb Ratio + // Insulin BG Ratio = Sensitivity Factor, Correction Factor + // simple values InsulinCHRatio(1, "PCFG_CH_INS_RATIO", ValueType.Simple), // InsulinBGRatio(2, "PCFG_BG_INS_RATIO", ValueType.Simple), // @@ -125,4 +131,25 @@ return (this.valueType == ValueType.Delta); } + + public static List<RatioType> getRatioTypes(PumpSettingsType settingsType) + { + switch (settingsType) + { + case InsulinCarbRatio: + return Arrays.asList(RatioType.InsulinCHRatio, RatioType.InsulinCHRatioDelta, + RatioType.InsulinCHRatioRange); + + case InsulinBGRatio: + return Arrays.asList(RatioType.InsulinBGRatio, RatioType.InsulinBGRatioDelta, + RatioType.InsulinBGRatioRange); + + case BGTargets: + return Arrays.asList(RatioType.BGTarget, RatioType.BGTargetDelta, RatioType.BGTargetRange); + + default: + return null; + } + } + } Added: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalPatternDTO.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalPatternDTO.java (rev 0) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalPatternDTO.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -0,0 +1,65 @@ +package ggc.pump.data.dto; + +import java.util.ArrayList; +import java.util.Iterator; + +import ggc.plugin.output.OutputWriter; + +/** + * Created by andy on 10.07.17. + */ +public class BasalPatternDTO extends ArrayList<BasalPatternEntryDTO> +{ + + private int patternNumber; + private String name; + + + public BasalPatternDTO(String name) + { + super(); + this.name = name; + } + + + public BasalPatternDTO(int patternNumber) + { + super(); + this.patternNumber = patternNumber; + this.name = "" + patternNumber; // this is preset, it might be changed + // later + } + + + public String getName() + { + return name; + } + + + public void setName(String name) + { + this.name = name; + } + + + public float getTotalAmount() + { + Iterator<BasalPatternEntryDTO> iterator = this.iterator(); + + float sum = 0.0f; + + while (iterator.hasNext()) + { + sum += iterator.next().getRate(); + } + + return sum; + } + + + public void writeToOutputWriter(OutputWriter outputWriter) + { + // FIXME + } +} Added: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalPatternEntryDTO.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalPatternEntryDTO.java (rev 0) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalPatternEntryDTO.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -0,0 +1,55 @@ +package ggc.pump.data.dto; + +import com.atech.utils.data.ATechDate; + +/** + * Created by andy on 10.07.17. + */ +public class BasalPatternEntryDTO +{ + + private ATechDate starTime; // AtechDateTime - TIME, so 1300, would mean + // 13:00 + private Integer endTime; // this might or might not be used, in most cases + // we record + // start time only + Integer duration; // also mostly not used + + private float rate; + + + public BasalPatternEntryDTO() + { + } + + + public BasalPatternEntryDTO(ATechDate starTime, float rate) + { + this.starTime = starTime; + this.rate = rate; + } + + + public float getRate() + { + return rate; + } + + + public void setRate(float rate) + { + this.rate = rate; + } + + + public ATechDate getStarTime() + { + return starTime; + } + + + public void setStarTime(ATechDate starTime) + { + this.starTime = starTime; + } +} Copied: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/PumpSettingsDTO.java (from rev 1456, trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/PumpSettings.java) =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/PumpSettingsDTO.java (rev 0) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/PumpSettingsDTO.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -0,0 +1,583 @@ +package ggc.pump.data.dto; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.atech.i18n.I18nControlAbstract; + +import ggc.core.data.defs.ClockModeType; +import ggc.core.data.defs.GlucoseUnitType; +import ggc.core.enums.BigDecimalValueType; +import ggc.plugin.data.DeviceValueConfigEntry; +import ggc.plugin.device.impl.animas.enums.AnimasDataType; +import ggc.plugin.device.impl.animas.enums.AnimasSoundType; +import ggc.plugin.device.impl.animas.enums.advsett.*; +import ggc.plugin.output.OutputWriter; +import ggc.pump.data.defs.PumpConfigurationGroup; +import ggc.pump.data.defs.PumpSettingsType; +import ggc.pump.data.defs.RatioType; +import ggc.pump.util.DataAccessPump; + +/** + * Application: GGC - GNU Gluco Control + * Plug-in: Pump Tool (support for Pump devices) + * + * 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: PumpSettings + * Description: Pump Settings + * + * Author: Andy Rozman {an...@at...} + */ +// NOTE: This is copied from Animas PumpSettings, but should be addapted to be +// able to use +// globally. + +// FIXME: write data only if set +// FIXME: make it global + +public class PumpSettingsDTO +{ + + private static final Logger LOG = LoggerFactory.getLogger(PumpSettingsDTO.class); + + // List<SettingEntry> allSettings = null; + public Map<AnimasSoundType, SoundValueType> soundVolumes = new HashMap<AnimasSoundType, SoundValueType>(); + public ClockModeType clockMode; + public Map<Integer, BasalPatternDTO> basalPatterns = new HashMap<Integer, BasalPatternDTO>(); + public Integer activeBasalPattern = 1; + public GlucoseUnitType glucoseUnitType; + private Map<RatioType, List<RatioDTO>> timeValueSettings = new HashMap<RatioType, List<RatioDTO>>(); + public Boolean audioBolusEnabled; + public Boolean advancedBolusEnabled = false; + public Boolean bolusReminderEnabled = false; + public Short numberOfBasalProfiles; + public BigDecimal maxBolusProHour; + public BigDecimal maxBasalAmountProHour; + public BigDecimal totalDailyDose; + public BigDecimal maxDoseIn2h; + public Short lowCartridgeWarning; + public Boolean autoOffEnabled; + public Short autoOffTimeoutHr; + public Boolean iOBEnabled; + public BolusSpeed bolusSpeed; + public Short displayTimeout; + public OcclusionSensitivity occlusionSensitivity; + public BigDecimal iOBDecay; + public BolusStepSize audioBolusStepSize; + public Language language; + + // Animas Specific Settings + public Short maxLock; + public Short sickDaysCheckKetones; + public Short sickDaysCheckBG; + public BigDecimal sickDaysCheckOverLimit; + public Map<Integer, String> userInfo; + + OutputWriter writer; + public String serialNumber; + + DataAccessPump dataAccess = DataAccessPump.getInstance(); + I18nControlAbstract i18nControl = dataAccess.getI18nControlInstance(); + public String friendlyName; + public String softwareCode; + + + public void addBasalPatternEntry(int basalProfilerNr, BasalPatternEntryDTO basalProfileEntry) + { + if (!basalPatterns.containsKey(basalProfilerNr)) + { + this.basalPatterns.put(basalProfilerNr, new BasalPatternDTO(basalProfilerNr)); + } + + this.basalPatterns.get(basalProfilerNr).add(basalProfileEntry); + + } + + + public void writeSettingsToGGC(PumpSettingsType... pumpSettingsTypes) + { + for (PumpSettingsType pumpSettingsType : pumpSettingsTypes) + { + writeSettingsToGGC(pumpSettingsType); + } + + } + + + public void writeSettingsToGGC(PumpSettingsType pumpSettingsType) + { + switch (pumpSettingsType) + { + case ClockMode: + { + if (clockMode != null) + { + writeSetting("CFG_BASE_CLOCK_MODE", clockMode.getTranslation(), PumpConfigurationGroup.General); + } + writeSetting("PCFG_ACTIVE_BASAL_PROFILE", this.activeBasalPattern, PumpConfigurationGroup.Basal); + } + break; + + case ActiveBasalPattern: + { + writeSetting("PCFG_ACTIVE_BASAL_PROFILE", this.activeBasalPattern, PumpConfigurationGroup.Basal); + } + break; + + case GlucoseUnit: + { + if (glucoseUnitType != null) + { + writeSetting("CFG_BASE_GLUCOSE_UNIT", glucoseUnitType.getTranslation(), + PumpConfigurationGroup.General); + } + } + break; + + case DeviceSerialAndVersion: + { + writeSetting("CFG_BASE_SERIAL_NUMBER", serialNumber, PumpConfigurationGroup.General); + writeSetting("CFG_BASE_FIRMWARE_VERSION", softwareCode, PumpConfigurationGroup.General); + + } + break; + + case SoundSettings: + { + for (Entry<AnimasSoundType, SoundValueType> entry : soundVolumes.entrySet()) + { + writeSetting( + i18nControl.getMessage("CFG_SOUND_VOLUME_FOR") + " " + entry.getKey().getTranslation(), + entry.getValue().getTranslation(), PumpConfigurationGroup.Sound); + } + } + break; + + case AdvancedSettings: + { + writeSetting("PCFG_AUDIO_BOLUS_ENABLED", audioBolusEnabled, PumpConfigurationGroup.Bolus); + + if (audioBolusStepSize != null) + { + writeSetting("PCFG_AUDIO_BOLUS_STEP_SIZE", audioBolusStepSize.getValue(), + PumpConfigurationGroup.Bolus); + } + writeSetting("PCFG_ADVANCED_BOLUS_ENABLED", advancedBolusEnabled, PumpConfigurationGroup.Bolus); + writeSetting("PCFG_BOLUS_REMINDER", bolusReminderEnabled, PumpConfigurationGroup.Bolus); + + writeSetting("PCFG_NUMBER_OF_BASAL_PROFILES", numberOfBasalProfiles, PumpConfigurationGroup.Basal); + writeSetting("PCFG_MAX_BOLUS_IN_HOUR", maxBolusProHour, BigDecimalValueType.Integer, + PumpConfigurationGroup.Bolus); + writeSetting("PCFG_MAX_BASAL_IN_HOUR", maxBasalAmountProHour, BigDecimalValueType.Integer, + PumpConfigurationGroup.Basal); + writeSetting("PCFG_TOTAL_DAILY_DOSE", totalDailyDose, BigDecimalValueType.Integer, + PumpConfigurationGroup.Insulin); + writeSetting("PCFG_MAX_DOSE_IN_2HOURS", maxDoseIn2h, BigDecimalValueType.Integer, + PumpConfigurationGroup.Insulin); + writeSetting("PCFG_LOW_CARTRIDGE_WARNING", lowCartridgeWarning, PumpConfigurationGroup.Insulin); + writeSetting("PCFG_AUTOOFF_ENABLED", autoOffEnabled, PumpConfigurationGroup.Device); + writeSetting("PCFG_AUTOOFF_TIMEOUT", autoOffTimeoutHr, PumpConfigurationGroup.Device); + writeSetting("PCFG_IOB_ENABLED", iOBEnabled, PumpConfigurationGroup.Insulin); + if (bolusSpeed != null) + { + writeSetting("PCFG_BOLUS_SPEED", bolusSpeed.getDescription(), PumpConfigurationGroup.Bolus); + } + + if (displayTimeout != null) + { + writeSetting("PCFG_DISPLAY_TIMEOUT", displayTimeout + " min", PumpConfigurationGroup.Device); + } + + if (occlusionSensitivity != null) + { + + writeSetting("PCFG_OCCLUSION_SENSITIVITY", occlusionSensitivity.name(), + PumpConfigurationGroup.Device); + } + + if (iOBDecay != null) + { + writeSetting("PCFG_IOB_DECAY", "" + formatDecimal(iOBDecay, 2, 1), + PumpConfigurationGroup.Insulin); + } + + if (language != null) + { + writeSetting("LANGUAGE", language.getDescription(), PumpConfigurationGroup.Device); + } + + // addSetting(public short maxLock; + + if (sickDaysCheckOverLimit != null) + { + writeSetting("PCFG_SICK_DAYS_CHECK_KETONES_EVERY", sickDaysCheckKetones, + PumpConfigurationGroup.Device); + writeSetting("PCFG_SICK_DAYS_CHECK_BG_EVERY", sickDaysCheckBG, PumpConfigurationGroup.Device); + + writeSetting("PCFG_SICK_DAYS_CHECK_OVER_LIMIT", + formatDecimal(sickDaysCheckOverLimit, 3, glucoseUnitType == GlucoseUnitType.mmol_L ? 1 : 0), + PumpConfigurationGroup.Device); + } + + } + break; + + case BasalPatterns: + { + // FIXME + for (int i = 0; i <= 48; i++) // Dana has max patterns, + // which is 48 + { + if (this.basalPatterns.containsKey(i)) + { + BasalPatternDTO bp = this.basalPatterns.get(i); + writeSetting( + i18nControl.getMessage("PCFG_BASAL_PROFILE") + " #" + i + " " + + i18nControl.getMessage("CFG_BASE_NAME"), + bp.getName(), PumpConfigurationGroup.Basal); + + int slot = 1; + + for (BasalPatternEntryDTO en : bp) + { + String key = i18nControl.getMessage("PCFG_BASAL_PROFILE") + " #" + i + " " + + i18nControl.getMessage("CFG_BASE_SLOT") + " " + + ((slot < 10) ? "0" + slot : slot); + + String value = i18nControl.getMessage("CFG_BASE_FROM") + "=" + + en.getStarTime().getTimeString() + ", " + + i18nControl.getMessage("CFG_BASE_AMOUNT") + "=" + en.getRate(); + + writeSetting(key, value, PumpConfigurationGroup.Basal); + + slot++; + } + } + } + } + break; + + case FriendlyName: + { + writeSetting("PCFG_FRIENDLY_NAME", this.friendlyName, PumpConfigurationGroup.Device); + + } + break; + + case InsulinCarbRatio: + case InsulinBGRatio: + case BGTargets: + writeRatioSettings(pumpSettingsType); + break; + + default: + LOG.warn("writeSettingsToGGC: Unknown type: " + pumpSettingsType.name()); + + } + + } + + + private void writeRatioSettings(PumpSettingsType settingsType) + { + List<RatioType> ratioTypes = RatioType.getRatioTypes(settingsType); + + // List<RatioDTO> ratioList = new ArrayList<RatioDTO>(); + + for (RatioType ratioType : ratioTypes) + { + if (timeValueSettings.containsKey(ratioType)) + { + for (RatioDTO stve : timeValueSettings.get(ratioType)) + { + writeSetting(ratioType.getTranslation() + " #" + stve.getIndex(), stve.getSettingValue(), + PumpConfigurationGroup.Bolus); + } + } + } + + } + + + public void writeSettingsToGGC(AnimasDataType dataType) + { + switch (dataType) + { + case ClockMode: + { + writeSettingsToGGC( // + PumpSettingsType.ClockMode, // + PumpSettingsType.ActiveBasalPattern, // + PumpSettingsType.GlucoseUnit, // + PumpSettingsType.DeviceSerialAndVersion); + } + break; + + case SoundSettings: + { + for (Entry<AnimasSoundType, SoundValueType> entry : soundVolumes.entrySet()) + { + writeSetting( + i18nControl.getMessage("CFG_SOUND_VOLUME_FOR") + " " + entry.getKey().getTranslation(), + entry.getValue().getTranslation(), PumpConfigurationGroup.Sound); + } + } + break; + + case AdvancedSettings: + { + writeSetting("PCFG_AUDIO_BOLUS_ENABLED", audioBolusEnabled, PumpConfigurationGroup.Bolus); + + if (audioBolusStepSize != null) + { + writeSetting("PCFG_AUDIO_BOLUS_STEP_SIZE", audioBolusStepSize.getValue(), + PumpConfigurationGroup.Bolus); + } + writeSetting("PCFG_ADVANCED_BOLUS_ENABLED", advancedBolusEnabled, PumpConfigurationGroup.Bolus); + writeSetting("PCFG_BOLUS_REMINDER", bolusReminderEnabled, PumpConfigurationGroup.Bolus); + writeSetting("PCFG_NUMBER_OF_BASAL_PROFILES", numberOfBasalProfiles, PumpConfigurationGroup.Basal); + writeSetting("PCFG_MAX_BOLUS_IN_HOUR", maxBolusProHour, BigDecimalValueType.Integer, + PumpConfigurationGroup.Bolus); + writeSetting("PCFG_MAX_BASAL_IN_HOUR", maxBasalAmountProHour, BigDecimalValueType.Integer, + PumpConfigurationGroup.Basal); + writeSetting("PCFG_TOTAL_DAILY_DOSE", totalDailyDose, BigDecimalValueType.Integer, + PumpConfigurationGroup.Insulin); + writeSetting("PCFG_MAX_DOSE_IN_2HOURS", maxDoseIn2h, BigDecimalValueType.Integer, + PumpConfigurationGroup.Insulin); + writeSetting("PCFG_LOW_CARTRIDGE_WARNING", lowCartridgeWarning, PumpConfigurationGroup.Insulin); + writeSetting("PCFG_AUTOOFF_ENABLED", autoOffEnabled, PumpConfigurationGroup.Device); + writeSetting("PCFG_AUTOOFF_TIMEOUT", autoOffTimeoutHr, PumpConfigurationGroup.Device); + writeSetting("PCFG_IOB_ENABLED", iOBEnabled, PumpConfigurationGroup.Insulin); + if (bolusSpeed != null) + { + writeSetting("PCFG_BOLUS_SPEED", bolusSpeed.getDescription(), PumpConfigurationGroup.Bolus); + } + + if (displayTimeout != null) + { + writeSetting("PCFG_DISPLAY_TIMEOUT", displayTimeout + " min", PumpConfigurationGroup.Device); + } + + if (occlusionSensitivity != null) + { + + writeSetting("PCFG_OCCLUSION_SENSITIVITY", occlusionSensitivity.name(), + PumpConfigurationGroup.Device); + } + + if (iOBDecay != null) + { + writeSetting("PCFG_IOB_DECAY", "" + formatDecimal(iOBDecay, 2, 1), + PumpConfigurationGroup.Insulin); + } + + if (language != null) + { + writeSetting("LANGUAGE", language.getDescription(), PumpConfigurationGroup.Device); + } + + // addSetting(public short maxLock; + + if (sickDaysCheckOverLimit != null) + { + writeSetting("PCFG_SICK_DAYS_CHECK_KETONES_EVERY", sickDaysCheckKetones, + PumpConfigurationGroup.Device); + writeSetting("PCFG_SICK_DAYS_CHECK_BG_EVERY", sickDaysCheckBG, PumpConfigurationGroup.Device); + writeSetting("PCFG_SICK_DAYS_CHECK_OVER_LIMIT", + formatDecimal(sickDaysCheckOverLimit, 3, glucoseUnitType == GlucoseUnitType.mmol_L ? 1 : 0), + PumpConfigurationGroup.Device); + } + + } + break; + + case BasalProfile: + { + writeSettingsToGGC(PumpSettingsType.BasalPatterns); + } + break; + + case FriendlyName: + { + writeSetting("PCFG_FRIENDLY_NAME", this.friendlyName, PumpConfigurationGroup.Device); + + } + break; + + case BGTargetSetting: + { + writeSettingsToGGC( // + PumpSettingsType.InsulinCarbRatio, // + PumpSettingsType.InsulinBGRatio, // + PumpSettingsType.BGTargets); + } + break; + + default: + System.out.println("writeSettingsToGGC: " + dataType.name()); + + } + + } + + + public void setBasalName(int basalProfilerNr, String basalName) + { + if (!basalPatterns.containsKey(basalProfilerNr)) + { + this.basalPatterns.put(basalProfilerNr, new BasalPatternDTO(basalProfilerNr)); + } + + this.basalPatterns.get(basalProfilerNr).setName(basalName); + } + + + public void addSettingTimeValueEntry(RatioDTO settingTimeValueEntry) + { + if (!timeValueSettings.containsKey(settingTimeValueEntry.getType())) + { + timeValueSettings.put(settingTimeValueEntry.getType(), new ArrayList<RatioDTO>()); + } + + timeValueSettings.get(settingTimeValueEntry.getType()).add(settingTimeValueEntry); + } + + + // public List<SettingEntry> getAllSettings() + // { + // + // if (allSettings == null) + // createAllSettings(); + // + // return allSettings; + // + // } + + public void setOutputForSetting(OutputWriter writer) + { + this.writer = writer; + } + + + private String formatDecimal(BigDecimal decimalNr, int nrPlaces, int decPlaces) + { + if (decPlaces == 0) + return String.format("%d", decimalNr.intValue()); + else + { + return String.format("%" + nrPlaces + "." + decPlaces + "f", decimalNr.floatValue()); + } + + } + + + private String getBooleanValue(Boolean val) + { + return val ? i18nControl.getMessage("YES") : i18nControl.getMessage("NO"); + } + + + // private void addSetting(String key, String value, Object rawValue, + // PumpConfigurationGroup group) + // { + // if (rawValue != null) + // { + // allSettings.add(new SettingEntry(key, value)); + // } + // } + + private void writeSetting(String key, String value, PumpConfigurationGroup group) + { + if (value != null) + { + writer.writeConfigurationData(new DeviceValueConfigEntry(i18nControl.getMessage(key), value, group)); + } + } + + + private void writeSetting(String key, Integer value, PumpConfigurationGroup group) + { + if (value != null) + { + writer.writeConfigurationData( + new DeviceValueConfigEntry(i18nControl.getMessage(key), "" + value.intValue(), group)); + } + } + + + private void writeSetting(String key, Short value, PumpConfigurationGroup group) + { + if (value != null) + { + writer.writeConfigurationData( + new DeviceValueConfigEntry(i18nControl.getMessage(key), "" + value.shortValue(), group)); + } + } + + + private void writeSetting(String key, Boolean value, PumpConfigurationGroup group) + { + if (value != null) + { + writer.writeConfigurationData( + new DeviceValueConfigEntry(i18nControl.getMessage(key), getBooleanValue(value), group)); + } + } + + + private void writeSetting(String key, BigDecimal value, BigDecimalValueType valueType, PumpConfigurationGroup group) + { + if (value != null) + { + String valueString = ""; + + switch (valueType) + { + case Integer: + valueString = "" + value.intValue(); + break; + case Byte: + valueString = "" + value.byteValue(); + break; + case Short: + valueString = "" + value.shortValue(); + break; + } + + writer.writeConfigurationData(new DeviceValueConfigEntry(i18nControl.getMessage(key), valueString, group)); + } + } + + // public void debugAllSettings(Logger log) + // { + // List<SettingEntry> settings = getAllSettings(); + // + // for (SettingEntry entry : settings) + // { + // log.debug(entry.key + " = " + entry.value); + // } + // } + +} Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/GGCPumpDb.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/GGCPumpDb.java 2017-09-17 22:37:54 UTC (rev 1469) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/GGCPumpDb.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -238,7 +238,7 @@ List<CGMSDayData> outData = new ArrayList<CGMSDayData>(); - List<CGMSDataH> listCGMSData = getRangeCGMSValuesRaw(from, to, "dv.base_type=1"); + List<CGMSDataH> listCGMSData = getRangeCGMSValuesRaw(from, to, Arrays.asList(Restrictions.eq("baseType", 1))); for (CGMSDataH pdh : listCGMSData) { @@ -761,64 +761,9 @@ } + // getHibernateData - /** - * Get Profiles - * - * @return - */ - @Deprecated - public List<PumpProfile> getProfilesForRangeOld(GregorianCalendar gcFrom, GregorianCalendar gcTill) - { - // FIXME this doesn't work like it should, we need to get active - // profile, not all profiles active on specific day - LOG.info("getProfilesForRange() - Run"); - String sql = ""; - - List<PumpProfile> listProfiles = new ArrayList<PumpProfile>(); - - long dtFrom = ATechDate.getATDateTimeFromGC(gcFrom, ATechDate.FORMAT_DATE_AND_TIME_S); - long dtTill = ATechDate.getATDateTimeFromGC(gcTill, ATechDate.FORMAT_DATE_AND_TIME_S); - - System.out.println("From: " + dtFrom + ", till: " + dtTill); - - try - { - sql = "SELECT dv " + // - "from ggc.core.db.hibernate.pump.PumpProfileH as dv " + // - "where (dv.active_from > " + dtFrom + // - " and dv.active_from <> 0 )" + // - " or dv.active_till > " + dtFrom + // - // " and dv.active_till < " + dtTill + - // " and dv.active_till > " + dtFrom + - " or (dv.active_till = 0) " + // - " and dv.person_id=" + dataAccess.getCurrentUserId(); - - // " and (dv.active_till < " + dtFrom + - - Query q = this.db.getSession().createQuery(sql); - - Iterator<?> it = q.list().iterator(); - - while (it.hasNext()) - { - PumpProfileH pdh = (PumpProfileH) it.next(); - listProfiles.add(new PumpProfile(pdh)); - } - - } - catch (Exception ex) - { - LOG.debug("Sql: " + sql); - LOG.error("getProfilesForRange(). Exception: " + ex, ex); - } - - return listProfiles; - - } - - /** * Get Profiles * Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpDeviceDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpDeviceDefinition.java 2017-09-17 22:37:54 UTC (rev 1469) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpDeviceDefinition.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -21,11 +21,15 @@ public enum PumpDeviceDefinition implements DeviceDefinition { + // NOTE: Devices with NoParameters, will not have port settings disaplyed, use that for all + // dummy devices, or devices + // with no implementation + // Animas / One Touch Devices Animas_IR1000(40001, "Animas IR 1000", "", "", AnimasDeviceType.Animas_IR1000, DeviceImplementationStatus.NotPlanned, DeviceCompanyDefinition.Animas, DeviceHandlerType.NoHandler, - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, null), Animas_IR1200(40002, "Animas IR 1200", "an_ir1200.jpg", "INSTRUCTIONS_ANIMAS_V2", AnimasDeviceType.Animas_IR1200, @@ -62,13 +66,13 @@ DeltecCosmo1700(50001, "Cosmo 1700", "de_cosmo1700.jpg", "INSTRUCTIONS_DELTEC_COSMO_1700", null, DeviceImplementationStatus.NotPlanned, DeviceCompanyDefinition.Deltec, DeviceHandlerType.NoHandler, - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.None, DeviceProgressStatus.Normal, "", - 0.1f, 0.1f, null, -1, 0, null), // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, DeviceProgressStatus.Normal, "", 0.1f, + 0.1f, null, -1, 0, null), // DeltecCosmo1800(50002, "Cosmo 1800", "de_cosmo1800.jpg", "INSTRUCTIONS_DELTEC_COSMO_1800", null, DeviceImplementationStatus.NotPlanned, DeviceCompanyDefinition.Deltec, DeviceHandlerType.NoHandler, - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.None, DeviceProgressStatus.Normal, "", - 0.1f, 0.1f, null, -1, 0, null), // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, DeviceProgressStatus.Normal, "", 0.1f, + 0.1f, null, -1, 0, null), // // Insulet @@ -83,53 +87,53 @@ MinimedDeviceType.Minimed_508_508c, DeviceImplementationStatus.NotPlanned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Serial_USBBridge, DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, - PumpProfileDefinition.MinimedProfile), // + PumpProfileDefinition.MinimedProfile), // TODO Minimed_511(10003, "Minimed 511", "mm_515_715.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_511, DeviceImplementationStatus.Planned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Serial_USBBridge, - DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, PumpProfileDefinition.MinimedProfile), // + DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, PumpProfileDefinition.MinimedProfile), // TODO Minimed_512_712(10004, "Minimed 512/712", "mm_515_715.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_512_712, DeviceImplementationStatus.Planned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Serial_USBBridge, DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, - PumpProfileDefinition.MinimedProfile), // + PumpProfileDefinition.MinimedProfile), // TODO Minimed_515_715(10005, "Minimed 515/715", "mm_515_715.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_515_715, DeviceImplementationStatus.Planned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Serial_USBBridge, DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, - PumpProfileDefinition.MinimedProfile), // + PumpProfileDefinition.MinimedProfile), // TODO Minimed_522_722(10006, "Minimed 522/722", "mm_522_722.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_522_722, DeviceImplementationStatus.Planned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Serial_USBBridge, DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, - PumpProfileDefinition.MinimedProfile), // + PumpProfileDefinition.MinimedProfile), // TODO Minimed_523_723(10007, "Minimed 523/723", "mm_522_722.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_523_723, DeviceImplementationStatus.Planned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Serial_USBBridge, DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, - PumpProfileDefinition.MinimedProfile), // + PumpProfileDefinition.MinimedProfile), // TODO Minimed_553_753_Revel(10008, "Minimed 553/753 (Revel)", "mm_554_veo.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_553_753_Revel, DeviceImplementationStatus.Planned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Serial_USBBridge, - DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, PumpProfileDefinition.MinimedProfile), // + DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, PumpProfileDefinition.MinimedProfile), // TODO Minimed_554_754_Veo(10009, "Minimed 554/754 (Veo)", "mm_554_veo.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_554_754_Veo, DeviceImplementationStatus.Planned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Serial_USBBridge, DeviceProgressStatus.Special, "", 0.1f, 0.1f, null, -1, 0, - PumpProfileDefinition.MinimedProfile), // + PumpProfileDefinition.MinimedProfile), // TODO Minimed_640G(10010, "Minimed 640G", "pic", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_640G, DeviceImplementationStatus.Planned, DeviceCompanyDefinition.Minimed, DeviceHandlerType.NoHandler, DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, - "", 0.1f, 0.1f, null, -1, 0, null), + "", 0.1f, 0.1f, null, -1, 0, null), // TODO // Roche / Accu-Chek (bridged old implementation) @@ -157,17 +161,24 @@ DeviceProgressStatus.Normal, "", 0.1f, 0.01f, PumpTBRDefinition.RocheTBR, -1, 2000, PumpProfileDefinition.RocheProfile), // + // FIXME + AccuChekInsight(20004, "Insight", "ac_insight.jpg", "INSTRUCTIONS_ACCUCHEK_SPIRIT", null, + DeviceImplementationStatus.NotAvailable, DeviceCompanyDefinition.Roche, + DeviceHandlerType.AccuChekPumpHandler, DevicePortParameterType.NoParameters, + DeviceConnectionProtocol.MassStorageXML, DeviceProgressStatus.Normal, "", 0.1f, 0.01f, + PumpTBRDefinition.RocheTBR, -1, 2000, PumpProfileDefinition.RocheProfile), // + // Sooil (Dana) (bridged old implementation) DanaDiabecare_II(70001, "Diabcare II", "so_danaII.jpg", null, null, DeviceImplementationStatus.DoesntSupportDownload, DeviceCompanyDefinition.Sooil, - DeviceHandlerType.NoSupportInDevice, DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.None, + DeviceHandlerType.NoSupportInDevice, DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, DeviceProgressStatus.Normal, "", 0.1f, 0.1f, PumpTBRDefinition.DanaTBR, -1, -1, PumpProfileDefinition.DanaProfile), // DanaDiabecare_IIS(70002, "Diabcare II S/SG", "so_danaIISG.jpg", null, null, DeviceImplementationStatus.DoesntSupportDownload, DeviceCompanyDefinition.Sooil, - DeviceHandlerType.NoSupportInDevice, DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.None, + DeviceHandlerType.NoSupportInDevice, DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, DeviceProgressStatus.Normal, "", 0.1f, 0.1f, PumpTBRDefinition.DanaTBR, -1, -1, PumpProfileDefinition.DanaProfile), @@ -181,7 +192,7 @@ AsanteSnap(80001, "Asante Snap", null, null, null, // DeviceImplementationStatus.NotAvailable, DeviceCompanyDefinition.Asante, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // 0.1f, null, 0.1f, null, // PumpTBRDefinition.AsanteTBR, PumpProfileDefinition.AsanteProfile), // @@ -189,22 +200,36 @@ TandemTSlim(90001, "t:slim", "tan_tslim.jpg", null, null, // DeviceImplementationStatus.NotAvailable, DeviceCompanyDefinition.Tandem, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, // 0.1f, 0.05f, 0.05f, 0.05f, // PumpTBRDefinition.TandemTBR, PumpProfileDefinition.TandemProfile), // TandemTFlex(90002, "t:flex", "tan_tflex.jpg", null, null, // DeviceImplementationStatus.NotAvailable, DeviceCompanyDefinition.Tandem, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, // 0.1f, 0.05f, 0.05f, 0.05f, // PumpTBRDefinition.TandemTBR, PumpProfileDefinition.TandemProfile), // TandemTSlimG4(90003, "t:slim G4", "tan_tslimG4.jpg", null, null, // DeviceImplementationStatus.NotAvailable, DeviceCompanyDefinition.Tandem, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, // 0.1f, 0.05f, 0.05f, 0.05f, // PumpTBRDefinition.TandemTBR, PumpProfileDefinition.TandemProfile), // + TandemTSlimX2(90003, "t:slim X2", "tan_tslim.jpg", null, null, // + DeviceImplementationStatus.NotAvailable, DeviceCompanyDefinition.Tandem, DeviceHandlerType.NoHandler, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, // + 0.1f, 0.05f, 0.05f, 0.05f, // + PumpTBRDefinition.TandemTBR, PumpProfileDefinition.TandemProfile), // + + // Cellnovo + + Cellnovo1(100001, "Cellnovo", "cel_cellnovo1.jpg", null, null, // + DeviceImplementationStatus.NotAvailable, DeviceCompanyDefinition.Cellnovo, DeviceHandlerType.NoHandler, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.None, // + 0.1f, 0.05f, 0.05f, 0.05f, // + null, null), // + ; // Tandem Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/converter/AnimasBaseDataV2Converter.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/converter/AnimasBaseDataV2Converter.java 2017-09-17 22:37:54 UTC (rev 1469) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/converter/AnimasBaseDataV2Converter.java 2017-09-17 22:46:34 UTC (rev 1470) @@ -20,12 +20,12 @@ import ggc.plugin.device.impl.animas.enums.advsett.*; import ggc.plugin.device.impl.animas.util.AnimasUtils; import ggc.pump.data.defs.RatioType; +import ggc.pump.data.dto.BasalPatternEntryDTO; +import ggc.pump.data.dto.PumpSettingsDTO; import ggc.pump.data.dto.RatioDTO; import ggc.pump.device.animas.impl.data.AnimasPumpDeviceData; -import ggc.pump.device.animas.impl.data.dto.BasalProfileEntry; import ggc.pump.device.animas.impl.data.dto.BolusEntry; import ggc.pump.device.animas.impl.data.dto.BolusExtEntry; -import ggc.pump.device.animas.impl.data.dto.PumpSettings; /** * Application: GGC - GNU Gluco Control @@ -543,7 +543,7 @@ private void decodeAdvancedSettings(AnimasDeviceReplyPacket packet) { - PumpSettings pumpSettings = this.data.pumpSettings; + PumpSettingsDTO pumpSettings = this.data.pumpSettings; pumpSettings.audioBolusEnabled = getBooleanValue(packet.getReceivedDataBit(6)); pumpSettings.audioBolusStepSize = BolusStepSize.getById(packet.getReceivedDataBit(7)); @@ -635,7 +635,7 @@ private void decodeActiveBasal(AnimasDeviceReplyPacket adp) { - data.setActiveBasalProfile(adp.getReceivedDataBit(6)); + data.setActiveBasalPattern(adp.getReceivedDataBit(6)); } @@ -653,7 +653,7 @@ adp.getReceivedDataBit((20 + (p * 2) + 1))) .divide(bigDecimals.get("BIG_DECIMAL_1000f"), 3, BigDecimal.ROUND_CEILING); - data.addBasalProfileEntry(profileNumber, new BasalProfileEntry(time, amount.floatValue())); + data.addBasalPatternEntry(profileNumber, new BasalPatternEntryDTO(time, amount.floatValue())); } } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/AnimasPumpDeviceData.ja... [truncated message content] |
From: <and...@us...> - 2017-09-17 22:37:58
|
Revision: 1469 http://sourceforge.net/p/ggc/code/1469 Author: andyrozman Date: 2017-09-17 22:37:54 +0000 (Sun, 17 Sep 2017) Log Message: ----------- 1.2.5 - Bug Fix: Configuration - Hid4JavaCommunicationHandler - Minimed new implementation: series5xx, and series6xx - UsbHidDeviceHandler / UsbHidDeviceReader Modified Paths: -------------- trunk/ggc-plugins/ggc-plugins-base/docs/Changelog trunk/ggc-plugins/ggc-plugins-base/pom.xml trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/CommunicationPortComponent.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/CommunicationSettingsPanel.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/DeviceConfigurationDialog.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/Hid4JavaCommunicationHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/PlugInExceptionType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/db/PluginDb.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/DeviceAbstract.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/accuchek/AccuChekSmartPix.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/cfg/MinimedSpecialConfig.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/MinimedCommandReply.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/MinimedCommandTypeInterface.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/MinimedDataPage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/converter/MinimedDataConverterAbstract.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommInterfaceType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/util/MinimedUtil.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/DeviceHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/DeviceInstanceWithHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/graph/data/CGMSGraphDataHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/gui/DeviceSpecialConfigPanelAbstract.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/gui/DeviceSpecialConfigPanelInterface.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/util/DataAccessPlugInBase.java trunk/ggc-plugins/ggc-plugins-base/src/main/resources/GGCPlugin_en.properties Added Paths: ----------- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/MinimedCommunicationContourNext2.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/MinimedCommunicationContourNext24.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/MinimedCommunicationContourNextAbstract.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/MinimedUsbHidCommunicationAbstract.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/CountourNext_Packets.txt trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/Readme.ContourNext24.txt trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/MedtronicCnlSession.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/ContourNextLinkCommandMessage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/ContourNextLinkMessage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/ContourNextLinkResponseMessage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/MessageUtils.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series5xx/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series5xx/ContourNextLinkBinaryMessage5xx.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series5xx/MedtronicSendMessage5xx.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series6xx/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series6xx/ChannelNegotiateRequestMessage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series6xx/ContourNextLink24ResponseConverter.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series6xx/ContourNextLinkBinaryMessage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series6xx/MedtronicMessage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series6xx/MedtronicReceiveMessage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/data/message/series6xx/MedtronicSendMessage.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/enums/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/enums/CommandAction.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/enums/CommandType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/enums/ResponseExpected.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/enums/SendMessageType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/test/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/test/SimpleReadContourNext.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/tmp/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/tmp/HexDump.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/contournext/tmp/PumpStatusEvent.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/handler/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/handler/UsbHidDeviceHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/type/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/protocol/reader/UsbHidDeviceReader.java Modified: trunk/ggc-plugins/ggc-plugins-base/docs/Changelog =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/docs/Changelog 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/docs/Changelog 2017-09-17 22:37:54 UTC (rev 1469) @@ -2,6 +2,13 @@ Changes file for GGC Plug-In Base ================================== +1.2.5 [17.9.2017] +- Bug Fix: Configuration +- Hid4JavaCommunicationHandler +- Minimed new implementation: series5xx, and series6xx +- UsbHidDeviceHandler / UsbHidDeviceReader + + 1.2.4 [26.6.2017] - extended Hid4Java Communication handler - extended IBMCommunicationHandler Modified: trunk/ggc-plugins/ggc-plugins-base/pom.xml =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/pom.xml 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/pom.xml 2017-09-17 22:37:54 UTC (rev 1469) @@ -92,6 +92,12 @@ </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.1</version> + </dependency> + </dependencies> Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/CommunicationPortComponent.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/CommunicationPortComponent.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/CommunicationPortComponent.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -147,14 +147,19 @@ */ public void setProtocol(DeviceConnectionProtocol protocol) { - if (protocol == null) + System.out.println("Protocol: " + protocol); + + if (protocol == null || isNoPortDevice(protocol)) { + System.out.println("NULL Protocol"); label.setText(m_ic.getMessage("COMMUNICATION_PORT") + ":"); setCommunicationPort("N/A"); this.bt_select.setEnabled(false); + this.setVisible(false); return; } + this.setVisible(true); this.portDiscoveryAgent = portDiscoveryManager.getDiscoveryAgent(protocol); label.setText(m_ic.getMessage(this.portDiscoveryAgent.getPortDeviceName()) + ":"); @@ -162,4 +167,13 @@ this.bt_select.setEnabled(!this.portDiscoveryAgent.isEmptyDiscoveryAgent()); } + + public boolean isNoPortDevice(DeviceConnectionProtocol protocol) + { + return protocol == DeviceConnectionProtocol.None; + // || // + // protocol == DeviceConnectionProtocol.Database || // + // protocol == DeviceConnectionProtocol.FileImport; + } + } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/CommunicationSettingsPanel.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/CommunicationSettingsPanel.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/CommunicationSettingsPanel.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -44,17 +44,19 @@ private static final long serialVersionUID = 9197820657243699214L; int x_pos, y_pos; - DataAccessPlugInBase m_da; - I18nControlAbstract m_ic; - CommunicationPortComponent comm_port_comp; + DataAccessPlugInBase dataAccess; + I18nControlAbstract i18nControl; + CommunicationPortComponent communicationPortComponent; JDialog parent; - DeviceSpecialConfigPanelInterface special_config = null; + DeviceSpecialConfigPanelInterface specialConfig = null; int element_size = 65; DeviceInterface currentDeviceV1 = null; DeviceInstanceWithHandler currentDeviceV2 = null; + DeviceConfigurationDialog deviceConfigurationDialog; + /** * Constructor * @@ -61,19 +63,21 @@ * @param x * @param y * @param da - * @param parent_ + * @param deviceConfigurationDialog */ - public CommunicationSettingsPanel(int x, int y, DataAccessPlugInBase da, JDialog parent_) + public CommunicationSettingsPanel(int x, int y, DataAccessPlugInBase da, + DeviceConfigurationDialog deviceConfigurationDialog) { super(); this.setLayout(null); - this.m_da = da; - this.m_ic = da.getI18nControlInstance(); - this.parent = parent_; + this.dataAccess = da; + this.i18nControl = da.getI18nControlInstance(); + this.parent = deviceConfigurationDialog; + this.deviceConfigurationDialog = deviceConfigurationDialog; this.x_pos = x; this.y_pos = y; - this.setBorder(new TitledBorder(m_ic.getMessage("COMMUNICATION_SETTINGS"))); + this.setBorder(new TitledBorder(i18nControl.getMessage("COMMUNICATION_SETTINGS"))); init(); @@ -87,8 +91,8 @@ public void init() { - this.comm_port_comp = new CommunicationPortComponent(m_da, this.parent); - this.add(this.comm_port_comp); + this.communicationPortComponent = new CommunicationPortComponent(dataAccess, this.parent); + this.add(this.communicationPortComponent); } @@ -95,24 +99,24 @@ /** * Set Current Device * - * @param dev_interface + * @param deviceInterface */ - public void setCurrentDevice(DeviceInterface dev_interface) + public void setCurrentDevice(DeviceInterface deviceInterface) { resetDevices(false); - this.currentDeviceV1 = dev_interface; + this.currentDeviceV1 = deviceInterface; if (this.currentDeviceV1 == null) { - this.comm_port_comp.setProtocol(DeviceConnectionProtocol.None); + this.communicationPortComponent.setProtocol(DeviceConnectionProtocol.None); } else { - this.comm_port_comp.setProtocol(this.currentDeviceV1.getConnectionProtocol()); + this.communicationPortComponent.setProtocol(this.currentDeviceV1.getConnectionProtocol()); } - this.special_config = dev_interface.getSpecialConfigPanel(); + this.specialConfig = deviceInterface.getSpecialConfigPanel(); resetLayout(true); } @@ -121,24 +125,24 @@ /** * Set Current Device * - * @param dev_interface + * @param deviceInterface */ - public void setCurrentDevice(DeviceInstanceWithHandler dev_interface) + public void setCurrentDevice(DeviceInstanceWithHandler deviceInterface) { resetDevices(false); - this.currentDeviceV2 = dev_interface; + this.currentDeviceV2 = deviceInterface; if (this.currentDeviceV2 == null) { - this.comm_port_comp.setProtocol(DeviceConnectionProtocol.None); + this.communicationPortComponent.setProtocol(DeviceConnectionProtocol.None); } else { - this.comm_port_comp.setProtocol(this.currentDeviceV2.getConnectionProtocol()); + this.communicationPortComponent.setProtocol(this.currentDeviceV2.getConnectionProtocol()); } - this.special_config = dev_interface.getSpecialConfigPanel(); + this.specialConfig = deviceInterface.getSpecialConfigPanel(); resetLayout(true); } @@ -163,36 +167,36 @@ { if (selected) { - this.special_config = null; + this.specialConfig = null; if (this.currentDeviceV2 != null && this.currentDeviceV2.hasSpecialConfig()) { - this.special_config = this.currentDeviceV2.getSpecialConfigPanel(); + this.specialConfig = this.currentDeviceV2.getSpecialConfigPanel(); } else if (this.currentDeviceV1 != null && this.currentDeviceV1.hasSpecialConfig()) { - this.special_config = this.currentDeviceV1.getSpecialConfigPanel(); + this.specialConfig = this.currentDeviceV1.getSpecialConfigPanel(); } } - // System.out.println("Special config: " + this.special_config); + // System.out.println("Special config: " + this.specialConfig); this.removeAll(); - this.add(this.comm_port_comp); + this.add(this.communicationPortComponent); - if (this.special_config != null) + if (this.specialConfig != null) { - JPanel panel = this.special_config.getPanel(); + JPanel panel = this.specialConfig.getPanel(); if (panel != null) { - this.special_config.initPanel(); - panel.setBounds(5, 55, 400, this.special_config.getHeight()); + this.specialConfig.initPanel(); + panel.setBounds(5, 55, 400, this.specialConfig.getHeight()); panel.setEnabled(true); this.add(panel); - this.special_config.loadParametersToGUI(); + this.specialConfig.loadParametersToGUI(); // panel.setBounds(40, 40, 400, 35); } @@ -210,7 +214,7 @@ */ public void setProtocol(DeviceConnectionProtocol protocol) { - this.comm_port_comp.setProtocol(protocol); + this.communicationPortComponent.setProtocol(protocol); } @@ -223,26 +227,26 @@ { if (param == null) { - this.comm_port_comp.setCommunicationPort(m_ic.getMessage("NOT_SET")); + this.communicationPortComponent.setCommunicationPort(i18nControl.getMessage("NOT_SET")); } else { - if (this.special_config == null) + if (this.specialConfig == null) { - this.comm_port_comp.setCommunicationPort(param); + this.communicationPortComponent.setCommunicationPort(param); } else { - this.special_config.loadConnectionParameters(param); - this.comm_port_comp.setCommunicationPort(this.special_config.getDefaultParameter()); + this.specialConfig.loadConnectionParameters(param); + this.communicationPortComponent.setCommunicationPort(this.specialConfig.getDefaultParameter()); // System.out.println("Def parameter: " + - // this.special_config.getDefaultParameter()); + // this.specialConfig.getDefaultParameter()); } } - // this.comm_port_comp + // this.communicationPortComponent } @@ -253,12 +257,12 @@ */ public String getParameters() { - if (this.special_config == null) - return this.comm_port_comp.getCommunicationPort(); + if (this.specialConfig == null) + return this.communicationPortComponent.getCommunicationPort(); else { - this.special_config.setDefaultParameter(this.comm_port_comp.getCommunicationPort()); - return this.special_config.saveConnectionParameters(); + this.specialConfig.setDefaultParameter(this.communicationPortComponent.getCommunicationPort()); + return this.specialConfig.saveConnectionParameters(); } } @@ -270,7 +274,7 @@ */ public boolean areParametersSet() { - if (this.special_config == null) + if (this.specialConfig == null) { if (hasDefaultParameter()) { @@ -285,14 +289,14 @@ { if (checkIfDefaultParameterSet()) { - this.special_config.setDefaultParameter(this.comm_port_comp.getCommunicationPort()); - return this.special_config.areConnectionParametersValid(); + this.specialConfig.setDefaultParameter(this.communicationPortComponent.getCommunicationPort()); + return this.specialConfig.areConnectionParametersValid(); } else return false; } else - return this.special_config.areConnectionParametersValid(); + return this.specialConfig.areConnectionParametersValid(); } @@ -299,6 +303,20 @@ } + public String getCustomErrorMessage() + { + if (this.specialConfig == null) + { + return null; + } + else + { + return this.specialConfig.getCustomErrorMessage(); + } + + } + + private boolean hasDefaultParameter() { return (((this.currentDeviceV2 != null) @@ -309,10 +327,10 @@ private boolean checkIfDefaultParameterSet() { - if (m_ic.getMessage("NOT_SET").equals(this.comm_port_comp.getCommunicationPort())) + if (i18nControl.getMessage("NOT_SET").equals(this.communicationPortComponent.getCommunicationPort())) return false; - if (this.comm_port_comp.getCommunicationPort().trim().length() == 0) + if (this.communicationPortComponent.getCommunicationPort().trim().length() == 0) return false; else return true; @@ -324,9 +342,9 @@ { int sz = element_size; - if (this.special_config != null) + if (this.specialConfig != null) { - sz += this.special_config.getHeight(); + sz += this.specialConfig.getHeight(); } return sz; Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/DeviceConfigurationDialog.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/DeviceConfigurationDialog.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/DeviceConfigurationDialog.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -74,7 +74,7 @@ JTextField tf_name; JButton help_button; JLabel lbl_company, lbl_device; - // CommunicationPortComponent comm_port_comp; + // CommunicationPortComponent communicationPortComponent; JButton buttons[] = null; JPanel main_panel; @@ -88,10 +88,10 @@ int current_index = 0; String current_index_object = ""; String first_selected = ""; - CommunicationSettingsPanel comm_settings; + CommunicationSettingsPanel communicationSettingsPanel; - DeviceInterface currentDeviceV1 = null; - DeviceInstanceWithHandler currentDeviceV2 = null; + private DeviceInterface currentDeviceV1 = null; + private DeviceInstanceWithHandler currentDeviceV2 = null; TimeZoneUtil timeZoneUtil = TimeZoneUtil.getInstance(); @@ -111,6 +111,7 @@ m_da = (DataAccessPlugInBase) da; m_ic = m_da.getI18nControlInstance(); this.dcd = m_da.getDeviceConfigurationDefinition(); + m_da.setDeviceConfigurationDialog(this); m_da.addComponent(this); @@ -189,8 +190,8 @@ showDevice(); // FIXME - // this.comm_port_comp.setCommunicationPort(i18nControl.getMessage("NOT_SET")); - this.comm_settings.setParameters(null); + // this.communicationPortComponent.setCommunicationPort(i18nControl.getMessage("NOT_SET")); + this.communicationSettingsPanel.setParameters(null); if (!dcd.doesDeviceSupportTimeFix()) return; @@ -286,8 +287,8 @@ ATSwingUtils.getButton(m_ic.getMessage("SELECT"), 295, 55, 100, 55, pan_meter, ATSwingUtils.FONT_NORMAL, null, "device_selector", this, m_da); - comm_settings = new CommunicationSettingsPanel(20, 270, m_da, this); - main_panel.add(this.comm_settings); + communicationSettingsPanel = new CommunicationSettingsPanel(20, 270, m_da, this); + main_panel.add(this.communicationSettingsPanel); /* * JPanel pan_comm_settings = ATSwingUtils.getPanel(20, 250, 410, 80, @@ -294,12 +295,13 @@ * null, * new TitledBorder(i18nControl.getMessage("COMMUNICATION_SETTINGS")), * main_panel); - * this.comm_port_comp = new CommunicationPortComponent(dataAccess, + * this.communicationPortComponent = new + * CommunicationPortComponent(dataAccess, * this); - * pan_comm_settings.add(this.comm_port_comp); + * pan_comm_settings.add(this.communicationPortComponent); */ - int start_y = 270 + 5 + comm_settings.getHeight(); + int start_y = 270 + 5 + communicationSettingsPanel.getHeight(); if (this.dcd.doesDeviceSupportTimeFix()) { @@ -356,8 +358,8 @@ // this.cb_entry.setSelectedItem(this.first_selected); - this.comm_settings.setProtocol(DeviceConnectionProtocol.None); - // comm_port_comp.setProtocol(0); + this.communicationSettingsPanel.setProtocol(DeviceConnectionProtocol.None); + // communicationPortComponent.setProtocol(0); current_index = this.cb_entry.getSelectedIndex(); this.current_index_object = (String) this.cb_entry.getSelectedItem(); this.loadItemData(); @@ -391,24 +393,24 @@ if (this.currentDeviceV1 != null && (this.currentDeviceV1.hasDefaultParameter() || this.currentDeviceV1.hasSpecialConfig())) { - this.comm_settings.setCurrentDevice(this.currentDeviceV1); - start_y += comm_settings.getHeight(); // .getBounds().height; - this.comm_settings.setVisible(true); + this.communicationSettingsPanel.setCurrentDevice(this.currentDeviceV1); + start_y += communicationSettingsPanel.getHeight(); // .getBounds().height; + this.communicationSettingsPanel.setVisible(true); } else if (this.currentDeviceV2 != null && (this.currentDeviceV2.getDevicePortParameterType() == DevicePortParameterType.SimpleParameter || this.currentDeviceV2.hasSpecialConfig())) { - this.comm_settings.setCurrentDevice(this.currentDeviceV2); + this.communicationSettingsPanel.setCurrentDevice(this.currentDeviceV2); - start_y += comm_settings.getHeight(); // .getBounds().height; - this.comm_settings.setVisible(true); + start_y += communicationSettingsPanel.getHeight(); // .getBounds().height; + this.communicationSettingsPanel.setVisible(true); } else { // System.out.println("No parameters used !"); - comm_settings.resetDevices(true); - this.comm_settings.setVisible(false); + communicationSettingsPanel.resetDevices(true); + this.communicationSettingsPanel.setVisible(false); } if (this.dcd.doesDeviceSupportTimeFix()) @@ -434,9 +436,9 @@ // System.out.println("current device: " + this.current_device); this.lbl_company.setText(m_ic.getMessage("NO_COMPANY_SELECTED")); this.lbl_device.setText(m_ic.getMessage("NO_DEVICE_SELECTED")); - // this.comm_port_comp.setProtocol(0); - this.comm_settings.setProtocol(DeviceConnectionProtocol.None); - this.comm_settings.setParameters(null); + // this.communicationPortComponent.setProtocol(0); + this.communicationSettingsPanel.setProtocol(DeviceConnectionProtocol.None); + this.communicationSettingsPanel.setParameters(null); this.refreshCommunicationSettings(); } @@ -444,33 +446,33 @@ { this.lbl_company.setText(getParameterValue(1)); this.lbl_device.setText(getParameterValue(2)); - // this.comm_port_comp.setProtocol(this.current_device.getConnectionProtocol()); + // this.communicationPortComponent.setProtocol(this.current_device.getConnectionProtocol()); // System.out.println("current device: " + this.current_device); this.refreshCommunicationSettings(); - if (this.comm_settings != null) + if (this.communicationSettingsPanel != null) { if (this.currentDeviceV1 != null) { - this.comm_settings.setCurrentDevice(this.currentDeviceV1); + this.communicationSettingsPanel.setCurrentDevice(this.currentDeviceV1); } else { - this.comm_settings.setCurrentDevice(this.currentDeviceV2); + this.communicationSettingsPanel.setCurrentDevice(this.currentDeviceV2); } if (this.current_entry != null) { - this.comm_settings.setParameters(this.current_entry.communication_port_raw); + this.communicationSettingsPanel.setParameters(this.current_entry.communication_port_raw); } else { - this.comm_settings.setParameters(null); + this.communicationSettingsPanel.setParameters(null); } - // this.comm_settings.setParameters(this.current_device.) + // this.communicationSettingsPanel.setParameters(this.current_device.) // x this.refreshCommunicationSettings(); } @@ -529,9 +531,13 @@ return; } - if (!this.comm_settings.areParametersSet()) + if (!this.communicationSettingsPanel.areParametersSet()) { - JOptionPane.showMessageDialog(this, m_ic.getMessage("CONFIG_ERROR_NO_DEVICE_OR_PARAMETERS"), + String customErrorMessage = this.communicationSettingsPanel.getCustomErrorMessage(); + + JOptionPane.showMessageDialog(this, + m_ic.getMessage( + customErrorMessage != null ? customErrorMessage : "CONFIG_ERROR_NO_DEVICE_OR_PARAMETERS"), m_ic.getMessage("WARNING"), JOptionPane.ERROR_MESSAGE); return; } @@ -543,6 +549,7 @@ this.m_da.resetSelectedDeviceInstance(); this.dispose(); + this.m_da.setDeviceConfigurationDialog(null); m_da.removeComponent(this); } else if (action.equals("cancel")) @@ -549,6 +556,7 @@ { action_was = false; this.dispose(); + this.m_da.setDeviceConfigurationDialog(null); m_da.removeComponent(this); } else if (action.equals("device_selector")) @@ -563,7 +571,7 @@ // dsd.getSelectedObject(); this.current_entry = new DeviceConfigEntry(m_ic); this.refreshCommunicationSettings(); - this.comm_settings.setParameters(null); + this.communicationSettingsPanel.setParameters(null); System.out.println("Device V1 " + currentDeviceV1 + ", Device V2 " + currentDeviceV2); @@ -680,9 +688,9 @@ // if (is_new) // dce.communication_port_raw = ""; // else - dce.communication_port_raw = this.comm_settings.getParameters(); // .comm_port_comp.getCommunicationPort(); + dce.communication_port_raw = this.communicationSettingsPanel.getParameters(); // .communicationPortComponent.getCommunicationPort(); - if (this.comm_settings.getParameters().equals(m_ic.getMessage("NOT_SET"))) + if (this.communicationSettingsPanel.getParameters().equals(m_ic.getMessage("NOT_SET"))) { dce.communication_port_raw = ""; } @@ -822,4 +830,15 @@ return "DeviceTool_Configuration"; } + + public DeviceInterface getCurrentDeviceV1() + { + return currentDeviceV1; + } + + + public DeviceInstanceWithHandler getCurrentDeviceV2() + { + return currentDeviceV2; + } } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/Hid4JavaCommunicationHandler.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/Hid4JavaCommunicationHandler.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/Hid4JavaCommunicationHandler.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -30,6 +30,7 @@ private USBDevice targetDevice; // FIXME we may need to support serialNumber // of device in future HidServices hidServices; + private boolean throwExceptionOnError; public boolean connectAndInitDevice() throws PlugInBaseException @@ -154,14 +155,11 @@ if (this.hidDevice != null) { this.hidDevice.close(); - this.hidDevice = null; - } if (this.hidServices != null) this.hidServices.shutdown(); // clean shutdown - } @@ -185,13 +183,30 @@ public int read(byte[] buffer) throws PlugInBaseException { - return this.hidDevice.read(buffer, timeoutMs); + int result = this.hidDevice.read(buffer, timeoutMs); + + return evaluateResult(result); } + private int evaluateResult(int result) throws PlugInBaseException + { + if ((result == -1) && (throwExceptionOnError)) + { + LOG.debug("evaluateResult: {}", this.getLastErrorMessage()); + throw new PlugInBaseException(PlugInExceptionType.Hid4JavaAPIError, + new Object[] { this.getLastErrorMessage(), Thread.currentThread().getStackTrace() }); + } + + return result; + } + + public int read(byte[] buffer, int timeout) throws PlugInBaseException { - return this.hidDevice.read(buffer, timeout); + int result = this.hidDevice.read(buffer, timeout); + + return evaluateResult(result); } @@ -208,16 +223,36 @@ public void write(byte[] buffer) throws PlugInBaseException { - this.hidDevice.write(buffer, buffer.length, this.selectedDevice.getReportId()); + int result = this.hidDevice.write(buffer, buffer.length, this.selectedDevice.getReportId()); + + evaluateResult(result); } public int writeWithReturn(byte[] buffer) throws PlugInBaseException { - return this.hidDevice.write(buffer, buffer.length, this.selectedDevice.getReportId()); + int result = this.hidDevice.write(buffer, buffer.length, this.selectedDevice.getReportId()); + + return evaluateResult(result); } + public int writeToFeatureReport(byte[] buffer) throws PlugInBaseException + { + int result = this.hidDevice.sendFeatureReport(buffer, this.selectedDevice.getReportId()); + + return evaluateResult(result); + } + + + public int readFromFeatureReport(byte[] buffer) throws PlugInBaseException + { + int result = this.hidDevice.getFeatureReport(buffer, this.selectedDevice.getReportId()); + + return evaluateResult(result); + } + + public String getLastErrorMessage() { return this.hidDevice.getLastErrorMessage(); @@ -323,6 +358,8 @@ USBDevice device = new USBDevice("", Integer.parseInt(address[0], 16), Integer.parseInt(address[1], 16)); this.targetDevice = device; LOG.debug("Target device is: " + targetDevice); + + // FIXME support for serial number } else { @@ -336,4 +373,10 @@ { return selectedDevice; } + + + public void setThrowExceptionOnError(boolean throwExceptionOnError) + { + this.throwExceptionOnError = throwExceptionOnError; + } } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -44,6 +44,7 @@ Insulet(206, "Insulet", "", DeviceImplementationStatus.Done), // Sooil(207, "Sooil", "", DeviceImplementationStatus.Full), // Asante(208, "Asante", "", DeviceImplementationStatus.NotAvailable), // + Cellnovo(209, "Cellnovo", "", DeviceImplementationStatus.NotAvailable), // // 3xx = CGMS Dexcom(301, "Dexcom", "", DeviceImplementationStatus.Partitial), // @@ -54,13 +55,12 @@ Tandem(403, "Tandem", "", DeviceImplementationStatus.Planned), // // 5xx = Meter + Pump - Roche(202, "AccuChek/Roche", "", DeviceImplementationStatus.Done), // Disetronic(2), // 6xx = Meter + CGMS Abbott(302, "Abbott", "", DeviceImplementationStatus.NotAvailable), // // 7xx = Meter + Pump + CGMS - + Roche(202, "AccuChek/Roche", "", DeviceImplementationStatus.Done), // Disetronic(2), ; int id; Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -53,6 +53,7 @@ DexcomHandler(DownloadSupportType.Download_Data_Config), // Dexcom7Handler(DownloadSupportType.DownloadDataFile), // only for old files MinimedCGMSHandler(DownloadSupportType.Download_Data_Config), // + AbbottLibreHandler(DownloadSupportType.Download_Data_Config), // ; Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/PlugInExceptionType.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/PlugInExceptionType.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/PlugInExceptionType.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -51,11 +51,13 @@ DeviceSerialNumberCouldNotBeRead("Serial number was not read from device."), // DeviceInvalidCommand("Device reported an invalid command error."), // + DeviceIsInWrongState("Device is in wrong state [current=%s, expected=%s]"), // DeviceInvalidParameterDesc("Device reported an invalid parameter error for parameter %s."), // DeviceInvalidParameter("Device reported an invalid parameter error."), // DeviceInternalError("Device reported an internal error."), // DeviceInvalidResponseCommand("Unknown or invalid response for command: %s (expected: %s)."), // DeviceInvalidResponseLength("Device packet response length is %d (expected length is %d)"), // + DeviceInvalidResponseDescription("Unknown or invalid response - (%s)."), // DeviceFailedToReadResponse("Failed to read contents of device packet"), // DeviceModelCouldNotBeIdentified("Device Model could not be identified."), // DeviceCouldNotBeContacted("Device could not be contacted."), // @@ -83,9 +85,10 @@ Parsing_BytesParsingError("EXC_BYTES_PARSING_ERROR"), // ParsingError("EXC_PARSING_ERROR"), // ParsingErrorUnsupportedDataLenth("EXC_PARSING_ERROR_UNSUPP_DATA_LENGTH"), // - FailedCRCCheck("EXC_FAILED_CRC_CHECK"), // + FailedCRCCheck("Device response failed CRC check. [expected=%s, got=%s]"), // "EXC_FAILED_CRC_CHECK" FailedCRCCheckInPacket("Failed CRC check in packet."), // - FailedEncryptionDecryption("Failure on encrypt/decrypt of data."), // + FailedEncryptionDecryption("Failed encryption/decryption of data."), // + FailedEncryptionDecryptionDesc("Failed encryption/decryption of data - (%s)."), // UnsupportedTypeOfParametersForCommand("EXC_UNSUPPORTED_TYPE_OF_PARAMS_FOR_CMD"), // // Handler @@ -97,6 +100,7 @@ DeviceInvalidResponse("Device returned invalid response. Expected: %s, Received: %s"), // DeviceCommandInvalidResponse("Device was sent command [%s], but it responded with [%s], instead of [%s]"), // DeviceUnexpectedResponse("Device returned unexpected response. Received: %s"), // + DeviceUnexpectedResponseCompared("Device returned unexpected response. Expected: %s, Received: %s"), // DeviceReturnedError("Device returned error [command=%s, errorCode=%s, errorDescription=%s, returnedData=%s]"), // @@ -104,6 +108,7 @@ ImportFileCouldNotBeRead("Import file (name=%s) could not be read (%s)"), // ErrorCommunicationWithProtocolHandler("Error communicating with specific library [%s]: (%s)"), // + Hid4JavaAPIError("Error using Hid4Java API: %s\n%s"), // ; // DXC_PARSING_ERROR = Error parsing. Exception: %s Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/db/PluginDb.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/db/PluginDb.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/db/PluginDb.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -1,10 +1,9 @@ package ggc.plugin.db; -import java.util.ArrayList; -import java.util.GregorianCalendar; -import java.util.Iterator; -import java.util.List; +import java.security.InvalidParameterException; +import java.util.*; +import org.apache.commons.collections.CollectionUtils; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.Session; @@ -20,6 +19,7 @@ import com.atech.db.hibernate.HibernateObject; import com.atech.graphics.graphs.v2.data.GraphDbDataRetriever; import com.atech.utils.data.ATechDate; +import com.atech.utils.data.ATechDateType; import ggc.core.db.hibernate.cgms.CGMSDataH; import ggc.plugin.util.DataAccessPlugInBase; @@ -238,8 +238,87 @@ } - public List<CGMSDataH> getRangeCGMSValuesRaw(GregorianCalendar from, GregorianCalendar to, String filter) + public Criterion getRangeCriteria(GregorianCalendar from, GregorianCalendar to, ATechDateType dateType, + String fromParameter, String toParameter) { + long dtFrom = ATechDate.getATDateTimeFromGC(from, ATechDateType.DateOnly); + long dtTill = ATechDate.getATDateTimeFromGC(to, ATechDateType.DateOnly); + + if (dateType == ATechDateType.DateAndTimeMin) + { + dtFrom *= 10000; + dtTill *= 10000; + + dtTill += 2359L; + } + else if (dateType == ATechDateType.DateAndTimeSec) + { + dtFrom *= 1000000; + dtTill *= 1000000; + + dtTill += 235959L; + } + else if (dateType != ATechDateType.DateOnly) + { + throw new InvalidParameterException(); + } + + return Restrictions.and(Restrictions.ge("dtInfo", dtFrom), Restrictions.le("dtInfo", dtTill)); + } + + + public Criterion getPersonCriterion() + { + return Restrictions.eq("personId", (int) dataAccess.getCurrentUserId()); + } + + + public Criterion getSourceDeviceCriterion() + { + return Restrictions.like("extended", "%" + dataAccess.getSourceDevice() + "%"); + } + + + public void addPersonAndSourceDevice(Criteria criteria) + { + criteria.add(getPersonCriterion()); + criteria.add(getSourceDeviceCriterion()); + } + + + public List<CGMSDataH> getRangeCGMSValuesRaw(GregorianCalendar from, GregorianCalendar to, + List<? extends Criterion> criterions) + { + LOG.info(String.format("getRangeCGMSValuesRaw(%s)", CollectionUtils.isEmpty(criterions) ? "" : criterions)); + + List<CGMSDataH> listCGMSData = new ArrayList<CGMSDataH>(); + + List<Criterion> criteria = new ArrayList<Criterion>(); + + criteria.add(getRangeCriteria(from, to, ATechDateType.DateOnly, "dtInfo", "dtInfo")); + + if (CollectionUtils.isNotEmpty(criterions)) + { + criteria.addAll(criterions); + } + + try + { + listCGMSData = getHibernateData(CGMSDataH.class, criteria, Arrays.asList(Order.asc("dtInfo"))); + } + catch (Exception ex) + { + LOG.error("getRangeCGMSValuesRaw(). Exception: " + ex, ex); + } + + LOG.debug("Found " + listCGMSData.size() + " entries."); + + return listCGMSData; + } + + + public List<CGMSDataH> getRangeCGMSValuesRawOld(GregorianCalendar from, GregorianCalendar to, String filter) + { LOG.info(String.format("getRangeCGMSValuesRaw(%s)", filter == null ? "" : filter)); long dt_from = ATechDate.getATDateTimeFromGC(from, ATechDate.FORMAT_DATE_ONLY); @@ -329,12 +408,15 @@ int sum_all = 0; Criteria criteria = this.getSession().createCriteria(hibernateClazz); - criteria.add(Restrictions.eq("personId", (int) dataAccess.getCurrentUserId())); + criteria.add(getPersonCriterion()); criteria.add(Restrictions.like("extended", "%" + dataAccess.getSourceDevice() + "%")); - for (Criterion criterion : criterionList) + if (CollectionUtils.isNotEmpty(criterionList)) { - criteria.add(criterion); + for (Criterion criterion : criterionList) + { + criteria.add(criterion); + } } criteria.setProjection(Projections.rowCount()); Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/DeviceAbstract.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/DeviceAbstract.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/DeviceAbstract.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -48,7 +48,7 @@ protected String deviceSourceName; protected String connectionParameters = null; protected String connectionParametersRaw = null; - protected DeviceSpecialConfigPanelInterface special_config = null; + protected DeviceSpecialConfigPanelInterface specialConfig = null; protected boolean canReadData = false; protected boolean canReadPartitialData = false; @@ -57,6 +57,7 @@ protected GGCI18nControl i18nControlAbstract = null; // DataAccessMeter.getInstance().getI18nControlInstance(); protected OutputWriter outputWriter; protected List<GGCPlugInFileReaderContext> fileContexts; + protected String specialConfigKey = null; /** @@ -594,8 +595,8 @@ { if (this.hasSpecialConfig()) { - this.special_config.loadConnectionParameters(param); - this.connectionParameters = this.special_config.getDefaultParameter(); + this.specialConfig.loadConnectionParameters(param); + this.connectionParameters = this.specialConfig.getDefaultParameter(); } else { @@ -631,7 +632,7 @@ { if (this.hasSpecialConfig()) { - this.special_config.loadConnectionParameters(param); + this.specialConfig.loadConnectionParameters(param); return this.getSpecialConfigPanel().areConnectionParametersValid(); } else @@ -659,7 +660,7 @@ */ public boolean hasSpecialConfig() { - return this.special_config != null; + return this.specialConfigKey != null; } @@ -670,12 +671,12 @@ */ public DeviceSpecialConfigPanelInterface getSpecialConfigPanel() { - return this.special_config; + return null; } /** - * Initialize Special Config + * Initialize Special Config (setting specialConfigKey) */ public void initSpecialConfig() { Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/accuchek/AccuChekSmartPix.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/accuchek/AccuChekSmartPix.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/accuchek/AccuChekSmartPix.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -137,7 +137,7 @@ // System.out.println("Init reader !!!"); - if (this.special_config.getParameter("SMARTPIX_VERSION").equals(AccuChekSmartPixSpecialConfig.SMARTPIX_V2)) + if (this.specialConfig.getParameter("SMARTPIX_VERSION").equals(AccuChekSmartPixSpecialConfig.SMARTPIX_V2)) { this.reader = new AccuChekSmartPixReaderV2(dataAccess, this.outputWriter, this); } @@ -432,6 +432,11 @@ } + // public DeviceSpecialConfigPanelAbstract getSpecialConfig() + // { + // return this.specialConfig; + // } + /** * Initialize Special Config */ @@ -438,16 +443,19 @@ @Override public void initSpecialConfig() { + this.specialConfigKey = "AccuChekSmartPix"; + if (DataAccessPlugInBase.special_configs.containsKey("AccuChekSmartPix")) { - this.special_config = DataAccessPlugInBase.special_configs.get("AccuChekSmartPix"); + this.specialConfig = (AccuChekSmartPixSpecialConfig) DataAccessPlugInBase.special_configs + .get("AccuChekSmartPix"); } else { // System.out.println("!!!!!!!! inti Special config"); - this.special_config = new AccuChekSmartPixSpecialConfig(dataAccess, this); + this.specialConfig = new AccuChekSmartPixSpecialConfig(dataAccess, this); DataAccessPlugInBase.special_configs.put("AccuChekSmartPix", - (DeviceSpecialConfigPanelAbstract) this.special_config); + (DeviceSpecialConfigPanelAbstract) this.specialConfig); } } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/cfg/MinimedSpecialConfig.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/cfg/MinimedSpecialConfig.java 2017-09-17 22:27:55 UTC (rev 1468) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/cfg/MinimedSpecialConfig.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -9,6 +9,7 @@ import com.atech.utils.ATSwingUtils; +import ggc.plugin.cfg.DeviceConfigurationDialog; import ggc.plugin.device.impl.minimed.enums.MinimedCommInterfaceType; import ggc.plugin.device.v2.DeviceInstanceWithHandler; import ggc.plugin.gui.DeviceSpecialConfigPanelAbstract; @@ -40,16 +41,12 @@ * Author: Andy {an...@at...} */ -public class MinimedSpecialConfig extends DeviceSpecialConfigPanelAbstract implements ActionListener // , - // ItemListener, - // DocumentListener +public class MinimedSpecialConfig extends DeviceSpecialConfigPanelAbstract implements ActionListener { - String[] data_versions = null; + String[] dataVersions = null; JComboBox cbInterface = null; - private JTextField tfSerialNr; - boolean inited = false; @@ -56,7 +53,6 @@ public MinimedSpecialConfig(DataAccessPlugInBase da, DeviceInstanceWithHandler deviceInstanceV2) { super(da, deviceInstanceV2); - System.out.println("MinimedSpecialConfig: " + this); } @@ -66,8 +62,6 @@ if (inited) return; - System.out.println("Init panel"); - this.configPanel = new JPanel(); this.configPanel.setLayout(null); this.configPanel.setSize(400, getHeight()); @@ -74,16 +68,13 @@ ATSwingUtils.initLibrary(); - String[] dta = MinimedCommInterfaceType.getSupportedInterfacesArray(); + dataVersions = MinimedCommInterfaceType.getSupportedInterfacesArray(); - data_versions = MinimedCommInterfaceType.getSupportedInterfacesArray(); - ATSwingUtils.getLabel(this.i18nControl.getMessage("MM_CONN_INTERFACE") + ":", 20, 5, 150, 25, this.configPanel, ATSwingUtils.FONT_NORMAL_BOLD); - cbInterface = ATSwingUtils.getComboBox(data_versions, 165, 5, 190, 25, this.configPanel, + cbInterface = ATSwingUtils.getComboBox(dataVersions, 165, 5, 190, 25, this.configPanel, ATSwingUtils.FONT_NORMAL); - // cbInterface.addItemListener(this); int size[] = { 17, 17 }; @@ -91,7 +82,7 @@ ATSwingUtils.FONT_NORMAL_BOLD); ATSwingUtils.getButton("", 365, 40, 25, 25, this.configPanel, ATSwingUtils.FONT_NORMAL, "about.png", "get_info", - this, dataAccess, size); // , this, dataAccess, size); + this, dataAccess, size); this.tfSerialNr = ATSwingUtils.getTextField(null, 165, 40, 150, 25, this.configPanel, ATSwingUtils.FONT_NORMAL); // this.tfSerialNr.getDocument().addDocumentListener(this); @@ -140,10 +131,10 @@ { if (ae.getActionCommand().contains("get_info")) { - JOptionPane.showMessageDialog(dataAccess.getCurrentComponentParent(), - i18nControl.getMessage("MINIMED_CONFIG_INFO"), // - i18nControl.getMessage("INFORMATION"), // - JOptionPane.INFORMATION_MESSAGE); + ATSwingUtils.showMessageDialog(dataAccess.getDeviceConfigurationDialog(), // + ATSwingUtils.DialogType.Info, // + i18nControl.getMessage("MM_CONFIG_INFO"), // + i18nControl); } } @@ -152,6 +143,42 @@ public boolean areCustomParametersValid() { readParametersFromGUI(); - return StringUtils.isNotBlank(tfSerialNr.getText()); + + if (StringUtils.isBlank(tfSerialNr.getText())) + return false; + + // check + + DeviceConfigurationDialog dialog = dataAccess.getDeviceConfigurationDialog(); + + String deviceName = dialog.getCurrentDeviceV2().getDeviceDefinitionBase().getDeviceName(); + + MinimedCommInterfaceType interfaceType = MinimedCommInterfaceType + .getByDescription((String) cbInterface.getSelectedItem()); + + if (((interfaceType == MinimedCommInterfaceType.ContourNextLink2) && // + (isContourNextLink24Required(deviceName))) // + || // + ((interfaceType == MinimedCommInterfaceType.ContourNextLink24) && // + (!isContourNextLink24Required(deviceName)))) + { + return false; + } + + return true; } + + + private boolean isContourNextLink24Required(String deviceName) + { + // add new 6xx devices here (name from PumpDevices) + return deviceName.equals("Minimed_640G"); + } + + + public String getCustomErrorMessage() + { + return "MM_CUSTOM_ERROR"; + } + } Added: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/MinimedCommunicationContourNext2.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/MinimedCommunicationContourNext2.java (rev 0) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/MinimedCommunicationContourNext2.java 2017-09-17 22:37:54 UTC (rev 1469) @@ -0,0 +1,160 @@ +package ggc.plugin.device.impl.minimed.comm.usb; + +import java.io.IOException; +import java.security.NoSuchAlgorithmException; +import java.util.concurrent.TimeoutException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ggc.plugin.device.PlugInBaseException; +import ggc.plugin.device.impl.minimed.comm.usb.contournext.data.message.ContourNextLinkMessage; +import ggc.plugin.device.impl.minimed.comm.usb.contournext.data.message.series5xx.MedtronicSendMessage5xx; +import ggc.plugin.device.impl.minimed.comm.usb.contournext.data.message.series6xx.ContourNextLinkBinaryMessage; +import ggc.plugin.device.impl.minimed.comm.usb.contournext.enums.CommandType; +import ggc.plugin.device.impl.minimed.data.MinimedCommandReply; +import ggc.plugin.device.impl.minimed.enums.MinimedCommInterfaceType; +import ggc.plugin.device.impl.minimed.enums.MinimedCommandType; +import ggc.plugin.device.impl.minimed.handler.MinimedDataHandler; +import ggc.plugin.util.DataAccessPlugInBase; + +/** + * Created by andy on 13.06.17. + */ + +/** + * This class was taken from 600SeriesAndroidUploader project, which + * is loacted at https://github.com/pazaan/600SeriesAndroidUploader. + * + * Original author: lgoedhart on 26/03/2016. + * + * Comment: this file has just minor changes + */ + +public class MinimedCommunicationContourNext2 extends MinimedCommunicationContourNextAbstract +{ + + private static final Logger LOG = LoggerFactory.getLogger(MinimedCommunicationContourNext2.class); + + + /** + * Constructor + * + * @param dataAccess + * @param minimedDataHandler data Handler + */ + public MinimedCommunicationContourNext2(DataAccessPlugInBase dataAccess, MinimedDataHandler minimedDataHandler) + { + super(dataAccess, minimedDataHandler); + + // responseConverter = new ContourNextLink2ResponseConverter(session); + } + + + @Override + public MinimedCommInterfaceType getInterfaceType() + { + return MinimedCommInterfaceType.ContourNextLink2; + } + + + public int initDevice() throws PlugInBaseException + { + try + { + enterControlMode(); + enterPassthroughMode(); + openConnection(); + } + catch (PlugInBaseException e) + { + e.printStackTrace(); + } + catch (Exception e) + { + e.printStackTrace(); + } + + return 0; + } + + + public int closeDevice() throws PlugInBaseException + { + try + { + closeConnection(); + endPassthroughMode(); + endControlMode(); + } + catch (PlugInBaseException e) + { + e.printStackTrace(); + } + catch (Exception e) + { + e.printStackTrace(); + } + + return 0; + } + + + public void sendMessage(ContourNextLinkMessage message) throws PlugInBaseException + { + sendMessage(message.encode()); + } + + + public MinimedCommandReply executeCommandWithRetry(MinimedCommandType commandType) throws PlugInBaseException + { + LOG.debug("executeCommandWithRetry (commandType={}) - START", commandType.name()); + + sendMessage(commandType); + + // FIXME do we get 2 responses or one + // Read the 0x81 + readMessage(); + + // Read the 0x80 + MinimedCommandReply minimedCommandReply = getMinimedCommandReply(commandType, readMessage()); + + LOG.debug("executeCommandWithRetry (commandType={}) - END", commandType.name()); + + return minimedCommandReply; + } + + + private MinimedCommandReply getMinimedCommandReply(MinimedCommandType commandType, byte[] rawData) + throws PlugInBaseException + { + MinimedCommandReply reply = new MinimedCommandReply(commandType); + + reply.setRawData(rawData); + return reply; + } + + + @Override + protected void executeHistoryCommandWithRetry(MinimedCommandType commandType) throws PlugInBaseException + { + + } + + + private void sendMessage(MinimedCommandType commandType) throws PlugInBaseException + { + sendMessage(new MedtronicSendMessage5xx(commandType, session)); + } + + + public void openConnection() throws IOException, TimeoutException, NoSuchAlgorithmException, PlugInBaseException + { + LOG.debug("Begin openConnection"); + sendMessage(new ContourNextLinkBinaryMessage(CommandType.OPEN_CONNECTION, session, null)); + // FIXME - We need to care what the response message is - wrong MAC and + // all that + readMessage(); + LOG.debu... [truncated message content] |
From: <and...@us...> - 2017-09-17 22:27:58
|
Revision: 1468 http://sourceforge.net/p/ggc/code/1468 Author: andyrozman Date: 2017-09-17 22:27:55 +0000 (Sun, 17 Sep 2017) Log Message: ----------- 1.6.0 - base support for Abbott Libre (almost finished, needs integration) - DeviceDefinitions added with new definitions - added some data converters for Minimed Modified Paths: -------------- trunk/ggc-plugins/ggc-cgms/doc/Changelog trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/GGC_CGMSDb.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/writer/CGMSValuesWriter.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceDefinition.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed522CGMSDataConverter.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed523CGMSDataConverter.java trunk/ggc-plugins/ggc-cgms/src/main/resources/GGC_CGMSTool_en.properties Added Paths: ----------- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSDataReader.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSHandler.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/AutoMeasurementDto.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreDataConverter.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreHidReportDto.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreRecordDto.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/ManualMeasurementDto.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/TimeChangeDto.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/enums/ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/enums/BaseCommand.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/enums/LibreError.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/enums/LibreTextCommand.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/enums/ResultValueType.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/MinimedCGMSDataConverterAbstract.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/test/CGMSLibreConsoleTester.java trunk/ggc-plugins/ggc-cgms/src/main/resources/icons/cgms/ac_eversense.png Modified: trunk/ggc-plugins/ggc-cgms/doc/Changelog =================================================================== --- trunk/ggc-plugins/ggc-cgms/doc/Changelog 2017-09-17 21:38:43 UTC (rev 1467) +++ trunk/ggc-plugins/ggc-cgms/doc/Changelog 2017-09-17 22:27:55 UTC (rev 1468) @@ -4,6 +4,11 @@ -- We will move to version 2.0, when Minimed is supported (Navigator 1.x or 2.x) +1.6.0 [17.9.2017] Andy +- base support for Abbott Libre (almost finished, needs integration) +- DeviceDefinitions added with new definitions +- added some data converters for Minimed + 1.5.3 [26.6.2017] - changed enums, so that translation are changed from withing DataAccess - refactorings Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/GGC_CGMSDb.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/GGC_CGMSDb.java 2017-09-17 21:38:43 UTC (rev 1467) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/GGC_CGMSDb.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -7,7 +7,6 @@ import org.hibernate.Criteria; import org.hibernate.criterion.Order; -import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,7 +15,6 @@ import com.atech.graphics.graphs.v2.data.GraphDbDataRetriever; import com.atech.graphics.graphs.v2.data.GraphDefinitionDto; import com.atech.graphics.graphs.v2.data.GraphTimeDataCollection; -import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.data.ATechDate; import com.atech.utils.data.ATechDateType; @@ -26,7 +24,6 @@ import ggc.core.db.hibernate.cgms.CGMSDataH; import ggc.plugin.data.DeviceValuesDay; import ggc.plugin.data.DeviceValuesEntryInterface; -import ggc.plugin.data.DeviceValuesRange; import ggc.plugin.db.PluginDb; /** @@ -119,7 +116,9 @@ // return null; } + // getHibernateData + /** * Get Pump Values Range * @@ -127,52 +126,54 @@ * @param to * @return */ - public DeviceValuesRange getRangePumpValues(GregorianCalendar from, GregorianCalendar to) - { - ATDataAccessAbstract.notImplemented("GGC_CGMSDb::getRangePumpValues()"); - return null; + // public DeviceValuesRange getRangePumpValues(GregorianCalendar from, GregorianCalendar to) + // { + // + // + // + // ATDataAccessAbstract.notImplemented("GGC_CGMSDb::getRangePumpValues()"); + // return null; + // + // /* + // * log.info("getPumpDayStats()"); + // * long dt_from = ATechDate.getATDateTimeFromGC(from, + // * ATechDate.FORMAT_DATE_ONLY); + // * long dt_to = ATechDate.getATDateTimeFromGC(to, + // * ATechDate.FORMAT_DATE_ONLY); + // * String sql = ""; + // * DeviceValuesRange dvr = new + // * DeviceValuesRange(DataAccessPump.getInstance(), from, to); + // * try + // * { + // * sql = "SELECT dv from " + + // * "ggc.core.db.hibernate.pump.PumpDataH as dv " + + // * "WHERE dv.dt_info >= " + dt_from + // * + "000000 AND dv.dt_info <= " + dt_to + "235959 ORDER BY dv.dt_info"; + // * //System.out.println("SQL: " + sql); + // * Query q = this.db.getSession().createQuery(sql); + // * Iterator<?> it = q.list().iterator(); + // * while (it.hasNext()) + // * { + // * PumpDataH pdh = (PumpDataH)it.next(); + // * PumpValuesEntry dv = new PumpValuesEntry(pdh); + // * dvr.addEntry(dv); + // * } + // * ArrayList<PumpValuesEntryExt> lst_ext = + // * getRangePumpValuesExtended(from, to); + // * mergeRangePumpData(dvr, lst_ext); + // * // ArrayList<PumpValuesEntryExt> lst_ext = + // * getDailyPumpValuesExtended(gc); + // * // mergeDailyPumpData(dV, lst_ext); + // * } + // * catch (Exception ex) + // * { + // * log.debug("Sql: " + sql); + // * log.error("getDayStats(). Exception: " + ex, ex); + // * } + // * return dvr; + // */ + // } - /* - * log.info("getPumpDayStats()"); - * long dt_from = ATechDate.getATDateTimeFromGC(from, - * ATechDate.FORMAT_DATE_ONLY); - * long dt_to = ATechDate.getATDateTimeFromGC(to, - * ATechDate.FORMAT_DATE_ONLY); - * String sql = ""; - * DeviceValuesRange dvr = new - * DeviceValuesRange(DataAccessPump.getInstance(), from, to); - * try - * { - * sql = "SELECT dv from " + - * "ggc.core.db.hibernate.pump.PumpDataH as dv " + - * "WHERE dv.dt_info >= " + dt_from - * + "000000 AND dv.dt_info <= " + dt_to + "235959 ORDER BY dv.dt_info"; - * //System.out.println("SQL: " + sql); - * Query q = this.db.getSession().createQuery(sql); - * Iterator<?> it = q.list().iterator(); - * while (it.hasNext()) - * { - * PumpDataH pdh = (PumpDataH)it.next(); - * PumpValuesEntry dv = new PumpValuesEntry(pdh); - * dvr.addEntry(dv); - * } - * ArrayList<PumpValuesEntryExt> lst_ext = - * getRangePumpValuesExtended(from, to); - * mergeRangePumpData(dvr, lst_ext); - * // ArrayList<PumpValuesEntryExt> lst_ext = - * getDailyPumpValuesExtended(gc); - * // mergeDailyPumpData(dV, lst_ext); - * } - * catch (Exception ex) - * { - * log.debug("Sql: " + sql); - * log.error("getDayStats(). Exception: " + ex, ex); - * } - * return dvr; - */ - } - - /** * Get All Elements Count * @@ -180,18 +181,7 @@ */ public int getAllElementsCount() { - Integer in = null; - int sum_all = 0; - - Criteria criteria = this.getSession().createCriteria(CGMSDataH.class); - criteria.add(Restrictions.eq("personId", (int) dataAccess.getCurrentUserId())); - criteria.add(Restrictions.like("extended", "%" + dataAccess.getSourceDevice() + "%")); - - criteria.setProjection(Projections.rowCount()); - in = (Integer) criteria.list().get(0); - sum_all = in.intValue(); - - return sum_all; + return getAllElementsCount(CGMSDataH.class, null); } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/writer/CGMSValuesWriter.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/writer/CGMSValuesWriter.java 2017-09-17 21:38:43 UTC (rev 1467) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/writer/CGMSValuesWriter.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -39,6 +39,8 @@ // DeviceTempValues> { + private static final long serialVersionUID = -3259908872077416922L; + static CGMSValuesWriter staticInstance; // static CGMSDataWriter cgmsDataWriter; boolean debug = false; @@ -162,7 +164,7 @@ // addConfiguration("Alarm_GlucoseFallRateTooHigh", // CGMSBaseDataType.Alarm, // CGMSAlarms.GlucoseFallRateTooHigh); - // addConfiguration("Alarm_UnknownAlarm", CGMSBaseDataType.Alarm, + // addConfiguration("Alarm_UnknownAlarm", CMSBaseDataType.Alarm, // CGMSAlarms.UnknownAlarm); // Trasmiter Events Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceDefinition.java 2017-09-17 21:38:43 UTC (rev 1467) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceDefinition.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -44,24 +44,30 @@ { // Abbott - AbbottFreeStyleNavigatorV1(10001, "Abbott FreeStyle Navigator V1", null, null, // + AbbottFreeStyleNavigatorV1(10001, "Abbott FreeStyle Navigator V1", "no_device.gif", null, // null, DeviceImplementationStatus.NotAvailable, // DeviceCompanyDefinition.Abbott, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // DeviceProgressStatus.Special, ""), // TODO - AbbottFreeStyleNavigatorV2(10002, "Abbott FreeStyle Navigator V2", null, null, // + AbbottFreeStyleNavigatorV2(10002, "Abbott FreeStyle Navigator V2", "no_device.gif", null, // null, DeviceImplementationStatus.NotAvailable, // DeviceCompanyDefinition.Abbott, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // DeviceProgressStatus.Special, ""), // TODO - AbbottFreeStyleNeo(10003, "Abbott FreeStyle Neo", null, null, // + AbbottFreeStyleNeo(10003, "Abbott FreeStyle Neo", "no_device.gif", null, // null, DeviceImplementationStatus.NotAvailable, // DeviceCompanyDefinition.Abbott, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // DeviceProgressStatus.Special, ""), // TODO + AbbottFreeStyleLibre(10004, "Abbott FreeStyle Libre", "no_device.gif", null, // + null, DeviceImplementationStatus.InProgress, // + DeviceCompanyDefinition.Abbott, DeviceHandlerType.AbbottLibreHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, // + DeviceProgressStatus.Special, ""), // TODO + // Animas OneTouchVibe(40006, "OneTouch Vibe", "an_vibe_cgms.jpg", "INSTRUCTIONS_ANIMAS_V2", // @@ -75,13 +81,13 @@ Dexcom7(20001, "Dexcom 7", null, null, // DexcomDevice.Dexcom7, DeviceImplementationStatus.NotAvailable, // DeviceCompanyDefinition.Dexcom, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // DeviceProgressStatus.Special, ""), // TODO Dexcom7Plus(20002, "Dexcom 7 Plus", null, null, // DexcomDevice.Dexcom7, DeviceImplementationStatus.NotAvailable, // DeviceCompanyDefinition.Dexcom, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // DeviceProgressStatus.Special, ""), // TODO DexcomG4(20003, "Dexcom G4", "dx_dexcomG4.jpg", "DEXCOM_INSTRUCTIONS_DL_SERIAL_USB", // @@ -93,7 +99,7 @@ DexcomG5(20004, "Dexcom G5", null, null, // DexcomDevice.DexcomG5, DeviceImplementationStatus.NotAvailable, // DeviceCompanyDefinition.Dexcom, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // DeviceProgressStatus.Special, ""), // TODO // Minimed @@ -102,52 +108,64 @@ MinimedDeviceType.MinimedCGMSGold, DeviceImplementationStatus.Planned, // DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, // DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Multiple, // - DeviceProgressStatus.Special, ""), // + DeviceProgressStatus.Special, ""), // TODO MinimedGuradianRealTime(30002, "Minimed Guardian RealTime", "mm_522_722.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.MinimedGuradianRealTime, DeviceImplementationStatus.Planned, // DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, // DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Multiple, // - DeviceProgressStatus.Special, ""), // + DeviceProgressStatus.Special, ""), // TODO Minimed_522_722(30003, "Minimed 522/722", "mm_522_722.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_522_722, DeviceImplementationStatus.Planned, // DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, // DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Multiple, // - DeviceProgressStatus.Special, ""), // + DeviceProgressStatus.Special, ""), // TODO Minimed_523_723(30004, "Minimed 523/723", "mm_522_722.jpg", "INSTRUCTIONS_MINIMED", // MinimedDeviceType.Minimed_523_723, DeviceImplementationStatus.Planned, // DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, // DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Multiple, // - DeviceProgressStatus.Special, ""), // + DeviceProgressStatus.Special, ""), // TODO Minimed_553_753_Revel(30005, "Minimed 553/753 (Revel)", "mm_554_veo.jpg", "INSTRUCTIONS_MINIMED", // MinimedDeviceType.Minimed_553_753_Revel, DeviceImplementationStatus.Planned, // DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, // DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Multiple, // - DeviceProgressStatus.Special, ""), // + DeviceProgressStatus.Special, ""), // TODO Minimed_554_754_Veo(30006, "Minimed 554/754 (Veo)", "mm_554_veo.jpg", "INSTRUCTIONS_MINIMED", MinimedDeviceType.Minimed_554_754_Veo, DeviceImplementationStatus.Planned, // DeviceCompanyDefinition.Minimed, DeviceHandlerType.MinimedPumpHandler, // DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Multiple, // - DeviceProgressStatus.Special, ""), // + DeviceProgressStatus.Special, ""), // TODO - Minimed_640G(30007, "Minimed 640G", "pic", "INSTRUCTIONS_MINIMED", // + // FIXME + Minimed_640G(30007, "Minimed 640G", "no_device.gif", "INSTRUCTIONS_MINIMED", // MinimedDeviceType.Minimed_640G, DeviceImplementationStatus.Planned, // DeviceCompanyDefinition.Minimed, DeviceHandlerType.NoHandler, // DevicePortParameterType.PackedParameters, DeviceConnectionProtocol.Multiple, // - DeviceProgressStatus.Special, ""), // + DeviceProgressStatus.Special, ""), // TODO // Tandem - TandemTSlimG4(50001, "t:slim G4", "tan_tslimG4.jpg", null, // null, DeviceImplementationStatus.NotAvailable, // DeviceCompanyDefinition.Tandem, DeviceHandlerType.NoHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // DeviceProgressStatus.Special, ""), // TODO + TandemTSlimX2(50002, "t:slim X2", "tan_tslimG4.jpg", null, null, // + DeviceImplementationStatus.NotAvailable, DeviceCompanyDefinition.Tandem, DeviceHandlerType.NoHandler, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, ""), // + + // Roche + RocheEversense(60001, "Roche Eversense", "ac_eversense.png", null, // + null, DeviceImplementationStatus.NotAvailable, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.NoHandler, // + DevicePortParameterType.NoParameters, DeviceConnectionProtocol.Multiple, // + DeviceProgressStatus.Special, ""), // TODO + ; static List<DeviceDefinition> allDevices; Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSDataReader.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSDataReader.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSDataReader.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -0,0 +1,464 @@ +package ggc.cgms.device.abbott.libre; + +import java.util.GregorianCalendar; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.atech.utils.data.ATechDate; +import com.atech.utils.data.ATechDateType; +import com.atech.utils.data.BitUtils; + +import ggc.cgms.defs.device.CGMSDeviceDefinition; +import ggc.cgms.device.abbott.libre.data.LibreDataConverter; +import ggc.cgms.device.abbott.libre.data.LibreHidReportDto; +import ggc.cgms.device.abbott.libre.enums.Command; +import ggc.cgms.device.abbott.libre.enums.LibreTextCommand; +import ggc.cgms.device.abbott.libre.util.LibreUtil; +import ggc.cgms.util.DataAccessCGMS; +import ggc.plugin.data.enums.PlugInExceptionType; +import ggc.plugin.data.progress.ProgressType; +import ggc.plugin.device.PlugInBaseException; +import ggc.plugin.device.v2.DeviceDefinition; +import ggc.plugin.output.OutputWriter; +import ggc.plugin.protocol.reader.UsbHidDeviceReader; + +/** + * Application: GGC - GNU Gluco Control + * Plug-in: Meter Tool (support for Meter devices) + * + * 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: LibraCGMSDataReader + * Description: Data reader for Arkray family + * + * Author: Andy {an...@at...} + */ + +public class LibreCGMSDataReader extends UsbHidDeviceReader +{ + + private static final Logger LOG = LoggerFactory.getLogger(LibreCGMSDataReader.class); + + private final LibreDataConverter converter; + private CGMSDeviceDefinition deviceDefinition; + private BitUtils bitUtils; + + String serialNumber; + private GregorianCalendar currentDate; + String softwareVersion; + + + public LibreCGMSDataReader(LibreCGMSHandler libreCGMSHandler, DeviceDefinition definition, String portName, + OutputWriter outputWriter) throws PlugInBaseException + { + super(libreCGMSHandler, portName, outputWriter); + + this.deviceDefinition = (CGMSDeviceDefinition) definition; + // configureProgressReporter(ProgressType.Static, 100, + // this.deviceDefinition.getMaxRecords(), 0); + this.bitUtils = LibreUtil.getBitUtils(); + LibreUtil.setOutputWriter(outputWriter); + + converter = new LibreDataConverter(outputWriter); + + LibreUtil.resetDebug(); + } + + + @Override + public void readData() throws PlugInBaseException + { + LibreUtil.setCurrentDebug(false); + + configureProgressReporter(ProgressType.Static, 100, 100, 0); + + this.initDevice(); + + this.readHistory(); + addToStaticProgress(40); + + this.readOtherHistory(); + addToStaticProgress(40); + + this.close(); + + LibreUtil.resetDebug(); + } + + + @Override + public void readConfiguration() throws PlugInBaseException + { + LibreUtil.setCurrentDebug(false); + + this.initDevice(); + + converter.convertData(LibreTextCommand.SerialNumber, serialNumber); + converter.convertData(LibreTextCommand.SoftwareVersion, softwareVersion); + + this.readDateTime(); + + readAndConvertData(LibreTextCommand.NtSound); + addToStaticProgress(20); + readAndConvertData(LibreTextCommand.BtSound); + addToStaticProgress(20); + + // Glucose Unit + // Bg Range + + this.close(); + + LibreUtil.resetDebug(); + } + + + public void initDevice() throws PlugInBaseException + { + this.connectAndInitDevice(); + this.communicationHandler.setThrowExceptionOnError(true); + + drainDevice(); + + // init 1 + sendToDeviceAndCheckResponse(Command.INIT_REQUEST_1, new byte[] { 0xc }); + addToStaticProgress(5); + + // init 2 - read serialNumber + writeReport(Command.INIT_REQUEST_2, ""); + serialNumber = readTextResponse(Command.INIT_REQUEST_2).trim(); + addToStaticProgress(5); + + // init 3 - read software version + writeReport(Command.INIT_REQUEST_3, ""); + softwareVersion = readTextResponse(Command.INIT_REQUEST_3).trim(); + addToStaticProgress(5); + + // System.out.println("Software Version: " + softwareVersion); + + byte[] response = sendToDeviceAndReceiveResponse(Command.INIT_REQUEST_4); + addToStaticProgress(5); + + // System.out.println("Response: " + bitUtils.getDebugByteArray(response)); + + } + + + private void addToStaticProgress(int progress) + { + addToProgress(ProgressType.Static, progress); + } + + + private void drainDevice() + { + byte[] data = new byte[1024]; + int readInfo = 0; + + do + { + try + { + readInfo = communicationHandler.read(data); + if (readInfo > 0) + LOG.debug("Drained {} bytes.", readInfo); + } + catch (PlugInBaseException e) + { + + } + } while (readInfo > 0); + + } + + + public boolean sendToDeviceAndCheckResponse(Command command, byte[] expectedResponse) throws PlugInBaseException + { + writeReport(command, ""); + byte[] response = readByteResponse(command); + + if (LibreUtil.getCurrentDebug()) + LOG.debug("Response: " + bitUtils.getByteArrayHex(response)); + + if (compareByteArrayResult(expectedResponse, response)) + { + throw new PlugInBaseException(PlugInExceptionType.DeviceInvalidResponseDescription, + new Object[] { response }); + } + + return true; + } + + + public byte[] sendToDeviceAndReceiveResponse(Command command) throws PlugInBaseException + { + writeReport(command, ""); + byte[] response = readByteResponse(command); + + if (LibreUtil.getCurrentDebug()) + LOG.debug("Response: " + bitUtils.getByteArrayHex(response)); + + return response; + } + + + private boolean compareByteArrayResult(byte[] expected, byte[] actual) + { + if (expected.length != actual.length) + return false; + + for (int i = 0; i < expected.length; i++) + { + if (expected[i] != actual[i]) + { + return false; + } + } + + return true; + } + + + @Override + public void customInitAndChecks() throws PlugInBaseException + { + // FIXME + } + + + @Override + public void configureProgressReporter() + { + // FIXME + } + + + public DataAccessCGMS getDataAccess() + { + return DataAccessCGMS.getInstance(); + } + + + public CGMSDeviceDefinition getDeviceDefinition() + { + return deviceDefinition; + } + + + @Override + public void initHandler() + { + + } + + + private LibreHidReportDto readReport() throws PlugInBaseException + { + byte[] resultData = new byte[64]; + + int result = -1; + + do + { + try + { + result = this.communicationHandler.read(resultData); + + if (result == 0) + DataAccessCGMS.sleep(100); + } + catch (Exception ex) + {} + } while (result == 0); + + return new LibreHidReportDto(resultData); + } + + + private void writeReport(Command command, String s) throws PlugInBaseException + { + LOG.debug("writeReport: command={}, value={}", command, s); + + // int length = 2; + // boolean hasPayload = false; + + // if (s.length() != 0) + // { + // s += "\r\n"; + // length++; + // length += s.length(); + // hasPayload = true; + // } + + byte[] sendArray = new byte[64]; + + int i = 0; + + // sendArray[0] = 0x00; + sendArray[i] = (byte) command.getRequestCode(); + + if (s.length() != 0) + { + i++; + sendArray[i] = (byte) s.length(); + + // int i = 1; + + for (Byte b : s.getBytes()) + { + i++; + sendArray[i] = b; + } + + // i++; + } + + int result = communicationHandler.writeWithReturn(sendArray); + + // System.out.println( + // "Send code: result: " + result + ", data: " + + // LibreUtil.getBitUtils().getDebugByteArray(sendArray)); + } + + + private void writeReport(LibreTextCommand libreTextCommand) throws PlugInBaseException + { + writeReport(Command.TEXT_COMMAND, libreTextCommand.getCommandText()); + } + + + private byte[] readByteResponse(Command command) throws PlugInBaseException + { + LibreHidReportDto report = readReport(); + + checkIfCorrectResponse(command, report.getMessageType()); + + return report.extractByteResponse(); + } + + + private void checkIfCorrectResponse(int expectedCode, byte receivedCode) throws PlugInBaseException + { + if (expectedCode != receivedCode) + { + throw new PlugInBaseException(PlugInExceptionType.DeviceUnexpectedResponseCompared, // + new Object[] { expectedCode, receivedCode }); + } + } + + + private void checkIfCorrectResponse(Command expectedCommand, Command receivedCommandResponse) + throws PlugInBaseException + { + if (expectedCommand != receivedCommandResponse) + { + throw new PlugInBaseException(PlugInExceptionType.DeviceUnexpectedResponseCompared, // + new Object[] { expectedCommand.getResponseCode(), receivedCommandResponse.getResponseCode() }); + } + } + + + private String readTextResponse(Command command) throws PlugInBaseException + { + LibreHidReportDto report = readReport(); + + checkIfCorrectResponse(command, report.getMessageType()); + + return report.extractText(); + } + + + public String readTextResponse() throws PlugInBaseException + { + return readTextResponse(Command.TEXT_COMMAND); + } + + + private void readDateTime() throws PlugInBaseException + { + currentDate = new GregorianCalendar(); + writeReport(LibreTextCommand.Date); + String date = readTextResponse(); + addToStaticProgress(20); + writeReport(LibreTextCommand.Time); + String time = readTextResponse(); + addToStaticProgress(20); + + converter.convertData(LibreTextCommand.Date, date + "," + time); + + converter.convertData(LibreTextCommand.ComputerDateTime, + ATechDate.getATechDateFromGC(currentDate, ATechDateType.DateAndTimeSec).toString()); + } + + + private void readAndConvertData(LibreTextCommand textCommand) throws PlugInBaseException + { + writeReport(textCommand); + converter.convertData(textCommand, readTextResponse()); + } + + + private void readHistory() throws PlugInBaseException + { + writeReport(LibreTextCommand.History); + readMultiPacket(LibreTextCommand.History, false); + } + + + private void readOtherHistory() throws PlugInBaseException + { + writeReport(LibreTextCommand.OtherHistory); + readMultiPacket(LibreTextCommand.OtherHistory, true); + } + + + private void close() + { + this.communicationHandler.disconnectDevice(); + } + + + private void readMultiPacket(LibreTextCommand command, boolean ignoreCrcCheck) throws PlugInBaseException + { + String text; + StringBuffer contentBuffer = new StringBuffer(); + + do + { + LibreHidReportDto libreHidReportDto = readReport(); + + text = libreHidReportDto.extractTextNoValidation(); + + contentBuffer.append(text); + + } while (!text.contains("CMD")); + + String responseText = LibreUtil.validateTextResponse(contentBuffer.toString(), false, ignoreCrcCheck); + + // System.out.println("got response Text:" + responseText); + + String[] responseLines = responseText.split("\r\n"); + + // System.out.println("got response Lines:" + responseLines.length); + + for (int i = 0; i < responseLines.length - 1; i++) // ignoring the last line + { + converter.convertData(command, responseLines[i]); + } + } + +} Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSHandler.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSHandler.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/LibreCGMSHandler.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -0,0 +1,76 @@ +package ggc.cgms.device.abbott.libre; + +import java.util.List; + +import ggc.cgms.defs.device.CGMSDeviceHandler; +import ggc.plugin.comm.cfg.USBDevice; +import ggc.plugin.data.enums.DeviceHandlerType; +import ggc.plugin.device.PlugInBaseException; +import ggc.plugin.device.v2.DeviceDefinition; +import ggc.plugin.device.v2.handler.UsbHidDeviceHandler; +import ggc.plugin.output.OutputWriter; + +/** + * Application: GGC - GNU Gluco Control + * Plug-in: Meter Tool (support for Meter devices) + * + * 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: LibreCGMSHandler + * Description: Arkray Meter Handler + * + * Author: Andy {an...@at...} + */ + +public class LibreCGMSHandler extends CGMSDeviceHandler implements UsbHidDeviceHandler +{ + + public DeviceHandlerType getDeviceHandlerKey() + { + return DeviceHandlerType.ArkrayMeterHandler; + } + + + public void readDeviceData(DeviceDefinition definition, Object connectionParameters, OutputWriter outputWriter) + throws PlugInBaseException + { + LibreCGMSDataReader dataReader = new LibreCGMSDataReader(this, definition, (String) connectionParameters, + outputWriter); + dataReader.readData(); + } + + + public void readConfiguration(DeviceDefinition definition, Object connectionParameters, OutputWriter outputWriter) + throws PlugInBaseException + { + LibreCGMSDataReader dataReader = new LibreCGMSDataReader(this, definition, (String) connectionParameters, + outputWriter); + dataReader.readConfiguration(); + } + + + public void closeDevice() throws PlugInBaseException + { + + } + + + public List<USBDevice> getAllowedDevicesList() + { + return null; + } +} Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/AutoMeasurementDto.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/AutoMeasurementDto.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/AutoMeasurementDto.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -0,0 +1,117 @@ +package ggc.cgms.device.abbott.libre.data; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; + +import com.atech.utils.data.ATechDate; + +public class AutoMeasurementDto extends LibreRecordDto +{ + + int recordId; + byte unknownValue1; + ATechDate dateTime; + + byte unknownValue2; + byte unknownValue3; + byte unknownValue4; + byte unknownValue5; + byte firstReading; + + int value; + int sensorTime; + int errorBitfield; + + boolean errorPresentBitField; + int errorCode; + + + public AutoMeasurementDto(String value) + { + this.values = value.split(","); + + this.recordId = getInt(0); + this.unknownValue1 = getByte(1); + + this.dateTime = getDateTime(3, 2, 4, 5, 6, 7); + + this.unknownValue2 = getByte(8); + this.unknownValue3 = getByte(9); + this.unknownValue4 = getByte(10); + this.unknownValue5 = getByte(11); + + this.firstReading = getByte(12); + + this.value = getInt(13); + this.sensorTime = getInt(14); + this.errorBitfield = getInt(15); + + this.errorPresentBitField = (errorBitfield & 0x8000) > 1; + this.errorCode = this.errorBitfield; + } + + + @Override + public boolean equals(Object o) + { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + AutoMeasurementDto that = (AutoMeasurementDto) o; + + return new EqualsBuilder() // + .append(recordId, that.recordId) // + .append(unknownValue1, that.unknownValue1) // + .append(unknownValue2, that.unknownValue2) // + .append(unknownValue3, that.unknownValue3) // + .append(unknownValue4, that.unknownValue4) // + .append(unknownValue5, that.unknownValue5) // + .append(firstReading, that.firstReading) // + .append(value, that.value) // + .append(sensorTime, that.sensorTime) // + .append(errorBitfield, that.errorBitfield) // + .append(dateTime, that.dateTime) // + .isEquals(); + } + + + @Override + public int hashCode() + { + return new HashCodeBuilder(17, 37) // + .append(recordId) // + .append(unknownValue1) // + .append(dateTime) // + .append(unknownValue2) // + .append(unknownValue3) // + .append(unknownValue4) // + .append(unknownValue5) // + .append(firstReading) // + .append(value) // + .append(sensorTime) // + .append(errorBitfield) // + .toHashCode(); + } + + + @Override + public String toString() + { + return "AutoMeasurementDto [" + // + "recordId=" + recordId + // + ", unknownValue1=" + unknownValue1 + // + ", dateTime=" + dateTime + // + ", unknownValue2=" + unknownValue2 + // + ", unknownValue3=" + unknownValue3 + // + ", unknownValue4=" + unknownValue4 + // + ", unknownValue5=" + unknownValue5 + // + ", firstReading=" + firstReading + // + ", value=" + value + // + ", sensorTime=" + sensorTime + // + ", errorBitfield=" + errorBitfield + ']'; + } + +} Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreDataConverter.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreDataConverter.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreDataConverter.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -0,0 +1,218 @@ +package ggc.cgms.device.abbott.libre.data; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.atech.utils.data.ATechDate; +import com.atech.utils.data.ATechDateType; + +import ggc.cgms.data.defs.CGMSConfigurationGroup; +import ggc.cgms.device.abbott.libre.enums.LibreTextCommand; +import ggc.plugin.data.DeviceValueConfigEntry; +import ggc.plugin.output.OutputWriter; + +/** + * Created by andy on 08/09/17. + */ +public class LibreDataConverter +{ + + private static final Logger LOG = LoggerFactory.getLogger(LibreDataConverter.class); + + OutputWriter outputWriter; + LibreRecordDto process = new LibreRecordDto(); + + + public LibreDataConverter(OutputWriter outputWriter) + { + this.outputWriter = outputWriter; + } + + + // public E <? extends LibreRecordDto> convert(LibreHidReportDto hidResponse, Class<E> clazz) + // { + // return null; + // } + + public void convertData(LibreTextCommand textCommand, String value) + { + switch (textCommand) + { + case SerialNumber: + convertDirectEntry("CFG_BASE_SERIAL_NUMBER", value, CGMSConfigurationGroup.General); + break; + + case SoftwareVersion: + convertDirectEntry("CFG_BASE_FIRMWARE_VERSION", value, CGMSConfigurationGroup.General); + break; + + case Date: + convertDateTime(value); + break; + + case Time: // not used + break; + + case History: + convertHistory(value); + break; + // + // case GlucoseUnits: + // break; + + case NtSound: + convertNtSound(value); + break; + + case BtSound: + convertBtSound(value); + break; + + case ComputerDateTime: + convertDirectEntry("CFG_BASE_COMPUTER_TIME", value, CGMSConfigurationGroup.General); + break; + + // case PatientName: + // case PatientId: + // case DatabaseRecordNumber: + + // case GlucoseUnits: + // case NtSound: + // //break; + // case BtSound: + // //break; + // case Language: + // break; + // case AllLanguages: + // break; + case Test: + break; + // case GlucoseUnits: + // break; + // case FoodUnits: + // break; + // case ClockType: + // break; + // case BgTargets: + // break; + case OtherHistory: + convertOtherHistory(value); + break; + + default: + LOG.warn("NOT DONE ........ key={}, value={}", textCommand.name(), value); + + } + + } + + + private void convertOtherHistory(String value) + { + String[] values = value.split(","); + + int type = process.getInt(values[1]); + + switch (type) + { + case 2: + convertManualEntry(values); + break; + + case 5: + convertTimeChangeEntry(values); + break; + + default: + { + LOG.error("Unsupported entry. PLEASE CONTACT GGC TEAM WITH FOLLOWING INFORMATION:"); + LOG.error("Type: {}: {}", type, value); + } + break; + + } + } + + + private void convertTimeChangeEntry(String[] values) + { + TimeChangeDto dto = new TimeChangeDto(values); + + System.out.println(dto.toString()); + } + + + private void convertManualEntry(String[] values) + { + ManualMeasurementDto dto = new ManualMeasurementDto(values); + + System.out.println(dto.toString()); + } + + + private void convertBtSound(String value) + { + String[] values = value.split(","); + + convertDirectEntry("CFG_SOUND_TYPE_VOLUME", + values[1].equals("1") ? "CFG_SOUND_VOLUME_HIGH" : "CFG_SOUND_VOLUME_LOW", CGMSConfigurationGroup.Sound); + + convertDirectEntry("CFG_SOUND_TYPE_TOUCH_TONE", values[0].equals("1") ? "CCFG_OPTION_ON" : "CCFG_OPTION_OFF", + CGMSConfigurationGroup.Sound); + } + + + private void convertNtSound(String value) + { + String[] values = value.split(","); + + convertDirectEntry("CFG_SOUND_TYPE_NOTIFICATION_TONE", + values[0].equals("1") ? "CCFG_OPTION_ON" : "CCFG_OPTION_OFF", CGMSConfigurationGroup.Sound); + + convertDirectEntry("CFG_SOUND_TYPE_NOTIFICATION_VIBRATE", + values[1].equals("1") ? "CCFG_OPTION_ON" : "CCFG_OPTION_OFF", CGMSConfigurationGroup.Sound); + } + + + private void convertHistory(String value) + { + AutoMeasurementDto dto = new AutoMeasurementDto(value); + + System.out.println(dto.toString()); + + // LOG.warn("NOT IMPLEMENTED HISTORY line={}", value); + } + + + private void convertDirectEntry(String key, String value, CGMSConfigurationGroup group) + { + outputWriter.writeConfigurationData(createConfigEntry(key, value, group)); + } + + + private void convertDateTime(String value) + { + // DateTime.strptime("#{date} #{readTextResponse}", '%m,%d,%y %H,%M') + String dateParts[] = value.split(","); + + ATechDate aTechDate = ATechDate.getATechDateFromParts(getInt(dateParts[1]), getInt(dateParts[0]), + getInt(dateParts[2]), getInt(dateParts[3]), getInt(dateParts[4]), 0, ATechDateType.DateAndTimeSec); + + outputWriter.writeConfigurationData( + createConfigEntry("CFG_BASE_DEVICE_TIME", aTechDate.toString(), CGMSConfigurationGroup.General)); + + } + + + private DeviceValueConfigEntry createConfigEntry(String key, String value, CGMSConfigurationGroup group) + { + return new DeviceValueConfigEntry(key, value, group); + } + + + private int getInt(String datePart) + { + return Integer.parseInt(datePart); + } + +} Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreHidReportDto.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreHidReportDto.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreHidReportDto.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -0,0 +1,106 @@ +package ggc.cgms.device.abbott.libre.data; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.atech.utils.data.BitUtils; + +import ggc.cgms.device.abbott.libre.enums.Command; +import ggc.cgms.device.abbott.libre.util.LibreUtil; +import ggc.plugin.device.PlugInBaseException; + +public class LibreHidReportDto +{ + + private static final Logger LOG = LoggerFactory.getLogger(LibreHidReportDto.class); + + private final byte payloadLength; + private final byte[] payload; + + private byte[] rawData; + + private byte messageTypeRaw; + static BitUtils bitUtils; + + + public LibreHidReportDto(byte[] data) + { + this.rawData = data; + + this.messageTypeRaw = data[0]; + this.payloadLength = data[1]; + + if (bitUtils == null) + { + bitUtils = LibreUtil.getBitUtils(); + } + + this.payload = bitUtils.getByteSubArray(data, 2, this.payloadLength); + + if (LibreUtil.getCurrentDebug()) + { + System.out.println("MessageType: " + messageTypeRaw + ", payloadLength=" + this.payloadLength); + + if (this.payloadLength > 0) + { + System.out.println("Value: " + bitUtils.getDebugByteArray(this.payload)); + } + } + } + + + public Command getMessageType() + { + return Command.getByResponseCode(this.messageTypeRaw); + } + + + public String extractText() throws PlugInBaseException + { + String outText = LibreUtil.getBitUtils().getString(this.payload, 0, this.payload.length); + + if (outText.contains("CMD")) + { + outText = LibreUtil.validateTextResponse(outText, true, false); + } + + return outText; + } + + + public String extractTextNoValidation() + { + return bitUtils.getString(this.payload, 0, this.payload.length); + } + + + public byte getMessageTypeRaw() + { + return messageTypeRaw; + } + + + public byte[] extractByteResponse() + { + return this.payload; + } + + + public static void main(String[] args) + { + String checksum = "00000175"; + + String chk = checksum; + + // while (chk.startsWith("0")) + // { + // chk = chk.substring(1); + // } + + long targetChecksum = Long.decode("0x" + chk); + + System.out.println(String.format("checksum: got: %s, expected: %s", 373, targetChecksum)); + + } + +} Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreRecordDto.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreRecordDto.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/LibreRecordDto.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -0,0 +1,84 @@ +package ggc.cgms.device.abbott.libre.data; + +import com.atech.utils.data.ATechDate; +import com.atech.utils.data.ATechDateType; + +/** + * Created by andy on 08/09/17. + */ +public class LibreRecordDto +{ + + String[] values = null; + + + public ATechDate getDateTime(String day, String month, String year, String hour, String minute, String second) + { + ATechDate date = new ATechDate(getInt(day), getInt(month), getInt(year) + 2000, getInt(hour), getInt(minute), + getInt(second), ATechDateType.DateAndTimeSec); + + return date; + } + + + public ATechDate getDateTime(int day, int month, int year, int hour, int minute, int second) + { + ATechDate date = new ATechDate(getInt(day), getInt(month), getInt(year) + 2000, getInt(hour), getInt(minute), + getInt(second), ATechDateType.DateAndTimeSec); + + return date; + } + + + public int getInt(String value) + { + return Integer.parseInt(value); + } + + + public int getInt(int index) + { + return getInt(values[index]); + } + + + public byte getByte(String value) + { + return Byte.parseByte(value); + } + + + public byte getByte(int index) + { + return getByte(values[index]); + } + + + public String getString(String value) + { + if (value.startsWith("\"")) + { + value = value.substring(1); + } + + if (value.endsWith("\"")) + { + value = value.substring(0, value.length() - 1); + } + + value = value.trim(); + + if (value.length() == 0) + return null; + else + return value; + + } + + + public String getString(int index) + { + return getString(values[index]); + } + +} Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/ManualMeasurementDto.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/ManualMeasurementDto.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/ManualMeasurementDto.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -0,0 +1,229 @@ +package ggc.cgms.device.abbott.libre.data; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.atech.utils.data.ATechDate; + +import ggc.cgms.data.defs.CGMSTrendArrow; +import ggc.cgms.device.abbott.libre.enums.ResultValueType; + +public class ManualMeasurementDto extends LibreRecordDto +{ + + private static final Logger LOG = LoggerFactory.getLogger(ManualMeasurementDto.class); + + int recordId; + int recordType; + ATechDate dateTime; + int unknown1; + ResultValueType readingType; + // blood-glucose = "0" + // blood-ketone = "1" + // sensor-glucose = "2" + + int unknown2; + byte errorPresent; // error or lo + float value; // in mg/dL, when blood-ketone ceil(value/2)/10 + int readFrom; // 0 = blood strip, 1 = from sensor + + CGMSTrendArrow trendArrow; + + byte sportsFlag; + byte medicationFlag; + byte rapidActingInsulinFlag; // + byte longActingInsulinFlag; // + int customCommentsBitfield; // Custom comments 1-6 flags. To be interpreted as a bitfield, LSB + // first. + + int unknown3; + int unknown4; + int unknown5; // "0" / "1" / "2" / "3" / "4" / "5" + + Float valueLongActingInsulin; // Value of long Acting insulin in 0.5 IE. If you want proper IE, + // divide by 2 + int unknown6; + byte foodFlag; + Integer foodCarbohydratesGrams; + int unknown7; + int errorBitField; + + boolean errorPresentBitField; + int errorCode; + + String comment1; + String comment2; + String comment3; + String comment4; + String comment5; + String comment6; + + int unknown8; + ATechDate dateTime2; + int unknown9; + Float valueRapidActingInsulin; + + boolean extendedSet = false; + + + public ManualMeasurementDto(String[] valuesIn) + { + this.values = valuesIn; + + this.recordId = getInt(0); + this.recordType = getInt(1); + this.dateTime = getDateTime(3, 2, 4, 5, 6, 7); + this.unknown1 = getInt(8); + + this.readingType = ResultValueType.getByCode(getByte(9)); + + this.unknown2 = getInt(10); + this.errorPresent = getByte(11); + + if (this.readingType == ResultValueType.Ketone) + { + float v1 = (float) Math.ceil((getInt(12) / 2f)); + this.value = v1 / 10f; + } + else + { + this.value = getInt(12); + } + + this.readFrom = getInt(13); + + this.trendArrow = getTrendArrow(getByte(14)); + + this.sportsFlag = getByte(15); + this.medicationFlag = getByte(16); + this.rapidActingInsulinFlag = getByte(17); + this.longActingInsulinFlag = getByte(18); + this.customCommentsBitfield = getInt(19); + + this.unknown3 = getByte(20); + this.unknown4 = getByte(21); + this.unknown5 = getByte(22); + + this.valueLongActingInsulin = getInt(23) / 2f; + + this.unknown6 = getByte(24); + this.foodFlag = getByte(25); + this.foodCarbohydratesGrams = getInt(26); + this.unknown7 = getByte(27); + + this.errorBitField = getInt(28); + this.errorPresentBitField = (errorBitField & 0x8000) > 1; + this.errorCode = this.errorBitField; + + this.comment1 = getString(29); + this.comment2 = getString(30); + this.comment3 = getString(31); + this.comment4 = getString(32); + this.comment5 = getString(33); + this.comment6 = getString(34); + + if (values.length > 35) + { + extendedSet = true; + this.unknown8 = getInt(35); + this.dateTime2 = getDateTime(37, 36, 38, 39, 40, 41); + this.unknown9 = getInt(42); + this.valueRapidActingInsulin = getInt(43) / 2f; + } + } + + + public CGMSTrendArrow getTrendArrow(byte direction) + { + switch (direction) + { + case 0: + return CGMSTrendArrow.None; + + case 1: + return CGMSTrendArrow.DoubleDown; + + case 2: + return CGMSTrendArrow.FortyFiveDown; // Down + + case 3: + return CGMSTrendArrow.Flat; + + case 4: + return CGMSTrendArrow.FortyFiveUp; + + case 5: + return CGMSTrendArrow.DoubleUp; + + default: + LOG.error("Unknown Trend: " + direction); + return CGMSTrendArrow.None; + + } + // none = "0" + // down-fast = "1" + // down = "2" + // steady = "3" + // up = "4" + // up-fast = "5" + + } + + + @Override + public String toString() + { + String valueString = "ManualMeasurementDto [" + // + "recordId=" + recordId + // + ", recordType=" + recordType + // + ", dateTime=" + dateTime + // + ", unknown1=" + unknown1 + // + ", readingType=" + readingType + // + ", unknown2=" + unknown2 + // + ", errorPresent=" + errorPresent + // + ", value=" + value + // + ", readFrom=" + readFrom + // + ", trendArrow=" + trendArrow + // + ", sportsFlag=" + sportsFlag + // + ", medicationFlag=" + medicationFlag + // + ", rapidActingInsulinFlag=" + rapidActingInsulinFlag + // + ", longActingInsulinFlag=" + longActingInsulinFlag + // + ", customCommentsBitfield=" + customCommentsBitfield + // + ", unknown3=" + unknown3 + // + ", unknown4=" + unknown4 + // + ", unknown5=" + unknown5 + // + ", valueLongActingInsulin=" + valueLongActingInsulin + // + ", unknown6=" + unknown6 + // + ", foodFlag=" + foodFlag + // + ", foodCarbohydratesGrams=" + foodCarbohydratesGrams + // + ", unknown7=" + unknown7 + // + ", errorPresentBitField=" + errorPresentBitField + // + ", errorCode=" + errorCode + // + ", comment1=" + comment1 + // + ", comment2=" + comment2 + // + ", comment3=" + comment3 + // + ", comment4=" + comment4 + // + ", comment5=" + comment5 + // + ", comment6=" + comment6; + + if (extendedSet) + { + valueString += ", unknown8=" + unknown8 + // + ", dateTime2=" + dateTime2 + // + ", unknown9=" + unknown9 + // + ", valueRapidActingInsulin=" + valueRapidActingInsulin; + } + + valueString += "]"; + + return valueString; + + } + /* + * TEST: + * 17.9. 12:01 Long acting 4U + * 12:49 Rapid acting 2E + * 15:54 : ch 80 + */ + +} Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/TimeChangeDto.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/TimeChangeDto.java (rev 0) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/data/TimeChangeDto.java 2017-09-17 22:27:55 UTC (rev 1468) @@ -0,0 +1,54 @@ +package ggc.cgms.device.abbott.libre.data; + +import com.atech.utils.data.ATechDate; + +public class TimeChangeDto extends LibreRecordDto +{ + + int recordId; + int recordType; + ATechDate dateTimeNew; + int unknown1; + ATechDate dateTimeOld; + int unknown2; + int unknown3; + int unknown4; + int unknown5; + int unknown6; + + + public TimeChangeDto(String[] valuesIn) + { + this.values = valuesIn; + + this.recordId = getInt(0); + this.recordType = getInt(1); // 5 + this.dateTimeNew = getDateTime(3, 2, 4, 5, 6, 7); + ; + this.unknown1 = getInt(8); + this.dateTimeOld = getDateTime(10, 9, 11, 12, 13, 14); + this.unknown2 = getInt(15); + this.unknown3 = getInt(16); + this.unknown4 = getInt(17); + this.unknown5 = getInt(18); + this.unknown6 = getInt(19); + } + + + @Override + public String toString() + { + return "TimeChangeDto [" + // + "recordId=" + recordId + // + ", recordType=" + recordType + // + ", dateTimeNew=" + dateTimeNew + // + ", unknown1=" + unknown1 + // + ", dateTimeOld=" + dateTimeOld + // + ", unknown2=" + unknown2 + // + ", unknown3=" + unknown3 + // + ", unknown4=" + unknown4 + // + ", unknown5=" + unknown5 + // + ", unknown6=" + unknown6 + // + ']'; + } +} Added: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/enums/BaseCommand.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/abbott/libre/enums/BaseCommand.java ... [truncated message content] |
From: <and...@us...> - 2017-09-17 21:38:46
|
Revision: 1467 http://sourceforge.net/p/ggc/code/1467 Author: andyrozman Date: 2017-09-17 21:38:43 +0000 (Sun, 17 Sep 2017) Log Message: ----------- 0.8.0 - Translation Tool Integration: GGCLanguageModule, GGCSupportedLanguages - data objects Old (for old restore): DailyValue, SettingColorScheme, Settings - data objects: SettingsH - backup/restore: new version of backup/restore, install (testing) Modified Paths: -------------- trunk/ggc-core-app/ggc-core/docs/Changelog 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/settings/SettingsH.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/impexp/GGCDbImporter.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/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/RestoreGGCSelectorDialog.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/gui/dialogs/selector/GGCSelectorDialog.java trunk/ggc-core-app/ggc-core/src/main/resources/GGC_en.properties trunk/ggc-core-app/ggc-core/src/test/java/ggc/misc/Test.java Added Paths: ----------- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/GGCLanguageModule.java trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/GGCSupportedLanguages.java trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/graph/v1/todo_graph.txt trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/DailyValueOld.java trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/SettingsColorSchemeOld.java trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/SettingsOld.java trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/GGCHibernateBackupObject.java trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/enums/BigDecimalValueType.java Modified: trunk/ggc-core-app/ggc-core/docs/Changelog =================================================================== --- trunk/ggc-core-app/ggc-core/docs/Changelog 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/docs/Changelog 2017-09-17 21:38:43 UTC (rev 1467) @@ -13,6 +13,10 @@ - added classes for DbTool integration - refactoring database - moved classes to different package (from shared) +- Translation Tool Integration: GGCLanguageModule, GGCSupportedLanguages +- data objects Old (for old restore): DailyValue, SettingColorScheme, Settings +- data objects: SettingsH +- backup/restore: new version of backup/restore, install (testing) 0.7 [18.5.2016] [Andy] Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/GGCLanguageModule.java =================================================================== --- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/GGCLanguageModule.java (rev 0) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/GGCLanguageModule.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -0,0 +1,93 @@ +package ggc.core.data.defs.lang; + +import java.util.ArrayList; +import java.util.List; + +import com.atech.i18n.info.LanguageModule; + +/** + * Created by andy on 30/06/17. + */ +public enum GGCLanguageModule implements LanguageModule +{ + + Core("GGC", "GGC_CORE", "GGC Core", ""), // + PluginBase("GGCPlugin", "GGC_PLUGIN", "GGC Plugin Base", ""), // + MeterPlugin("GGCMeterTool", "GGC_METER", "GGC Meter Plugin", ""), // + PumpPlugin("GGCPumpTool", "GGC_PUMP", "GGC Pump Plugin", ""), // + NutriPlugin("GGC_Nutrition", "GGC_NUTRI", "GGC Nutrition Plugin", ""), // + CGMSPlugin("GGC_CGMSTool", "GGC_CGMS", "GGC CGMS Plugin", ""), // + + ; + + private static List<LanguageModule> moduleList; + + String rootFileName; + String moduleId; + String moduleDescription; + String path; + + + GGCLanguageModule(String rootFileName, String moduleId, String moduleDescription, String path) + { + this.rootFileName = rootFileName; + this.moduleId = moduleId; + this.moduleDescription = moduleDescription; + this.path = path; + } + + + public String getLanguageFilePath() + { + return this.path; + } + + + public String getLanguageFileRoot() + { + return this.rootFileName; + } + + + public String getModuleDescription() + { + return this.moduleDescription; + } + + + public String getModuleId() + { + return this.moduleId; + } + + + public List<LanguageModule> getAllModules() + { + if (moduleList == null) + { + List<LanguageModule> outList = new ArrayList<LanguageModule>(); + + for (GGCLanguageModule module : values()) + { + outList.add(module); + } + + moduleList = outList; + } + + return moduleList; + } + + + public LanguageModule getMainModule() + { + return Core; + } + + + public String toString() + { + return this.moduleDescription; + } + +} Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/GGCSupportedLanguages.java =================================================================== --- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/GGCSupportedLanguages.java (rev 0) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/defs/lang/GGCSupportedLanguages.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -0,0 +1,83 @@ +package ggc.core.data.defs.lang; + +import java.util.ArrayList; +import java.util.List; + +import com.atech.data.enums.LanguageISO639; +import com.atech.i18n.info.SupportedLanguage; + +/** + * Created by andy on 30/06/17. + */ +public enum GGCSupportedLanguages implements SupportedLanguage +{ + English(LanguageISO639.English, true), // + Slovene(LanguageISO639.Slovene), // + French(LanguageISO639.French), // + German(LanguageISO639.German) // + ; + + private static List<SupportedLanguage> supportedLanguagesList; + + LanguageISO639 languageISO639; + boolean defaultLanguage; + + + GGCSupportedLanguages(LanguageISO639 languageISO639) + { + this(languageISO639, false); + } + + + GGCSupportedLanguages(LanguageISO639 languageISO639, boolean defaultLanguage) + { + this.languageISO639 = languageISO639; + this.defaultLanguage = defaultLanguage; + } + + + public boolean isDefaultLanguage() + { + return this.defaultLanguage; + } + + + public LanguageISO639 getLanguageDefinition() + { + return this.languageISO639; + } + + + /** + * Only the ones that are supported. + * + * @return + */ + public List<SupportedLanguage> getLanguagesToTranslate() + { + if (supportedLanguagesList == null) + { + + List<SupportedLanguage> outList = new ArrayList<SupportedLanguage>(); + + for (SupportedLanguage lang : values()) + { + if (!lang.isDefaultLanguage()) + { + outList.add(lang); + } + } + + supportedLanguagesList = outList; + } + + return supportedLanguagesList; + } + + + public SupportedLanguage getMasterLanguage() + { + return English; + } + +} Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/graph/v1/todo_graph.txt =================================================================== --- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/graph/v1/todo_graph.txt (rev 0) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/graph/v1/todo_graph.txt 2017-09-17 21:38:43 UTC (rev 1467) @@ -0,0 +1,33 @@ + +Pen Graphs: +- cleanup code +- hba1c (start date) + + +Pump: + - data retrival: - gluco values + - hba1c + - menus + - hba1c + + +== DONE + +Pen: ++ frequency implement : + other data + + X os ++- move to correct Menu item ++- size load ++- size save (viewer) ++- data retrival (dates check) : + week + + month + + 3 months + + custom + + whole day? + ++ remove old versions, leave TableLayouts only + +Pump: + + + Copied: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/DailyValueOld.java (from rev 1457, 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/DailyValueOld.java (rev 0) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/DailyValueOld.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -0,0 +1,80 @@ +package ggc.core.db.datalayer; + +import com.atech.i18n.I18nControlAbstract; + +import ggc.core.db.hibernate.pen.DayValueH; + +/** + * 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: DailyValue + * Description: This is DataLayer file (data file, with methods to work with database or in + * this case Hibernate). This one is used for DailyValue. + * This one is also BackupRestoreObject. + * + * Author: andyrozman {an...@at...} + */ + +// TODO: DL +@Deprecated +public class DailyValueOld extends DailyValue +{ + + /** + * Constructor + */ + public DailyValueOld() + { + super(); + } + + + /** + * Constructor + * + * @param dvh + */ + public DailyValueOld(DayValueH dvh) + { + super(dvh); + } + + + /** + * Constructor + * + * @param ic + */ + public DailyValueOld(I18nControlAbstract ic) + { + super(ic); + } + + + /** + * getBackupClassName - name of class which will be updated/restored + * + * @return + */ + public String getClassName() + { + return "ggc.core.db.hibernate.DayValueH"; + } + +} Copied: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/SettingsColorSchemeOld.java (from rev 1457, 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/SettingsColorSchemeOld.java (rev 0) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/SettingsColorSchemeOld.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -0,0 +1,113 @@ +package ggc.core.db.datalayer; + +import java.util.ArrayList; + +import com.atech.graphics.components.tree.CheckBoxTreeNodeInterface; +import com.atech.i18n.I18nControlAbstract; + +import ggc.core.db.hibernate.settings.ColorSchemeH; + +/** + * 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: SettingsColorScheme + * Description: This is DataLayer file (data file, with methods to work with database or in + * this case Hibernate). This one is used for ColorSchemes. This one is also + * BackupRestoreObject. + * + * Author: andyrozman {an...@at...} + */ +@Deprecated +public class SettingsColorSchemeOld extends SettingsColorScheme +{ + + private static final long serialVersionUID = -4888702023546352015L; + + + /** + * Constructor + */ + public SettingsColorSchemeOld() + { + super(); + } + + + /** + * Constructor + * + * @param ic + */ + public SettingsColorSchemeOld(I18nControlAbstract ic) + { + super(ic); + } + + + /** + * Constructor + * + * @param ch + */ + public SettingsColorSchemeOld(ColorSchemeH ch) + { + super(ch); + } + + + /** + * getBackupClassName - name of class which will be updated/restored + * + * @return + */ + public String getBackupClassName() + { + return "ggc.core.db.hibernate.ColorSchemeH"; + } + + + /** + * Has To Be Clean - if table needs to be cleaned before import + * + * @return true if we need to clean + */ + public boolean hasToBeCleaned() + { + return true; + } + + + /** + * Get Node Children + */ + public ArrayList<CheckBoxTreeNodeInterface> getNodeChildren() + { + return null; + } + + + /** + * Has Node Children + */ + public boolean hasNodeChildren() + { + return false; + } + +} Copied: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/SettingsOld.java (from rev 1457, 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/SettingsOld.java (rev 0) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/datalayer/SettingsOld.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -0,0 +1,80 @@ +package ggc.core.db.datalayer; + +import com.atech.i18n.I18nControlAbstract; + +import ggc.core.db.hibernate.settings.SettingsH; + +/** + * 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: Settings + * Description: This is datalayer file (data file, with methods to work with database or in + * this case Hibernate). This one is used for Settings. + * + * Author: Andy {an...@at...} + */ +@Deprecated +public class SettingsOld extends Settings +{ + + private static final long serialVersionUID = 533548318516266674L; + + + /** + * Constructor + */ + public SettingsOld() + { + super(); + } + + + /** + * Constructor + * + * @param ic + */ + public SettingsOld(I18nControlAbstract ic) + { + super(ic); + } + + + /** + * Constructor + * + * @param ch + */ + public SettingsOld(SettingsH ch) + { + super(ch); + } + + + /** + * Get Class Name + * + * @see com.atech.db.hibernate.transfer.BackupRestoreBase#getClassName() + */ + public String getClassName() + { + return "ggc.core.db.hibernate.SettingsH"; + } + +} Copied: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/GGCHibernateBackupObject.java (from rev 1457, 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/GGCHibernateBackupObject.java (rev 0) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/GGCHibernateBackupObject.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -0,0 +1,35 @@ +package ggc.core.db.hibernate; + +import com.atech.db.hibernate.HibernateBackupObject; +import com.atech.i18n.I18nControlAbstract; + +import ggc.core.util.DataAccess; + +/** + * Created by andy on 17/02/17. + */ +public abstract class GGCHibernateBackupObject extends HibernateBackupObject +{ + + private static final long serialVersionUID = 6152513443224878124L; + + + public GGCHibernateBackupObject() + { + super(); + } + + + public GGCHibernateBackupObject(I18nControlAbstract i18nControl) + { + super(i18nControl); + } + + + @Override + protected void initTypeDisplayDefintion() + { + typeDisplayDefintion = DataAccess.getInstance().getDataDefinitionManager().getEntry(this.getClass()); + } + +} Modified: 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/StockSubTypeH.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/StockSubTypeH.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -278,7 +278,7 @@ // Backup Object @Override - protected String getColumnNames(int tableVersion) + public String getColumnNames(int tableVersion) { return null; } Modified: 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/db/hibernate/settings/SettingsH.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/hibernate/settings/SettingsH.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -1,13 +1,19 @@ package ggc.core.db.hibernate.settings; +import java.util.Map; + import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; +import org.hibernate.Criteria; +import org.hibernate.Session; -import com.atech.db.hibernate.HibernateObject; +import com.atech.db.hibernate.HibernateBackupSelectableObject; +import ggc.core.db.hibernate.GGCHibernateBackupObject; + /** @author Hibernate CodeGenerator */ -public class SettingsH extends HibernateObject +public class SettingsH extends GGCHibernateBackupObject { private static final long serialVersionUID = 2231322090212148293L; @@ -222,4 +228,37 @@ return new HashCodeBuilder().append(getId()).toHashCode(); } + + @Override + public String getColumnNames(int tableVersion) + { + return null; + } + + + public String dbExport(int table_version) throws Exception + { + return null; + } + + + public void dbImport(int tableVersion, String valueEntry, Map<String, String> headers) throws Exception + { + + } + + + @Override + public String toStringDescriptive() + { + return null; + } + + + @Override + public Criteria getChildrenCriteria(Session session, HibernateBackupSelectableObject object) + { + return null; + } + } Modified: 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/GGCDatabaseTableConfiguration.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/data/GGCDatabaseTableConfiguration.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -9,24 +9,32 @@ import ggc.core.db.hibernate.doc.DoctorTypeH; import ggc.core.db.hibernate.food.*; import ggc.core.db.hibernate.settings.ColorSchemeH; +import ggc.core.db.hibernate.settings.SettingsH; public enum GGCDatabaseTableConfiguration implements DatabaseTableConfiguration { // core + // FIXME DayValueH(), // DailyValue - Pen/Injection data - SettingsH(), // Settings + SettingsH(SettingsH.class, null, 1, // + "id; key; value; type; description; person_id", // + "SETTINGS", DatabaseImportStrategy.Clean), // Settings ColorSchemeH(ColorSchemeH.class, null, 1, // "id; name; custom_type; color_bg; color_bg_avg; color_bg_low; color_bg_high; color_bg_target; color_ins; color_ins1; color_ins2; color_ins_perbu; color_ch", // - "COLOR_SCHEMES", DatabaseImportStrategy.Clean), // Color Scheme for - // BG Data + "COLOR_SCHEMES", DatabaseImportStrategy.Clean), // Color Scheme for BG Data // pump + // FIXME PumpDataH(), // + // FIXME PumpDataExtendedH(), // + // FIXME PumpProfileH(), // // cgms + // FIXME CGMSDataH(), // + // FIXME CGMSDataExtendedH(), // // nutrition Modified: 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/impexp/GGCDbImporter.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/impexp/GGCDbImporter.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory; import com.atech.data.mng.DataDefinitionEntry; +import com.atech.db.hibernate.HibernateBackupObject; import com.atech.db.hibernate.HibernateObject; import com.atech.db.hibernate.tool.data.DatabaseImportStrategy; import com.atech.db.hibernate.tool.data.dto.DbTableExportInfoDto; @@ -16,7 +17,6 @@ import com.atech.db.hibernate.transfer.BackupRestoreWorkGiver; import com.atech.db.hibernate.transfer.RestoreFileInfo; -import ggc.core.db.hibernate.GGCHibernateBackupSelectableObject; import ggc.core.util.DataAccess; /** @@ -53,8 +53,8 @@ } - public void importData(Class<? extends GGCHibernateBackupSelectableObject> clazz, - DataDefinitionEntry definitionEntry, DatabaseImportStrategy databaseImportStrategy) + public void importData(Class<? extends HibernateBackupObject> clazz, DataDefinitionEntry definitionEntry, + DatabaseImportStrategy databaseImportStrategy) { String line = null; Modified: 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/GGCBackupRestoreRunner.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/GGCBackupRestoreRunner.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -4,6 +4,7 @@ import java.util.*; import com.atech.data.mng.DataDefinitionEntry; +import com.atech.db.hibernate.HibernateBackupObject; import com.atech.db.hibernate.HibernateObject; import com.atech.db.hibernate.tool.data.DatabaseImportStrategy; import com.atech.db.hibernate.tool.data.management.impexp.DbExporter; @@ -20,6 +21,7 @@ import ggc.core.db.hibernate.doc.DoctorH; import ggc.core.db.hibernate.doc.DoctorTypeH; import ggc.core.db.hibernate.settings.ColorSchemeH; +import ggc.core.db.hibernate.settings.SettingsH; import ggc.core.db.tool.defs.GGCImportExportContext; import ggc.core.db.tool.impexp.GGCDbImporter; import ggc.core.util.DataAccess; @@ -58,11 +60,13 @@ private String lastBackupFile = null; Class singleBackupRestoreObjects[] = { // + SettingsH.class, // ColorSchemeH.class // }; Map<String, List<Class<? extends HibernateObject>>> groupedBackupRestoreObjects = null; GGCImportExportContext importExportContext = new GGCImportExportContext(); + Map<String, Class<? extends HibernateBackupObject>> backwardCompatibilityMatrix = null; /** @@ -75,6 +79,7 @@ { super(objects, giver); // this.backupObjects = objects; + // initGroups(); } @@ -101,6 +106,7 @@ this.restoreWithAppend = false; } } + // initGroups(); } @@ -125,15 +131,16 @@ // this.doneBackupElements++; } - if (this.isBackupObjectSelected(ic.getMessage("SETTINGS"))) - { - this.setTask(ic.getMessage("SETTINGS")); - ExportSettings edv = new ExportSettings(this); - edv.run(); - this.setStatus(100); - // this.doneBackupElements++; - } + // if (this.isBackupObjectSelected(ic.getMessage("SETTINGS"))) + // { + // this.setTask(ic.getMessage("SETTINGS")); + // ExportSettings edv = new ExportSettings(this); + // edv.run(); + // this.setStatus(100); + // // this.doneBackupElements++; + // } + // FIXME whats up with this // if (this.isBackupObjectSelected(ic.getMessage("COLOR_SCHEMES"))) // { // this.setTask(ic.getMessage("COLOR_SCHEMES")); @@ -219,6 +226,10 @@ DoctorH.class, // DoctorAppointmentH.class)); + this.backwardCompatibilityMatrix = new HashMap<String, Class<? extends HibernateBackupObject>>(); + + backwardCompatibilityMatrix.put("ggc.core.db.hibernate.SettingsH", SettingsH.class); + } @@ -306,6 +317,7 @@ @Override public void executeRestore() { + initGroups(); if (this.isRestoreObjectSelected("ggc.core.db.hibernate.pen.DayValueH")) { @@ -315,19 +327,55 @@ edv.setImportClean(!this.restoreWithAppend); edv.run(); this.setStatus(100); - // this.doneBackupElements++; } - if (this.isRestoreObjectSelected("ggc.core.db.hibernate.settings.SettingsH")) + // FIXME: Remove sometime in future + if (this.isRestoreObjectSelected("ggc.core.db.hibernate.DayValueH")) { + this.setTask(ic.getMessage("DAILY_VALUES")); + ImportDailyValues edv = new ImportDailyValues(this, + this.getRestoreObject("ggc.core.db.hibernate.DayValueH")); + edv.setImportClean(!this.restoreWithAppend); + edv.run(); + this.setStatus(100); + } + + // if (this.isRestoreObjectSelected("ggc.core.db.hibernate.settings.SettingsH")) + // { + // this.setTask(ic.getMessage("SETTINGS")); + // ImportSettings edv = new ImportSettings(this, + // this.getRestoreObject("ggc.core.db.hibernate.settings.SettingsH")); + // edv.run(); + // this.setStatus(100); + // } + + // Backward compatibility item because object class path changed) + if (this.isRestoreObjectSelected("ggc.core.db.hibernate.SettingsH")) + { this.setTask(ic.getMessage("SETTINGS")); - ImportSettings edv = new ImportSettings(this, - this.getRestoreObject("ggc.core.db.hibernate.settings.SettingsH")); + ImportSettings edv = new ImportSettings(this, this.getRestoreObject("ggc.core.db.hibernate.SettingsH")); edv.run(); this.setStatus(100); - // this.doneBackupElements++; } + // FIXME Backward compatibility + + for (Map.Entry<String, Class<? extends HibernateBackupObject>> oldClassEntry : backwardCompatibilityMatrix + .entrySet()) + { + DataDefinitionEntry entry = dataAccess.getDataDefinitionManager().getEntry(oldClassEntry.getValue()); + + if (this.isBackupObjectSelected(ic.getMessage(entry.getBackupTargetName()))) + { + DatabaseImportStrategy importStrategy = determineImportStrategy(entry); + this.setTask(ic.getMessage(entry.getBackupTargetName())); + GGCDbImporter ge = new GGCDbImporter(this, importExportContext, + this.getRestoreObject(oldClassEntry.getValue())); + ge.importData(oldClassEntry.getValue(), entry, importStrategy); + this.setStatus(100); + } + } + // if // (this.isRestoreObjectSelected("ggc.core.db.hibernate.settings.ColorSchemeH")) // { Modified: 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/GGCImporter.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/GGCImporter.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -173,6 +173,10 @@ ImportDailyValues idv = new ImportDailyValues(this.file_name, false); idv.importDailyValues(); } + else + { + LOG.error("File was not identified: " + this.selected_class); + } System.out.println(); @@ -230,12 +234,19 @@ for (Enumeration<String> en = m_da.getPlugins().keys(); en.hasMoreElements();) { String key = en.nextElement(); + System.out.println("key: " + key); PlugInClient pic = m_da.getPlugIn(key); - if (pic.getBackupRestoreHandler().doesContainBackupRestoreObject(class_name)) + System.out.println("PlugInClient: " + pic); + System.out.println("pic.getBackupRestoreHandler(): " + pic.getBackupRestoreHandler()); + + if (pic.getBackupRestoreHandler() != null + && pic.getBackupRestoreHandler().doesContainBackupRestoreObject(class_name)) return pic.getBackupRestoreHandler().getBackupRestoreObject(class_name); } + // FIXME old types, and remove this method, or at least change it + return null; } @@ -327,7 +338,7 @@ bro_new.dbImport(bro.getTableVersion(), line); } - this.hibernate_util.add(bro_new); + this.hibernateUtil.add(bro_new); count++; this.writeStatus(dot_mark, count); @@ -400,7 +411,7 @@ newEntry.dbImport(definitionEntry.getTableVersion(), line, headers); } - this.hibernate_util.add(newEntry); + this.hibernateUtil.add(newEntry); count++; this.writeStatus(dot_mark, count); Modified: 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/ImportDailyValues.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ImportDailyValues.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -283,7 +283,7 @@ * dvh.setComment(bef); } */ - this.hibernate_util.addHibernate(dvh); + this.hibernateUtil.addHibernate(dvh); count++; this.writeStatus(dot_mark, count); Modified: 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/ImportNutrition.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ImportNutrition.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -311,7 +311,7 @@ fud.setNutritions(getString(strtok.nextToken())); fud.setChanged(getLong(strtok.nextToken())); - this.hibernate_util.addHibernate(fud); + this.hibernateUtil.addHibernate(fud); count++; this.writeStatus(dot_mark, count); @@ -389,7 +389,7 @@ fug.setParentId(parent_id); fug.setChanged(getLong(strtok.nextToken())); - this.hibernate_util.addHibernate(fug); + this.hibernateUtil.addHibernate(fug); count++; this.writeStatus(dot_mark, count); @@ -473,7 +473,7 @@ ml.setComment(getString(strtok.nextToken())); ml.setChanged(getLong(strtok.nextToken())); - this.hibernate_util.addHibernate(ml); + this.hibernateUtil.addHibernate(ml); count++; this.writeStatus(dot_mark, count); @@ -551,7 +551,7 @@ mg.setParentId(parent_id); mg.setChanged(getLong(strtok.nextToken())); - this.hibernate_util.addHibernate(mg); + this.hibernateUtil.addHibernate(mg); count++; this.writeStatus(dot_mark, count); Modified: 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/ImportSettings.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/ImportSettings.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -234,7 +234,7 @@ dvh.setPersonId(person_id); } - this.hibernate_util.addHibernate(dvh); + this.hibernateUtil.addHibernate(dvh); count++; this.writeStatus(dot_mark, count); Modified: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/RestoreGGCSelectorDialog.java =================================================================== --- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/RestoreGGCSelectorDialog.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/db/tool/transfer/RestoreGGCSelectorDialog.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -5,6 +5,8 @@ import com.atech.db.hibernate.transfer.RestoreSelectorDialog; import com.atech.utils.ATDataAccessAbstract; +import ggc.core.util.DataAccess; + /** * Application: GGC - GNU Gluco Control * @@ -35,6 +37,7 @@ { private static final long serialVersionUID = 3536165659702725457L; + DataAccess dataAccessLocal = null; /** @@ -47,6 +50,7 @@ { super(parent, da); this.enableHelp("GGC_Tools_Restore_File_Selector"); + dataAccessLocal = (DataAccess) da; } @@ -60,6 +64,7 @@ { super(parent, da); this.enableHelp("GGC_Tools_Restore_File_Selector"); + dataAccessLocal = (DataAccess) da; } @@ -86,7 +91,7 @@ // System.out.println("Res Coll: " + // this.dataAccess.getBackupRestoreCollection()); RestoreGGCDialog rgd = new RestoreGGCDialog((JFrame) this.my_parent, this.m_da, - this.m_da.getBackupRestoreCollection(), this.tf_file.getText()); + this.dataAccessLocal.getBackupRestoreCollection(true), this.tf_file.getText()); rgd.enableHelp("GGC_Tools_Restore"); rgd.showDialog(); } Added: trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/enums/BigDecimalValueType.java =================================================================== --- trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/enums/BigDecimalValueType.java (rev 0) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/enums/BigDecimalValueType.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -0,0 +1,12 @@ +package ggc.core.enums; + +/** + * Created by andy on 10.07.17. + */ +public enum BigDecimalValueType +{ + Integer, // + Byte, // + Short, // + ; +} Modified: 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/DataAccess.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/util/DataAccess.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -21,6 +21,7 @@ import com.atech.i18n.I18nControlLangMgr; import com.atech.i18n.I18nControlLangMgrDual; import com.atech.i18n.mgr.LanguageManager; +import com.atech.i18n.tool.simple.data.TranslationToolConfigurationDto; import com.atech.plugin.PlugInClient; import com.atech.utils.ATDataAccessLMAbstract; import com.atech.utils.ATSwingUtils; @@ -32,12 +33,12 @@ import ggc.core.data.cfg.ConfigurationManager; import ggc.core.data.cfg.ConfigurationManagerWrapper; import ggc.core.data.defs.*; +import ggc.core.data.defs.lang.GGCLanguageModule; +import ggc.core.data.defs.lang.GGCSupportedLanguages; import ggc.core.data.graph.v2.GGCGraphContext; import ggc.core.db.GGCDb; import ggc.core.db.GGCDbLoader; -import ggc.core.db.datalayer.DailyValue; -import ggc.core.db.datalayer.Settings; -import ggc.core.db.datalayer.SettingsColorScheme; +import ggc.core.db.datalayer.*; import ggc.core.db.hibernate.doc.DoctorAppointmentH; import ggc.core.db.hibernate.doc.DoctorH; import ggc.core.db.hibernate.doc.DoctorTypeH; @@ -45,6 +46,7 @@ import ggc.core.db.hibernate.inventory.InventoryItemH; import ggc.core.db.hibernate.inventory.InventoryItemTypeH; import ggc.core.db.hibernate.settings.ColorSchemeH; +import ggc.core.db.hibernate.settings.SettingsH; import ggc.core.db.tool.DbToolApplicationGGC; import ggc.core.db.tool.data.GGCDatabaseTableConfiguration; import ggc.core.plugins.*; @@ -224,7 +226,7 @@ loadLanguageIntoContext(); - HelpContext hc = new HelpContext("/" + this.lang_mgr.getHelpSet()); + HelpContext hc = new HelpContext("/" + this.languageManager.getHelpSet()); this.setHelpContext(hc); this.helpEnabled = true; @@ -302,7 +304,7 @@ if (!ctx.isSelectedLanguageDefaultLanguage()) { - I18nControlLangMgr mgr = this.getLanguageManager().getI18nControl(this.m_icr); + I18nControlLangMgr mgr = this.getLanguageManager().getI18nControl(this.i18nControlRunner); if (mgr instanceof I18nControlLangMgrDual) { @@ -664,6 +666,7 @@ { BackupRestoreCollection brc_full = new BackupRestoreCollection("GGC_BACKUP", this.m_i18n); brc_full.addNodeChild(new DailyValue(this.m_i18n)); + brc_full.addNodeChild(new DailyValueOld(this.m_i18n)); BackupRestoreCollection brc1 = new BackupRestoreCollection("DOC_APPOINTMENT_BACKUP", this.m_i18n, true); brc1.addNodeChild(new DoctorTypeH(this.m_i18n)); @@ -690,6 +693,45 @@ } + public BackupRestoreCollection getBackupRestoreCollection(boolean restore) + { + BackupRestoreCollection brc_full = new BackupRestoreCollection("GGC_BACKUP", this.m_i18n); + brc_full.addNodeChild(new DailyValue(this.m_i18n)); + + if (restore) + brc_full.addNodeChild(new DailyValueOld(this.m_i18n)); + + BackupRestoreCollection brc1 = new BackupRestoreCollection("DOC_APPOINTMENT_BACKUP", this.m_i18n, true); + brc1.addNodeChild(new DoctorTypeH(this.m_i18n)); + brc1.addNodeChild(new DoctorH(this.m_i18n)); + brc1.addNodeChild(new DoctorAppointmentH(this.m_i18n)); + brc_full.addNodeChild(brc1); + + brc1 = new BackupRestoreCollection("CONFIGURATION", this.m_i18n); + brc1.addNodeChild(new Settings(this.m_i18n)); + brc1.addNodeChild(new SettingsColorScheme(this.m_i18n)); + if (restore) + { + brc1.addNodeChild(new SettingsOld(this.m_i18n)); + brc1.addNodeChild(new SettingsColorSchemeOld(this.m_i18n)); + } + + brc_full.addNodeChild(brc1); + + for (Enumeration<String> en = this.plugins.keys(); en.hasMoreElements();) + { + PlugInClient pic = this.plugins.get(en.nextElement()); + + if (pic.isBackupRestoreEnabled()) + { + brc_full.addNodeChild(pic.getBackupObjects()); + } + } + + return brc_full; + } + + /** * Load Graph Config Properties */ @@ -1478,6 +1520,8 @@ // "STOCK_TYPE,NAME,DESCRIPTION", "20,40,40", "", 1, ""); // OK + addDisplayManagerEntry(SettingsH.class, // + GGCSelectorConfiguration.None, GGCDatabaseTableConfiguration.SettingsH); addDisplayManagerEntry(ColorSchemeH.class, // GGCSelectorConfiguration.None, GGCDatabaseTableConfiguration.ColorSchemeH); @@ -1492,7 +1536,7 @@ addDisplayManagerEntry(DoctorAppointmentH.class, // GGCSelectorConfiguration.DoctorAppointmentH, GGCDatabaseTableConfiguration.DoctorAppointmentH); - // INVENTORY + // FIXME - INVENTORY Work in Progress (no db support yet) addDisplayManagerEntry(InventoryH.class, // GGCSelectorConfiguration.InventoryH, null); @@ -1531,6 +1575,8 @@ { // FIXME this.internalSetting.put(InternalSetting.Help_Settings_UserAddEdit, "unknownKey"); + // TranslationTool + } @@ -1879,4 +1925,24 @@ this.user_types[1] = m_i18n.getMessage("USER_NORMAL"); } + + @Override + public TranslationToolConfigurationDto getTranslationToolConfiguration() + { + TranslationToolConfigurationDto translationToolConfigurationDto = new TranslationToolConfigurationDto(); + + translationToolConfigurationDto.setMainModule(GGCLanguageModule.Core.getMainModule()); + translationToolConfigurationDto.setModules(GGCLanguageModule.Core.getAllModules()); + translationToolConfigurationDto.setMasterLanguage(GGCSupportedLanguages.English.getMasterLanguage()); + translationToolConfigurationDto.setSupportedLanguages(GGCSupportedLanguages.English.getLanguagesToTranslate()); + + return translationToolConfigurationDto; + } + + + @Override + public void saveTranslationToolConfiguration(TranslationToolConfigurationDto configuration) + { + + } } Modified: 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/GGCSelectorDialog.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/java/ggc/gui/dialogs/selector/GGCSelectorDialog.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -222,8 +222,11 @@ if (selectedObject.getPredefined() == 1) { - dataAccess.showConfirmDialog(this, ATSwingUtils.DialogType.Error, // - "DOCTOR_TYPE_CANT_EDIT_PREDEFINED", ATSwingUtils.ConfirmDialogType.ClosedOption); + ATSwingUtils.showConfirmDialog(this, // + ATSwingUtils.DialogType.Error, // + "DOCTOR_TYPE_CANT_EDIT_PREDEFINED", // + ATSwingUtils.ConfirmDialogType.ClosedOption, // + i18nControl); } else { Modified: trunk/ggc-core-app/ggc-core/src/main/resources/GGC_en.properties =================================================================== --- trunk/ggc-core-app/ggc-core/src/main/resources/GGC_en.properties 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/main/resources/GGC_en.properties 2017-09-17 21:38:43 UTC (rev 1467) @@ -60,8 +60,9 @@ NOT_TESTED_100PRO=Not tested 100% NOT_USED=Not Used DATE=Date +INFO=Information +WARNING=Warning - # # !G! ggc.datamodels [1] # Modified: trunk/ggc-core-app/ggc-core/src/test/java/ggc/misc/Test.java =================================================================== --- trunk/ggc-core-app/ggc-core/src/test/java/ggc/misc/Test.java 2017-06-28 20:55:08 UTC (rev 1466) +++ trunk/ggc-core-app/ggc-core/src/test/java/ggc/misc/Test.java 2017-09-17 21:38:43 UTC (rev 1467) @@ -1,9 +1,16 @@ package ggc.misc; -import java.math.BigDecimal; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import javax.swing.*; + +import com.atech.i18n.tool.simple.internal.TranslationToolInternalWizard1_ConfigurationCheck; + +import ggc.core.util.DataAccess; + /** * Created by andy on 05/10/16. */ @@ -10,21 +17,101 @@ public class Test { - public static void main(String[] args) + public static void copyFile() { - BigDecimal val1 = new BigDecimal(200); - BigDecimal val2 = new BigDecimal(35.7); + try + { + System.out.println(ExportResource("/GGC_en.properties")); + } + catch (Exception e) + { + e.printStackTrace(); + } + } - System.out.println("Val1: " + val1 + ", val2: " + val2 + " result: " + (val1.compareTo(val2) > 0)); - String errorCode = "AddNetworkService:[AVAC][GPRS_ADD]"; + static public String ExportResource(String resourceName) throws Exception + { + InputStream stream = null; + OutputStream resStreamOut = null; + String jarFolder; + try + { + stream = Test.class.getResourceAsStream(resourceName);// note that + // each / is a + // directory + // down in the + // "jar tree" + // been the + // jar the + // root of the + // tree + if (stream == null) + { + throw new Exception("Cannot get resource \"" + resourceName + "\" from Jar file."); + } - Matcher matcher = Pattern.compile("(\\[\\w+\\]\\[\\w+\\])").matcher(errorCode); - if (matcher.find()) + int readBytes; + byte[] buffer = new byte[4096]; + jarFolder = new File(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()) + .getParentFile().getPath().replace('\\', '/'); + resStreamOut = new FileOutputStream(jarFolder + resourceName); + while ((readBytes = stream.read(buffer)) > 0) + { + resStreamOut.write(buffer, 0, readBytes); + } + } + catch (Exception ex) { - System.out.println(matcher.group()); + System.out.println("Exception: " + ex.getMessage()); + throw ex; } + finally + { + if (stream != null) + stream.close(); + if (resStreamOut != null) + resStreamOut.close(); + } + + return jarFolder + resourceName; } + + public static void main(String[] args) + { + + // Test.copyFile(); + + Test.translationTool(); + + // BigDecimal val1 = new BigDecimal(200); + // BigDecimal val2 = new BigDecimal(35.7); + // + // System.out.println("Val1: " + val1 + ", val2: " + val2 + " result: " + // + (val1.compareTo(val2) > 0)); + // + // String errorCode = "AddNetworkService:[AVAC][GPRS_ADD]"; + // + // Matcher matcher = + // Pattern.compile("(\\[\\w+\\]\\[\\w+\\])").matcher(errorCode); + // if (matcher.find()) + // { + // System.out.println(matcher.group()); + // } + + } + + + private static void translationTool() + { + JFrame frame = new JFrame(); + + DataAccess dataAccess = DataAccess.createInstance(frame); + + new TranslationToolInternalWizard1_ConfigurationCheck(frame, dataAccess); + + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-06-28 20:55:12
|
Revision: 1466 http://sourceforge.net/p/ggc/code/1466 Author: andyrozman Date: 2017-06-28 20:55:08 +0000 (Wed, 28 Jun 2017) Log Message: ----------- 1.4.3 [26.6.2017] - refactoring of database objects - refactoring of database access class Modified Paths: -------------- trunk/ggc-plugins/ggc-nutrition/docs/Changelog trunk/ggc-plugins/ggc-nutrition/pom.xml trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/data/GGCTreeRootDyn.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/data/GGCTreeRootStatic.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/GGCDbCache.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/GGCDbNutri.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/DailyFoodEntry.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/FoodDescription.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/FoodGroup.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/Meal.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/MealGroup.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/NutritionDefinition.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/NutritionHomeWeightType.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/defs/NutriPluginDefinition.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/DailyFoodEntryDisplay.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/MealFoodDisplay.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/MealNutritionsDisplay.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/NutritionDataDisplay.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/gui/print/PrintFoodDialog.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelMealSelector.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFood.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFoodEdit.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFoodGroup.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFoodGroupEdit.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionMeal.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionMealEdit.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/plugin/BackupRestoreNutriHandler.java trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/plugin/NutriPlugInServer.java Added Paths: ----------- trunk/ggc-plugins/ggc-nutrition/src/main/templates/ trunk/ggc-plugins/ggc-nutrition/src/main/templates/Version.java.template Removed Paths: ------------- trunk/ggc-plugins/ggc-nutrition/build/ Modified: trunk/ggc-plugins/ggc-nutrition/docs/Changelog =================================================================== --- trunk/ggc-plugins/ggc-nutrition/docs/Changelog 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/docs/Changelog 2017-06-28 20:55:08 UTC (rev 1466) @@ -6,6 +6,11 @@ -------------------------------------------------------------------------------------------------- +1.4.3 [26.6.2017] +- refactoring of database objects +- refactoring of database access class + + 1.4.2 [25.12.2016] [Andy] - GGCTreeRootStatic changed - datalayer @@ -18,6 +23,7 @@ - db objects refactoring - refactorings + 1.4.0 [24.10.2015] * refactoring changing Log to Logger instance * refactoring use of BG converter @@ -24,31 +30,39 @@ * refactoring whole plugin to use DevicePluginDefintionAbstract * refactoring DataAccessNutri + 1.3.7 [10.10.2015] * refactoring because of ConfigurationManagerWrapper + 1.3.6 [2.10.2015] * refactoring of ATDataAccess + 1.3.5 [26.4.2015] * changes to atech-tools, which required change here * changed data handling a little + 1.3.4 [21.09.2014] * printing changes + 1.3.3 [26.9.2011] * jdk7 changes + 1.3.1 [16.2.2010] * Added help to whole plugin * Cosmetic changes mostly + 1.2.1 (current) * Extended Food Selector (with plugin active check) * required base plugin is now 0.4.1 (framework v2) * this plugin already uses some of v2 features + 1.2 (10.6.2009) [andy] * Given ability to call Food Selector and Recalculation of CH (change in plugin functionality) * Minor cosmetic changes in NutriPlugInServer @@ -58,9 +72,11 @@ 1.1.3 (16.4.2009) [andy] * Fixed tree loading + 1.1.2 (11.4.2009) [andy] * Fixed data loading for print functions + 1.1.1 (27.3.2009) [andy] * Nutrition is now separate project Modified: trunk/ggc-plugins/ggc-nutrition/pom.xml =================================================================== --- trunk/ggc-plugins/ggc-nutrition/pom.xml 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/pom.xml 2017-06-28 20:55:08 UTC (rev 1466) @@ -1,41 +1,66 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.sf.ggc</groupId> - <artifactId>ggc-plugins</artifactId> - <version>0.8-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-plugins</artifactId> + <version>0.8-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> - <name>GGC Plugins - Nutrition Tool</name> - <artifactId>ggc-nutrition-tool</artifactId> - <version>${ggc-nutrition-tool.version}</version> + <name>GGC Plugins - Nutrition Tool</name> + <artifactId>ggc-nutrition-tool</artifactId> + <version>${ggc-nutrition-tool.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/nutri/defs/</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> - <dependencies> - <dependency> - <groupId>net.sf.ggc</groupId> - <artifactId>ggc-core</artifactId> - </dependency> + </plugins> + </build> - <dependency> - <groupId>net.sf.ggc</groupId> - <artifactId>ggc-plugins-base</artifactId> - </dependency> + <dependencies> + <dependency> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-core</artifactId> + </dependency> - <dependency> - <groupId>com.atech-software</groupId> - <artifactId>atech-tools</artifactId> - </dependency> - </dependencies> + <dependency> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-plugins-base</artifactId> + </dependency> - <properties> + <dependency> + <groupId>com.atech-software</groupId> + <artifactId>atech-tools</artifactId> + </dependency> + </dependencies> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <properties> + <version.file> + ${project.build.directory}/generated-sources/ggc/nutri/defs/Version.java + </version.file> + </properties> - </properties> - </project> Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/data/GGCTreeRootDyn.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/data/GGCTreeRootDyn.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/data/GGCTreeRootDyn.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -273,11 +273,11 @@ * for (int i = 0; i < this.import2_grp.size(); i++) * { * MealGroup fg = this.import2_grp.get(i); - * if (fg.getParent_id() == 0) + * if (fg.getParentId() == 0) * rt.add(fg); * else * { - * this.m_meal_groups_ht.get("" + fg.getParent_id()).addChild(fg); + * this.m_meal_groups_ht.get("" + fg.getParentId()).addChild(fg); * } * } * this.m_meal_groups_tree = rt; @@ -294,7 +294,7 @@ * public void addMealGroup(MealGroup mg) * { * /* - * if (mg.getParent_id() == 0) + * if (mg.getParentId() == 0) * { * this.m_meal_groups_ht.put("" + mg.getId(), mg); * this.m_meal_groups_tree.add(mg); @@ -302,7 +302,7 @@ * else * { * this.m_meal_groups_ht.put("" + mg.getId(), mg); - * this.m_meal_groups_ht.get("" + mg.getParent_id()).addChild(mg); + * this.m_meal_groups_ht.get("" + mg.getParentId()).addChild(mg); * } * } */ @@ -338,7 +338,7 @@ * { * FoodDescription fd = it2.next(); * this.m_foods_ht.put("" + fd.getId(), fd); - * this.m_groups_ht.get("" + fd.getGroup_id()).addChild(fd); + * this.m_groups_ht.get("" + fd.getGroupId()).addChild(fd); * } * } * else if (m_type == GGCTreeRoot.TREE_MEALS) @@ -349,7 +349,7 @@ * { * Meal fd = it2.next(); * this.m_meals_ht.put("" + fd.getId(), fd); - * this.m_meal_groups_ht.get("" + fd.getGroup_id()).addChild(fd); + * this.m_meal_groups_ht.get("" + fd.getGroupId()).addChild(fd); * } * } * } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/data/GGCTreeRootStatic.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/data/GGCTreeRootStatic.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/data/GGCTreeRootStatic.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -305,13 +305,13 @@ { MealGroup fg = this.import2_grp.get(i); - if (fg.getParent_id() == 0) + if (fg.getParentId() == 0) { rt.add(fg); } else { - this.m_meal_groups_ht.get("" + fg.getParent_id()).addChild(fg); + this.m_meal_groups_ht.get("" + fg.getParentId()).addChild(fg); } } @@ -328,7 +328,7 @@ */ public void addMealGroup(MealGroup mg) { - if (mg.getParent_id() == 0) + if (mg.getParentId() == 0) { this.m_meal_groups_ht.put("" + mg.getId(), mg); this.m_meal_groups_tree.add(mg); @@ -336,7 +336,7 @@ else { this.m_meal_groups_ht.put("" + mg.getId(), mg); - this.m_meal_groups_ht.get("" + mg.getParent_id()).addChild(mg); + this.m_meal_groups_ht.get("" + mg.getParentId()).addChild(mg); } } @@ -388,7 +388,7 @@ { Meal fd = it2.next(); this.m_meals_ht.put("" + fd.getId(), fd); - this.m_meal_groups_ht.get("" + fd.getGroup_id()).addChild(fd); + this.m_meal_groups_ht.get("" + fd.getGroupId()).addChild(fd); } } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/GGCDbCache.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/GGCDbCache.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/GGCDbCache.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -177,7 +177,7 @@ this.addMealGroup2Tree(3, mg); /* - * if (mg.getParent_id() == 0) + * if (mg.getParentId() == 0) * { * this.m_meal_groups_ht.put("" + mg.getId(), mg); * this.m_meal_groups_tree.add(mg); @@ -185,7 +185,7 @@ * else * { * this.m_meal_groups_ht.put("" + mg.getId(), mg); - * this.m_meal_groups_ht.get("" + mg.getParent_id()).addChild(mg); + * this.m_meal_groups_ht.get("" + mg.getParentId()).addChild(mg); * } */ } @@ -228,7 +228,7 @@ * { * FoodDescription fd = it2.next(); * this.m_foods_ht.put("" + fd.getId(), fd); - * this.m_groups_ht.get("" + fd.getGroup_id()).addChild(fd); + * this.m_groups_ht.get("" + fd.getGroupId()).addChild(fd); * } * } * else if (m_type == GGCTreeRoot.TREE_MEALS) @@ -239,7 +239,7 @@ * { * Meal fd = it2.next(); * this.m_meals_ht.put("" + fd.getId(), fd); - * this.m_meal_groups_ht.get("" + fd.getGroup_id()).addChild(fd); + * this.m_meal_groups_ht.get("" + fd.getGroupId()).addChild(fd); * } * } * } @@ -286,7 +286,7 @@ public void addMeal2Tree(int type, Meal _meal) { // debug("addMeal2Tree :: Not Implemented Yet !"); - this.meal_groups.get("" + type).get("" + _meal.getGroup_id()).addChild(_meal); + this.meal_groups.get("" + type).get("" + _meal.getGroupId()).addChild(_meal); this.meals.get("" + type).put("" + _meal.getId(), _meal); } @@ -300,7 +300,7 @@ public void addMealGroup2Tree(int type, MealGroup mg) { // debug("addMealGroup2Tree :: Not Implemented Yet !"); - this.meal_groups.get("" + type).get("" + mg.getParent_id()).addChild(mg); + this.meal_groups.get("" + type).get("" + mg.getParentId()).addChild(mg); this.meal_groups.get("" + type).put("" + mg.getId(), mg); } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/GGCDbNutri.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/GGCDbNutri.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/GGCDbNutri.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -20,6 +20,7 @@ import ggc.core.db.GGCDb; import ggc.core.db.hibernate.food.*; +import ggc.core.util.DataAccess; import ggc.nutri.data.GGCTreeRoot; import ggc.nutri.data.GGCTreeRootDyn; import ggc.nutri.db.datalayer.*; @@ -66,6 +67,8 @@ */ public GGCDbNutri(GGCDb db) { + super(DataAccess.getInstance(), db); + this.hib_config = db.getHibernateConfiguration(); // System.out.println("hib_Config:" + this.hib_config); @@ -342,7 +345,7 @@ */ public List<FoodGroup> getUserFoodGroups(long parentId) { - List<FoodUserGroupH> fgList = getHibernateObjectListByParameter("parent_id", parentId, Order.asc("name"), + List<FoodUserGroupH> fgList = getHibernateObjectListByParameter("parentId", parentId, Order.asc("name"), FoodUserGroupH.class, 2); return getDAOGroupList(fgList, FoodGroup.class); @@ -388,7 +391,7 @@ */ public List<FoodDescription> getFoodsByParent(int type, long parent_id) { - logInfo("getFoodsByParent(type=" + type + ",parent_id=" + parent_id + ")"); + logInfo("getFoodsByParent(type=" + type + ",parentId=" + parent_id + ")"); if (type == GGCTreeRoot.TREE_USDA_NUTRITION) return this.getUSDAFoodDescriptionsByParent(parent_id); @@ -421,7 +424,7 @@ */ public List<FoodDescription> getUSDAFoodDescriptionsByParent(long parentId) { - List<FoodDescriptionH> fgList = getHibernateObjectListByParameter("parent_id", parentId, Order.asc("name"), + List<FoodDescriptionH> fgList = getHibernateObjectListByParameter("parentId", parentId, Order.asc("name"), FoodDescriptionH.class, 2); return getDAOGroupList(fgList, FoodDescription.class); @@ -533,7 +536,7 @@ { Query q = getSession(2).createQuery( - "select pst from ggc.core.db.hibernate.food.FoodUserDescriptionH as pst where pst.group_id=" + parent_id + "select pst from ggc.core.db.hibernate.food.FoodUserDescriptionH as pst where pst.groupId=" + parent_id + " order by pst.name"); Iterator<?> it = q.iterate(); @@ -572,7 +575,7 @@ { Query q = getSession(2).createQuery( - "select pst from ggc.core.db.hibernate.food.FoodUserDescriptionH as pst order by pst.group_id, pst.name"); + "select pst from ggc.core.db.hibernate.food.FoodUserDescriptionH as pst order by pst.groupId, pst.name"); Iterator<?> it = q.iterate(); @@ -610,7 +613,7 @@ { Query q = getSession(2).createQuery( - "select pst from ggc.core.db.hibernate.food.MealH as pst order by pst.group_id, pst.name"); + "select pst from ggc.core.db.hibernate.food.MealH as pst order by pst.groupId, pst.name"); Iterator<?> it = q.iterate(); @@ -665,8 +668,8 @@ { Query q = getSession(2) - .createQuery("select pst from ggc.core.db.hibernate.food.MealH as pst where pst.group_id=" - + parent_id + " order by pst.group_id, pst.name"); + .createQuery("select pst from ggc.core.db.hibernate.food.MealH as pst where pst.groupId=" + + parent_id + " order by pst.groupId, pst.name"); Iterator<?> it = q.iterate(); @@ -916,6 +919,27 @@ } + @Override + protected void initDataTransformer() + { + + } + + + @Override + protected <E extends HibernateObject> void specialFilteringOfCriteria(Class<E> clazz, Criteria criteria) + { + + } + + + @Override + protected <E extends HibernateObject> boolean isTypeCached(Class<E> clazz) + { + return false; + } + + /** * Create Configuration */ Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/DailyFoodEntry.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/DailyFoodEntry.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/DailyFoodEntry.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -519,7 +519,7 @@ private void loadHomeWeight() { - // System.out.println("HWs: " + this.m_food.getHome_weights()); + // System.out.println("HWs: " + this.m_food.getHomeWeights()); // System.out.println("Looking for: " + this.home_weight_id); if (this.m_food.getHome_weights() == null && this.m_food.getHome_weights().length() == 0) Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/FoodDescription.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/FoodDescription.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/FoodDescription.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -105,7 +105,7 @@ /** * this.setId(0); this.setFood_group_id(0); this.setName(""); * this.setI18n_name(""); this.setRefuse(0.0f); this.setNutritions(""); - * this.setHome_weights(""); this.setRefuse(0.0f); + * this.setHomeWeights(""); this.setRefuse(0.0f); */ } @@ -128,7 +128,7 @@ * this.setEnergy_kcal(ch.getEnergy_kcal()); // * this.setEnergy_kJ(ch.getEnergy_kJ()); // * this.setFat_g(ch.getFat_g()); this.setRefuse(ch.getRefuse()); - * this.setHome_weights(ch.getHome_weights()); + * this.setHomeWeights(ch.getHomeWeights()); * this.setNutritions(ch.getNutritions()); * * // this.setSugar_g(ch.getSugar_g()); @@ -172,7 +172,7 @@ { return this.getName(); // return "Food [id=" + getId() + ",name=" + this.getName() + - // ",parent_id=" + this.getGroup_id() + "]"; + // ",parent_id=" + this.getGroupId() + "]"; } @@ -223,9 +223,9 @@ public long getGroup_id() { if (type == 1) - return this.m_food_desc1.getGroup_id(); + return this.m_food_desc1.getGroupId(); else - return this.m_food_desc2.getGroup_id(); + return this.m_food_desc2.getGroupId(); } @@ -238,11 +238,11 @@ { if (type == 1) { - this.m_food_desc1.setGroup_id(group_id); + this.m_food_desc1.setGroupId(group_id); } else { - this.m_food_desc2.setGroup_id(group_id); + this.m_food_desc2.setGroupId(group_id); } } @@ -287,9 +287,9 @@ public String getName_i18n() { if (type == 1) - return this.m_food_desc1.getName_i18n(); + return this.m_food_desc1.getNameI18n(); else - return this.m_food_desc2.getName_i18n(); + return this.m_food_desc2.getNameI18n(); } @@ -302,11 +302,11 @@ { if (type == 1) { - this.m_food_desc1.setName_i18n(name_i18n); + this.m_food_desc1.setNameI18n(name_i18n); } else { - this.m_food_desc2.setName_i18n(name_i18n); + this.m_food_desc2.setNameI18n(name_i18n); } } @@ -383,9 +383,9 @@ public String getHome_weights() { if (type == 1) - return this.m_food_desc1.getHome_weights(); + return this.m_food_desc1.getHomeWeights(); else - return this.m_food_desc2.getHome_weights(); + return this.m_food_desc2.getHomeWeights(); } @@ -398,11 +398,11 @@ { if (type == 1) { - this.m_food_desc1.setHome_weights(home_weights); + this.m_food_desc1.setHomeWeights(home_weights); } else { - this.m_food_desc2.setHome_weights(home_weights); + this.m_food_desc2.setHomeWeights(home_weights); } } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/FoodGroup.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/FoodGroup.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/FoodGroup.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -118,7 +118,7 @@ else { this.group_db2 = new FoodUserGroupH(); - this.group_db2.setParent_id(-1); + this.group_db2.setParentId(-1); } } @@ -277,9 +277,9 @@ public String getName_i18n() { if (group_type == 1) - return this.group_db1.getName_i18n(); + return this.group_db1.getNameI18n(); else - return this.group_db2.getName_i18n(); + return this.group_db2.getNameI18n(); } @@ -292,11 +292,11 @@ { if (group_type == 1) { - this.group_db1.setName_i18n(name); + this.group_db1.setNameI18n(name); } else { - this.group_db2.setName_i18n(name); + this.group_db2.setNameI18n(name); } } @@ -515,7 +515,7 @@ if (this.group_type == 1) return 0L; else - return this.group_db2.getParent_id(); + return this.group_db2.getParentId(); } @@ -528,7 +528,7 @@ { if (this.group_type == 2) { - this.group_db2.setParent_id(parent_id); + this.group_db2.setParentId(parent_id); } } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/Meal.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/Meal.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/Meal.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -86,8 +86,8 @@ { this.setId(0L); this.setName(""); - this.setName_i18n(""); - this.setGroup_id(0); + this.setNameI18n(""); + this.setGroupId(0); this.setDescription(""); this.setParts(""); this.setNutritions(""); @@ -112,8 +112,8 @@ this.setId(ch.getId()); this.setName(ch.getName()); - this.setName_i18n(ch.getName_i18n()); - this.setGroup_id(ch.getGroup_id()); + this.setNameI18n(ch.getNameI18n()); + this.setGroupId(ch.getGroupId()); this.setDescription(ch.getDescription()); this.setParts(ch.getParts()); this.setNutritions(ch.getNutritions()); @@ -186,8 +186,8 @@ ch.setId(this.getId()); ch.setName(this.getName()); - ch.setName_i18n(this.getName_i18n()); - ch.setGroup_id(this.getGroup_id()); + ch.setNameI18n(this.getNameI18n()); + ch.setGroupId(this.getGroupId()); ch.setDescription(this.getDescription()); ch.setParts(this.getParts()); ch.setNutritions(this.getNutritions()); @@ -218,8 +218,8 @@ ch.setId(this.getId()); ch.setName(this.getName()); - ch.setName_i18n(this.getName_i18n()); - ch.setGroup_id(this.getGroup_id()); + ch.setNameI18n(this.getNameI18n()); + ch.setGroupId(this.getGroupId()); ch.setDescription(this.getDescription()); ch.setParts(this.getParts()); ch.setNutritions(this.getNutritions()); @@ -285,8 +285,8 @@ this.setId(ch.getId()); this.setName(ch.getName()); - this.setName_i18n(ch.getName_i18n()); - this.setGroup_id(ch.getGroup_id()); + this.setNameI18n(ch.getNameI18n()); + this.setGroupId(ch.getGroupId()); this.setDescription(ch.getDescription()); this.setParts(ch.getParts()); this.setNutritions(ch.getNutritions()); Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/MealGroup.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/MealGroup.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/MealGroup.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -114,8 +114,8 @@ this.setId(0); this.setName(""); this.setDescription(""); - this.setName_i18n(""); - this.setParent_id(-1); + this.setNameI18n(""); + this.setParentId(-1); } @@ -130,8 +130,8 @@ this.setId(ch.getId()); this.setName(ch.getName()); this.setDescription(ch.getDescription()); - this.setName_i18n(ch.getName_i18n()); - this.setParent_id(ch.getParent_id()); + this.setNameI18n(ch.getNameI18n()); + this.setParentId(ch.getParentId()); } @@ -327,7 +327,7 @@ */ public String getLongDescription() { - return "MealGroup [id=" + this.getId() + ",name=" + this.getName() + ",parent_id=" + this.getParent_id() + "]"; + return "MealGroup [id=" + this.getId() + ",name=" + this.getName() + ",parent_id=" + this.getParentId() + "]"; } @@ -367,8 +367,8 @@ // ch.setId(this.getId()); ch.setName(this.getName()); ch.setDescription(this.getDescription()); - ch.setParent_id(this.getParent_id()); - ch.setName_i18n(this.getName_i18n()); + ch.setParentId(this.getParentId()); + ch.setNameI18n(this.getNameI18n()); Long id = (Long) sess.save(ch); @@ -397,8 +397,8 @@ ch.setName(this.getName()); ch.setDescription(this.getDescription()); - ch.setParent_id(this.getParent_id()); - ch.setName_i18n(this.getName_i18n()); + ch.setParentId(this.getParentId()); + ch.setNameI18n(this.getNameI18n()); sess.update(ch); tx.commit(); @@ -473,8 +473,8 @@ this.setId(ch.getId()); this.setName(ch.getName()); this.setDescription(ch.getDescription()); - this.setParent_id(ch.getParent_id()); - this.setName_i18n(ch.getName_i18n()); + this.setParentId(ch.getParentId()); + this.setNameI18n(ch.getNameI18n()); return true; } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/NutritionDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/NutritionDefinition.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/NutritionDefinition.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -58,8 +58,8 @@ this.setId(0); this.setTag(""); this.setName(""); - this.setWeight_unit(""); - this.setDecimal_places(""); + this.setWeightUnit(""); + this.setDecimalPlaces(""); ic = DataAccessNutri.getInstance().getI18nControlInstance(); @@ -77,8 +77,8 @@ this.setId(ch.getId()); this.setTag(ch.getTag()); this.setName(ch.getName()); - this.setWeight_unit(ch.getWeight_unit()); - this.setDecimal_places(ch.getDecimal_places()); + this.setWeightUnit(ch.getWeightUnit()); + this.setDecimalPlaces(ch.getDecimalPlaces()); ic = DataAccessNutri.getInstance().getI18nControlInstance(); this.setSearchContext(); } @@ -91,7 +91,7 @@ */ public String getShortDescription() { - return this.getResolvedName() + " (" + this.getWeight_unit() + ")"; + return this.getResolvedName() + " (" + this.getWeightUnit() + ")"; } @@ -128,8 +128,8 @@ ch.setId(this.getId()); ch.setTag(this.getTag()); ch.setName(this.getName()); - ch.setWeight_unit(this.getWeight_unit()); - ch.setDecimal_places(this.getDecimal_places()); + ch.setWeightUnit(this.getWeightUnit()); + ch.setDecimalPlaces(this.getDecimalPlaces()); Long id = (Long) sess.save(ch); @@ -157,8 +157,8 @@ ch.setId(this.getId()); ch.setTag(this.getTag()); ch.setName(this.getName()); - ch.setWeight_unit(this.getWeight_unit()); - ch.setDecimal_places(this.getDecimal_places()); + ch.setWeightUnit(this.getWeightUnit()); + ch.setDecimalPlaces(this.getDecimalPlaces()); sess.update(ch); tx.commit(); @@ -220,8 +220,8 @@ this.setId(ch.getId()); this.setTag(ch.getTag()); this.setName(ch.getName()); - this.setWeight_unit(ch.getWeight_unit()); - this.setDecimal_places(ch.getDecimal_places()); + this.setWeightUnit(ch.getWeightUnit()); + this.setDecimalPlaces(ch.getDecimalPlaces()); this.setSearchContext(); @@ -287,7 +287,7 @@ { // this.getId(); /* - * this.getName(); this.getTag(); this.getWeight_unit(); + * this.getName(); this.getTag(); this.getWeightUnit(); */ switch (num) { @@ -319,7 +319,7 @@ // this.getId(); /* - * this.getName(); this.getTag(); this.getWeight_unit(); + * this.getName(); this.getTag(); this.getWeightUnit(); */ switch (num) { @@ -327,7 +327,7 @@ return this.getTag(); case 3: - return this.getWeight_unit(); + return this.getWeightUnit(); case 2: return this.getResolvedName(); @@ -354,7 +354,7 @@ return this.getTag(); case 3: - return this.getWeight_unit(); + return this.getWeightUnit(); case 2: return this.getResolvedName(); Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/NutritionHomeWeightType.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/NutritionHomeWeightType.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/db/datalayer/NutritionHomeWeightType.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -292,7 +292,7 @@ switch (num) { case 3: - return getYesNo(this.getStatic_entry()); + return getYesNo(this.getStaticEntry()); case 2: return this.getResolvedName(); @@ -322,7 +322,7 @@ switch (num) { case 3: - return getYesNo(this.getStatic_entry()); + return getYesNo(this.getStaticEntry()); case 2: return getResolvedName(); Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/defs/NutriPluginDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/defs/NutriPluginDefinition.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/defs/NutriPluginDefinition.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -3,12 +3,11 @@ import java.util.List; import com.atech.app.data.about.CreditsGroup; -import com.atech.i18n.I18nControlRunner; import com.atech.i18n.mgr.LanguageManager; import ggc.core.plugins.GGCPluginType; import ggc.nutri.report.def.NutriReportDefinition; -import ggc.nutri.util.DataAccessNutri; +import ggc.nutri.util.GGCNutriICRunner; import ggc.plugin.defs.DevicePluginDefinitionAbstract; import ggc.plugin.graph.PluginGraphDefinition; import ggc.plugin.list.BaseListEntry; @@ -20,22 +19,20 @@ public class NutriPluginDefinition extends DevicePluginDefinitionAbstract { - String PLUGIN_VERSION = "1.4.0"; - String PLUGIN_NAME = "GGC Nutrition Plugin"; + private static String PLUGIN_NAME = "GGC Nutrition Plugin"; - public NutriPluginDefinition(DataAccessNutri dataAccessPump) + public NutriPluginDefinition(LanguageManager languageManager) { - super(dataAccessPump); + super(languageManager, // + new GGCNutriICRunner(), // + PLUGIN_NAME, // + GGCPluginType.NutritionToolPlugin, // + "nutri_", // + "ggc.nutri.defs.Version"); } - public NutriPluginDefinition(LanguageManager languageManager, I18nControlRunner i18nControlRunner) - { - super(languageManager, i18nControlRunner); - } - - public int getCopyrightFrom() { return 2009; @@ -60,24 +57,6 @@ } - public String getPluginVersion() - { - return this.PLUGIN_VERSION; - } - - - public String getPluginName() - { - return this.PLUGIN_NAME; - } - - - public GGCPluginType getPluginType() - { - return GGCPluginType.NutritionToolPlugin; - } - - @Override public List<BaseListEntry> getWebListerItems() { @@ -117,11 +96,4 @@ return null; } - - @Override - public String getPluginActionsPrefix() - { - return "nutri_"; - } - } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/DailyFoodEntryDisplay.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/DailyFoodEntryDisplay.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/DailyFoodEntryDisplay.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -1,10 +1,10 @@ package ggc.nutri.display; -import ggc.nutri.db.datalayer.DailyFoodEntry; - import com.atech.graphics.components.ATTableData; import com.atech.i18n.I18nControlAbstract; +import ggc.nutri.db.datalayer.DailyFoodEntry; + /** * Application: GGC - GNU Gluco Control * @@ -36,6 +36,7 @@ private static String[] weight_type_description = null; DailyFoodEntry daily_food_entry = null; + /** * Constructor * @@ -47,6 +48,7 @@ initStatic(); } + /** * Constructor * @@ -69,10 +71,11 @@ // String[] col = { "TYPE", "ID", "DESCRIPTION", "AMOUNT" }; } + /* * public void setNutritionDefinition(NutritionDefinition def) { this.id = * "" + def.getId(); // this.name = def.getName(); //this.value = - * def.get.getTag(); // this.weight_unit = def.getWeight_unit(); } + * def.get.getTag(); // this.weight_unit = def.getWeightUnit(); } */ /** @@ -90,6 +93,7 @@ } + /** * Init * @@ -104,6 +108,7 @@ init(col, col_size); } + /** * Get Daily Food Entry * @@ -114,6 +119,7 @@ return this.daily_food_entry; } + /** * Get String For Db * @@ -124,6 +130,7 @@ return this.daily_food_entry.getValueString(); } + /** * Get Column Value * Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/MealFoodDisplay.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/MealFoodDisplay.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/MealFoodDisplay.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -103,7 +103,7 @@ /* * public void setNutritionDefinition(NutritionDefinition def) { this.id = * "" + def.getId(); // this.name = def.getName(); //this.value = - * def.get.getTag(); // this.weight_unit = def.getWeight_unit(); } + * def.get.getTag(); // this.weight_unit = def.getWeightUnit(); } */ private void initStatic() Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/MealNutritionsDisplay.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/MealNutritionsDisplay.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/MealNutritionsDisplay.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -1,14 +1,14 @@ package ggc.nutri.display; -import ggc.nutri.db.datalayer.MealNutrition; -import ggc.nutri.db.datalayer.NutritionDefinition; -import ggc.nutri.util.DataAccessNutri; - import java.util.Comparator; import com.atech.graphics.components.ATTableData; import com.atech.i18n.I18nControlAbstract; +import ggc.nutri.db.datalayer.MealNutrition; +import ggc.nutri.db.datalayer.NutritionDefinition; +import ggc.nutri.util.DataAccessNutri; + /** * Application: GGC - GNU Gluco Control * @@ -43,6 +43,7 @@ private String weight_unit; private String decimal_places; + // private float calculated_value; /** @@ -55,6 +56,7 @@ super(ic); } + /** * Constructor * @@ -70,6 +72,7 @@ } + /** * Set Nutrition Definition * @@ -80,10 +83,11 @@ this.id = "" + def.getId(); this.name = def.getResolvedName(); // .getName(); // this.value = def.get.getTag(); - this.weight_unit = def.getWeight_unit(); - this.decimal_places = def.getDecimal_places(); + this.weight_unit = def.getWeightUnit(); + this.decimal_places = def.getDecimalPlaces(); } + /** * Init * @@ -98,6 +102,7 @@ init(cols, cols_size); } + /** * Get Id * @return @@ -107,6 +112,7 @@ return this.id; } + /** * Get Value * @@ -115,10 +121,11 @@ public String getValue() { float fl = Float.parseFloat(this.value); - return DataAccessNutri.getInstance().getDecimalHandler() - .getDecimalAsString(fl, Integer.parseInt(this.decimal_places)); + return DataAccessNutri.getInstance().getDecimalHandler().getDecimalAsString(fl, + Integer.parseInt(this.decimal_places)); } + /** * Get Column Value * @@ -143,6 +150,7 @@ } + /** * Compare * @@ -153,6 +161,7 @@ return mnd1.name.compareTo(mnd2.name); } + /** * Get Save Data * @@ -163,6 +172,7 @@ return this.id + "=" + this.getValue(); } + /** * To String * Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/NutritionDataDisplay.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/NutritionDataDisplay.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/display/NutritionDataDisplay.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -100,8 +100,8 @@ this.id = "" + def.getId(); this.name = def.getResolvedName(); // .getName(); // this.value = def.get.getTag(); - this.weight_unit = def.getWeight_unit(); - this.decimal_places = def.getDecimal_places(); + this.weight_unit = def.getWeightUnit(); + this.decimal_places = def.getDecimalPlaces(); } @@ -209,8 +209,8 @@ */ public void setAmount(float amount) { - this.value = DataAccessNutri.getInstance().getDecimalHandler() - .getDecimalAsString(amount, Integer.parseInt(this.decimal_places)); + this.value = DataAccessNutri.getInstance().getDecimalHandler().getDecimalAsString(amount, + Integer.parseInt(this.decimal_places)); } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/gui/print/PrintFoodDialog.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/gui/print/PrintFoodDialog.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/gui/print/PrintFoodDialog.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -46,7 +46,7 @@ private String[] report_types_2 = { ic.getMessage("FOOD_MENU_BASE"), ic.getMessage("FOOD_MENU_EXT_I"), ic.getMessage("FOOD_MENU_EXT_II"), - // m_ic.getMessage("FOOD_MENU_EXT_III") + // i18nControl.getMessage("FOOD_MENU_EXT_III") }; DataAccessNutri dataAccessNutri; Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelMealSelector.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelMealSelector.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelMealSelector.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -1,34 +1,12 @@ package ggc.nutri.panels; -import com.atech.utils.ATSwingUtils; -import ggc.nutri.db.datalayer.DailyFoodEntries; -import ggc.nutri.db.datalayer.DailyFoodEntry; -import ggc.nutri.db.datalayer.MealNutrition; -import ggc.nutri.db.datalayer.NutritionDefinition; -import ggc.nutri.dialogs.MealSpecialSelectorDialog; -import ggc.nutri.display.DailyFoodEntryDisplay; -import ggc.nutri.display.MealNutritionsDisplay; -import ggc.nutri.util.DataAccessNutri; - -import java.awt.Component; -import java.awt.Font; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Hashtable; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.ListSelectionModel; -import javax.swing.SwingConstants; +import javax.swing.*; import javax.swing.table.TableColumnModel; import com.atech.graphics.components.ATTableData; @@ -36,8 +14,17 @@ import com.atech.graphics.layout.ZeroLayout; import com.atech.help.HelpCapable; import com.atech.i18n.I18nControlAbstract; -import com.atech.utils.ATDataAccessAbstract; +import com.atech.utils.ATSwingUtils; +import ggc.nutri.db.datalayer.DailyFoodEntries; +import ggc.nutri.db.datalayer.DailyFoodEntry; +import ggc.nutri.db.datalayer.MealNutrition; +import ggc.nutri.db.datalayer.NutritionDefinition; +import ggc.nutri.dialogs.MealSpecialSelectorDialog; +import ggc.nutri.display.DailyFoodEntryDisplay; +import ggc.nutri.display.MealNutritionsDisplay; +import ggc.nutri.util.DataAccessNutri; + /** * Application: GGC - GNU Gluco Control * @@ -71,11 +58,11 @@ DataAccessNutri m_da = null; Font font_big, font_normal, font_normal_b; - JLabel label; //, label_refuse, label_name, label_name_i18n; + JLabel label; // , label_refuse, label_name, label_name_i18n; JLabel label_title; JButton button, button_select, help_button; - //JTextField tf_name, tf_name_i18n, tf_name_i18n_key, tf_group; - //JTextArea jta_desc; + // JTextField tf_name, tf_name_i18n, tf_name_i18n_key, tf_group; + // JTextArea jta_desc; JTable table_1, table_2 = null; JScrollPane scroll_1, scroll_2 = null; JDialog m_dialog; @@ -93,6 +80,7 @@ I18nControlAbstract ic = null; String meals_ids; + /** * Constructor * @@ -129,6 +117,7 @@ } + private void loadFoodParts() { // System.out.println("Food parts: " + this.meals_ids); @@ -150,11 +139,13 @@ } + private void addFoodPart(DailyFoodEntryDisplay _dfed) { this.addFoodPart(_dfed, true); } + private void addFoodPart(DailyFoodEntryDisplay _dfed, boolean refresh) { if (_dfed.getDailyFoodEntry() != null) @@ -168,6 +159,7 @@ } } + /** * Get String For Db * @@ -191,6 +183,7 @@ return sb.toString(); } + /** * Get CH Sum String * @return @@ -214,6 +207,7 @@ return "0,0"; } + private void createPanel() { @@ -318,7 +312,8 @@ button1.addActionListener(this.action_listener); this.add(button1); - this.help_button = ATSwingUtils.createHelpButtonByBounds(380, 410, 110, 25, this, ATSwingUtils.FONT_NORMAL, m_da); + this.help_button = ATSwingUtils.createHelpButtonByBounds(380, 410, 110, 25, this, ATSwingUtils.FONT_NORMAL, + m_da); this.add(this.help_button); m_da.enableHelp(this); @@ -326,6 +321,7 @@ return; } + // private static final int MODEL_MEAL_PARTS = 1; // private static final int MODEL_MEALS_NUTRITIONS = 2; @@ -346,9 +342,11 @@ } + /* * private void createKeyWord() { String key = - * dataAccess.makeI18nKeyword(tf_name.getText()); tf_name_i18n_key.setText(key); + * dataAccess.makeI18nKeyword(tf_name.getText()); + * tf_name_i18n_key.setText(key); * tf_name_i18n.setText(i18nControlAbstract.getMessage(key)); } */ @@ -359,6 +357,7 @@ this.refreshNutritions(); } + /* * private JTable getFoodTable() * { @@ -451,7 +450,8 @@ * this.meal.getId()); * if (msd.wasAction()) { MealPart mp = new * MealPart(msd.getSelectedObjectType(), msd.getSelectedObject(), - * msd.getAmountValue()); this.list_parts.add(new MealPartsDisplay(i18nControlAbstract, + * msd.getAmountValue()); this.list_parts.add(new + * MealPartsDisplay(i18nControlAbstract, * mp)); * this.createModel(this.list_parts, this.table_1, this.mpd); * refreshNutritions(); } @@ -459,7 +459,8 @@ * System.out.println("Edit Meal"); * if (this.table_1.getSelectedRowCount()==0) { * JOptionPane.showConfirmDialog(this, - * i18nControlAbstract.getMessage("SELECT_ITEM_FIRST"), i18nControlAbstract.getMessage("ERROR"), + * i18nControlAbstract.getMessage("SELECT_ITEM_FIRST"), + * i18nControlAbstract.getMessage("ERROR"), * JOptionPane.CLOSED_OPTION); return; } * MealPartsDisplay mnd = * this.list_parts.get(this.table_1.getSelectedRow()); @@ -472,10 +473,12 @@ * System.out.println("Remove Meal"); * if (this.table_1.getSelectedRowCount()==0) { * JOptionPane.showConfirmDialog(this, - * i18nControlAbstract.getMessage("SELECT_ITEM_FIRST"), i18nControlAbstract.getMessage("ERROR"), + * i18nControlAbstract.getMessage("SELECT_ITEM_FIRST"), + * i18nControlAbstract.getMessage("ERROR"), * JOptionPane.CLOSED_OPTION); return; } * int ii = JOptionPane.showConfirmDialog(this, - * i18nControlAbstract.getMessage("ARE_YOU_SURE_DELETE"), i18nControlAbstract.getMessage("ERROR"), + * i18nControlAbstract.getMessage("ARE_YOU_SURE_DELETE"), + * i18nControlAbstract.getMessage("ERROR"), * JOptionPane.YES_NO_OPTION); * if (ii==JOptionPane.YES_OPTION) { MealPartsDisplay mnd = * this.list_parts.get(this.table_1.getSelectedRow()); //PersonContact @@ -488,11 +491,13 @@ } + private void out(String text) { System.out.println(text); } + /* * proc v1 private void refreshNutritions() { * System.out.println("Refresh Nutritions"); @@ -556,7 +561,8 @@ * mnd.setNutritionDefinition(nd); * this.list_nutritions.add(mnd); } } * java.util.Collections.sort(this.list_nutritions, new - * MealNutritionsDisplay(i18nControlAbstract)); this.createModel(this.list_nutritions, + * MealNutritionsDisplay(i18nControlAbstract)); + * this.createModel(this.list_nutritions, * this.table_2, this.mnd); * } */ @@ -612,6 +618,7 @@ } + // TODO: fix GI/GL handling @SuppressWarnings("unused") private void loadGI_GL(Hashtable<String, MealNutrition> nutres) @@ -624,6 +631,7 @@ nutres.put("4005", new MealNutrition(4005, 0.0f, "GL Max")); } + // TODO: fix GI/GL handling @SuppressWarnings("unused") private void checkGI_GL(Hashtable<String, MealNutrition> nutres, MealNutrition mn, boolean GI) @@ -671,6 +679,7 @@ } + // TODO: fix GI/GL handling @SuppressWarnings("unused") private void checkGI_GL_Max(Hashtable<String, MealNutrition> nutres, MealNutrition mn, boolean GI) @@ -703,6 +712,7 @@ } + // TODO: fix GI/GL handling @SuppressWarnings("unused") private void checkGI_GL_Min(Hashtable<String, MealNutrition> nutres, MealNutrition mn, boolean GI) @@ -735,16 +745,19 @@ } + public Component getComponent() { return this; } + public JButton getHelpButton() { return help_button; } + public String getHelpId() { return "GGC_MFS_Daily_Selector"; @@ -790,14 +803,16 @@ * setTypeOfAction(EditableAbstractPanel.ACTION_EDIT); * this.label_title.setText(i18nControlAbstract.getMessage("MEAL_EDIT")); * this.tf_name.setText(this.meal.getName()); - * this.tf_name_i18n_key.setText(this.meal.getName_i18n()); - * this.tf_name_i18n.setText(i18nControlAbstract.getMessage(this.meal.getName_i18n())); + * this.tf_name_i18n_key.setText(this.meal.getNameI18n()); + * this.tf_name_i18n.setText(i18nControlAbstract.getMessage(this.meal. + * getNameI18n())); * this.jta_desc.setText(this.meal.getDescription()); - * if (this.meal.getGroup_id()>0) { this.meal_group = + * if (this.meal.getGroupId()>0) { this.meal_group = * dataAccess.tree_roots.get("3").m_meal_groups_ht.get("" + - * this.meal.getGroup_id()); + * this.meal.getGroupId()); * this.tf_group.setText(this.meal_group.getName()); } else { - * this.meal_group = null; this.tf_group.setText(i18nControlAbstract.getMessage("ROOT")); } + * this.meal_group = null; + * this.tf_group.setText(i18nControlAbstract.getMessage("ROOT")); } * this.loadMealsParts(); this.button_select.setEnabled(true); * createKeyWord(); * } Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFood.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFood.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFood.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -1,33 +1,26 @@ package ggc.nutri.panels; -import com.atech.utils.ATSwingUtils; -import ggc.nutri.data.GGCTreeRoot; -import ggc.nutri.db.datalayer.FoodDescription; -import ggc.nutri.db.datalayer.FoodGroup; -import ggc.nutri.dialogs.NutritionTreeDialog; -import ggc.nutri.display.HomeWeightDataDisplay; -import ggc.nutri.display.NutritionDataDisplay; - -import java.awt.Font; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.StringTokenizer; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.ListSelectionModel; -import javax.swing.SwingConstants; +import javax.swing.*; import javax.swing.table.TableColumnModel; import com.atech.graphics.components.ATTableData; import com.atech.graphics.components.ATTableModel; import com.atech.graphics.layout.ZeroLayout; -import com.atech.utils.ATDataAccessAbstract; +import com.atech.utils.ATSwingUtils; +import ggc.nutri.data.GGCTreeRoot; +import ggc.nutri.db.datalayer.FoodDescription; +import ggc.nutri.db.datalayer.FoodGroup; +import ggc.nutri.dialogs.NutritionTreeDialog; +import ggc.nutri.display.HomeWeightDataDisplay; +import ggc.nutri.display.NutritionDataDisplay; + /** * Application: GGC - GNU Gluco Control * @@ -53,7 +46,7 @@ * Author: andyrozman {an...@at...} */ -public class PanelNutritionFood extends GGCTreePanel /* JPanel */implements ActionListener +public class PanelNutritionFood extends GGCTreePanel /* JPanel */ implements ActionListener { private static final long serialVersionUID = 4046645712360241891L; @@ -77,6 +70,7 @@ FoodGroup food_group = null; + /** * Constructor * @@ -101,6 +95,7 @@ } + private void createPanel() { @@ -162,7 +157,8 @@ this.add(label_name_i18n, null); /* - * label = new JLabel(i18nControlAbstract.getMessage("TRANSLATED_NAME") + ":"); + * label = new JLabel(i18nControlAbstract.getMessage("TRANSLATED_NAME") + * + ":"); * label.setBounds(30, 140, 300, 60); label.setFont(fnt_14_bold); * this.add(label, null); * this.label_name_i18n = new JLabel(); // 180 @@ -238,7 +234,8 @@ label.setFont(fnt_14_bold); this.add(label, null); - // HomeWeightDataDisplay hwd = new HomeWeightDataDisplay(i18nControlAbstract); + // HomeWeightDataDisplay hwd = new + // HomeWeightDataDisplay(i18nControlAbstract); // System.out.println(hwd.getColumnsCount()); table_2 = new JTable(); @@ -265,6 +262,7 @@ return; } + /** * Set Parent * @@ -276,6 +274,7 @@ } + /** * Set Data * @@ -290,7 +289,7 @@ // this.label_name.setText("<html><body>" + fd.getName() + // "</body></html>"); - // this.label_name_i18n.setText("<html><body>" + fd.getName_i18n()+ + // this.label_name_i18n.setText("<html><body>" + fd.getNameI18n()+ // "</body></html>"); this.label_name.setText(fd.getName()); @@ -305,7 +304,7 @@ if (fd.getGroup_id() > 0) { // this.food_group = dataAccess.tree_roots.get("" + - // fd.getFoodType()).m_groups_ht.get("" + fd.getGroup_id()); + // fd.getFoodType()).m_groups_ht.get("" + fd.getGroupId()); this.food_group = m_da.getDbCache().tree_roots.get("" + fd.getFoodType()).findFoodGroup(fd.getFoodType(), fd.getGroup_id()); @@ -357,6 +356,7 @@ } + // public static final int MODEL_NUTRITIONS = 1; // public static final int MODEL_HOME_WEIGHTS = 2; @@ -377,6 +377,7 @@ } + /** * Action Listener */ @@ -388,6 +389,7 @@ } + /** * Get Warning string. This method returns warning string for either add or * edit. If value returned is null, then no warning message box will be @@ -402,6 +404,7 @@ return null; } + /** * Was data in this panel changed. * @@ -413,6 +416,7 @@ return false; } + /** * Save data in panel * @@ -424,6 +428,7 @@ return false; } + public String getHelpId() { if (this.m_dialog.getNutritionType() == GGCTreeRoot.TREE_USDA_NUTRITION) Modified: trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFoodEdit.java =================================================================== --- trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFoodEdit.java 2017-06-28 19:17:02 UTC (rev 1465) +++ trunk/ggc-plugins/ggc-nutrition/src/main/java/ggc/nutri/panels/PanelNutritionFoodEdit.java 2017-06-28 20:55:08 UTC (rev 1466) @@ -1,20 +1,6 @@ package ggc.nutri.panels; -import com.atech.utils.ATSwingUtils; -import ggc.nutri.data.HomeWeightComparator; -import ggc.nutri.data.NutritionsComparator; -import ggc.nutri.db.datalayer.FoodDescription; -import ggc.nutri.db.datalayer.FoodGroup; -import ggc.nutri.db.datalayer.NutritionDefinition; -import ggc.nutri.db.datalayer.NutritionHomeWeightType; -import ggc.nutri.dialogs.FoodPartMainSelectorDialog; -import ggc.nutri.dialogs.NutritionGroupDialog; -import ggc.nutri.dialogs.NutritionTreeDialog; -import ggc.nutri.display.HomeWeightDataDisplay; -import ggc.nutri.display.NutritionDataDisplay; -import ggc.nutri.util.DataAccessNutri; - -import java.awt.Font; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; @@ -23,15 +9,7 @@ import java.util.Collections; import java.util.StringTokenizer; -import javax.swing.JButton; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.ListSelectionModel; -import javax.swing.SwingConstants; +import javax.swing.*; import javax.swing.table.TableColumnModel; import com.atech.graphics.components.ATTableData; @@ -38,8 +16,21 @@ import com.atech.graphics.components.ATTableModel; import com.atech.graphics.components.EditableAbstractPanel; import com.atech.graphics.layout.ZeroLayout; -import com.atech.utils.ATDataAccessAbstract; +import com.atech.utils.ATSwingUtils; +import ggc.nutri.data.HomeWeightComparator; +import ggc.nutri.data.NutritionsComparator; +import ggc.nutri.db.datalayer.FoodDescription; +import ggc.nutri.db.datalayer.FoodGroup; +import ggc.nutri.db.datalayer.NutritionDefinition; +import ggc.nutri.db.datalayer.NutritionHomeWeightType; +import ggc.nutri.dialogs.FoodPartMainSelectorDialog; +import ggc.nutri.dialogs.NutritionGroupDialog; +import ggc.nutri.dialogs.NutritionTreeDialog; +import ggc.nutri.display.HomeWeightDataDisplay; +import ggc.nutri.display.NutritionDataDisplay; +import ggc.nutri.util.DataAccessNutri; + /** * Ap... [truncated message content] |
From: <and...@us...> - 2017-06-28 19:17:04
|
Revision: 1465 http://sourceforge.net/p/ggc/code/1465 Author: andyrozman Date: 2017-06-28 19:17:02 +0000 (Wed, 28 Jun 2017) Log Message: ----------- 0.2.3 [16.2.2017] [Andy] - added Appointment pages Modified Paths: -------------- trunk/ggc-support/ggc-help/docs/Changelog.txt trunk/ggc-support/ggc-help/src/main/resources/help/en/GGCTOC.xml trunk/ggc-support/ggc-help/src/main/resources/help/en/Map.jhm trunk/ggc-support/ggc-help/src/main/resources/help/si/GGCTOC.xml Added Paths: ----------- trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_AppDialog.html trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_AppList.html trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_DocSelector.html Modified: trunk/ggc-support/ggc-help/docs/Changelog.txt =================================================================== --- trunk/ggc-support/ggc-help/docs/Changelog.txt 2017-06-28 19:15:28 UTC (rev 1464) +++ trunk/ggc-support/ggc-help/docs/Changelog.txt 2017-06-28 19:17:02 UTC (rev 1465) @@ -2,6 +2,9 @@ Changelog for GGC Help (Help for GGC) ===================================== +0.2.3 [16.2.2017] [Andy] +- added Appointment pages + 0.2.2 [18.5.2016] [Andy] - added pages for Doctors module (WIP) - added pages for Graph_CGMS Modified: trunk/ggc-support/ggc-help/src/main/resources/help/en/GGCTOC.xml =================================================================== --- trunk/ggc-support/ggc-help/src/main/resources/help/en/GGCTOC.xml 2017-06-28 19:15:28 UTC (rev 1464) +++ trunk/ggc-support/ggc-help/src/main/resources/help/en/GGCTOC.xml 2017-06-28 19:17:02 UTC (rev 1465) @@ -97,6 +97,11 @@ <tocitem text="Add/Edit Working Time" target="Doc_WorkingTimeDialog"/> <tocitem text="Add/Edit Time (from Working Time)" target="Doc_WorkingTimeTimeDialog"/> </tocitem> + <tocitem text="Appointments"> + <tocitem text="Appointment's List" target="Appointment_AppointmentList"/> + <tocitem text="Add/Edit Doctor's Appointment" target="Appointment_AppointmentDialog"/> + <tocitem text="Doctor Selector" target="Appointment_DoctorSelector"/> + </tocitem> </tocitem> Modified: trunk/ggc-support/ggc-help/src/main/resources/help/en/Map.jhm =================================================================== --- trunk/ggc-support/ggc-help/src/main/resources/help/en/Map.jhm 2017-06-28 19:15:28 UTC (rev 1464) +++ trunk/ggc-support/ggc-help/src/main/resources/help/en/Map.jhm 2017-06-28 19:17:02 UTC (rev 1465) @@ -116,6 +116,12 @@ <mapID target="Doc_WorkingTimeDialog" url="pages/GGC_Doc_WorkingTimeDialog.html"/> <mapID target="Doc_WorkingTimeTimeDialog" url="pages/GGC_Doc_WorkingTimeTimeDialog.html"/> + <!-- Appointment --> + <mapID target="Appointment_AppointmentList" url="pages/Misc_Appoint_AppList.html"/> + <mapID target="Appointment_AppointmentDialog" url="pages/Misc_Appoint_AppDialog.html"/> + <mapID target="Appointment_DoctorSelector" url="pages/Misc_Appoint_DocSelector.html"/> + + <mapID target="images.popup" url="images/popup.gif"/> </map> \ No newline at end of file Added: trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_AppDialog.html =================================================================== --- trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_AppDialog.html (rev 0) +++ trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_AppDialog.html 2017-06-28 19:17:02 UTC (rev 1465) @@ -0,0 +1,7 @@ +<html> +<body> +<h1>Add/Edit Doctor Appointment</h1> + + +</body> +</html> \ No newline at end of file Added: trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_AppList.html =================================================================== --- trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_AppList.html (rev 0) +++ trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_AppList.html 2017-06-28 19:17:02 UTC (rev 1465) @@ -0,0 +1,7 @@ +<html> +<body> +<h1>Appointments List</h1> + + +</body> +</html> \ No newline at end of file Added: trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_DocSelector.html =================================================================== --- trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_DocSelector.html (rev 0) +++ trunk/ggc-support/ggc-help/src/main/resources/help/en/pages/Misc_Appoint_DocSelector.html 2017-06-28 19:17:02 UTC (rev 1465) @@ -0,0 +1,7 @@ +<html> +<body> +<h1>Doctor Selector</h1> + + +</body> +</html> \ No newline at end of file Modified: trunk/ggc-support/ggc-help/src/main/resources/help/si/GGCTOC.xml =================================================================== --- trunk/ggc-support/ggc-help/src/main/resources/help/si/GGCTOC.xml 2017-06-28 19:15:28 UTC (rev 1464) +++ trunk/ggc-support/ggc-help/src/main/resources/help/si/GGCTOC.xml 2017-06-28 19:17:02 UTC (rev 1465) @@ -134,11 +134,11 @@ </tocitem> - <tocitem text="HbA1c "> + <tocitem text="HbA1c"> <tocitem text="HbA1c View " target="GGC_BG_HbA1c"/> </tocitem> - <tocitem text="Ratio "> + <tocitem text="Ratio"> <tocitem text="Base Ratio" target="GGC_Ratio_Base"/> <tocitem text="Extended Ratio" target="GGC_Ratio_Extended"/> <tocitem text="Ratio Calculator" target="GGC_Ratio_Calculator"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-06-28 19:15:32
|
Revision: 1464 http://sourceforge.net/p/ggc/code/1464 Author: andyrozman Date: 2017-06-28 19:15:28 +0000 (Wed, 28 Jun 2017) Log Message: ----------- 0.8.0 [26.6.2017] - little update to documentation - Apointments Implementation - Doctors Implementation - Stock/Inventory implementation started - refactoring a little - added DialogCreator Modified Paths: -------------- trunk/ggc-desktop-app/ggc-desktop/data/update/GGC_Update.properties trunk/ggc-desktop-app/ggc-desktop/doc/Changelog trunk/ggc-desktop-app/ggc-desktop/doc/Diabetes_Hardware.txt trunk/ggc-desktop-app/ggc-desktop/doc/GGC_Supported_Hardware.html trunk/ggc-desktop-app/ggc-desktop/doc/HardwareLibraries.txt trunk/ggc-desktop-app/ggc-desktop/doc/How_Can_I_Help.txt trunk/ggc-desktop-app/ggc-desktop/doc/README.de trunk/ggc-desktop-app/ggc-desktop/doc/README.en trunk/ggc-desktop-app/ggc-desktop/doc/README.si trunk/ggc-desktop-app/ggc-desktop/doc/TO-DO Detailed.txt trunk/ggc-desktop-app/ggc-desktop/doc/TO-DO.txt trunk/ggc-desktop-app/ggc-desktop/doc/archive/Changelog_old trunk/ggc-desktop-app/ggc-desktop/doc/archive/How_Can_I_Help_v1.txt trunk/ggc-desktop-app/ggc-desktop/doc/archive/How_Can_I_Help_v2.txt trunk/ggc-desktop-app/ggc-desktop/doc/archive/TO-DO_Archive.txt trunk/ggc-desktop-app/ggc-desktop/pom.xml trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/GGC.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/AboutGGCDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/AppointmentsDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/DoctorDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/DoctorsDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/AbstractPrefOptionsPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/ConfigCGMSPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/ConfigPumpPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/PrefFontsAndColorPane.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/PrefGeneralPane.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/PrefLanguagePane.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/PrefMedicalDataPane.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/PrefModePane.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/PrefPrintingPane.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/PrefRenderingQualityPane.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/DoctorDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/DoctorListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/DoctorTypeDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/appointment/AppointmentDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/appointment/AppointmentListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/to-do_doctor.txt trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/worktime/WorkingTimeDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/StockAmounts.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/StockSelectorDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/def/StockListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/def/StockTypeListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/def/StocktakingListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/MainFrame.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/StatusBar.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/AbstractInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/DeviceInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/GeneralInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/HbA1cInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/InfoPanelType.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/MainWindowInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/PlugInsInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/StatisticsInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/pen/DailyRowDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/pen/DailyRowMealsDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/pen/DailyStatsDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/test/Testing.java Added Paths: ----------- trunk/ggc-desktop-app/ggc-desktop/doc/Developer Image.txt trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/GGCCoreDesktopDialogCreator.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/GGCListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/PropertiesDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/SchemeDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/SchemeEDDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/graph/ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/graph/DailyGraphView.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/graph/JFAbstractGraphView.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/ConfigUsersPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/config/panels/PrefGlobalPane.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/inventory/ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/inventory/InventoryItemDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/inventory/InventoryItemTypeDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/inventory/def/ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/inventory/def/InventoryListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/inventory/def/MainInventoryListDef.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/selector/ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/AppointmentsInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/InventoryInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/resources/icons/cfg_global.png trunk/ggc-desktop-app/ggc-desktop/src/main/resources/icons/cfg_users.png trunk/ggc-desktop-app/ggc-desktop/src/main/resources/icons/data_find.png trunk/ggc-desktop-app/ggc-desktop/src/main/resources/icons/usr_add.png trunk/ggc-desktop-app/ggc-desktop/src/main/resources/icons/usr_default.png trunk/ggc-desktop-app/ggc-desktop/src/main/resources/icons/usr_delete.png trunk/ggc-desktop-app/ggc-desktop/src/main/resources/icons/usr_edit.png Removed Paths: ------------- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/cfg/PropertiesDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/cfg/SchemeDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/cfg/SchemeEDDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/cfg/graph/ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/cfg/panels/ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/doctor/appointment/DoctorSelector.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/StockDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/dialogs/stock/StockSubTypeDialog.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/ScheduleInfoPanel.java trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/main/panels/StocksInfoPanel.java Modified: trunk/ggc-desktop-app/ggc-desktop/data/update/GGC_Update.properties =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/data/update/GGC_Update.properties 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/data/update/GGC_Update.properties 2017-06-28 19:15:28 UTC (rev 1464) @@ -3,7 +3,6 @@ # # !!! Do NOT delete and/or edit this file. # -# Core: 0.5.0.3, Desktop: 0.5.0.3 # # Main application @@ -11,13 +10,16 @@ PRODUCT_ID=ggc ROOT=.. -VERSION_NAME=0.7 -VERSION_NUMERIC=15 +VERSION_NAME=0.8 +VERSION_NUMERIC=16 -VERSION_DESCRIPTION=Core 0.6.0, Desktop 0.6.0, Meter Tool 2.2.0, Pump Tool 1.5.0, CGMS Tool 1.3.5 +###### NOT DONE YET +VERSION_DESCRIPTION=Core 0.7.0, Desktop 0.7.0, Meter Tool 2.4.1, Pump Tool 2.0.1, CGMS Tool 1.5.1, Nutrition Tool 1.4.1 + + # # Applications # Modified: trunk/ggc-desktop-app/ggc-desktop/doc/Changelog =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/Changelog 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/Changelog 2017-06-28 19:15:28 UTC (rev 1464) @@ -6,7 +6,16 @@ -------------------------------------------------------------------------------------------------- +0.8.0 [26.6.2017] +- little update to documentation +- Apointments Implementation +- Doctors Implementation +- Stock/Inventory implementation started +- refactoring a little +- added DialogCreator + + 0.7.0 [2.2.2016] [Andy] - table layout: - refactoring of info panels Added: trunk/ggc-desktop-app/ggc-desktop/doc/Developer Image.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/Developer Image.txt (rev 0) +++ trunk/ggc-desktop-app/ggc-desktop/doc/Developer Image.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -0,0 +1,68 @@ + +DEVELOPER VIRTUAL BOX IMAGE +============================ + +Since we had some complaints from people who are not acquinted with Maven, that they have +problems getting Development running, I decided to create Developer image, contaning all +software needed for starting development. + +IMAGE CONTENT: +-------------- +- Lubuntu Image 16.10 (x386) +- Subversion 1.8 +- Maven 3.0.5 +- Java 1.5 (for compiling GGC) +- Java 1.8 (for IntelliJ) +- local maven cache for start working (no download needed) +- IntelliJ 14 - Community edition (I am still using this version, because it works best, and + all later changes are pretty bad) +- Some Intellij Plugins: Save Actions, Eclipse Formatter. +- PostgreSQL 9.1 with PgAdmin III. (with empty ggc database) + +Read-only repositories of: +- Atech-Software +- GGC + + +HOW CAN I START +--------------- +1. Download image +2. Start it in your Virtual Box +3. When box is running install "Virtual Box Guest Additions" (for better resolution) + +And that's it. You can try out the GGC. You can run Intellij and start GGC from there. (with latest +version available in Image) + + +START WITH NEVER VERSION +------------------------ + +Image of GGC might be older one, so you should probably go to: ~/workspaces/ggc +and run "svn update", same in ~/workspaces/ggc/atech-tools. + +After that just run "mvn clean install" in ~/workspaces/ggc + + +START OF DEVELOPMENT +-------------------- + +If you want to start contributing you should check out repositories again with your own +sourceforge.net username and password (so that you can checkin changes made). + + +NOTES +----- +We are still supporting Java 1.5, which is why Java 1.5 is installed. Maven 3.0.5 also +supports Java 1.5 (it might be the last version that does). There is also Java 8 installed, +but that is only so that we can run IntelliJ. JavaC points to java 1.5. Theoretically +you can use any version of java you want, but code checked in needs to be in strict 1.5 format. +While you can set target to 1.5 in maven, it usually doesn't check if you have writen it +correctly, which in turn means that it won't be compilable with java 1.5. + +There is PostgreSQL database installed with ggc_v7 instance and your development environment +will start with it, so that you can easily go to database and see data there (pgAdminIII is +installed for browsing database). + +You can also run with standard local database (same as with running application), but +in that case you are limited with one instance of application. + Modified: trunk/ggc-desktop-app/ggc-desktop/doc/Diabetes_Hardware.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/Diabetes_Hardware.txt 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/Diabetes_Hardware.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -107,5 +107,10 @@ the same, if you have one, you can just make another copy of same file or link) +2.) Linux (when running as non-root user) +Some devices require that you register (add rules) your device, so that you can access it +(USB devices) directly. + + Modified: trunk/ggc-desktop-app/ggc-desktop/doc/GGC_Supported_Hardware.html =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/GGC_Supported_Hardware.html 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/GGC_Supported_Hardware.html 2017-06-28 19:15:28 UTC (rev 1464) @@ -623,7 +623,7 @@ <td>Level 2</td> <td>Planned</td> <td>-</td> - <td>End of 2015</td> + <td>4Q/2017</td> <td> </td> <td></td> </tr> @@ -634,7 +634,7 @@ <td>Level 2</td> <td>Planned</td> <td>-</td> - <td>End of 2015</td> + <td>4Q/2017</td> <td> </td> <td>*1</td> </tr> @@ -645,7 +645,7 @@ <td>Level 2</td> <td>Planned</td> <td>-</td> - <td>End of 2015</td> + <td>4Q/2017</td> <td> </td> <td>*1</td> </tr> @@ -656,7 +656,7 @@ <td>Level 2</td> <td>Planned</td> <td>-</td> - <td>End of 2015</td> + <td>4Q/2017</td> <td> </td> <td>*1</td> </tr> @@ -668,7 +668,7 @@ <td>Level 2</td> <td>Planned</td> <td>-</td> - <td>End of 2015</td> + <td>4Q/2017</td> <td> </td> <td>*1</td> </tr> @@ -679,7 +679,7 @@ <td>Level 2</td> <td>Planned</td> <td>-</td> - <td>End of 2015</td> + <td>4Q/2017</td> <td> </td> <td>*1</td> </tr> @@ -690,7 +690,7 @@ <td>Level 2</td> <td>Planned</td> <td>-</td> - <td>End of 2015</td> + <td>4Q/2017</td> <td> </td> <td>*1</td> </tr> @@ -701,7 +701,7 @@ <td>Level 1</td> <td>Not planned for now</td> <td>-</td> - <td>?</td> + <td>4Q/2018</td> <td> </td> <td>*2. Perhaps export from Carelink</td> </tr> @@ -776,14 +776,15 @@ <br> -*1 - Minimed Pumps currently have 3 interfaces (devices) which can be used to read data from them. <b>ComLink</b> is -oldest of -them and is no longer used, so we won't add support for it. Second one is <b>Carelink USB</b>, which is at least for -most used interface, so we are adding support for this. Third one is <b>Contour Next Link meter</b>. Protocol for -this one is at this time unknown, so time when this will be supported is undetermined, we hope to get it done by -end of 2016.<br> +*1 - Minimed Pumps currently have 3 interfaces (devices) which can be used to read data from them:<br> +<b>ComLink</b> is oldest of +them and is no longer used, so we won't add support for it. <br> +<b>Carelink USB</b> - was most used interface recently, but it stopped working when Linux/Mac stopped using +USB 2.0 interface. We had support for this, but since it doesn;t work anymore, we have to go with next one<br> +<b>Contour Next Link meter</b>. Protocol for this one is still mostly unknown, but we are working on decoding it +and adding support for Medtronic device as soon as we can (probably by end 2017).<br> *2 - New Minimed Pump uses different protocol (which is supported through Contour Next Link 2.4 meter ), which means -that it won't be supported together with all other devices. +that it won't be supported together with all other devices. Support is planned for 2018. <br><br><br> @@ -1032,7 +1033,7 @@ <br> 1. Add your user into group plugdev<br> Add your user into group plugdev (this is the group under which USB devices are loaded as default). -Please google "udev" for your computer, if this sollutions doesn't work for you.<br> +Please google "udev" for your computer, if this solutions doesn't work for you.<br> <br> 2. Add rule in /etc/udev/rules.d<br> Create file 44-ggc-devices.rules and add entry like this:<br> Modified: trunk/ggc-desktop-app/ggc-desktop/doc/HardwareLibraries.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/HardwareLibraries.txt 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/HardwareLibraries.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -33,7 +33,7 @@ ======= Our Version: 4.1.0 -Latest Version: - +Latest Version: Latest of 4.1 branch OS: - Own version: Yes Comment: Dependency of Hid4Java. Modified: trunk/ggc-desktop-app/ggc-desktop/doc/How_Can_I_Help.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/How_Can_I_Help.txt 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/How_Can_I_Help.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -22,7 +22,7 @@ There are several ways you can help. The first and major way is to test software. Try to use it and find anything that doesn't work. Version 0.3 will be started from the command-line and all actions will also be displayed in the console. If you see an error text, exception or e.g. many cryptic lines of classes with numbers, this means something went wrong. The error is displayed on your screen, but it is also logged to a file (in <GGC_Root>\data\log). There you will find one or more files for each day. If an error happened today, there will be a file named 'GGC.log'. You need to open it and go to end and try to find the previously displayed errors. Zip this file and store it. And do the following (choose option A or B): -a.) Visit the bug reporting site for our project and enter the bug by yourself. Please attach the zipped log. The site is (data should be entered in English): http://sourceforge.net/tracker/?group_id=49749&atid=457319 +a.) Visit the bug reporting site for our project and enter the bug by yourself. Please attach the zipped log. The site is (data should be entered in English): http://sourceforge.net/tracker/?groupId=49749&atid=457319 You don't need to be member at sourceforge to add this information, if you are not please, write your email address somewhere in the error report. Describe exactly what you were doing when the exception occurred and how the problem affected your application. Also please let us know the configuration of your computer (for example: Celereon 2000 with 2 Gb Ram, running Ubuntu Linux, kernel 2.6.2.34, with java 1.8_12) b.) Send us an email (gg...@at...), with all the data described in A). @@ -36,7 +36,7 @@ --- So you have been using the software for some time, some things work fine, other not so well. If you find parts of GGC, which your think could work better, please let us know. If you find that some functionality is missing, again, let us know. You can use either email, or you can use the following form (data should be entered in English): -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-desktop-app/ggc-desktop/doc/README.de =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/README.de 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/README.de 2017-06-28 19:15:28 UTC (rev 1464) @@ -196,7 +196,7 @@ a) Gehen Sie zur Fehlerberichtserstattungsseite für dieses Projekt und geben Sie den Fehler selbst ein. Bitte fügen Sie das gepackte Protokoll bei. Die - Seite ist: http://sourceforge.net/tracker/?group_id=49749&atid=457319 (Bitte + Seite ist: http://sourceforge.net/tracker/?groupId=49749&atid=457319 (Bitte geben Sie Fehlerberichte nur auf Englisch ein!) Sie müssen kein Sourceforge-Mitglied sein, um Fehler zu berichten. Sofern Sie kein Mitglied sind, vermerken Sie bitte Ihre E-Mail-Adresse im @@ -225,7 +225,7 @@ nicht? Bitte berichten Sie über Ihre Erfahrungen (vor allem negative). Sie können entweder E-Mail schreiben oder oder folgendes Formular (Englisch) ausfüllen: -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-desktop-app/ggc-desktop/doc/README.en =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/README.en 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/README.en 2017-06-28 19:15:28 UTC (rev 1464) @@ -186,7 +186,7 @@ a.) Visit the bug reporting site for our project and enter the bug by yourself. Please attach the zipped log. The site is (data should be entered in English): - http://sourceforge.net/tracker/?group_id=49749&atid=457319 + http://sourceforge.net/tracker/?groupId=49749&atid=457319 You don't need to be member at sourceforge to add this information, if you are not please, write your email address somewhere in the error report. Describe exactly what you were doing when the exception occurred and how the problem @@ -213,7 +213,7 @@ know. If you find that some functionality is missing, again, let us know. You can use either email, or you can use the following form (data should be entered in English): -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-desktop-app/ggc-desktop/doc/README.si =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/README.si 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/README.si 2017-06-28 19:15:28 UTC (rev 1464) @@ -189,7 +189,7 @@ a.) Obiščite spletno stran za poročanje hroščev in vnesite hrošča. Prosim pripnite arhivirano dnevniško datoteko. Spletna stran je (podatki morajo biti vnešeni - v angleščini) http://sourceforge.net/tracker/?group_id=49749&atid=457319 + v angleščini) http://sourceforge.net/tracker/?groupId=49749&atid=457319 Za vpis teh podatkov ne rabite biti član portala sourceforge.net. Če niste član prosim pustite svoj e-mail naslov nekje v poročilu. Čim bolj natančno opišite kaj ste delali, ko je prišlo do napake in kako se je aplikacija obnašala po @@ -215,7 +215,7 @@ malo manj. Če ste našli dele GGC za katere mislite, da bi lahko delovali boljše, nam prosim sporočite to. Lahko uporabite email, ali pa uporabite naslednjo spletno stran (na tej strani morajo biti podatki vpisani v angleščini): -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-desktop-app/ggc-desktop/doc/TO-DO Detailed.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/TO-DO Detailed.txt 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/TO-DO Detailed.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -9,10 +9,10 @@ GGC 0.8 ======== -- stocks feature + - Refactor: - ExtendedDailyValueHandler (add enums) -METER TOOL: +METER TOOL: (not tested) - menarini - arkray @@ -22,6 +22,8 @@ GGC 0.9 ======== +- stocks feature (req. new DB) + - Startup Feature Modified: trunk/ggc-desktop-app/ggc-desktop/doc/TO-DO.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/TO-DO.txt 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/TO-DO.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -45,7 +45,7 @@ GGC Meter Tool -------------- See TO-DO_MeterTool.txt (in svn/trunk/ggc-meter) - Planned Device (in near future): Menarini, Arkray, Ascensia Contour Next One, Accu-chek Mobile + Planned Device (in near future): Menarini f., Arkray f., Ascensia Contour Next One, Accu-chek Mobile GGC Pump Tool @@ -62,7 +62,7 @@ -II. SORTED BY VERSION (Updated 16.10.2016) +II. SORTED BY VERSION (Updated 17.05.2017) =========================================== We plan to change version to 1.0, when all entries specified with [1.0] are @@ -69,24 +69,19 @@ finished (Help for english, Upgrade, Db Tool and Support for multiple persons) -Version 0.8 [1.6.2016 - 2.2.2017] +Version 0.8 [x.6.2017] ================================= -Meanrini support +Contour ONE: - check if works -Arkray support +Menarini support: + implement + + integrate +Arkray support: + implement + + integrate -Graphs (v1): - Pump: - - data retrival: - gluco values +Db Version: + determine version from resource file contents -DbTool: - base GGC - - init GGC - - export GGC - - restore GGC - - Release 0.8: - prepare release - release - webpage @@ -95,9 +90,29 @@ -Version 0.9 [1.4 - 1.7.2016] +Version 0.9 [x.12.2017] ================================= +Add to List: - Meter (Ascensia One ?, Menarini, Arkray) + + +Refactor: - Meter Db + +Graphs (v1): + Pump: + - data retrival: - gluco values + +DbTool(?): - base GGC + - init GGC + - export GGC + - restore GGC + +Menarini support: - test + +Arkray support: - test + +HbA1c: - for Pump + (1) Minimed: - support through Contour Next Link @@ -108,27 +123,48 @@ - move package +Inventory: - implement + - integrate [Required Db Update functionality] +Doctors: - integrate [Required Db Update functionality] Graph: - Configuration CGMS for Graph (Low, High Value) + +Hid4Java: - use version 0.5 + - use serialNumber to access devices + - changes to code (disable USB scanner) + (4) -Release 0.7: - prepare release +Release 0.9: - prepare release - release - upgrade configuration - upgrade server deploy +================================ +1.0 Milestones +================================ +* Db Tools Integration: - InitDb [1.0] +* Update (server) [1.0] +* Java Help: - Write help pages II. (finish EN) [1.0] + - Load from language jar [1.0] +* Support for multiple persons [1.0] + + ================================ +WAITING LIST / WISH LIST +================================ -GGC 0.9 -======== +------------------------------------------------------------------------- +CORE +------------------------------------------------------------------------- Update System v3 [1.0] - Software updater @@ -162,11 +198,47 @@ Fix: UpgradeCheckStatus class, and Statusbar +Graphs: - Framework v2 (ON HOLD FOR NOW) + - read XML definition + - graphs type support: - line + - bar + - ... + - CGMS Daily Graph V2 + - CGMS Weekly Graph + - GRAPH EDITOR (Graph Framework 3.0) (ON HOLD FOR NOW) + - Predefined graphs for GE (we need to create some usable graphs for end users, and convert all old) -(8) + +DeviceSelector: - resize possibility (ZeroLayout2) + - color (just enabled - supported, disabled for now - not supported) + + +* Db Tools Integration: - InitDb [1.0] +* Support for multiple persons [1.0] +* Update for Database IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + +* DeviceValuesTableModel - problem with existing data if data changes (manual change and then + again import) + + + +------------------------------------------------------------------------- +PEN/INJECTION +------------------------------------------------------------------------- + + +Pen/Injection: - Additional data: BP, Weight, Pills + + +------------------------------------------------------------------------- +PLUGINS - CONNECT +------------------------------------------------------------------------- + GGC Connect Plugin: - base - about - display version + - integrate - export GUI - import GUI - GGC: - import Pen @@ -177,164 +249,51 @@ - export CGMS - SiDiary: - export - import + - connect to Nutrition SLO Db -(9) -Doctors module: [Required Db Update functionality] - - add doctor: - dialog - - working days - + working hours - - add scheduling entry: - dialog +* Import of data from SiDiary Desktop application. SiDiary has its sister + applications running on many small devices (PocketPC, Palms, SmartPhones, + Java Phones), and it has import for a lot of Meters and also some pumps... +------------------------------------------------------------------------- +PLUGINS - PUMP & CGMS +------------------------------------------------------------------------- - -REFACTORING 0.7 or later -========================= - -GUI Refacoring: - main window - - pen: ? - - pumo: ? - - cgms: ? - - tools: ? - - ... - -Project refactoring: - add doctors project as maven: - - core - - desktop - - server (?) - - add desktop little as separate project - - create correct maven structure: - core - - desktop - - plugin_base (rename ?) - - cgms - - pump - - meter - - nutrition - - -GGC Help: - - ******************************************************************* - *** Section * Done * All * N/A *** - ******************************************************************* - * Main * 0 * 1 * *** - * File * 0 * 2 * 2 *** - * Pen/Injection * 0 * 13 * 4 *** - * Food * 0 * 17 * 2 *** - * Doctor * 0 * 3 * 3 *** - * Printing * 0 * 3 * 3 *** - * Graphs * * * ? *** - * Plugin - Core * 0 * 10 * *** - * Meter * * * *** - * Pump * 0 * 9 * 4 *** - * CGMS * 0 * 0 * *** - * Tools * 0 * 10 * *** - * Help * 0 * 1 * 1 *** - ******************************************************************* - - - -(Low) -Refactoring: - DataAccess -> Languages - - DataAccess (PlugIns also) -> Decimal Formaters (new way) - - PlugInBaseExceptionType -> Translations for exceptions - - refactor configuration (gui parts, changes detection, make more like ConfigPump...) - - refactor numeric formatters in DataAccess - - refactor Pump Report to use internal data retrieval to use PrintParameter - - Pump Profile Editor -> Not available for some pumps - - Pump -> Manual -> Add -> Profile Selector not available for some Pumps (implement it must be available) - - Pump Profile (??) - rethinking after Minimed is finished, possible removal - - in configuration we use old Graph for display of settings, reimplet with new Graph v1 - (Atech Graph V1) and then remove all of pre V1 implementation (rumbi's Jchart preview). - - -Tasks: - configuration of colors for Daily TimeSheet report (hardcoded) - - configuration CGMS: Low Target range, High target range (graph, reports) - -ReportPluginDefinition: - - refactor all reports to use same Print Dialog (at least Food, Pump and CGMS should use the same), add - printing defintions or something similar, this should also take care of register of menus for - printing. - - Pump 100% - - Food 20% - - CGMS 20% - - Connect --- - - Meter --- - - Core ??? - - - - - -************************************************************************************** -Version 0.10 -************************************************************************************** - -(6) -Stocks: ... [?] - -Graphs: - Framework v2 - - read XML definition - - graphs type support: - line - - bar - - ... - - CGMS Daily Graph V2 - - CGMS Weekly Graph - -HbA1c: - for Pump - -Minimed: - comlink: read CGMS data +Minimed: x comlink: read CGMS data - decode CGMS history data - - carelink: read CGMS data - - carelink: read CGMS history data + x carelink: read CGMS data + x carelink: read CGMS history data - add support for contour next link - contourNextLink: read pump data - contourNextLink: read pump history data - contourNextLink: read CGMS data - contourNextLink: read CGMS history data - - support 5306?? + - support 640G? (ContourNextLink 2.4)? -DeviceSelector: - resize possibility (ZeroLayout2) - - color (just enabled - supported, disabled for now - not supported) +Tandem: - ??? -Pump: - Additional data: BP, Weight, Pills +------------------------------------------------------------------------- +PLUGINS - PUMP +------------------------------------------------------------------------- -Pen/Injection: - Additional data: BP, Weight, Pills +Pump: - Additional data: BP, Weight, Pills +* Tandem support ?? -0.9 -==== -* Graphs: - - Graphs - - GRAPH EDITOR (Graph Framework 3.0) - - Predefined graphs for GE (we need to create some usable graphs for end users, and convert all old) +------------------------------------------------------------------------- +PLUGINS - NUTRITION +------------------------------------------------------------------------- -* Db Tools Integration: - InitDb [1.0] - -* Support for multiple persons [1.0] - - - -* Update for Database IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - -Bugs: * Nutrition Db in DataAccess fix (works ok, just outside confines of framework) - 5 -* DeviceValuesTableModel - problem with existing data if data changes (manual change and then - again import) -GGC 0.10 -======= - -* External foods database - * Added functionality for Nutrition Db: - Import data (selective) - Import Entry @@ -346,126 +305,143 @@ - Glycemic data change - Foods tree, we need to see about dynamic loading, since it takes a lot of memory to hold this information -* Stocks - - AED subtypes - - AED stocks -* Tandem support ?? +* External foods database -GGC 0.11 and later -================== +------------------------------------------------------------------------- +CORE FUNCTIONALITIES +------------------------------------------------------------------------- -* GGC Little +* Activity Manager + * Server Error Resolution (exceptions thrown by application, that help can be found on internet). -* Activity Manager + * Synchronization + * GGC Network + * Internet data (links for pages, forums, blogs - informational) - AED Inet Group - AED Inet Type - AED Inet Links -* GGC PPC (??) -* Appoinmtments Mngr - - AED doctor - - AED appointment - * GGC Network - Support for multiple instances of GGC and their communication -* Import of data from SiDiary Desktop application. SiDiary has its sister - applications running on many small devices (PocketPC, Palms, SmartPhones, - Java Phones), and it has import for a lot of Meters and also some pumps... ----- +------------------------------------------------------------------------- +OTHER +------------------------------------------------------------------------- +* GGC Little +* GGC: - Android (??) + - Iphone -1.0 Milestones -============== -* Db Tools Integration: - InitDb [1.0] -* Update (server) [1.0] -* Java Help - Write help pages II. (finish EN) [1.0] - - Load from language jar [1.0] -* Support for multiple persons [1.0] +================================ +REFACTORING +================================ -III. SORTED BY LEVELS OF PRIORITY (not updated !!!) -================================= +GUI Refacoring: - main window + - pen: ? + - pumo: ? + - cgms: ? + - tools: ? + - ... -Level 1 (High Priority): ----------------------------- +Project refactoring: - add doctors project as maven: + + core + - desktop + - server (?) + - add desktop little as separate project + - create correct maven structure: + core + + desktop + + plugin_base (rename ?) + + cgms + + pump + + meter + + nutrition + - atech-tools -Level 2 (Medium 1 Priority): ----------------------------- +GGC Help: + ******************************************************************* + *** Section * Done * All * N/A *** + ******************************************************************* + * Main * 0 * 1 * *** + * File * 0 * 2 * 2 *** + * Pen/Injection * 0 * 13 * 4 *** + * Food * 0 * 17 * 2 *** + * Doctor * 0 * 3 * 3 *** + * Printing * 0 * 3 * 3 *** + * Graphs * * * ? *** + * Plugin - Core * 0 * 10 * *** + * Meter * * 0 * *** + * Pump * 0 * 9 * 4 *** + * CGMS * 0 * 0 * *** + * Tools * 0 * 10 * *** + * Help * 0 * 1 * 1 *** + ******************************************************************* + * Together * 0 * 0 * *** + ******************************************************************* -* Import/Export Tool (old data): -// o Export old data (daily values, with conversion of BS format, in db can be only in mg/Dl) -// o Import old data (daily values) - o Db Maintainance GUI -* Add external library for graphs (something with pictures creations, so we can use it in pdfs) +(Low) +Refactoring: - DataAccess -> Languages + - DataAccess (PlugIns also) -> Decimal Formaters (new way) + - PlugInBaseExceptionType -> Translations for exceptions + - refactor configuration (gui parts, changes detection, make more like ConfigPump...) + - refactor numeric formatters in DataAccess + - refactor Pump Report to use internal data retrieval to use PrintParameter + - Pump Profile Editor -> Not available for some pumps + - Pump -> Manual -> Add -> Profile Selector not available for some Pumps (implement it must be available) + - Pump Profile (??) - rethinking after Minimed is finished, possible removal + - in configuration we use old Graph for display of settings, reimplet with new Graph v1 + (Atech Graph V1) and then remove all of pre V1 implementation (rumbi's Jchart preview). -Level 3 (Medium 2 Priority): ----------------------------- -* DB TOOL - o ??? - o Nutrition data Init - o Basic Data Init +Tasks: - configuration of colors for Daily TimeSheet report (hardcoded) + - configuration CGMS: Low Target range, High target range (graph, reports) -* Import/Export Tool (for real time): - o Backup - o Restore +ReportPluginDefinition: + - refactor all reports to use same Print Dialog (at least Food, Pump and CGMS should use the same), add + printing defintions or something similar, this should also take care of register of menus for + printing. + - Pump 100% + - Food 20% + - CGMS 20% + - Connect --- + - Meter --- + - Core ??? -Level 4 (Medium 3 Priority): ----------------------------- -* Entering daily data: - o Add CH entry through meals - -* Java Help: - x Integration - o Write English help -Level 5 (Low Priority): ----------------------------- -* Appointments/Doctors: - o Create GUI - o Database entries - o Add/Edit/Delete - o View -* GGC Little: - o GUI - o about - o meter import, add/edit should be centered -* Adding support for mmol/l (now we have only mG/DL): - o graphs -* Web Links: - o Db +III. LANGUAGE SUPPORT +====================== -Level 6 (IN NEAR FUTURE): -------------------------- +LANGUAGE STATUS LAST UPDATE +--------------------------------------------- +German WIP (50%) - +Slovenian WIP (75%) - +French: DONE 0.5 -* I18n Language: German (work in progress) -* I18n Language: Slovenian (work in progress 74% done) * I18n Language: Italian Modified: trunk/ggc-desktop-app/ggc-desktop/doc/archive/Changelog_old =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/archive/Changelog_old 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/archive/Changelog_old 2017-06-28 19:15:28 UTC (rev 1464) @@ -635,7 +635,7 @@ all texts for check and select elements were displayed to close to control 2006-04-14 (v0.2.1.10) Andy Rozman <and...@us...> - * moved ggc.gui.PropertiesFrame to ggc.gui.cfg.PropertiesDialog, and changed internal + * moved ggc.gui.PropertiesFrame to ggc.gui.dialogs.config.PropertiesDialog, and changed internal workings, so that after properties are done, we can save all setting and not just the current as it was till now. * changed DailyStatsDialog to display graph and ti display error if no row was selected. Modified: trunk/ggc-desktop-app/ggc-desktop/doc/archive/How_Can_I_Help_v1.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/archive/How_Can_I_Help_v1.txt 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/archive/How_Can_I_Help_v1.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -34,7 +34,7 @@ a.) Visit the bug reporting site for our project and enter the bug by yourself. Please attach the zipped log. The site is (data should be entered in English): - http://sourceforge.net/tracker/?group_id=49749&atid=457319 + http://sourceforge.net/tracker/?groupId=49749&atid=457319 You don't need to be member at sourceforge to add this information, if you are not please, write your email address somewhere in the error report. Describe exactly what you were doing when the exception occurred and how the problem @@ -60,7 +60,7 @@ know. If you find that some functionality is missing, again, let us know. You can use either email, or you can use the following form (data should be entered in English): -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-desktop-app/ggc-desktop/doc/archive/How_Can_I_Help_v2.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/archive/How_Can_I_Help_v2.txt 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/archive/How_Can_I_Help_v2.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -34,7 +34,7 @@ a.) Visit the bug reporting site for our project and enter the bug by yourself. Please attach the zipped log. The site is (data should be entered in English): - http://sourceforge.net/tracker/?group_id=49749&atid=457319 + http://sourceforge.net/tracker/?groupId=49749&atid=457319 You don't need to be member at sourceforge to add this information, if you are not please, write your email address somewhere in the error report. Describe exactly what you were doing when the exception occurred and how the problem @@ -60,7 +60,7 @@ know. If you find that some functionality is missing, again, let us know. You can use either email, or you can use the following form (data should be entered in English): -http://sourceforge.net/tracker/?group_id=49749&atid=457322 +http://sourceforge.net/tracker/?groupId=49749&atid=457322 --- Modified: trunk/ggc-desktop-app/ggc-desktop/doc/archive/TO-DO_Archive.txt =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/doc/archive/TO-DO_Archive.txt 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/doc/archive/TO-DO_Archive.txt 2017-06-28 19:15:28 UTC (rev 1464) @@ -4,7 +4,42 @@ **************************************************************** +0.8 +=== +Doctors: + implemented but hidden (db change and update required) +Doctors module: + + add doctor: + dialog + + working days + + working hours + + add scheduling entry: + dialog + + + +CANCELED 0.7 +============= + +Minimed: - comlink: read history data from device -2.1 + + + + +0.7 +==== + +(6) +Graphs (v2): + - CGMS Daily Graph V2 + - CGMS Weekly Graph + +Graphs (v1): (make them workable for Pen and add them for Pump) + + Pen: + - cleanup code + + + + =============================================================================== =============================================================================== DONE @@ -369,31 +404,12 @@ - web page -CANCELED 0.7 -============= -Minimed: - comlink: read history data from device -2.1 -DONE Version 0.7 -================= -(6) -Graphs (v2): - - CGMS Daily Graph V2 - - CGMS Weekly Graph - -Graphs (v1): (make them workable for Pen and add them for Pump) - - Pen: - - cleanup code - - - - - ============================== Modified: trunk/ggc-desktop-app/ggc-desktop/pom.xml =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/pom.xml 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/pom.xml 2017-06-28 19:15:28 UTC (rev 1464) @@ -14,8 +14,10 @@ <version>${ggc-desktop.version}</version> + <dependencies> - <dependencies> + <!-- GGC Dependencies --> + <dependency> <groupId>com.atech-software</groupId> <artifactId>atech-tools</artifactId> @@ -57,14 +59,24 @@ <artifactId>ggc-nutrition-tool</artifactId> </dependency> - <!-- + <dependency> <groupId>net.sf.ggc</groupId> <artifactId>ggc-connect-tool</artifactId> </dependency> ---> + + <!-- GGC Temporary Dependecies (testing only) --> + <dependency> + <groupId>net.sf.ggc</groupId> + <artifactId>ggc-device-menarini</artifactId> + </dependency> + + + <!-- Support Libraries --> + + <dependency> <groupId>javax.help</groupId> <artifactId>javahelp</artifactId> </dependency> @@ -74,13 +86,7 @@ <artifactId>skinlf</artifactId> </dependency> - <!-- <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - </dependency> ---> - <dependency> <groupId>jfree</groupId> <artifactId>jfreechart</artifactId> </dependency> @@ -111,24 +117,15 @@ </dependency> - <!-- <dependency> <groupId>info.clearthought</groupId> - <artifactId>table-layout-j15</artifactId> - <version>1.0</version> + <artifactId>table-layout</artifactId> </dependency> - --> <dependency> - <groupId>info.clearthought</groupId> - <artifactId>table-layout</artifactId> + <groupId>javax.jmdns</groupId> + <artifactId>jmdns</artifactId> </dependency> - - <!-- <dependency> <groupId>org.swinglabs</groupId> <artifactId>pdf-renderer</artifactId> - </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> - </dependency> --> - - </dependencies> </project> Modified: trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/GGC.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/GGC.java 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/GGC.java 2017-06-28 19:15:28 UTC (rev 1464) @@ -41,6 +41,7 @@ private static GGC s_theApp; private static MainFrame s_mainWindow; + // Version information /** * Version of application @@ -50,9 +51,8 @@ /** * Full Version */ - public static String full_version = "v" + DataAccess.CORE_VERSION; + // public static String full_version = "v" + DataAccess.CORE_VERSION; - /** * Version Date */ @@ -67,8 +67,8 @@ { GGCDbConfig conf = new GGCDbConfig(true); - DbCheckReport dcr = new DbCheckReport(conf.getDbInfoReportFilename(), - DataAccess.getInstance().getI18nControlInstance()); + DbCheckReport dcr = new DbCheckReport(conf.getDbInfoReportFilename(), DataAccess.getInstance() + .getI18nControlInstance()); if (dcr.canApplicationStart()) return true; Deleted: trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/cfg/PropertiesDialog.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/cfg/PropertiesDialog.java 2017-06-28 19:09:37 UTC (rev 1463) +++ trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/cfg/PropertiesDialog.java 2017-06-28 19:15:28 UTC (rev 1464) @@ -1,395 +0,0 @@ -package ggc.gui.cfg; - -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; - -import javax.swing.*; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import com.atech.help.HelpCapable; -import com.atech.i18n.I18nControlAbstract; -import com.atech.utils.ATSwingUtils; - -import ggc.core.data.cfg.ConfigCellRenderer; -import ggc.core.data.defs.GlucoseUnitType; -import ggc.core.util.DataAccess; -import ggc.gui.cfg.panels.*; - -/** - * 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: PropertiesDialog - * Description: Dialog for setting properties for application. - * - * Author: andyrozman {an...@at...} - */ - -// REFACTOR -public class PropertiesDialog extends JDialog implements ListSelectionListener, ActionListener, HelpCapable -{ - - private static final long serialVersionUID = -5813992933782713913L; - - private DataAccess dataAccess = DataAccess.getInstance(); - private I18nControlAbstract i18nControl = dataAccess.getI18nControlInstance(); - - private JList list = null; - private JPanel mainEditPanel; - private JButton helpButton; - - private ArrayList<AbstractPrefOptionsPanel> panels = null; - - private int currentIndex = 0; - private boolean okAction = false; - - // used for updating preferences correctly when glucoseUnit changes - private PrefFontsAndColorPane fontsAndColorPane = null; - private PrefRenderingQualityPane renderingQualityPane = null; - AbstractPrefOptionsPanel selectedPanel = null; - - /** - * Config types - */ - public String configTypes[] = { // - i18nControl.getMessage("MODE"), // - i18nControl.getMessage("GENERAL"), // - i18nControl.getMessage("MEDICAL_DATA"), // - i18nControl.getMessage("COLORS_AND_FONTS"), // - i18nControl.getMessage("RENDERING_QUALITY"), // - i18nControl.getMessage("PRINTING"), // - i18nControl.getMessage("LANGUAGE"), // - i18nControl.getMessage("PUMP"), // - i18nControl.getMessage("CGMS") // - }; - - - /** - * Constructor - * - * @param da - */ - public PropertiesDialog(DataAccess da) - { - super(da.getMainParent(), "", true); - - setSize(640, 480); - setTitle(i18nControl.getMessage("PREFERENCES")); - - ATSwingUtils.initLibrary(); - - ATSwingUtils.centerJDialog(this, da.getMainParent()); - - helpButton = ATSwingUtils.createHelpButtonBySize(120, 25, this, dataAccess); - createPanels(); - - init(); - selectPanel(0); - this.setResizable(false); - this.setVisible(true); - } - - - @SuppressWarnings({ "unchecked", "rawtypes" }) - private void init() - { - Dimension dim = new Dimension(120, 25); - - list = new JList(configTypes); - list.addListSelectionListener(this); - ConfigCellRenderer renderer = new ConfigCellRenderer(); - renderer.setPreferredSize(new Dimension(100, 75)); - list.setCellRenderer(renderer); - list.setSelectedIndex(0); - - JScrollPane prefTreePane = new JScrollPane(list, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, - ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - - mainEditPanel = new JPanel(new BorderLayout()); - - // set the buttons up... - JButton okButton = new JButton(" " + i18nControl.getMessage("OK")); - okButton.setPreferredSize(dim); - okButton.setIcon(ATSwingUtils.getImageIcon_22x22("ok.png", this, dataAccess)); - okButton.setActionCommand("ok"); - okButton.addActionListener(this); - - JButton cancelButton = new JButton(" " + i18nControl.getMessage("CANCEL")); - cancelButton.setPreferredSize(dim); - cancelButton.setIcon(ATSwingUtils.getImageIcon_22x22("cancel.png", this, dataAccess)); - cancelButton.setActionCommand("cancel"); - cancelButton.addActionListener(this); - - JButton applyButton = new JButton(" " + i18nControl.getMessage("APPLY")); - applyButton.setPreferredSize(dim); - applyButton.setIcon(ATSwingUtils.getImageIcon_22x22("flash.png", this, dataAccess)); - applyButton.setActionCommand("apply"); - applyButton.addActionListener(this); - - // ...and align them in a row at the buttom. - JPanel buttonPanel = new JPanel(); - buttonPanel.setAlignmentX(Component.RIGHT_ALIGNMENT); - buttonPanel.add(okButton); - buttonPanel.add(cancelButton); - buttonPanel.add(applyButton); - - buttonPanel.add(helpButton); - - mainEditPanel.add(buttonPanel, BorderLayout.SOUTH); - mainEditPanel.add(panels.get(0), BorderLayout.CENTER); - - getContentPane().add(prefTreePane, BorderLayout.WEST); - // getContentPane().add(list, BorderLayout.WEST); - getContentPane().add(mainEditPanel, BorderLayout.CENTER); - } - - - /** - * Create Panels - */ - public void createPanels() - { - // Each node must have a panel, and panel numbers must be as they are - // added - // to. You must add panels in same order as you add, nodes. - - panels = new ArrayList<AbstractPrefOptionsPanel>(); - // panel_id = new Hashtable<String, String>(); - - // addPanel(i18nControl.getMessage("PREFERENCES"), this.PANEL_MAIN, new - // PrefMainPane()); - // addPanel(i18nControl.getMessage("MODE"), PANEL_MODE, new - // PrefModePane(this)); - // addPanel(i18nControl.getMessage("GENERAL"), this.PANEL_GENERAL, new - // PrefGeneralPane(this)); - // addPanel(i18nControl.getMessage("MEDICAL_DATA"), - // this.PANEL_MEDICAL_DATA, new PrefMedicalDataPane(this)); - // fontsAndColorPane = new PrefFontsAndColorPane(this); // to be able to - // use - // // updateGraphView with an - // // instance later. - ... [truncated message content] |
From: <and...@us...> - 2017-06-28 19:09:40
|
Revision: 1463 http://sourceforge.net/p/ggc/code/1463 Author: andyrozman Date: 2017-06-28 19:09:37 +0000 (Wed, 28 Jun 2017) Log Message: ----------- 0.3.1 [26.6.2017] - created new project under maven - moved files from desktop module - refactoring a little Modified Paths: -------------- trunk/ggc-desktop-app/ggc-desktop-little/pom.xml trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/GGCLittle.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/StatusBarL.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/DailyStatsControlsL.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/DailyStatsPanelL.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/GeneralInfoPanelL.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/MainLittlePanel.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/PlugInMeterPanelL.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/PlugInPumpPanelL.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/ScheduleInfoPanelL.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/StocksInfoPanelL.java Added Paths: ----------- trunk/ggc-desktop-app/ggc-desktop-little/docs/Changelog trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/data/ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/data/DailyStatsTableLittleModel.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/DailyStatsListPanelL.java trunk/ggc-desktop-app/ggc-desktop-little/src/main/templates/ trunk/ggc-desktop-app/ggc-desktop-little/src/main/templates/Version.java.template Removed Paths: ------------- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/little/ Added: trunk/ggc-desktop-app/ggc-desktop-little/docs/Changelog =================================================================== --- trunk/ggc-desktop-app/ggc-desktop-little/docs/Changelog (rev 0) +++ trunk/ggc-desktop-app/ggc-desktop-little/docs/Changelog 2017-06-28 19:09:37 UTC (rev 1463) @@ -0,0 +1,12 @@ + +Changes for Desktop Little +=========================== + +0.3.1 [26.6.2017] +- created new project under maven +- moved files from desktop module +- refactoring a little + + +0.3.0 +- before changes \ No newline at end of file Modified: trunk/ggc-desktop-app/ggc-desktop-little/pom.xml =================================================================== --- trunk/ggc-desktop-app/ggc-desktop-little/pom.xml 2017-06-28 19:00:28 UTC (rev 1462) +++ trunk/ggc-desktop-app/ggc-desktop-little/pom.xml 2017-06-28 19:09:37 UTC (rev 1463) @@ -11,34 +11,39 @@ <name>GGC Desktop - Little</name> <description>GGC Little (Version of GGC that could always run in background)</description> <artifactId>ggc-desktop-little</artifactId> - <version>0.1-SNAPSHOT</version> + <version>${ggc-desktop-little.version}</version> + + <build> - <directory>target</directory> - <outputDirectory>target/classes</outputDirectory> - <finalName>${project.artifactId}-${project.version}</finalName> - <testOutputDirectory>target/test-classes</testOutputDirectory> - <sourceDirectory>src/main/java</sourceDirectory> - <!-- <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> --> + <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/gui/little/data/</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> - <testSourceDirectory>src/test/java</testSourceDirectory> - <resources> - <resource> - <directory>src</directory> - <filtering>true</filtering> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - </testResources> + </plugins> </build> + <dependencies> <dependency> <groupId>net.sf.ggc</groupId> @@ -72,10 +77,9 @@ </dependencies> <properties> - - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - + <version.file> + ${project.build.directory}/generated-sources/ggc/gui/little/data/Version.java + </version.file> </properties> </project> Modified: trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/GGCLittle.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/little/GGCLittle.java 2016-12-26 14:02:38 UTC (rev 1456) +++ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/GGCLittle.java 2017-06-28 19:09:37 UTC (rev 1463) @@ -1,34 +1,35 @@ package ggc.gui.little; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowEvent; -import java.awt.event.WindowListener; -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; +import java.awt.event.*; import java.text.SimpleDateFormat; import java.util.GregorianCalendar; import java.util.Hashtable; +import java.util.Map; +import java.util.Observable; -import javax.help.CSH; -import javax.help.HelpBroker; -import javax.help.HelpSet; -import javax.help.HelpSetException; import javax.swing.*; -import com.atech.help.HelpContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.atech.graphics.observe.EventObserverInterface; import com.atech.i18n.I18nControlAbstract; import com.atech.utils.ATSwingUtils; -import com.l2fprod.gui.plaf.skin.SkinLookAndFeel; +import com.atech.utils.java.VersionResolver; import ggc.core.data.DailyValuesRow; +import ggc.core.data.defs.DatabaseStatusType; +import ggc.core.data.defs.GGCObservableType; +import ggc.core.data.defs.RefreshInfoType; import ggc.core.db.GGCDb; +import ggc.core.gui.GGCGuiHelper; +import ggc.core.plugins.GGCPluginType; import ggc.core.util.DataAccess; import ggc.gui.dialogs.AboutGGCDialog; -import ggc.gui.little.panels.DailyStatsPanelL; +import ggc.gui.little.panels.DailyStatsListPanelL; import ggc.gui.little.panels.MainLittlePanel; +import ggc.gui.main.StatusBar; import ggc.gui.pen.DailyRowDialog; /** @@ -58,22 +59,26 @@ * Author: andyrozman {an...@at...} */ -public class GGCLittle extends JFrame implements WindowListener, ActionListener +public class GGCLittle extends JFrame implements ActionListener, EventObserverInterface { private static final long serialVersionUID = -7744922647111948669L; - private I18nControlAbstract m_ic = null; // I18nControl.getInstance(); - private DataAccess m_da = null; + private static Logger LOG = LoggerFactory.getLogger(GGCLittle.class); + + private GGCGuiHelper guiHelper; // = new GGCGuiHelper(LOG); + + private I18nControlAbstract i18nControl = null; // I18nControl.getInstance(); + private DataAccess dataAccess = null; private GGCDb m_db = null; - private static SkinLookAndFeel s_skinlf; - private static final String skinLFdir = "../data/skinlf_themes/"; - private Hashtable<String, GGCAction> actions = null; + // private static SkinLookAndFeel s_skinlf; + // private static final String skinLFdir = "../data/skinlf_themes/"; + private Map<String, JMenuItem> actions = null; // GUI private MainLittlePanel informationPanel = null; - private StatusBarL statusPanel; - private DailyStatsPanelL dailyStats = null; + private StatusBar statusPanel; + private DailyStatsListPanelL dailyStats = null; // fields private JToolBar toolBar = new JToolBar(); @@ -87,56 +92,18 @@ String ggc_little_version = "v0.2.3"; - /** * Static definitions (Look and Feel) */ static { - GGCLittle.setLookAndFeel(); // Win (not so bad) ??? + GGCGuiHelper.setLog(LOG); + GGCGuiHelper.setLookAndFeel(); + DataAccess.getSkinManager().setSkinLfOverrides(GGCGuiHelper.getSkinLfOverrides()); } /** - * Set Look And Feel - */ - public static void setLookAndFeel() - { - - try - { - - String data[] = DataAccess.getLFData(); - - if (data == null) - return; - else - { - if (data[0].equals("com.l2fprod.gui.plaf.skin.SkinLookAndFeel")) - { - SkinLookAndFeel.setSkin(SkinLookAndFeel.loadThemePack(skinLFdir + data[1])); - - s_skinlf = new com.l2fprod.gui.plaf.skin.SkinLookAndFeel(); - UIManager.setLookAndFeel(s_skinlf); - } - else - { - UIManager.setLookAndFeel(data[0]); - } - - JFrame.setDefaultLookAndFeelDecorated(true); - JDialog.setDefaultLookAndFeelDecorated(true); - } - } - catch (Exception ex) - { - System.err.println("Error loading L&F: " + ex); - } - - } - - - /** * Constructor * * @param developer_version @@ -143,21 +110,35 @@ */ public GGCLittle(boolean developer_version) { - m_da = DataAccess.createInstance(this); - m_ic = m_da.getI18nControlInstance(); - m_db = m_da.getDb(); + dataAccess = DataAccess.createInstance(this); + i18nControl = dataAccess.getI18nControlInstance(); + m_db = dataAccess.getDb(); - this.actions = new Hashtable<String, GGCAction>(); + guiHelper = new GGCGuiHelper(); + guiHelper.setDataAccess(dataAccess); - statusPanel = new StatusBarL(this); + this.actions = new Hashtable<String, JMenuItem>(); - String title = m_ic.getMessage("GGC_LITTLE_TITLE"); + statusPanel = new StatusBar(); + String title = i18nControl.getMessage("GGC_LITTLE_TITLE"); + + ggc_little_version = "v" + + VersionResolver.getVersion("ggc.gui.little.data.Version", this.getClass().getSimpleName()); + setTitle(title + " (" + ggc_little_version + ")"); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); - addWindowListener(this); + addWindowListener(new WindowAdapter() + { + @Override + public void windowClosing(WindowEvent e) + { + close(); + } + }); + createToolbar(); createSystemTrayInstance(); @@ -170,13 +151,19 @@ getContentPane().add(toolBar, BorderLayout.NORTH); getContentPane().add(statusPanel, BorderLayout.SOUTH); - helpInit(); + guiHelper.helpInit(); + guiHelper.setApplicationIcon(this); + dataAccess.getObserverManager().addObserver(GGCObservableType.Status, this); + dataAccess.getObserverManager().addObserver(GGCObservableType.Database, this); + // dataAccess.addObserver(observable_id, inst) - m_da.startDb(); // statusPanel); + dataAccess.getObserverManager().startToObserve(); + + dataAccess.startDb(); // statusPanel); setDbActions(false); - statusPanel.setStatusMessage(m_ic.getMessage("INIT")); + statusPanel.setStatusMessage(i18nControl.getMessage("INIT")); // dayData = DataAccess.getInstance().getDayStats(new // GregorianCalendar()); @@ -187,12 +174,37 @@ dailyStats = informationPanel.dailyStats; getContentPane().add(informationPanel, BorderLayout.CENTER); - setSize(640, 480); - this.setResizable(false); + this.setBounds(100, 100, 800, 600); + + this.getRootPane().addComponentListener(new ComponentAdapter() + { + + public void componentResized(ComponentEvent e) + { + // This is only called when the user releases the mouse button. + resizeEvent(); + } + }); + + // this.setResizable(false); this.setVisible(true); } + private void resizeEvent() + { + double x = this.getBounds().getWidth() - 360; + + emptyLabelBeforeHelp.setSize((int) x, 30); + emptyLabelBeforeHelp.setPreferredSize(new Dimension((int) x, 30)); + + // emptyLabelBeforeHelp.getWidth() + System.out.println("componentResized [" + this.getBounds().getWidth()); + } + + JLabel emptyLabelBeforeHelp; + + private void createToolbar() { @@ -202,19 +214,19 @@ JLabel label_empty = new JLabel(""); label_empty.setPreferredSize(new Dimension(40, 20)); - this.toolBar.add(getEmptyLabel(10, 20)); + this.toolBar.add(guiHelper.getEmptyLabel(10, 20)); - createToolbarAction("MN_QUIT", "MN_QUIT_LT_DESC", "quit", "exit.png"); + createToolbarButton("MN_QUIT", "MN_QUIT_LT_DESC", "quit", "exit.png"); - this.toolBar.add(getEmptyLabel(30, 20)); + this.toolBar.add(guiHelper.getEmptyLabel(30, 20)); - createToolbarAction("TB_ADD_ROW", "TB_ADD_ROW_DESC", "add_entry", "table_add.png"); - createToolbarAction("TB_EDIT_ROW", "TB_EDIT_ROW_DESC", "edit_entry", "table_edit.png"); - createToolbarAction("TB_DELETE_ROW", "TB_DELETE_ROW_DESC", "delete_entry", "table_delete.png"); + createToolbarButton("TB_ADD_ROW", "TB_ADD_ROW_DESC", "add_entry", "table_add.png"); + createToolbarButton("TB_EDIT_ROW", "TB_EDIT_ROW_DESC", "edit_entry", "table_edit.png"); + createToolbarButton("TB_DELETE_ROW", "TB_DELETE_ROW_DESC", "delete_entry", "table_delete.png"); - this.toolBar.add(getEmptyLabel(30, 20)); + this.toolBar.add(guiHelper.getEmptyLabel(30, 20)); - createToolbarAction("TB_SHOW_GRAPH", "TB_SHOW_GRAPH_DESC", "show_graph", "line-chart.png"); + createToolbarButton("TB_SHOW_GRAPH", "TB_SHOW_GRAPH_DESC", "show_graph", "line-chart.png"); // this.toolBar.add(getEmptyLabel(30,20)); @@ -221,9 +233,10 @@ // createToolbarAction("MN_FROM_METER", "TB_READ_METER_LT_DESC", // "read_meter", "readmeter.gif"); - this.toolBar.add(getEmptyLabel(360, 20)); + this.toolBar.add(emptyLabelBeforeHelp = guiHelper.getEmptyLabel(430, 20)); - createToolbarAction("MN_ABOUT", "TB_ABOUT_DESC", "hlp_about", "about.png"); + createToolbarButton("MN_HELP", "TB_HELP_DESC", "hlp_help", "help.png"); + createToolbarButton("MN_ABOUT", "TB_ABOUT_DESC", "hlp_about", "about.png"); // this.actions.get("read_meter").setEnabled(false); @@ -268,7 +281,6 @@ } - /* * private JMenuItem createItem(String name, String desc, String action) { * JMenuItem item = new JMenuItem(i18nControl.getMessage(name)); @@ -279,15 +291,15 @@ * return item; } */ - /** - * Get Status Panel - * - * @return - */ - public StatusBarL getStatusPanel() - { - return this.statusPanel; - } + // /** + // * Get Status Panel + // * + // * @return + // */ + // public StatusBarL getStatusPanel() + // { + // return this.statusPanel; + // } /** @@ -301,30 +313,43 @@ } - private JLabel getEmptyLabel(int width, int height) + private void createToolbarButton(String name, String toolTip, String actionCommand, String iconSmall + /* , GGCToolbarType toolbarType */) { - JLabel label_empty = new JLabel(""); - label_empty.setPreferredSize(new Dimension(width, height)); - return label_empty; + JButton button = new JButton(); + button.setName(i18nControl.getMessageWithoutMnemonic(name)); - } + if (toolTip != null) + { + button.setToolTipText(i18nControl.getMessage(toolTip)); + } + if (actionCommand != null) + { + button.setActionCommand(actionCommand); + } - private void createToolbarAction(String name, String tip, String action_command, String icon_small) - { - GGCAction action = new GGCAction(name, tip, action_command); - - if (icon_small != null) + if (iconSmall != null) { - action.putValue(Action.SMALL_ICON, ATSwingUtils.getImageIcon(icon_small, 24, 24, this, m_da)); + button.setIcon(ATSwingUtils.getImageIcon(iconSmall, 28, 28, this, dataAccess)); } - // this.toolBar.add(action); - this.actions.put(action_command, action); + button.addActionListener(this); - addToolBarButton(action); + // this.toolbarItems.get(toolbarType).put(actionCommand, button); + // this.toolbars.get(toolbarType).add(button); + toolBar.add(button); + + button.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + button.setFocusPainted(false); + button.setPreferredSize(new Dimension(32, 32)); + + // this.toolbars.get(toolbarType).add(button); + + // this.actions.put(action_command, action); + } @@ -354,7 +379,7 @@ { // write to prefs to file on close. // props.write(); - m_da.getDb().closeDb(); + dataAccess.getDb().closeDb(); // s_dbH.disconnectDb(); dispose(); System.exit(0); @@ -361,425 +386,233 @@ } - /* - * private JMenuItem addMenuItem(JMenu menu, Action action) { JMenuItem item - * = menu.add(action); - * KeyStroke keystroke = (KeyStroke)action.getCode(Action.ACCELERATOR_KEY); - * if (keystroke != null) item.setAccelerator(keystroke); return item; } - */ - /* - * private void addToolBarSpacer() { toolBar.addSeparator(); } - */ - - private JButton addToolBarButton(Action action) + private boolean checkDateSame() { - final JButton button = toolBar.add(action); + if (m_db == null) + { + this.m_db = dataAccess.getDb(); + } - button.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); - button.setFocusPainted(false); + if (!dataAccess.isSameDay(this.gc_current, new GregorianCalendar())) + { + // not same date + JOptionPane.showMessageDialog(getMyParent(), i18nControl.getMessage("CURRENT_DATE_HAS_CHANGED"), + i18nControl.getMessage("ERROR"), JOptionPane.ERROR_MESSAGE); - button.setPreferredSize(new Dimension(28, 28)); + this.dailyStats.refreshInfo(); - // button.setIcon((ImageIcon)action.getCode(Action.SMALL_ICON)); - /* - * button.addMouseListener(new MouseListener() { public void - * mouseEntered(MouseEvent e) { if (button.isEnabled()) { - * button.setBorder(BorderFactory.createLineBorder(new Color(8, 36, - * 106), 1)); button.setBackground(new Color(180, 190, 213)); } - * } - * public void mouseExited(MouseEvent e) { - * button.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); - * button.setBackground(new Color(213, 210, 205)); } - * public void mouseClicked(MouseEvent e) { } - * public void mousePressed(MouseEvent e) { } - * public void mouseReleased(MouseEvent e) { } - * }); - */ + return false; + } + else + return true; - // button.setRolloverIcon(new ImageIcon("ggc/icons/connect.png")); - // button.setRolloverEnabled(true); - return button; } - class GGCAction extends AbstractAction + + /** + * actionPerformed + */ + public void actionPerformed(ActionEvent e) { - // private String command = null; - /** - * - */ - private static final long serialVersionUID = 5381628629001707536L; + // FIXME add/edit/delete for both types + String actionCommand = e.getActionCommand(); - GGCAction(String name, String command) + if (actionCommand.equals("show_app")) { - super(); - setName(m_ic.getMessageWithoutMnemonic(name)); - - putValue(Action.NAME, m_ic.getMessageWithoutMnemonic(name)); - - char ch = m_ic.getMnemonic(name); - - if (ch != '0') + if (is_visible) { - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(ch, Event.CTRL_MASK)); + this.toFront(); } - - if (command != null) + else { - putValue(ACTION_COMMAND_KEY, command); + this.setVisible(true); } + } + else if (actionCommand.equals("hide_app")) + { + is_visible = false; + this.setVisible(false); - command = name; } - - - /* - * GGCAction(String name, KeyStroke keystroke) { this(); - * setName(i18nControl.getMessageWithoutMnemonic(name)); if (keystroke - * != null) - * putValue(ACCELERATOR_KEY, keystroke); } - */ - GGCAction(String name, String tooltip, String command) + else if (actionCommand.equals("exit_app")) { - super(); - setName(m_ic.getMessageWithoutMnemonic(name)); + close(); + } + else if (actionCommand.equals("quit")) + { + close(); + } + else if (actionCommand.equals("add_entry")) + { + if (checkIfPumpAndDisplayError("Adding entry")) + { + return; + } - putValue(Action.NAME, m_ic.getMessageWithoutMnemonic(name)); + checkDateSame(); - char ch = m_ic.getMnemonic(name); + SimpleDateFormat sf = new SimpleDateFormat("dd.MM.yyyy"); - if (ch != '0') - { - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(ch, Event.CTRL_MASK)); - } + DailyRowDialog aRF = new DailyRowDialog(dailyStats.getDayData(), sf.format(gc_current.getTime()), + getMyParent()); - if (tooltip != null) + if (aRF.actionSuccessful()) { - putValue(SHORT_DESCRIPTION, m_ic.getMessage(tooltip)); - } + System.out.println("m_db:" + m_db); + System.out.println("dailyStats.dayData:" + dailyStats.getDayData()); - if (command != null) - { - putValue(ACTION_COMMAND_KEY, command); + m_db.saveDayStats(dailyStats.getDayData()); + dailyStats.getTableModel().fireTableChanged(null); + // this.model.fireTableChanged(null); } - } + // DailyValues dv = getDayData(); + // + // DailyRowDialog aRF = new DailyRowDialog(dv, + // dataAccess.getCurrentDateString(), getFrame()); + // + // if (aRF.actionSuccessful()) + // { + // dataAccess.getDb().saveDayStats(dv); + // reloadTable(); + // } - /* - * GGCAction(String name, KeyStroke keystroke, String tooltip) { - * this(name, keystroke); if (tooltip != null) - * putValue(SHORT_DESCRIPTION, tooltip); } - */ - - public void actionPerformed(ActionEvent e) + } + else if (actionCommand.equals("edit_entry")) { - String command = e.getActionCommand(); - - if (command.equals("quit")) + if (checkIfPumpAndDisplayError("Edit entry")) { - close(); + return; } - else if (command.equals("add_entry")) - { - checkDateSame(); - SimpleDateFormat sf = new SimpleDateFormat("dd.MM.yyyy"); + checkDateSame(); - DailyRowDialog aRF = new DailyRowDialog(dailyStats.getDayData(), sf.format(gc_current.getTime()), - getMyParent()); - - if (aRF.actionSuccessful()) - { - System.out.println("m_db:" + m_db); - System.out.println("dailyStats.dayData:" + dailyStats.getDayData()); - - m_db.saveDayStats(dailyStats.getDayData()); - dailyStats.getTableModel().fireTableChanged(null); - // this.model.fireTableChanged(null); - } - } - else if (command.equals("edit_entry")) + if (dailyStats.getTable().getSelectedRow() == -1) { - checkDateSame(); - - if (dailyStats.getTable().getSelectedRow() == -1) - { - JOptionPane.showMessageDialog(getMyParent(), m_ic.getMessage("SELECT_ROW_FIRST"), - m_ic.getMessage("ERROR"), JOptionPane.ERROR_MESSAGE); - return; - } - - DailyValuesRow dvr = dailyStats.getDayData().getRow(dailyStats.getTable().getSelectedRow()); - - DailyRowDialog aRF = new DailyRowDialog(dvr, getMyParent()); - - if (aRF.actionSuccessful()) - { - m_db.saveDayStats(dailyStats.getDayData()); - dailyStats.getTableModel().fireTableChanged(null); - } - + JOptionPane.showMessageDialog(getMyParent(), i18nControl.getMessage("SELECT_ROW_FIRST"), + i18nControl.getMessage("ERROR"), JOptionPane.ERROR_MESSAGE); + return; } - else if (command.equals("delete_entry")) - { - checkDateSame(); - if (dailyStats.getTable().getSelectedRow() == -1) - { - JOptionPane.showMessageDialog(getMyParent(), m_ic.getMessage("SELECT_ROW_FIRST"), - m_ic.getMessage("ERROR"), JOptionPane.ERROR_MESSAGE); - return; - } + DailyValuesRow dvr = dailyStats.getDayData().getRow(dailyStats.getTable().getSelectedRow()); - int option_selected = JOptionPane.showOptionDialog(getMyParent(), - m_ic.getMessage("ARE_YOU_SURE_DELETE_ROW"), m_ic.getMessage("QUESTION"), JOptionPane.YES_NO_OPTION, - JOptionPane.QUESTION_MESSAGE, null, m_da.options_yes_no, JOptionPane.YES_OPTION); + DailyRowDialog aRF = new DailyRowDialog(dvr, getMyParent()); - if (option_selected == JOptionPane.NO_OPTION) - return; - - try - { - dailyStats.getDayData().deleteRow(dailyStats.getTable().getSelectedRow()); - dailyStats.getTableModel().fireTableChanged(null); - m_db.saveDayStats(dailyStats.getDayData()); - } - catch (Exception ex) - { - System.out.println("DailyStatsDialog:Action:Delete Row: " + ex); - // log.error("Action::Delete Row::Exception: " + ex, ex); - } - } - else if (command.equals("show_graph")) + if (aRF.actionSuccessful()) { - // DailyGraphDialog dgd = new DailyGraphDialog(getMyParent(), - // dailyStats.getDayData()); - // dgd.setDailyValues(dailyStats.getDayData()); + m_db.saveDayStats(dailyStats.getDayData()); + dailyStats.getTableModel().fireTableChanged(null); } - else if (command.equals("read_meter")) - { - // ReadMeterDialog.showMe(MainFrame.this); - } - else if (command.equals("hlp_about")) - { - // FIX This - new AboutGGCDialog(getMyParent()); - // JOptionPane.showMessageDialog(null, - // "GNU Gluco Control v0.0.1", "About GGC", - // JOptionPane.INFORMATION_MESSAGE); - } - else - { - System.out.println("GGCLittle:Unknown Command: " + command); - } } - } - - - /** - * Help Init - */ - public void helpInit() - { - // TODO fix this - HelpContext hc = new HelpContext("../data/help/GGC.hs"); - - m_da.setHelpContext(hc); - - JMenuItem helpItem = new JMenuItem(m_ic.getMessage("HELP") + "..."); - helpItem.setIcon(new ImageIcon(getClass().getResource("/icons/help.gif"))); - - hc.setHelpItem(helpItem); - - String mainHelpSetName = "../data/help/GGC.hs"; - mainHelpSetName = mainHelpSetName.replace("/", File.separator); - - hc.setMainHelpSetName(mainHelpSetName); - - // try to find the helpset and create a HelpBroker object - if (hc.getMainHelpBroker() == null) + else if (actionCommand.equals("delete_entry")) { + if (checkIfPumpAndDisplayError("Delete entry")) + { + return; + } - // System.out.println("Help init broker"); + checkDateSame(); - HelpSet main_help_set = null; - // HelpContext.mainHelpSet = null; + if (dailyStats.getTable().getSelectedRow() == -1) + { + JOptionPane.showMessageDialog(getMyParent(), i18nControl.getMessage("SELECT_ROW_FIRST"), + i18nControl.getMessage("ERROR"), JOptionPane.ERROR_MESSAGE); + return; + } - // ClassLoader cl = MainFrame.class.getClassLoader(); - // String help_url = "jar:file:pis_lang-0.1.jar!/help/PIS.hs"; + int option_selected = JOptionPane.showOptionDialog(getMyParent(), + i18nControl.getMessage("ARE_YOU_SURE_DELETE_ROW"), i18nControl.getMessage("QUESTION"), + JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, dataAccess.options_yes_no, + JOptionPane.YES_OPTION); - String help_url = "jar:file:ggc_help-0.1.jar!/help/en/GGC.hs"; + if (option_selected == JOptionPane.NO_OPTION) + return; try { - URL hsURL = new URL(help_url); - - /* - * if (hsURL == null) - * System.out.println("HelpSet " + help_url /* - * PISMain.mainHelpSetName - */// + " not found."); - // else */ - main_help_set = new HelpSet(null, hsURL); + dailyStats.getDayData().deleteRow(dailyStats.getTable().getSelectedRow()); + dailyStats.getTableModel().fireTableChanged(null); + m_db.saveDayStats(dailyStats.getDayData()); } - catch (HelpSetException ee) + catch (Exception ex) { - System.out.println("HelpSet " + help_url + " could not be opened."); - System.out.println(ee.getMessage()); + System.out.println("DailyStatsDialog:Action:Delete Row: " + ex); + // log.error("Action::Delete Row::Exception: " + ex, ex); } - catch (MalformedURLException ee) + } + else if (actionCommand.equals("show_graph")) + { + showFunctionalityNotAvailableYet("Show daily graph"); + // DailyGraphDialog dgd = new DailyGraphDialog(getMyParent(), + // dailyStats.getDayData()); + // dgd.setDailyValues(dailyStats.getDayData()); + } + else if (actionCommand.equals("read_meter")) + { + executePluginAction(GGCPluginType.MeterToolPlugin, e, "meters_read"); + } + else if (actionCommand.equals("read_pump")) + { + if (dataAccess.isPluginAvailable(GGCPluginType.MeterToolPlugin)) { - System.out.println("Problem with HelpSet path: " + help_url + "\n" + ee); + dataAccess.getPlugIn(GGCPluginType.MeterToolPlugin) + .actionPerformed(new ActionEvent(this, e.getID() + 1, "meters_read")); } - HelpBroker main_help_broker = null; - - if (main_help_set != null) - { - // System.out.println("Help: Main Help Set present, creating - // broker"); - main_help_broker = main_help_set.createHelpBroker(); - } - - CSH.DisplayHelpFromSource csh = null; - - if (main_help_broker != null) - { - // CSH.DisplayHelpFromSource is a convenience class to display - // the helpset - csh = new CSH.DisplayHelpFromSource(main_help_broker); - - if (csh != null) - { - // listen to ActionEvents from the helpItem - hc.getHelpItem().addActionListener(csh); - } - } - - hc.setDisplayHelpFromSourceInstance(csh); - hc.setMainHelpBroker(main_help_broker); - hc.setMainHelpSet(main_help_set); - - CSH.trackCSEvents(); - + showFunctionalityNotAvailableYet("Read Pump"); + // ReadMeterDialog.showMe(MainFrame.this); } - - } - - - private boolean checkDateSame() - { - if (m_db == null) + else if (actionCommand.equals("read_cgms")) { - this.m_db = m_da.getDb(); + showFunctionalityNotAvailableYet("Read CGMS"); + // ReadMeterDialog.showMe(MainFrame.this); } - - if (!m_da.isSameDay(this.gc_current, new GregorianCalendar())) + else if (actionCommand.equals("hlp_about")) { - // not same date - JOptionPane.showMessageDialog(getMyParent(), m_ic.getMessage("CURRENT_DATE_HAS_CHANGED"), - m_ic.getMessage("ERROR"), JOptionPane.ERROR_MESSAGE); - - this.dailyStats.refreshInfo(); - - return false; + // FIX This + new AboutGGCDialog(getMyParent()); + // JOptionPane.showMessageDialog(null, + // "GNU Gluco Control v0.0.1", "About GGC", + // JOptionPane.INFORMATION_MESSAGE); } else - return true; + { + System.out.println("GGCLittle:Unknown Command: " + actionCommand); + } } - // Window Listener - - /** - */ - public void windowDeactivated(WindowEvent e) + private void executePluginAction(GGCPluginType pluginType, ActionEvent e, String actionCommand) { - } + if (dataAccess.isPluginAvailable(pluginType)) + { + dataAccess.getPlugIn(pluginType).actionPerformed(new ActionEvent(this, e.getID(), actionCommand)); + } - - /** - */ - public void windowActivated(java.awt.event.WindowEvent e) - { } - /** - */ - public void windowDeiconified(java.awt.event.WindowEvent e) + private void showFunctionalityNotAvailableYet(String functionality) { + dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, + functionality + " is not working in this application yet. Please use full version of GGC instead."); } - /** - */ - public void windowIconified(java.awt.event.WindowEvent e) + private boolean checkIfPumpAndDisplayError(String errorDescriptionTarget) { - } - - - /** - */ - public void windowClosed(java.awt.event.WindowEvent e) - { - } - - - /** - */ - public void windowOpened(java.awt.event.WindowEvent e) - { - } - - - /** - * Window Closing Event - * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent) - */ - public void windowClosing(WindowEvent e) - { - close(); - } - - - /** - * actionPerformed - */ - public void actionPerformed(ActionEvent e) - { - - String action = e.getActionCommand(); - - if (action.equals("show_app")) + if (dataAccess.isPumpMode()) { - if (is_visible) - { - this.toFront(); - } - else - { - this.setVisible(true); - } + dataAccess.showMessageDialog(this, ATSwingUtils.DialogType.Error, + errorDescriptionTarget + " for Pump is not working in this application yet. Please use GGC instead."); + return true; } - else if (action.equals("hide_app")) - { - is_visible = false; - this.setVisible(false); - } - else if (action.equals("exit_app")) - { - close(); - } - else - { - System.out.println("Action: " + action); - } - + return false; } @@ -803,4 +636,59 @@ } + + public void update(Observable obj, Object arg) + { + // System.out.println("!!!! update app: " + + // this.getClass().getSimpleName() + " - " + arg); + + if (arg instanceof RefreshInfoType) + { + RefreshInfoType refreshInfoType = (RefreshInfoType) arg; + + // if (!title_set) + // { + // if (refreshInfoType.getCode() >= + // RefreshInfoType.GeneralInfo.getCode()) + // { + // title_set = true; + // this.setSoftwareMode(); + // } + // } + + // Integer i = (Integer)arg; + + // this.setSoftwareMode(); + // this.setTitle(); + + } + else if (arg instanceof DatabaseStatusType) + { + // DatabaseStatusType databaseStatusType = (DatabaseStatusType) arg; + // + // setMenusByDbLoad(databaseStatusType.getCode()); + // + // if (databaseStatusType == DatabaseStatusType.Loaded) + // { + // refreshMenus(); + // } + } + else if (arg instanceof Exception) + { + Exception ex = (Exception) arg; + LOG.error("Error connecting to Database: " + ex.getMessage(), ex); + + dataAccess.createErrorDialog("Main", "Opening Db", ex, guiHelper.getDbSettingsAndCause(false), // + guiHelper.getDbSettingsAndCause(true), // + i18nControl.getMessage("DB_PROBLEM_NOT_CONNECTED_SOLUTION"), // + i18nControl.getMessage("DB_PROBLEM_NOT_CONNECTED_SOLUTION_TOOLTIP")); + + System.exit(1); + } + else + { + LOG.error("Unallowed update type ({}) - {}.", arg.getClass().getSimpleName(), arg); + } + + } } Modified: trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/StatusBarL.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/little/StatusBarL.java 2016-12-26 14:02:38 UTC (rev 1456) +++ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/StatusBarL.java 2017-06-28 19:09:37 UTC (rev 1463) @@ -5,9 +5,12 @@ import javax.swing.*; +import com.atech.graphics.observe.EventObserverInterface; import com.atech.i18n.I18nControlAbstract; -import com.atech.misc.refresh.EventObserverInterface; import com.atech.utils.ATSwingUtils; + +import ggc.core.data.defs.DatabaseStatusType; +import ggc.core.data.defs.GGCObservableType; import ggc.core.util.DataAccess; /** @@ -96,7 +99,7 @@ add(lblMessage, BorderLayout.WEST); add(pan, BorderLayout.EAST); - da.addObserver(DataAccess.OBSERVABLE_STATUS, this); + da.getObserverManager().addObserver(GGCObservableType.Status, this); } @@ -156,10 +159,14 @@ */ public void update(Observable obj, Object arg) { - if (arg instanceof Integer) + System.out.println("!!!! update Status: " + this.getClass().getSimpleName() + " - " + arg); + + System.out.println("Status update: " + arg); + + if (arg instanceof DatabaseStatusType) { - Integer i = (Integer) arg; - this.setDbStatus(i.intValue()); + DatabaseStatusType databaseStatusType = (DatabaseStatusType) arg; + this.setDbStatus(databaseStatusType.getCode()); } else { Copied: trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/data/DailyStatsTableLittleModel.java (from rev 1456, trunk/ggc-core-app/ggc-core/src/main/java/ggc/core/data/DailyStatsTableModel.java) =================================================================== --- trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/data/DailyStatsTableLittleModel.java (rev 0) +++ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/data/DailyStatsTableLittleModel.java 2017-06-28 19:09:37 UTC (rev 1463) @@ -0,0 +1,112 @@ +package ggc.gui.little.data; + +import javax.swing.table.AbstractTableModel; + +import ggc.core.data.DailyValues; +import ggc.core.data.DataValuesInterface; + +/** + * 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: DailyStatsTableModel + * Description: A TableModel for the DailyStats-Table. It is the bridge between + * the table and the data behind it in the DailyValues Class. + * + * Author: schultd + * Andy {an...@at...} + */ + +public class DailyStatsTableLittleModel extends AbstractTableModel +{ + + private static final long serialVersionUID = -8281136305573121781L; + + DailyValues dayDataPen; + + DataValuesInterface data; + + + public DailyStatsTableLittleModel() + { + } + + + // public DailyValues getDailyValuesPen() + // { + // return this.dayDataPen; + // } + + public void setDataValues(DataValuesInterface dayData) + { + this.data = dayData; + fireTableChanged(null); + } + + + public int getColumnCount() + { + if (data == null) + return 0; + + return data.getColumnCount(); + } + + + public int getRowCount() + { + if (data == null) + return 0; + + return data.getRowCount(); + } + + + public Object getValueAt(int row, int column) + { + if (data == null) + return null; + + return data.getValueAt(row, column); + } + + + @Override + public String getColumnName(int column) + { + if (data == null) + return null; + + return data.getColumnName(column); + } + + + @Override + public Class<?> getColumnClass(int c) + { + return String.class; + } + + + @Override + public boolean isCellEditable(int row, int col) + { + return false; + } + +} Modified: trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/DailyStatsControlsL.java =================================================================== --- trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/little/panels/DailyStatsControlsL.java 2016-12-26 14:02:38 UTC (rev 1456) +++ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/DailyStatsControlsL.java 2017-06-28 19:09:37 UTC (rev 1463) @@ -3,7 +3,8 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.Map; import javax.swing.*; @@ -12,7 +13,7 @@ import ggc.gui.little.GGCLittle; import ggc.gui.main.panels.AbstractInfoPanel; import ggc.gui.main.panels.InfoPanelType; -import ggc.gui.pen.DailyRowDialog; +import info.clearthought.layout.TableLayout; /** * Application: GGC - GNU Gluco Control @@ -45,8 +46,9 @@ private static final long serialVersionUID = -3682024667811580299L; GGCLittle m_little = null; JButton[] buttons = new JButton[4]; - MainLittlePanel m_mlp; - GregorianCalendar m_gc = null; + // MainLittlePanel m_mlp; + // GregorianCalendar m_gc = null; + Map<String, JButton> buttonMap = new HashMap<String, JButton>(); // private I18nControlAbstract i18nControl = @@ -60,8 +62,8 @@ public DailyStatsControlsL(MainLittlePanel mlp) { super(""); - m_mlp = mlp; - m_gc = new GregorianCalendar(); + m_little = mlp.getApplication(); + // m_gc = new GregorianCalendar(); init(); } @@ -69,14 +71,33 @@ private void init() { - this.setLayout(new GridLayout(2, 2)); + double sizes[][] = { { 0.50, 0.50 }, { 0.25, 0.25, 0.25, 0.25 }, }; + + setLayout(new TableLayout(sizes)); + + // add(new JLabel(i18nControl.getMessage(i18nKey) + ":"), "1, " + + // currentLine); + + addButton("ADD_ROW", "add_entry", "0,0"); + addButton("EDIT_ROW", "edit_entry", "1,0"); + addButton("DELETE_ROW", "delete_entry", "0,1"); + addButton("SHOW_DAILY_GRAPH", "show_graph", "1,1"); + addButton("READ_METER", "read_meter", "0,2"); + addButton("READ_PUMP", "read_pump", "1,2"); + addButton("READ_CGMS", "read_cgms", "0,3"); + addButton("MN_HELP", "hlp_help", "1,3"); + + if (true) + return; + + this.setLayout(new GridLayout(4, 2)); setBorder(BorderFactory.createTitledBorder( DataAccess.getInstance().getI18nControlInstance().getMessage("DAILY_CONTROL") + ":")); - Dimension dim = new Dimension(120, 20); + // Dimension dim = new Dimension(120, 20); - JButton button = new JButton(m_ic.getMessage("SHOW_DAILY_GRAPH")); - button.setPreferredSize(dim); + JButton button = new JButton(i18nControl.getMessage("SHOW_DAILY_GRAPH")); + // button.setPreferredSize(dim); button.setActionCommand("show_daily_graph"); button.addActionListener(this); button.setEnabled(false); @@ -83,8 +104,8 @@ buttons[0] = button; this.add(button); - button = new JButton(m_ic.getMessage("ADD_ROW")); - button.setPreferredSize(dim); + button = new JButton(i18nControl.getMessage("ADD_ROW")); + // button.setPreferredSize(dim); button.setActionCommand("add_row"); button.addActionListener(this); button.setEnabled(false); @@ -91,8 +112,8 @@ buttons[1] = button; this.add(button); - button = new JButton(m_ic.getMessage("EDIT_ROW")); - button.setPreferredSize(dim); + button = new JButton(i18nControl.getMessage("EDIT_ROW")); + // button.setPreferredSize(dim); button.setActionCommand("edit_row"); button.addActionListener(this); button.setEnabled(false); @@ -99,8 +120,8 @@ buttons[2] = button; this.add(button); - button = new JButton(m_ic.getMessage("DELETE_ROW")); - button.setPreferredSize(dim); + button = new JButton(i18nControl.getMessage("DELETE_ROW")); + // button.setPreferredSize(dim); button.setActionCommand("delete_row"); button.addActionListener(this); button.setEnabled(false); @@ -111,6 +132,21 @@ } + private void addButton(String key, String actionCommand, String position) + { + JButton button = new JButton(i18nControl.getMessage(key)); + // button.setPreferredSize(dim); + button.setActionCommand(actionCommand); + button.addActionListener(this.m_little); + button.setEnabled(false); + // buttons[3] = button; + + buttonMap.put(actionCommand, button); + + add(button, position); + } + + /** * Refresh Information */ @@ -117,8 +153,10 @@ @Override public void refreshInfo() { - boolean start = m_da.getDb().isDbStarted(); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!! refreshInfo: DailyStats"); + boolean start = dataAccess.getDb().isDbStarted(); + for (JButton button : this.buttons) { button.setEnabled(start); @@ -133,17 +171,16 @@ } - /** - * Get Table - * - * @return - */ - public JTable getTable() - { - return this.m_mlp.dailyStats.getTable(); - } + // /** + // * Get Table + // * + // * @return + // */ + // public JTable getTable() + // { + // return this.m_mlp.dailyStats.getTable(); + // } - /** * Get Day Data * @@ -151,32 +188,32 @@ */ public DailyValues getDayData() { - return this.m_mlp.dailyStats.getTableModel().getDailyValues(); + // FIXME + return null; + // return this.m_mlp.dailyStats.getTableModel().getDailyValues(); } + // /** + // * Reload Table + // */ + // public void reloadTable() + // { + // // dataAccess.getDayStats(new GregorianCalendar()); + // dataAccess.loadDailySettingsLittle(m_gc, true); + // this.m_mlp.dailyStats.getTableModel().setDataValues(dataAccess.getDayStats(m_gc)); + // } - /** - * Reload Table - */ - public void reloadTable() - { - // dataAccess.getDayStats(new GregorianCalendar()); - m_da.loadDailySettingsLittle(m_gc, true); - this.m_mlp.dailyStats.getTableModel().setDailyValues(m_da.getDayStats(m_gc)); - } + // /** + // * Get Frame + // * @return + // */ + // public JFrame getFrame() + // { + // return this.m_mlp.m_little; + // } /** - * Get Frame - * @return - */ - public JFrame getFrame() - { - return this.m_mlp.m_little; - } - - - /** * Action Performed * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) @@ -184,76 +221,79 @@ public void actionPerformed(ActionEvent e) { - String command = e.getActionCommand(); - - if (command.equals("add_row")) - { - DailyValues dv = getDayData(); - - DailyRowDialog aRF = new DailyRowDialog(dv, m_da.getCurrentDateString(), getFrame()); - - if (aRF.actionSuccessful()) - { - m_da.getDb().saveDayStats(dv); - reloadTable(); - } - } - else if (command.equals("edit_row")) - { - int srow = getTable().getSelectedRow(); - - if (srow == -1) - { - JOptionPane.showMessageDialog(this, m_ic.getMessage("SELECT_ROW_FIRST"), m_ic.getMessage("ERROR"), - JOptionPane.ERROR_MESSAGE); - return; - } - - DailyValues dv = getDayData(); - - DailyRowDialog aRF = new DailyRowDialog(dv.getRow(srow), getFrame()); - - if (aRF.actionSuccessful()) - { - m_da.getDb().saveDayStats(dv); - reloadTable(); - } - - } - else if (command.equals("delete_row")) - { - int srow = getTable().getSelectedRow(); - - if (srow == -1) - { - JOptionPane.showMessageDialog(this, m_ic.getMessage("SELECT_ROW_FIRST"), m_ic.getMessage("ERROR"), - JOptionPane.ERROR_MESSAGE); - return; - } - - try - { - DailyValues dv = getDayData(); - - dv.deleteRow(srow); - - m_da.getDb().saveDayStats(dv); - reloadTable(); - } - catch (Exception ex) - { - System.out.println("DailyStatsDialog:Action:Delete Row: " + ex); - } - } - else if (command.equals("show_daily_graph")) - { - // DailyGraphDialog dgd = new DailyGraphDialog(m_mlp.m_little); - // dgd.setDailyValues(getDayData()); - } - else - { - System.out.println("DailyStatsDialog:Unknown Action: " + command); - } + // String command = e.getActionCommand(); + // + // if (command.equals("add_row")) + // { + // DailyValues dv = getDayData(); + // + // DailyRowDialog aRF = new DailyRowDialog(dv, + // dataAccess.getCurrentDateString(), getFrame()); + // + // if (aRF.actionSuccessful()) + // { + // dataAccess.getDb().saveDayStats(dv); + // reloadTable(); + // } + // } + // else if (command.equals("edit_row")) + // { + // int srow = getTable().getSelectedRow(); + // + // if (srow == -1) + // { + // JOptionPane.showMessageDialog(this, + // i18nControl.getMessage("SELECT_ROW_FIRST"), + // i18nControl.getMessage("ERROR"), JOptionPane.ERROR_MESSAGE); + // return; + // } + // + // DailyValues dv = getDayData(); + // + // DailyRowDialog aRF = new DailyRowDialog(dv.getRow(srow), getFrame()); + // + // if (aRF.actionSuccessful()) + // { + // dataAccess.getDb().saveDayStats(dv); + // reloadTable(); + // } + // + // } + // else if (command.equals("delete_row")) + // { + // int srow = getTable().getSelectedRow(); + // + // if (srow == -1) + // { + // JOptionPane.showMessageDialog(this, + // i18nControl.getMessage("SELECT_ROW_FIRST"), + // i18nControl.getMessage("ERROR"), JOptionPane.ERROR_MESSAGE); + // return; + // } + // + // try + // { + // DailyValues dv = getDayData(); + // + // dv.deleteRow(srow); + // + // dataAccess.getDb().saveDayStats(dv); + // reloadTable(); + // } + // catch (Exception ex) + // { + // System.out.println("DailyStatsDialog:Action:Delete Row: " + ex); + // } + // } + // else if (command.equals("show_daily_graph")) + // { + // // DailyGraphDialog dgd = new DailyGraphDialog(m_mlp.m_little); + // // dgd.setDailyValues(getDayData()); + // } + // else + // { + // System.out.println("DailyStatsDialog:Unknown Action: " + command); + // } } /* @@ -285,6 +325,13 @@ @Override public void doRefresh() { + System.out.println("!!!!!!!!!!!!!!!!!!!!!!! doRefresh: DailyStats"); + + for (JButton button : buttonMap.values()) + { + button.setEnabled(true); + } + } } Copied: trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/DailyStatsListPanelL.java (from rev 1456, trunk/ggc-desktop-app/ggc-desktop/src/main/java/ggc/gui/little/panels/DailyStatsPanelL.java) =================================================================== --- trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/DailyStatsListPanelL.java (rev 0) +++ trunk/ggc-desktop-app/ggc-desktop-little/src/main/java/ggc/gui/little/panels/DailyStatsListPanelL.java 2017-06-28 19:09:37 UTC (rev 1463) @@ -0,0 +1,174 @@ +package ggc.gui.little.panels; + +import java.awt.*; +import java.util.GregorianCalendar; + +import javax.swing.*; +import javax.swing.border.TitledBorder; + +import ggc.core.data.DailyValues; +import ggc.gui.little.data.DailyStatsTableLittleModel; +import ggc.gui.main.panels.AbstractInfoPanel; +import ggc.gui.main.panels.InfoPanelType; + +/** + * 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: DailyStatsPanelL + * Description: Panel for Daily Stats + * + * Author: andyrozman {an...@at...} + */ + +public class DailyStatsListPanelL extends AbstractInfoPanel +{ + + private static final long serialVersionUID = 3519092324025060409L; + private DailyStatsTableLittleModel model = null; + JScrollPane resultsPane; + private JTable table; + private DailyValues dayData; + + + /** + * Constructor + */ + public DailyStatsListPanelL() + { + super(null); + + setTitle(i18nControl.getMessage("DAILY_VALUES") + ": (" + dataAccess.getCurrentDateString() + ")"); + init(); + } + + + public void setTitle(String title) + { + TitledBorder titledBorder = (TitledBorder) this.getBorder(); + titledBorder.setTitle(title); + } + + + /** + * Get Table Model + * + * @return + */ + public DailyStatsTableLittleModel getTableModel() + { + return model; + } + + + /** + * Refresh Information + */ + @Override + public void refreshInfo() + { + refreshDayData(); + } + + + @Override + public InfoPanelType getPanelType() + { + return InfoPanelType.DailyValuesList; + } + + + /** + * Get Table + * + * @return + */ + public JTable getTable() + { + return this.table; + } + + + /** + * Get Day Data + * + * @return + */ + public DailyValues getDayData() + { + return this.dayData; + } + + + private void refreshDayData() + { + DailyValues dv = dataAccess.getDayStats(new GregorianCalendar()); + + if (dv != null) + { + dayData = dv; + model.setDataValues(dayData); + this.model.fireTableChanged(null); + } + } + + + private void init() + { + this.setLayout(new GridLayout(1, 1)); + + dayData = dataAccess.getDayStats(new GregorianCalendar()); + + // if (dayData==null) + // dayData = DataAccess.getInstance().getDayStats(new + // GregorianCalendar()); + // refreshDayData(); + + System.out.println("DailyStatPa... [truncated message content] |
From: <and...@us...> - 2017-06-28 19:00:31
|
Revision: 1462 http://sourceforge.net/p/ggc/code/1462 Author: andyrozman Date: 2017-06-28 19:00:28 +0000 (Wed, 28 Jun 2017) Log Message: ----------- 1.5.3 [26.6.2017] - changed enums, so that translation are changed from withing DataAccess - refactorings - changes to Db Objects Modified Paths: -------------- trunk/ggc-plugins/ggc-cgms/doc/Changelog trunk/ggc-plugins/ggc-cgms/pom.xml trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSDataReader.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSValuesEntry.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSValuesExtendedEntry.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/CGMSData.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/CGMSDataExtended.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/GGC_CGMSDb.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSAlarms.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSBaseDataType.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSConfigurationGroup.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSErrors.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSEvents.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/CGMSPluginDefinition.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceDefinition.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceHandler.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/animas/AnimasCGMSHandler.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/animas/impl/AnimasCGMSDeviceReader.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/dexcom/DexcomHandler.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/MinimedCGMSDeviceHandler.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed522CGMSDataConverter.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed523CGMSDataConverter.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/gui/viewer/CGMSDataDialog.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/util/CGMSUtil.java trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/util/DataAccessCGMS.java Added Paths: ----------- trunk/ggc-plugins/ggc-cgms/src/main/templates/ trunk/ggc-plugins/ggc-cgms/src/main/templates/Version.java.template Modified: trunk/ggc-plugins/ggc-cgms/doc/Changelog =================================================================== --- trunk/ggc-plugins/ggc-cgms/doc/Changelog 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/doc/Changelog 2017-06-28 19:00:28 UTC (rev 1462) @@ -4,6 +4,12 @@ -- We will move to version 2.0, when Minimed is supported (Navigator 1.x or 2.x) +1.5.3 [26.6.2017] +- changed enums, so that translation are changed from withing DataAccess +- refactorings +- changes to Db Objects + + 1.5.2 [25.12.2016] [Andy] - Db changes - added new Extended Type Modified: trunk/ggc-plugins/ggc-cgms/pom.xml =================================================================== --- trunk/ggc-plugins/ggc-cgms/pom.xml 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/pom.xml 2017-06-28 19:00:28 UTC (rev 1462) @@ -13,7 +13,36 @@ <artifactId>ggc-cgms-tool</artifactId> <version>${ggc-cgms-tool.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/cgms/defs/</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + + + + </plugins> + </build> + <dependencies> <dependency> <groupId>net.sf.ggc</groupId> @@ -43,9 +72,9 @@ </dependencies> <properties> + <version.file> + ${project.build.directory}/generated-sources/ggc/cgms/defs/Version.java + </version.file> + </properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - - </properties> </project> Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSDataReader.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSDataReader.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSDataReader.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -65,7 +65,7 @@ { // DataAccessCGMS.notImplemented("CGMSDataReader::getMaxEntries()"); db = m_da.getDb(); - this.all_entries = db.getAllElementsCount(); + this.allEntries = db.getAllElementsCount(); } @@ -114,7 +114,7 @@ float proc_total = (proc * 1.0f + db_reading) / 120.0f * 100.0f; int proc_total_i = (int) proc_total; - this.m_drr.setOldDataReadingProgress(proc_total_i); + this.deviceReaderRunner.setOldDataReadingProgress(proc_total_i); /* * try Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSValuesEntry.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSValuesEntry.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSValuesEntry.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -88,10 +88,10 @@ super(); list = new ArrayList<CGMSValuesSubEntry>(); this.id = pdh.getId(); - this.datetime = pdh.getDt_info(); - this.type = pdh.getBase_type(); + this.datetime = pdh.getDtInfo(); + this.type = pdh.getBaseType(); loadExtended(pdh.getExtended()); - this.person_id = pdh.getPerson_id(); + this.person_id = pdh.getPersonId(); } @@ -310,33 +310,33 @@ { switch (index) { - /* - * case 0: // time - * { - * return this.datetime.getTimeString(); - * } - * case 1: // type - * { - * return getBaseTypeString(); - * } - * case 2: // subtype - * { - * return getSubTypeString(); - * } - * case 3: // value - * { - * //return this.getCode(); - * return getValuePrint(); - * } - * case 4: // additional - * { - * return this.getAdditionalDisplay(); - * } - * case 5: // food - * { - * return this.isFoodSet(); - * } - */ + /* + * case 0: // time + * { + * return this.datetime.getTimeString(); + * } + * case 1: // type + * { + * return getBaseTypeString(); + * } + * case 2: // subtype + * { + * return getSubTypeString(); + * } + * case 3: // value + * { + * //return this.getCode(); + * return getValuePrint(); + * } + * case 4: // additional + * { + * return this.getAdditionalDisplay(); + * } + * case 5: // food + * { + * return this.isFoodSet(); + * } + */ } return "N/A"; } @@ -538,10 +538,10 @@ CGMSDataH pdh = new CGMSDataH(); pdh.setId(this.id); - pdh.setDt_info(this.datetime); - pdh.setBase_type(this.type); + pdh.setDtInfo(this.datetime); + pdh.setBaseType(this.type); pdh.setExtended(extended = this.saveExtended()); - pdh.setPerson_id(this.person_id); + pdh.setPersonId(this.person_id); pdh.setChanged(System.currentTimeMillis()); Long _id = (Long) sess.save(pdh); @@ -573,9 +573,9 @@ CGMSDataH pdh = (CGMSDataH) sess.get(CGMSDataH.class, this.id); pdh.setId(this.id); - pdh.setBase_type(this.type); + pdh.setBaseType(this.type); pdh.setExtended(this.extended = saveExtended()); - pdh.setPerson_id(this.person_id); + pdh.setPersonId(this.person_id); pdh.setChanged(System.currentTimeMillis()); sess.update(pdh); @@ -630,10 +630,10 @@ CGMSDataH pdh = (CGMSDataH) sess.get(CGMSDataH.class, this.id); this.id = pdh.getId(); - this.datetime = pdh.getDt_info(); - this.type = pdh.getBase_type(); + this.datetime = pdh.getDtInfo(); + this.type = pdh.getBaseType(); loadExtended(pdh.getExtended()); - this.person_id = pdh.getPerson_id(); + this.person_id = pdh.getPersonId(); return true; } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSValuesExtendedEntry.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSValuesExtendedEntry.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/CGMSValuesExtendedEntry.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -84,11 +84,11 @@ { this.id = pdh.getId(); - this.datetime = pdh.getDt_info(); + this.datetime = pdh.getDtInfo(); this.type = CGMSExtendedDataType.getEnum(pdh.getType()); this.value = pdh.getValue(); loadExtended(pdh.getExtended()); - this.personId = pdh.getPerson_id(); + this.personId = pdh.getPersonId(); this.comment = pdh.getComment(); } @@ -288,11 +288,11 @@ { this.personId = CGMSUtil.getCurrentUserId(); - ch.setDt_info(this.datetime); + ch.setDtInfo(this.datetime); ch.setType(this.type.getValue()); ch.setValue(this.getValue()); ch.setExtended(extended = this.saveExtended()); - ch.setPerson_id(this.personId); + ch.setPersonId(this.personId); ch.setComment(this.comment); ch.setChanged(System.currentTimeMillis()); } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/CGMSData.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/CGMSData.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/CGMSData.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -72,12 +72,12 @@ public CGMSData(CGMSDataH ch) { this.setId(ch.getId()); - this.setDt_info(ch.getDt_info()); - this.setBase_type(ch.getBase_type()); - this.setSub_type(ch.getSub_type()); + this.setDtInfo(ch.getDtInfo()); + this.setBaseType(ch.getBaseType()); + this.setSubType(ch.getSubType()); this.setValue(ch.getValue()); this.setExtended(ch.getExtended()); - this.setPerson_id(ch.getPerson_id()); + this.setPersonId(ch.getPersonId()); this.setComment(ch.getComment()); this.setChanged(ch.getChanged()); } @@ -92,12 +92,12 @@ { // FIXME this.setId(0L); - this.setDt_info(pve.getDateTime()); - // this.setBase_type(pve.getBaseType()); - // this.setSub_type(pve.getSubType()); + this.setDtInfo(pve.getDateTime()); + // this.setBaseType(pve.getBaseType()); + // this.setSubType(pve.getSubType()); this.setValue(pve.getValue()); this.setExtended(""); - this.setPerson_id((int) DataAccessCGMS.getInstance().getCurrentUserId()); + this.setPersonId((int) DataAccessCGMS.getInstance().getCurrentUserId()); // this.setComment(pve.getComment()); this.setChanged(System.currentTimeMillis()); } @@ -223,12 +223,12 @@ CGMSDataH ch = new CGMSDataH(); ch.setId(this.getId()); - ch.setDt_info(this.getDt_info()); - ch.setBase_type(this.getBase_type()); - ch.setSub_type(this.getSub_type()); + ch.setDtInfo(this.getDtInfo()); + ch.setBaseType(this.getBaseType()); + ch.setSubType(this.getSubType()); ch.setValue(this.getValue()); ch.setExtended(this.getExtended()); - ch.setPerson_id(this.getPerson_id()); + ch.setPersonId(this.getPersonId()); ch.setComment(this.getComment()); ch.setChanged(System.currentTimeMillis()); @@ -274,12 +274,12 @@ CGMSDataH ch = (CGMSDataH) sess.get(CGMSDataH.class, new Long(this.getId())); ch.setId(this.getId()); - ch.setDt_info(this.getDt_info()); - ch.setBase_type(this.getBase_type()); - ch.setSub_type(this.getSub_type()); + ch.setDtInfo(this.getDtInfo()); + ch.setBaseType(this.getBaseType()); + ch.setSubType(this.getSubType()); ch.setValue(this.getValue()); ch.setExtended(this.getExtended()); - ch.setPerson_id(this.getPerson_id()); + ch.setPersonId(this.getPersonId()); ch.setComment(this.getComment()); ch.setChanged(System.currentTimeMillis()); @@ -302,12 +302,12 @@ CGMSDataH ch = (CGMSDataH) sess.get(CGMSDataH.class, new Long(this.getId())); this.setId(ch.getId()); - this.setDt_info(ch.getDt_info()); - this.setBase_type(ch.getBase_type()); - this.setSub_type(ch.getSub_type()); + this.setDtInfo(ch.getDtInfo()); + this.setBaseType(ch.getBaseType()); + this.setSubType(ch.getSubType()); this.setValue(ch.getValue()); this.setExtended(ch.getExtended()); - this.setPerson_id(ch.getPerson_id()); + this.setPersonId(ch.getPersonId()); this.setComment(ch.getComment()); this.setChanged(ch.getChanged()); @@ -367,17 +367,17 @@ sb.append(this.getId()); sb.append("|"); - sb.append(this.getDt_info()); + sb.append(this.getDtInfo()); sb.append("|"); - sb.append(this.getBase_type()); + sb.append(this.getBaseType()); sb.append("|"); - sb.append(this.getSub_type()); + sb.append(this.getSubType()); sb.append("|"); sb.append(this.getValue()); sb.append("|"); sb.append(this.getExtended()); sb.append("|"); - sb.append(this.getPerson_id()); + sb.append(this.getPersonId()); sb.append("|"); sb.append(this.getComment()); sb.append("|"); @@ -444,12 +444,12 @@ String[] arr = da.splitString(value_entry, "|"); this.setId(da.getLongValueFromString(arr[0])); - this.setDt_info(da.getLongValueFromString(arr[1])); - this.setBase_type(da.getIntValueFromString(arr[2])); - this.setSub_type(da.getIntValueFromString(arr[3])); + this.setDtInfo(da.getLongValueFromString(arr[1])); + this.setBaseType(da.getIntValueFromString(arr[2])); + this.setSubType(da.getIntValueFromString(arr[3])); this.setValue(arr[4]); this.setExtended(arr[5]); - this.setPerson_id(da.getIntValueFromString(arr[6])); + this.setPersonId(da.getIntValueFromString(arr[6])); this.setComment(arr[7]); this.setChanged(da.getLongValueFromString(arr[8])); Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/CGMSDataExtended.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/CGMSDataExtended.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/CGMSDataExtended.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -71,11 +71,11 @@ public CGMSDataExtended(CGMSDataExtendedH ch) { this.setId(ch.getId()); - this.setDt_info(ch.getDt_info()); + this.setDtInfo(ch.getDtInfo()); this.setType(ch.getType()); this.setValue(ch.getValue()); this.setExtended(ch.getExtended()); - this.setPerson_id(ch.getPerson_id()); + this.setPersonId(ch.getPersonId()); this.setComment(ch.getComment()); this.setChanged(ch.getChanged()); } @@ -201,11 +201,11 @@ CGMSDataExtendedH ch = new CGMSDataExtendedH(); ch.setId(this.getId()); - ch.setDt_info(this.getDt_info()); + ch.setDtInfo(this.getDtInfo()); ch.setType(this.getType()); ch.setValue(this.getValue()); ch.setExtended(this.getExtended()); - ch.setPerson_id(this.getPerson_id()); + ch.setPersonId(this.getPersonId()); ch.setComment(this.getComment()); ch.setChanged(System.currentTimeMillis()); @@ -252,11 +252,11 @@ CGMSDataExtendedH ch = (CGMSDataExtendedH) sess.get(CGMSDataExtendedH.class, new Long(this.getId())); ch.setId(this.getId()); - ch.setDt_info(this.getDt_info()); + ch.setDtInfo(this.getDtInfo()); ch.setType(this.getType()); ch.setValue(this.getValue()); ch.setExtended(this.getExtended()); - ch.setPerson_id(this.getPerson_id()); + ch.setPersonId(this.getPersonId()); ch.setComment(this.getComment()); ch.setChanged(System.currentTimeMillis()); @@ -280,11 +280,11 @@ CGMSDataExtendedH ch = (CGMSDataExtendedH) sess.get(CGMSDataExtendedH.class, new Long(this.getId())); this.setId(ch.getId()); - this.setDt_info(ch.getDt_info()); + this.setDtInfo(ch.getDtInfo()); this.setType(ch.getType()); this.setValue(ch.getValue()); this.setExtended(ch.getExtended()); - this.setPerson_id(ch.getPerson_id()); + this.setPersonId(ch.getPersonId()); this.setComment(ch.getComment()); this.setChanged(ch.getChanged()); @@ -344,7 +344,7 @@ sb.append(this.getId()); sb.append("|"); - sb.append(this.getDt_info()); + sb.append(this.getDtInfo()); sb.append("|"); sb.append(this.getType()); sb.append("|"); @@ -352,7 +352,7 @@ sb.append("|"); sb.append(this.getExtended()); sb.append("|"); - sb.append(this.getPerson_id()); + sb.append(this.getPersonId()); sb.append("|"); sb.append(this.getComment()); sb.append("|"); @@ -419,11 +419,11 @@ String[] arr = da.splitString(value_entry, "|"); this.setId(da.getLongValueFromString(arr[0])); - this.setDt_info(da.getLongValueFromString(arr[1])); + this.setDtInfo(da.getLongValueFromString(arr[1])); this.setType(da.getIntValueFromString(arr[2])); this.setValue(arr[3]); this.setExtended(arr[4]); - this.setPerson_id(da.getIntValueFromString(arr[5])); + this.setPersonId(da.getIntValueFromString(arr[5])); this.setComment(arr[6]); this.setChanged(da.getLongValueFromString(arr[7])); } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/GGC_CGMSDb.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/GGC_CGMSDb.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/db/GGC_CGMSDb.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -1,12 +1,12 @@ package ggc.cgms.data.db; +import java.util.Arrays; import java.util.GregorianCalendar; import java.util.Hashtable; -import java.util.Iterator; import java.util.List; import org.hibernate.Criteria; -import org.hibernate.Query; +import org.hibernate.criterion.Order; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.slf4j.Logger; @@ -49,8 +49,8 @@ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * - * Filename: ###---### - * Description: + * Filename: GGC_CGMSDb + * Description: CGMS database handler * * Author: Andy {an...@at...} */ @@ -59,7 +59,6 @@ { private static final Logger LOG = LoggerFactory.getLogger(GGC_CGMSDb.class); - DataAccessCGMS m_da = DataAccessCGMS.getInstance(); /** @@ -69,8 +68,8 @@ */ public GGC_CGMSDb(HibernateDb db) { - super(db); - LOG.debug("Created CGMSDb"); + super(db, DataAccessCGMS.getInstance()); + // LOG.debug("Created CGMSDb"); // getAllElementsCount(); } @@ -88,7 +87,7 @@ long dt = ATechDate.getATDateTimeFromGC(gc, ATechDateType.DateOnly); // long dt = 20070323; - DeviceValuesDay dV = new DeviceValuesDay(m_da); + DeviceValuesDay dV = new DeviceValuesDay(dataAccess); dV.setDateTimeGC(gc); String sql = ""; @@ -95,19 +94,15 @@ try { - sql = "SELECT dv from ggc.core.db.hibernate.cgms.CGMSDataH as dv WHERE dv.dt_info = " + dt - + " ORDER BY dv.dt_info "; - // + "000000 AND dv.dt_info <= " + dt + - // "235959 ORDER BY dv.dt_info"; + List<CGMSDataH> dataList = getHibernateData(CGMSDataH.class, // + Arrays.asList( // + Restrictions.eq("personId", this.dataAccess.getCurrentUserId()), // + Restrictions.eq("dtInfo", dt)) // + , Arrays.asList(Order.asc("dtInfo"))); - Query q = this.db.getSession().createQuery(sql); - - Iterator<?> it = q.list().iterator(); - - while (it.hasNext()) + for (CGMSDataH cgmsDataH : dataList) { - CGMSDataH pdh = (CGMSDataH) it.next(); - CGMSValuesEntry dv = new CGMSValuesEntry(pdh); + CGMSValuesEntry dv = new CGMSValuesEntry(cgmsDataH); dV.addList(dv.getSubEntryList()); } @@ -189,7 +184,9 @@ int sum_all = 0; Criteria criteria = this.getSession().createCriteria(CGMSDataH.class); - criteria.add(Restrictions.eq("person_id", (int) m_da.getCurrentUserId())); + criteria.add(Restrictions.eq("personId", (int) dataAccess.getCurrentUserId())); + criteria.add(Restrictions.like("extended", "%" + dataAccess.getSourceDevice() + "%")); + criteria.setProjection(Projections.rowCount()); in = (Integer) criteria.list().get(0); sum_all = in.intValue(); @@ -213,21 +210,19 @@ { int counter = 0; - sql = "SELECT dv from ggc.core.db.hibernate.cgms.CGMSDataH as dv WHERE dv.person_id=" - + m_da.getCurrentUserId() + " ORDER BY dv.dt_info "; + List<CGMSDataH> dataList = getHibernateData(CGMSDataH.class, // + Arrays.asList( // + Restrictions.eq("personId", this.dataAccess.getCurrentUserId()), // + Restrictions.like("extended", "%" + dataAccess.getSourceDevice() + "%")) // + , Arrays.asList(Order.asc("dtInfo"))); - Query q = this.db.getSession().createQuery(sql); - - Iterator<?> it = q.list().iterator(); - pdr.writeStatus(-1); - // id = "PD_%s_%s_%s"; - while (it.hasNext()) + for (CGMSDataH cgmsDataH : dataList) { counter++; - CGMSValuesEntry pve = new CGMSValuesEntry((CGMSDataH) it.next()); + CGMSValuesEntry pve = new CGMSValuesEntry(cgmsDataH); dt.put(pve.getSpecialId(), pve); pdr.writeStatus(counter); } @@ -251,7 +246,7 @@ GraphTimeDataCollection collection = new GraphTimeDataCollection(); - List<ATechDate> dates = m_da.getDatesList(gcFrom, gcTill, true); + List<ATechDate> dates = dataAccess.getDatesList(gcFrom, gcTill, true); Criteria criteria = null; @@ -258,10 +253,10 @@ try { criteria = getSession().createCriteria(CGMSDataH.class) - .add(Restrictions.eq("person_id", (int) m_da.getCurrentUserId())) - .add(Restrictions.eq("base_type", 1)) - .add(Restrictions.and(Restrictions.ge("dt_info", dates.get(0).getATDateTimeAsLong()), - Restrictions.le("dt_info", dates.get(1).getATDateTimeAsLong()))); + .add(Restrictions.eq("personId", (int) dataAccess.getCurrentUserId())) + .add(Restrictions.eq("baseType", 1)) + .add(Restrictions.and(Restrictions.ge("dtInfo", dates.get(0).getATDateTimeAsLong()), + Restrictions.le("dtInfo", dates.get(1).getATDateTimeAsLong()))); List listData = criteria.list(); Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSAlarms.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSAlarms.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSAlarms.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -5,7 +5,6 @@ import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.cgms.util.DataAccessCGMS; /** * Application: GGC - GNU Gluco Control @@ -65,22 +64,33 @@ static Hashtable<String, CGMSAlarms> translationMapping = new Hashtable<String, CGMSAlarms>(); static Hashtable<Integer, CGMSAlarms> codeMapping = new Hashtable<Integer, CGMSAlarms>(); - static { - I18nControlAbstract ic = DataAccessCGMS.getInstance().getI18nControlInstance(); + for (CGMSAlarms pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (CGMSAlarms pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } + + translated = true; } int code; String i18nKey; String translation; + static boolean translated = false; private CGMSAlarms(int code, String i18nKey) Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSBaseDataType.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSBaseDataType.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSBaseDataType.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -4,7 +4,6 @@ import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.cgms.util.DataAccessCGMS; /** * Application: GGC - GNU Gluco Control @@ -76,17 +75,29 @@ static Hashtable<String, CGMSBaseDataType> translationMapping = new Hashtable<String, CGMSBaseDataType>(); static Hashtable<Integer, CGMSBaseDataType> codeMapping = new Hashtable<Integer, CGMSBaseDataType>(); + private static boolean translated; static { - I18nControlAbstract ic = DataAccessCGMS.getInstance().getI18nControlInstance(); + for (CGMSBaseDataType pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (CGMSBaseDataType pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } + + translated = true; } int code; @@ -94,7 +105,7 @@ String translation; - private CGMSBaseDataType(int code, String i18nKey) + CGMSBaseDataType(int code, String i18nKey) { this.code = code; this.i18nKey = i18nKey; Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSConfigurationGroup.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSConfigurationGroup.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSConfigurationGroup.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -6,7 +6,6 @@ import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.cgms.util.DataAccessCGMS; import ggc.plugin.data.enums.DeviceConfigurationGroup; /** @@ -81,18 +80,29 @@ int code; String i18nKey; String translation; + static boolean translated = false; static { - I18nControlAbstract ic = DataAccessCGMS.getInstance().getI18nControlInstance(); + for (CGMSConfigurationGroup pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (CGMSConfigurationGroup pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } + translated = true; } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSErrors.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSErrors.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSErrors.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -4,7 +4,6 @@ import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.cgms.util.DataAccessCGMS; /** * Application: GGC - GNU Gluco Control @@ -57,22 +56,34 @@ static { - I18nControlAbstract ic = DataAccessCGMS.getInstance().getI18nControlInstance(); + for (CGMSErrors pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (CGMSErrors pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } + + translated = true; } int code; String i18nKey; String translation; + static boolean translated = false; - private CGMSErrors(int code, String i18nKey) + CGMSErrors(int code, String i18nKey) { this.code = code; this.i18nKey = i18nKey; Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSEvents.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSEvents.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/data/defs/CGMSEvents.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -5,7 +5,6 @@ import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.cgms.util.DataAccessCGMS; /** * Application: GGC - GNU Gluco Control @@ -73,22 +72,34 @@ static { - I18nControlAbstract ic = DataAccessCGMS.getInstance().getI18nControlInstance(); + for (CGMSEvents pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (CGMSEvents pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } + + translated = true; } int code; String i18nKey; String translation; + static boolean translated = false; - private CGMSEvents(int code, String i18nKey) + CGMSEvents(int code, String i18nKey) { this.code = code; this.i18nKey = i18nKey; Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/CGMSPluginDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/CGMSPluginDefinition.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/CGMSPluginDefinition.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -10,8 +10,7 @@ import com.atech.app.data.about.LibraryInfoEntry; import com.atech.i18n.mgr.LanguageManager; -import ggc.cgms.device.animas.AnimasCGMSHandler; -import ggc.cgms.device.dexcom.DexcomHandler; +import ggc.cgms.device.minimed.MinimedCGMSDeviceHandler; import ggc.cgms.graph.CGMSGraphDefintion; import ggc.cgms.report.def.CGMSReportDefinition; import ggc.cgms.util.DataAccessCGMS; @@ -52,8 +51,7 @@ public class CGMSPluginDefinition extends DevicePluginDefinitionAbstract { - String PLUGIN_VERSION = "1.5.1"; - String PLUGIN_NAME = "GGC CGMS Plugin"; + private static String PLUGIN_NAME = "GGC CGMS Plugin"; CGMSReportDefinition reportsCGMSDefinition; CGMSGraphDefintion graphsCGMSDefintion; @@ -61,7 +59,12 @@ public CGMSPluginDefinition(LanguageManager languageManager) { - super(languageManager, new GGC_CGMS_ICRunner()); + super(languageManager, // + new GGC_CGMS_ICRunner(), // + PLUGIN_NAME, // + GGCPluginType.CGMSToolPlugin, // + "cgms_", // + "ggc.cgms.defs.Version"); } @@ -155,29 +158,6 @@ } - public String getPluginVersion() - { - return this.PLUGIN_VERSION; - } - - - /** - * Get Name of Plugin (for internal use) - * - * @return - */ - public String getPluginName() - { - return this.PLUGIN_NAME; - } - - - public GGCPluginType getPluginType() - { - return GGCPluginType.CGMSToolPlugin; - } - - @Override public List<BaseListEntry> getWebListerItems() { @@ -194,13 +174,6 @@ @Override - public String getWebListerDescription() - { - return this.i18nControl.getMessage("DEVICE_LIST_WEB_DESC"); - } - - - @Override public PluginReportDefinition getReportsDefinition() { if (reportsCGMSDefinition == null) @@ -225,20 +198,14 @@ @Override - public String getPluginActionsPrefix() - { - return "cgms_"; - } - - - @Override public void registerDeviceHandlers() { - // Animas CGMS - Dexcom (Vibe) - DeviceHandlerManager.getInstance().addDeviceHandler(new AnimasCGMSHandler()); + // Minimed CGMS - this one can't be registered Dynamically + DeviceHandlerManager.getInstance() + .addDeviceHandler(new MinimedCGMSDeviceHandler((DataAccessCGMS) this.dataAccess)); - // Dexcom: G4 - DeviceHandlerManager.getInstance().addDeviceHandler(new DexcomHandler()); + // register dynamic handlers + DeviceHandlerManager.getInstance().registerDeviceHandlersDynamically(getPluginType()); } } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceDefinition.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceDefinition.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -153,7 +153,6 @@ static List<DeviceDefinition> allDevices; static List<DeviceDefinition> supportedDevices; - static { allDevices = new ArrayList<DeviceDefinition>(); @@ -182,7 +181,7 @@ Object internalDefintion; DeviceImplementationStatus implementationStatus; DeviceCompanyDefinition companyDefinition; - DeviceHandlerType deviceHandlerType; + DeviceHandlerType deviceHandlerType = DeviceHandlerType.NullHandler; DevicePortParameterType devicePortParameterType; DeviceConnectionProtocol deviceConnectionProtocol; DeviceProgressStatus deviceProgressStatus; Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceHandler.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceHandler.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/defs/device/CGMSDeviceHandler.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -3,6 +3,7 @@ import java.util.List; import ggc.cgms.util.DataAccessCGMS; +import ggc.core.plugins.GGCPluginType; import ggc.plugin.data.GGCPlugInFileReaderContext; import ggc.plugin.device.DownloadSupportType; import ggc.plugin.device.v2.DeviceDefinition; @@ -76,4 +77,13 @@ return (CGMSDeviceDefinition) definition; } + + /** + * {@inheritDoc} + */ + public GGCPluginType getGGCPluginType() + { + return GGCPluginType.CGMSToolPlugin; + } + } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/animas/AnimasCGMSHandler.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/animas/AnimasCGMSHandler.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/animas/AnimasCGMSHandler.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -72,6 +72,12 @@ } + public void closeDevice() throws PlugInBaseException + { + // not used - handled internally + } + + private AnimasDeviceType getAnimasDeviceType(DeviceDefinition definition) { return (AnimasDeviceType) getDeviceDefinition(definition).getInternalDefintion(); Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/animas/impl/AnimasCGMSDeviceReader.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/animas/impl/AnimasCGMSDeviceReader.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/animas/impl/AnimasCGMSDeviceReader.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -62,4 +62,11 @@ handler.startAction(AnimasTransferType.DownloadCGMSSettings); } + + @Override + public void closeDevice() throws PlugInBaseException + { + // not used - close is handled internally + } + } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/dexcom/DexcomHandler.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/dexcom/DexcomHandler.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/dexcom/DexcomHandler.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -10,9 +10,6 @@ import ggc.plugin.device.v2.DeviceDefinition; import ggc.plugin.output.OutputWriter; -/** - * Created by andy on 15.04.15. - */ public class DexcomHandler extends CGMSDeviceHandler { @@ -47,7 +44,6 @@ outputWriter.endOutput(); } - } @@ -77,7 +73,12 @@ outputWriter.endOutput(); } + } + + public void closeDevice() throws PlugInBaseException + { + // not used - is handled internally } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/MinimedCGMSDeviceHandler.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/MinimedCGMSDeviceHandler.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/MinimedCGMSDeviceHandler.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -54,9 +54,13 @@ private static MinimedSpecialConfig specialConfigPanel; + public DataAccessCGMS dataAccess; - public MinimedCGMSDeviceHandler() throws PlugInBaseException + + public MinimedCGMSDeviceHandler(DataAccessCGMS dataAccess) { + this.dataAccess = dataAccess; + this.registerConverters(); } @@ -90,6 +94,12 @@ } + public void closeDevice() throws PlugInBaseException + { + // not used - close is handled internally + } + + public List<GGCPlugInFileReaderContext> getFileDownloadContexts(DownloadSupportType downloadSupportType) { return null; @@ -107,9 +117,9 @@ if (!MinimedUtil.isTargetRegistered(MinimedTargetType.CGMS)) { MinimedUtil.registerConverter(MinimedTargetType.CGMS, MinimedConverterType.CGMS522Converter, - new Minimed522CGMSDataConverter()); + new Minimed522CGMSDataConverter(dataAccess)); MinimedUtil.registerConverter(MinimedTargetType.CGMS, MinimedConverterType.CGMS523Converter, - new Minimed523CGMSDataConverter()); + new Minimed523CGMSDataConverter(dataAccess)); } } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed522CGMSDataConverter.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed522CGMSDataConverter.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed522CGMSDataConverter.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -46,9 +46,12 @@ private static final Logger LOG = LoggerFactory.getLogger(Minimed522CGMSDataConverter.class); - public Minimed522CGMSDataConverter() + // public DataAccessCGMS dataAccess; + + public Minimed522CGMSDataConverter(DataAccessCGMS dataAccess) { - super(DataAccessCGMS.getInstance()); + super(dataAccess); + // this.dataAccess = dataAccess; this.bitUtils = MinimedUtil.getBitUtils(); this.outputWriter = MinimedUtil.getOutputWriter(); } @@ -182,8 +185,7 @@ } - protected void decodeEnableSetting(String key, MinimedCommandReply minimedReply, int bit, - CGMSConfigurationGroup pcg) + protected void decodeEnableSetting(String key, MinimedCommandReply minimedReply, int bit, CGMSConfigurationGroup pcg) { writeSetting(key, parseResultEnable(minimedReply.getRawDataAsInt(bit)), pcg); } Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed523CGMSDataConverter.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed523CGMSDataConverter.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/device/minimed/data/converter/Minimed523CGMSDataConverter.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -6,6 +6,7 @@ import com.atech.utils.ATDataAccessAbstract; import ggc.cgms.data.defs.CGMSConfigurationGroup; +import ggc.cgms.util.DataAccessCGMS; import ggc.core.data.defs.GlucoseUnitType; import ggc.plugin.device.impl.minimed.data.MinimedCommandReply; import ggc.plugin.device.impl.minimed.data.converter.MinimedDataConverterAbstract; @@ -44,6 +45,12 @@ private static final Logger LOG = LoggerFactory.getLogger(Minimed523CGMSDataConverter.class); + public Minimed523CGMSDataConverter(DataAccessCGMS dataAccess) + { + super(dataAccess); + } + + @Override public void convertData(MinimedCommandReply minimedReply) { @@ -173,17 +180,13 @@ // System.out.println("Set Rise Rate Limit: " + // DataAccessPump.Decimal3Format.format(rd[1]/1000.0f) + " mmol/L/min"); - writeSetting("CCFG_RATE_OF_CHANGE_ALERTS_RISE_RATE_LIMIT", - minimedReply.getRawDataAsInt(1) == 0 ? "OFF" - : DataAccessPlugInBase.Decimal3Format.format(minimedReply.getRawDataAsInt(1) / 1000.0f) - + " mmol/L / min", - CGMSConfigurationGroup.Warnings); + writeSetting("CCFG_RATE_OF_CHANGE_ALERTS_RISE_RATE_LIMIT", minimedReply.getRawDataAsInt(1) == 0 ? "OFF" + : DataAccessPlugInBase.Decimal3Format.format(minimedReply.getRawDataAsInt(1) / 1000.0f) + + " mmol/L / min", CGMSConfigurationGroup.Warnings); - writeSetting("CCFG_RATE_OF_CHANGE_ALERTS_FALL_RATE_LIMIT", - minimedReply.getRawDataAsInt(2) == 0 ? "OFF" - : DataAccessPlugInBase.Decimal3Format.format(minimedReply.getRawDataAsInt(2) / 1000.0f) - + " mmol/L / min", - CGMSConfigurationGroup.Warnings); + writeSetting("CCFG_RATE_OF_CHANGE_ALERTS_FALL_RATE_LIMIT", minimedReply.getRawDataAsInt(2) == 0 ? "OFF" + : DataAccessPlugInBase.Decimal3Format.format(minimedReply.getRawDataAsInt(2) / 1000.0f) + + " mmol/L / min", CGMSConfigurationGroup.Warnings); // SET FALL RATE LIMIT = 0.250 // SET RISE RATE LIMIT = 0.275 @@ -199,8 +202,8 @@ } else { - writeSetting("CCFG_SENSOR_TIME_SENSITIVITY_LOW_PREDICTIVE_ALERT", - "00:" + (minimedReply.getRawDataAsInt(4) - 128), CGMSConfigurationGroup.Warnings); + writeSetting("CCFG_SENSOR_TIME_SENSITIVITY_LOW_PREDICTIVE_ALERT", "00:" + + (minimedReply.getRawDataAsInt(4) - 128), CGMSConfigurationGroup.Warnings); } if (minimedReply.getRawDataAsInt(3) == 0) @@ -210,8 +213,8 @@ } else { - writeSetting("CCFG_SENSOR_TIME_SENSITIVITY_HIGH_PREDICTIVE_ALERT", - "00:" + (minimedReply.getRawDataAsInt(3) - 128), CGMSConfigurationGroup.Warnings); + writeSetting("CCFG_SENSOR_TIME_SENSITIVITY_HIGH_PREDICTIVE_ALERT", "00:" + + (minimedReply.getRawDataAsInt(3) - 128), CGMSConfigurationGroup.Warnings); } return true; Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/gui/viewer/CGMSDataDialog.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/gui/viewer/CGMSDataDialog.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/gui/viewer/CGMSDataDialog.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -26,6 +26,7 @@ import ggc.cgms.util.CGMSUtil; import ggc.cgms.util.DataAccessCGMS; import ggc.core.data.defs.GlucoseUnitType; +import ggc.core.util.DataAccess; import ggc.plugin.data.DeviceValuesDay; /** @@ -59,9 +60,6 @@ // private static Log log = LogFactory.getLog(PumpDataDialog.class); - /** - * - */ private static final long serialVersionUID = -3923519587722702685L; private DataAccessCGMS m_da = DataAccessCGMS.getInstance(); private I18nControlAbstract m_ic = m_da.getI18nControlInstance(); @@ -239,63 +237,71 @@ /* * JPanel BGPanel = new JPanel(new GridLayout(0, 6)); - * BGPanel.setBorder(BorderFactory.createTitledBorder(m_ic.getMessage( + * BGPanel.setBorder(BorderFactory.createTitledBorder(i18nControl. + * getMessage( * "BLOOD_GLUCOSE_CALIB") + ":")); - * BGPanel.add(new JLabel(m_ic.getMessage("AVG_BG") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("AVG_BG") + ":")); * BGPanel.add(avgBG = new JLabel()); - * BGPanel.add(new JLabel(m_ic.getMessage("HIGHEST") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("HIGHEST") + ":")); * BGPanel.add(highestBG = new JLabel()); - * BGPanel.add(new JLabel(m_ic.getMessage("READINGS") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("READINGS") + ":")); * BGPanel.add(readings = new JLabel()); - * BGPanel.add(new JLabel(m_ic.getMessage("STD_DEV") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("STD_DEV") + ":")); * BGPanel.add(stdDev = new JLabel()); - * BGPanel.add(new JLabel(m_ic.getMessage("LOWEST") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("LOWEST") + ":")); * BGPanel.add(lowestBG = new JLabel()); * InsPanel.add(new JLabel(getIns1Abbr() + ":")); * InsPanel.add(sumIns1 = new JLabel()); - * InsPanel.add(new JLabel(m_ic.getMessage("AVG") + " " + getIns1Abbr() + * InsPanel.add(new JLabel(i18nControl.getMessage("AVG") + " " + + * getIns1Abbr() * + ":")); * InsPanel.add(avgIns1 = new JLabel()); - * InsPanel.add(new JLabel(m_ic.getMessage("DOSE") + " " + getIns1Abbr() + * InsPanel.add(new JLabel(i18nControl.getMessage("DOSE") + " " + + * getIns1Abbr() * + ":")); * InsPanel.add(doseIns1 = new JLabel()); * InsPanel.add(new JLabel(getIns2Abbr() + ":")); * InsPanel.add(sumIns2 = new JLabel()); - * InsPanel.add(new JLabel(m_ic.getMessage("AVG") + " " + getIns2Abbr() + * InsPanel.add(new JLabel(i18nControl.getMessage("AVG") + " " + + * getIns2Abbr() * + ":")); * InsPanel.add(avgIns2 = new JLabel()); - * InsPanel.add(new JLabel(m_ic.getMessage("DOSE") + " " + getIns2Abbr() + * InsPanel.add(new JLabel(i18nControl.getMessage("DOSE") + " " + + * getIns2Abbr() * + ":")); * InsPanel.add(doseIns2 = new JLabel()); - * InsPanel.add(new JLabel(m_ic.getMessage("TOTAL") + ":")); + * InsPanel.add(new JLabel(i18nControl.getMessage("TOTAL") + ":")); * InsPanel.add(sumIns = new JLabel()); - * InsPanel.add(new JLabel("")); //m_ic.getMessage("AVG_INS") + ":")); + * InsPanel.add(new JLabel("")); //i18nControl.getMessage("AVG_INS") + + * ":")); * InsPanel.add(avgIns = new JLabel()); - * InsPanel.add(new JLabel(m_ic.getMessage("DOSE_INS") + ":")); + * InsPanel.add(new JLabel(i18nControl.getMessage("DOSE_INS") + ":")); * InsPanel.add(doseIns = new JLabel()); * // Panel for BU Stats * JPanel BUPanel = new JPanel(new GridLayout(1, 6)); - * BUPanel.setBorder(BorderFactory.createTitledBorder(m_ic.getMessage( + * BUPanel.setBorder(BorderFactory.createTitledBorder(i18nControl. + * getMessage( * "BREAD_UNITS") + ":")); - * BUPanel.add(new JLabel(m_ic.getMessage("SUM") + ":")); + * BUPanel.add(new JLabel(i18nControl.getMessage("SUM") + ":")); * BUPanel.add(sumBE = new JLabel()); - * BUPanel.add(new JLabel(m_ic.getMessage("AVG") + ":")); + * BUPanel.add(new JLabel(i18nControl.getMessage("AVG") + ":")); * BUPanel.add(avgBE = new JLabel()); - * BUPanel.add(new JLabel(m_ic.getMessage("MEALS") + ":")); + * BUPanel.add(new JLabel(i18nControl.getMessage("MEALS") + ":")); * BUPanel.add(meals = new JLabel()); * // Panel for BG Stats * JPanel BGPanel = new JPanel(new GridLayout(0, 6)); - * BGPanel.setBorder(BorderFactory.createTitledBorder(m_ic.getMessage( + * BGPanel.setBorder(BorderFactory.createTitledBorder(i18nControl. + * getMessage( * "BLOOD_GLUCOSE") + ":")); - * BGPanel.add(new JLabel(m_ic.getMessage("AVG_BG") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("AVG_BG") + ":")); * BGPanel.add(avgBG = new JLabel()); - * BGPanel.add(new JLabel(m_ic.getMessage("HIGHEST") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("HIGHEST") + ":")); * BGPanel.add(highestBG = new JLabel()); - * BGPanel.add(new JLabel(m_ic.getMessage("READINGS") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("READINGS") + ":")); * BGPanel.add(readings = new JLabel()); - * BGPanel.add(new JLabel(m_ic.getMessage("STD_DEV") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("STD_DEV") + ":")); * BGPanel.add(stdDev = new JLabel()); - * BGPanel.add(new JLabel(m_ic.getMessage("LOWEST") + ":")); + * BGPanel.add(new JLabel(i18nControl.getMessage("LOWEST") + ":")); * BGPanel.add(lowestBG = new JLabel()); */ @@ -371,6 +377,8 @@ }; table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); + DataAccess.getSkinManager().reSkinifyComponent(table); + resultsPane = new JScrollPane(table); // resultsPane.getViewport().addMouseListener(ma); // resultsPane.getViewport().setBackground(table.getBackground()); @@ -414,7 +422,8 @@ // Dimension dim = new Dimension(120, 20); /* - * JButton addButton = new JButton(" " + m_ic.getMessage("ADD")); + * JButton addButton = new JButton(" " + + * i18nControl.getMessage("ADD")); * addButton.setPreferredSize(dim); * addButton.setIcon(dataAccess.getImageIcon_22x22("table_add.png", * this)); @@ -421,7 +430,8 @@ * addButton.setActionCommand("add_row"); * addButton.addActionListener(this); * EntryBox.add(addButton); - * JButton editButton = new JButton(" " + m_ic.getMessage("EDIT")); + * JButton editButton = new JButton(" " + + * i18nControl.getMessage("EDIT")); * editButton.setPreferredSize(dim); * editButton.setIcon(dataAccess.getImageIcon_22x22("table_edit.png", * this)); @@ -428,7 +438,8 @@ * editButton.setActionCommand("edit_row"); * editButton.addActionListener(this); * EntryBox.add(editButton); - * JButton delButton = new JButton(" " + m_ic.getMessage("DELETE")); + * JButton delButton = new JButton(" " + + * i18nControl.getMessage("DELETE")); * delButton.setPreferredSize(dim); * delButton.setIcon(dataAccess.getImageIcon_22x22("table_delete.png", * this)); @@ -579,11 +590,11 @@ /* * private String getIns1Abbr() * { - * return m_ic.getMessage("BOLUS"); //"Bolus Insulin"; + * return i18nControl.getMessage("BOLUS"); //"Bolus Insulin"; * } * private String getIns2Abbr() * { - * return m_ic.getMessage("BASAL"); + * return i18nControl.getMessage("BASAL"); * //return "Basal Insulin"; * } */ @@ -615,7 +626,8 @@ * if (table.getSelectedRow() == -1) * { * JOptionPane.showMessageDialog(this, - * m_ic.getMessage("SELECT_ROW_FIRST"), m_ic.getMessage("ERROR"), + * i18nControl.getMessage("SELECT_ROW_FIRST"), + * i18nControl.getMessage("ERROR"), * JOptionPane.ERROR_MESSAGE); * return; * } @@ -622,7 +634,7 @@ * //DeviceValuesEntryInterface dei = * this.dayData.getRowAt(table.getSelectedRow()); * int option_selected = JOptionPane.showOptionDialog(this, - * m_ic.getMessage("ARE_YOU_SURE_DELETE"), m_ic + * i18nControl.getMessage("ARE_YOU_SURE_DELETE"), i18nControl * .getMessage("QUESTION"), JOptionPane.YES_NO_OPTION, * JOptionPane.QUESTION_MESSAGE, null, * dataAccess.options_yes_no, JOptionPane.YES_OPTION); Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/util/CGMSUtil.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/util/CGMSUtil.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/util/CGMSUtil.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -42,13 +42,21 @@ public class CGMSUtil { - private static DataAccessCGMS dataAccess = DataAccessCGMS.getInstance(); + private static DataAccessCGMS dataAccess; - private static GGCI18nControl i18nControl = dataAccess.getI18nControlInstance(); + private static GGCI18nControl i18nControl; - private static GlucoseUnitType BGUnit = DataAccess.getInstance().getGlucoseUnitType(); + private static GlucoseUnitType BGUnit; + public static void setDataAccess(DataAccessCGMS dataAccess_) + { + dataAccess = dataAccess_; + i18nControl = dataAccess.getI18nControlInstance(); + BGUnit = DataAccess.getInstance().getGlucoseUnitType(); + } + + public static GGCI18nControl getI18Control() { return i18nControl; Modified: trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/util/DataAccessCGMS.java =================================================================== --- trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/util/DataAccessCGMS.java 2017-06-28 18:57:17 UTC (rev 1461) +++ trunk/ggc-plugins/ggc-cgms/src/main/java/ggc/cgms/util/DataAccessCGMS.java 2017-06-28 19:00:28 UTC (rev 1462) @@ -10,6 +10,7 @@ import ggc.cgms.data.ExtendedCGMSValueHandler; import ggc.cgms.data.cfg.CGMSConfigurationDefinition; import ggc.cgms.data.db.GGC_CGMSDb; +import ggc.cgms.data.defs.*; import ggc.cgms.data.graph.v2.CGMSGraphContext; import ggc.cgms.defs.CGMSPluginDefinition; import ggc.cgms.manager.CGMSManager; @@ -98,6 +99,8 @@ this.prepareTranslationForEnums(); this.prepareGraphContext(); + + CGMSUtil.setDataAccess(this); } @@ -105,6 +108,11 @@ { AnimasSoundType.translateKeywords(this.getI18nControlInstance(), this.getPluginType()); DeviceEntryStatus.translateKeywords(this.getI18nControlInstance()); + CGMSEvents.translateKeywords(this.getI18nControlInstance()); + CGMSConfigurationGroup.translateKeywords(this.getI18nControlInstance()); + CGMSAlarms.translateKeywords(this.getI18nControlInstance()); + CGMSErrors.translateKeywords(this.getI18nControlInstance()); + CGMSBaseDataType.translateKeywords(this.getI18nControlInstance()); } @@ -148,11 +156,11 @@ m_i18n = null; } + // ******************************************************** // ****** Abstract Methods ***** // ******************************************************** - // ******************************************************** // ****** Manager ***** // ******************************************************** @@ -167,11 +175,11 @@ return this.m_cgms_manager; } + // ******************************************************** // ****** Parent handling (for UIs) ***** // ******************************************************** - // ******************************************************** // ****** Dates and Times Handling ***** // ******************************************************** @@ -237,6 +245,7 @@ this.device_config = new DeviceConfiguration(this); } + // ******************************************************** // ****** About Methods ***** // ******************************************************** @@ -317,7 +326,6 @@ // ****** Web Lister Methods ***** // ******************************************************** - // /** // * Create WebLister (for List) Context for plugin // */ @@ -388,8 +396,7 @@ @Override public void loadExtendedHandlers() { - this.addExtendedHandler(DataAccessCGM... [truncated message content] |
From: <and...@us...> - 2017-06-28 18:57:21
|
Revision: 1461 http://sourceforge.net/p/ggc/code/1461 Author: andyrozman Date: 2017-06-28 18:57:17 +0000 (Wed, 28 Jun 2017) Log Message: ----------- 2.0.3 [26.6.2017] - changed enums, so that translation are changed from withing DataAccess - refactorings - changes to Db Objects Modified Paths: -------------- trunk/ggc-plugins/ggc-pump/docs/Changelog trunk/ggc-plugins/ggc-pump/pom.xml trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntry.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryExt.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryProfile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAdditionalDataType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAlarms.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBasalType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBaseType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBolusType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationGroup.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpErrors.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpEventType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpReport.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewBasalRateEstimator.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewDailyPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/GraphViewBasalRate.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/GraphViewBasals.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/GraphViewRatios.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/v1/GraphV1DbRetrieverPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/profile/Profile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/GGCPumpDb.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/PumpData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/PumpDataExtended.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/PumpProfile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/PumpPluginDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpDeviceDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpDeviceHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/DummyPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/accuchek/AccuChekPumpHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/AnimasIR1200Handler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/AnimasPumpDeviceReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/handler/AnimasBaseDataV2Handler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaDiabecare_III_R.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaPumpHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaPumpHandlerV2.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/impl/DanaDeviceReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/impl/comm/DanaCommProtocolV1.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/InsuletHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/InsuletReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/util/InsuletUtil.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/MinimedPumpDeviceHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/old/MinimedSPMPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataAdditionalWizardTwo.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataDialog.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataRowDialog.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataTypeComponent.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataTypeComponent2.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/profile/ProfileEditor.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/profile/ProfileEntryDialog.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/profile/ProfileSelector.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/manager/PumpManager.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataAbstract.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataBase.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataExt.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataProfiles.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/util/DataAccessPump.java Added Paths: ----------- trunk/ggc-plugins/ggc-pump/src/main/templates/ trunk/ggc-plugins/ggc-pump/src/main/templates/Version.java.template Modified: trunk/ggc-plugins/ggc-pump/docs/Changelog =================================================================== --- trunk/ggc-plugins/ggc-pump/docs/Changelog 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/docs/Changelog 2017-06-28 18:57:17 UTC (rev 1461) @@ -2,6 +2,12 @@ Changes file for GGC Pump Tool ============================== +2.0.3 [26.6.2017] +- changed enums, so that translation are changed from withing DataAccess +- refactorings +- changes to Db Objects + + 2.0.2 [25.12.2016] [Andy] - PumpDataAdditionalWizardTwo - PumpDataTypeComponent Modified: trunk/ggc-plugins/ggc-pump/pom.xml =================================================================== --- trunk/ggc-plugins/ggc-pump/pom.xml 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/pom.xml 2017-06-28 18:57:17 UTC (rev 1461) @@ -13,7 +13,35 @@ <version>${ggc-pump-tool.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/pump/defs/</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + </build> + + <dependencies> <dependency> <groupId>net.sf.ggc</groupId> @@ -30,13 +58,11 @@ <artifactId>atech-tools</artifactId> </dependency> - <dependency> <groupId>com.ibm.old.comapi</groupId> <artifactId>ibm-compapi</artifactId> </dependency> - <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> @@ -58,13 +84,14 @@ <artifactId>commons-collections</artifactId> </dependency> - </dependencies> + <properties> + <version.file> + ${project.build.directory}/generated-sources/ggc/pump/defs/Version.java + </version.file> + </properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - </properties> </project> Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataReader.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataReader.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataReader.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -64,7 +64,7 @@ public void getMaxEntries() { db = m_da.getDb(); - this.all_entries = db.getAllElementsCount(); + this.allEntries = db.getAllElementsCount(); } @@ -110,7 +110,7 @@ float proc_total = (proc * 1.0f + db_reading) / 160.0f * 100.0f; int proc_total_i = (int) proc_total; - this.m_drr.setOldDataReadingProgress(proc_total_i); + this.deviceReaderRunner.setOldDataReadingProgress(proc_total_i); /* * try Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntry.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntry.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntry.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -86,7 +86,7 @@ public PumpValuesEntry(boolean tr) { // dataAccess = DataAccessPump.getInstance(); - // m_ic = dataAccess.getI18nControlInstance(); + // i18nControl = dataAccess.getI18nControlInstance(); } @@ -158,13 +158,13 @@ // this.entry_object = pdh; this.id = pdh.getId(); this.old_id = pdh.getId(); - this.datetime = new ATechDate(ATechDateType.DateAndTimeSec, pdh.getDt_info()); - this.baseType = PumpBaseType.getByCode(pdh.getBase_type()); - this.sub_type = pdh.getSub_type(); + this.datetime = new ATechDate(ATechDateType.DateAndTimeSec, pdh.getDtInfo()); + this.baseType = PumpBaseType.getByCode(pdh.getBaseType()); + this.sub_type = pdh.getSubType(); this.value = pdh.getValue(); this.extended = pdh.getExtended(); // loadExtended(pdh.getExtended()); - this.person_id = pdh.getPerson_id(); + this.person_id = pdh.getPersonId(); this.comment = pdh.getComment(); } @@ -756,7 +756,7 @@ // * this.entry_object = new DayValueH(); this.entry_object.setIns1(0); // * this.entry_object.setIns2(0); this.entry_object.setCh(0.0f); // * this.entry_object.setBg(Integer.parseInt(this.getBGValue(OutputUtil. - // * BG_MGDL))); this.entry_object.setDt_info(this.datetime); + // * BG_MGDL))); this.entry_object.setDtInfo(this.datetime); // * this.entry_object.setChanged(System.currentTimeMillis()); // * this.entry_object.setComment(createComment()); } // */ @@ -829,12 +829,12 @@ PumpDataH pdh = new PumpDataH(); pdh.setId(this.id); - pdh.setDt_info(this.datetime.getATDateTimeAsLong()); - pdh.setBase_type(this.baseType.getCode()); - pdh.setSub_type(this.sub_type); + pdh.setDtInfo(this.datetime.getATDateTimeAsLong()); + pdh.setBaseType(this.baseType.getCode()); + pdh.setSubType(this.sub_type); pdh.setValue(this.value); pdh.setExtended("SOURCE=" + this.source); - pdh.setPerson_id((int) this.person_id); + pdh.setPersonId((int) this.person_id); pdh.setComment(this.comment); pdh.setChanged(System.currentTimeMillis()); pdh.setChanged(System.currentTimeMillis()); @@ -887,12 +887,12 @@ // System.out.println("PumpDataH: " + pdh); pdh.setId(this.old_id); - pdh.setDt_info(this.datetime.getATDateTimeAsLong()); - pdh.setBase_type(this.baseType.getCode()); - pdh.setSub_type(this.sub_type); + pdh.setDtInfo(this.datetime.getATDateTimeAsLong()); + pdh.setBaseType(this.baseType.getCode()); + pdh.setSubType(this.sub_type); pdh.setValue(this.value); pdh.setExtended(this.extended); - pdh.setPerson_id((int) this.person_id); + pdh.setPersonId((int) this.person_id); pdh.setComment(this.comment); pdh.setChanged(System.currentTimeMillis()); @@ -917,12 +917,12 @@ PumpDataH pdh = (PumpDataH) sess.get(PumpDataH.class, this.id); this.id = pdh.getId(); - this.datetime = new ATechDate(ATechDate.FORMAT_DATE_AND_TIME_S, pdh.getDt_info()); - this.baseType = PumpBaseType.getByCode(pdh.getBase_type()); - this.sub_type = pdh.getSub_type(); + this.datetime = new ATechDate(ATechDate.FORMAT_DATE_AND_TIME_S, pdh.getDtInfo()); + this.baseType = PumpBaseType.getByCode(pdh.getBaseType()); + this.sub_type = pdh.getSubType(); this.value = pdh.getValue(); this.extended = pdh.getExtended(); - this.person_id = pdh.getPerson_id(); + this.person_id = pdh.getPersonId(); this.comment = pdh.getComment(); return true; Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryExt.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryExt.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryExt.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -95,7 +95,7 @@ public PumpValuesEntryExt(String src) { this.source = (src == null) ? da.getSourceDevice() : src; - this.setPerson_id(da.getCurrentUserIdAsInt()); + this.setPersonId(da.getCurrentUserIdAsInt()); } @@ -109,12 +109,12 @@ // pumpAdditionalDataType = new PumpAdditionalDataType(); this.setId(pd.getId()); - this.setDt_info(pd.getDt_info()); + this.setDtInfo(pd.getDtInfo()); this.setType(pd.getType()); this.setValue(pd.getValue()); this.setExtended(pd.getExtended()); - this.setPerson_id(pd.getPerson_id()); + this.setPersonId(pd.getPersonId()); this.setComment(pd.getComment()); this.setChanged(pd.getChanged()); @@ -157,7 +157,7 @@ */ public ATechDate getDateTimeObject() { - return new ATechDate(ATechDate.FORMAT_DATE_AND_TIME_S, this.getDt_info()); + return new ATechDate(ATechDate.FORMAT_DATE_AND_TIME_S, this.getDtInfo()); } @@ -266,11 +266,11 @@ PumpDataExtendedH ch = new PumpDataExtendedH(); // ch.setId(id); - ch.setDt_info(this.getDt_info()); + ch.setDtInfo(this.getDtInfo()); ch.setType(this.getType()); ch.setValue(this.getValue()); ch.setExtended("SOURCE=" + this.source); - ch.setPerson_id(this.getPerson_id()); + ch.setPersonId(this.getPersonId()); ch.setComment(this.getComment()); ch.setChanged(System.currentTimeMillis()); @@ -312,11 +312,11 @@ // TODO: changed check // ch.setId(id); - ch.setDt_info(this.getDt_info()); + ch.setDtInfo(this.getDtInfo()); ch.setType(this.getType()); ch.setValue(this.getValue()); ch.setExtended(this.getExtended()); - ch.setPerson_id(this.getPerson_id()); + ch.setPersonId(this.getPersonId()); ch.setComment(this.getComment()); ch.setChanged(System.currentTimeMillis()); @@ -393,11 +393,11 @@ * @param dt_info */ @Override - public void setDt_info(long dt_info) + public void setDtInfo(long dt_info) { - if (dt_info != getDt_info()) + if (dt_info != getDtInfo()) { - super.setDt_info(dt_info); + super.setDtInfo(dt_info); changed = true; } } @@ -426,7 +426,7 @@ */ public long getDateTime() { - return this.getDt_info(); + return this.getDtInfo(); } @@ -448,7 +448,7 @@ */ public void setDateTimeObject(ATechDate dt) { - this.setDt_info(dt.getATDateTimeAsLong()); + this.setDtInfo(dt.getATDateTimeAsLong()); } @@ -524,7 +524,7 @@ */ public String getSpecialId() { - return "PE_" + this.getDt_info() + "_" + this.getType(); + return "PE_" + this.getDtInfo() + "_" + this.getType(); } @@ -840,7 +840,7 @@ // this.getType()); // // if (map != -1) - // return new GraphValue(this.getDt_info(), map, this.getValue()); + // return new GraphValue(this.getDtInfo(), map, this.getValue()); // else return null; } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryProfile.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryProfile.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryProfile.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -123,12 +123,12 @@ { this.setId(pd.getId()); this.setName(pd.getName()); - this.setBasal_base(pd.getBasal_base()); - this.setBasal_diffs(pd.getBasal_diffs()); - this.setActive_from(pd.getActive_from()); - this.setActive_till(pd.getActive_till()); + this.setBasalBase(pd.getBasalBase()); + this.setBasalDiffs(pd.getBasalDiffs()); + this.setActiveFrom(pd.getActiveFrom()); + this.setActiveTill(pd.getActiveTill()); this.setExtended(pd.getExtended()); - this.setPerson_id(pd.getPerson_id()); + this.setPersonId(pd.getPersonId()); this.setComment(pd.getComment()); this.setChanged(pd.getChanged()); } @@ -163,7 +163,7 @@ */ public ATechDate getDateTimeObject() { - return new ATechDate(ATechDate.FORMAT_DATE_AND_TIME_S, this.getActive_from()); + return new ATechDate(ATechDate.FORMAT_DATE_AND_TIME_S, this.getActiveFrom()); } /* @@ -232,7 +232,7 @@ * // * this.entry_object.setBg(Integer.parseInt(this.getBGValue(OutputUtil * .BG_MGDL))); - * // this.entry_object.setDt_info(this.datetime); + * // this.entry_object.setDtInfo(this.datetime); * this.entry_object.setChanged(System.currentTimeMillis()); * // this.entry_object.setComment(createComment()); * } @@ -310,7 +310,7 @@ this.value_multiline = s_multi; - this.setBasal_diffs(s); + this.setBasalDiffs(s); } @@ -331,7 +331,7 @@ public String toString() { // OutputUtil o= null; - return "PumpValueEntryProfile [id=" + this.getId() + "] " + this.getBasal_diffs(); + return "PumpValueEntryProfile [id=" + this.getId() + "] " + this.getBasalDiffs(); } @@ -346,12 +346,12 @@ pd.setId(this.getId()); pd.setName(this.getName()); - pd.setBasal_base(this.getBasal_base()); - pd.setBasal_diffs(this.getBasal_diffs()); - pd.setActive_from(this.getActive_from()); - pd.setActive_till(this.getActive_till()); + pd.setBasalBase(this.getBasalBase()); + pd.setBasalDiffs(this.getBasalDiffs()); + pd.setActiveFrom(this.getActiveFrom()); + pd.setActiveTill(this.getActiveTill()); pd.setExtended("SOURCE=" + this.source); - pd.setPerson_id(this.getPerson_id()); + pd.setPersonId(this.getPersonId()); pd.setComment(this.getComment()); pd.setChanged(System.currentTimeMillis()); @@ -391,12 +391,12 @@ // pd.setId(this.getId()); pd.setName(this.getName()); - pd.setBasal_base(this.getBasal_base()); - pd.setBasal_diffs(this.getBasal_diffs()); - pd.setActive_from(this.getActive_from()); - pd.setActive_till(this.getActive_till()); + pd.setBasalBase(this.getBasalBase()); + pd.setBasalDiffs(this.getBasalDiffs()); + pd.setActiveFrom(this.getActiveFrom()); + pd.setActiveTill(this.getActiveTill()); pd.setExtended(this.getExtended()); - pd.setPerson_id(this.getPerson_id()); + pd.setPersonId(this.getPersonId()); pd.setComment(this.getComment()); pd.setChanged(System.currentTimeMillis()); @@ -414,12 +414,12 @@ this.setId(pd.getId()); this.setName(pd.getName()); - this.setBasal_base(pd.getBasal_base()); - this.setBasal_diffs(pd.getBasal_diffs()); - this.setActive_from(pd.getActive_from()); - this.setActive_till(pd.getActive_till()); + this.setBasalBase(pd.getBasalBase()); + this.setBasalDiffs(pd.getBasalDiffs()); + this.setActiveFrom(pd.getActiveFrom()); + this.setActiveTill(pd.getActiveTill()); this.setExtended(pd.getExtended()); - this.setPerson_id(pd.getPerson_id()); + this.setPersonId(pd.getPersonId()); this.setComment(pd.getComment()); this.setChanged(pd.getChanged()); @@ -524,7 +524,7 @@ case 3: return ""; // ATechDate.getDateTimeString(this.getDateTimeFormat(), - // this.getActive_till()); + // this.getActiveTill()); case 4: return this.getValue(); @@ -554,9 +554,9 @@ case OutputWriterType.CONSOLE: case OutputWriterType.FILE: return "Profile=" + this.getName() + ", From=" - + ATechDate.getDateTimeString(ATechDate.FORMAT_DATE_AND_TIME_S, this.getActive_from()) + + ATechDate.getDateTimeString(ATechDate.FORMAT_DATE_AND_TIME_S, this.getActiveFrom()) + ", Till=" - + ATechDate.getDateTimeString(ATechDate.FORMAT_DATE_AND_TIME_S, this.getActive_till()); + + ATechDate.getDateTimeString(ATechDate.FORMAT_DATE_AND_TIME_S, this.getActiveTill()); case OutputWriterType.GGC_FILE_EXPORT: { @@ -590,7 +590,7 @@ */ public String getSpecialId() { - return "PP_" + this.getActive_from() + "_" + this.getName(); + return "PP_" + this.getActiveFrom() + "_" + this.getName(); } @@ -613,7 +613,7 @@ public String getValue() { // this.processProfileSubEntries(1); - return this.getBasal_diffs(); + return this.getBasalDiffs(); } @@ -624,7 +624,7 @@ */ public long getDateTime() { - return this.getActive_from(); + return this.getActiveFrom(); } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAdditionalDataType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAdditionalDataType.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAdditionalDataType.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -9,7 +9,6 @@ import com.atech.utils.data.CodeEnumWithTranslation; import ggc.pump.data.PumpValuesEntryExt; -import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -51,7 +50,7 @@ /** * Additional data description */ - public static String[] addata_desc = null; + public static String[] descriptions = null; /** @@ -62,7 +61,7 @@ */ public String getTypeDescription(int idx) { - return this.addata_desc[idx]; + return this.descriptions[idx]; } @@ -73,7 +72,7 @@ */ public String[] getDescriptions() { - return this.addata_desc; + return this.descriptions; } static Map<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>(); @@ -81,26 +80,42 @@ static { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); + for (PumpAdditionalDataType pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (PumpAdditionalDataType pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } - String[] addata_desc_lcl = { ic.getMessage("SELECT_ADDITIONAL_DATA"), ic.getMessage("ADD_DATA_ACTIVITY"), - ic.getMessage("ADD_DATA_COMMENT"), ic.getMessage("ADD_DATA_BG"), - ic.getMessage("ADD_DATA_URINE"), ic.getMessage("ADD_DATA_CH"), - ic.getMessage("ADD_DATA_FOOD_DB"), ic.getMessage("ADD_DATA_FOOD_DESC"), }; + String[] additionalDataDescriptions = { ic.getMessage("SELECT_ADDITIONAL_DATA"), // + ic.getMessage("ADD_DATA_ACTIVITY"), // + ic.getMessage("ADD_DATA_COMMENT"), // + ic.getMessage("ADD_DATA_BG"), // + ic.getMessage("ADD_DATA_URINE"), // + ic.getMessage("ADD_DATA_CH"), // + ic.getMessage("ADD_DATA_FOOD_DB"), // + ic.getMessage("ADD_DATA_FOOD_DESC"), }; - addata_desc = addata_desc_lcl; + descriptions = additionalDataDescriptions; + + translated = true; } int code; String i18nKey; String translation; + static boolean translated = false; private PumpAdditionalDataType(int code, String i18nKey) @@ -170,11 +185,11 @@ { ArrayList<String> items = new ArrayList<String>(); - for (int i = 1; i < addata_desc.length; i++) + for (int i = 1; i < descriptions.length; i++) { - if (!old_data.containsKey(addata_desc[i])) + if (!old_data.containsKey(descriptions[i])) { - items.add(addata_desc[i]); + items.add(descriptions[i]); } } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAlarms.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAlarms.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAlarms.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -8,8 +8,6 @@ import com.atech.utils.ATDataAccess; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.pump.util.DataAccessPump; - /** * Application: GGC - GNU Gluco Control Plug-in: Pump Tool (support for Pump * devices) @@ -59,8 +57,61 @@ int code; String i18nKey; String translation; + static boolean translated = false; + static Map<Integer, PumpAlarms> alarmCodeMapping = new HashMap<Integer, PumpAlarms>(); + static Map<String, CodeEnumWithTranslation> translationMap = new HashMap<String, CodeEnumWithTranslation>(); + static String[] descriptions; + static + { + for (PumpAlarms pbt : values()) + { + alarmCodeMapping.put(pbt.code, pbt); + } + } + + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + + for (PumpAlarms pbt : values()) + { + pbt.setTranslation(ic.getMessage(pbt.i18nKey)); + translationMap.put(pbt.getTranslation(), pbt); + } + + String[] alarmDescriptions = { ic.getMessage("SELECT_SUBTYPE"), // + ic.getMessage("ALARM_CARTRIDGE_LOW"), // + ic.getMessage("ALARM_BATTERY_LOW"), // + ic.getMessage("ALARM_REPLACE_BATTERY"), // + ic.getMessage("ALARM_REVIEW_DATETIME"), // + ic.getMessage("ALARM_ALARM_CLOCK"), // + ic.getMessage("ALARM_PUMP_TIMER"), // + ic.getMessage("ALARM_TEMPORARY_BASAL_RATE_CANCELED"), // + ic.getMessage("ALARM_TEMPORARY_BASAL_RATE_OVER"), // + ic.getMessage("ALARM_BOLUS_CANCELED"), // + ic.getMessage("ALARM_NO_DELIVERY"), // + ic.getMessage("ALARM_EMPTY_CARTRIDGE"), // + ic.getMessage("ALARM_AUTO_OFF"), // + ic.getMessage("ALARM_CALL_SERVICE"),// + }; + + descriptions = alarmDescriptions; + + translated = true; + } + + + PumpAlarms(int code, String i18nKey) + { + this.code = code; + this.i18nKey = i18nKey; + } + + public int getCode() { return code; @@ -90,49 +141,7 @@ return this.name(); } - static Map<Integer, PumpAlarms> alarmCodeMapping = new HashMap<Integer, PumpAlarms>(); - static Map<String, CodeEnumWithTranslation> translationMap = new HashMap<String, CodeEnumWithTranslation>(); - static String[] alarm_desc; - static - { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); - - for (PumpAlarms pbt : values()) - { - pbt.setTranslation(ic.getMessage(pbt.i18nKey)); - translationMap.put(pbt.getTranslation(), pbt); - alarmCodeMapping.put(pbt.code, pbt); - } - - String[] alarm_desc_lcl = { ic.getMessage("SELECT_SUBTYPE"), // - ic.getMessage("ALARM_CARTRIDGE_LOW"), // - ic.getMessage("ALARM_BATTERY_LOW"), // - ic.getMessage("ALARM_REPLACE_BATTERY"), // - ic.getMessage("ALARM_REVIEW_DATETIME"), // - ic.getMessage("ALARM_ALARM_CLOCK"), // - ic.getMessage("ALARM_PUMP_TIMER"), // - ic.getMessage("ALARM_TEMPORARY_BASAL_RATE_CANCELED"), // - ic.getMessage("ALARM_TEMPORARY_BASAL_RATE_OVER"), // - ic.getMessage("ALARM_BOLUS_CANCELED"), // - ic.getMessage("ALARM_NO_DELIVERY"), // - ic.getMessage("ALARM_EMPTY_CARTRIDGE"), // - ic.getMessage("ALARM_AUTO_OFF"), // - ic.getMessage("ALARM_CALL_SERVICE"),// - }; - - alarm_desc = alarm_desc_lcl; - - } - - - private PumpAlarms(int code, String i18nKey) - { - this.code = code; - this.i18nKey = i18nKey; - } - - public static PumpAlarms getByCode(int code) { if (alarmCodeMapping.containsKey(code)) @@ -148,7 +157,7 @@ public static String[] getDescriptions() { - return alarm_desc; + return descriptions; } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBasalType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBasalType.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBasalType.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -7,8 +7,6 @@ import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.pump.util.DataAccessPump; - /** * Application: GGC - GNU Gluco Control * Plug-in: Pump Tool (support for Pump devices) @@ -56,14 +54,13 @@ public static boolean isTemporaryBasalType(PumpBasalType type) { - return (type == TemporaryBasalRate || type == TemporaryBasalRateProfile || type == TemporaryBasalRateCanceled - || type == TemporaryBasalRateEnded); + return (type == TemporaryBasalRate || type == TemporaryBasalRateProfile || type == TemporaryBasalRateCanceled || type == TemporaryBasalRateEnded); } /** * Basal Descriptions */ - public static String[] basal_desc = null; + public static String[] descriptions = null; static Map<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>(); static Map<Integer, PumpBasalType> codeMapping = new HashMap<Integer, PumpBasalType>(); @@ -70,34 +67,47 @@ static { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); + for (PumpBasalType pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (PumpBasalType 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_BASAL_TYPE"), ic.getMessage("BASAL_VALUE"), // - ic.getMessage("BASAL_PROFILE"), // - ic.getMessage("BASAL_TEMPORARY_BASAL_RATE"), // - ic.getMessage("BASAL_TEMPORARY_BASAL_RATE_PROFILE"), // - ic.getMessage("BASAL_PUMP_STATUS"), // - ic.getMessage("BASAL_TEMPORARY_BASAL_RATE_ENDED"), // - ic.getMessage("BASAL_TEMPORARY_BASAL_RATE_CANCELED"), - ic.getMessage("BASAL_VALUE_CHANGE"), // + String[] basalDescriptions = { ic.getMessage("SELECT_BASAL_TYPE"), + ic.getMessage("BASAL_VALUE"), // + ic.getMessage("BASAL_PROFILE"), // + ic.getMessage("BASAL_TEMPORARY_BASAL_RATE"), // + ic.getMessage("BASAL_TEMPORARY_BASAL_RATE_PROFILE"), // + ic.getMessage("BASAL_PUMP_STATUS"), // + ic.getMessage("BASAL_TEMPORARY_BASAL_RATE_ENDED"), // + ic.getMessage("BASAL_TEMPORARY_BASAL_RATE_CANCELED"), + ic.getMessage("BASAL_VALUE_CHANGE"), // }; - basal_desc = basal_desc_lcl; + descriptions = basalDescriptions; + + translated = true; } int code; String i18nKey; String translation; + static boolean translated = false; - private PumpBasalType(int code, String i18nKey) + PumpBasalType(int code, String i18nKey) { this.code = code; this.i18nKey = i18nKey; @@ -167,7 +177,7 @@ */ public static String[] getDescriptions() { - return basal_desc; + return descriptions; } } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBaseType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBaseType.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBaseType.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -5,8 +5,6 @@ import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.pump.util.DataAccessPump; - /** * Application: GGC - GNU Gluco Control Plug-in: Pump Tool (support for Pump * devices) @@ -54,12 +52,8 @@ static { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); - for (PumpBaseType pbt : values()) { - pbt.setTranslation(ic.getMessage(pbt.i18nKey)); - basetypeTranslationMapping.put(pbt.getTranslation(), pbt); basetypeCodeMapping.put(pbt.code, pbt); } } @@ -67,8 +61,24 @@ int code; String i18nKey; String translation; + static boolean translated = false; + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + + for (PumpBaseType pbt : values()) + { + pbt.setTranslation(ic.getMessage(pbt.i18nKey)); + basetypeTranslationMapping.put(pbt.getTranslation(), pbt); + } + + translated = true; + } + + public String getTranslation() { return translation; @@ -99,7 +109,7 @@ } - private PumpBaseType(int code, String i18nKey) + PumpBaseType(int code, String i18nKey) { this.code = code; this.i18nKey = i18nKey; Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBolusType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBolusType.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBolusType.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -6,8 +6,6 @@ import com.atech.utils.ATDataAccess; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.pump.util.DataAccessPump; - /** * Application: GGC - GNU Gluco Control * Plug-in: Pump Tool (support for Pump devices) @@ -44,36 +42,40 @@ ; - static String[] bolus_desc; + static String[] descriptions; static HashMap<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>(); static HashMap<Integer, PumpBolusType> codeMapping = new HashMap<Integer, PumpBolusType>(); + private static boolean translated; static { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); + for (PumpBolusType pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (PumpBolusType pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); - - // System.out.println("Tr: " + i18nControl.getMessage(pbt.i18nKey)); } - String[] bolus_desc_lcl = { ic.getMessage("SELECT_BOLUS_TYPE"), // - ic.getMessage("BOLUS_STANDARD"), // - ic.getMessage("BOLUS_AUDIO"), // - ic.getMessage("BOLUS_SQUARE"), // - ic.getMessage("BOLUS_MULTIWAVE"), }; + String[] bolusDescriptions = { ic.getMessage("SELECT_BOLUS_TYPE"), // + ic.getMessage("BOLUS_STANDARD"), // + ic.getMessage("BOLUS_AUDIO"), // + ic.getMessage("BOLUS_SQUARE"), // + ic.getMessage("BOLUS_MULTIWAVE"), }; - bolus_desc = bolus_desc_lcl; + descriptions = bolusDescriptions; - // for(String s : bolus_desc_lcl) - // { - // System.out.println("Tr: " + s); - // } - + translated = true; } int code; @@ -82,7 +84,7 @@ String valueTemplate; - private PumpBolusType(int code, String i18nKey) + PumpBolusType(int code, String i18nKey) { this.code = code; this.i18nKey = i18nKey; @@ -89,7 +91,7 @@ } - private PumpBolusType(int code, String i18nKey, String valueTemplate) + PumpBolusType(int code, String i18nKey, String valueTemplate) { this.code = code; this.i18nKey = i18nKey; @@ -160,6 +162,6 @@ */ public static String[] getDescriptions() { - return bolus_desc; + return descriptions; } } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationGroup.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationGroup.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationGroup.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -7,7 +7,6 @@ import com.atech.utils.data.CodeEnumWithTranslation; import ggc.plugin.data.enums.DeviceConfigurationGroup; -import ggc.pump.util.DataAccessPump; /** * Created by andy on 27.02.15. @@ -31,18 +30,14 @@ int code; String i18nKey; String translation; + static boolean translated; static { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); - for (PumpConfigurationGroup pbt : values()) { - pbt.setTranslation(ic.getMessage(pbt.i18nKey)); - translationMapping.put(pbt.getTranslation(), pbt); codeMapping.put(pbt.code, pbt); } - } @@ -53,6 +48,21 @@ } + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + + for (PumpConfigurationGroup pbt : values()) + { + pbt.setTranslation(ic.getMessage(pbt.i18nKey)); + translationMapping.put(pbt.getTranslation(), pbt); + } + + translated = true; + } + + public String getTranslation() { return translation; Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpErrors.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpErrors.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpErrors.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -8,8 +8,6 @@ import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.pump.util.DataAccessPump; - /** * Application: GGC - GNU Gluco Control * Plug-in: Pump Tool (support for Pump devices) @@ -73,36 +71,48 @@ static { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); + for (PumpErrors pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (PumpErrors pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } String[] errors_desc_lcl = { ic.getMessage("SELECT_SUBTYPE"), // - ic.getMessage("ERROR_CARTRIDGE_EMPTY"), // - ic.getMessage("ERROR_BATTERY_DEPLETED"), // - ic.getMessage("ERROR_AUTOMATIC_OFF"), // - ic.getMessage("ERROR_NO_DELIVERY"), // - ic.getMessage("ERROR_END_OF_OPERATION"), // - ic.getMessage("ERROR_MECHANICAL_ERROR"), // - ic.getMessage("ERROR_ELECTRONIC_ERROR"), // - ic.getMessage("ERROR_POWER_INTERRUPT"), // - ic.getMessage("ERROR_CARTRIDGE_ERROR"), // - ic.getMessage("ERROR_SET_NOT_PRIMED"), // - ic.getMessage("ERROR_DATA_INTERRUPTED"), // - ic.getMessage("ERROR_LANGUAGE_ERROR"), // - ic.getMessage("ERROR_INSULIN_CHANGED"), }; + ic.getMessage("ERROR_CARTRIDGE_EMPTY"), // + ic.getMessage("ERROR_BATTERY_DEPLETED"), // + ic.getMessage("ERROR_AUTOMATIC_OFF"), // + ic.getMessage("ERROR_NO_DELIVERY"), // + ic.getMessage("ERROR_END_OF_OPERATION"), // + ic.getMessage("ERROR_MECHANICAL_ERROR"), // + ic.getMessage("ERROR_ELECTRONIC_ERROR"), // + ic.getMessage("ERROR_POWER_INTERRUPT"), // + ic.getMessage("ERROR_CARTRIDGE_ERROR"), // + ic.getMessage("ERROR_SET_NOT_PRIMED"), // + ic.getMessage("ERROR_DATA_INTERRUPTED"), // + ic.getMessage("ERROR_LANGUAGE_ERROR"), // + ic.getMessage("ERROR_INSULIN_CHANGED"), }; errors_desc = errors_desc_lcl; + + translated = true; } int code; String i18nKey; String translation; + static boolean translated = false; private PumpErrors(int code, String i18nKey) Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpEventType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpEventType.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpEventType.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -7,8 +7,6 @@ import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.pump.util.DataAccessPump; - /** * Application: GGC - GNU Gluco Control * Plug-in: Pump Tool (support for Pump devices) @@ -78,10 +76,9 @@ BgFromMeter(70, "EVENT_BG_FROM_METER"), // BolusCancelled(80, "ALARM_BOLUS_CANCELED"), // - BolusWizard(81, "EVENT_BOLUS_WIZARD", - "BG=%s;CH=%s;CH_UNIT=%s;" - + "CH_INS_RATIO=%s;BG_INS_RATIO=%s;BG_TARGET_LOW=%s;BG_TARGET_HIGH=%s;BOLUS_TOTAL=%s;" - + "BOLUS_CORRECTION=%s;BOLUS_FOOD=%s;UNABSORBED_INSULIN=%s"), // + BolusWizard(81, "EVENT_BOLUS_WIZARD", "BG=%s;CH=%s;CH_UNIT=%s;" + + "CH_INS_RATIO=%s;BG_INS_RATIO=%s;BG_TARGET_LOW=%s;BG_TARGET_HIGH=%s;BOLUS_TOTAL=%s;" + + "BOLUS_CORRECTION=%s;BOLUS_FOOD=%s;UNABSORBED_INSULIN=%s"), // ChangeRemoteId(90, "EVENT_CHANGE_REMOTE_ID"), // @@ -94,39 +91,50 @@ static { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); + for (PumpEventType pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (PumpEventType pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } String[] descriptions_lcl = { ic.getMessage("SELECT_SUBTYPE"), ic.getMessage("EVENT_PRIME_INFUSION_SET"), - ic.getMessage("EVENT_CARTRIDGE_CHANGED"), - ic.getMessage("EVENT_REWIND_INFUSION_SET"), ic.getMessage("EVENT_RESERVOIR_LOW"), - ic.getMessage("EVENT_RESERVOIR_LOW_DESC"), ic.getMessage("EVENT_FILL_CANNULA"), - ic.getMessage("EVENT_SET_TEMPORARY_BASAL_RATE_TYPE"), - ic.getMessage("EVENT_SET_BASAL_PATTERN"), ic.getMessage("EVENT_BASAL_RUN"), + ic.getMessage("EVENT_CARTRIDGE_CHANGED"), + ic.getMessage("EVENT_REWIND_INFUSION_SET"), ic.getMessage("EVENT_RESERVOIR_LOW"), + ic.getMessage("EVENT_RESERVOIR_LOW_DESC"), ic.getMessage("EVENT_FILL_CANNULA"), + ic.getMessage("EVENT_SET_TEMPORARY_BASAL_RATE_TYPE"), + ic.getMessage("EVENT_SET_BASAL_PATTERN"), ic.getMessage("EVENT_BASAL_RUN"), - ic.getMessage("EVENT_BASAL_STOP"), ic.getMessage("EVENT_POWER_DOWN"), - ic.getMessage("EVENT_POWER_UP"), ic.getMessage("EVENT_SELF_TEST"), - ic.getMessage("EVENT_DOWNLOAD"), ic.getMessage("EVENT_DATETIME_SET"), - ic.getMessage("EVENT_DATETIME_CORRECT"), + ic.getMessage("EVENT_BASAL_STOP"), ic.getMessage("EVENT_POWER_DOWN"), + ic.getMessage("EVENT_POWER_UP"), ic.getMessage("EVENT_SELF_TEST"), + ic.getMessage("EVENT_DOWNLOAD"), ic.getMessage("EVENT_DATETIME_SET"), + ic.getMessage("EVENT_DATETIME_CORRECT"), - ic.getMessage("EVENT_SET_MAX_BASAL"), // - ic.getMessage("EVENT_SET_MAX_BOLUS"), // - ic.getMessage("EVENT_BATERRY_REMOVED"), // + ic.getMessage("EVENT_SET_MAX_BASAL"), // + ic.getMessage("EVENT_SET_MAX_BOLUS"), // + ic.getMessage("EVENT_BATERRY_REMOVED"), // - ic.getMessage("EVENT_BATERRY_REPLACED"), // - ic.getMessage("EVENT_BATERRY_LOW"), // - ic.getMessage("EVENT_BATERRY_LOW_DESC"), // - ic.getMessage("EVENT_BG_FROM_METER"), // - ic.getMessage("ALARM_BOLUS_CANCELED"), // - ic.getMessage("EVENT_BOLUS_WIZARD") }; + ic.getMessage("EVENT_BATERRY_REPLACED"), // + ic.getMessage("EVENT_BATERRY_LOW"), // + ic.getMessage("EVENT_BATERRY_LOW_DESC"), // + ic.getMessage("EVENT_BG_FROM_METER"), // + ic.getMessage("ALARM_BOLUS_CANCELED"), // + ic.getMessage("EVENT_BOLUS_WIZARD") }; descriptions = descriptions_lcl; + + translated = true; } int code; @@ -133,9 +141,10 @@ String i18nKey; String translation; private String valueTemplate; + static boolean translated = false; - private PumpEventType(int code, String i18nKey) + PumpEventType(int code, String i18nKey) { this.code = code; this.i18nKey = i18nKey; @@ -142,7 +151,7 @@ } - private PumpEventType(int code, String i18nKey, String valueTemplate) + PumpEventType(int code, String i18nKey, String valueTemplate) { this.code = code; this.i18nKey = i18nKey; Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpReport.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpReport.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpReport.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -6,8 +6,6 @@ import com.atech.utils.ATDataAccess; import com.atech.utils.data.CodeEnumWithTranslation; -import ggc.pump.util.DataAccessPump; - /** * Application: GGC - GNU Gluco Control * Plug-in: Pump Tool (support for Pump devices) @@ -48,7 +46,7 @@ /** * Report Descriptions */ - public static String[] report_desc = null; + public static String[] descriptions = null; static HashMap<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>(); static HashMap<Integer, PumpReport> codeMapping = new HashMap<Integer, PumpReport>(); @@ -55,30 +53,42 @@ static { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); + for (PumpReport pbt : values()) + { + codeMapping.put(pbt.code, pbt); + } + } + + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + for (PumpReport pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); translationMapping.put(pbt.getTranslation(), pbt); - codeMapping.put(pbt.code, pbt); } - String[] report_desc_lcl = { ic.getMessage("SELECT_SUBTYPE"), // - ic.getMessage("REPORT_MISC"), // - ic.getMessage("REPORT_BOLUS_TOTAL_DAY"), // - ic.getMessage("REPORT_BASAL_TOTAL_DAY"), // - ic.getMessage("REPORT_INSULIN_TOTAL_DAY"), }; + String[] reportDescriptions = { ic.getMessage("SELECT_SUBTYPE"), // + ic.getMessage("REPORT_MISC"), // + ic.getMessage("REPORT_BOLUS_TOTAL_DAY"), // + ic.getMessage("REPORT_BASAL_TOTAL_DAY"), // + ic.getMessage("REPORT_INSULIN_TOTAL_DAY"), }; - report_desc = report_desc_lcl; + descriptions = reportDescriptions; + + translated = true; } int code; String i18nKey; String translation; + static boolean translated = false; - private PumpReport(int code, String i18nKey) + PumpReport(int code, String i18nKey) { this.code = code; this.i18nKey = i18nKey; @@ -148,7 +158,7 @@ */ public static String[] getDescriptions() { - return report_desc; + return descriptions; } } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -4,7 +4,6 @@ import com.atech.utils.data.CodeEnumWithTranslation; import ggc.plugin.data.enums.ValueType; -import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -54,15 +53,20 @@ String i18nKey; String translation; ValueType valueType; + static boolean translated = false; - static + + public static void translateKeywords(I18nControlAbstract ic) { - I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); + if (translated) + return; for (RatioType pbt : values()) { pbt.setTranslation(ic.getMessage(pbt.i18nKey)); } + + translated = true; } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewBasalRateEstimator.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewBasalRateEstimator.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewBasalRateEstimator.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -186,16 +186,16 @@ * + hbValues.getPercentOfDaysInClass(2) + "\n" + * hbValues.getPercentOfDaysInClass(3) + "\n" * + hbValues.getPercentOfDaysInClass(4)); - * datasetBG.insertValue(0, m_ic.getMessage("DAYS_WITH_READINGS_0_1"), + * datasetBG.insertValue(0, i18nControl.getMessage("DAYS_WITH_READINGS_0_1"), * hbValues.getPercentOfDaysInClass(0)); - * datasetBG.insertValue(1, m_ic.getMessage("DAYS_WITH_READINGS_2_3"), + * datasetBG.insertValue(1, i18nControl.getMessage("DAYS_WITH_READINGS_2_3"), * hbValues.getPercentOfDaysInClass(1)); - * datasetBG.insertValue(2, m_ic.getMessage("DAYS_WITH_READINGS_4_5"), + * datasetBG.insertValue(2, i18nControl.getMessage("DAYS_WITH_READINGS_4_5"), * hbValues.getPercentOfDaysInClass(2)); - * datasetBG.insertValue(3, m_ic.getMessage("DAYS_WITH_READINGS_6_7"), + * datasetBG.insertValue(3, i18nControl.getMessage("DAYS_WITH_READINGS_6_7"), * hbValues.getPercentOfDaysInClass(3)); * datasetBG.insertValue(4, - * m_ic.getMessage("DAYS_WITH_READINGS_MORE_7"), + * i18nControl.getMessage("DAYS_WITH_READINGS_MORE_7"), * hbValues.getPercentOfDaysInClass(4)); */ @@ -204,8 +204,8 @@ /* * TimeSeries BGSeries = new - * TimeSeries(this.m_ic.getMessage("BLOOD_GLUCOSE"), Hour.class); - * TimeSeries CHSeries = new TimeSeries(this.m_ic.getMessage("CH_LONG"), + * TimeSeries(this.i18nControl.getMessage("BLOOD_GLUCOSE"), Hour.class); + * TimeSeries CHSeries = new TimeSeries(this.i18nControl.getMessage("CH_LONG"), * Hour.class); * TimeSeries ins1Series = new * TimeSeries(dataAccessPump.getSettings().getIns1Name(), Hour.class); @@ -216,7 +216,7 @@ XYSeries bg = new XYSeries(this.m_ic.getMessage("MEASURED_BASAL_BG"), true, true); // , // Hour.class); - // XYSeries CHSeries = new XYSeries(this.m_ic.getMessage("CH_LONG"), + // XYSeries CHSeries = new XYSeries(this.i18nControl.getMessage("CH_LONG"), // true, true); //, Hour.class); // XYSeries ins1Series = new // XYSeries(dataAccessPump.getSettings().getIns1Name(), true, true); //, @@ -412,7 +412,7 @@ insBURenderer.setSeriesShapesVisible(2, true); // AX dateAxis.setDateFormatOverride(new - // SimpleDateFormat(m_ic.getMessage("FORMAT_DATE_HOURS"))); + // SimpleDateFormat(i18nControl.getMessage("FORMAT_DATE_HOURS"))); // AX dateAxis.setAutoRange(false); /* * dateAxis.setRange(this.gluco_values.getRangeFrom().getTime(), @@ -423,8 +423,8 @@ */ // BGAxis.setAutoRangeIncludesZero(true); - // ax insBUAxis.setLabel(m_ic.getMessage("CH_LONG") + " / " + - // m_ic.getMessage("INSULIN")); + // ax insBUAxis.setLabel(i18nControl.getMessage("CH_LONG") + " / " + + // i18nControl.getMessage("INSULIN")); // ax insBUAxis.setAutoRangeIncludesZero(true); } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewDailyPump.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewDailyPump.java 2017-06-28 18:49:34 UTC (rev 1460) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewDailyPump.java 2017-06-28 18:57:17 UTC (rev 1461) @@ -26,7 +26,7 @@ import com.atech.utils.data.TimeZoneUtil; import ggc.core.data.graph.v1.view.GraphViewCGMSDailyAbstract; -import ggc.core.db.hibernate.ColorSchemeH; +import ggc.core.db.hibernate.settings.ColorSchemeH; import ggc.core.util.DataAccess; import ggc.plugin.data.DeviceValuesDay; import ggc.pump.data.PumpValuesEntry; Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/GraphViewBasal... [truncated message content] |
From: <and...@us...> - 2017-06-28 18:49:37
|
Revision: 1460 http://sourceforge.net/p/ggc/code/1460 Author: andyrozman Date: 2017-06-28 18:49:34 +0000 (Wed, 28 Jun 2017) Log Message: ----------- 1.2.4 [26.6.2017] - extended Hid4Java Communication handler - extended IBMCommunicationHandler - extended DeviceCompanyDefinition and DeviceHandlerType with None option - added ASCII enum - refactor PluginDb o not to duplicate code from HibernateDb - extended Minimed implementation for new modules - extended some of Readers - refactorings Modified Paths: -------------- trunk/ggc-plugins/ggc-plugins-base/docs/Changelog trunk/ggc-plugins/ggc-plugins-base/pom.xml trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/DevicePlugInServer.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/DeviceConfigurationDialog.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/Hid4JavaCommunicationHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/IBMCommunicationHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/DeviceDataHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/PlugInExceptionType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/db/PluginDb.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/defs/DevicePluginDefinitionAbstract.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/DeviceIdentification.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/PlugInBaseException.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/MinimedDeviceReader.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/dto/MinimedConnectionParametersDTO.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommInterfaceType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommandType.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/handler/MinimedDataHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/util/MinimedUtil.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/mgr/DeviceHandlerManager.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/DeviceHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/DeviceHandlerAbstract.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/DeviceInstanceWithHandler.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/v2/DeviceInterfaceV2.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/graph/PlugInGraphDialog.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/graph/view/CourseGraphView.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/graph/view/JFAbstractGraphView.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/gui/DeviceDisplayConfigDialog.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/gui/DeviceDisplayDataDialog.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/gui/DeviceInstructionsDialog.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/gui/OldDataReaderAbstract.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/gui/file/ImportFileSelectorDialog.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/gui/file/MultipleFileSelectorDialog.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/manager/company/AbstractDeviceCompany.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/protocol/BlueToothProtocol.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/protocol/SerialProtocol.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/protocol/reader/AbstractDeviceReader.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/protocol/reader/SerialDeviceReader.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/report/data/cgms/CGMSDayData.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/test/TestDeviceInstructions.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/util/DataAccessPlugInBase.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/util/PlugInDeviceUtil.java Added Paths: ----------- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/ASCII.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/comm/usb/ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/MinimedCommandTypeInterface.java trunk/ggc-plugins/ggc-plugins-base/src/main/templates/ trunk/ggc-plugins/ggc-plugins-base/src/main/templates/Version.java.template Modified: trunk/ggc-plugins/ggc-plugins-base/docs/Changelog =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/docs/Changelog 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/docs/Changelog 2017-06-28 18:49:34 UTC (rev 1460) @@ -2,6 +2,17 @@ Changes file for GGC Plug-In Base ================================== +1.2.4 [26.6.2017] +- extended Hid4Java Communication handler +- extended IBMCommunicationHandler +- extended DeviceCompanyDefinition and DeviceHandlerType with None option +- added ASCII enum +- refactor PluginDb o not to duplicate code from HibernateDb +- extended Minimed implementation for new modules +- extended some of Readers +- refactorings + + 1.2.3 [25.12.2016] - refactoring AccuChek meters to MeterInterface V2 Modified: trunk/ggc-plugins/ggc-plugins-base/pom.xml =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/pom.xml 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/pom.xml 2017-06-28 18:49:34 UTC (rev 1460) @@ -14,7 +14,16 @@ <version>${ggc-plugins-base.version}</version> + <build> + <plugins> + <plugin> + <groupId>com.google.code.maven-replacer-plugin</groupId> + <artifactId>maven-replacer-plugin</artifactId> + </plugin> + </plugins> + </build> + <dependencies> <dependency> <groupId>net.sf.ggc</groupId> @@ -72,14 +81,24 @@ <dependency> <groupId>org.scream3r</groupId> - <artifactId>jssc</artifactId> + <artifactId>jssc</artifactId> </dependency> + + + <dependency> + <groupId>com.ibm.old.comapi</groupId> + <artifactId>ibm-compapi</artifactId> + </dependency> + + </dependencies> + <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <version.file> + ${project.build.directory}/generated-sources/ggc/plugin/defs/Version.java + </version.file> </properties> </project> Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/DevicePlugInServer.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/DevicePlugInServer.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/DevicePlugInServer.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -11,6 +11,7 @@ import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.ATDataAccessLMAbstract; +import ggc.core.data.defs.ReturnActionType; import ggc.core.util.DataAccess; import ggc.plugin.cfg.DeviceConfigurationDialog; import ggc.plugin.data.DeviceDataHandler; @@ -141,7 +142,7 @@ if (command.equals("plugin_read_data")) { new DeviceInstructionsDialog(this.parent, dataAccessPlugIn, this, DeviceDataHandler.TRANSFER_READ_DATA); - this.client.executeReturnAction(RETURN_ACTION_READ_DATA); + this.client.executeReturnAction(ReturnActionType.ReadData); } else if (command.equals("plugin_read_config")) { @@ -156,19 +157,19 @@ { new DeviceConfigurationDialog((JFrame) this.parent, dataAccessPlugIn); refreshMenusAfterConfig(); - this.client.executeReturnAction(RETURN_ACTION_CONFIG); + this.client.executeReturnAction(ReturnActionType.ChangeConfig); } else if (command.equals("plugin_read_data_file")) { new DeviceInstructionsDialog(this.parent, dataAccessPlugIn, this, DeviceDataHandler.TRANSFER_READ_DATA_FILE); - this.client.executeReturnAction(RETURN_ACTION_READ_DATA); + this.client.executeReturnAction(ReturnActionType.ReadData); } else if (command.equals("plugin_read_config_file")) { new DeviceInstructionsDialog(this.parent, dataAccessPlugIn, this, DeviceDataHandler.TRANSFER_READ_CONFIGURATION_FILE); - this.client.executeReturnAction(RETURN_ACTION_READ_DATA); + this.client.executeReturnAction(ReturnActionType.ReadData); } else if (command.equals("plugin_about")) { Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/DeviceConfigurationDialog.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/DeviceConfigurationDialog.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/cfg/DeviceConfigurationDialog.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -189,7 +189,7 @@ showDevice(); // FIXME - // this.comm_port_comp.setCommunicationPort(m_ic.getMessage("NOT_SET")); + // this.comm_port_comp.setCommunicationPort(i18nControl.getMessage("NOT_SET")); this.comm_settings.setParameters(null); if (!dcd.doesDeviceSupportTimeFix()) @@ -292,7 +292,7 @@ /* * JPanel pan_comm_settings = ATSwingUtils.getPanel(20, 250, 410, 80, * null, - * new TitledBorder(m_ic.getMessage("COMMUNICATION_SETTINGS")), + * new TitledBorder(i18nControl.getMessage("COMMUNICATION_SETTINGS")), * main_panel); * this.comm_port_comp = new CommunicationPortComponent(dataAccess, * this); Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/Hid4JavaCommunicationHandler.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/Hid4JavaCommunicationHandler.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/Hid4JavaCommunicationHandler.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -25,9 +25,11 @@ List<USBDevice> allowedDevices; HidDevice hidDevice = null; - USBDevice selectedDevice; + private USBDevice selectedDevice; int timeoutMs = 100; - private USBDevice targetDevice; + private USBDevice targetDevice; // FIXME we may need to support serialNumber + // of device in future + HidServices hidServices; public boolean connectAndInitDevice() throws PlugInBaseException @@ -34,7 +36,13 @@ { LOG.debug("connectAndInitDevice - USB/Hid"); - HidServices hidServices; + // 0.5 + // HidServicesSpecification hidServicesSpecification = new + // HidServicesSpecification(); + // hidServicesSpecification.setAutoShutdown(true); + // hidServicesSpecification.setScanInterval(500); + // hidServicesSpecification.setPauseInterval(5000); + // hidServicesSpecification.setScanMode(ScanMode.SCAN_AT_FIXED_INTERVAL_WITH_PAUSE_AFTER_WRITE); try { @@ -61,36 +69,6 @@ private HidDevice findHidDevice(HidServices hidServices) throws PlugInBaseException { - // // 0.3.1 - // - // HidDeviceInfo selHidDeviceInfo = null; - // - // // Provide a list of attached devices - // for (HidDeviceInfo hidDeviceInfo : - // hidServices.getAttachedHidDevices()) - // { - // if (isCorrectDevice(hidDeviceInfo.getVendorId(), - // hidDeviceInfo.getProductId())) - // { - // selHidDeviceInfo = hidDeviceInfo; - // } - // } - // - // if (selHidDeviceInfo == null) - // { - // throw new PlugInBaseException(PlugInExceptionType.DeviceNotFound); - // } - // - // hidDevice = hidServices.getHidDevice(selectedDevice.getVendorId(), - // selectedDevice.getProductId(), null); - // - // if (hidDevice == null) - // { - // LOG.error("Device could not be opened."); - // throw new - // PlugInBaseException(PlugInExceptionType.DeviceCouldNotBeContacted); - // } - // 0.4.x HidDevice selHidDeviceInfo = null; @@ -97,8 +75,8 @@ // Provide a list of attached devices for (HidDevice hidDeviceInfo : hidServices.getAttachedHidDevices()) { - System.out.println(hidDeviceInfo); - if (isInAllowedDevicesList(hidDeviceInfo.getVendorId(), hidDeviceInfo.getProductId())) + LOG.debug("Attached USB Device: " + hidDeviceInfo); + if (isCorrectDevice(hidDeviceInfo.getVendorId(), hidDeviceInfo.getProductId())) { selHidDeviceInfo = hidDeviceInfo; } @@ -108,6 +86,10 @@ { throw new PlugInBaseException(PlugInExceptionType.DeviceNotFound); } + else + { + LOG.info("Device Selected: " + selHidDeviceInfo); + } hidDevice = selHidDeviceInfo; @@ -169,8 +151,17 @@ public void disconnectDevice() { - this.hidDevice.close(); - this.hidDevice = null; + if (this.hidDevice != null) + { + this.hidDevice.close(); + + this.hidDevice = null; + + } + + if (this.hidServices != null) + this.hidServices.shutdown(); // clean shutdown + } @@ -198,6 +189,12 @@ } + public int read(byte[] buffer, int timeout) throws PlugInBaseException + { + return this.hidDevice.read(buffer, timeout); + } + + public int read(byte[] b, int off, int len) throws PlugInBaseException { return 0; @@ -211,6 +208,7 @@ public void write(byte[] buffer) throws PlugInBaseException { + this.hidDevice.write(buffer, buffer.length, this.selectedDevice.getReportId()); } @@ -332,4 +330,10 @@ } } + + + public USBDevice getSelectedDevice() + { + return selectedDevice; + } } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/IBMCommunicationHandler.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/IBMCommunicationHandler.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/comm/IBMCommunicationHandler.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -88,7 +88,7 @@ private static final Logger LOG = LoggerFactory.getLogger(IBMCommunicationHandler.class); - // protected I18nControlAbstract m_ic = null; //I18nControl.getInstance(); + // protected I18nControlAbstract i18nControl = null; //I18nControl.getInstance(); // protected DataAccessPlugInBase dataAccess = null; // //DataAccessMeter.getInstance(); @@ -249,7 +249,7 @@ return isPortOpen; // if (portIdentifier == null) - // throw new ImportException(m_ic.getMessage("NO_COM_PORT_SPECIFIED")); + // throw new ImportException(i18nControl.getMessage("NO_COM_PORT_SPECIFIED")); try { Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/DeviceDataHandler.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/DeviceDataHandler.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/DeviceDataHandler.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -1,9 +1,6 @@ package ggc.plugin.data; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; +import java.util.*; import com.atech.db.DbDataReaderAbstract; import com.atech.db.DbDataReadingFinishedInterface; @@ -56,7 +53,7 @@ protected OutputWriter m_output_writer; protected DeviceConfigEntry configured_device; protected DbDataReaderAbstract m_reader; - protected Hashtable<String, DeviceValuesEntryInterface> old_data; + protected Map<String, DeviceValuesEntryInterface> old_data; protected StatusReporterInterface export_dialog; DbDataReadingFinishedInterface m_reading_inst = null; protected DeviceValuesTableModel m_model; @@ -221,7 +218,7 @@ * * @return Hashtable with old data */ - public Hashtable<String, DeviceValuesEntryInterface> getOldData() + public Map<String, DeviceValuesEntryInterface> getOldData() { return this.old_data; } @@ -356,7 +353,7 @@ * * @param data data as Hashtable<String,?> data */ - public void setDeviceData(Hashtable<String, DeviceValuesEntryInterface> data) + public void setDeviceData(Map<String, DeviceValuesEntryInterface> data) { if (data == null || data.size() == 0) { Added: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/ASCII.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/ASCII.java (rev 0) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/ASCII.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -0,0 +1,75 @@ +package ggc.plugin.data.enums; + +/** + * Created by andy on 13.06.17. + */ +public enum ASCII +{ + + NUL(0x00, 0), // + SOH(0x01, 1), // + STX(0x02, 2), // + ETX(0x03, 3), // + EOT(0x04, 4), // + ENQ(0x05, 5), // + ACK(0x06, 6), // + BEL(0x07, 7), // + BS(0x08, 8), // + TAB(0x09, 9), // + LF(0x0A, 10), // + VT(0x0B, 11), // + FF(0x0C, 12), // + CR(0x0D, 13), // + SO(0x0E, 14), // + SI(0x0F, 15), // + + DLE(0x10, 16), // + DC1(0x11, 17), // + DC2(0x12, 18), // + DC3(0x13, 19), // + DC4(0x14, 20), // + NAK(0x15, 21), // + SYN(0x16, 22), // + ETB(0x17, 23), // + CAN(0x18, 24), // + EM(0x19, 25), // + SUB(0x1A, 26), // + ESC(0x1B, 27), // + FS(0x1C, 28), // + GS(0x1D, 29), // + RS(0x1E, 30), // + US(0x1F, 31), // + SPC(0x20, 32), // + ; + + // public static final char STX = '\002'; + // public static final char ETX = '\003'; + // public static final char EOT = '\004'; + // public static final char ENQ = '\005'; + // public static final char ACK = '\006'; + // public static final char ETB = '\027'; + // public static final char LF = '\n'; + // public static final char CR = '\r'; + // public static final char NAK = '\025'; + // public static final char CAN = '\030'; + + private byte value; + + + ASCII(int code) + { + this.value = (byte) code; + } + + + ASCII(int code, int code2) + { + this.value = (byte) code; + } + + + public byte getValue() + { + return value; + } +} Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -30,6 +30,7 @@ public enum DeviceCompanyDefinition { + NoCompany(0, "No Company", "", DeviceImplementationStatus.NotAvailable), // // 1xx = Meter Ascensia(101, "Ascensia/Bayer", "", DeviceImplementationStatus.Done), // Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -30,6 +30,7 @@ public enum DeviceHandlerType { + NullHandler(DownloadSupportType.NotSupportedByGGC), // NoHandler(DownloadSupportType.NotSupportedByGGC), // NoSupportInDevice(DownloadSupportType.NotSupportedByDevice), // Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/PlugInExceptionType.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/PlugInExceptionType.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/PlugInExceptionType.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -48,6 +48,7 @@ DeviceNAKOrInvalidCRCDesc("Device reported NAK or an invalid CRC error. (%s)"), // DeviceNAK("Device reported NAK error [%s]."), // + DeviceSerialNumberCouldNotBeRead("Serial number was not read from device."), // DeviceInvalidCommand("Device reported an invalid command error."), // DeviceInvalidParameterDesc("Device reported an invalid parameter error for parameter %s."), // @@ -84,6 +85,7 @@ ParsingErrorUnsupportedDataLenth("EXC_PARSING_ERROR_UNSUPP_DATA_LENGTH"), // FailedCRCCheck("EXC_FAILED_CRC_CHECK"), // FailedCRCCheckInPacket("Failed CRC check in packet."), // + FailedEncryptionDecryption("Failure on encrypt/decrypt of data."), // UnsupportedTypeOfParametersForCommand("EXC_UNSUPPORTED_TYPE_OF_PARAMS_FOR_CMD"), // // Handler @@ -94,6 +96,7 @@ DeviceInvalidResponse("Device returned invalid response. Expected: %s, Received: %s"), // DeviceCommandInvalidResponse("Device was sent command [%s], but it responded with [%s], instead of [%s]"), // + DeviceUnexpectedResponse("Device returned unexpected response. Received: %s"), // DeviceReturnedError("Device returned error [command=%s, errorCode=%s, errorDescription=%s, returnedData=%s]"), // Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/db/PluginDb.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/db/PluginDb.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/db/PluginDb.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -1,22 +1,28 @@ package ggc.plugin.db; -import java.sql.SQLException; import java.util.ArrayList; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.List; +import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.Session; -import org.hibernate.Transaction; +import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.atech.db.hibernate.DatabaseObjectHibernate; import com.atech.db.hibernate.HibernateDb; +import com.atech.db.hibernate.HibernateObject; import com.atech.graphics.graphs.v2.data.GraphDbDataRetriever; import com.atech.utils.data.ATechDate; + import ggc.core.db.hibernate.cgms.CGMSDataH; +import ggc.plugin.util.DataAccessPlugInBase; /** * Application: GGC - GNU Gluco Control @@ -52,20 +58,18 @@ private static final Logger LOG = LoggerFactory.getLogger(PluginDb.class); protected HibernateDb db; + protected DataAccessPlugInBase dataAccess = null; - private int m_errorCode = 0; - private String m_errorDesc = ""; - private String m_addId = ""; - /** * Constructor * * @param db */ - public PluginDb(HibernateDb db) + public PluginDb(HibernateDb db, DataAccessPlugInBase dataAccess) { this.db = db; + this.dataAccess = dataAccess; } @@ -92,48 +96,7 @@ */ public boolean add(Object obj) { - - if (obj instanceof DatabaseObjectHibernate) - { - DatabaseObjectHibernate doh = (DatabaseObjectHibernate) obj; - - LOG.info(doh.getObjectName() + "::DbAdd"); - - try - { - String id = doh.DbAdd(getSession()); // getSession()); - this.m_addId = id; - // System.out.println("Add:" + doh); - return true; - } - catch (SQLException ex) - { - setError(1, ex.getMessage(), doh.getObjectName()); - LOG.error("SQLException on add: " + ex, ex); - Exception eee = ex.getNextException(); - - if (eee != null) - { - LOG.error("Nested Exception on add: " + eee.getMessage(), eee); - } - return false; - } - catch (Exception ex) - { - setError(1, ex.getMessage(), doh.getObjectName()); - LOG.error("Exception on add: " + ex, ex); - return false; - } - - } - else - { - setError(-2, "Object is not DatabaseObjectHibernate instance", "GGCDb"); - - LOG.error("Internal error on add: " + obj); - return false; - } - + return this.db.add(obj); } @@ -166,25 +129,7 @@ */ public long addHibernate(Object obj) { - - LOG.info("addHibernate::" + obj.toString()); - - try - { - Session sess = getSession(); - Transaction tx = sess.beginTransaction(); - - Long val = (Long) sess.save(obj); - tx.commit(); - - return val.longValue(); - } - catch (Exception ex) - { - LOG.error("Exception on addHibernate: " + ex, ex); - return -1; - } - + return this.db.addHibernate(obj); } @@ -196,45 +141,7 @@ */ public boolean edit(Object obj) { - - if (obj instanceof DatabaseObjectHibernate) - { - DatabaseObjectHibernate doh = (DatabaseObjectHibernate) obj; - - LOG.info(doh.getObjectName() + "::DbEdit"); - - try - { - doh.DbEdit(getSession()); - // System.out.println("Edit:" + doh); - return true; - } - catch (SQLException ex) - { - setError(1, ex.getMessage(), doh.getObjectName()); - LOG.error("SQLException on edit: " + ex, ex); - Exception eee = ex.getNextException(); - - if (eee != null) - { - LOG.error("Nested Exception on edit: " + eee.getMessage(), eee); - } - return false; - } - catch (Exception ex) - { - setError(1, ex.getMessage(), doh.getObjectName()); - LOG.error("Exception on edit: " + ex, ex); - return false; - } - } - else - { - setError(-2, "Object is not DatabaseObjectHibernate instance", "GGCDb"); - LOG.error("Internal error on edit: " + obj); - return false; - } - + return this.db.edit(obj); } @@ -246,27 +153,7 @@ */ public boolean editHibernate(Object obj) { - - LOG.info("editHibernate::" + obj.toString()); - - try - { - Session sess = getSession(); - Transaction tx = sess.beginTransaction(); - - sess.update(obj); - - tx.commit(); - - return true; - } - catch (Exception ex) - { - LOG.error("Exception on editHibernate: " + ex, ex); - // ex.printStackTrace(); - return false; - } - + return this.db.editHibernate(obj); } @@ -278,27 +165,7 @@ */ public boolean deleteHibernate(Object obj) { - - LOG.info("deleteHibernate::" + obj.toString()); - - try - { - Session sess = getSession(); - Transaction tx = sess.beginTransaction(); - - sess.delete(obj); - - tx.commit(); - - return true; - } - catch (Exception ex) - { - LOG.error("Exception on deleteHibernate: " + ex, ex); - // ex.printStackTrace(); - return false; - } - + return this.db.deleteHibernate(obj); } @@ -310,45 +177,7 @@ */ public boolean get(Object obj) { - - if (obj instanceof DatabaseObjectHibernate) - { - DatabaseObjectHibernate doh = (DatabaseObjectHibernate) obj; - - LOG.info(doh.getObjectName() + "::DbGet"); - - try - { - doh.DbGet(getSession()); - return true; - } - catch (SQLException ex) - { - setError(1, ex.getMessage(), doh.getObjectName()); - LOG.error("SQLException on get: " + ex, ex); - Exception eee = ex.getNextException(); - - if (eee != null) - { - LOG.error("Nested Exception on get: " + eee.getMessage(), eee); - } - return false; - } - catch (Exception ex) - { - setError(1, ex.getMessage(), doh.getObjectName()); - LOG.error("Exception on get: " + ex, ex); - return false; - } - - } - else - { - setError(-2, "Object is not DatabaseObjectHibernate instance", "GGCDb"); - LOG.error("Internal error on get: " + obj); - return false; - } - + return this.db.get(obj); } @@ -360,54 +189,7 @@ */ public boolean delete(Object obj) { - - if (obj instanceof DatabaseObjectHibernate) - { - DatabaseObjectHibernate doh = (DatabaseObjectHibernate) obj; - - LOG.info(doh.getObjectName() + "::DbDelete"); - - try - { - - if (doh.DbHasChildren(getSession())) - { - setError(-3, "Object has children object", doh.getObjectName()); - LOG.error(doh.getObjectName() + " had Children objects"); - return false; - } - - doh.DbDelete(getSession()); - - return true; - } - catch (SQLException ex) - { - setError(1, ex.getMessage(), doh.getObjectName()); - LOG.error("SQLException on delete: " + ex, ex); - Exception eee = ex.getNextException(); - - if (eee != null) - { - LOG.error("Nested Exception on delete: " + eee.getMessage(), eee); - } - return false; - } - catch (Exception ex) - { - setError(1, ex.getMessage(), doh.getObjectName()); - LOG.error("Exception on delete: " + ex, ex); - return false; - } - - } - else - { - setError(-2, "Object is not DatabaseObjectHibernate instance", "GGCDb"); - LOG.error("Internal error on delete: " + obj); - return false; - } - + return this.db.delete(obj); } @@ -417,7 +199,7 @@ */ public String addGetId() { - return this.m_addId; + return this.db.addGetId(); } @@ -428,7 +210,7 @@ */ public int getErrorCode() { - return this.m_errorCode; + return this.db.getErrorCode(); } @@ -439,7 +221,7 @@ */ public String getErrorDescription() { - return this.m_errorDesc; + return this.db.getErrorDescription(); } @@ -452,8 +234,7 @@ */ public void setError(int code, String desc, String source) { - this.m_errorCode = code; - this.m_errorDesc = source + " : " + desc; + this.db.setError(code, desc, source); } @@ -502,4 +283,70 @@ return listCGMSData; } + + public <E extends HibernateObject> List<E> getHibernateData(Class<E> clazz, // + List<? extends Criterion> criterionList, // + int sessionNumber) + { + return getHibernateData(clazz, criterionList, null, sessionNumber); + } + + + public <E extends HibernateObject> List<E> getHibernateData(Class<E> clazz, // + List<? extends Criterion> criterionList) + { + return getHibernateData(clazz, criterionList, null, 1); + } + + + public <E extends HibernateObject> List<E> getHibernateData(Class<E> clazz, // + List<? extends Criterion> criterionList, // + List<Order> orderList) + { + return getHibernateData(clazz, criterionList, orderList, 1); + } + + + public <E extends HibernateObject> List<E> getHibernateData(Class<E> clazz, // + List<? extends Criterion> criterionList, // + List<Order> orderList, // + int sessionNumber) + { + return this.db.getHibernateData(clazz, criterionList, orderList, sessionNumber); + } + + + /** + * Get All Elements Count + * + * @return + */ + public int getAllElementsCount(Class<? extends HibernateObject> hibernateClazz, // + List<? extends Criterion> criterionList) + { + try + { + int sum_all = 0; + + Criteria criteria = this.getSession().createCriteria(hibernateClazz); + criteria.add(Restrictions.eq("personId", (int) dataAccess.getCurrentUserId())); + criteria.add(Restrictions.like("extended", "%" + dataAccess.getSourceDevice() + "%")); + + for (Criterion criterion : criterionList) + { + criteria.add(criterion); + } + + criteria.setProjection(Projections.rowCount()); + Integer in = (Integer) criteria.list().get(0); + return in.intValue(); + } + catch (Exception ex) + { + LOG.error("getAllElementsCount: " + ex, ex); + ex.printStackTrace(); + return 0; + } + } + } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/defs/DevicePluginDefinitionAbstract.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/defs/DevicePluginDefinitionAbstract.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/defs/DevicePluginDefinitionAbstract.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -8,12 +8,13 @@ import com.atech.app.defs.AppPluginDefinitionAbstract; import com.atech.i18n.I18nControlRunner; import com.atech.i18n.mgr.LanguageManager; +import com.atech.utils.java.VersionResolver; import ggc.core.plugins.GGCPluginType; +import ggc.plugin.device.mgr.DeviceHandlerManager; import ggc.plugin.graph.PluginGraphDefinition; import ggc.plugin.list.BaseListEntry; import ggc.plugin.report.PluginReportDefinition; -import ggc.plugin.util.DataAccessPlugInBase; /** * Created by andy on 18.10.15. @@ -21,32 +22,109 @@ public abstract class DevicePluginDefinitionAbstract extends AppPluginDefinitionAbstract { - // FIXME-Andy - public DevicePluginDefinitionAbstract(DataAccessPlugInBase dataAccess) + // private static final Logger LOG = + // LoggerFactory.getLogger(DevicePluginDefinitionAbstract.class); + + protected String pluginVersion; + protected GGCPluginType pluginType; + protected String pluginActionPrefix; + protected String pluginVersionClass; + protected String pluginName; + protected boolean useBaseLibraries = true; + + + public DevicePluginDefinitionAbstract(LanguageManager languageManager, I18nControlRunner i18nControlRunner) { - super(dataAccess); + super(languageManager, i18nControlRunner); + initVersion(); } - public DevicePluginDefinitionAbstract(LanguageManager languageManager, I18nControlRunner i18nControlRunner) + public DevicePluginDefinitionAbstract(LanguageManager languageManager, // + I18nControlRunner i18nControlRunner, // + String pluginName, // + GGCPluginType pluginType, // + String pluginActionPrefix, // + String pluginVersionClass) { super(languageManager, i18nControlRunner); + this.pluginName = pluginName; + this.pluginType = pluginType; + this.pluginActionPrefix = pluginActionPrefix; + this.pluginVersionClass = pluginVersionClass; + + initVersion(); } + private void initVersion() + { + if (this.getPluginVersionClass() != null) + { + this.pluginVersion = VersionResolver.getVersion(this.getPluginVersionClass(), + this.getClass().getSimpleName()); + } + } + + public List<FeaturesGroup> getFeatures() { - List<FeaturesGroup> lst_features = new ArrayList<FeaturesGroup>(); + List<FeaturesGroup> listFeatures = new ArrayList<FeaturesGroup>(); - addFeatureGroup("IMPLEMENTED_FEATURES", getImplementedFeatures(), lst_features); - addFeatureGroup("SUPPORTED_DEVICES", getSupportedDevices(), lst_features); - addFeatureGroup("NOT_IMPLEMENTED_FEATURES", getNotImplementedFeatures(), lst_features); - addFeatureGroup("PLANNED_DEVICES", getPlannedDevices(), lst_features); + addFeatureGroup("IMPLEMENTED_FEATURES", getImplementedFeatures(), listFeatures); + addFeatureGroup("SUPPORTED_DEVICES", getSupportedDevices(), listFeatures); + addFeatureGroup("NOT_IMPLEMENTED_FEATURES", getNotImplementedFeatures(), listFeatures); + addFeatureGroup("PLANNED_DEVICES", getPlannedDevices(), listFeatures); - return lst_features; + return listFeatures; } + /** + * Get Name of Plugin (for internal use) + * + * @return + */ + public String getPluginName() + { + return this.pluginName; + } + + + /** + * getPluginType - get Plugin Type + */ + public GGCPluginType getPluginType() + { + return this.pluginType; + } + + + /** + * This is prefix for this plugins actions. So for example PumpPlugin has + * prefix 'pumps_', so we know that actionCommand that starts with 'pumps_' is + * intended for this plugin. + * + * @return Prefix with underscore + */ + public String getPluginActionsPrefix() + { + return this.pluginActionPrefix; + } + + + public String getPluginVersion() + { + return this.pluginVersion; + } + + + public String getPluginVersionClass() + { + return this.pluginVersionClass; + } + + public List<FeaturesEntry> getImplementedFeatures() { return null; @@ -71,13 +149,13 @@ } - public abstract GGCPluginType getPluginType(); - - public abstract List<BaseListEntry> getWebListerItems(); - public abstract String getWebListerDescription(); + public String getWebListerDescription() + { + return this.i18nControl.getMessage("DEVICE_LIST_WEB_DESC"); + } public abstract PluginReportDefinition getReportsDefinition(); @@ -87,19 +165,19 @@ /** - * This is prefix for this plugins actions. So for example PumpPlugin has - * prefix 'pumps_', so we know that actionCommand that starts with 'pumps_' is - * intended for this plugin. - * - * @return Prefix with underscore + * Register Device Handlers - Used for registration of DeviceHandlers for Devices V2. + * This will dinamically load all handlers. If you had to change loading of + * handlers, override this method. */ - public abstract String getPluginActionsPrefix(); + public void registerDeviceHandlers() + { + // register dynamic handlers + DeviceHandlerManager.getInstance().registerDeviceHandlersDynamically(getPluginType()); + } - /** - * Register Device Handlers - Used for registration of DeviceHandlers for Devices V2 - */ - public void registerDeviceHandlers() + public boolean isUseBaseLibraries() { + return useBaseLibraries; } } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/DeviceIdentification.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/DeviceIdentification.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/DeviceIdentification.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -88,7 +88,7 @@ // DataAccessPlugInBase da - // I18nControlAbstract m_ic; + // I18nControlAbstract i18nControl; /** * Constructor @@ -121,7 +121,7 @@ public String getInformation(String prefix) { StringBuffer sb = new StringBuffer(); - // I18nControlAbstract m_ic = + // I18nControlAbstract i18nControl = // DataAccess.getInstance().getI18nControlInstance(); sb.append(prefix); @@ -165,7 +165,7 @@ return this.getShortInformationFile(); StringBuffer sb = new StringBuffer(); - // I18nControlAbstract m_ic = + // I18nControlAbstract i18nControl = // DataAccess.getInstance().getI18nControlInstance(); sb.append(this.company); @@ -205,7 +205,7 @@ private String getShortInformationFile() { StringBuffer sb = new StringBuffer(); - // I18nControlAbstract m_ic = + // I18nControlAbstract i18nControl = // DataAccess.getInstance().getI18nControlInstance(); sb.append(this.company); Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/PlugInBaseException.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/PlugInBaseException.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/PlugInBaseException.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -138,6 +138,12 @@ } + public PlugInBaseException(PlugInExceptionType exceptionType, Throwable ex) + { + super(PlugInBaseException.createMessage(exceptionType, null), ex); + this.setExceptionType(exceptionType); + } + public PlugInBaseException(PlugInExceptionType exceptionType, Exception ex) { super(PlugInBaseException.createMessage(exceptionType, null), ex); @@ -144,7 +150,6 @@ this.setExceptionType(exceptionType); } - public PlugInBaseException(PlugInExceptionType exceptionType, Object[] parameters) { super(PlugInBaseException.createMessage(exceptionType, parameters)); Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/MinimedDeviceReader.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/MinimedDeviceReader.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/MinimedDeviceReader.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -135,6 +135,13 @@ } + @Override + public void closeDevice() throws PlugInBaseException + { + // close is handled internally + } + + public void customInitAndChecks() throws PlugInBaseException { } Added: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/MinimedCommandTypeInterface.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/MinimedCommandTypeInterface.java (rev 0) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/MinimedCommandTypeInterface.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -0,0 +1,11 @@ +package ggc.plugin.device.impl.minimed.data; + +/** + * Created by andy on 14.06.17. + */ +public interface MinimedCommandTypeInterface +{ + + int getCommandCode(); + +} Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/dto/MinimedConnectionParametersDTO.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/dto/MinimedConnectionParametersDTO.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/data/dto/MinimedConnectionParametersDTO.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -36,6 +36,7 @@ public MinimedCommInterfaceType interfaceType; public String serialNumber; public int[] serialNumberBCD; + private String nextLinkConnector; public MinimedConnectionParametersDTO(String communicationParameters) @@ -62,4 +63,16 @@ String[] val = value.split("!="); return val[1]; } + + + public void setNextLinkConnector(String nextLinkConnector) + { + this.nextLinkConnector = nextLinkConnector; + } + + + public String getNextLinkConnector() + { + return nextLinkConnector; + } } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommInterfaceType.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommInterfaceType.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommInterfaceType.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -47,8 +47,9 @@ CareLinkUSB("Medtronic CareLink USB", true), // // Contour Next Link - ContourUSBNextLink("Contour Next Link", false), // - ContourUSBNextLink24("Contour Next Link 2.4", false), // + ContourNextLink1("Contour Next Link 1", false), // + ContourNextLink2("Contour Next Link 2", false), // + ContourNextLink24("Contour Next Link 2.4", false), // ; static Map<String, MinimedCommInterfaceType> mapByName; @@ -57,7 +58,6 @@ String description; boolean supported; - static { mapByName = new HashMap<String, MinimedCommInterfaceType>(); Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommandType.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommandType.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/enums/MinimedCommandType.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -7,6 +7,8 @@ import org.apache.commons.lang.NotImplementedException; +import ggc.plugin.device.impl.minimed.data.MinimedCommandTypeInterface; + /** * Application: GGC - GNU Gluco Control * Plug-in: GGC PlugIn Base (base class for all plugins) @@ -35,7 +37,7 @@ // Lot of stuff in here is legacy stuff for CareLink(1). We should remove it in // future. -public enum MinimedCommandType implements Serializable +public enum MinimedCommandType implements Serializable, MinimedCommandTypeInterface { // All (9) CommandAck(6, "Acknowledge", MinimedTargetType.ActionCommand, MinimedDeviceType.All, @@ -86,7 +88,7 @@ MinimedCommandParameterType.NoParameters), // init RealTimeClock(112, "Real Time Clock", MinimedTargetType.PumpConfiguration, MinimedDeviceType.All, - MinimedCommandParameterType.NoParameters), // + MinimedCommandParameterType.NoParameters), // 0x70 BatteryStatus(127, "Read Battery Status", MinimedTargetType.PumpConfiguration, MinimedDeviceType.All, MinimedCommandParameterType.NoParameters), // @@ -98,7 +100,7 @@ MinimedCommandParameterType.NoParameters), // HistoryData_511(128, "History data", MinimedTargetType.PumpData, MinimedDeviceType.Minimed_511, - MinimedCommandParameterType.SubCommands, 1024, 32, 0), // + MinimedCommandParameterType.SubCommands, 1024, 32, 0), // 0x80 Profile_STD_511(122, "Profile Standard", MinimedTargetType.PumpDataAndConfiguration, MinimedDeviceType.Minimed_511, MinimedCommandParameterType.NoParameters, 128, 1, 8), // FIXME_ @@ -115,12 +117,12 @@ SetTemporaryBasal(76, "Set Temp Basal Rate (bolus detection only)", MinimedTargetType.InitCommand, MinimedDeviceType.Minimed_512andHigher, MinimedCommandParameterType.NoParameters, getByteArray(0, 0, 0)), - // util.getCommand(MinimedCommand.SET_TEMPORARY_BASAL).allowedRetries - // = 0; + // util.getCommand(MinimedCommand.SET_TEMPORARY_BASAL).allowedRetries + // = 0; // 512 Config PumpModel(141, "Pump Model", MinimedTargetType.PumpConfiguration, MinimedDeviceType.Minimed_512andHigher, - MinimedCommandParameterType.NoParameters), // + MinimedCommandParameterType.NoParameters), // 0x8D BGTargets_512(140, "BG Targets", MinimedTargetType.PumpConfiguration, MinimedDeviceType.Minimed_512_712, MinimedCommandParameterType.NoParameters), // @@ -148,7 +150,7 @@ // 512 Data HistoryData(128, "History data", MinimedTargetType.PumpData, MinimedDeviceType.Minimed_512andHigher, - MinimedCommandParameterType.SubCommands, 1024, 36, 0), // + MinimedCommandParameterType.SubCommands, 1024, 36, 0), // 0x80 // new MinimedCommandHistoryData(36) Profile_STD(146, "Profile Standard", MinimedTargetType.PumpConfiguration, MinimedDeviceType.Minimed_512andHigher, @@ -223,6 +225,24 @@ // 553 // 554 + // var MESSAGES = { + // READ_TIME : 0x70, + // READ_BATTERY_STATUS: 0x72, + // READ_HISTORY : 0x80, + // READ_CARB_RATIOS : 0x8A, + // READ_INSULIN_SENSITIVITIES: 0x8B, + // READ_MODEL : 0x8D, + // READ_PROFILE_STD : 0x92, + // READ_PROFILE_A : 0x93, + // READ_PROFILE_B : 0x94, + // READ_CBG_HISTORY: 0x9A, + // READ_ISIG_HISTORY: 0x9B, + // READ_CURRENT_PAGE : 0x9D, + // READ_BG_TARGETS : 0x9F, + // READ_SETTINGS : 0xC0, 192 + // READ_CURRENT_CBG_PAGE : 0xCD + // }; + ; public int commandCode = 0; @@ -262,7 +282,6 @@ public byte weirdByte; - // public boolean hasSubCommands = false; static Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/handler/MinimedDataHandler.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/handler/MinimedDataHandler.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/handler/MinimedDataHandler.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -78,7 +78,7 @@ */ public MinimedDataHandler(DataAccessPlugInBase dataAccess, MinimedConnectionParametersDTO connectionParametersDTO, MinimedDeviceType deviceType, MinimedDeviceReader deviceReader, OutputWriter writer) - throws PlugInBaseException + throws PlugInBaseException { this.dataAccess = dataAccess; initDataHandler(connectionParametersDTO, deviceType, deviceReader, writer); @@ -120,10 +120,13 @@ communicationProtocol = new MinimedCommunicationCareLinkUSB(dataAccess, this); } break; - case ContourUSBNextLink: + case ContourNextLink2: { - throw new PlugInBaseException(PlugInExceptionType.YetUnsupportedInterface, - new Object[] { connectionParametersDTO.interfaceType.name() }); + // throw new + // PlugInBaseException(PlugInExceptionType.YetUnsupportedInterface, + // new Object[] { + // connectionParametersDTO.interfaceType.name() }); + break; } case None: Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/util/MinimedUtil.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/util/MinimedUtil.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/impl/minimed/util/MinimedUtil.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -71,6 +71,7 @@ private static Map<MinimedConverterType, MinimedDataConverter> pumpConverterMap = new HashMap<MinimedConverterType, MinimedDataConverter>(); private static Map<MinimedConverterType, MinimedDataConverter> cgmsConverterMap = new HashMap<MinimedConverterType, MinimedDataConverter>(); private static Map<MinimedTargetType, MinimedHistoryDecoder> recordsDecoderMap = new HashMap<MinimedTargetType, MinimedHistoryDecoder>(); + // private static MedtronicCnlSession medtronicCnlSession; public static OutputWriter getOutputWriter() @@ -129,6 +130,11 @@ { paradigmLink = true; } + else if ((connectionParameters.interfaceType == MinimedCommInterfaceType.ContourNextLink2) + || (connectionParameters.interfaceType == MinimedCommInterfaceType.ContourNextLink24)) + { + bitUtils.computeCRC8WithPolynomialInit(0x9b, 0, null); + } serialNumber = connectionParameters.serialNumber; serialNumberBCD = connectionParameters.serialNumberBCD; @@ -404,4 +410,16 @@ { MinimedUtil.lowLevelDebugData = lowLevelDebugData; } + + // public static void setMedtronicCnlSession( + // MedtronicCnlSession medtronicCnlSession) + // { + // MinimedUtil.medtronicCnlSession = medtronicCnlSession; + // } + // + // + // public static MedtronicCnlSession getMedtronicCnlSession() + // { + // return medtronicCnlSession; + // } } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/mgr/DeviceHandlerManager.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/mgr/DeviceHandlerManager.java 2017-06-28 18:39:43 UTC (rev 1459) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/device/mgr/DeviceHandlerManager.java 2017-06-28 18:49:34 UTC (rev 1460) @@ -1,25 +1,30 @@ package ggc.plugin.device.mgr; -import java.util.HashMap; +import java.util.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.atech.utils.file.ClassFinder; +import com.atech.utils.file.ClassTypeDefinition; + +import ggc.core.plugins.GGCPluginType; import ggc.plugin.data.enums.DeviceHandlerType; import ggc.plugin.device.v2.DeviceHandler; -/** - * Created by andy on 10.02.15. - */ public class DeviceHandlerManager { - private static DeviceHandlerManager deviceHandlerManager = null; private static final Logger LOG = LoggerFactory.getLogger(DeviceHandlerManager.class); - HashMap<DeviceHandlerType, DeviceHandler> deviceHandlers = new HashMap<DeviceHandlerType, DeviceHandler>(); + private static DeviceHandlerManager deviceHandlerManager = null; + Map<DeviceHandlerType, DeviceHandler> deviceHandlers = new HashMap<DeviceHandlerType, DeviceHandler>(); + Map<GGCPluginType, List<DeviceHandler>> handlersDiscoveredByType = new HashMap<GGCPluginType, List<DeviceHandler>>(); + Set<Class<?>> unDynamicalClasses = new HashSet<Class<?>>(); + + public static DeviceHandlerManager getInstance() { if (deviceHandlerManager == null) @@ -33,19 +38,32 @@ private DeviceHandlerManager() { + this.registerUnDynamicalClasses(); } public void addDeviceHandler(DeviceHandler handler) { - this.deviceHandlers.put(handler.getDeviceHandlerKey(), handler); + addDeviceHandler(handler, false); } + public void addDeviceHandler(DeviceHandler handler, boolean dynamicRegister) + { + if (!deviceHandlers.containsKey(handler.getDeviceHandlerKey())) + { + this.deviceHandlers.put(handler.getDeviceHandlerKey(), handler); + LOG.debug("Device Handler registered [type={}, name={}, dynamic={}]", handler.getGGCPluginType(), + handler.getDeviceHandlerKey(), dynamicRegister); + } + } + + public DeviceHandler getDeviceHandler(DeviceHandlerType deviceHandlerType) { - if ((deviceHandlerType == DeviceHandlerType.NoHandler) - || (deviceHandlerType == DeviceHandlerType.NoSupportInDevice)) + if ((deviceHandlerType == DeviceHandlerType.NoHandler) || // + (deviceHandlerType == DeviceHandlerType.NullHandler) || // + (deviceHandlerType == DeviceHandlerType.NoSupportInDevice)) return null; if (this.deviceHandlers.containsKey(deviceHandlerType)) @@ -59,4 +77,125 @@ } } + + public void registerDeviceHandlersDynamically(GGCPluginType pluginType) + { + if (this.handlersDiscoveredByType.size() == 0) + { + registerDeviceHandlersDynamically(); + } + + if (handlersDiscoveredByType.containsKey(pluginType)) + { + List<DeviceHandler> deviceHandlers = handlersDiscoveredByType.get(pluginType); + + for (DeviceHandler handler : deviceHandlers) + { + addDeviceHandler(handler, true); + } + } + } + + + public void registerDeviceHandlersDynamically() + { + try + { + ClassFinder finder = new ClassFinder(); + + Vector<Class<?>> subclasses = finder.findSubclasses(DeviceHandler.class.getName(), + ClassTypeDefinition.EndClass); + + for (Class c : subclasses) + { + try + { + if (unDynamicalClasses.contains(c)) + continue; + + DeviceHandler handler = (DeviceHandler) c.newInstance(); + + if (handler.isEnabled()) + { + if (handlersDiscoveredByType.containsKey(handler.getGGCPluginType())) + { + handlersDiscoveredByType.get(handler.getGGCPluginType()).add(handler); + } + else + { + List<DeviceHandler> listHandlers = new ArrayList<DeviceHandler>(); + listHandlers.add(handler); + + handlersDiscoveredByType.put(handler.getGGCPluginType(), listHandlers); + } + } + } + catch (Exception ex) + { + LOG.warn("Problem instantiating Devic... [truncated message content] |
From: <and...@us...> - 2017-06-28 18:39:46
|
Revision: 1459 http://sourceforge.net/p/ggc/code/1459 Author: andyrozman Date: 2017-06-28 18:39:43 +0000 (Wed, 28 Jun 2017) Log Message: ----------- 0.1.0 - added some framework files for Connect Plugin - added LibraScale (as Other Hardware), no implementation yet - added OpenPlatformForClinicalNutritionHandler (as remote service), no implementation yet Modified Paths: -------------- trunk/ggc-plugins/ggc-connect/pom.xml trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/db/GGCConnectDb.java trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/defs/ConnectPluginDefinition.java trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/plugin/ConnectPlugInServer.java trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/util/DataAccessConnect.java trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/util/GGCConnectICRunner.java trunk/ggc-plugins/ggc-connect/src/main/resources/GGCConnectTool_en.properties Added Paths: ----------- trunk/ggc-plugins/ggc-connect/docs/Changelog trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/device/ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/device/scale/ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/device/scale/LibraScale.java trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/local/ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/local/sidiary/ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/local/sidiary/SiDiaryHandler.java trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/web/ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/web/opkp/ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/web/opkp/OpenPlatformForClinicalNutritionHandler.java trunk/ggc-plugins/ggc-connect/src/main/templates/ trunk/ggc-plugins/ggc-connect/src/main/templates/Version.java.template Added: trunk/ggc-plugins/ggc-connect/docs/Changelog =================================================================== --- trunk/ggc-plugins/ggc-connect/docs/Changelog (rev 0) +++ trunk/ggc-plugins/ggc-connect/docs/Changelog 2017-06-28 18:39:43 UTC (rev 1459) @@ -0,0 +1,7 @@ +CONNECT PLUGIN +================ + +0.1.0 - 28.6.2017 +- added some framework files for Connect Plugin +- added LibraScale (as Other Hardware), no implementation yet +- added OpenPlatformForClinicalNutritionHandler (as remote service), no implementation yet \ No newline at end of file Modified: trunk/ggc-plugins/ggc-connect/pom.xml =================================================================== --- trunk/ggc-plugins/ggc-connect/pom.xml 2017-06-24 11:31:09 UTC (rev 1458) +++ trunk/ggc-plugins/ggc-connect/pom.xml 2017-06-28 18:39:43 UTC (rev 1459) @@ -13,8 +13,34 @@ <artifactId>ggc-connect-tool</artifactId> <version>${ggc-connect-tool.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/connect/defs/</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> <dependency> <groupId>net.sf.ggc</groupId> @@ -48,10 +74,9 @@ </dependencies> <properties> - - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - + <version.file> + ${project.build.directory}/generated-sources/ggc/connect/defs/Version.java + </version.file> </properties> </project> Modified: trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/db/GGCConnectDb.java =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/db/GGCConnectDb.java 2017-06-24 11:31:09 UTC (rev 1458) +++ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/db/GGCConnectDb.java 2017-06-28 18:39:43 UTC (rev 1459) @@ -52,8 +52,8 @@ */ public GGCConnectDb(HibernateDb db) { - super(db); - LOG.debug("Created GGCConnectDb"); + super(db, DataAccessConnect.getInstance()); + // LOG.debug("Created GGCConnectDb"); // getAllElementsCount(); } Modified: trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/defs/ConnectPluginDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/defs/ConnectPluginDefinition.java 2017-06-24 11:31:09 UTC (rev 1458) +++ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/defs/ConnectPluginDefinition.java 2017-06-28 18:39:43 UTC (rev 1459) @@ -46,19 +46,25 @@ public class ConnectPluginDefinition extends DevicePluginDefinitionAbstract { - String PLUGIN_VERSION = "0.1.0"; - String PLUGIN_NAME = "GGC Connect Plugin"; + // String PLUGIN_VERSION = "0.1.0"; + static String PLUGIN_NAME = "GGC Connect Plugin"; public ConnectPluginDefinition(LanguageManager languageManager) { - super(languageManager, new GGCConnectICRunner()); + super(languageManager, // + new GGCConnectICRunner(), // + PLUGIN_NAME, // + GGCPluginType.ConnectToolPlugin, // + "connect_", // + "ggc.connect.defs.Version"); + this.useBaseLibraries = false; } public int getCopyrightFrom() { - return 2016; + return 2017; } @@ -129,36 +135,31 @@ { List<FeaturesEntry> outList = new ArrayList<FeaturesEntry>(); - outList.add(new FeaturesEntry("SiDiary (2016)")); - outList.add(new FeaturesEntry("MS Health (2016-17)")); + outList.add(new FeaturesEntry("SiDiary (2017)")); + outList.add(new FeaturesEntry("MS Health (2018)")); + outList.add(new FeaturesEntry("Libra (2018)")); + outList.add(new FeaturesEntry("Open Platform for Clinical Nutrition (2018)")); return outList; } - public String getPluginVersion() - { - return this.PLUGIN_VERSION; - } + // /** + // * Get Name of Plugin (for internal use) + // * + // * @return + // */ + // public String getPluginName() + // { + // return this.PLUGIN_NAME; + // } + // + // + // public GGCPluginType getPluginType() + // { + // return GGCPluginType.ConnectToolPlugin; + // } - - /** - * Get Name of Plugin (for internal use) - * - * @return - */ - public String getPluginName() - { - return this.PLUGIN_NAME; - } - - - public GGCPluginType getPluginType() - { - return GGCPluginType.ConnectToolPlugin; - } - - @Override public List<BaseListEntry> getWebListerItems() { @@ -166,13 +167,12 @@ } - @Override - public String getWebListerDescription() - { - return this.i18nControl.getMessage("DEVICE_LIST_WEB_DESC"); - } + // @Override + // public String getWebListerDescription() + // { + // return this.i18nControl.getMessage("DEVICE_LIST_WEB_DESC"); + // } - @Override public PluginReportDefinition getReportsDefinition() { @@ -202,13 +202,12 @@ } - @Override - public String getPluginActionsPrefix() - { - return "connect_"; - } + // @Override + // public String getPluginActionsPrefix() + // { + // return "connect_"; + // } - @Override public void registerDeviceHandlers() { Added: trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/device/scale/LibraScale.java =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/device/scale/LibraScale.java (rev 0) +++ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/device/scale/LibraScale.java 2017-06-28 18:39:43 UTC (rev 1459) @@ -0,0 +1,8 @@ +package ggc.connect.device; + +/** + * Created by andy on 03.04.17. + */ +public class LibraScale +{ +} Modified: trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/plugin/ConnectPlugInServer.java =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/plugin/ConnectPlugInServer.java 2017-06-24 11:31:09 UTC (rev 1458) +++ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/plugin/ConnectPlugInServer.java 2017-06-28 18:39:43 UTC (rev 1459) @@ -238,11 +238,9 @@ // // menu_cgms.addSeparator(); // - // ATSwingUtils.createMenuItem(menu_cgms, "MN_CGMS_ABOUT", // - // "MN_CGMS_ABOUT_DESC", "plugin_about", this, null, ic_local, - // DataAccessCGMS.getInstance(), parent); - // - // return menu_cgms; + ATSwingUtils.createMenuItem(menuConnect, "MN_CGMS_ABOUT", // + "MN_CGMS_ABOUT_DESC", "plugin_about", // + this, null, ic_local, DataAccessConnect.getInstance(), parent); return menuConnect; } Added: trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/local/sidiary/SiDiaryHandler.java =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/local/sidiary/SiDiaryHandler.java (rev 0) +++ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/local/sidiary/SiDiaryHandler.java 2017-06-28 18:39:43 UTC (rev 1459) @@ -0,0 +1,8 @@ +package ggc.connect.software.local.sidiary; + +/** + * Created by andy on 03.04.17. + */ +public class SiDiaryHandler +{ +} Added: trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/web/opkp/OpenPlatformForClinicalNutritionHandler.java =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/web/opkp/OpenPlatformForClinicalNutritionHandler.java (rev 0) +++ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/software/web/opkp/OpenPlatformForClinicalNutritionHandler.java 2017-06-28 18:39:43 UTC (rev 1459) @@ -0,0 +1,8 @@ +package ggc.connect.software.web.opkp; + +/** + * Created by andy on 03.04.17. + */ +public class OpenPlatformForClinicalNutritionHandler +{ +} Modified: trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/util/DataAccessConnect.java =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/util/DataAccessConnect.java 2017-06-24 11:31:09 UTC (rev 1458) +++ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/util/DataAccessConnect.java 2017-06-28 18:39:43 UTC (rev 1459) @@ -6,8 +6,6 @@ import ggc.connect.db.GGCConnectDb; import ggc.connect.defs.ConnectPluginDefinition; -import ggc.plugin.data.enums.DeviceEntryStatus; -import ggc.plugin.device.impl.animas.enums.AnimasSoundType; import ggc.plugin.util.DataAccessPlugInBase; /** @@ -39,7 +37,8 @@ public class DataAccessConnect extends DataAccessPlugInBase { - private static final String EXTENDED_HANDLER_CGMSValuesExtendedEntry = "CGMSValuesExtendedEntry"; + // private static final String EXTENDED_HANDLER_CGMSValuesExtendedEntry = + // "CGMSValuesExtendedEntry"; private static DataAccessConnect s_da = null; // This is handle to unique @@ -94,8 +93,7 @@ private void prepareTranslationForEnums() { - AnimasSoundType.translateKeywords(this.getI18nControlInstance(), this.getPluginType()); - DeviceEntryStatus.translateKeywords(this.getI18nControlInstance()); + } Modified: trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/util/GGCConnectICRunner.java =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/util/GGCConnectICRunner.java 2017-06-24 11:31:09 UTC (rev 1458) +++ trunk/ggc-plugins/ggc-connect/src/main/java/ggc/connect/util/GGCConnectICRunner.java 2017-06-28 18:39:43 UTC (rev 1459) @@ -39,7 +39,7 @@ @Override public String getLanguageFileRoot() { - return "GGC_CGMSTool"; + return "GGCConnectTool"; } } Modified: trunk/ggc-plugins/ggc-connect/src/main/resources/GGCConnectTool_en.properties =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/resources/GGCConnectTool_en.properties 2017-06-24 11:31:09 UTC (rev 1458) +++ trunk/ggc-plugins/ggc-connect/src/main/resources/GGCConnectTool_en.properties 2017-06-28 18:39:43 UTC (rev 1459) @@ -33,6 +33,8 @@ # !G! Plug-in Specific [1] # CONNECT_PLUGIN=Connect Plugin +DEVICE_NAME_NORMAL=connect +DEVICE_NAME_BIG=Connect # # !G! Menus [1] Added: trunk/ggc-plugins/ggc-connect/src/main/templates/Version.java.template =================================================================== --- trunk/ggc-plugins/ggc-connect/src/main/templates/Version.java.template (rev 0) +++ trunk/ggc-plugins/ggc-connect/src/main/templates/Version.java.template 2017-06-28 18:39:43 UTC (rev 1459) @@ -0,0 +1,42 @@ +package ggc.connect.defs; + +import com.atech.utils.java.VersionInterface; + +public class Version implements VersionInterface +{ + + public static final String VERSION = "@pomversion@"; + public static final String BUILD_NUMBER = "@buildnumber@"; + public static final String BUILD_TIME = "@buildtime@"; + + + public String getVersion() + { + String version = this.VERSION; + + if (version.endsWith("-SNAPSHOT")) + { + version = version.substring(0, version.indexOf("-SNAPSHOT")); + } + + if (version.endsWith("-RELEASE")) + { + version = version.substring(0, version.indexOf("-RELEASE")); + } + + return version; + } + + + public String getBuildTime() + { + return this.BUILD_TIME; + } + + + public String getBuildNumber() + { + return this.BUILD_NUMBER; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2017-06-24 11:31:13
|
Revision: 1458 http://sourceforge.net/p/ggc/code/1458 Author: andyrozman Date: 2017-06-24 11:31:09 +0000 (Sat, 24 Jun 2017) Log Message: ----------- 2.4.2 [24.6.2017] - Refactoring of Db (not 100%) - Refactoring plugin data handling (DataHandler, DataReeader, Values) - added devices: - Ascensia Next One (refactoring of converter and reader) - Menarini family - Arkray family Modified Paths: -------------- trunk/ggc-plugins/ggc-meter/docs/Changelog trunk/ggc-plugins/ggc-meter/pom.xml trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterDataHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterDataReader.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntry.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntryDataType.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/db/GGCMeterDb.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/GlucoseMeterMarker.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/MeterPluginDefinition.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceDefinition.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/DummyMeter.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/SerialMeterAbstract.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/UsbMeterAbstract.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/AccuChekMeterHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/ascensia/AscensiaMeter.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/ascensia/AscensiaUsbMeterHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/ascensia/impl/AscensiaContourUsbReader.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/ascensia/impl/AscensiaDecoder.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/manager/MeterDevicesIds.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/manager/MeterManager.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/util/DataAccessMeter.java trunk/ggc-plugins/ggc-meter/src/main/resources/GGCMeterTool_en.properties Added Paths: ----------- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/ArkrayMeterDataReader.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/ArkrayMeterHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/ArkrayUtil.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkrayGlucoCard.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkrayGlucoCardMemoryPC.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkrayGlucoCardSM.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkrayGlucoMeter18xx.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkrayGlucoXMeter.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkrayGlucocardMX.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkrayMeterMode.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkraySerialMeterAbstract.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/arkray/impl/ArkrayUSBMeterAbstract.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/MeanriniMeterDataReader.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/MenariniMeterHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/impl/ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/impl/MenariniGlucoMenGM.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/impl/MenariniGlucoMenLXMio.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/impl/MenariniGlucoMenLXMioPlus.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/impl/MenariniGlucoMenPC.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/impl/MenariniGlucoMenReady.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/impl/MenariniGlucoMenVisio.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/menarini/impl/MenariniSerialMeterAbstract.java trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/ark_glucocard_gplus.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/ark_glucocard_mx.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/ark_glucocard_sm.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/ascensia_contour_next_one.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucofix_id.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucofix_mio_plus.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucofix_premium.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucofix_tech.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucomen_areo.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucomen_areo_2k.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucomen_gm.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucomen_lx2.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucomen_lx_plus.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucomen_ready.png trunk/ggc-plugins/ggc-meter/src/main/resources/icons/meters/mn_glucomen_visio.png trunk/ggc-plugins/ggc-meter/src/main/templates/ trunk/ggc-plugins/ggc-meter/src/main/templates/Version.java.template trunk/ggc-plugins/ggc-meter/src/test/ trunk/ggc-plugins/ggc-meter/src/test/java/ trunk/ggc-plugins/ggc-meter/src/test/java/ggc/ trunk/ggc-plugins/ggc-meter/src/test/java/ggc/meter/ trunk/ggc-plugins/ggc-meter/src/test/java/ggc/meter/device/ trunk/ggc-plugins/ggc-meter/src/test/java/ggc/meter/device/TestDeviceInstructionsMeterEnum.java Modified: trunk/ggc-plugins/ggc-meter/docs/Changelog =================================================================== --- trunk/ggc-plugins/ggc-meter/docs/Changelog 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/docs/Changelog 2017-06-24 11:31:09 UTC (rev 1458) @@ -2,6 +2,15 @@ Changes file for GGC Meter Tool =============================== +2.4.2 [24.6.2017] +- Refactoring of Db (not 100%) +- Refactoring plugin data handling (DataHandler, DataReeader, Values) +- added devices: + - Ascensia Next One (refactoring of converter and reader) + - Menarini family + - Arkray family + + 2.4.1 [26.6.2016] - refactorings (code, db) - graphs Modified: trunk/ggc-plugins/ggc-meter/pom.xml =================================================================== --- trunk/ggc-plugins/ggc-meter/pom.xml 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/pom.xml 2017-06-24 11:31:09 UTC (rev 1458) @@ -16,6 +16,35 @@ <version>${ggc-meter-tool.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/meter/defs/</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + </build> + + <dependencies> <dependency> @@ -50,9 +79,9 @@ <properties> - - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - + <version.file> + ${project.build.directory}/generated-sources/ggc/meter/defs/Version.java + </version.file> </properties> + </project> Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterDataHandler.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterDataHandler.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterDataHandler.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -2,7 +2,6 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.Hashtable; import java.util.Map; import org.slf4j.Logger; @@ -130,7 +129,7 @@ } // 4. get pump data (for specific items) - Hashtable<String, PumpDataExtendedH> pumpData = db.getPumpData(timeMarksWithChangedData); + Map<String, PumpDataExtendedH> pumpData = db.getPumpData(timeMarksWithChangedData); this.setCustomStatus(1, 10); // 5. add/edit pump items @@ -155,10 +154,10 @@ // add PumpDataExtendedH pdeh = new PumpDataExtendedH(); - pdeh.setDt_info(timeData.getKey() * 100); + pdeh.setDtInfo(timeData.getKey() * 100); pdeh.setType(mvedt.getKey().pumpExtCode); pdeh.setValue(getValueAsString(mvedt.getValue())); - pdeh.setPerson_id((int) m_da.getCurrentUserId()); + pdeh.setPersonId((int) m_da.getCurrentUserId()); pdeh.setExtended("SOURCE=" + m_da.getSourceDevice()); pdeh.setChanged(System.currentTimeMillis()); Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterDataReader.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterDataReader.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterDataReader.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -1,6 +1,6 @@ package ggc.meter.data; -import java.util.Hashtable; +import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,7 +67,7 @@ public void getMaxEntries() { db = m_da.getDb(); - this.all_entries = db.getAllElementsCount(); + this.allEntries = db.getAllElementsCount(); } @@ -75,7 +75,7 @@ * Read Old entries */ @Override - public Hashtable<String, DeviceValuesEntryInterface> readOldEntries() + public Map<String, DeviceValuesEntryInterface> readOldEntries() { return db.getMeterValues(this); // TODO Auto-generated method stub @@ -100,12 +100,12 @@ { if (current_entry == -1) { - this.m_drr.setOldDataReadingProgress(0); + this.deviceReaderRunner.setOldDataReadingProgress(0); LOG.debug("Old Data reading progress [" + m_da.getApplicationName() + "]: 0% not started"); } else if (current_entry == 0) { - this.m_drr.setOldDataReadingProgress(40); + this.deviceReaderRunner.setOldDataReadingProgress(40); LOG.debug("Old Data reading progress [" + m_da.getApplicationName() + "]: 40% read from database"); LOG.debug("Old Data reading progress [" + m_da.getApplicationName() + "]: Started to sort through data (progress will not be displayed)"); @@ -112,7 +112,7 @@ } else if (current_entry == -2) { - this.m_drr.setOldDataReadingProgress(100); + this.deviceReaderRunner.setOldDataReadingProgress(100); } else { @@ -123,7 +123,7 @@ // LOG.debug("Old Data reading progress [" + // dataAccess.getApplicationName() + "]: " + proc_total_i + " %" ); - this.m_drr.setOldDataReadingProgress(proc_total_i); + this.deviceReaderRunner.setOldDataReadingProgress(proc_total_i); /* * try Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntry.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntry.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntry.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -6,7 +6,6 @@ import org.hibernate.Transaction; import com.atech.data.GsonUtils; -import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.ATechDate; import com.atech.utils.data.ATechDateType; @@ -13,7 +12,7 @@ import ggc.core.data.ExtendedDailyValueHandler; import ggc.core.data.ExtendedDailyValueType; import ggc.core.data.defs.GlucoseUnitType; -import ggc.core.db.hibernate.DayValueH; +import ggc.core.db.hibernate.pen.DayValueH; import ggc.meter.util.DataAccessMeter; import ggc.plugin.data.DeviceValuesEntry; import ggc.plugin.data.enums.DeviceEntryStatus; @@ -48,9 +47,8 @@ public class MeterValuesEntry extends DeviceValuesEntry { - private static DataAccessMeter da = DataAccessMeter.getInstance(); - private static I18nControlAbstract ic = da.getI18nControlInstance(); - private static ExtendedDailyValueHandler extendedDailyValueHandler = da.getExtendedDailyValueHandler(); + private static DataAccessMeter da; // = DataAccessMeter.getInstance(); + private static ExtendedDailyValueHandler extendedDailyValueHandler; private ATechDate datetime; private Integer bgOriginal = null; @@ -69,7 +67,12 @@ public MeterValuesEntry() { super(); - this.source = DataAccessMeter.getInstance().getSourceDevice(); + if (da == null) + da = DataAccessMeter.getInstance(); + + this.source = da.getSourceDevice(); + if (extendedDailyValueHandler == null) + extendedDailyValueHandler = da.getExtendedDailyValueHandler(); this.loadExtendedEntries(null); resetExtendedType(); } @@ -82,11 +85,12 @@ public MeterValuesEntry(DayValueH dv) { super(); - this.datetime = new ATechDate(this.getDateTimeFormat(), dv.getDt_info()); + this.datetime = new ATechDate(this.getDateTimeFormat(), dv.getDtInfo()); this.setBgValue("" + dv.getBg(), GlucoseUnitType.mg_dL); this.entry_object = dv; this.object_status = DeviceValuesEntry.OBJECT_STATUS_OLD; this.ch = dv.getCh(); + extendedDailyValueHandler = da.getExtendedDailyValueHandler(); this.loadExtendedEntries(dv.getExtended()); @@ -596,8 +600,8 @@ this.entry_object.setIns1(0); this.entry_object.setIns2(0); this.entry_object.setCh(0.0f); - this.entry_object.setPerson_id((int) DataAccessMeter.getInstance().getCurrentUserId()); - this.entry_object.setDt_info(this.getDateTime()); + this.entry_object.setPersonId((int) DataAccessMeter.getInstance().getCurrentUserId()); + this.entry_object.setDtInfo(this.getDateTime()); } @@ -613,7 +617,7 @@ this.entry_object.setChanged(System.currentTimeMillis()); this.entry_object.setComment(createComment()); - this.entry_object.setPerson_id((int) DataAccessMeter.getInstance().getCurrentUserId()); + this.entry_object.setPersonId((int) DataAccessMeter.getInstance().getCurrentUserId()); // log.debug("Updated. Status was Edit. Action was: " + act); } @@ -804,6 +808,13 @@ } + private ExtendedDailyValueHandler getExtendedHandler() + { + // FIXME + return null; + } + + public boolean hasUrine() { if (extendedMap == null) @@ -924,7 +935,7 @@ */ public String getExtendedTypeDescription() { - return ic.getMessage(extendedType.getDescription()); // extendedTypeDescription; + return extendedType.getTranslation(); // extendedTypeDescription; } @@ -959,7 +970,7 @@ default: case InvalidData: case None: - return ic.getMessage(MeterValuesEntryDataType.InvalidData.getDescription()); + return MeterValuesEntryDataType.InvalidData.getTranslation(); } } @@ -977,17 +988,17 @@ if (this.hasBGEntry()) { - values.put(ic.getMessage("BG") + ": ", getDisplayableBgValueWithUnit()); + values.put(MeterValuesEntryDataType.BG.getTranslation() + ": ", getDisplayableBgValueWithUnit()); } if (this.hasCHEntry()) { - values.put(ic.getMessage("CH") + ": ", da.getFormatedValue(this.ch, 1)); + values.put(MeterValuesEntryDataType.CH.getTranslation() + ": ", da.getFormatedValue(this.ch, 1)); } if (this.hasUrine()) { - values.put(ic.getMessage("URINE") + ": ", // + values.put(MeterValuesEntryDataType.Urine.getTranslation() + ": ", // getUrineValue()); } Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntryDataType.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntryDataType.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/MeterValuesEntryDataType.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -2,6 +2,8 @@ import java.util.HashMap; +import com.atech.i18n.I18nControlAbstract; + /** * Created by andy on 02.05.15. */ @@ -20,8 +22,24 @@ static HashMap<Integer, String> allowedPumpTypes; static HashMap<MeterValuesEntryDataType, String> processorTypes; boolean isProcessor; + String translation; + static boolean translated = false; + public static void translateKeywords(I18nControlAbstract ic) + { + if (translated) + return; + + for (MeterValuesEntryDataType pbt : values()) + { + pbt.translation = ic.getMessage(pbt.description); + } + + translated = true; + } + + MeterValuesEntryDataType(String description, Integer pumpExtCode, boolean isProcessor) { this.description = description; @@ -72,4 +90,10 @@ { return description; } + + + public String getTranslation() + { + return this.translation; + } } Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/db/GGCMeterDb.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/db/GGCMeterDb.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/db/GGCMeterDb.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -2,9 +2,8 @@ import java.util.*; -import org.hibernate.Criteria; import org.hibernate.Query; -import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -13,7 +12,7 @@ import com.atech.graphics.graphs.v2.data.GraphDefinitionDto; import com.atech.graphics.graphs.v2.data.GraphTimeDataCollection; -import ggc.core.db.hibernate.DayValueH; +import ggc.core.db.hibernate.pen.DayValueH; import ggc.core.db.hibernate.pump.PumpDataExtendedH; import ggc.meter.data.MeterDataReader; import ggc.meter.data.MeterValuesEntry; @@ -42,8 +41,8 @@ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * - * Filename: ###---### - * Description: + * Filename: GGCMeterDb + * Description: Database handler for Meter Plugin * * Author: Andy {an...@at...} */ @@ -62,9 +61,7 @@ */ public GGCMeterDb(HibernateDb db) { - super(db); - - // getAllElementsCount(); + super(db, DataAccessMeter.getInstance()); } @@ -75,31 +72,15 @@ */ public int getAllElementsCount() { - try - { - Integer in = null; - int sum_all = 0; - Criteria criteria = this.getSession().createCriteria(DayValueH.class); - criteria.add(Restrictions.eq("person_id", (int) m_da.getCurrentUserId())); - criteria.add(Restrictions.or( - Restrictions.or(Restrictions.gt("bg", 0), Restrictions.like("extended", "%URINE%")), - Restrictions.gt("ch", 0.0f))); - criteria.add(Restrictions.like("extended", "%" + m_da.getSourceDevice() + "%")); - criteria.setProjection(Projections.rowCount()); - in = (Integer) criteria.list().get(0); - sum_all = in.intValue(); + int sumAll = getAllElementsCount(DayValueH.class, // + Arrays.asList( + Restrictions.or(Restrictions.or(Restrictions.gt("bg", 0), Restrictions.like("extended", "%URINE%")), + Restrictions.gt("ch", 0.0f)))); - LOG.debug("Old Meter Data in Db: " + in.intValue()); + LOG.debug("Old Meter Data in Db: " + sumAll); - return sum_all; - } - catch (Exception ex) - { - LOG.error("getAllElementsCount: " + ex, ex); - ex.printStackTrace(); - return 0; - } + return sumAll; } @@ -110,9 +91,9 @@ * * @return */ - public Hashtable<String, DeviceValuesEntryInterface> getMeterValues(MeterDataReader mdr) + public Map<String, DeviceValuesEntryInterface> getMeterValues(MeterDataReader mdr) { - Hashtable<String, DeviceValuesEntryInterface> ht = new Hashtable<String, DeviceValuesEntryInterface>(); + Map<String, DeviceValuesEntryInterface> ht = new HashMap<String, DeviceValuesEntryInterface>(); LOG.info("getMeterValues()"); @@ -120,30 +101,28 @@ try { - LOG.debug("getMeterValues() - Process"); - Query q = this.getSession().createQuery(" SELECT dv from ggc.core.db.hibernate.DayValueH as dv " + // - " WHERE ((dv.bg>0) OR (dv.extended LIKE '%URINE%') OR (dv.ch>0)) " + // - " AND person_id=" + m_da.getCurrentUserId() + // - " AND dv.extended like '%" + m_da.getSourceDevice() + "%' " + // - " ORDER BY dv.dt_info ASC"); + List<DayValueH> hibernateData = getHibernateData(DayValueH.class, // + Arrays.asList(Restrictions.eq("personId", (int) m_da.getCurrentUserId()), // + Restrictions.or( + Restrictions.or(Restrictions.gt("bg", 0), // + Restrictions.like("extended", "%URINE%")), // + Restrictions.gt("ch", 0.0f)), // + Restrictions.like("extended", "%" + m_da.getSourceDevice() + "%")), // + Arrays.asList(Order.asc("dtInfo"))); - // System.out.println("Found elements: " + q.list().size()); - - Iterator<?> it = q.list().iterator(); - int counter = 0; mdr.writeStatus(counter); - while (it.hasNext()) + for (DayValueH dayValueH : hibernateData) { counter++; - MeterValuesEntry mves = new MeterValuesEntry((DayValueH) it.next()); + MeterValuesEntry mves = new MeterValuesEntry(dayValueH); - ht.put("" + mves.getSpecialId(), mves); + ht.put(mves.getSpecialId(), mves); mdr.writeStatus(counter); } @@ -168,8 +147,7 @@ * @param timeMarks * @return */ - public Hashtable<String, PumpDataExtendedH> getPumpData( - HashMap<Long, HashMap<MeterValuesEntryDataType, Object>> timeMarks) + public Map<String, PumpDataExtendedH> getPumpData(Map<Long, HashMap<MeterValuesEntryDataType, Object>> timeMarks) { Hashtable<String, PumpDataExtendedH> pumpData = new Hashtable<String, PumpDataExtendedH>(); @@ -180,6 +158,7 @@ { LOG.debug("getPumpData() - Process"); + // FIXME Query q = this.getSession().createQuery( " SELECT dv FROM ggc.core.db.hibernate.pump.PumpDataExtendedH as dv " + " WHERE dv.person_id=" + m_da.getCurrentUserId() + " AND dv.dt_info IN " + getDataListForSQL(timeMarks) @@ -192,8 +171,8 @@ { PumpDataExtendedH pde = (PumpDataExtendedH) it.next(); - int time = (int) (pde.getDt_info() / 100); // same time as in - // DailyValueH + int time = (int) (pde.getDtInfo() / 100); // same time as in + // DailyValueH pumpData.put(time + "_" + pde.getType(), pde); } @@ -214,10 +193,10 @@ * @return * @deprecated */ - public Hashtable<Long, MeterValuesEntry> getMeterData(Hashtable<Long, String> timeMarks) + public Map<Long, MeterValuesEntry> getMeterData(Hashtable<Long, String> timeMarks) { - Hashtable<Long, MeterValuesEntry> meter_data = new Hashtable<Long, MeterValuesEntry>(); + Map<Long, MeterValuesEntry> meter_data = new HashMap<Long, MeterValuesEntry>(); if (timeMarks.size() == 0) return meter_data; @@ -227,7 +206,7 @@ LOG.debug("getMeterData() - Process"); Query q = this.getSession().createQuery( // - " SELECT dv from ggc.core.db.hibernate.DayValueH as dv " + // + " SELECT dv from ggc.core.db.hibernate.pen.DayValueH as dv " + // " WHERE person_id=" + m_da.getCurrentUserId() + // " AND dv.dt_info IN " + getDataListForSQL(timeMarks) + // " ORDER BY dv.dt_info ASC"); @@ -251,21 +230,20 @@ } - private String getDataListForSQL(Hashtable<?, ?> ht) - { - StringBuffer sb = new StringBuffer(); - sb.append(" ("); + // private String getDataListForSQL(Map<?, ?> ht) + // { + // StringBuffer sb = new StringBuffer(); + // sb.append(" ("); + // + // for (Enumeration<?> en = ht.keys(); en.hasMoreElements();) + // { + // sb.append(en.nextElement() + ", "); + // } + // + // return sb.substring(0, sb.length() - 2) + ")"; + // } - for (Enumeration<?> en = ht.keys(); en.hasMoreElements();) - { - sb.append(en.nextElement() + ", "); - } - - return sb.substring(0, sb.length() - 2) + ")"; - } - - - private String getDataListForSQL(HashMap<?, ?> ht) + private String getDataListForSQL(Map<?, ?> ht) { StringBuffer sb = new StringBuffer(); sb.append(" ("); Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/GlucoseMeterMarker.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/GlucoseMeterMarker.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/GlucoseMeterMarker.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -10,6 +10,7 @@ HighGlucose("MARKER_HI"), // PreMeal("MARKER_PRE_MEAL"), // PostMeal("MARKER_POST_MEAL"), // + PostMealTime("MARKER_POST_MEAL_TIME"), // DontFeelRight("MARKER_DONT_FEEL_RIGHT"), // Sick("MARKER_SICK"), // Stress("MARKER_STRESS"), // @@ -16,7 +17,11 @@ Activity("MARKER_ACTIVITY"), // ControlResult("MARKER_CONTROL_RESULT"), // AfterFoodWithTime("MARKER_AFTER_FOOD"), // - ; + MealLevel1("MARKER_MEAL_LEVEL_1"), // + MealLevel2("MARKER_MEAL_LEVEL_2"), // + MealLevel3("MARKER_MEAL_LEVEL_3"), // + Hypoglycemia("MARKER_HYPO"), // + BedTime("MARKER_BED_TIME"); private String description; Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/MeterPluginDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/MeterPluginDefinition.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/MeterPluginDefinition.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -3,6 +3,9 @@ import java.util.ArrayList; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.atech.app.data.about.CreditsEntry; import com.atech.app.data.about.CreditsGroup; import com.atech.app.data.about.FeaturesEntry; @@ -10,10 +13,8 @@ import com.atech.i18n.mgr.LanguageManager; import ggc.core.plugins.GGCPluginType; -import ggc.meter.device.ascensia.AscensiaUsbMeterHandler; import ggc.meter.util.GGCMeterICRunner; import ggc.plugin.defs.DevicePluginDefinitionAbstract; -import ggc.plugin.device.mgr.DeviceHandlerManager; import ggc.plugin.graph.PluginGraphDefinition; import ggc.plugin.list.BaseListEntry; import ggc.plugin.report.PluginReportDefinition; @@ -24,13 +25,20 @@ public class MeterPluginDefinition extends DevicePluginDefinitionAbstract { - String PLUGIN_VERSION = "2.4.1"; - String PLUGIN_NAME = "GGC Meter Plugin"; + private static final Logger LOG = LoggerFactory.getLogger(MeterPluginDefinition.class); + private static String PLUGIN_NAME = "GGC Meter Plugin"; + public MeterPluginDefinition(LanguageManager languageManager) { - super(languageManager, new GGCMeterICRunner()); + super(languageManager, // + new GGCMeterICRunner(), // + PLUGIN_NAME, // + GGCPluginType.MeterToolPlugin, // + "meters_", // + "ggc.meter.defs.Version"); + } @@ -118,6 +126,8 @@ outList.add(new FeaturesEntry("Accu-Chek/Roche: All supported by SmartPix 3.x")); outList.add(new FeaturesEntry("LifeScan: Ultra, Profile, Easy, UltraSmart")); outList.add(new FeaturesEntry("Abbott: Optium Xceeed, PrecisionXtra, Frestyle")); + outList.add(new FeaturesEntry("Menarini: most newer models (NOT TESTED)")); + outList.add(new FeaturesEntry("Arkray: some models (NOT TESTED)")); return outList; } @@ -127,33 +137,15 @@ { List<FeaturesEntry> outList = new ArrayList<FeaturesEntry>(); - outList.add(new FeaturesEntry("LifeScan: Ultra2 (in 2017)")); - outList.add(new FeaturesEntry("Wellion: Calla, Luna (in 2017 ?)")); - outList.add(new FeaturesEntry("Menarini: most newer models (in 2017 ?)")); - outList.add(new FeaturesEntry("Arkray: some models (in 2017 ?)")); + outList.add(new FeaturesEntry("LifeScan: Ultra2 (in 2018)")); + outList.add(new FeaturesEntry("Wellion: Calla, Luna (in 2017-18)")); + //outList.add(new FeaturesEntry("Menarini: most newer models (in 2017 ?)")); + //outList.add(new FeaturesEntry("Arkray: some models (in 2017 ?)")); return outList; } - public String getPluginVersion() - { - return this.PLUGIN_VERSION; - } - - - public String getPluginName() - { - return this.PLUGIN_NAME; - } - - - public GGCPluginType getPluginType() - { - return GGCPluginType.MeterToolPlugin; - } - - @Override public List<BaseListEntry> getWebListerItems() { @@ -178,13 +170,6 @@ @Override - public String getWebListerDescription() - { - return this.i18nControl.getMessage("DEVICE_LIST_WEB_DESC"); - } - - - @Override public PluginReportDefinition getReportsDefinition() { // no reports for this plugin @@ -199,19 +184,4 @@ return null; } - - @Override - public String getPluginActionsPrefix() - { - return "meters_"; - } - - - @Override - public void registerDeviceHandlers() - { - // Ascensia - DeviceHandlerManager.getInstance().addDeviceHandler(new AscensiaUsbMeterHandler()); - } - } Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceDefinition.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceDefinition.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -3,6 +3,9 @@ import java.util.ArrayList; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import ggc.meter.device.MeterDisplayInterfaceType; import ggc.plugin.data.enums.DeviceCompanyDefinition; import ggc.plugin.data.enums.DeviceHandlerType; @@ -17,7 +20,10 @@ */ public enum MeterDeviceDefinition implements DeviceDefinition { + + // -------------------- // Ascensia + // -------------------- AscensiaContourUsb(10007, "Contour USB", "ascensia_contour_usb.jpg", // "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, DeviceImplementationStatus.Done, // DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, // @@ -42,9 +48,19 @@ DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", 2000, MeterDisplayInterfaceType.Simple), + AscensiaContourNextOne(10011, "Contour Next One", "ascensia_contour_next_one.png", // + "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", + 2000, MeterDisplayInterfaceType.Simple), + + // -- Missing: Contour Next EZ, Contour Next Link 2.4, Didget, Contour XT ? + // -- Planned: Contour Next Link 2.4 (Test with current usb code) + // -- Not planned: Contour Next EZ, Didget, Contour XT (this might actually work without any changes) + + // -------------------- // AccuChek - - // FIXME + // -------------------- AccuChekSmartPixGeneric(20001, "SmartPix", "ac_active.jpg", // "INSTRUCTIONS_ACCUCHEK_ACTIVE", null, DeviceImplementationStatus.Done, // DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // @@ -123,35 +139,139 @@ DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // DeviceProgressStatus.Normal, "", 500, MeterDisplayInterfaceType.Extended), // - // FIXME - just for testing - // MenariniGlucoMenReady(100011, "Menarini", null, // - // "instructions", null, DeviceImplementationStatus.Planned, - // DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, - // // - // DevicePortParameterType.SimpleParameter, - // DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", - // 200, MeterDisplayInterfaceType.Simple), // + // -- Missing: Mobile, Connect, ...Connect - ; - // AccuChekActive.java - // AccuChekAdvantage.java - // AccuChekAvivaCombo.java - // AccuChekAviva.java - // AccuChekComfort.java - // AccuChekCompact.java - // AccuChekCompactPlus.java - // AccuChekGo.java - // AccuChekIntegra.java - // AccuChekMeterHandler.java - // AccuChekNano.java - // AccuChekPerforma.java - // AccuChekSensor.java + // -------------------- + // Meanrini + // -------------------- + MenariniGlucoFixId(50003, "GlucoFix ID", "mn_glucofix_id.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Planned, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 250, MeterDisplayInterfaceType.Simple), // - // Contour Next EZ, Contour Next Link 2.4, Didget, Contour XT ? + MenariniGlucoFixMio(50001, "GlucoFix Mio", "mn_glucofix_mio_plus.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Planned, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 400, MeterDisplayInterfaceType.Simple), // + MenariniGlucoFixMioPlus(50002, "GlucoFix Mio Plus", "mn_glucofix_mio_plus.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Planned, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 400, MeterDisplayInterfaceType.Extended), // ket, + + MenariniGlucoFixPremium(50004, "GlucoFix Premium", "mn_glucofix_premium.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Planned, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 400, MeterDisplayInterfaceType.Extended), // ket, + + MenariniGlucoFixTech(50005, "GlucoFix Tech", "mn_glucofix_tech.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Planned, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 730, MeterDisplayInterfaceType.Simple), // + + MenariniGlucoMenVisio(50006, "GlucoMen Visio", "mn_glucomen_visio.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Planned, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 250, MeterDisplayInterfaceType.Simple), // + + MenariniGlucoMenGM(50007, "GlucoMen GM", "mn_glucomen_gm.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 250, MeterDisplayInterfaceType.Simple), // + + MenariniGlucoMenPC(50014, "GlucoMen PC", "mn_glucomen_gm.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 250, MeterDisplayInterfaceType.Simple), // + + MenariniGlucoMenLxPlus(50008, "GlucoMen Lx Plus", "mn_glucomen_lx_plus.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 400, MeterDisplayInterfaceType.Extended), // ket, + + MenariniGlucoMenLx2(50009, "GlucoMen Lx 2", "mn_glucomen_lx2.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 400, MeterDisplayInterfaceType.Extended), // ket + + MenariniGlucoMenMendor(50010, "GlucoMen Mendor", "mn_glucomen_ready.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 500, MeterDisplayInterfaceType.Simple), // + + MenariniGlucoMenReady(50011, "GlucoMen Ready", "mn_glucomen_ready.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 500, MeterDisplayInterfaceType.Simple), // + + MenariniGlucoMenAreo(50012, "GlucoMen Areo", "mn_glucomen_areo.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 730, MeterDisplayInterfaceType.Simple), // + + MenariniGlucoMenAreo2k(50013, "GlucoMen Areo 2K", "mn_glucomen_areo_2k.png", // + "INSTRUCTIONS_MENARINI", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 830, MeterDisplayInterfaceType.Extended), // ket, + + + // -------------------- + // Arkray + // -------------------- + ArkrayGlucoXMeter(60003, "Arkray Glucocard X-Meter", "ark_glucocard_sm.png", // + "INSTRUCTIONS_ARKRAY", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Arkray, DeviceHandlerType.ArkrayMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, // + DeviceProgressStatus.Special, "", 0, MeterDisplayInterfaceType.Simple), // + + ArkrayGT_1810(60004, "Arkray Glucocard G+ (1810)", "ark_glucocard_gplus.png", // + "INSTRUCTIONS_ARKRAY", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Arkray, DeviceHandlerType.ArkrayMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 450, MeterDisplayInterfaceType.Simple), // + + ArkrayGT_1820(60005, "Arkray Glucocard G+ (1820)", "ark_glucocard_gplus.png", // + "INSTRUCTIONS_ARKRAY", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Arkray, DeviceHandlerType.ArkrayMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 450, MeterDisplayInterfaceType.Simple), // + + ArkrayGlucoCardMX(60006, "Arkray Glucocard MX", "ark_glucocard_mx.png", // + "INSTRUCTIONS_ARKRAY", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Arkray, DeviceHandlerType.ArkrayMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.Serial_USBBridge, // + DeviceProgressStatus.Special, "", 500, MeterDisplayInterfaceType.Simple), // + + ArkrayGlucoCardSM(60007, "Arkray Glucocard SM", "ark_glucocard_sm.png", // + "INSTRUCTIONS_ARKRAY", null, DeviceImplementationStatus.Testing, // + DeviceCompanyDefinition.Arkray, DeviceHandlerType.ArkrayMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, // + DeviceProgressStatus.Special, "", 500, MeterDisplayInterfaceType.Simple), // + + // Missing: Implementations there but incomplete: ArkrayGlucoCardPlus() [450], ArkrayGlucoCard(), ArkrayGlucoCardMemoryPC(), + + + + ; + static List<DeviceDefinition> allDevices; static List<DeviceDefinition> supportedDevices; + private static final Logger LOG = LoggerFactory.getLogger(MeterDeviceDefinition.class); static { @@ -168,19 +288,19 @@ } } - System.out.println( - "Meter Devices V2 (registered: " + allDevices.size() + ", supported: " + supportedDevices.size() + ")"); + // LOG.info("Meter Devices V2 (registered: " + allDevices.size() + + // ", supported: " + supportedDevices.size() + ")"); } // we need to extend this to all values currently in DeviceImplementation int deviceId; - String deviceName; + String deviceName = "no name"; String iconName; String instructions; Object internalDefintion; DeviceImplementationStatus implementationStatus; DeviceCompanyDefinition companyDefinition; - DeviceHandlerType deviceHandlerType; + DeviceHandlerType deviceHandlerType = DeviceHandlerType.NullHandler; DevicePortParameterType devicePortParameterType; DeviceConnectionProtocol deviceConnectionProtocol; DeviceProgressStatus deviceProgressStatus; @@ -188,8 +308,14 @@ int maxRecords; MeterDisplayInterfaceType displayInterfaceType; + @Deprecated + MeterDeviceDefinition() + { - private MeterDeviceDefinition(int id, String name, String iconName, String instructions, Object internalDefinition, + } + + + MeterDeviceDefinition(int id, String name, String iconName, String instructions, Object internalDefinition, DeviceImplementationStatus implementationStatus, DeviceCompanyDefinition companyDefinition, DeviceHandlerType deviceHandlerType, DevicePortParameterType portParameterType, DeviceConnectionProtocol connectionProtocol, DeviceProgressStatus progressStatus, String specialComment, Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceHandler.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceHandler.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceHandler.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -1,5 +1,6 @@ package ggc.meter.defs.device; +import ggc.core.plugins.GGCPluginType; import ggc.meter.util.DataAccessMeter; import ggc.plugin.device.v2.DeviceDefinition; import ggc.plugin.device.v2.DeviceHandlerAbstract; @@ -37,4 +38,20 @@ dataAccessMeter = DataAccessMeter.getInstance(); } + + protected DataAccessMeter getDataAccess() + { + checkIfDataAccessSet(); + return dataAccessMeter; + } + + + /** + * {@inheritDoc} + */ + public GGCPluginType getGGCPluginType() + { + return GGCPluginType.MeterToolPlugin; + } + } Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/DummyMeter.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/DummyMeter.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/DummyMeter.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -43,7 +43,7 @@ } // DataAccessMeter dataAccess = DataAccessMeter.getInstance(); - // I18nControlAbstract m_ic = dataAccess.getI18nControlInstance(); + // I18nControlAbstract i18nControl = dataAccess.getI18nControlInstance(); /** * This is method for reading data from device. All reading from actual device should be done from here. Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/SerialMeterAbstract.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/SerialMeterAbstract.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/SerialMeterAbstract.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -1,6 +1,7 @@ package ggc.meter.device; import java.io.EOFException; +import java.util.List; import java.util.Set; import org.slf4j.Logger; @@ -9,7 +10,9 @@ import com.atech.utils.data.ATechDate; import com.atech.utils.data.ATechDateType; +import ggc.core.data.ExtendedDailyValueType; import ggc.core.data.defs.GlucoseUnitType; +import ggc.meter.data.GlucoseMeterMarkerDto; import ggc.meter.data.MeterValuesEntry; import ggc.meter.defs.device.MeterDeviceDefinition; import ggc.meter.util.DataAccessMeter; @@ -29,6 +32,17 @@ private static final Logger LOG = LoggerFactory.getLogger(SerialMeterAbstract.class); + public static final char STX = '\002'; + public static final char ETX = '\003'; + public static final char EOT = '\004'; + public static final char ENQ = '\005'; + public static final char ACK = '\006'; + public static final char ETB = '\027'; + public static final char LF = '\n'; + public static final char CR = '\r'; + public static final char NAK = '\025'; + public static final char CAN = '\030'; + protected DataAccessMeter dataAccess; protected OutputWriter outputWriter; protected NRSerialCommunicationHandler communicationHandler; @@ -36,7 +50,7 @@ protected boolean active = false; protected String serialNumber; protected MeterDeviceDefinition deviceDefinition; - protected GlucoseUnitType glucoseUnitType; + protected GlucoseUnitType glucoseUnitType = GlucoseUnitType.mg_dL; private int receiveTimeout; @@ -67,6 +81,12 @@ } + public void closeDevice() + { + this.communicationHandler.disconnectDevice(); + } + + protected abstract void preInitDevice() throws PlugInBaseException; @@ -141,7 +161,7 @@ } - protected char readChar() throws Exception + protected char readChar() throws PlugInBaseException { int rv = -1; @@ -158,10 +178,10 @@ { if (this.active) { - throw new EOFException("Serial port timeout on " + this.portName); + throw new PlugInBaseException("Serial port timeout on " + this.portName); } - throw new InterruptedException(); + throw new PlugInBaseException(PlugInExceptionType.TimeoutReadingData); } return (char) rv; } @@ -174,6 +194,7 @@ { if (s == null) return null; + if (s.length() <= size) { return s; @@ -203,7 +224,8 @@ protected void disconnectDevice() { - this.communicationHandler.disconnectDevice(); + if (this.communicationHandler != null) + this.communicationHandler.disconnectDevice(); this.active = false; } @@ -226,6 +248,18 @@ } + protected void writeDeviceIdentification(String serialNumber) + { + DeviceIdentification deviceIdentification = new DeviceIdentification(dataAccess.getI18nControlInstanceBase()); + deviceIdentification.setDeviceDefinition(this.deviceDefinition); + deviceIdentification.device_serial_number = serialNumber; + this.serialNumber = serialNumber; + + outputWriter.setDeviceIdentification(deviceIdentification); + outputWriter.writeDeviceIdentification(); + } + + public void setGlucoseUnitType(GlucoseUnitType glucoseUnitType) { this.glucoseUnitType = glucoseUnitType; @@ -242,6 +276,77 @@ } + public void writeBGData(float bg, ATechDate aTechDate) + { + MeterValuesEntry mve = new MeterValuesEntry(); + mve.setBgValue(bg, glucoseUnitType); + mve.setDateTimeObject(aTechDate); + + this.outputWriter.writeData(mve); + } + + + public void writeBGData(float bg, GlucoseUnitType unitType, ATechDate aTechDate) + { + MeterValuesEntry mve = new MeterValuesEntry(); + mve.setBgValue(bg, unitType); + mve.setDateTimeObject(aTechDate); + + this.outputWriter.writeData(mve); + } + + + public void writeBGData(float bg, GlucoseUnitType unitType, ATechDate aTechDate, + List<GlucoseMeterMarkerDto> markers) + { + MeterValuesEntry mve = new MeterValuesEntry(); + mve.setBgValue(bg, unitType); + mve.setDateTimeObject(aTechDate); + + for (GlucoseMeterMarkerDto marker : markers) + mve.addGlucoseMeterMarker(marker); + + this.outputWriter.writeData(mve); + } + + + public void writeUrineData(Float value, GlucoseUnitType unitType, ATechDate adt) + { + if (value == null) + return; + + MeterValuesEntry mve = new MeterValuesEntry(); + + mve.setDateTimeObject(adt); + + float urineMmoL = value; + + if (unitType == GlucoseUnitType.mg_dL) + { + urineMmoL = dataAccess.getBGValueByType(GlucoseUnitType.mg_dL, GlucoseUnitType.mmol_L, value); + } + + mve.setUrine(ExtendedDailyValueType.Urine_mmolL, dataAccess.getFormatedValue(urineMmoL, 1)); + + this.outputWriter.writeData(mve); + + } + + + public void writeBGData(float bg, int year, int month, int day, int hour, int minute, + List<GlucoseMeterMarkerDto> markers) + { + MeterValuesEntry mve = new MeterValuesEntry(); + mve.setBgValue(bg, glucoseUnitType); + mve.setDateTimeObject(getATechDate(year, month, day, hour, minute)); + + for (GlucoseMeterMarkerDto marker : markers) + mve.addGlucoseMeterMarker(marker); + + this.outputWriter.writeData(mve); + } + + public ATechDate getATechDate(int year, int month, int day, int hour, int minute) { return new ATechDate(day, month, year, hour, minute, ATechDateType.DateAndTimeMin); @@ -253,4 +358,19 @@ communicationHandler.read(data); } + + public void readUntilCharacterReceived(char character) throws PlugInBaseException + { + char c; + + while ((c = readChar()) != character) + ; + } + + + public void readUntilACKReceived() throws PlugInBaseException + { + readUntilCharacterReceived(ACK); + } + } Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/UsbMeterAbstract.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/UsbMeterAbstract.java 2017-06-19 18:10:37 UTC (rev 1457) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/UsbMeterAbstract.java 2017-06-24 11:31:09 UTC (rev 1458) @@ -1,9 +1,7 @@ package ggc.meter.device; import java.io.EOFException; -import java.util.ArrayList; import java.util.List; -import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,20 +10,18 @@ import com.atech.utils.data.ATechDateType; import ggc.core.data.defs.GlucoseUnitType; +import ggc.meter.data.GlucoseMeterMarkerDto; import ggc.meter.data.MeterValuesEntry; import ggc.meter.defs.device.MeterDeviceDefinition; import ggc.meter.util.DataAccessMeter; -import ggc.plugin.comm.NRSerialCommunicationHandler; -import ggc.plugin.comm.cfg.SerialSettings; +import ggc.plugin.comm.Hid4JavaCommunicationHandler; import ggc.plugin.comm.cfg.USBDevice; -import ggc.plugin.data.GGCPlugInFileReaderContext; -import ggc.plugin.data.enums.PlugInExceptionType; import ggc.plugin.device.DeviceIdentification; -import ggc.plugin.device.DownloadSupportType; import ggc.plugin.device.PlugInBaseException; import ggc.plugin.device.v2.DeviceDefinition; import ggc.plugin.output.OutputWriter; +// TODO /** * This is abstract class for Usb meters, that works with new framework (MeterInterface2). */ @@ -32,17 +28,17 @@ public abstract class UsbMeterAbstract { - private static final Logger LOG = LoggerFactory.getLogger(SerialMeterAbstract.class); + private static final Logger LOG = LoggerFactory.getLogger(UsbMeterAbstract.class); protected DataAccessMeter dataAccess; protected OutputWriter outputWriter; - protected NRSerialCommunicationHandler communicationHandler; - protected String portName; + protected Hid4JavaCommunicationHandler communicationHandler; protected boolean active = false; protected String serialNumber; protected MeterDeviceDefinition deviceDefinition; protected GlucoseUnitType glucoseUnitType; private int receiveTimeout; + protected List<USBDevice> allowedDevicesList; public UsbMeterAbstract(DataAccessMeter dataAccess, OutputWriter outputWriter, @@ -50,14 +46,20 @@ { this.dataAccess = dataAccess; this.outputWriter = outputWriter; - this.portName = portName; this.deviceDefinition = deviceDefinition; + createAllowedDevicesList(); } + /** + * Creates list of Allowed USB devices for this implementation. + */ + protected abstract void createAllowedDevicesList(); + + public void readData() throws PlugInBaseException { - checkIfDevicePresentOnConfiguredPort(); + // checkIfDevicePresentOnConfiguredPort(); connectDevice(); preInitDevice(); readDeviceData(); @@ -64,45 +66,27 @@ } - private void connectDevice() + private void connectDevice() throws PlugInBaseException { - communicationHandler = new NRSerialCommunicationHandler(portName, getSerialSettings()); + communicationHandler = new Hid4JavaCommunicationHandler(); + communicationHandler.setAllowedDevices(allowedDevicesList); + communicationHandler.setDelayForTimedReading(100); communicationHandler.connectAndInitDevice(); this.active = true; } + public void closeDevice() throws PlugInBaseException + { + communicationHandler.disconnectDevice(); + } + + protected abstract void preInitDevice() throws PlugInBaseException; private void checkIfDevicePresentOnConfiguredPort() throws PlugInBaseException { - Set<String> availablePorts = NRSerialCommunicationHandler.getAvailablePorts(); - - boolean found = false; - - for (String port : availablePorts) - { - if (port.equalsIgnoreCase(portName)) - { - found = true; - break; - } - } - - if (!found) - { - throw new PlugInBaseException(PlugInExceptionType.DeviceNotFoundOnConfiguredPort); - // if (availablePorts.size() > 0) - // { - // - // } - // else - // { - // throw new - // PlugInBaseException(PlugInExceptionType.DeviceNotFoundOnConfiguredPort); - // } - } } @@ -139,7 +123,7 @@ if (this.active) { - throw new EOFException("Serial port timeout on " + this.portName); + throw new EOFException("Serial port timeout on " + this.communicationHandler.getSelectedDevice()); } return -1; @@ -163,7 +147,7 @@ { if (this.active) { - throw new EOFException("Serial port timeout on " + this.portName); + throw new EOFException("Serial port timeout on " + this.communicationHandler.getSelectedDevice()); } throw new InterruptedException(); @@ -172,9 +156,6 @@ } - public abstract Seria... [truncated message content] |
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] |
From: <and...@us...> - 2016-12-26 14:02:40
|
Revision: 1456 http://sourceforge.net/p/ggc/code/1456 Author: andyrozman Date: 2016-12-26 14:02:38 +0000 (Mon, 26 Dec 2016) Log Message: ----------- - minor changes Modified Paths: -------------- trunk/ggc-future/pom.xml trunk/ggc-plugins/ggc-plugins-base/docs/Changelog trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java trunk/pom.xml Modified: trunk/ggc-future/pom.xml =================================================================== --- trunk/ggc-future/pom.xml 2016-12-26 14:02:03 UTC (rev 1455) +++ trunk/ggc-future/pom.xml 2016-12-26 14:02:38 UTC (rev 1456) @@ -9,7 +9,7 @@ <relativePath>../pom.xml</relativePath> </parent> - <name>GGC Future Modules</name> + <name>GGC Future</name> <artifactId>ggc-future</artifactId> <packaging>pom</packaging> Modified: trunk/ggc-plugins/ggc-plugins-base/docs/Changelog =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/docs/Changelog 2016-12-26 14:02:03 UTC (rev 1455) +++ trunk/ggc-plugins/ggc-plugins-base/docs/Changelog 2016-12-26 14:02:38 UTC (rev 1456) @@ -2,6 +2,9 @@ Changes file for GGC Plug-In Base ================================== +1.2.3 [25.12.2016] +- refactoring AccuChek meters to MeterInterface V2 + 1.2.2 [26.6.2016] [Andy] - extended CommunicationInterface - refactorings Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java 2016-12-26 14:02:03 UTC (rev 1455) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceCompanyDefinition.java 2016-12-26 14:02:38 UTC (rev 1456) @@ -2,7 +2,6 @@ import ggc.plugin.manager.DeviceImplementationStatus; - /** * Application: GGC - GNU Gluco Control * Plug-in: Meter Tool (support for Meter devices) @@ -29,15 +28,16 @@ * Author: Andy {an...@at...} */ -public enum DeviceCompanyDefinition { +public enum DeviceCompanyDefinition +{ // 1xx = Meter Ascensia(101, "Ascensia/Bayer", "", DeviceImplementationStatus.Done), // + // AccuChek(102, "Accu-Chek/Roche", "", DeviceImplementationStatus.Done), // Lifescan(103, "One Touch/Lifescan", "", DeviceImplementationStatus.Partitial), // Menarini(105, "Menarini", "", DeviceImplementationStatus.Planned), // Arkray(106, "Arkray", "", DeviceImplementationStatus.Planned), // - // 2xx = Pump Deltec(205, "Deltec", "", DeviceImplementationStatus.NotAvailable), // Insulet(206, "Insulet", "", DeviceImplementationStatus.Done), // @@ -47,14 +47,13 @@ // 3xx = CGMS Dexcom(301, "Dexcom", "", DeviceImplementationStatus.Partitial), // - // 4xx = Pump + CGMS Animas(401, "Animas", "", DeviceImplementationStatus.Full), // Minimed(402, "Minimed", "", DeviceImplementationStatus.Planned), // Tandem(403, "Tandem", "", DeviceImplementationStatus.Planned), // // 5xx = Meter + Pump - Roche(202, "AccuChek/Roche", "", DeviceImplementationStatus.Partitial), // Disetronic(2), + Roche(202, "AccuChek/Roche", "", DeviceImplementationStatus.Done), // Disetronic(2), // 6xx = Meter + CGMS Abbott(302, "Abbott", "", DeviceImplementationStatus.NotAvailable), // @@ -69,7 +68,8 @@ DeviceImplementationStatus companyImplementationStatus; - DeviceCompanyDefinition(int id, String name, String description, DeviceImplementationStatus implementationStatus) { + DeviceCompanyDefinition(int id, String name, String description, DeviceImplementationStatus implementationStatus) + { this.id = id; this.companyName = name; this.companyDescription = description; @@ -77,22 +77,26 @@ } - public String getName() { + public String getName() + { return this.companyName; } - public int getCompanyId() { + public int getCompanyId() + { return this.id; } - public String getDescription() { + public String getDescription() + { return this.companyDescription; } - public DeviceImplementationStatus getImplementationStatus() { + public DeviceImplementationStatus getImplementationStatus() + { return this.companyImplementationStatus; } Modified: trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java =================================================================== --- trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java 2016-12-26 14:02:03 UTC (rev 1455) +++ trunk/ggc-plugins/ggc-plugins-base/src/main/java/ggc/plugin/data/enums/DeviceHandlerType.java 2016-12-26 14:02:38 UTC (rev 1456) @@ -37,6 +37,7 @@ AscensiaUsbHandler(DownloadSupportType.DownloadData), // ArkrayMeterHandler(DownloadSupportType.DownloadData), // MenariniMeterHandler(DownloadSupportType.DownloadData), // + AccuChekMeterHandler(DownloadSupportType.DownloadData), // // Pumps AnimasV2PumpHandler(DownloadSupportType.Download_Data_Config), // Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2016-12-26 14:02:03 UTC (rev 1455) +++ trunk/pom.xml 2016-12-26 14:02:38 UTC (rev 1456) @@ -595,6 +595,7 @@ <module>ggc-core-app</module> <module>ggc-plugins</module> <module>ggc-support</module> + <module>ggc-future</module> <module>ggc-desktop-app</module> <module>ggc-doctor-app</module> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2016-12-26 14:02:07
|
Revision: 1455 http://sourceforge.net/p/ggc/code/1455 Author: andyrozman Date: 2016-12-26 14:02:03 +0000 (Mon, 26 Dec 2016) Log Message: ----------- pump - changing classes, because move of previous files was unsecucesfull and files were mishandeled. Modified Paths: -------------- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDailyStatistics.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntry.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryExt.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryInterface.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryProfile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHour.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHourProcessor.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesTableModel.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpWriterValues.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BREData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BREDataCollection.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BasalEstimationData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/RatioData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/cfg/PumpConfigurationDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAdditionalDataType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAlarms.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBasalType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBaseType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBolusType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationGroup.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationOld.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpDeviceValueType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpErrors.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpEventType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpReport.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalRatesDayDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BasalStatistics.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BolusDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/BolusWizardDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/RatioDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/dto/TemporaryBasalRateDTO.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewBasalRateEstimator.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewDailyPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/GraphViewProfileEditor.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/BREGraphsAbstract.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/GraphViewBasalRate.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/GraphViewBasals.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/GraphViewRatios.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/bre/Test.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/graph/v1/GraphV1DbRetrieverPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/profile/Profile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/profile/ProfileSubEntry.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/profile/ProfileSubOther.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/profile/ProfileSubPattern.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/util/PumpAdditionalDataHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/util/PumpBasalManager.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/util/PumpBolusManager.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/writer/PumpValuesWriter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/writer/PumpWriterDefInterface.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/GGCPumpDb.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/PumpData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/PumpDataExtended.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/db/PumpProfile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/PumpPluginDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpDeviceDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpDeviceHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpProfileDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/device/PumpTBRDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/defs/report/PumpReportDefinition.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/AbstractBlueToothPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/AbstractPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/AbstractSerialPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/AbstractXmlPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/DummyPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/PumpDeviceInstanceWithHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/PumpInterface.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/PumpInterfaceV2.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/accuchek/AccuChekCombo.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/accuchek/AccuChekDTron.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/accuchek/AccuChekPumpHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/accuchek/AccuChekPumpReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/accuchek/AccuChekSmartPixPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/accuchek/AccuChekSpirit.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/accuchek/DisetronicDTron.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/AnimasIR1200Handler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/FRC_EZManager_v2.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/AnimasPumpDeviceReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/converter/AnimasBaseDataV2Converter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/AnimasPumpDeviceData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/BasalLogDay.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/BasalLogEntry.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/BasalProfile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/BasalProfileEntry.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/BolusEntry.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/BolusExtEntry.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/data/dto/PumpSettings.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/handler/AnimasBaseDataV2Handler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/animas/impl/handler/AnimasPumpDataWriter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaDiabecare_II.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaDiabecare_III_R.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaDiabecare_IIS.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaPumpHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/DanaPumpHandlerV2.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/PacketStreamReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/impl/DanaDeviceReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/impl/comm/DanaCommProtocolAbstract.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/impl/comm/DanaCommProtocolNRSV1.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/impl/comm/DanaCommProtocolV1.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/dana/impl/data/defs/DanaDataType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/deltec/DeltecCosmo1700.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/deltec/DeltecCosmo1800.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/deltec/DeltecPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/deltec/FRC_CoPilotXMLPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/FRC_InsuletOmnipod.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/InsuletHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/InsuletReader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/converter/OmnipodConfigConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/converter/OmnipodConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/converter/OmnipodDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/AbstractRecord.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/UnknownRecord.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/BasalProgramNames.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/ConfigRecord.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/EepromSettings.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/IbfVersion.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/LogDescription.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/LogDescriptions.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/LogHeader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/ManufacturingData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/PdmVersion.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/Profile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/config/ProfileHeader.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/data/HistoryRecord.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/data/LogRecord.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/dto/data/PumpAlarmRecord.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/enums/AlarmType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/enums/BGFlags.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/enums/HistoryRecordType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/enums/LogType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/enums/OmnipodDataType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/data/enums/ProfileType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/insulet/util/InsuletUtil.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/MinimedPumpDeviceHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/PumpHistoryEntry.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed511PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed512PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed515PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/converter/Minimed523PumpDataConverter.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/decoder/MinimedPumpHistoryDecoder.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/data/enums/PumpHistoryEntryType.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/file/FRC_MinimedCarelink.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/file/FRC_MinimedCarelinkConfig.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/file/MinimedCareLinkPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/file/MinimedCareLinkPumpData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/file/MinimedCareLinkPumpProfile.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/old/MinimedSPM.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/old/MinimedSPMData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/device/minimed/old/MinimedSPMPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/graph/PumpGraphContext.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/graph/PumpGraphDefintion.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/bre/BasalRateEstimator.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/bre/BasalRateEstimatorAlgorithm.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataAdditionalWizardOne.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataAdditionalWizardTwo.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataDialog.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataRowDialog.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataTableModel.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataTypeComponent.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/manual/PumpDataTypeComponent2.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/PumpDataTypeAlarmHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/PumpDataTypeBasalHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/PumpDataTypeBolusHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/PumpDataTypeComponentHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/PumpDataTypeComponentHandlerAbstract.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/PumpDataTypeErrorHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/PumpDataTypeEventHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/PumpDataTypePenInjectionHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/pdtc/TemporaryBasalRateComponent.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/profile/ProfileEditor.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/profile/ProfileEntryDialog.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/profile/ProfileSelector.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/gui/profile/ProfileSelectorPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/manager/PumpDevicesIds.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/manager/PumpManager.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/manager/company/AbstractPumpDeviceCompany.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/manager/company/Deltec.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/manager/company/GenericPumpDevice.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/manager/company/Roche.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/manager/company/Sooil.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/plugin/BackupRestorePumpHandler.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/plugin/PumpPlugInServer.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpBasalCheckSheet.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataAbstract.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataBase.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataDailyTimeSheet.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataExt.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/report/PrintPumpDataProfiles.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/AbstractPumpTest.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/BasalManagerTest.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/DanaPumpTester.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/GUITest.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/MinimedConsoleTester.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/MinimedDecoderTester.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/PumpConsoleTester.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/TestAnimas.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/TestOmnipod.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/minimed/DecoderLoadData.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/minimed/MinimedBaseTest.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/minimed/MinimedCarelinkUSBTester.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/minimed/MinimedConsoleTester.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/test/minimed/MinimedDecoderTester.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/util/DataAccessPump.java trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/util/GGCPumpICRunner.java Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDailyStatistics.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDailyStatistics.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDailyStatistics.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,10 +1,10 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import com.atech.misc.statistics.StatisticsCollection; import ggc.core.data.defs.GlucoseUnitType; -import main.java.ggc.pump.data.defs.PumpBaseType; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.data.defs.PumpBaseType; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataHandler.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataHandler.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataHandler.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,8 +1,8 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import ggc.plugin.data.DeviceDataHandler; import ggc.plugin.util.DataAccessPlugInBase; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataReader.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataReader.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpDataReader.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import java.util.Hashtable; @@ -7,8 +7,8 @@ import ggc.plugin.data.DeviceValuesEntryInterface; import ggc.plugin.gui.OldDataReaderAbstract; -import main.java.ggc.pump.db.GGCPumpDb; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.db.GGCPumpDb; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntry.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntry.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntry.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import java.util.*; @@ -19,8 +19,8 @@ import ggc.plugin.graph.data.GraphValuesCapable; import ggc.plugin.output.OutputWriterType; import ggc.plugin.util.DataAccessPlugInBase; -import main.java.ggc.pump.data.defs.*; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.data.defs.*; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control Plug-in: Pump Tool (support for Pump Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryExt.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryExt.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryExt.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import java.util.ArrayList; @@ -19,8 +19,8 @@ import ggc.plugin.graph.data.GraphValuesCapable; import ggc.plugin.output.OutputWriterType; import ggc.plugin.util.DeviceValuesEntryUtil; -import main.java.ggc.pump.data.defs.PumpAdditionalDataType; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.data.defs.PumpAdditionalDataType; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryInterface.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryInterface.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryInterface.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import ggc.plugin.data.DeviceValuesEntryInterface; Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryProfile.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryProfile.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesEntryProfile.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import java.util.ArrayList; import java.util.Calendar; @@ -18,8 +18,8 @@ import ggc.plugin.data.enums.DeviceEntryStatus; import ggc.plugin.output.OutputWriterType; import ggc.plugin.util.DeviceValuesEntryUtil; -import main.java.ggc.pump.data.profile.ProfileSubEntry; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.data.profile.ProfileSubEntry; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHour.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHour.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHour.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import java.util.HashMap; @@ -9,9 +9,9 @@ import com.atech.utils.data.ATechDate; import com.atech.utils.data.ExceptionHandling; -import main.java.ggc.pump.data.defs.PumpBaseType; -import main.java.ggc.pump.data.defs.PumpBolusType; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.data.defs.PumpBaseType; +import ggc.pump.data.defs.PumpBolusType; +import ggc.pump.util.DataAccessPump; public class PumpValuesHour { Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHourProcessor.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHourProcessor.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesHourProcessor.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import java.util.ArrayList; import java.util.HashMap; @@ -7,10 +7,10 @@ import org.apache.commons.lang.StringUtils; import ggc.plugin.data.DeviceValuesEntry; -import main.java.ggc.pump.data.defs.PumpAdditionalDataType; -import main.java.ggc.pump.data.defs.PumpBaseType; -import main.java.ggc.pump.data.defs.PumpDeviceValueType; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.data.defs.PumpAdditionalDataType; +import ggc.pump.data.defs.PumpBaseType; +import ggc.pump.data.defs.PumpDeviceValueType; +import ggc.pump.util.DataAccessPump; public class PumpValuesHourProcessor { Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesTableModel.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesTableModel.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpValuesTableModel.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,8 +1,8 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import ggc.plugin.data.DeviceDataHandler; import ggc.plugin.data.DeviceValuesTableModel; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -40,7 +40,7 @@ * Constructor * * @param ddh - + */ public PumpValuesTableModel(DeviceDataHandler ddh, String source) { Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpWriterValues.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpWriterValues.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/PumpWriterValues.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data; +package ggc.pump.data; import com.atech.utils.data.ATechDate; import com.atech.utils.data.CodeEnumWithTranslation; @@ -40,27 +40,32 @@ this(_object_type, _base_type, _sub_type, null, isNumericValue); } + public PumpWriterValues(int _object_type, CodeEnumWithTranslation _base_type, int _sub_type, Boolean isNumericValue) { this(_object_type, _base_type.getCode(), _sub_type, null, isNumericValue); } + public PumpWriterValues(int _object_type, CodeEnumWithTranslation _base_type, CodeEnumWithTranslation _sub_type, - Boolean isNumericValue) + Boolean isNumericValue) { this(_object_type, _base_type.getCode(), _sub_type.getCode(), null, isNumericValue); } + public PumpWriterValues(int _object_type, int _base_type, Boolean isNumericValue) { this(_object_type, _base_type, 0, null, isNumericValue); } + public PumpWriterValues(int _object_type, CodeEnumWithTranslation _base_type, Boolean isNumericValue) { this(_object_type, _base_type.getCode(), 0, null, isNumericValue); } + /** * @param _object_type * @param _base_type @@ -68,7 +73,7 @@ * @param _value_template */ public PumpWriterValues(int _object_type, int _base_type, int _sub_type, String _value_template, - Boolean isNumericValue) + Boolean isNumericValue) { super(_object_type, _base_type, _sub_type, _value_template, isNumericValue); } @@ -82,7 +87,7 @@ /** * Pump Object: Base SubType */ - //public static final int OBJECT_BASE_SET_SUBTYPE = 4; + // public static final int OBJECT_BASE_SET_SUBTYPE = 4; /** * Pump Object: Extended @@ -94,6 +99,7 @@ */ public static final int OBJECT_PROFILE = 3; + /* * public void writeObject(OutputWriter ow, String _value) * { @@ -126,7 +132,7 @@ pve.setSubType(stype); pve.setDateTimeObject(dt); - //System.out.println("PumpTempValues [" + pve.toString() + "]"); + // System.out.println("PumpTempValues [" + pve.toString() + "]"); if (this.value_template == null) { @@ -139,15 +145,15 @@ return pve; } -// else if (this.object_type == PumpTempValues.OBJECT_BASE_SET_SUBTYPE) -// { -// PumpValuesEntry pve = new PumpValuesEntry(); -// pve.setBaseType(this.base_type); -// pve.setSubType(Integer.parseInt(val)); -// pve.setDateTimeObject(dt); -// -// return pve; -// } + // else if (this.object_type == PumpTempValues.OBJECT_BASE_SET_SUBTYPE) + // { + // PumpValuesEntry pve = new PumpValuesEntry(); + // pve.setBaseType(this.base_type); + // pve.setSubType(Integer.parseInt(val)); + // pve.setDateTimeObject(dt); + // + // return pve; + // } else if (this.object_type == PumpWriterValues.OBJECT_EXT) { PumpValuesEntryExt pvex = new PumpValuesEntryExt(); Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BREData.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BREData.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BREData.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.bre; +package ggc.pump.data.bre; import com.atech.utils.data.ATechDate; @@ -41,6 +41,7 @@ */ public static final int BRE_DATA_BASAL_RATIO_GRAPH = 100; + /** * Constructor * @@ -75,6 +76,7 @@ */ public float value = 0.0f; + /** * Are we in time range. * @@ -90,6 +92,7 @@ return false; } + /** * toString */ @@ -123,7 +126,7 @@ sb.append("</font></html>"); return sb.toString(); - // return atd.getTimeString() + " " + + // return atd.getTimeString() + " " + // DataAccessPump.Decimal1Format.format(value); } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BREDataCollection.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BREDataCollection.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BREDataCollection.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.bre; +package ggc.pump.data.bre; import java.util.ArrayList; @@ -39,6 +39,7 @@ */ ArrayList<BasalEstimationData> basal_estimation; + /** * Instantiates a new bRE data collection. */ @@ -52,6 +53,7 @@ basal_estimation = new ArrayList<BasalEstimationData>(); } + /** * Adds the BREData * @@ -86,6 +88,7 @@ } + /** * Adds the BREData * @@ -99,6 +102,7 @@ add(type, data); } + /** * Adds the BREData * @@ -113,6 +117,7 @@ this.ratios.add(data); } + /** * Gets the data by type * @@ -138,6 +143,7 @@ } + /** * Gets the ratios collection * @@ -160,6 +166,7 @@ } + /** * Process ratios */ @@ -183,6 +190,7 @@ } + /** * Process old basals */ @@ -207,6 +215,7 @@ } + /** * Process new basals */ @@ -215,6 +224,7 @@ processBasals(this.basal_new); } + /** * Process basals * @@ -244,6 +254,7 @@ } } + /** * Sets the basal estimation data * @@ -254,6 +265,7 @@ this.basal_estimation = data; } + /** * Gets the basal estimation data * Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BasalEstimationData.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BasalEstimationData.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/BasalEstimationData.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.bre; +package ggc.pump.data.bre; // TODO: Auto-generated Javadoc /** @@ -22,6 +22,7 @@ */ public double insulin_value; + /** * toString */ Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/RatioData.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/RatioData.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/bre/RatioData.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.bre; +package ggc.pump.data.bre; import com.atech.utils.data.ATechDate; @@ -36,6 +36,7 @@ */ public float ratio_ch_bg = 0.0f; + /** * Constructor * @@ -52,6 +53,7 @@ this.ratio_ch_bg = ratio_ch_bg; } + /** * toString */ Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/cfg/PumpConfigurationDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/cfg/PumpConfigurationDefinition.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/cfg/PumpConfigurationDefinition.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,12 +1,12 @@ -package main.java.ggc.pump.data.cfg; +package ggc.pump.data.cfg; import java.util.List; import com.atech.graphics.dialogs.selector.SelectableInterface; import ggc.plugin.cfg.DeviceConfigurationDefinition; -import main.java.ggc.pump.device.DummyPump; -import main.java.ggc.pump.manager.PumpManager; +import ggc.pump.device.DummyPump; +import ggc.pump.manager.PumpManager; /** * Application: GGC - GNU Gluco Control @@ -48,6 +48,7 @@ return "PUMP"; } + /** * Only certain devices support manual time fix for application (meters do, other's don't). * @@ -58,6 +59,7 @@ return false; } + /** * Get path to Configuration file as string * @@ -68,6 +70,7 @@ return "../data/tools/PumpConfiguration.properties"; } + /** * Returns Dummy object (needed for some actions) * @@ -78,6 +81,7 @@ return new DummyPump(); } + /** * Returns list of all supported devices for plugin. Needed for device selection * @@ -85,9 +89,10 @@ */ public List<SelectableInterface> getSupportedDevices() { - return PumpManager.getInstance().getSupportedDevicesForSelector(); //.getSupportedDevices(); + return PumpManager.getInstance().getSupportedDevicesForSelector(); // .getSupportedDevices(); } + /** * Returns prefix for help context * @@ -98,11 +103,12 @@ return "PumpTool_"; } + public Object getSpecificDeviceInstance(String company, String deviceName) { Object device = PumpManager.getInstance().getDeviceV2(company, deviceName); - if (device==null) + if (device == null) { device = PumpManager.getInstance().getDeviceV1(company, deviceName); } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAdditionalDataType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAdditionalDataType.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAdditionalDataType.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.ArrayList; import java.util.HashMap; @@ -8,8 +8,8 @@ import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import main.java.ggc.pump.data.PumpValuesEntryExt; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.data.PumpValuesEntryExt; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -91,9 +91,9 @@ } String[] addata_desc_lcl = { ic.getMessage("SELECT_ADDITIONAL_DATA"), ic.getMessage("ADD_DATA_ACTIVITY"), - ic.getMessage("ADD_DATA_COMMENT"), ic.getMessage("ADD_DATA_BG"), - ic.getMessage("ADD_DATA_URINE"), ic.getMessage("ADD_DATA_CH"), - ic.getMessage("ADD_DATA_FOOD_DB"), ic.getMessage("ADD_DATA_FOOD_DESC"), }; + ic.getMessage("ADD_DATA_COMMENT"), ic.getMessage("ADD_DATA_BG"), + ic.getMessage("ADD_DATA_URINE"), ic.getMessage("ADD_DATA_CH"), + ic.getMessage("ADD_DATA_FOOD_DB"), ic.getMessage("ADD_DATA_FOOD_DESC"), }; addata_desc = addata_desc_lcl; } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAlarms.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAlarms.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpAlarms.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.Collection; import java.util.HashMap; @@ -8,7 +8,7 @@ import com.atech.utils.ATDataAccess; import com.atech.utils.data.CodeEnumWithTranslation; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control Plug-in: Pump Tool (support for Pump @@ -106,19 +106,19 @@ } String[] alarm_desc_lcl = { ic.getMessage("SELECT_SUBTYPE"), // - ic.getMessage("ALARM_CARTRIDGE_LOW"), // - ic.getMessage("ALARM_BATTERY_LOW"), // - ic.getMessage("ALARM_REPLACE_BATTERY"), // - ic.getMessage("ALARM_REVIEW_DATETIME"), // - ic.getMessage("ALARM_ALARM_CLOCK"),// - ic.getMessage("ALARM_PUMP_TIMER"),// - ic.getMessage("ALARM_TEMPORARY_BASAL_RATE_CANCELED"),// - ic.getMessage("ALARM_TEMPORARY_BASAL_RATE_OVER"),// - ic.getMessage("ALARM_BOLUS_CANCELED"),// - ic.getMessage("ALARM_NO_DELIVERY"),// - ic.getMessage("ALARM_EMPTY_CARTRIDGE"),// - ic.getMessage("ALARM_AUTO_OFF"),// - ic.getMessage("ALARM_CALL_SERVICE"),// + ic.getMessage("ALARM_CARTRIDGE_LOW"), // + ic.getMessage("ALARM_BATTERY_LOW"), // + ic.getMessage("ALARM_REPLACE_BATTERY"), // + ic.getMessage("ALARM_REVIEW_DATETIME"), // + ic.getMessage("ALARM_ALARM_CLOCK"), // + ic.getMessage("ALARM_PUMP_TIMER"), // + ic.getMessage("ALARM_TEMPORARY_BASAL_RATE_CANCELED"), // + ic.getMessage("ALARM_TEMPORARY_BASAL_RATE_OVER"), // + ic.getMessage("ALARM_BOLUS_CANCELED"), // + ic.getMessage("ALARM_NO_DELIVERY"), // + ic.getMessage("ALARM_EMPTY_CARTRIDGE"), // + ic.getMessage("ALARM_AUTO_OFF"), // + ic.getMessage("ALARM_CALL_SERVICE"),// }; alarm_desc = alarm_desc_lcl; Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBasalType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBasalType.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBasalType.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.HashMap; import java.util.Map; @@ -7,7 +7,7 @@ import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -42,7 +42,8 @@ Value(1, "BASAL_VALUE"), // Profile(2, "BASAL_PROFILE"), // TemporaryBasalRate(3, "BASAL_TEMPORARY_BASAL_RATE"), // - @Deprecated TemporaryBasalRateProfile(4, "BASAL_TEMPORARY_BASAL_RATE_PROFILE"), // + @Deprecated + TemporaryBasalRateProfile(4, "BASAL_TEMPORARY_BASAL_RATE_PROFILE"), // PumpStatus(5, "BASAL_PUMP_STATUS"), // TemporaryBasalRateEnded(6, "BASAL_TEMPORARY_BASAL_RATE_ENDED"), // TemporaryBasalRateCanceled(7, "BASAL_TEMPORARY_BASAL_RATE_CANCELED"), // @@ -67,7 +68,6 @@ static Map<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>(); static Map<Integer, PumpBasalType> codeMapping = new HashMap<Integer, PumpBasalType>(); - static { I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBaseType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBaseType.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBaseType.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,11 +1,11 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.Hashtable; import com.atech.i18n.I18nControlAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control Plug-in: Pump Tool (support for Pump Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBolusType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBolusType.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpBolusType.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.HashMap; @@ -6,7 +6,7 @@ import com.atech.utils.ATDataAccess; import com.atech.utils.data.CodeEnumWithTranslation; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -48,7 +48,6 @@ static HashMap<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>(); static HashMap<Integer, PumpBolusType> codeMapping = new HashMap<Integer, PumpBolusType>(); - static { I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationGroup.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationGroup.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationGroup.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.HashMap; import java.util.Map; @@ -7,7 +7,7 @@ import com.atech.utils.data.CodeEnumWithTranslation; import ggc.plugin.data.enums.DeviceConfigurationGroup; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Created by andy on 27.02.15. @@ -23,7 +23,7 @@ Bolus(5, "GROUP_BOLUS"), // Sound(6, "GROUP_SOUND"), // - Other(20, "GROUP_OTHER"), ; // + Other(20, "GROUP_OTHER"),; // static Map<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>(); static Map<Integer, PumpConfigurationGroup> codeMapping = new HashMap<Integer, PumpConfigurationGroup>(); Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationOld.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationOld.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpConfigurationOld.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,10 +1,10 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.Hashtable; import com.atech.i18n.I18nControlAbstract; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -42,21 +42,22 @@ * Errors Description */ private String[] errors_desc = { ic.getMessage("ERROR_UNKNOWN_ERROR"), ic.getMessage("ERROR_CARTRIDGE_EMPTY"), - ic.getMessage("ERROR_BATTERY_DEPLETED"), ic.getMessage("ERROR_AUTOMATIC_OFF"), - ic.getMessage("ERROR_NO_DELIVERY"), ic.getMessage("ERROR_END_OF_OPERATION"), - ic.getMessage("ERROR_MECHANICAL_ERROR"), ic.getMessage("ERROR_ELECTRONIC_ERROR"), - ic.getMessage("ERROR_POWER_INTERRUPT"), ic.getMessage("ERROR_CARTRIDGE_ERROR"), - ic.getMessage("ERROR_SET_NOT_PRIMED"), ic.getMessage("ERROR_DATA_INTERRUPTED"), - ic.getMessage("ERROR_LANGUAGE_ERROR"), ic.getMessage("ERROR_INSULIN_CHANGED"), }; + ic.getMessage("ERROR_BATTERY_DEPLETED"), ic.getMessage("ERROR_AUTOMATIC_OFF"), + ic.getMessage("ERROR_NO_DELIVERY"), ic.getMessage("ERROR_END_OF_OPERATION"), + ic.getMessage("ERROR_MECHANICAL_ERROR"), ic.getMessage("ERROR_ELECTRONIC_ERROR"), + ic.getMessage("ERROR_POWER_INTERRUPT"), ic.getMessage("ERROR_CARTRIDGE_ERROR"), + ic.getMessage("ERROR_SET_NOT_PRIMED"), ic.getMessage("ERROR_DATA_INTERRUPTED"), + ic.getMessage("ERROR_LANGUAGE_ERROR"), ic.getMessage("ERROR_INSULIN_CHANGED"), }; private String[] errors_compdesc = { ic.getMessage("SELECT_SUBTYPE"), ic.getMessage("ERROR_CARTRIDGE_EMPTY"), - ic.getMessage("ERROR_BATTERY_DEPLETED"), ic.getMessage("ERROR_AUTOMATIC_OFF"), - ic.getMessage("ERROR_NO_DELIVERY"), ic.getMessage("ERROR_END_OF_OPERATION"), - ic.getMessage("ERROR_MECHANICAL_ERROR"), - ic.getMessage("ERROR_ELECTRONIC_ERROR"), - ic.getMessage("ERROR_POWER_INTERRUPT"), ic.getMessage("ERROR_CARTRIDGE_ERROR"), - ic.getMessage("ERROR_SET_NOT_PRIMED"), ic.getMessage("ERROR_DATA_INTERRUPTED"), - ic.getMessage("ERROR_LANGUAGE_ERROR"), ic.getMessage("ERROR_INSULIN_CHANGED"), }; + ic.getMessage("ERROR_BATTERY_DEPLETED"), ic.getMessage("ERROR_AUTOMATIC_OFF"), + ic.getMessage("ERROR_NO_DELIVERY"), ic.getMessage("ERROR_END_OF_OPERATION"), + ic.getMessage("ERROR_MECHANICAL_ERROR"), + ic.getMessage("ERROR_ELECTRONIC_ERROR"), + ic.getMessage("ERROR_POWER_INTERRUPT"), ic.getMessage("ERROR_CARTRIDGE_ERROR"), + ic.getMessage("ERROR_SET_NOT_PRIMED"), ic.getMessage("ERROR_DATA_INTERRUPTED"), + ic.getMessage("ERROR_LANGUAGE_ERROR"), + ic.getMessage("ERROR_INSULIN_CHANGED"), }; Hashtable<String, String> errors_mapping = new Hashtable<String, String>(); @@ -85,6 +86,7 @@ */ public static final int PUMP_CONFIG_GROUP_OTHER = 5; + // public static final int PUMP_CONFIG_GROUP_GENERAL = 1; // public static final int PUMP_CONFIG_GROUP_GENERAL = 1; // public static final int PUMP_CONFIG_GROUP_GENERAL = 1; @@ -110,6 +112,7 @@ this.errors_mapping.put(ic.getMessage("ERROR_INSULIN_CHANGED"), "14"); } + /** * Get Type from Description * @@ -129,6 +132,7 @@ } + /** * Get Descriptions (array) * @@ -139,6 +143,7 @@ return this.errors_compdesc; } + /** * Get Description by ID * Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpDeviceValueType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpDeviceValueType.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpDeviceValueType.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import ggc.plugin.data.DeviceValueTypeInterface; @@ -14,20 +14,24 @@ private String colorKey; + private PumpDeviceValueType() { } + private PumpDeviceValueType(String colorKey) { this.colorKey = colorKey; } + public String getColorKey() { return colorKey; } + public void setColorKey(String colorKey) { this.colorKey = colorKey; Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpErrors.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpErrors.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpErrors.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.Collection; import java.util.HashMap; @@ -8,7 +8,7 @@ import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -83,19 +83,19 @@ } String[] errors_desc_lcl = { ic.getMessage("SELECT_SUBTYPE"), // - ic.getMessage("ERROR_CARTRIDGE_EMPTY"), // - ic.getMessage("ERROR_BATTERY_DEPLETED"), // - ic.getMessage("ERROR_AUTOMATIC_OFF"), // - ic.getMessage("ERROR_NO_DELIVERY"), // - ic.getMessage("ERROR_END_OF_OPERATION"), // - ic.getMessage("ERROR_MECHANICAL_ERROR"), // - ic.getMessage("ERROR_ELECTRONIC_ERROR"), // - ic.getMessage("ERROR_POWER_INTERRUPT"), // - ic.getMessage("ERROR_CARTRIDGE_ERROR"), // - ic.getMessage("ERROR_SET_NOT_PRIMED"), // - ic.getMessage("ERROR_DATA_INTERRUPTED"), // - ic.getMessage("ERROR_LANGUAGE_ERROR"), // - ic.getMessage("ERROR_INSULIN_CHANGED"), }; + ic.getMessage("ERROR_CARTRIDGE_EMPTY"), // + ic.getMessage("ERROR_BATTERY_DEPLETED"), // + ic.getMessage("ERROR_AUTOMATIC_OFF"), // + ic.getMessage("ERROR_NO_DELIVERY"), // + ic.getMessage("ERROR_END_OF_OPERATION"), // + ic.getMessage("ERROR_MECHANICAL_ERROR"), // + ic.getMessage("ERROR_ELECTRONIC_ERROR"), // + ic.getMessage("ERROR_POWER_INTERRUPT"), // + ic.getMessage("ERROR_CARTRIDGE_ERROR"), // + ic.getMessage("ERROR_SET_NOT_PRIMED"), // + ic.getMessage("ERROR_DATA_INTERRUPTED"), // + ic.getMessage("ERROR_LANGUAGE_ERROR"), // + ic.getMessage("ERROR_INSULIN_CHANGED"), }; errors_desc = errors_desc_lcl; } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpEventType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpEventType.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpEventType.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.Collection; import java.util.HashMap; @@ -7,7 +7,7 @@ import com.atech.utils.ATDataAccessAbstract; import com.atech.utils.data.CodeEnumWithTranslation; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -92,7 +92,6 @@ static HashMap<String, CodeEnumWithTranslation> translationMapping = new HashMap<String, CodeEnumWithTranslation>(); static HashMap<Integer, PumpEventType> codeMapping = new HashMap<Integer, PumpEventType>(); - static { I18nControlAbstract ic = DataAccessPump.getInstance().getI18nControlInstance(); @@ -111,15 +110,16 @@ ic.getMessage("EVENT_SET_TEMPORARY_BASAL_RATE_TYPE"), ic.getMessage("EVENT_SET_BASAL_PATTERN"), ic.getMessage("EVENT_BASAL_RUN"), - ic.getMessage("EVENT_BASAL_STOP"), ic.getMessage("EVENT_POWER_DOWN"), ic.getMessage("EVENT_POWER_UP"), - ic.getMessage("EVENT_SELF_TEST"), ic.getMessage("EVENT_DOWNLOAD"), - ic.getMessage("EVENT_DATETIME_SET"), ic.getMessage("EVENT_DATETIME_CORRECT"), + ic.getMessage("EVENT_BASAL_STOP"), ic.getMessage("EVENT_POWER_DOWN"), + ic.getMessage("EVENT_POWER_UP"), ic.getMessage("EVENT_SELF_TEST"), + ic.getMessage("EVENT_DOWNLOAD"), ic.getMessage("EVENT_DATETIME_SET"), + ic.getMessage("EVENT_DATETIME_CORRECT"), - ic.getMessage("EVENT_SET_MAX_BASAL"), // + ic.getMessage("EVENT_SET_MAX_BASAL"), // ic.getMessage("EVENT_SET_MAX_BOLUS"), // ic.getMessage("EVENT_BATERRY_REMOVED"), // - ic.getMessage("EVENT_BATERRY_REPLACED"), // + ic.getMessage("EVENT_BATERRY_REPLACED"), // ic.getMessage("EVENT_BATERRY_LOW"), // ic.getMessage("EVENT_BATERRY_LOW_DESC"), // ic.getMessage("EVENT_BG_FROM_METER"), // Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpReport.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpReport.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/PumpReport.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,4 +1,4 @@ -package main.java.ggc.pump.data.defs; +package ggc.pump.data.defs; import java.util.HashMap; @@ -6,7 +6,7 @@ import com.atech.utils.ATDataAccess; import com.atech.utils.data.CodeEnumWithTranslation; -import main.java.ggc.pump.util.DataAccessPump; +import ggc.pump.util.DataAccessPump; /** * Application: GGC - GNU Gluco Control @@ -65,10 +65,10 @@ } String[] report_desc_lcl = { ic.getMessage("SELECT_SUBTYPE"), // - ic.getMessage("REPORT_MISC"), // - ic.getMessage("REPORT_BOLUS_TOTAL_DAY"), // - ic.getMessage("REPORT_BASAL_TOTAL_DAY"), // - ic.getMessage("REPORT_INSULIN_TOTAL_DAY"), }; + ic.getMessage("REPORT_MISC"), // + ic.getMessage("REPORT_BOLUS_TOTAL_DAY"), // + ic.getMessage("REPORT_BASAL_TOTAL_DAY"), // + ic.getMessage("REPORT_INSULIN_TOTAL_DAY"), }; report_desc = report_desc_lcl; } Modified: trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java =================================================================== --- trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java 2016-12-26 13:55:11 UTC (rev 1454) +++ trunk/ggc-plugins/ggc-pump/src/main/java/ggc/pump/data/defs/RatioType.java 2016-12-26 14:02:03 UTC (rev 1455) @@ -1,10 +1,10 @@ -package main.java.ggc.pump.data.defs; ... [truncated message content] |
From: <and...@us...> - 2016-12-26 13:55:14
|
Revision: 1454 http://sourceforge.net/p/ggc/code/1454 Author: andyrozman Date: 2016-12-26 13:55:11 +0000 (Mon, 26 Dec 2016) Log Message: ----------- - refactoring of AccuChek meters, changing everything to Meter Interface v2 Modified Paths: -------------- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/MeterDeviceInstanceWithHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/SerialMeterAbstract.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/UsbMeterAbstract.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/manager/MeterManager.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/test/MeterConsoleTester.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/util/DataAccessMeter.java Added Paths: ----------- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceDefinition.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/AccuChekMeterHandler.java trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/impl/ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/impl/AccuChekMeterReader.java Removed Paths: ------------- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/defs/MeterDeviceDefinition.java Deleted: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/defs/MeterDeviceDefinition.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/defs/MeterDeviceDefinition.java 2016-12-25 20:52:08 UTC (rev 1453) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/defs/MeterDeviceDefinition.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -1,247 +0,0 @@ -package ggc.meter.data.defs; - -import java.util.ArrayList; -import java.util.List; - -import ggc.meter.device.MeterDisplayInterfaceType; -import ggc.plugin.data.enums.DeviceCompanyDefinition; -import ggc.plugin.data.enums.DeviceHandlerType; -import ggc.plugin.data.enums.DevicePortParameterType; -import ggc.plugin.data.enums.DeviceProgressStatus; -import ggc.plugin.device.v2.DeviceDefinition; -import ggc.plugin.manager.DeviceImplementationStatus; -import ggc.plugin.protocol.DeviceConnectionProtocol; - -/** - * Created by andy on 06.02.15. - */ -public enum MeterDeviceDefinition implements DeviceDefinition -{ - - AscensiaContourUsb(10007, "Contour USB", "ascensia_contour_usb.jpg", // - "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, DeviceImplementationStatus.Done, // - DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, // - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, // - DeviceProgressStatus.Special, "", 2000, // - MeterDisplayInterfaceType.Simple), - - AscensiaContourNext(10008, "Contour Next", "ascensia_contour_next.jpg", "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, - DeviceImplementationStatus.Done, DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", - 800, MeterDisplayInterfaceType.Simple), - - AscensiaContourNextUsb(10009, "Contour Next USB", "ascensia_contour_nextusb.jpg", - "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, DeviceImplementationStatus.Done, - DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", - 2000, MeterDisplayInterfaceType.Simple), - - AscensiaContourNextLink(10010, "Contour Next Link", "ascensia_contour_nextlink.jpg", // - "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, DeviceImplementationStatus.InProgress, // - DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, - DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", - 2000, MeterDisplayInterfaceType.Simple), - - // FIXME - just for testing - // MenariniGlucoMenReady(100011, "Menarini", null, // - // "instructions", null, DeviceImplementationStatus.Planned, - // DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, - // // - // DevicePortParameterType.SimpleParameter, - // DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", - // 200, MeterDisplayInterfaceType.Simple), // - - ; - - // Contour Next EZ, Contour Next Link 2.4, Didget, Contour XT ? - - static List<DeviceDefinition> allDevices; - static List<DeviceDefinition> supportedDevices; - - - static - { - allDevices = new ArrayList<DeviceDefinition>(); - supportedDevices = new ArrayList<DeviceDefinition>(); - - for (MeterDeviceDefinition mdd : values()) - { - allDevices.add(mdd); - - if (mdd.isSupportedDevice()) - { - supportedDevices.add(mdd); - } - } - - System.out.println( - "Meter Devices V2 (registered: " + allDevices.size() + ", supported: " + supportedDevices.size() + ")"); - } - - // we need to extend this to all values currently in DeviceImplementation - int deviceId; - String deviceName; - String iconName; - String instructions; - Object internalDefintion; - DeviceImplementationStatus implementationStatus; - DeviceCompanyDefinition companyDefinition; - DeviceHandlerType deviceHandlerType; - DevicePortParameterType devicePortParameterType; - DeviceConnectionProtocol deviceConnectionProtocol; - DeviceProgressStatus deviceProgressStatus; - String specialComment; - int maxRecords; - MeterDisplayInterfaceType displayInterfaceType; - - - private MeterDeviceDefinition(int id, String name, String iconName, String instructions, Object internalDefinition, - DeviceImplementationStatus implementationStatus, DeviceCompanyDefinition companyDefinition, - DeviceHandlerType deviceHandlerType, DevicePortParameterType portParameterType, - DeviceConnectionProtocol connectionProtocol, DeviceProgressStatus progressStatus, String specialComment, - int maxRecords, MeterDisplayInterfaceType displayInterfaceType) - { - this.deviceId = id; - this.deviceName = name; - this.iconName = iconName; - this.instructions = instructions; - this.internalDefintion = internalDefinition; - this.implementationStatus = implementationStatus; - this.companyDefinition = companyDefinition; - this.deviceHandlerType = deviceHandlerType; - this.devicePortParameterType = portParameterType; - this.deviceConnectionProtocol = connectionProtocol; - this.deviceProgressStatus = progressStatus; - this.specialComment = specialComment; - this.maxRecords = maxRecords; - this.displayInterfaceType = displayInterfaceType; - } - - - public int getDeviceId() - { - return deviceId; - } - - - public String getDeviceName() - { - return this.deviceName; - } - - - public String getIconName() - { - return this.iconName; - } - - - public String getInstructionsI18nKey() - { - return this.instructions; - } - - - public DeviceImplementationStatus getDeviceImplementationStatus() - { - return this.implementationStatus; - } - - - public Object getInternalDefintion() - { - return this.internalDefintion; - } - - - public DeviceCompanyDefinition getDeviceCompany() - { - return this.companyDefinition; - } - - - public DeviceHandlerType getDeviceHandler() - { - return this.deviceHandlerType; - } - - - public List<DeviceDefinition> getSupportedDevices() - { - return supportedDevices; - } - - - public static List<DeviceDefinition> getAllDevices() - { - return allDevices; - } - - - public boolean isSupportedDevice() - { - return isSupportedDevice(this); - } - - - public static boolean isSupportedDevice(MeterDeviceDefinition meterDeviceDefinition) - { - return DeviceImplementationStatus.isSupportedDevice(meterDeviceDefinition.getDeviceImplementationStatus()); - } - - - /** - * Get Device handler key - * @return - */ - public DeviceHandlerType getDeviceHandlerKey() - { - return this.deviceHandlerType; - } - - - /** - * Device Port Parameter Type - * @return - */ - public DevicePortParameterType getDevicePortParameterType() - { - return this.devicePortParameterType; - } - - - /** - * Get Connection Protocol - * - * @return - */ - public DeviceConnectionProtocol getConnectionProtocol() - { - return this.deviceConnectionProtocol; - } - - - /** - * Get Device Progress Status. It determines how device progress is determined. In most casess we use Special - * progress which is then implemented by Handler. - * - * @return - */ - public DeviceProgressStatus getDeviceProgressStatus() - { - return this.deviceProgressStatus; - } - - - public String getSpecialComment() - { - return this.specialComment; - } - - - public MeterDisplayInterfaceType getMeterDisplayInterfaceType() - { - return this.displayInterfaceType; - } - -} Copied: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceDefinition.java (from rev 1452, trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/data/defs/MeterDeviceDefinition.java) =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceDefinition.java (rev 0) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceDefinition.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -0,0 +1,347 @@ +package ggc.meter.defs.device; + +import java.util.ArrayList; +import java.util.List; + +import ggc.meter.device.MeterDisplayInterfaceType; +import ggc.plugin.data.enums.DeviceCompanyDefinition; +import ggc.plugin.data.enums.DeviceHandlerType; +import ggc.plugin.data.enums.DevicePortParameterType; +import ggc.plugin.data.enums.DeviceProgressStatus; +import ggc.plugin.device.v2.DeviceDefinition; +import ggc.plugin.manager.DeviceImplementationStatus; +import ggc.plugin.protocol.DeviceConnectionProtocol; + +/** + * Created by andy on 06.02.15. + */ +public enum MeterDeviceDefinition implements DeviceDefinition +{ + // Ascensia + AscensiaContourUsb(10007, "Contour USB", "ascensia_contour_usb.jpg", // + "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, // + DeviceProgressStatus.Special, "", 2000, // + MeterDisplayInterfaceType.Simple), + + AscensiaContourNext(10008, "Contour Next", "ascensia_contour_next.jpg", "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, + DeviceImplementationStatus.Done, DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", + 800, MeterDisplayInterfaceType.Simple), + + AscensiaContourNextUsb(10009, "Contour Next USB", "ascensia_contour_nextusb.jpg", + "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, DeviceImplementationStatus.Done, + DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", + 2000, MeterDisplayInterfaceType.Simple), + + AscensiaContourNextLink(10010, "Contour Next Link", "ascensia_contour_nextlink.jpg", // + "INSTRUCTIONS_ASCENSIA_CONTOUR_USB", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Ascensia, DeviceHandlerType.AscensiaUsbHandler, + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", + 2000, MeterDisplayInterfaceType.Simple), + + // AccuChek + + // FIXME + AccuChekSmartPixGeneric(20001, "SmartPix", "ac_active.jpg", // + "INSTRUCTIONS_ACCUCHEK_ACTIVE", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 1, MeterDisplayInterfaceType.Simple), // + + AccuChekActive(20002, "Active", "ac_active.jpg", // + "INSTRUCTIONS_ACCUCHEK_ACTIVE", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 480, MeterDisplayInterfaceType.Simple), // + + AccuChekAdvantage(20003, "Advantage", "ac_advantage.jpg", // + "INSTRUCTIONS_ACCUCHEK_ADVANTAGE", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 480, MeterDisplayInterfaceType.Simple), // + + AccuChekAviva(20004, "Aviva", "ac_aviva.jpg", // + "INSTRUCTIONS_ACCUCHEK_AVIVA", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 500, MeterDisplayInterfaceType.Simple), // + + AccuChekComfort(20005, "Comfort", "ac_comfort.jpg", // + "INSTRUCTIONS_ACCUCHEK_COMFORT", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 100, MeterDisplayInterfaceType.Simple), // + + AccuChekCompact(20006, "Compact", "ac_compact.jpg", // + "INSTRUCTIONS_ACCUCHEK_COMPACT", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 100, MeterDisplayInterfaceType.Simple), // + + AccuChekCompactPlus(20007, "CompactPlus", "ac_compact_plus.jpg", // + "INSTRUCTIONS_ACCUCHEK_COMPACTPLUS", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 300, MeterDisplayInterfaceType.Simple), // + + AccuChekGo(20008, "Go", "ac_go.jpg", // + "INSTRUCTIONS_ACCUCHEK_GO", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 480, MeterDisplayInterfaceType.Simple), // + + AccuChekIntegra(20009, "Integra", "ac_integra.jpg", // + "INSTRUCTIONS_ACCUCHEK_INTEGRA", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 100, MeterDisplayInterfaceType.Simple), // + + AccuChekPerforma(20010, "Performa", "ac_performa.jpg", // + "INSTRUCTIONS_ACCUCHEK_PERFORMA", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 500, MeterDisplayInterfaceType.Simple), // + + AccuChekSensor(20011, "Sensor", "ac_sensor.jpg", // + "INSTRUCTIONS_ACCUCHEK_SENSOR", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 480, MeterDisplayInterfaceType.Simple), // + + AccuChekNano(20012, "Aviva Nano", "ac_nano.jpg", // + "INSTRUCTIONS_ACCUCHEK_NANO", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 500, MeterDisplayInterfaceType.Simple), // + + AccuChekAvivaCombo(20013, "Aviva Combo", "ac_combo.jpg", // + "INSTRUCTIONS_ACCUCHEK_AVIVA_COMBO", null, DeviceImplementationStatus.Done, // + DeviceCompanyDefinition.Roche, DeviceHandlerType.AccuChekMeterHandler, // + DevicePortParameterType.SimpleParameter, DeviceConnectionProtocol.MassStorageXML, // + DeviceProgressStatus.Normal, "", 500, MeterDisplayInterfaceType.Extended), // + + // FIXME - just for testing + // MenariniGlucoMenReady(100011, "Menarini", null, // + // "instructions", null, DeviceImplementationStatus.Planned, + // DeviceCompanyDefinition.Menarini, DeviceHandlerType.MenariniMeterHandler, + // // + // DevicePortParameterType.SimpleParameter, + // DeviceConnectionProtocol.USB_Hid, DeviceProgressStatus.Special, "", + // 200, MeterDisplayInterfaceType.Simple), // + + ; + + // AccuChekActive.java + // AccuChekAdvantage.java + // AccuChekAvivaCombo.java + // AccuChekAviva.java + // AccuChekComfort.java + // AccuChekCompact.java + // AccuChekCompactPlus.java + // AccuChekGo.java + // AccuChekIntegra.java + // AccuChekMeterHandler.java + // AccuChekNano.java + // AccuChekPerforma.java + // AccuChekSensor.java + + // Contour Next EZ, Contour Next Link 2.4, Didget, Contour XT ? + + static List<DeviceDefinition> allDevices; + static List<DeviceDefinition> supportedDevices; + + static + { + allDevices = new ArrayList<DeviceDefinition>(); + supportedDevices = new ArrayList<DeviceDefinition>(); + + for (MeterDeviceDefinition mdd : values()) + { + allDevices.add(mdd); + + if (mdd.isSupportedDevice()) + { + supportedDevices.add(mdd); + } + } + + System.out.println( + "Meter Devices V2 (registered: " + allDevices.size() + ", supported: " + supportedDevices.size() + ")"); + } + + // we need to extend this to all values currently in DeviceImplementation + int deviceId; + String deviceName; + String iconName; + String instructions; + Object internalDefintion; + DeviceImplementationStatus implementationStatus; + DeviceCompanyDefinition companyDefinition; + DeviceHandlerType deviceHandlerType; + DevicePortParameterType devicePortParameterType; + DeviceConnectionProtocol deviceConnectionProtocol; + DeviceProgressStatus deviceProgressStatus; + String specialComment; + int maxRecords; + MeterDisplayInterfaceType displayInterfaceType; + + + private MeterDeviceDefinition(int id, String name, String iconName, String instructions, Object internalDefinition, + DeviceImplementationStatus implementationStatus, DeviceCompanyDefinition companyDefinition, + DeviceHandlerType deviceHandlerType, DevicePortParameterType portParameterType, + DeviceConnectionProtocol connectionProtocol, DeviceProgressStatus progressStatus, String specialComment, + int maxRecords, MeterDisplayInterfaceType displayInterfaceType) + { + this.deviceId = id; + this.deviceName = name; + this.iconName = iconName; + this.instructions = instructions; + this.internalDefintion = internalDefinition; + this.implementationStatus = implementationStatus; + this.companyDefinition = companyDefinition; + this.deviceHandlerType = deviceHandlerType; + this.devicePortParameterType = portParameterType; + this.deviceConnectionProtocol = connectionProtocol; + this.deviceProgressStatus = progressStatus; + this.specialComment = specialComment; + this.maxRecords = maxRecords; + this.displayInterfaceType = displayInterfaceType; + } + + + public int getDeviceId() + { + return deviceId; + } + + + public String getDeviceName() + { + return this.deviceName; + } + + + public String getIconName() + { + return this.iconName; + } + + + public String getInstructionsI18nKey() + { + return this.instructions; + } + + + public DeviceImplementationStatus getDeviceImplementationStatus() + { + return this.implementationStatus; + } + + + public Object getInternalDefintion() + { + return this.internalDefintion; + } + + + public DeviceCompanyDefinition getDeviceCompany() + { + return this.companyDefinition; + } + + + public DeviceHandlerType getDeviceHandler() + { + return this.deviceHandlerType; + } + + + public List<DeviceDefinition> getSupportedDevices() + { + return supportedDevices; + } + + + public static List<DeviceDefinition> getAllDevices() + { + return allDevices; + } + + + public boolean isSupportedDevice() + { + return isSupportedDevice(this); + } + + + public static boolean isSupportedDevice(MeterDeviceDefinition meterDeviceDefinition) + { + return DeviceImplementationStatus.isSupportedDevice(meterDeviceDefinition.getDeviceImplementationStatus()); + } + + + /** + * Get Device handler key + * @return + */ + public DeviceHandlerType getDeviceHandlerKey() + { + return this.deviceHandlerType; + } + + + /** + * Device Port Parameter Type + * @return + */ + public DevicePortParameterType getDevicePortParameterType() + { + return this.devicePortParameterType; + } + + + /** + * Get Connection Protocol + * + * @return + */ + public DeviceConnectionProtocol getConnectionProtocol() + { + return this.deviceConnectionProtocol; + } + + + /** + * Get Device Progress Status. It determines how device progress is determined. In most casess we use Special + * progress which is then implemented by Handler. + * + * @return + */ + public DeviceProgressStatus getDeviceProgressStatus() + { + return this.deviceProgressStatus; + } + + + public String getSpecialComment() + { + return this.specialComment; + } + + + public MeterDisplayInterfaceType getMeterDisplayInterfaceType() + { + return this.displayInterfaceType; + } + + + public int getMaxRecords() + { + return this.maxRecords; + } + +} Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceHandler.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceHandler.java 2016-12-25 20:52:08 UTC (rev 1453) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/defs/device/MeterDeviceHandler.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -1,6 +1,5 @@ package ggc.meter.defs.device; -import ggc.meter.data.defs.MeterDeviceDefinition; import ggc.meter.util.DataAccessMeter; import ggc.plugin.device.v2.DeviceDefinition; import ggc.plugin.device.v2.DeviceHandlerAbstract; @@ -28,4 +27,14 @@ return (MeterDeviceDefinition) definition; } + + /** + * Check if DataAccess Set, if not set it. + */ + protected void checkIfDataAccessSet() + { + if (dataAccessMeter == null) + dataAccessMeter = DataAccessMeter.getInstance(); + } + } Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/MeterDeviceInstanceWithHandler.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/MeterDeviceInstanceWithHandler.java 2016-12-25 20:52:08 UTC (rev 1453) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/MeterDeviceInstanceWithHandler.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -1,6 +1,6 @@ package ggc.meter.device; -import ggc.meter.data.defs.MeterDeviceDefinition; +import ggc.meter.defs.device.MeterDeviceDefinition; import ggc.meter.util.DataAccessMeter; import ggc.plugin.device.DeviceIdentification; import ggc.plugin.device.v2.DeviceDefinition; Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/SerialMeterAbstract.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/SerialMeterAbstract.java 2016-12-25 20:52:08 UTC (rev 1453) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/SerialMeterAbstract.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -11,7 +11,7 @@ import ggc.core.data.defs.GlucoseUnitType; import ggc.meter.data.MeterValuesEntry; -import ggc.meter.data.defs.MeterDeviceDefinition; +import ggc.meter.defs.device.MeterDeviceDefinition; import ggc.meter.util.DataAccessMeter; import ggc.plugin.comm.NRSerialCommunicationHandler; import ggc.plugin.comm.cfg.SerialSettings; Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/UsbMeterAbstract.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/UsbMeterAbstract.java 2016-12-25 20:52:08 UTC (rev 1453) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/UsbMeterAbstract.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -13,7 +13,7 @@ import ggc.core.data.defs.GlucoseUnitType; import ggc.meter.data.MeterValuesEntry; -import ggc.meter.data.defs.MeterDeviceDefinition; +import ggc.meter.defs.device.MeterDeviceDefinition; import ggc.meter.util.DataAccessMeter; import ggc.plugin.comm.NRSerialCommunicationHandler; import ggc.plugin.comm.cfg.SerialSettings; Added: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/AccuChekMeterHandler.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/AccuChekMeterHandler.java (rev 0) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/AccuChekMeterHandler.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -0,0 +1,109 @@ +package ggc.meter.device.accuchek; + +import java.util.ArrayList; +import java.util.List; + +import ggc.meter.defs.device.MeterDeviceDefinition; +import ggc.meter.defs.device.MeterDeviceHandler; +import ggc.meter.device.accuchek.impl.AccuChekMeterReader; +import ggc.meter.util.DataAccessMeter; +import ggc.plugin.data.GGCPlugInFileReaderContext; +import ggc.plugin.data.enums.DeviceHandlerType; +import ggc.plugin.device.DownloadSupportType; +import ggc.plugin.device.PlugInBaseException; +import ggc.plugin.device.impl.accuchek.AccuChekSmartPixSpecialConfig; +import ggc.plugin.device.impl.accuchek.FRC_AccuChekSmartPixXml; +import ggc.plugin.device.v2.DeviceDefinition; +import ggc.plugin.device.v2.DeviceInstanceWithHandler; +import ggc.plugin.gui.DeviceSpecialConfigPanelAbstract; +import ggc.plugin.output.OutputWriter; + +public class AccuChekMeterHandler extends MeterDeviceHandler +{ + + private static AccuChekSmartPixSpecialConfig specialConfigPanel; + + + public AccuChekMeterHandler() + { + super(); + } + + + /** + * {@inheritDoc} + */ + public DeviceHandlerType getDeviceHandlerKey() + { + return DeviceHandlerType.AccuChekMeterHandler; + } + + + /** + * {@inheritDoc} + */ + public void readDeviceData(DeviceDefinition definition, Object connectionParameters, OutputWriter outputWriter) + throws PlugInBaseException + { + AccuChekMeterReader reader = new AccuChekMeterReader((MeterDeviceDefinition) definition, + (String) connectionParameters, outputWriter, DataAccessMeter.getInstance()); + reader.readDeviceDataFull(); + } + + + /** + * {@inheritDoc} + */ + public void readConfiguration(DeviceDefinition definition, Object connectionParameters, OutputWriter outputWriter) + throws PlugInBaseException + { + } + + + /** + * {@inheritDoc} + */ + public List<GGCPlugInFileReaderContext> getFileDownloadContexts(DownloadSupportType downloadSupportType) + { + checkIfDataAccessSet(); + + List<GGCPlugInFileReaderContext> fileContexts = new ArrayList<GGCPlugInFileReaderContext>(); + fileContexts.add(new FRC_AccuChekSmartPixXml(dataAccessMeter, getReader())); + + return fileContexts; + } + + + private AccuChekMeterReader getReader() + { + String connectionString = dataAccessMeter.getSelectedDeviceConfigEntry().communication_port_raw; + + DeviceDefinition selectedDeviceDefinition = dataAccessMeter.getSelectedDeviceDefinition(); + return new AccuChekMeterReader((MeterDeviceDefinition) selectedDeviceDefinition, connectionString, + dataAccessMeter); + } + + + /** + * {@inheritDoc} + */ + @Override + public void registerSpecialConfig() + { + this.specialConfigKey = "AccuChekSmartPix"; + } + + + @Override + public DeviceSpecialConfigPanelAbstract getSpecialConfigPanel(DeviceInstanceWithHandler deviceInstanceWithHandler) + { + if (specialConfigPanel == null) + { + specialConfigPanel = new AccuChekSmartPixSpecialConfig(dataAccessMeter.getInstance(), + deviceInstanceWithHandler); + } + + return specialConfigPanel; + } + +} Added: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/impl/AccuChekMeterReader.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/impl/AccuChekMeterReader.java (rev 0) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/device/accuchek/impl/AccuChekMeterReader.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -0,0 +1,132 @@ +package ggc.meter.device.accuchek.impl; + +import ggc.meter.defs.device.MeterDeviceDefinition; +import ggc.meter.device.accuchek.AccuChekSmartPixMeter; +import ggc.plugin.output.OutputWriter; +import ggc.plugin.util.DataAccessPlugInBase; + +/** + * Created by andy on 20.10.15. + */ +public class AccuChekMeterReader extends AccuChekSmartPixMeter +{ + + MeterDeviceDefinition deviceType; + + + public AccuChekMeterReader(MeterDeviceDefinition deviceType, DataAccessPlugInBase da) + { + this(deviceType, null, null, da); + } + + + // this one is only for file download + public AccuChekMeterReader(MeterDeviceDefinition deviceType, String connectionParameter, DataAccessPlugInBase da) + { + this(deviceType, connectionParameter, null, da); + } + + + public AccuChekMeterReader(MeterDeviceDefinition deviceType, String connectionParameter, OutputWriter writer, + DataAccessPlugInBase da) + { + super(connectionParameter, writer, da); + this.deviceType = deviceType; + } + + + public String getName() + { + return this.deviceType.getDeviceName(); + } + + + public String getIconName() + { + return this.deviceType.getIconName(); + } + + + public int getDeviceId() + { + return this.deviceType.getDeviceId(); + } + + + public String getInstructions() + { + return this.deviceType.getInstructionsI18nKey(); + } + + + public String getComment() + { + return null; + } + + + public String getDeviceClassName() + { + return this.getClass().getName(); + } + + + /** + * getMaxMemoryRecords - Get Maximum entries that can be stored in devices memory + * + * @return number + */ + @Override + public int getMaxMemoryRecords() + { + return this.deviceType.getMaxRecords(); + } + + + /** + * getNrOfElementsFor1s - How many elements are read in 1s (which is our refresh time) + * @return number of elements + */ + @Override + public int getNrOfElementsFor1s() + { + switch (deviceType) + { + case AccuChekNano: + return 20; + + case AccuChekAvivaCombo: + case AccuChekAviva: + return 12; + + case AccuChekActive: + case AccuChekAdvantage: + case AccuChekComfort: + case AccuChekCompact: + case AccuChekCompactPlus: + case AccuChekGo: + case AccuChekIntegra: + case AccuChekPerforma: + case AccuChekSensor: + return 10; + + default: + return 0; + + } + } + + // public int getInterfaceTypeForMeter() + // { + // switch (deviceType) + // { + // case AccuChekAvivaCombo: + // return MeterInterface.METER_INTERFACE_EXTENDED; + // + // default: + // return MeterInterface.METER_INTERFACE_SIMPLE; + // + // } + // } + +} Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/manager/MeterManager.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/manager/MeterManager.java 2016-12-25 20:52:08 UTC (rev 1453) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/manager/MeterManager.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -1,6 +1,6 @@ package ggc.meter.manager; -import ggc.meter.data.defs.MeterDeviceDefinition; +import ggc.meter.defs.device.MeterDeviceDefinition; import ggc.meter.device.MeterDeviceInstanceWithHandler; import ggc.meter.manager.company.*; import ggc.plugin.device.v2.DeviceDefinition; @@ -96,7 +96,7 @@ public void loadDeviceCompanies() { addDeviceCompany(new AscensiaBayer()); - addDeviceCompany(new Roche()); + // addDeviceCompany(new Roche()); addDeviceCompany(new LifeScan()); addDeviceCompany(new Abbott()); addDeviceCompany(new Menarini()); @@ -109,17 +109,4 @@ addDeviceCompany(new Wavesense()); } - // /** - // * Load Supported Devices - // */ - // @Override - // public void loadSupportedDevices() - // { - // this.supported_devices.addAll(new AscensiaBayer().getDevices()); - // this.supported_devices.addAll(new Roche().getDevices()); - // this.supported_devices.addAll(new LifeScan().getDevices()); - // this.supported_devices.addAll(new Abbott().getDevices()); - // this.supported_devices.addAll(new Menarini().getDevices()); - // } - } Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/test/MeterConsoleTester.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/test/MeterConsoleTester.java 2016-12-25 20:52:08 UTC (rev 1453) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/test/MeterConsoleTester.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -11,8 +11,8 @@ import ggc.core.db.GGCDb; import ggc.core.util.DataAccess; -import ggc.meter.data.defs.MeterDeviceDefinition; import ggc.meter.defs.MeterPluginDefinition; +import ggc.meter.defs.device.MeterDeviceDefinition; import ggc.meter.device.abbott.OptiumXceed; import ggc.meter.device.accuchek.AccuChekAvivaCombo; import ggc.meter.device.ascensia.AscensiaContour; Modified: trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/util/DataAccessMeter.java =================================================================== --- trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/util/DataAccessMeter.java 2016-12-25 20:52:08 UTC (rev 1453) +++ trunk/ggc-plugins/ggc-meter/src/main/java/ggc/meter/util/DataAccessMeter.java 2016-12-26 13:55:11 UTC (rev 1454) @@ -151,142 +151,6 @@ } // ******************************************************** - // ****** About Methods ***** - // ******************************************************** - - // /** - // * Create About Context for plugin - // */ - // @Override - // public void createPlugInAboutContext() - // { - // I18nControlAbstract i18nControl = getI18nControlInstance(); - // - // // about_title = i18nControlAbstract.getMessage("METER_PLUGIN_ABOUT"); - // about_image_name = "/icons/about_meter.jpg"; - // // about_image_name = "/icons/about_logo.gif"; - // about_plugin_copyright_from = 2006; - // // about_plugin_name = i18nControlAbstract.getMessage("METER_PLUGIN"); - // - // ArrayList<LibraryInfoEntry> lst_libs = new ArrayList<LibraryInfoEntry>(); - // - // lst_libs.addAll(getBaseLibraries()); - // - // lst_libs.add( - // new LibraryInfoEntry("XML Pull Parser", "3.1.1.4c", - // "http://www.extreme.indiana.edu/xgws/xsoap/xpp/", - // "Indiana University Extreme! Lab Software License", "Xml parser for - // processing xml document", - // "Copyright (c) 2002 Extreme! Lab, Indiana University. All rights - // reserved.")); - // plugin_libraries = lst_libs; - // - // ArrayList<CreditsGroup> lst_credits = new ArrayList<CreditsGroup>(); - // CreditsGroup cg = new - // CreditsGroup(i18nControl.getMessage("DEVELOPERS_DESC")); - // cg.addCreditsEntry(new CreditsEntry("Aleksander Rozman (Andy)", - // "an...@at...", - // "Full framework and support for Ascensia, Roche, LifeScan devices")); - // cg.addCreditsEntry(new CreditsEntry("Alexander Balaban", - // "aba...@ya...", "Support for OT UltraSmart")); - // cg.addCreditsEntry(new CreditsEntry("Ophir Setter", - // "oph...@gm...", "Support for Freestyle Meters")); - // lst_credits.add(cg); - // cg = new CreditsGroup(i18nControl.getMessage("HELPERS_DESC")); - // cg.addCreditsEntry(new CreditsEntry("Rafael Ziherl (RAF)", "", "Supplied - // hardware for Roche development")); - // lst_credits.add(cg); - // - // plugin_developers = lst_credits; - // - // // features - // ArrayList<FeaturesGroup> lst_features = new ArrayList<FeaturesGroup>(); - // - // FeaturesGroup fg = new - // FeaturesGroup(i18nControl.getMessage("IMPLEMENTED_FEATURES")); - // fg.addFeaturesEntry(new FeaturesEntry("Base Meter Tools Framework")); - // fg.addFeaturesEntry(new FeaturesEntry("Various output types")); - // fg.addFeaturesEntry(new FeaturesEntry("Communication Framework")); - // fg.addFeaturesEntry(new FeaturesEntry("Graphical Interface (GGC - // integration)")); - // fg.addFeaturesEntry(new FeaturesEntry("About dialog")); - // fg.addFeaturesEntry(new FeaturesEntry("List of meters")); - // fg.addFeaturesEntry(new FeaturesEntry("Configuration")); - // - // lst_features.add(fg); - // - // fg = new FeaturesGroup(i18nControl.getMessage("SUPPORTED_DEVICES")); - // fg.addFeaturesEntry(new FeaturesEntry("Ascensia/Bayer (except Contour USB - // and Didget)")); - // fg.addFeaturesEntry(new FeaturesEntry("Accu-Chek/Roche: All supported by - // SmartPix 3.x")); - // fg.addFeaturesEntry(new FeaturesEntry("LifeScan: Ultra, Profile, Easy, - // UltraSmart")); - // fg.addFeaturesEntry(new FeaturesEntry("Abbott: Optium Xceeed, - // PrecisionXtra, Frestyle")); - // // FIXME - // lst_features.add(fg); - // - // // lst_features.add(fg); - // - // fg = new FeaturesGroup(i18nControl.getMessage("PLANNED_DEVICES")); - // fg.addFeaturesEntry(new FeaturesEntry("LifeScan: Ultra2 (in 2015)")); - // fg.addFeaturesEntry(new FeaturesEntry("Ascensia/Bayer: Usb devices")); - // - // lst_features.add(fg); - // - // this.plugin_features = lst_features; - // - // } - - // ******************************************************** - // ****** Web Lister Methods ***** - // ******************************************************** - - // /** - // * Create WebLister (for List) Context for plugin - // */ - // @Override - // public void createWebListerContext() - // { - // - // this.loadWebLister(); - // - // // I18nControlAbstract i18nControlAbstract = getI18nControlInstance(); - // - // weblister_items = new ArrayList<BaseListEntry>(); - // weblister_items.add(new BaseListEntry("Abbott Diabetes Care", - // "/meters/abbott.html", 4)); - // weblister_items.add(new BaseListEntry("Arkray USA (formerly Hypoguard)", - // "/meters/arkray.html", 5)); - // weblister_items.add(new BaseListEntry("Bayer Diagnostics", - // "/meters/bayer.html", 1)); - // weblister_items.add(new BaseListEntry("Diabetic Supply of Suncoast", - // "/meters/dsos.html", 5)); - // weblister_items.add(new BaseListEntry("Diagnostic Devices", - // "/meters/prodigy.html", 5)); - // weblister_items.add(new BaseListEntry("HealthPia America", - // "/meters/healthpia.html", 5)); - // weblister_items.add(new BaseListEntry("Home Diagnostics", - // "/meters/home_diagnostics.html", 5)); - // weblister_items.add(new BaseListEntry("Lifescan", - // "/meters/lifescan.html", 4)); - // weblister_items.add(new BaseListEntry("Nova Biomedical", - // "/meters/nova_biomedical.html", 5)); - // weblister_items.add(new BaseListEntry("Roche Diagnostics", - // "/meters/roche.html", 2)); - // weblister_items.add(new BaseListEntry("Sanvita", "/meters/sanvita.html", - // 5)); - // weblister_items.add(new BaseListEntry("U.S. Diagnostics", - // "/meters/us_diagnostics.html", 5)); - // weblister_items.add(new BaseListEntry("WaveSense", - // "/meters/wavesense.html", 5)); - // - // // weblister_title = i18nControlAbstract.getMessage("METERS_LIST_WEB"); - // weblister_desc = i18n_plugin.getMessage("METERS_LIST_WEB_DESC"); - // } - - // ******************************************************** // ****** Version ***** // ******************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |