| 1 | package tmcsim.client.cadclientgui.data; |
|---|
| 2 | |
|---|
| 3 | import java.io.Serializable; |
|---|
| 4 | |
|---|
| 5 | import tmcsim.client.cadclientgui.enums.CADDataEnums; |
|---|
| 6 | |
|---|
| 7 | /** |
|---|
| 8 | * This class is a further subdivision of Incident to hold data. |
|---|
| 9 | * |
|---|
| 10 | * @author Vincent |
|---|
| 11 | * |
|---|
| 12 | */ |
|---|
| 13 | public class IncidentAdditionalInfo implements Serializable { |
|---|
| 14 | |
|---|
| 15 | /* The init variables are set only from the XML script (readXMLNode method) |
|---|
| 16 | * and are only used for resetCADDataSimulation purposes |
|---|
| 17 | */ |
|---|
| 18 | private String init_type = ""; |
|---|
| 19 | private String init_typeCode = ""; |
|---|
| 20 | private String init_machine = ""; |
|---|
| 21 | private String init_callStatus = ""; |
|---|
| 22 | private String init_callTakerExt = ""; |
|---|
| 23 | private String init_alarmLevel = ""; |
|---|
| 24 | private String init_rotationProviderArea = ""; |
|---|
| 25 | private String init_comment = ""; |
|---|
| 26 | |
|---|
| 27 | private String type; |
|---|
| 28 | private String typeCode; |
|---|
| 29 | private String machine; |
|---|
| 30 | private String callStatus; |
|---|
| 31 | private String callTakerExt; |
|---|
| 32 | private String alarmLevel; |
|---|
| 33 | private String rotationProviderArea; |
|---|
| 34 | private String comment; |
|---|
| 35 | |
|---|
| 36 | /* |
|---|
| 37 | * Constructor. Initializes all objects to avoid null pointers. |
|---|
| 38 | */ |
|---|
| 39 | public IncidentAdditionalInfo() { |
|---|
| 40 | type = ""; |
|---|
| 41 | typeCode = ""; |
|---|
| 42 | machine = ""; |
|---|
| 43 | callStatus = ""; |
|---|
| 44 | callTakerExt = ""; |
|---|
| 45 | alarmLevel = ""; |
|---|
| 46 | rotationProviderArea = ""; |
|---|
| 47 | comment = ""; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | public void resetCADDataSimulation(){ |
|---|
| 51 | type = init_type; |
|---|
| 52 | typeCode = init_typeCode; |
|---|
| 53 | machine = init_machine; |
|---|
| 54 | callStatus = init_callStatus; |
|---|
| 55 | callTakerExt = init_callTakerExt; |
|---|
| 56 | alarmLevel = init_alarmLevel; |
|---|
| 57 | rotationProviderArea = init_rotationProviderArea; |
|---|
| 58 | comment = init_comment; |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | public String getMachine() { |
|---|
| 62 | return machine; |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | public void setMachine(String machine) { |
|---|
| 66 | this.machine = machine; |
|---|
| 67 | } |
|---|
| 68 | |
|---|
| 69 | public String getCallStatus() { |
|---|
| 70 | return callStatus; |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | public void setCallStatus(String callStatus) { |
|---|
| 74 | this.callStatus = callStatus; |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | public String getCallTakerExt() { |
|---|
| 78 | return callTakerExt; |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | public void setCallTakerExt(String callTakerExt) { |
|---|
| 82 | this.callTakerExt = callTakerExt; |
|---|
| 83 | } |
|---|
| 84 | |
|---|
| 85 | public String getType() { |
|---|
| 86 | return type; |
|---|
| 87 | } |
|---|
| 88 | |
|---|
| 89 | public void setType(String type) { |
|---|
| 90 | this.type = type; |
|---|
| 91 | } |
|---|
| 92 | |
|---|
| 93 | public String getTypeCode() { |
|---|
| 94 | return typeCode; |
|---|
| 95 | } |
|---|
| 96 | |
|---|
| 97 | public void setTypeCode(String type) { |
|---|
| 98 | this.typeCode = type; |
|---|
| 99 | } |
|---|
| 100 | |
|---|
| 101 | public String getAlarmLevel() { |
|---|
| 102 | return alarmLevel; |
|---|
| 103 | } |
|---|
| 104 | |
|---|
| 105 | public void setAlarmLevel(String alarmLevel) { |
|---|
| 106 | this.alarmLevel = alarmLevel; |
|---|
| 107 | } |
|---|
| 108 | |
|---|
| 109 | public String getRotationProviderArea() { |
|---|
| 110 | return rotationProviderArea; |
|---|
| 111 | } |
|---|
| 112 | |
|---|
| 113 | public void setRotationProviderArea(String rotationProviderArea) { |
|---|
| 114 | this.rotationProviderArea = rotationProviderArea; |
|---|
| 115 | } |
|---|
| 116 | |
|---|
| 117 | public String getComment() { |
|---|
| 118 | return comment; |
|---|
| 119 | } |
|---|
| 120 | |
|---|
| 121 | public void setComment(String comment) { |
|---|
| 122 | this.comment = comment; |
|---|
| 123 | } |
|---|
| 124 | |
|---|
| 125 | /* |
|---|
| 126 | * Called from the tmc.simulator.cadclient.data.Incident.java. Handles |
|---|
| 127 | * storing data based on script tag. |
|---|
| 128 | */ |
|---|
| 129 | public void readXMLNode(String tag_name, String value) { |
|---|
| 130 | if (tag_name.equals(CADDataEnums.INC_ADD_INFO.TYPE.tag)) { |
|---|
| 131 | init_type = value; |
|---|
| 132 | setType(value); |
|---|
| 133 | } else if (tag_name.equals(CADDataEnums.INC_ADD_INFO.TYPE_CODE.tag)) { |
|---|
| 134 | init_typeCode = value; |
|---|
| 135 | setTypeCode(value); |
|---|
| 136 | } else if (tag_name.equals(CADDataEnums.INC_ADD_INFO.MACHINE.tag)) { |
|---|
| 137 | init_machine = value; |
|---|
| 138 | setMachine(value); |
|---|
| 139 | } else if (tag_name.equals(CADDataEnums.INC_ADD_INFO.CALL_STATUS.tag)) { |
|---|
| 140 | init_callStatus = value; |
|---|
| 141 | setCallStatus(value); |
|---|
| 142 | } else if (tag_name.equals(CADDataEnums.INC_ADD_INFO.CALL_TAKER_EXT.tag)) { |
|---|
| 143 | init_callTakerExt = value; |
|---|
| 144 | setCallTakerExt(value); |
|---|
| 145 | } else if (tag_name.equals(CADDataEnums.INC_ADD_INFO.ALARM_LEVEL.tag)) { |
|---|
| 146 | init_alarmLevel = value; |
|---|
| 147 | setAlarmLevel(value); |
|---|
| 148 | } else if (tag_name.equals(CADDataEnums.INC_ADD_INFO.ROTATION_PROVIDER_AREA.tag)) { |
|---|
| 149 | init_rotationProviderArea = value; |
|---|
| 150 | setRotationProviderArea(value); |
|---|
| 151 | } else if (tag_name.equals(CADDataEnums.INC_ADD_INFO.COMMENT.tag)) { |
|---|
| 152 | init_comment = value; |
|---|
| 153 | setComment(value); |
|---|
| 154 | } |
|---|
| 155 | } |
|---|
| 156 | |
|---|
| 157 | } |
|---|