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 {
|
|
|
|
|
2020-11-29 12:42:51 +01:00
|
|
|
public static final String[] UNIT_STRING={"fs", "ps", "ns", "us", "ms"};//, "s"};
|
2021-11-16 14:12:10 +01:00
|
|
|
public static final long[] UNIT_MULTIPLIER={1, 1000, 1000*1000, 1000*1000*1000, 1000*1000*1000*1000, 1000*1000*1000*1000*1000 };
|
|
|
|
|
|
|
|
//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
|
|
|
|
2021-11-16 09:37:50 +01:00
|
|
|
public static final DecimalFormat TIME_FORMAT_FS = new DecimalFormat("#");
|
|
|
|
public static final DecimalFormat TIME_FORMAT_PS = new DecimalFormat("#");
|
|
|
|
public static final DecimalFormat TIME_FORMAT_NS = new DecimalFormat("#.0##");
|
|
|
|
public static final DecimalFormat TIME_FORMAT_US = new DecimalFormat("#.0#####");
|
|
|
|
public static final DecimalFormat TIME_FORMAT_MS = new DecimalFormat("#.0#####");
|
|
|
|
|
|
|
|
|
2021-11-16 14:12:10 +01:00
|
|
|
public static DecimalFormat getTimeFormatForLevel(int level) {
|
|
|
|
switch(level/SCALE_MULTIPLIER.length) {
|
|
|
|
case 0: return TIME_FORMAT_FS;
|
|
|
|
case 1: return TIME_FORMAT_PS;
|
|
|
|
case 2: return TIME_FORMAT_NS;
|
|
|
|
case 3: return TIME_FORMAT_US;
|
|
|
|
case 4: return TIME_FORMAT_MS;
|
|
|
|
default:
|
|
|
|
return TIME_FORMAT_FS;
|
|
|
|
}
|
|
|
|
}
|
2020-11-29 12:42:51 +01:00
|
|
|
private Constants() {}
|
2018-10-15 09:10:10 +02:00
|
|
|
|
|
|
|
}
|