예제 #1
0
        /// <summary>
        /// Deep Clone
        /// </summary>
        /// <returns></returns>
        public IDSLoop Copy()
        {
            IDSLoop loop = MemberwiseClone() as IDSLoop;

            loop.SubLoops = this.SubLoops.Copy();

            return(loop);
        }
예제 #2
0
        public IDSSubLoop(IDSLoop loop)
        {
            ID              = "";
            ParentID        = "";
            _loop           = loop;
            Code            = "";
            Name            = "";
            Phase           = "";
            SerialNumber    = "";
            Description     = "";
            IsNameInSubLoop = false;
            IsNameInFront   = false;

            Equipments        = new IDSEquipmentCollection();
            EquipingLocations = new IDSEquipingLocationCollection();
            IOSignals         = new IDSIOSignalCollection();
        }
예제 #3
0
        public static IDSLoop CreateIDSLoop(DataRow rowLoop,
                                            string subSystemCode,
                                            string systemCode,
                                            string subSystemName,
                                            DataTable tableHierarchy,
                                            DataTable tableEquipment,
                                            DataTable tableSubEquipment,
                                            DataTable tableRepositories,
                                            DataTable tableCable,
                                            DataTable tableMountingScheme)
        {
            if (rowLoop == null)
            {
                throw new System.ArgumentNullException("frome function CreateIDSLoop", "Parameter rowLoop equals to null");
            }

            IDSLoop loop = new IDSLoop();

            lock (rowLoop) {
                try {
                    loop.ID       = Convert.ToString(rowLoop[TblIDSLoop.ID]).Trim();
                    loop.ParentID = Convert.ToString(rowLoop[TblIDSLoop.ParentID]).Trim();

                    loop.LoopType     = (rowLoop[TblIDSLoop.LoopType] as string).Trim();
                    loop.SerialNumber = (rowLoop[TblIDSLoop.SerialNumber] as string).Trim();
                    loop.Suffix       = (rowLoop[TblIDSLoop.Suffix] as string).Trim();

                    loop.Tag = systemCode + "." + loop.LoopType + "-" + subSystemCode + loop.SerialNumber + loop.Suffix;

                    loop.Location           = subSystemName + (rowLoop[TblIDSLoop.Location] as string).Trim();
                    loop.Medium             = (rowLoop[TblIDSLoop.Medium] as string).Trim();
                    loop.Parameter          = (rowLoop[TblIDSLoop.Parameter] as string).Trim();
                    loop.NormalTemperature  = (rowLoop[TblIDSLoop.NormalTemperature] as string).Trim();
                    loop.UplimitTemperature = (rowLoop[TblIDSLoop.UplimitTemperature] as string).Trim();
                    loop.NormalPressure     = (rowLoop[TblIDSLoop.NormalPressure] as string).Trim();
                    loop.UplimitPressure    = (rowLoop[TblIDSLoop.UplimitPressure] as string).Trim();
                    loop.PressureUnit       = (rowLoop[TblIDSLoop.PressureUnit] as string).Trim();
                    loop.PipeMaterial       = (rowLoop[TblIDSLoop.PipeMaterial] as string).Trim();
                    loop.DN = (rowLoop[TblIDSLoop.DN] as string).Trim();
                    loop.ContainerMaterial  = (rowLoop[TblIDSLoop.ContainerMaterial] as string).Trim();
                    loop.HasInnerLining     = Convert.ToBoolean(rowLoop[TblIDSLoop.HasInnerLining]);
                    loop.AmbientTemperature = (rowLoop[TblIDSLoop.AmbientTemperature] as string).Trim();
                    loop.AmbientExLevel     = (rowLoop[TblIDSLoop.AmbientExLevel] as string).Trim();
                    loop.MediumExLevel      = (rowLoop[TblIDSLoop.MediumExLevel] as string).Trim();
                    loop.MeasurementRange   = (rowLoop[TblIDSLoop.MeasurementRange] as string).Trim();
                    loop.ProcessRange       = (rowLoop[TblIDSLoop.ProcessRange] as string).Trim();
                    loop.Unit        = (rowLoop[TblIDSLoop.Unit] as string).Trim();
                    loop.Function    = (rowLoop[TblIDSLoop.Function] as string).Trim();
                    loop.Description = (rowLoop[TblIDSLoop.Description] as string).Trim();
                    loop.Source      = (rowLoop[TblIDSLoop.Source] as string).Trim();

                    loop.SubLoops.Clear();
                    lock (tableHierarchy) {
                        foreach (DataRow rowSubLoop in tableHierarchy.Rows)
                        {
                            if (Convert.ToString(rowSubLoop[TblIDSHierarchy.ParentID]).Trim() == loop.ID &&
                                Convert.ToString(rowSubLoop[TblIDSHierarchy.Type]).Trim() == IDSEnumSystemType.SubLoop)
                            {
                                loop.SubLoops.Add(CreateIDSSubLoop(rowSubLoop,
                                                                   loop.LoopType,
                                                                   loop.SerialNumber,
                                                                   loop.Suffix,
                                                                   subSystemCode,
                                                                   systemCode,
                                                                   loop.Location,
                                                                   tableEquipment,
                                                                   tableSubEquipment,
                                                                   tableRepositories,
                                                                   tableCable,
                                                                   tableMountingScheme));
                            }
                        }
                    }
                }
                catch (System.Data.DataException ex) {
                    MessageBoxWinForm.Info("数据访问错误", ex.Message, "");
                }
            }

            return(loop);
        }