mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-25 08:32:32 +00:00
Merge branch 'main' of https://github.com/PAMGuard/PAMGuard
This commit is contained in:
commit
96d18b85a7
@ -47,6 +47,8 @@ public class PamCalendar {
|
|||||||
|
|
||||||
public static TimeZone defaultTimeZone = TimeZone.getTimeZone("UTC");
|
public static TimeZone defaultTimeZone = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
|
private static TimeZone localTimeZone = TimeZone.getDefault();
|
||||||
|
|
||||||
public static final long millisPerDay = 1000L*24L*3600L;
|
public static final long millisPerDay = 1000L*24L*3600L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -174,8 +176,9 @@ public class PamCalendar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static TimeZone getDisplayTimeZone(boolean useLocal) {
|
public static TimeZone getDisplayTimeZone(boolean useLocal) {
|
||||||
return TimeZone.getTimeZone("UTC");
|
// return TimeZone.getTimeZone("UTC");
|
||||||
// return useLocal ? CalendarControl.getInstance().getChosenTimeZone() : defaultTimeZone;
|
// return useLocal ? CalendarControl.getInstance().getChosenTimeZone() : defaultTimeZone;
|
||||||
|
return useLocal ? localTimeZone : defaultTimeZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String formatDateTime(Date date) {
|
public static String formatDateTime(Date date) {
|
||||||
|
@ -106,6 +106,13 @@ public abstract class DataBlockTableView<T extends PamDataUnit> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call the table data changed function to update table values.
|
||||||
|
*/
|
||||||
|
public void fireTableDataChanged() {
|
||||||
|
blockTableModel.fireTableDataChanged();
|
||||||
|
}
|
||||||
|
|
||||||
public JComponent getComponent() {
|
public JComponent getComponent() {
|
||||||
return tablePanel;
|
return tablePanel;
|
||||||
}
|
}
|
||||||
@ -150,14 +157,23 @@ public abstract class DataBlockTableView<T extends PamDataUnit> {
|
|||||||
String tip = null;
|
String tip = null;
|
||||||
java.awt.Point p = e.getPoint();
|
java.awt.Point p = e.getPoint();
|
||||||
int rowIndex = rowAtPoint(p);
|
int rowIndex = rowAtPoint(p);
|
||||||
|
// int column = columnAtPoint(p);
|
||||||
|
// System.out.println("Get tooltip for row " + rowIndex + " column" + column);
|
||||||
if (rowIndex < 0) {
|
if (rowIndex < 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
int colIndex = columnAtPoint(p);
|
int colIndex = columnAtPoint(p);
|
||||||
int realColumnIndex = convertColumnIndexToModel(colIndex);
|
int realColumnIndex = convertColumnIndexToModel(colIndex);
|
||||||
|
try {
|
||||||
T dataUnit = getDataUnit(rowIndex);
|
T dataUnit = getDataUnit(rowIndex);
|
||||||
return DataBlockTableView.this.getToolTipText(dataUnit, realColumnIndex);
|
return DataBlockTableView.this.getToolTipText(dataUnit, realColumnIndex);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
// I once got an index out of bounds here, or it might have been
|
||||||
|
// a concurrent modification exception ? Either way return null;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -226,14 +242,17 @@ public abstract class DataBlockTableView<T extends PamDataUnit> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of rows in the table - default behaviour is the
|
* Get the number of rows in the table - default behaviour is the
|
||||||
* number of rows in the datablock, but this may be overridded if
|
* number of rows in the datablock, but this may be overridden if
|
||||||
* data are being selected in a different way.
|
* data are being selected in a different way.
|
||||||
* @return number of table rows to show.
|
* @return number of table rows to show.
|
||||||
*/
|
*/
|
||||||
public int getRowCount() {
|
public int getRowCount() {
|
||||||
|
if (dataUnitCopy == null) {
|
||||||
|
updatePamData();
|
||||||
if (dataUnitCopy == null) {
|
if (dataUnitCopy == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return dataUnitCopy.size();
|
return dataUnitCopy.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ public class RWEProcess extends PamProcess {
|
|||||||
minSoundType = rweControl.rweParameters.minSoundType;
|
minSoundType = rweControl.rweParameters.minSoundType;
|
||||||
classifier.setSoundData(getSampleRate(), sourceDataBlock.getFftLength(),
|
classifier.setSoundData(getSampleRate(), sourceDataBlock.getFftLength(),
|
||||||
sourceDataBlock.getFftHop());
|
sourceDataBlock.getFftHop());
|
||||||
System.out.println("Create right whale channel process " + iChannel);
|
// System.out.println("Create right whale channel process " + iChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class BinaryStoreProcess extends PamProcess {
|
|||||||
startTime = PamCalendar.getTimeInMillis();
|
startTime = PamCalendar.getTimeInMillis();
|
||||||
long round = binaryStore.binaryStoreSettings.fileSeconds * 1000;
|
long round = binaryStore.binaryStoreSettings.fileSeconds * 1000;
|
||||||
nextFileTime = (startTime/round) * round + round;
|
nextFileTime = (startTime/round) * round + round;
|
||||||
System.out.println("Next file start at " + PamCalendar.formatDateTime(nextFileTime));
|
// System.out.println("Next file start at " + PamCalendar.formatDateTime(nextFileTime));
|
||||||
timer = new Timer();
|
timer = new Timer();
|
||||||
timer.schedule(new FileTimerTask(), 1000, 1000);
|
timer.schedule(new FileTimerTask(), 1000, 1000);
|
||||||
|
|
||||||
|
@ -412,8 +412,9 @@ PamSettingsSource {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dbParameters.getUseAutoCommit() == false) {
|
// if (dbParameters.getUseAutoCommit() == false) {
|
||||||
JMenuItem commitItem = new JMenuItem("Commit Changes");
|
JMenuItem commitItem = new JMenuItem("Commit Changes");
|
||||||
|
commitItem.setEnabled(dbParameters.getUseAutoCommit() == false);
|
||||||
commitItem.setToolTipText("Immediately commit recent changes to the database");
|
commitItem.setToolTipText("Immediately commit recent changes to the database");
|
||||||
commitItem.addActionListener(new ActionListener() {
|
commitItem.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -422,7 +423,7 @@ PamSettingsSource {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
menu.add(commitItem);
|
menu.add(commitItem);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (SMRUEnable.isEnable()) {
|
if (SMRUEnable.isEnable()) {
|
||||||
JMenuItem speedMenu = new JMenuItem("Test database speed");
|
JMenuItem speedMenu = new JMenuItem("Test database speed");
|
||||||
|
@ -279,7 +279,9 @@ public class SqliteSystem extends DBSystem implements PamSettings {
|
|||||||
{
|
{
|
||||||
if(connection != null){
|
if(connection != null){
|
||||||
// if (USEAUTOCOMMIT == false) {
|
// if (USEAUTOCOMMIT == false) {
|
||||||
|
if (connection.getConnection().getAutoCommit()) {
|
||||||
connection.getConnection().commit();
|
connection.getConnection().commit();
|
||||||
|
}
|
||||||
// }
|
// }
|
||||||
connection.getConnection().close();
|
connection.getConnection().close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user