Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.crl.nms.systemConstants; //GlobalConstant.java
- import java.awt.Font;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.Vector;
- import com.crl.nms.communication.MessageProcessor;
- import com.crl.nms.communication.MessageReceiver;
- import com.crl.nms.communication.MessageSender;
- import com.crl.nms.communication.inMessages.ADSS_MAPD_ZONE_AND_ASSOCIATED_SENSOR_CAMERA_MSG;
- import com.crl.nms.communication.inMessages.Struct_Interface_Info;
- import com.crl.nms.communication.structs.SYSTEM_ALERT_INFORMATION;
- import com.crl.nms.communication.structs.Struct_Annotation;
- import com.crl.nms.communication.structs.Struct_Battery_Charging_Status;
- import com.crl.nms.communication.structs.Struct_Camera_Characteristics;
- import com.crl.nms.communication.structs.Struct_Camera_Configuration;
- import com.crl.nms.communication.structs.Struct_Composite_Rule;
- import com.crl.nms.communication.structs.Struct_Fire_Plan;
- import com.crl.nms.communication.structs.Struct_Free_Textplus;
- import com.crl.nms.communication.structs.Struct_Movement_Plan;
- import com.crl.nms.communication.structs.Struct_Plot_Data;
- import com.crl.nms.communication.structs.Struct_Radar_Characterstics;
- import com.crl.nms.communication.structs.Struct_Radar_Data;
- import com.crl.nms.communication.structs.Struct_Received_Free_Textplus;
- import com.crl.nms.communication.structs.Struct_Rule;
- import com.crl.nms.communication.structs.Struct_Sensor_Status;
- import com.crl.nms.communication.structs.Struct_Share_Unshare;
- import com.crl.nms.communication.structs.Struct_Single_Target_Rule;
- import com.crl.nms.communication.structs.Struct_Sop;
- import com.crl.nms.communication.structs.Struct_Time_Position_Rule;
- import com.crl.nms.model.Free_Text;
- import com.crl.nms.model.User;
- //import com.crl.nms.communication.structs.Struct_Share_Record;
- public class GlobalConstant {
- public static boolean LOGGEDIN = false;
- public static boolean ISAOIEXSISTING = false;
- public static short id = 0;
- public static boolean isRecording = false;
- public static Thread msg_Thread = new MessageReceiver("MAPD");
- public static MessageProcessor msg_Processor= new MessageProcessor();
- public static boolean ISEXESPAWN = false;
- // public static HashMap<Integer, Struct_Main_Radar_Details_2D>
- // hm_radar_main_detials_2D = new HashMap<Integer,
- // Struct_Main_Radar_Details_2D>();
- // public static HashMap<Integer, Struct_Main_Radar_Details_3D>
- // hm_radar_main_detials_3D = new HashMap<Integer,
- // Struct_Main_Radar_Details_3D>();
- public static HashMap<Long, Struct_Interface_Info> hm_interface = new HashMap<Long, Struct_Interface_Info>();
- public static HashMap<Short, Struct_Radar_Characterstics> hm_radar_main_detials_2D = new HashMap<Short, Struct_Radar_Characterstics>();
- public static HashMap<Short, Struct_Radar_Characterstics> hm_radar_main_detials_3D = new HashMap<Short, Struct_Radar_Characterstics>();
- public static HashMap<Integer, Struct_Annotation> hm_annotation = new HashMap<Integer, Struct_Annotation>();
- public static HashMap<Long, Struct_Interface_Info> hm = new HashMap<Long, Struct_Interface_Info>();
- public static HashMap<Short, Struct_Camera_Configuration> hm_camera_config = new HashMap<Short, Struct_Camera_Configuration>();
- public static HashMap<String, Struct_Camera_Characteristics> hm_camera_charecterstics = new HashMap<String, Struct_Camera_Characteristics>();
- public static HashMap<Integer, Struct_Plot_Data> hm_plot_icon = new HashMap<Integer, Struct_Plot_Data>();
- public static HashMap<Integer, Struct_Movement_Plan> hm_MV_Plan = new HashMap<Integer, Struct_Movement_Plan>();
- public static HashMap<String, Struct_Fire_Plan> hm_Fire_Plan = new HashMap<String, Struct_Fire_Plan>();
- public static HashMap<Integer, Struct_Sensor_Status> interface_status = new HashMap<Integer, Struct_Sensor_Status>();
- public static HashMap<Integer, Struct_Free_Textplus> hm_Free_Text_Msg = new HashMap<Integer, Struct_Free_Textplus>();
- public static HashMap<Integer, Struct_Received_Free_Textplus> hm_Received_Free_Text_Msg = new HashMap<Integer, Struct_Received_Free_Textplus>();
- public static HashMap<Integer, Struct_Radar_Data> hm_radar_data = new HashMap<Integer, Struct_Radar_Data>();
- public static HashMap<Integer, Struct_Composite_Rule> hm_Composite_Rule = new HashMap<Integer, Struct_Composite_Rule>();
- public static HashMap<Integer, Struct_Time_Position_Rule> hm_Time_Position_Rule = new HashMap<Integer, Struct_Time_Position_Rule>();
- public static HashMap<Integer, Struct_Single_Target_Rule> hm_Single_Target_Rule = new HashMap<Integer, Struct_Single_Target_Rule>();
- public static HashMap<String, Vector<Struct_Share_Unshare>> hm_Share_Unshare_Interfaces = new HashMap<String, Vector<Struct_Share_Unshare>>();
- public static HashMap<Integer, Vector<Struct_Rule>> hm_Attached_Rules = new HashMap<Integer, Vector<Struct_Rule>>();
- public static HashMap<Integer, Struct_Battery_Charging_Status> hm_Battery_Status = new HashMap<Integer, Struct_Battery_Charging_Status>();
- public static HashMap<Integer, Struct_Sop> hm_SOP_Details = new HashMap<Integer, Struct_Sop>();
- public static HashMap<String, Struct_Camera_Characteristics> cameraCharectrsitcsMap = new HashMap<String, Struct_Camera_Characteristics>();
- public static HashMap<Integer, String> cameraConfigurationMap = new HashMap<Integer, String>();
- public static HashMap<Integer, String> cameraConfigurationMap_hd_URLS = new HashMap<Integer, String>();
- public static HashMap<Integer, String> cameraConfigurationMap_non_hd_URLS = new HashMap<Integer, String>();
- public static HashMap<Integer, String> cameraConfigurationMap_NIGHT_URLS = new HashMap<Integer, String>();
- public static String SensorMangemntURL=new String();
- public static String NetworkMangemntURL=new String();
- public static String VideoMangemntURL=new String();
- public static String IPMangemntURL=new String();
- public static Vector <Free_Text> sent_Free_text=new Vector <Free_Text>();
- public static Vector <Free_Text> received_Free_text=new Vector <Free_Text>();
- //SYSTEM_ALERT_INFORMATION
- public static HashMap<String, SYSTEM_ALERT_INFORMATION> pids_alerts_message_store = new HashMap<String, SYSTEM_ALERT_INFORMATION>();
- //interface
- public static HashMap<Integer, Short> interface_template_mapping = new HashMap<Integer, Short>();
- public static HashMap<String, String> track_creation_data = new HashMap<String, String>();
- public static Vector<Integer> deployedRadarids=new Vector<Integer>();
- //for init a datastore is created
- public static Init_Datastore init_datastore = new Init_Datastore();
- //2011 ke liye
- public static Vector<ADSS_MAPD_ZONE_AND_ASSOCIATED_SENSOR_CAMERA_MSG> Zone_alerts = new Vector<ADSS_MAPD_ZONE_AND_ASSOCIATED_SENSOR_CAMERA_MSG>();
- //for the interface details
- public static HashMap<Integer, String> Interface_Datastore = new HashMap<Integer, String>();
- //for login data
- public static HashMap<String, User> credentials = new HashMap<String, User>();
- public static String who_request ;
- public static int login_or_refresh; // 0 means login and 1 means refresh
- //
- public static String username = "";
- public static String ip = "";
- public static String userpassword = "";
- public static ArrayList<Long> list_trackid = new ArrayList<Long>();
- public static ArrayList<String> list_serverid = new ArrayList<String>();
- public static ArrayList<Long> deployed_interfaces = new ArrayList<Long>();
- public static ArrayList<Long> shared_interfaces = new ArrayList<Long>();
- public static boolean EncryptionDecryptionActiveFlag = true;
- // PIDS IRS CIBMS(HLS) IRS
- // 0x100 1 FibreBreak
- // 0x200 2 OpticalPowerDegraded
- // 0x400 3 LaserTemperatureWarning
- // 0x800 4 LaserShutdown
- // 0x1000 5 LaserOff
- // 0x2000 6 SopAlarm
- public static int isConnected = 0;
- public static int Plot_Id = 0;
- public static int plot_Count = 0;
- public static int trackCount = 0;
- public final static int UNSPECIFEID = 0;
- public final static int HUMAN = 1;
- public final static int VEHICLE = 2;
- public final static int ANIMAL = 3;
- public final static int AERIALTARGET = 4;
- public final static int FLOATINGOBJECT = 5;
- public final static int UNDERWATEROBJECT = 6;
- public final static int UNSPECIFIED = 0;
- public final static int STATIONARY = 1;
- public final static int CRAWLING = 2;
- public final static int MOVING = 3;
- public final static int FASTMOVING = 4;
- public final static int FLYING = 5;
- public final static int DIGGING = 6;
- public final static int TUNNELING = 7;
- public final static int TAMPERING = 8;
- public final static String LABELUNSPECIFIC[] = { "UNSPECIFIED" };
- public final static String LABELHUMAN[] = { "UNSPECIFIED", "STATIONARY", "CRAWLING", "MOVING", "FAST MOVING",
- "FLYING", "DIGGING", "TUNNELING", "TAMPERING/THEFT" };
- public final static String LABELVEHICLE[] = { "UNSPECIFIED", "STATIONARY", "MOVING", "FAST MOVING", "DIGGING",
- "TUNNELING" };
- public final static String LABELANIMAL[] = { "UNSPECIFIED", "STATIONARY", "MOVING", "FAST MOVING" };
- public final static String LABELAERIALTARGET[] = { "UNSPECIFIED", "STATIONARY", "FLYING" };
- public final static String LABELFLOATINGOBJECT[] = { "UNSPECIFIED", "STATIONARY", "MOVING" };
- public final static String LABELUNDERWATEROBJECT[] = { "UNSPECIFIED", "STATIONARY", "MOVING" };
- public final static String SubTypeUNSPECIFIC[] = { "UNSPECIFIED" };
- public final static String SubTypeHUMAN[] = { "UNSPECIFIED", "UNARMED", "LIGHT ARMED", "HEAVY ARMED" };
- public final static String SubTypeVEHICLE[] = { "UNSPECIFIED", "LIGHT", "HEAVY", "ARMED" };
- public final static String SubTypeANIMAL[] = { "UNSPECIFIED" };
- public final static String SubTypeAERIALTARGET[] = { "UNSPECIFIED", "SMALL AERIAL TARGET", "LARGE AERIAL TARGET" };
- public final static String SubTypeFLOATINGOBJECT[] = { "UNSPECIFIED", "SMALL", "BIG", "SMALL ARMED", "BIG ARMED" };
- public final static String SubTypeUNDERWATEROBJECT[] = { "UNSPECIFIED", "SMALL", "BIG", "SMALL ARMED", "BIG ARMED" };
- public final static String ONE = "Fibre Break";
- public final static String TWO = "Optical Power Degraded";
- public final static String THREE = "Laser Temperature Warning";
- public final static String FOUR = "Laser Shutdown";
- public final static String FIVE = "Laser Off";
- public final static String SIX = "SOP Alarm";
- public final static String FORMATIONID1 = "";
- public final static String FORMATIONID2 = "";
- public final static String FORMATIONID3 = "";
- public final static String SENSITIVITY0 = "HIGH";
- public final static String SENSITIVITY1 = "MEDIUM";
- public final static String SENSITIVITY2 = "LOW";
- public final static short ITRACK_IF = 13;
- public final static short CTRACK_IF = 14;
- public final static short ETRACK_IF = 15;
- public final static short BFSR_ACES_IF = 16;
- public final static short PIDS_IF = 17;
- public final static short EO_SENSOR_IF = 18;
- public final static short GAMS_IF = 19;
- public final static short FLCS_IF = 20;
- public final static short UGS_IF = 21;
- public final static short UWS_IF = 22;
- public final static short MICRO_AEROSTAT_IF = 23;
- public final static short QRT_IF = 24;
- public final static short PP_IF = 3; //
- public final static short RT_IF = 25;
- public final static short BLIGHTER_RADAR_IF = 26;
- //public final static short OPTASENSE_IF = 27;// ugs
- //public final static short DB_RD_MASTER_IF = 28;
- public final static short MAGAOS_SR500 = 27;
- public final static short MAGAOS_SR1000 = 28;//
- public final static short BN_HQIF = 29;
- public final static short MANUAL_TRK = 100;
- public final static short FL_STATUS_FLAG_OFF = 0;
- public final static short FL_STATUS_FLAG_ON = 1;
- public final static short IS_ISOLATED = 2;// 1-yes 2-no
- public final static short ZONE_STATE = 2;// 1-Online 2-Offline
- public static final int MAX_MESSAGE_SIZE = 1400;
- public static final int MESSAGE_HEADER_SIZE = 18;
- public final static short MESSAGE_HEADER_LENGTH = 12;
- // Constants Defined as per the IRS Document
- public final static short MAX_LENGTH_OF_CALL_SIGN = 8;
- public final static short MAX_IP_LENGTH = 16;
- public final static short MAX_LENGTH_OF_SHIPNAME = 21;
- public final static short MAX_LENGTH_OF_DESTINATION = 21;
- public static int SCREEN_WIDTH = 1280;
- public static int SCREEN_HEIGHT = 1024;
- // GUI Related Constants
- public static final int DEFAULT_FONT_SIZE = 12;
- public static final int MENU_FONT_SIZE = 14;
- public static final String DEFAULT_FONT_TYPE = Font.SANS_SERIF;
- public static final Font DEFAULT_FONT_REGULAR = new Font(DEFAULT_FONT_TYPE, Font.PLAIN, DEFAULT_FONT_SIZE);
- public static final Font DEFAULT_FONT_BOLD = new Font(DEFAULT_FONT_TYPE, Font.BOLD, DEFAULT_FONT_SIZE);
- public static final Font DEFAULT_MENU_BOLD = new Font(DEFAULT_FONT_TYPE, Font.BOLD, MENU_FONT_SIZE);
- public static enum LatLongType {
- LATITUDE, LONGITUDE
- };
- public final static double LAT_LONG_CONV_CONSTANT = 600000.0;
- public final static double SPEED_CONV_CONST = (1.0 / 514.444);
- public final static double COURSE_CONV_CONST = (0.0055);
- public final static double NM_RADIUS_CONV_CONST = 1852000;
- public final static double NM_KM_CONV_CONST = 1.852;
- public final static double NM_METRE_CONV_CONST = 1852;
- public final static double KM_NM_CONV_CONST = (1.0 / 1.852);
- public final static double METER_TO_NM_CONV_CONST = (1.0 / 1852.0);
- public final static double KM_METER_CONV_CONST = 1000.0;
- public final static double PI = 3.14159265358979323846;
- public final static double DEG_TO_RADIANS = (PI / 180.0);
- public final static double RADIANS_TO_DEGREES = 1.0 / DEG_TO_RADIANS;
- public final static double KNOTS_TO_MPS = (1852.0 / 3600.0);
- public final static double MPS_TO_KNOTS = (3600.0 / 1852.0);
- public final static double KMPH_TO_MPS = (1000.0 / 3600.0);
- public final static double MPS_TO_KMPH = (3600.0 / 1000.0);
- public final static double KNOTS_TO_KMPH = (1852.0 / 1000.0);
- public final static double KMPH_TO_KNOTS = (1000.0 / 1852.0);
- // Degree, Minute, Second Symbol
- public static String degSymbol = "\u00b0";
- public static String minSymbol = "\u2032";
- public static String secSymbol = "\u2033";
- public final static String TB_NORTH_LEFT = "NorthLeft";
- public final static String TB_NORTH_RIGHT = "NorthRight";
- public final static String TB_SOUTH_TOPRIGHT = "SouthTopRight";
- public final static String TB_SOUTH_TOPLEFT = "SouthTopLeft";
- public final static String TB_SOUTH_BOTTOMRIGHT = "SouthBottomRight";
- public final static String TB_SOUTH_BOTTOMLEFT = "SouthBottomLeft";
- public final static String TB_EAST_TOP = "EastTop";
- public final static String TB_EAST_BOTTOM = "EastBottom";
- public final static String TB_WEST_TOP = "WestTop";
- public final static String TB_WEST_BOTTOM = "WestBottom";
- public static enum GridType {
- LON_LAT, MGRS, GEOREF
- };
- // HLS
- public final static short TRACK_PREFIX = 4;
- public static final short MAX_NO_OF_DESCRIPTION_BYTES = 100 + 1;
- public static final short MAX_NO_OF_CONTRIBUTING_SENSORS = 20;
- public static final short MAX_NO_OF_NAME_CHAR = 50 + 1;
- // Area Types
- public final static short UNKNOWN = 0;
- public final static short AOI = 1;
- public final static short AOR = 2;
- public final static short DESIGNATED_AREA = 3;
- public final static short ROUTE = 4;
- public final static short SURVELLIANCEZONE = 5;
- public final static short FILTERZONE = 9;
- // Identity Type
- public final static short FRIENDLY = 1;
- public final static short NEUTRAL = 2;
- public final static short HOSTILE = 3;
- // Geometry type
- public final static short POINT = 1;
- public final static short LINE = 2;
- public final static short POLYGON = 3;
- public final static short CIRCLE = 4;
- public final static short POLYLINE = 5;
- // Login
- public final static short LOGIN = 1154;
- // public final static String IP_MSDF = "192.168.14.50";
- // public final static String IP_MAPD = "192.168.101.177";
- // public final static int PORT_MSDF = 11009;
- // public final static int PORT_MAPD = 11001;
- public final static byte SHARE_TRACK = 1;
- public final static byte SHARE_AOI = 2;
- public final static byte SHARE_AOR = 3;
- public final static byte SHARE_DA = 4;
- public final static byte SHARE_ROUTE = 6;
- public final static byte SLUE_CUE_CAMERA = 8;
- public final static byte SHARE_MP = 7;
- public final static byte SHARE_ANNOTATION = 5;
- public final static byte SHARE_SURVELLIANCEZONE = 9;
- // FirePlan
- public final static short MAX_LENGTH_OF_ARTY_GUN_ID = 21;
- public static final short MAX_PIDS_SENSOR_ID = 4;
- public static final short LASER_LOC_VALID = 1;
- public static final short LASER_LOC_INVALID = 0;
- public static final short SENSOR_ON = 1;
- public static final short SENSOR_OFF = 2;
- // FormationType
- public static final short CORPS = 1;
- public static final short DIVISION = 2;
- public static final short BRIGADE = 3;
- public static final short BATTALION = 4;
- public static final short COMPANY = 5;
- // Infrastructure
- public static final byte BOP = 0;
- public static final byte BNHQ = 1;
- public static final byte GATE = 2;
- private static short templateid = 0;
- //camera
- public static final byte MAX_FLOAT_LENGTH=10;
- public static final byte MAX_CAMERA_NAME=51;
- public static String getIdentityFromNumtoString(int identity) {
- String str = "";
- if (identity == 0)
- str = "UNKNOWN";
- else if (identity == 1)
- str = "FRIENDLY";
- else if (identity == 2)
- str = "NEUTRAL";
- else if (identity == 3)
- str = "HOSTILE";
- else
- str = "INVALID";
- return str;
- }
- public static String getTargetTypeFromNumtoString(int identity) {
- String str = "";
- if (identity == 0)
- str = "UNSPECIFEID";
- else if (identity == 1)
- str = "HUMAN";
- else if (identity == 2)
- str = "VEHICLE";
- else if (identity == 3)
- str = "ANIMAL";
- else if (identity == 4)
- str = "AERIAL TARGET";
- else if (identity == 5)
- str = "FLOATING OBJECT";
- else if (identity == 6)
- str = "UNDER_WATER_OBJECT";
- else
- str = "INVALID";
- return str;
- }
- public static String getSubTargetTypeFromNumtoString(int tgttype, int subTgtType) {
- String str = "";
- if (tgttype == 0) {
- if (subTgtType == 0)
- str = "UNSPECIFEID";
- }
- if (tgttype == 1) {// human
- if (subTgtType == 0)
- str = "UNSPECIFEID";
- else if (subTgtType == 1)
- str = "UNARMED";
- else if (subTgtType == 2)
- str = "LIGHT ARMED";
- else if (subTgtType == 3)
- str = "HEAVY ARMED";
- }
- if (tgttype == 2) {// vehicle
- if (subTgtType == 0)
- str = "UNSPECIFEID";
- else if (subTgtType == 1)
- str = "LIGHT";
- else if (subTgtType == 2)
- str = "HEAVY";
- else if (subTgtType == 3)
- str = "ARMED";
- }
- if (tgttype == 3) {// animal
- if (subTgtType == 0)
- str = "UNSPECIFEID";
- }
- if (tgttype == 4) {// AERIAL_TARGET
- if (subTgtType == 0)
- str = "UNSPECIFEID";
- else if (subTgtType == 1)
- str = "SMALL AERIAL TARGET";
- else if (subTgtType == 2)
- str = "LARGE AERIAL TARGET";
- }
- if (tgttype == 5) {// FLOATING_OBJECT
- if (subTgtType == 0)
- str = "UNSPECIFEID";
- else if (subTgtType == 1)
- str = "SMALL";
- else if (subTgtType == 2)
- str = "BIG";
- else if (subTgtType == 3)
- str = "SMALL ARMED";
- else if (subTgtType == 4)
- str = "BIG ARMED";
- }
- if (tgttype == 6) {// UNDER_WATER_OBJECT
- if (subTgtType == 0)
- str = "UNSPECIFEID";
- else if (subTgtType == 1)
- str = "SMALL";
- else if (subTgtType == 2)
- str = "BIG";
- else if (subTgtType == 3)
- str = "SMALL ARMED";
- else if (subTgtType == 4)
- str = "BIG ARMED";
- }
- return str;
- }
- public static String getActivityFromNumtoString(int identity) {
- String str = "";
- if (identity == 0)
- str = "UNSPECIFIED";
- else if (identity == 1)
- str = "STATIONARY";
- else if (identity == 2)
- str = "CRAWLING";
- else if (identity == 3)
- str = "MOVING";
- else if (identity == 4)
- str = "FAST MOVING";
- else if (identity == 5)
- str = "FLYING";
- else if (identity == 6)
- str = "DIGGING";
- else if (identity == 7)
- str = "TUNNELING";
- else if (identity == 8)
- str = "TAMPERING/THEFT";
- else
- str = "INVALID";
- return str;
- }
- public String getFormationIDFromNumtoString(int formationid) {
- if (formationid == 0) {
- return GlobalConstant.FORMATIONID1;
- } else if (formationid == 1) {
- return GlobalConstant.FORMATIONID2;
- } else {
- return GlobalConstant.FORMATIONID3;
- }
- }
- public static String getFormationTypeFromNumToString(int formationtype) {
- String stringFormationtype;
- if (formationtype == 1) {
- stringFormationtype = "CORPS";
- } else if (formationtype == 2) {
- stringFormationtype = "DIVISION";
- }
- else if (formationtype == 3) {
- stringFormationtype = "BRIGADE";
- }
- else if (formationtype == 4) {
- stringFormationtype = "BATTALION";
- }
- else if (formationtype == 5) {
- stringFormationtype = "COMPANY";
- } else {
- stringFormationtype = "Wrong Type";
- }
- return stringFormationtype;
- }
- public static String getZoneIsolation(int isolation) {
- if (isolation == 1)
- return "Isolated";
- else
- return "Not Isolated";
- }
- public static String getSensititvityFromNumToString(int senstitvity) {
- if (senstitvity == 0) {
- return GlobalConstant.SENSITIVITY0;
- } else if (senstitvity == 1) {
- return GlobalConstant.SENSITIVITY1;
- } else {
- return GlobalConstant.SENSITIVITY2;
- }
- }
- public static String getAreaTypeFromNumToString(int areaType) {
- if (areaType == UNKNOWN) {
- return "Unknown";
- } else if (areaType == AOI) {
- return "AOI";
- } else if (areaType == AOR) {
- return "AOR";
- } else if (areaType == DESIGNATED_AREA) {
- return "DA";
- } else if (areaType == ROUTE) {
- return "ROUTE";
- } else if (areaType == SURVELLIANCEZONE) {
- return "SURVELLIANCE ZONE";
- } else {
- return "WRONG AREATYPE";
- }
- }
- public static boolean isCameraAvailableInCameraList() {
- if (GlobalConstant.hm_camera_config.isEmpty())
- return false;
- else
- return true;
- }
- public static boolean isInterfaceForSharingAvailable() {
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- String _name = i.getInterfaceName();
- // System.out.println("name is " + _name);
- int template_type = i.getTemplateType();
- // System.out.println("template_type is " + template_type);
- // if((_name.contains("QRT"))||_name.contains("RECCE")||_name.contains("PP"))
- if ((template_type == GlobalConstant.QRT_IF) || (template_type == GlobalConstant.PP_IF)
- || (template_type == GlobalConstant.RT_IF))
- return true;
- }
- return false;
- }
- public static boolean isInterfaceAvailableForDisplay() {
- if (GlobalConstant.hm.isEmpty())
- return false;
- else
- return true;
- }
- public static String getInterfaceName(long id) {
- String _name = "";
- if (isInterfaceAvailableForDisplay()) {
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- if (id == i.getInterfaceId()) {
- _name = i.getInterfaceName();
- return _name;
- }
- }
- }
- return _name;
- }
- public static long getInterfaceId(String name) {
- long id = 0;
- if (isInterfaceAvailableForDisplay()) {
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- if (name.equals(i.getInterfaceName())) {
- id = i.getInterfaceId();
- return id;
- }
- }
- }
- return id;
- }
- public static short gettemplateType(long id) {
- short _type = 0;
- if (isInterfaceAvailableForDisplay()) {
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- if (id == i.getInterfaceId()) {
- _type = i.getTemplateType();
- return _type;
- }
- }
- }
- return _type;
- }
- public static long getInterfaceIDFromTemplateType(short templatetype) {
- long id = 0;
- if (isInterfaceAvailableForDisplay()) {
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- if (templatetype == i.getTemplateType()) {
- id = i.getInterfaceId();
- return id;
- }
- }
- }
- return id;
- }
- public static String getTemplateNameFromInterfaceID(long interface_id) {
- int template_type = gettemplateType(interface_id);
- String _templateName = gettemplateName(template_type);
- return _templateName;
- }
- public static String loadAudioFileForLaserAlarm(int alarmtype) {
- if (alarmtype == 1) {
- return "Alarms/Fibre Break.wav";
- }
- else if (alarmtype == 2) {
- return "Alarms/Optical Power Degraded.wav";
- }
- else if (alarmtype == 3) {
- return "Alarms/Laser Temperature Warning.wav";
- }
- else if (alarmtype == 4) {
- return "Alarms/Laser Shutdown.wav";
- }
- else if (alarmtype == 5) {
- return "Alarms/Laser Off.wav";
- }
- else if (alarmtype == 6) {
- return "Alarms/SOP Alarm.wav";
- }
- else {
- // System.out.println("alarmtype" + alarmtype);
- return "Alarms/SOP Alarm.wav";
- }
- }
- public static int getPlot_Count() {
- return plot_Count;
- }
- public static void setPlot_Count(int plot_Count) {
- GlobalConstant.plot_Count = plot_Count;
- }
- public static int getTrackCount() {
- return trackCount;
- }
- public static void setTrackCount(int trackCount) {
- GlobalConstant.trackCount = trackCount;
- }
- public static String gettemplateName(long template_type) {
- if (template_type == ITRACK_IF) {
- return "ITRACK";
- } else if (template_type == CTRACK_IF) {
- return "CTRACK";
- } else if (template_type == BFSR_ACES_IF) {
- return "BFSR_ACES";
- } else if (template_type == PIDS_IF) {
- return "PIDS";
- } else if (template_type == EO_SENSOR_IF) {
- return "EO";
- } else if (template_type == GAMS_IF) {
- return "GAMS";
- } else if (template_type == FLCS_IF) {
- return "FLCS";
- } else if (template_type == UGS_IF) {
- return "UGS";
- } else if (template_type == UWS_IF) {
- return "UWS";
- } else if (template_type == MICRO_AEROSTAT_IF) {
- return "MICRO_AEROSTAT";
- } else if (template_type == QRT_IF) {
- return "QRT_IF";
- } else if (template_type == PP_IF) {
- return "PP_IF";
- } else if (template_type == RT_IF) {
- return "RT_IF";
- } else if (template_type == BLIGHTER_RADAR_IF) {
- return "BLIGHTER_RADAR_IF";
- } else if (template_type == MAGAOS_SR500) {
- return "MAGAOS_SR500";
- } else if (template_type == MAGAOS_SR1000) {
- return "MAGAOS_SR1000";
- } else {
- return "Wrong Template Type";
- }
- }
- public static boolean IsTargetAvailableInSystem() {
- return false;
- /*
- * List<IExternalEntity<Long>> allEe =
- * EntityType.TRACK.getManager().getAllExternalEntities();
- *
- * if(allEe.isEmpty()) return false; else return true;
- */}
- public static ArrayList<Long> getTargetList() {
- return list_trackid;
- /*
- * if(IsTargetAvailableInSystem()){ List<IExternalEntity<Long>> allEe =
- * EntityType.TRACK.getManager().getAllExternalEntities();
- * for(IExternalEntity<Long> e: allEe){ DisplayTarget data =
- * (DisplayTarget) e.getComposedDataObj(); long
- * _id=data.getTrackNumber(); list_trackid.add(_id); } } >>>>>>> .r6046
- * return list_trackid; <<<<<<< .mine /*
- * if(IsTargetAvailableInSystem()){ List<IExternalEntity<Long>> allEe =
- * EntityType.TRACK.getManager().getAllExternalEntities();
- * for(IExternalEntity<Long> e: allEe){ DisplayTarget data =
- * (DisplayTarget) e.getComposedDataObj(); long
- * _id=data.getTrackNumber(); list_trackid.add(_id); } } return
- * list_trackid;
- */}
- public static void setInterfaceForBlighterCommand() {
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- String _name = i.getInterfaceName();
- long id = i.getInterfaceId();
- // System.out.println("name is " + _name);
- int template_type = i.getTemplateType();
- // System.out.println("template_type is " + template_type);
- if ((template_type == GlobalConstant.BLIGHTER_RADAR_IF))
- MessageSender.getInstance().setInterfaceId(id);
- }
- }
- public static boolean isConfiguredRADARExist() {
- boolean _flag = false;
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- int template_type = i.getTemplateType();
- // System.out.println("template_type is " + template_type);
- if ((template_type == GlobalConstant.BLIGHTER_RADAR_IF) || (template_type == GlobalConstant.BFSR_ACES_IF)) {
- _flag = true;
- return _flag;
- }
- }
- return _flag;
- }
- public static boolean isConfiguredCameraExist() {
- boolean _flag = false;
- if (!GlobalConstant.hm_camera_config.isEmpty()) {
- _flag = true;
- return _flag;
- }
- return _flag;
- }
- public static boolean isConfiguredUWSExist() {
- boolean _flag = false;
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- int template_type = i.getTemplateType();
- // System.out.println("template_type is " + template_type);
- if ((template_type == GlobalConstant.UWS_IF)) {
- _flag = true;
- return _flag;
- }
- }
- return _flag;
- }
- public static boolean isConfiguredGateExist() {
- boolean _flag = false;
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- int template_type = i.getTemplateType();
- // System.out.println("template_type is " + template_type);
- if ((template_type == GlobalConstant.GAMS_IF)) {
- _flag = true;
- return _flag;
- }
- }
- return _flag;
- }
- public static boolean isConfiguredBNHQExist() {
- boolean _flag = false;
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- int template_type = i.getTemplateType();
- // System.out.println("template_type is " + template_type);
- if ((template_type == GlobalConstant.BN_HQIF)) {
- _flag = true;
- return _flag;
- }
- }
- return _flag;
- }
- public static boolean isDeployedInterfacesExist() {
- if (GlobalConstant.deployed_interfaces.isEmpty())
- return false;
- else
- return true;
- }
- public static boolean isRADARDeployed(long id) {
- boolean _flag = false;
- if (GlobalConstant.deployed_interfaces.contains(id)) {
- _flag = true;
- }
- return _flag;
- }
- public static boolean isConfiguredFLExist() {
- boolean _flag = false;
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- int template_type = i.getTemplateType();
- // System.out.println("template_type is " + template_type);
- if ((template_type == GlobalConstant.FLCS_IF)) {
- _flag = true;
- return _flag;
- }
- }
- return _flag;
- }
- public static boolean isFLDeployed(long id) {
- boolean _flag = false;
- if (GlobalConstant.deployed_interfaces.contains(id)) {
- _flag = true;
- }
- return _flag;
- }
- public static boolean isConfiguredEOExist() {
- boolean _flag = false;
- for (Struct_Interface_Info i : GlobalConstant.hm.values()) {
- int template_type = i.getTemplateType();
- // System.out.println("template_type is " + template_type);
- if ((template_type == GlobalConstant.EO_SENSOR_IF)) {
- _flag = true;
- return _flag;
- }
- }
- return _flag;
- }
- public static boolean isEODeployed(long id) {
- boolean _flag = false;
- if (GlobalConstant.deployed_interfaces.contains(id)) {
- _flag = true;
- return _flag;
- }
- return _flag;
- }
- public static String LoadAudioFileForSystemAlarm(long alarmtype) {
- // SOP ALARM 6 not included as suggested
- String audio = "";
- if (alarmtype == 1) {
- audio = "Alarms/Controller Shutdown.wav";
- }
- else if (alarmtype == 2) {
- audio = "Alarms/Maintenance.wav";
- }
- else if (alarmtype == 3) {
- audio = "Alarms/Tamper.wav";
- }
- else if (alarmtype == 4) {
- audio = "Alarms/Locator Fault.wav";
- }
- else if (alarmtype == 5) {
- audio = "Alarms/Communication Lost.wav";
- }
- // else if (alarmtype == 6) {
- // alarm_Description = "SOP Alarm";
- // }
- else if (alarmtype == 7) {
- audio = "Alarms/System Error.wav";
- } else if (alarmtype == 8) {
- audio = "Alarms/Power Supply.wav";
- }
- else {
- // System.out.println("alarmtype" + alarmtype);
- audio = "Alarms/Power Supply.wav";
- }
- return audio;
- }
- public static boolean getAOIExsisting() {
- // System.out.println("Here the vale inital" + " " + ISAOIEXSISTING);
- return ISAOIEXSISTING;
- }
- public static void setAOIExsiting(boolean getAoi) {
- // System.out.println("From message" + " " + ISAOIEXSISTING);
- ISAOIEXSISTING = getAoi;
- }
- public static boolean isRecording() {
- return isRecording;
- }
- public static void setRecording(boolean isRec) {
- isRecording = isRec;
- }
- // public void setSectorGeometry() {
- // int startang = 10;
- // if (listOfSectors != null) {
- // ILcdPoint cenpoint = new TLcdLonLatPoint(this.getLongitude(),
- // this.getLatitude());
- // for (int i = 0; i < 18; i++) {
- // TLcdLonLatArcBand arc = new TLcdLonLatArcBand(cenpoint, getMinRadius(),
- // getMaxRadius(), 90 - startang, 10);
- // listOfSectors.put(i, arc);
- // startang += 10;
- // }
- // // System.out.println(listOfSectors.toString());
- // }
- // }
- //
- // public Map<Integer, ILcdShape> getGeometryofSectors(){
- // return listOfSectors;
- // }
- public static ArrayList<Long> RetreiveSharedInterfaceList(byte sharing_type, long _id) {
- // TODO Auto-generated method stub
- ArrayList<Long> _interface_shared_list = new ArrayList<Long>();
- for (String t : GlobalConstant.hm_Share_Unshare_Interfaces.keySet()) {
- // String _interfaceName_From_Key = t.substring(0, 5);
- // String _IDFromKey = t.substring(5, t.length() - 1);
- String _IDFromKey = t.substring(0, t.length() - 1);
- // System.out.println("_IDFromKey" + _IDFromKey);
- String _sharingTypeFromKey = t.substring(t.length() - 1);
- // System.out.println("_sharingTypeFromKey" + _sharingTypeFromKey);
- // String
- // key=GlobalConstant.getInterfaceName(_share_unshare_obj.getShareInterfaceId())
- // +
- // Integer.toString(_share_unshare_obj.getShareObjectId())+GlobalConstant.SHARE_TRACK
- // ;
- // System.out.println("_interfaceName_From_Key" +
- // _interfaceName_From_Key);
- // if ((Integer.parseInt(_sharingTypeFromKey) == sharing_type) &&
- // (Integer.parseInt(_IDFromKey) == _id))
- // _interface_shared_list.add(GlobalConstant.getInterfaceId(_interfaceName_From_Key));
- if ((Integer.parseInt(_sharingTypeFromKey) == sharing_type) && (Integer.parseInt(_IDFromKey) == _id))
- for (Struct_Share_Unshare sharedTo : GlobalConstant.hm_Share_Unshare_Interfaces.get(t))
- _interface_shared_list.add((long) sharedTo.getShareInterfaceId());
- }
- return _interface_shared_list;
- }
- public static ArrayList<Long> RetreiveSharedInterfaceListForUnsharing(byte sharing_type, byte _id) {
- ArrayList<Long> _interface_shared_list = new ArrayList<Long>();
- for (String t : GlobalConstant.hm_Share_Unshare_Interfaces.keySet()) {
- // String _interfaceName_From_Key = t.substring(0, 5);
- String _sharingTypeFromKey = t.substring(t.length() - 1);
- String _IDFromKey = t.substring(5, t.length() - 1);
- // System.out.println("_sharingTypeFromKey" + _sharingTypeFromKey);
- // String
- // key=GlobalConstant.getInterfaceName(_share_unshare_obj.getShareInterfaceId())
- // +
- // Integer.toString(_share_unshare_obj.getShareObjectId())+GlobalConstant.SHARE_TRACK
- // ;
- // System.out.println("_interfaceName_From_Key" +
- // _interfaceName_From_Key);
- // if ((Integer.parseInt(_sharingTypeFromKey) == sharing_type) &&
- // (Integer.parseInt(_IDFromKey) == _id))
- // _interface_shared_list.add(GlobalConstant.getInterfaceId(_interfaceName_From_Key));
- }
- return _interface_shared_list;
- }
- public static String RetreiveTimePositionRuleDesc(int t) {
- String _str = "";
- if (t == 1)
- _str = "IS INSIDE";
- else if (t == 2)
- _str = "IS APPROACHING";
- else if (t == 3)
- _str = "IS DEPARTING";
- else if (t == 4)
- _str = "IS LOITERING";
- else if (t == 5)
- _str = "CROSS COUNT";
- else
- _str = "WRONG VALUE";
- return _str;
- }
- public static void setUserInformation(String usrname, String usrpassword) {
- username = usrname;
- userpassword = usrpassword;
- }
- public static String getUserId() {
- return username;
- }
- public static String getUserPassword() {
- return userpassword;
- }
- public static void ClearAllLayers() {}
- public static void setTemplateId(short templateId) {
- templateid = templateId;
- }
- public static short getTemplateId() {
- return templateid;
- }
- }
Add Comment
Please, Sign In to add comment