2 using System.Collections.Generic;
8 namespace RobotIOControls
10 namespace DynamixelUSB
15 protected int m_iUpdateAllParamsCount = 10;
16 protected int m_iUpdateQueueIndex = -1;
18 public override string ModuleName {
get {
return "RoboticsAnimatSim"; } }
19 protected override System.Type GetLinkedPartDropDownTreeType() {
return typeof(AnimatGUI.TypeHelpers.DropDownTreeEditorNoFirstSelect); }
21 public virtual int UpdateAllParamsCount
23 get {
return m_iUpdateAllParamsCount; }
27 throw new System.Exception(
"Invalid Update All Params Count specified. (" + value.ToString() +
"). It must be greater than zero.");
28 SetSimData(
"UpdateAllParamsCount", value.ToString(),
true);
29 m_iUpdateAllParamsCount = value;
33 public virtual int UpdateQueueIndex
35 get {
return m_iUpdateQueueIndex; }
39 throw new System.Exception(
"Invalid Update Queue Index specified. (" + m_iUpdateAllParamsCount.ToString() +
"). It must be greater than zero or -1.");
40 SetSimData(
"UpdateQueueIndex", value.ToString(),
true);
41 m_iUpdateQueueIndex = value;
51 protected override void CloneInternal(AnimatGUI.Framework.DataObject doOriginal,
bool bCutData, AnimatGUI.Framework.DataObject doRoot)
53 base.CloneInternal(doOriginal, bCutData, doRoot);
57 m_iUpdateAllParamsCount = servo.m_iUpdateAllParamsCount;
58 m_iUpdateQueueIndex = servo.m_iUpdateQueueIndex;
61 public override void BuildProperties(ref AnimatGuiCtrls.Controls.PropertyTable propTable)
63 base.BuildProperties(ref propTable);
65 propTable.Properties.Add(
new AnimatGuiCtrls.Controls.PropertySpec(
"Update All Params Count",
this.UpdateAllParamsCount.GetType(),
"UpdateAllParamsCount",
66 "Properties",
"How many update loops to go through before updating all params (voltage, load, etc.)", this.UpdateAllParamsCount));
68 propTable.Properties.Add(
new AnimatGuiCtrls.Controls.PropertySpec(
"Update Queue Index",
this.UpdateQueueIndex.GetType(),
"UpdateQueueIndex",
69 "Properties",
"Dynamixel motors can be updated in a round robin fashion. To do this change their queue index. " +
70 "To have it updated every time set the index to -1.", this.UpdateAllParamsCount));
78 m_iUpdateAllParamsCount = oXml.GetChildInt(
"UpdateAllParamsCount", m_iUpdateAllParamsCount);
79 m_iUpdateQueueIndex = oXml.GetChildInt(
"UpdateQueueIndex", m_iUpdateQueueIndex);
88 oXml.AddChildElement(
"UpdateAllParamsCount", m_iUpdateAllParamsCount);
89 oXml.AddChildElement(
"UpdateQueueIndex", m_iUpdateQueueIndex);
93 public override void SaveSimulationXml(
ManagedAnimatInterfaces.
IStdXml oXml, ref AnimatGUI.Framework.DataObject nmParentControl,
string strName =
"")
95 base.SaveSimulationXml(oXml, ref nmParentControl, strName);
98 oXml.AddChildElement(
"UpdateAllParamsCount", m_iUpdateAllParamsCount);
99 oXml.AddChildElement(
"UpdateQueueIndex", m_iUpdateQueueIndex);