From: <and...@us...> - 2009-06-20 15:41:13
|
Revision: 809 http://ggc.svn.sourceforge.net/ggc/?rev=809&view=rev Author: andyrozman Date: 2009-06-20 15:39:47 +0000 (Sat, 20 Jun 2009) Log Message: ----------- Modified Paths: -------------- trunk/ggc-plugin_base/build/GGCPlugInBaseVersion.properties trunk/ggc-plugin_base/docs/Changelog trunk/ggc-plugin_base/src/ggc/plugin/data/DeviceDataHandler.java trunk/ggc-plugin_base/src/ggc/plugin/gui/DeviceDisplayDataDialog.java trunk/ggc-plugin_base/src/ggc/plugin/gui/DeviceReaderRunner.java trunk/ggc-plugin_base/src/ggc/plugin/gui/OldDataReaderAbstract.java trunk/ggc-plugin_base/src/ggc/plugin/util/DataAccessPlugInBase.java Modified: trunk/ggc-plugin_base/build/GGCPlugInBaseVersion.properties =================================================================== --- trunk/ggc-plugin_base/build/GGCPlugInBaseVersion.properties 2009-06-19 15:52:54 UTC (rev 808) +++ trunk/ggc-plugin_base/build/GGCPlugInBaseVersion.properties 2009-06-20 15:39:47 UTC (rev 809) @@ -6,5 +6,5 @@ # # GGC PlugIn Base Version # -ggc-plugin-base.version=0.3.3 +ggc-plugin-base.version=0.4.0 Modified: trunk/ggc-plugin_base/docs/Changelog =================================================================== --- trunk/ggc-plugin_base/docs/Changelog 2009-06-19 15:52:54 UTC (rev 808) +++ trunk/ggc-plugin_base/docs/Changelog 2009-06-20 15:39:47 UTC (rev 809) @@ -2,6 +2,13 @@ Changes file for GGC Plug-In Base ================================== +0.4.0 + * Changed reading of old data in reading classes + * Framework changed, each plugin can (must) have it's own instance of Db, with which it handles all db + data + +0.3.3 + 0.3.2 * Added DeviceValuesRange class, which is used for getting data from device for same range (for printing purposes for now, later probably for graphs too). Modified: trunk/ggc-plugin_base/src/ggc/plugin/data/DeviceDataHandler.java =================================================================== --- trunk/ggc-plugin_base/src/ggc/plugin/data/DeviceDataHandler.java 2009-06-19 15:52:54 UTC (rev 808) +++ trunk/ggc-plugin_base/src/ggc/plugin/data/DeviceDataHandler.java 2009-06-20 15:39:47 UTC (rev 809) @@ -187,7 +187,8 @@ */ public boolean isOldDataReadingFinished() { - return this.m_reader.isFinished(); + //return this.m_reader.isFinished(); + return true; } Modified: trunk/ggc-plugin_base/src/ggc/plugin/gui/DeviceDisplayDataDialog.java =================================================================== --- trunk/ggc-plugin_base/src/ggc/plugin/gui/DeviceDisplayDataDialog.java 2009-06-19 15:52:54 UTC (rev 808) +++ trunk/ggc-plugin_base/src/ggc/plugin/gui/DeviceDisplayDataDialog.java 2009-06-20 15:39:47 UTC (rev 809) @@ -255,7 +255,7 @@ Font normal = m_da.getFont(DataAccessPlugInBase.FONT_NORMAL); Font normal_b = m_da.getFont(DataAccessPlugInBase.FONT_NORMAL_BOLD); - setBounds(0, 0, 480, 680); + setBounds(0, 0, 480, 660); m_da.centerJDialog(this); setDefaultCloseOperation(DISPOSE_ON_CLOSE); @@ -301,7 +301,7 @@ // reading old data label = new JLabel(m_ic.getMessage("READING_OLD_DATA") + ":"); - label.setBounds(30, 420, 100, 25); // 420 + label.setBounds(30, 425, 250, 25); // 420 label.setFont(normal_b); panel.add(label); @@ -315,34 +315,34 @@ // device status label = new JLabel(m_ic.getMessage("ACTION") + ":"); - label.setBounds(30, 520, 100, 25); // 420 + label.setBounds(30, 490, 100, 25); // 420 label.setFont(normal_b); panel.add(label); lbl_status = new JLabel(m_ic.getMessage("READY")); - lbl_status.setBounds(110, 520, 330, 25); // 420 + lbl_status.setBounds(110, 490, 330, 25); // 420 //lbl_status.setBorder(new LineBorder(Color.red)); lbl_status.setFont(normal); panel.add(lbl_status); this.progress = new JProgressBar(); - this.progress.setBounds(30, 550, 410, 20); // 450 + this.progress.setBounds(30, 520, 410, 20); // 450 this.progress.setStringPainted(true); // this.progress.setIndeterminate(true); panel.add(this.progress); bt_break = new JButton(m_ic.getMessage("BREAK_COMMUNICATION")); - bt_break.setBounds(150, 490, 170, 25); + bt_break.setBounds(150, 570, 170, 25); // bt_break.setEnabled(this.m_mim.isStatusOK()); bt_break.setActionCommand("break_communication"); bt_break.addActionListener(this); panel.add(bt_break); - help_button = m_da.createHelpButtonByBounds(30, 490, 110, 25, this); + help_button = m_da.createHelpButtonByBounds(30, 570, 110, 25, this); panel.add(help_button); bt_close = new JButton(m_ic.getMessage("CLOSE")); - bt_close.setBounds(330, 490, 110, 25); + bt_close.setBounds(330, 570, 110, 25); bt_close.setEnabled(false); bt_close.setActionCommand("close"); bt_close.addActionListener(this); @@ -878,6 +878,7 @@ */ public void setOldDataReadingProgress(int value) { + this.progress_old.setValue(value); } Modified: trunk/ggc-plugin_base/src/ggc/plugin/gui/DeviceReaderRunner.java =================================================================== --- trunk/ggc-plugin_base/src/ggc/plugin/gui/DeviceReaderRunner.java 2009-06-19 15:52:54 UTC (rev 808) +++ trunk/ggc-plugin_base/src/ggc/plugin/gui/DeviceReaderRunner.java 2009-06-20 15:39:47 UTC (rev 809) @@ -101,8 +101,9 @@ if (odra!=null) { + odra.setDeviceReadRunner(this); - odra.readOldEntries(); + m_da.getDeviceDataHandler().setDeviceData(odra.readOldEntries()); lg = "Reading of old data finished !"; log.debug(lg); writeLog(LogEntryType.DEBUG, lg); @@ -164,7 +165,7 @@ { this.setStatus(AbstractOutputWriter.STATUS_READER_ERROR); //System.out.println("Exception: " + ex); - //ex.printStackTrace(); + ex.printStackTrace(); //log.error("MeterReaderRunner:Exception:" + ex, ex); lg = "DeviceReaderRunner:Exception:" + ex; log.error(lg, ex); Modified: trunk/ggc-plugin_base/src/ggc/plugin/gui/OldDataReaderAbstract.java =================================================================== --- trunk/ggc-plugin_base/src/ggc/plugin/gui/OldDataReaderAbstract.java 2009-06-19 15:52:54 UTC (rev 808) +++ trunk/ggc-plugin_base/src/ggc/plugin/gui/OldDataReaderAbstract.java 2009-06-20 15:39:47 UTC (rev 809) @@ -2,11 +2,11 @@ import ggc.plugin.util.DataAccessPlugInBase; +import java.util.Hashtable; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.atech.db.hibernate.HibernateDb; - /** * Application: GGC - GNU Gluco Control * Plug-in: Base PlugIn @@ -65,6 +65,11 @@ } + /** + * Set DeviceReaderRunner instance + * + * @param drr + */ public void setDeviceReadRunner(DeviceReaderRunner drr) { this.m_drr = drr; @@ -80,9 +85,11 @@ /** - * Read Old entries + * Read Old entries (data is returned in form of Hashtable<String,Object>. What is stored there will depend + * from plugin to plugin) + * @return */ - public abstract void readOldEntries(); + public abstract Hashtable<String, Object> readOldEntries(); /** @@ -94,6 +101,9 @@ */ public void writeStatus(int current_entry) { + //System.out.println("Progress: " + current_entry + "/" + this.all_entries + " = "); + + float ee = ((float)current_entry)/(1.0f*this.all_entries); ee *= 100; @@ -101,15 +111,22 @@ this.m_drr.setOldDataReadingProgress(ee_i); log.debug("Old Data reading progress [" + m_da.getApplicationName() + "]: " + ee_i ); + //System.out.println("Progress: " + current_entry + "/" + this.all_entries + " = " + ee_i); } + /** + * Get Element Procent (this determines procent of reading by comparing data to full set) + * @param current_entry + * @return + */ public int getElementProcent(int current_entry) { float ee = ((float)current_entry)/(1.0f*this.all_entries); - ee *= 100; + ee *= 100.0f; int ee_i = (int)ee; + //System.out.println("Element Progress: " + current_entry + "/" + this.all_entries + " = " + ee_i); return ee_i; } Modified: trunk/ggc-plugin_base/src/ggc/plugin/util/DataAccessPlugInBase.java =================================================================== --- trunk/ggc-plugin_base/src/ggc/plugin/util/DataAccessPlugInBase.java 2009-06-19 15:52:54 UTC (rev 808) +++ trunk/ggc-plugin_base/src/ggc/plugin/util/DataAccessPlugInBase.java 2009-06-20 15:39:47 UTC (rev 809) @@ -233,7 +233,10 @@ protected long current_user_id = 0; + + protected OldDataReaderAbstract m_old_data_reader = null; + // ******************************************************** // ****** Constructors and Access methods ***** @@ -1154,6 +1157,11 @@ /** + * Create Old Data Reader + */ + public abstract void createOldDataReader(); + + /** * Get Old Data Reader (instance of OldDataReaderAbstract which can read data already in database - * for comparison purposes) * @@ -1161,15 +1169,25 @@ */ public OldDataReaderAbstract getOldDataReader() { - return null; + return this.m_old_data_reader; } + /** + * Get Current User Id + * + * @return + */ public long getCurrentUserId() { return this.current_user_id; } + /** + * Set Current User Id + * + * @param user_id + */ public void setCurrentUserId(long user_id) { this.current_user_id = user_id; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |