Initial import of ClientModules from the sourceforge CVS repository
[remote/remote-gui.git] / DIKUClientMainModule / temp / ConfirmText.java
blob99dddbd1d21d56a895f586e831e9ec672540754f
1 package gui;
3 import diku.distlab.motecontrolclientlib.protocols.*;
5 public class ConfirmText {
6 String message;
8 long mote_id;
10 public ConfirmText(long mote_id, short type, int result) {
11 this.mote_id = mote_id;
12 if (result != MsgResult.SUCCESS) {
13 switch (type) {
14 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_GETHANDLE:
15 message = "Control request failed.";
16 break;
17 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_DROPHANDLE:
18 message = "Release failed.";
19 break;
20 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_REPROGRAM:
21 message = "Programming failed.";
22 break;
23 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_STATUS:
24 message = "Status request failed.";
25 break;
26 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_RESET:
27 message = "Reset failed.";
28 break;
29 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_STOP:
30 message = "Stop failed.";
31 break;
32 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_START:
33 message = "Start failed.";
34 break;
36 } else {
37 switch (type) {
38 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_GETHANDLE:
39 message = "Control request successful.";
40 break;
41 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_DROPHANDLE:
42 message = "Release successful.";
43 break;
44 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_REPROGRAM:
45 message = "Programming successful.";
46 break;
47 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_STATUS:
48 message = "Status request successful.";
49 break;
50 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_RESET:
51 message = "Reset successful.";
52 break;
53 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_STOP:
54 message = "Stop successful.";
55 break;
56 case diku.distlab.motecontrolclientlib.protocols.simplemotecontrol.MOTE_START:
57 message = "Start successful.";
58 break;
63 public String getMessage() {
64 return message;
67 public void setMessage(String message) {
68 this.message = message;
71 public long getMote_id() {
72 return mote_id;
75 public void setMote_id(long mote_id) {
76 this.mote_id = mote_id;