本文整理汇总了C#中Ecell.Objects.EcellObject.GetEcellData方法的典型用法代码示例。如果您正苦于以下问题:C# EcellObject.GetEcellData方法的具体用法?C# EcellObject.GetEcellData怎么用?C# EcellObject.GetEcellData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ecell.Objects.EcellObject
的用法示例。
在下文中一共展示了EcellObject.GetEcellData方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateInitialCondition
/// <summary>
/// Update the initial condition of new object.
/// </summary>
/// <param name="oldObj">the old object.</param>
/// <param name="newObj">the new object.</param>
public void UpdateInitialCondition(EcellObject oldObj, EcellObject newObj)
{
string modelID = oldObj.ModelID;
foreach (EcellData oldData in oldObj.Value)
{
EcellData newData = newObj.GetEcellData(oldData.Name);
if (newData == null)
continue;
string oldPath = oldData.EntityPath;
string newPath = newData.EntityPath;
foreach (string simParam in InitialCondition.Keys)
{
if (InitialCondition[simParam][modelID].ContainsKey(oldPath))
{
InitialCondition[simParam][modelID][newPath] =
InitialCondition[simParam][modelID][oldPath];
InitialCondition[simParam][modelID].Remove(oldPath);
}
}
}
}
示例2: CheckLoggerData
private void CheckLoggerData(EcellObject oldObj, EcellObject newObj)
{
List<LoggerEntry> entList = m_env.LoggerManager.GetLoggerEntryForObject(oldObj.Key, oldObj.Type);
foreach (EcellData nd in newObj.Value)
{
EcellData od = oldObj.GetEcellData(nd.Name);
if (od != null && od.Logged == nd.Logged)
continue;
if (nd.Logged)
{
m_env.LoggerManager.AddLoggerEntry(newObj.ModelID, newObj.Key, newObj.Type, nd.EntityPath);
}
else
{
if (od != null)
m_env.LoggerManager.LoggerRemoved(new LoggerEntry(newObj.ModelID, newObj.Key, newObj.Type, nd.EntityPath));
}
}
}
示例3: IsCheckNecessary
/// <summary>
/// Check whether the properties of this object is added or deleted.
/// </summary>
/// <param name="oldObj">the old object.</param>
/// <param name="newObj">the new object.</param>
/// <returns>if changed, return true.</returns>
private bool IsCheckNecessary(EcellObject oldObj, EcellObject newObj)
{
if (oldObj.Value.Count > newObj.Value.Count)
return true;
foreach (EcellData d in oldObj.Value)
{
if (newObj.GetEcellData(d.Name) == null)
return true;
}
return false;
}
示例4: CheckDeleteParameterData
/// <summary>
/// Check the deleted property in paramater or observed data.
/// </summary>
/// <param name="oldObj">the old object.</param>
/// <param name="newObj">the new object.</param>
private void CheckDeleteParameterData(EcellObject oldObj, EcellObject newObj)
{
List<string> delList = new List<string>();
foreach (EcellData oldData in oldObj.Value)
{
if (newObj.GetEcellData(oldData.Name) == null)
delList.Add(oldData.EntityPath);
}
foreach (string entPath in delList)
{
EcellParameterData p = GetParameterData(entPath);
if (p != null)
RemoveParameterData(p);
EcellObservedData o = GetObservedData(entPath);
if (o != null )
RemoveObservedData(o);
}
foreach (string paramID in m_currentProject.InitialCondition.Keys)
{
foreach (string modelID in m_currentProject.InitialCondition[paramID].Keys)
{
foreach (string entPath in delList)
{
if (m_currentProject.InitialCondition[paramID][modelID].ContainsKey(entPath))
m_currentProject.InitialCondition[paramID][modelID].Remove(entPath);
}
}
}
}
示例5: UpdatePropertyForDataChanged
/// <summary>
/// Update the property when DataChanged is executed,
/// </summary>
/// <param name="variable">the variable object.</param>
/// <param name="updateData">the update data.</param>
public void UpdatePropertyForDataChanged(EcellObject variable, EcellData updateData)
{
if (variable.LocalID.Equals(EcellSystem.SIZE))
return;
// check old data;
EcellObject old = GetEcellObject(variable.ModelID, variable.Key, variable.Type);
if (old == null)
return;
if (updateData == null)
{
foreach (EcellData orgdata in old.Value)
{
if (!orgdata.Settable)
continue;
updateData = variable.GetEcellData(orgdata.Name);
if (updateData == null)
continue;
if (!updateData.Value.ToString().Equals(orgdata.Value.ToString()))
{
break;
}
updateData = null;
}
}
if (updateData == null)
return;
EcellObject sys = GetEcellObject(variable.ModelID, variable.ParentSystemID, Constants.xpathSystem);
string variablePath = Constants.delimiterPath + Constants.delimiterColon + "V0";
string sizePath = Constants.delimiterPath + Constants.delimiterColon + Constants.xpathSize.ToUpper();
string sizeValuePath = Constants.xpathVariable + Constants.delimiterColon + sizePath +
Constants.delimiterColon + Constants.xpathValue;
WrappedSimulator sim = null;
EcellObject dummySizeObject = null;
EcellObject variableObject = null;
Dictionary<string, EcellData> dic = new Dictionary<string, EcellData>();
try
{
sim = m_currentProject.CreateSimulatorInstance();
BuildDefaultSimulator(sim, null, null);
dummySizeObject = EcellObject.CreateObject(
"",
sizePath,
EcellObject.VARIABLE,
EcellObject.VARIABLE,
null
);
sim.SetEntityProperty(sizeValuePath, ((EcellSystem)sys).SizeInVolume);
sim.CreateEntity(Constants.xpathVariable, Constants.xpathVariable + Constants.delimiterColon + variablePath);
foreach (EcellData data in variable.Value)
{
if (!data.Settable) continue;
if (data.Name.Equals(updateData.Name)) continue;
sim.SetEntityProperty(
Constants.xpathVariable + Constants.delimiterColon + variablePath +
Constants.delimiterColon + data.Name, data.Value.Value);
}
sim.SetEntityProperty(
Constants.xpathVariable + Constants.delimiterColon + variablePath +
Constants.delimiterColon + updateData.Name, updateData.Value.Value);
variableObject = EcellObject.CreateObject(
"",
variablePath,
EcellObject.VARIABLE,
EcellObject.VARIABLE,
null
);
DataStorer.DataStored4Variable(
sim,
variableObject,
new Dictionary<string, double>());
SetPropertyList(variableObject, dic);
foreach (string name in dic.Keys)
{
EcellData tmp = variable.GetEcellData(name);
tmp.Value = dic[name].Value;
}
}
finally
{
sim.Dispose();
sim = null;
variableObject = null;
}
}
示例6: CreateRow
/// <summary>
/// Create the new row for Object.
/// </summary>
/// <param name="obj">the inserted object.</param>
/// <returns>the inserted row.</returns>
private DataGridViewRow CreateRow(EcellObject obj)
{
DataGridViewRow rs = new DataGridViewRow();
{
DataGridViewImageCell c = new DataGridViewImageCell();
c.Value = GetIconImage(obj);
rs.Cells.Add(c);
c.ReadOnly = true;
}
{
DataGridViewTextBoxCell c = new DataGridViewTextBoxCell();
c.Value = obj.Classname;
rs.Cells.Add(c);
c.ReadOnly = true;
}
{
DataGridViewTextBoxCell c = new DataGridViewTextBoxCell();
c.Value = obj.Key;
rs.Cells.Add(c);
c.ReadOnly = true;
}
{
DataGridViewTextBoxCell c = new DataGridViewTextBoxCell();
EcellData d = obj.GetEcellData("Name");
// for loading the project include the process not in DM directory.
if (d == null)
c.Value = "";
else
c.Value = d.Value.ToString();
rs.Cells.Add(c);
c.ReadOnly = true;
}
rs.Tag = obj;
return rs;
}
示例7: DataChanged
/// <summary>
/// The event sequence on changing value of data at other plugin.
/// </summary>
/// <param name="modelID">The model ID before value change.</param>
/// <param name="key">The ID before value change.</param>
/// <param name="type">The data type before value change.</param>
/// <param name="data">Changed value of object.</param>
public void DataChanged(string modelID, string key, string type, EcellObject data)
{
if (key != data.Key)
{
DataDelete(modelID, key, type);
DataAdd(data);
AddSelect(data.ModelID, data.Key, data.Type);
return;
}
DataGridViewRow r = SearchIndex(type, key);
if (r != null)
{
r.Tag = data;
r.Cells[IndexType].Value = GetIconImage(data);
r.Cells[IndexClass].Value = data.Classname;
EcellData d = data.GetEcellData("Name");
r.Cells[IndexName].Value = d != null ? d.Value.ToString() : "";
}
}
示例8: GetData
/// <summary>
/// Get the data string from entity name.
/// </summary>
/// <param name="name">The entity name.</param>
/// <param name="obj">The searched object.</param>
/// <returns>the data string.</returns>
private string GetData(string name, EcellObject obj)
{
if (name.Equals(s_indexType))
{
return obj.Type;
}
else if (name.Equals(s_indexID))
{
return obj.Key;
}
else if (name.Equals(s_indexModel))
{
return obj.ModelID;
}
else if (name.Equals(s_indexClass))
{
return obj.Classname;
}
else if (name.Equals(s_indexName))
{
EcellData data = obj.GetEcellData("Name");
return data != null ? (string)data.Value : "";
}
else if (name.Equals(s_indexStepper))
{
foreach (EcellData d in obj.Value)
{
if (d.Name.Equals(Constants.xpathStepperID))
return (string)d.Value;
}
}
else if (name.Equals(s_indexSize))
{
EcellSystem data = obj as EcellSystem;
return data.SizeInVolume.ToString(m_env.DataManager.DisplayStringFormat);
}
else
{
foreach (EcellData d in obj.Value)
{
if (name.Equals(d.Name))
{
if (d.Value.IsDouble)
return ((double)d.Value).ToString(m_env.DataManager.DisplayStringFormat);
return (string)d.Value;
}
}
}
return "";
}