Commit efb8a509 authored by allens's avatar allens

added message handling

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@27760 18c085ea-50e0-402c-830e-de6fd14e8384
parent f1dd4960
......@@ -157,6 +157,7 @@ void avtSimulationInformation::Copy(const avtSimulationInformation &obj)
customCommands.push_back(newavtSimulationCommandSpecification);
}
message = obj.message;
avtSimulationInformation::SelectAll();
}
......@@ -346,7 +347,8 @@ avtSimulationInformation::operator == (const avtSimulationInformation &obj) cons
(otherValues == obj.otherValues) &&
genericCommands_equal &&
(mode == obj.mode) &&
customCommands_equal);
customCommands_equal &&
(message == obj.message));
}
// ****************************************************************************
......@@ -498,6 +500,7 @@ avtSimulationInformation::SelectAll()
Select(ID_genericCommands, (void *)&genericCommands);
Select(ID_mode, (void *)&mode);
Select(ID_customCommands, (void *)&customCommands);
Select(ID_message, (void *)&message);
}
// ****************************************************************************
......@@ -578,6 +581,13 @@ avtSimulationInformation::SetMode(avtSimulationInformation::RunMode mode_)
Select(ID_mode, (void *)&mode);
}
void
avtSimulationInformation::SetMessage(const std::string &message_)
{
message = message_;
Select(ID_message, (void *)&message);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -666,6 +676,18 @@ avtSimulationInformation::GetCustomCommands()
return customCommands;
}
const std::string &
avtSimulationInformation::GetMessage() const
{
return message;
}
std::string &
avtSimulationInformation::GetMessage()
{
return message;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -706,6 +728,12 @@ avtSimulationInformation::SelectCustomCommands()
Select(ID_customCommands, (void *)&customCommands);
}
void
avtSimulationInformation::SelectMessage()
{
Select(ID_message, (void *)&message);
}
///////////////////////////////////////////////////////////////////////////////
// AttributeGroupVector convenience methods.
///////////////////////////////////////////////////////////////////////////////
......@@ -1044,6 +1072,7 @@ avtSimulationInformation::GetFieldName(int index) const
case ID_genericCommands: return "genericCommands";
case ID_mode: return "mode";
case ID_customCommands: return "customCommands";
case ID_message: return "message";
default: return "invalid index";
}
}
......@@ -1076,6 +1105,7 @@ avtSimulationInformation::GetFieldType(int index) const
case ID_genericCommands: return FieldType_attVector;
case ID_mode: return FieldType_enum;
case ID_customCommands: return FieldType_attVector;
case ID_message: return FieldType_string;
default: return FieldType_unknown;
}
}
......@@ -1108,6 +1138,7 @@ avtSimulationInformation::GetFieldTypeName(int index) const
case ID_genericCommands: return "attVector";
case ID_mode: return "enum";
case ID_customCommands: return "attVector";
case ID_message: return "string";
default: return "invalid index";
}
}
......@@ -1192,6 +1223,11 @@ avtSimulationInformation::FieldsEqual(int index_, const AttributeGroup *rhs) con
retval = customCommands_equal;
}
break;
case ID_message:
{ // new scope
retval = (message == obj.message);
}
break;
default: retval = false;
}
......
......@@ -101,6 +101,7 @@ public:
void SelectOtherValues();
void SelectGenericCommands();
void SelectCustomCommands();
void SelectMessage();
// Property setting methods
void SetHost(const std::string &host_);
......@@ -109,6 +110,7 @@ public:
void SetOtherNames(const stringVector &otherNames_);
void SetOtherValues(const stringVector &otherValues_);
void SetMode(RunMode mode_);
void SetMessage(const std::string &message_);
// Property getting methods
const std::string &GetHost() const;
......@@ -125,6 +127,8 @@ public:
RunMode GetMode() const;
const AttributeGroupVector &GetCustomCommands() const;
AttributeGroupVector &GetCustomCommands();
const std::string &GetMessage() const;
std::string &GetMessage();
// Attributegroup convenience methods
......@@ -166,6 +170,7 @@ public:
ID_genericCommands,
ID_mode,
ID_customCommands,
ID_message,
ID__LAST
};
......@@ -180,11 +185,12 @@ private:
AttributeGroupVector genericCommands;
int mode;
AttributeGroupVector customCommands;
std::string message;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define AVTSIMULATIONINFORMATION_TMFS "siss*s*a*ia*"
#define AVTSIMULATIONINFORMATION_TMFS "siss*s*a*ia*s"
#endif
......@@ -23,4 +23,6 @@
</Field>
<Field name="customCommands" label="customCommands" type="attVector" subtype="avtSimulationCommandSpecification">
</Field>
<Field name="message" label="message" type="string">
</Field>
</Attribute>
......@@ -57,7 +57,7 @@ import java.util.Vector;
public class avtSimulationInformation extends AttributeSubject
{
private static int avtSimulationInformation_numAdditionalAtts = 8;
private static int avtSimulationInformation_numAdditionalAtts = 9;
// Enum values
public final static int RUNMODE_UNKNOWN = 0;
......@@ -77,6 +77,7 @@ public class avtSimulationInformation extends AttributeSubject
genericCommands = new Vector();
mode = RUNMODE_UNKNOWN;
customCommands = new Vector();
message = new String("");
}
public avtSimulationInformation(int nMoreFields)
......@@ -91,6 +92,7 @@ public class avtSimulationInformation extends AttributeSubject
genericCommands = new Vector();
mode = RUNMODE_UNKNOWN;
customCommands = new Vector();
message = new String("");
}
public avtSimulationInformation(avtSimulationInformation obj)
......@@ -127,6 +129,7 @@ public class avtSimulationInformation extends AttributeSubject
customCommands.addElement(new avtSimulationCommandSpecification(oldObj));
}
message = new String(obj.message);
SelectAll();
}
......@@ -189,7 +192,8 @@ public class avtSimulationInformation extends AttributeSubject
otherValues_equal &&
genericCommands_equal &&
(mode == obj.mode) &&
customCommands_equal);
customCommands_equal &&
(message.equals(obj.message)));
}
// Property setting methods
......@@ -229,6 +233,12 @@ public class avtSimulationInformation extends AttributeSubject
Select(6);
}
public void SetMessage(String message_)
{
message = message_;
Select(8);
}
// Property getting methods
public String GetHost() { return host; }
public int GetPort() { return port; }
......@@ -238,6 +248,7 @@ public class avtSimulationInformation extends AttributeSubject
public Vector GetGenericCommands() { return genericCommands; }
public int GetMode() { return mode; }
public Vector GetCustomCommands() { return customCommands; }
public String GetMessage() { return message; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
......@@ -272,6 +283,8 @@ public class avtSimulationInformation extends AttributeSubject
tmp.Write(buf);
}
}
if(WriteSelect(8, buf))
buf.WriteString(message);
}
public void ReadAtts(int index, CommunicationBuffer buf)
......@@ -322,6 +335,9 @@ public class avtSimulationInformation extends AttributeSubject
}
Select(7);
break;
case 8:
SetMessage(buf.ReadString());
break;
}
}
......@@ -361,6 +377,7 @@ public class avtSimulationInformation extends AttributeSubject
str = str + "\n";
}
str = str + "}\n";
str = str + stringToString("message", message, indent) + "\n";
return str;
}
......@@ -439,5 +456,6 @@ public class avtSimulationInformation extends AttributeSubject
private Vector genericCommands; // vector of avtSimulationCommandSpecification objects
private int mode;
private Vector customCommands; // vector of avtSimulationCommandSpecification objects
private String message;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment