2020-07-15 21:42:10 +02:00
|
|
|
package com.minres.scviewer.database.ui.swt;
|
2018-10-15 09:10:10 +02:00
|
|
|
|
2021-11-16 09:37:50 +01:00
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
2018-10-15 09:10:10 +02:00
|
|
|
public class Constants {
|
|
|
|
|
2021-11-27 14:04:06 +01:00
|
|
|
public static final String[] UNIT_STRING={"fs", "ps", "ns", "us", "ms", "s"};
|
|
|
|
public static final long[] UNIT_MULTIPLIER={1l, 1000l, 1000l*1000, 1000l*1000*1000, 1000l*1000*1000*1000, 1000l*1000*1000*1000*1000 };
|
2021-11-16 14:12:10 +01:00
|
|
|
|
|
|
|
//public static final int[] UNIT_MULTIPLIER={1, 3, 10, 30, 100, 300};
|
|
|
|
public static final long[] SCALE_MULTIPLIER={1, 2, 5, 10, 20, 50, 100, 200, 500};
|
2020-03-21 06:28:28 +01:00
|
|
|
|
|
|
|
public static final String CONTENT_PROVIDER_TAG = "TOOLTIP_CONTENT_PROVIDER";
|
|
|
|
public static final String HELP_PROVIDER_TAG = "TOOLTIP_HELP_PROVIDER";
|
2020-11-29 12:42:51 +01:00
|
|
|
|
2023-03-18 12:20:29 +01:00
|
|
|
public static final DecimalFormat TIME_FORMAT_FS = new DecimalFormat("#0");
|
|
|
|
public static final DecimalFormat TIME_FORMAT_PS = new DecimalFormat("#0");
|
|
|
|
public static final DecimalFormat TIME_FORMAT_NS = new DecimalFormat("#0.0##");
|
|
|
|
public static final DecimalFormat TIME_FORMAT_UMS = new DecimalFormat("#0.0#####");
|
2021-11-27 14:04:06 +01:00
|
|
|
public static final long[] POWERS_OF_TEN = {
|
|
|
|
1L,
|
|
|
|
10L,
|
|
|
|
100L,
|
|
|
|
1_000L,
|
|
|
|
10_000L,
|
|
|
|
100_000L,
|
|
|
|
1_000_000L,
|
|
|
|
10_000_000L,
|
|
|
|
100_000_000L,
|
|
|
|
1_000_000_000L,
|
|
|
|
10_000_000_000L,
|
|
|
|
100_000_000_000L,
|
|
|
|
1_000_000_000_000L,
|
|
|
|
10_000_000_000_000L,
|
|
|
|
100_000_000_000_000L,
|
|
|
|
1_000_000_000_000_000L};
|
2021-11-16 09:37:50 +01:00
|
|
|
|
2021-11-27 14:04:06 +01:00
|
|
|
public static DecimalFormat getTimeFormatForLevel(int idx) {
|
|
|
|
switch(idx) {
|
2021-11-16 14:12:10 +01:00
|
|
|
case 0: return TIME_FORMAT_FS;
|
|
|
|
case 1: return TIME_FORMAT_PS;
|
|
|
|
case 2: return TIME_FORMAT_NS;
|
|
|
|
default:
|
2021-11-27 14:04:06 +01:00
|
|
|
return TIME_FORMAT_UMS;
|
2021-11-16 14:12:10 +01:00
|
|
|
}
|
|
|
|
}
|
2020-11-29 12:42:51 +01:00
|
|
|
private Constants() {}
|
2018-10-15 09:10:10 +02:00
|
|
|
|
|
|
|
}
|