• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Objects.EcellObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Ecell.Objects.EcellObject的典型用法代码示例。如果您正苦于以下问题:C# EcellObject类的具体用法?C# EcellObject怎么用?C# EcellObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EcellObject类属于Ecell.Objects命名空间,在下文中一共展示了EcellObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ChangeStepperAction

 /// <summary>
 /// The constructor for UpdateStepperAction with initial parameters.
 /// </summary>
 /// <param name="newID">The updated stepper ID.</param>
 /// <param name="orgID">The original stepper ID.</param>
 /// <param name="newStepper">The updated stepper.</param>
 /// <param name="oldStepper">The old stepper.</param>
 public ChangeStepperAction(string newID, string orgID, EcellObject newStepper, EcellObject oldStepper)
 {
     m_newID = newID;
     m_orgID = orgID;
     m_newStepper = newStepper;
     m_oldStepper = oldStepper;
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:14,代码来源:ChangeStepperAction.cs


示例2: DataStored

 /// <summary>
 /// Stores the "EcellObject"
 /// </summary>
 /// <param name="simulator">The "simulator"</param>
 /// <param name="dmm">The "DMDescriptorKeeper"</param>
 /// <param name="ecellObject">The stored "EcellObject"</param>
 /// <param name="initialCondition">The initial condition.</param>
 internal static void DataStored(
     WrappedSimulator simulator,
     DMDescriptorKeeper dmm,
     EcellObject ecellObject,
     Dictionary<string, double> initialCondition)
 {
     if (ecellObject.Type.Equals(Constants.xpathStepper))
     {
         DataStored4Stepper(simulator, dmm, ecellObject);
     }
     else if (ecellObject.Type.Equals(Constants.xpathSystem))
     {
         DataStored4System(
                 simulator,
                 ecellObject,
                 initialCondition);
     }
     else if (ecellObject.Type.Equals(Constants.xpathProcess))
     {
         DataStored4Process(
                 simulator,
                 dmm,
                 ecellObject,
                 initialCondition);
     }
     else if (ecellObject.Type.Equals(Constants.xpathVariable))
     {
         DataStored4Variable(
                 simulator,
                 ecellObject,
                 initialCondition);
     }
     //
     // 4 children
     //
     if (ecellObject.Children != null)
     {
         foreach (EcellObject childEcellObject in ecellObject.Children)
             DataStored(simulator, dmm, childEcellObject, initialCondition);
     }
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:48,代码来源:DataStorer.cs


示例3: AddSystem

 /// <summary>
 /// Add System to this project.
 /// </summary>
 /// <param name="system">the system object.</param>
 public void AddSystem(EcellObject system)
 {
     m_systemDic[system.ModelID].Add(system);
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:8,代码来源:Project.cs


示例4: DataStored4System

        /// <summary>
        /// Stores the "EcellObject" 4 the "System".
        /// </summary>
        /// <param name="simulator">The simulator</param>
        /// <param name="ecellObject">The stored "System"</param>
        /// <param name="initialCondition">The initial condition.</param>
        internal static void DataStored4System(
            WrappedSimulator simulator,
            EcellObject ecellObject,
            Dictionary<string, double> initialCondition)
        {
            // Creates an entityPath.
            string parentPath = ecellObject.ParentSystemID;
            string childPath = ecellObject.LocalID;
            string key = Constants.xpathSystem + Constants.delimiterColon +
                parentPath + Constants.delimiterColon +
                childPath;
            // Property List
            IList<string> wrappedPolymorph = simulator.GetEntityPropertyList(key);
            //
            // Checks the stored "EcellData"
            //
            List<EcellData> systemEcellDataList = new List<EcellData>();
            Dictionary<string, EcellData> storedEcellDataDic
                    = new Dictionary<string, EcellData>();
            if (ecellObject.Value != null && ecellObject.Value.Count > 0)
            {
                foreach (EcellData storedEcellData in ecellObject.Value)
                {
                    storedEcellDataDic[storedEcellData.Name] = storedEcellData;
                    systemEcellDataList.Add(storedEcellData);

                }
            }
            foreach (string name in wrappedPolymorph)
            {
                string entityPath = key + Constants.delimiterColon + name;
                PropertyAttributes flag = simulator.GetEntityPropertyAttributes(entityPath);

                if (!flag.Gettable)
                {
                    continue;
                }

                object value = null;
                if (name.Equals(Constants.xpathSize))
                {
                    value = new EcellValue(EcellSystem.DefaultSize);
                }
                else
                {
                    try
                    {
                        value = new EcellValue(simulator.GetEntityProperty(entityPath));
                    }
                    catch (WrappedException ex)
                    {
                        Trace.WriteLine(ex);
                        if (storedEcellDataDic.ContainsKey(name))
                        {
                            IEnumerable val = storedEcellDataDic[name].Value as IEnumerable;
                            object firstItem = null;
                            {
                                IEnumerator i = val.GetEnumerator();
                                if (i.MoveNext())
                                    firstItem = i.Current;
                            }
                            if (firstItem is IEnumerable)
                            {
                                value = val;
                            }
                            else
                            {
                                value = firstItem;
                            }
                        }
                        else
                        {
                            value = "";
                        }
                    }
                }

                EcellData ecellData = CreateEcellData(name, new EcellValue(value), entityPath, flag);
                if (ecellData.Value != null)
                {
                    ecellData.Logable = ecellData.Value.IsDouble;
                }
                if (storedEcellDataDic.ContainsKey(name))
                {
                    ecellData.Logged = storedEcellDataDic[name].Logged;
                    systemEcellDataList.Remove(storedEcellDataDic[name]);
                }
                systemEcellDataList.Add(ecellData);
            }

            ecellObject.SetEcellDatas(systemEcellDataList);
        }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:98,代码来源:DataStorer.cs


示例5: DataStored4Process

        /// <summary>
        /// Stores the "EcellObject" 4 the "Process".
        /// </summary>
        /// <param name="simulator">The simulator</param>
        /// <param name="dmm">The "DMDescriptorKeeper"</param>
        /// <param name="ecellObject">The stored "Process"</param>
        /// <param name="initialCondition">The initial condition.</param>
        internal static void DataStored4Process(
            WrappedSimulator simulator,
            DMDescriptorKeeper dmm,
            EcellObject ecellObject,
            Dictionary<string, double> initialCondition)
        {
            string key = ecellObject.FullID;
            IList<string> wrappedPolymorph = null;
            try
            {
                wrappedPolymorph = simulator.GetEntityPropertyList(key);
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
                return;
            }
            //
            // Checks the stored "EcellData"
            //
            List<EcellData> processEcellDataList = new List<EcellData>();
            Dictionary<string, EcellData> storedEcellDataDic = new Dictionary<string, EcellData>();

            if (ecellObject.Value != null && ecellObject.Value.Count > 0)
            {
                foreach (EcellData storedEcellData in ecellObject.Value)
                {
                    storedEcellDataDic[storedEcellData.Name] = storedEcellData;
                    processEcellDataList.Add(storedEcellData);

                }
            }
            //
            // Stores the "EcellData"
            //
            foreach (string name in wrappedPolymorph)
            {
                string entityPath = Util.BuildFullPN(key, name);

                PropertyAttributes flag = simulator.GetEntityPropertyAttributes(entityPath);
                if (!flag.Gettable)
                {
                    continue;
                }
                EcellValue value = null;

                if (name == Constants.xpathVRL)
                {
                    // Won't restore the variable reference list from the simulator's corresponding
                    // object.
                    if (storedEcellDataDic.ContainsKey(name))
                        value = storedEcellDataDic[name].Value;
                    else
                        value = new EcellValue(new List<object>());
                }
                else if (name == Constants.xpathActivity || name == Constants.xpathMolarActivity)
                {
                    value = new EcellValue(0.0);
                }
                else
                {
                    try
                    {
                        value = new EcellValue(simulator.GetEntityProperty(entityPath));
                        if (dmm.ContainsDescriptor(ecellObject.Type, ecellObject.Classname))
                        {
                            DMDescriptor desc = dmm.GetDMDescriptor(ecellObject.Type, ecellObject.Classname);
                            if (desc.ContainsProperty(name))
                            {
                                PropertyDescriptor prop = desc[name];
                                if (prop.DefaultValue.Type == EcellValueType.List && !value.IsList)
                                    value = new EcellValue(new List<EcellValue>());
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Trace.WriteLine(ex);
                        value = GetValueFromDMM(dmm, ecellObject.Type, ecellObject.Classname, name);
                    }
                }
                EcellData ecellData = CreateEcellData(name, value, entityPath, flag);
                if (ecellData.Value != null)
                {
                    ecellData.Logable = ecellData.Value.IsDouble &&
                        (ecellData.Settable == false || ecellData.Saveable == false);

                }

                if (storedEcellDataDic.ContainsKey(name))
                {
                    ecellData.Logged = storedEcellDataDic[name].Logged;
                    processEcellDataList.Remove(storedEcellDataDic[name]);
//.........这里部分代码省略.........
开发者ID:ecell,项目名称:ecell3-ide,代码行数:101,代码来源:DataStorer.cs


示例6: 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 (m_current == null)
         return;
     if (m_isChanging)
     {
         if (m_current.Key == key)
         {
             m_current = data;
             UpdateProperties();
         }
         return;
     }
     if (m_current.ModelID == modelID && m_current.Key == key && m_current.Type == type)
     {
         m_current = data;
         ReloadProperties();
     }
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:26,代码来源:PropertyWindow.cs


示例7: ChangeStatus

 /// <summary>
 ///  When change system status, change menu enable/disable.
 /// </summary>
 /// <param name="type">System status.</param>
 public void ChangeStatus(ProjectStatus type)
 {
     if (type == ProjectStatus.Running)
     {
         m_dgv.ReadOnly = true;
     //                m_dgv.Enabled = false;
         m_time.Enabled = true;
         m_time.Start();
     }
     else if (type == ProjectStatus.Suspended)
     {
         m_dgv.ReadOnly = false;
     //                m_dgv.Enabled = true;
         m_time.Enabled = false;
         m_time.Stop();
         try
         {
             UpdatePropForSimulation();
             ResetReadOnly();
         }
         catch (Exception)
         {
             // ���̃v���O�C���Ńf�[�^��ҏW������
             // �V�~�����[�V�������ُ�I���������f�[�^��擾�ł��Ȃ��������߁B
             // ���̃v���O�C���ŃG���[���b�Z�[�W���\�������̂�
             // �����ł͏o���Ȃ��悤�ɂ���B
         }
     }
     else if (type == ProjectStatus.Loaded)
     {
     //                m_dgv.Enabled = true;
         m_dgv.ReadOnly = false;
         if (m_status == ProjectStatus.Running || m_status == ProjectStatus.Suspended || m_status == ProjectStatus.Stepping)
         {
             m_time.Enabled = false;
             m_time.Stop();
             if (m_current != null)
                 m_current = m_env.DataManager.GetEcellObject(m_current.ModelID, m_current.Key, m_current.Type);
             ResetProperty();
             ResetReadOnly();
         }
     }
     else if (type == ProjectStatus.Uninitialized)
     {
         m_dgv.ReadOnly = true;
     //                m_dgv.Enabled = false;
     }
     else if (type == ProjectStatus.Stepping)
     {
         m_dgv.ReadOnly = false;
     //                m_dgv.Enabled = true;
         try
         {
             UpdatePropForSimulation();
             ResetReadOnly();
         }
         catch (Exception)
         {
             // ���̃v���O�C���Ńf�[�^��ҏW������
             // �V�~�����[�V�������ُ�I���������f�[�^��擾�ł��Ȃ��������߁B
             // ���̃v���O�C���ŃG���[���b�Z�[�W���\�������̂�
             // �����ł͏o���Ȃ��悤�ɂ���B
         }
     }
     m_status = type;
     m_dgv.ReadOnly = false;
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:71,代码来源:PropertyWindow.cs


示例8: DataChangeAction

 /// <summary>
 /// The constructor for DataChangeAction with initial parameters.
 /// </summary>
 /// <param name="paramID">A parameter ID.</param>
 /// <param name="oldObj">An object before changing.</param>
 /// <param name="newObj">An object after changing.</param>
 public DataChangeAction(string paramID, EcellObject oldObj, EcellObject newObj)
 {
     m_paramID = paramID;
     m_oldObj = oldObj.Clone();
     m_newObj = newObj.Clone();
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:12,代码来源:DataChangeAction.cs


示例9: DataAdd

 /// <summary>
 /// Add the object.
 /// </summary>
 /// <param name="data">the added object.</param>
 public override void DataAdd(EcellObject data)
 {
     m_editCount++;
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:8,代码来源:StaticDebugWindow.cs


示例10: ObjectPropertyReport

 /// <summary>
 /// Constructor with the initial parameters.
 /// </summary>
 /// <param name="type">the type of message.</param>
 /// <param name="message">the message string.</param>
 /// <param name="group">the group string.</param>
 /// <param name="obj">the object of message.</param>
 /// <param name="propertyName">the proerty name.</param>
 public ObjectPropertyReport(MessageType type, string message, 
     string group, EcellObject obj, string propertyName)
     : base(type, message, group, obj)
 {
     m_propName = propertyName;
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:14,代码来源:ObjectPropertyReport.cs


示例11: AddIntoDictionary

 private void AddIntoDictionary(SortedDictionary<float, List<EcellObject>> dict,
     float posValue,
     EcellObject node)
 {
     if (dict == null)
         return;
     if (dict.ContainsKey(posValue))
         dict[posValue].Add(node);
     else
     {
         List<EcellObject> newDict = new List<EcellObject>();
         newDict.Add(node);
         dict.Add(posValue, newDict);
     }
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:15,代码来源:DistributeLayout.cs


示例12: SetInitialCondition

        /// <summary>
        /// Set initial condition of new object.
        /// </summary>
        /// <param name="newobj">the new object.</param>
        public void SetInitialCondition(EcellObject newobj)
        {
            EcellObject defaultObj = GetEcellObject(newobj.ModelID,
                newobj.Type, newobj.Key, true);

            foreach (EcellData newData in newobj.Value)
            {
                EcellData defaultData = defaultObj.GetEcellData(newData.Name);
                if (defaultData == null)
                    continue;
                defaultData.Logged = newData.Logged;
                if (!newData.Settable || (newData.Value == null || (!newData.Value.IsDouble && !newData.Value.IsInt)))
                {
                    defaultObj.RemoveEcellValue(newData.Name);
                    defaultObj.Value.Add(newData);
                    continue;
                }
                double newProp = Convert.ToDouble(newData.Value.Value.ToString());
                double defaultProp = Convert.ToDouble(defaultData.Value.Value.ToString());
                if (newProp != defaultProp)
                {
                    InitialCondition[Info.SimulationParam][newobj.ModelID][newData.EntityPath] = newProp;
                }
                else
                {
                    InitialCondition[Info.SimulationParam][newobj.ModelID].Remove(newData.EntityPath);
                }
            }

            defaultObj.Layout = newobj.Layout.Clone();
        }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:35,代码来源:Project.cs


示例13: DeleteSystem

 /// <summary>
 /// Delete System.
 /// </summary>
 /// <param name="system">the system object.</param>
 public void DeleteSystem(EcellObject system)
 {
     string type, ekey, param;
     m_systemDic[system.ModelID].Remove(system);
     // Delete Simulation parameter.
     foreach (string keyParamID in m_initialCondition.Keys)
     {
         foreach (string delModel in m_initialCondition[keyParamID].Keys)
         {
             Debug.Assert(system.Type == Constants.xpathSystem);
             string delKey = system.Key;
             List<String> delKeyList = new List<string>();
             foreach (string entKey in m_initialCondition[keyParamID][delModel].Keys)
             {
                 Util.ParseFullPN(entKey, out type, out ekey, out param);
                 if (ekey.Equals(delKey) || ekey.StartsWith(delKey + "/") || ekey.StartsWith(delKey + ":"))
                     delKeyList.Add(entKey);
             }
             foreach (string entKey in delKeyList)
             {
                 m_initialCondition[keyParamID][delModel].Remove(entKey);
             }
         }
     }
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:29,代码来源:Project.cs


示例14: DeleteInitialCondition

 /// <summary>
 /// Delete the initial condition of object.
 /// </summary>
 /// <param name="obj">the deleted object.</param>
 public void DeleteInitialCondition(EcellObject obj)
 {
     string modelID = obj.ModelID;
     foreach (String simParam in InitialCondition.Keys)
     {
         foreach (EcellData d in obj.Value)
         {
             if (InitialCondition[simParam][modelID].ContainsKey(d.EntityPath))
                 InitialCondition[simParam][modelID].Remove(d.EntityPath);
         }
     }
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:16,代码来源:Project.cs


示例15: DeleteEntity

        /// <summary>
        /// Delete Entity.
        /// </summary>
        /// <param name="entity">the entity object.</param>
        public void DeleteEntity(EcellObject entity)
        {
            // set param
            string model = entity.ModelID;
            string key = entity.Key;
            string sysKey = entity.ParentSystemID;
            string type = entity.Type;
            // delete entity
            foreach (EcellObject system in m_systemDic[entity.ModelID])
            {
                if (!system.Key.Equals(sysKey))
                    continue;
                foreach (EcellObject child in system.Children)
                {
                    if (!child.Key.Equals(key) || !child.Type.Equals(type))
                        continue;
                    system.Children.Remove(child);
                    break;
                }
            }

            // Delete Simulation parameter.
            foreach (string keyParameterID in m_initialCondition.Keys)
            {
                Dictionary<string, double> condition = m_initialCondition[keyParameterID][model];
                foreach (EcellData data in entity.Value)
                {
                    if (!data.Settable)
                        continue;
                    if (!condition.ContainsKey(data.EntityPath))
                        continue;
                    condition.Remove(data.EntityPath);
                }
            }
        }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:39,代码来源:Project.cs


示例16: NotifyDataAdd

 /// <summary>
 /// Notify DataAdd event to outside.
 /// </summary>
 /// <param name="eo">Added EcellObject</param>
 /// <param name="isAnchor">Whether this action is an anchor or not</param>
 public void NotifyDataAdd(EcellObject eo, bool isAnchor)
 {
     try
     {
         m_window.NotifyDataAdd(eo, isAnchor);
     }
     catch (Exception e)
     {
         Debug.WriteLine(e.Message);
     }
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:16,代码来源:PathwayControl.cs


示例17: NotifyDataChanged

 /// <summary>
 /// Notify DataChanged event to outside (PathwayControl -> PathwayWindow -> DataManager)
 /// To notify position or size change.
 /// </summary>
 /// <param name="oldKey">the key before adding.</param>
 /// <param name="eo">Changed EcellObject.</param>
 /// <param name="isRecorded">Whether to record this change.</param>
 /// <param name="isAnchor">Whether this action is an anchor or not.</param>
 public void NotifyDataChanged(
     string oldKey,
     EcellObject eo,
     bool isRecorded,
     bool isAnchor)
 {
     m_unreachedFlag = true;
     m_window.NotifyDataChanged(oldKey, eo, isRecorded, isAnchor);
     if (m_unreachedFlag)
         throw new PathwayException("Unreached DataChangedEvent.");
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:19,代码来源:PathwayControl.cs


示例18: DataChanged

 /// <summary>
 /// Change the property of object.
 /// </summary>
 /// <param name="modelID">the model ID of changed object.</param>
 /// <param name="key">the key of changed object.</param>
 /// <param name="type">the type of changed object.</param>
 /// <param name="data">the changed object.</param>
 public override void DataChanged(string modelID, string key, string type, EcellObject data)
 {
     m_editCount++;
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:11,代码来源:StaticDebugWindow.cs


示例19: NotifyDataChanged

 /// <summary>
 /// Change the property of data. 
 /// </summary>
 /// <param name="modelID">the modelID of object changed property.</param>
 /// <param name="key">the key of object changed property.</param>
 /// <param name="obj">the object changed property.</param>
 private bool NotifyDataChanged(string modelID, string key, EcellObject obj)
 {
     bool changeSuccess = true;
     m_isChanging = true;
     try
     {
         m_env.DataManager.DataChanged(modelID, key, obj.Type, obj);
         if (obj != m_current)
         {
             if (m_status == ProjectStatus.Suspended || m_status == ProjectStatus.Stepping)
             {
                 UpdatePropForSimulation();
             }
             else
             {
                 UpdateProperties();
             }
             changeSuccess = false;
         }
     }
     finally
     {
         m_isChanging = false;
     }
     return changeSuccess;
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:32,代码来源:PropertyWindow.cs


示例20: NotifyDataDelete

 /// <summary>
 /// Notify DataDelete event to outsite.
 /// </summary>
 /// <param name="eo">the deleted object.</param>
 /// <param name="isAnchor">the type of deleted object.</param>
 public void NotifyDataDelete(EcellObject eo, bool isAnchor)
 {
     try
     {
         m_window.NotifyDataDelete(eo.ModelID, eo.Key, eo.Type, isAnchor);
     }
     catch (Exception e)
     {
         Util.ShowErrorDialog(e.Message);
         Debug.WriteLine(e.Message);
     }
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:17,代码来源:PathwayControl.cs



注:本文中的Ecell.Objects.EcellObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NET.Context类代码示例发布时间:2022-05-24
下一篇:
C# Model.WF_ModleRecordWorkTaskIns类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap