public void StationComponentInitialize(StationComponent stationComponent, StationScheme stationScheme)
 {
     foreach (var schemeComponent in stationScheme.stationChemeComponents)
     {
         if (stationComponent.ComponentType.Equals(schemeComponent.Key) && schemeComponent.Value.Item3.Length > 0)
         {
             stationComponent.RotationComponentArray     = schemeComponent.Value.Item3;
             stationComponent.IsComponentForPressureLine = schemeComponent.Value.Item4;
         }
         else if (stationComponent.ComponentType.Equals(schemeComponent.Key))
         {
             stationComponent.RotationComponentArray     = new int[] { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
             stationComponent.IsComponentForPressureLine = schemeComponent.Value.Item4;
         }
     }
 }
        public static string GetComponentsPathByType(ComponentsLocationPaths componentsLocation, StationComponent component)
        {
            string[] s1 = component.ComponentType.ToString().Split('_');

            if (s1[0].Equals("КВ") || s1[0].Equals("КН"))
            {
                return(componentsLocation.componentsLocationPaths["collectorsPath"] + (component.ComponentType.Equals(StationComponentTypeEnum.КВ_коллектор_всасывающий)
                    ? componentsLocation.componentsLocationPaths["suctionCollectorsPath"] : componentsLocation.componentsLocationPaths["pressureCollectorsPath"]));
            }
            else if (s1[0].Equals("ОКФ") || s1[0].Equals("ОКР"))
            {
                return(componentsLocation.componentsLocationPaths["checkValvesPath"] + (component.ComponentType.Equals(StationComponentTypeEnum.ОКФ_обратный_клапан_фланцевый)
                    ? componentsLocation.componentsLocationPaths["flangeCheckValvesPath"] : componentsLocation.componentsLocationPaths["carveCheckValvesPath"]));
            }
            else if (s1[0].Equals("ЗД") || s1[0].Equals("РК"))
            {
                return(componentsLocation.componentsLocationPaths["lockValvesPath"] + (component.ComponentType.Equals(StationComponentTypeEnum.К_резьбовой_кран_2) || component.ComponentType.Equals(StationComponentTypeEnum.К_резьбовой_кран_1)
                    ? componentsLocation.componentsLocationPaths["carvesValvesPath"] : componentsLocation.componentsLocationPaths["shuttersPath"]));
            }
            else if (s1[0].Equals("ТВ") || s1[0].Equals("ТН"))
            {
                return(componentsLocation.componentsLocationPaths["teesPath"] + (component.ComponentType.Equals(StationComponentTypeEnum.ТВ_тройник_всасывающий_1) || component.ComponentType.Equals(StationComponentTypeEnum.ТВ_тройник_всасывающий_2)
                    ? componentsLocation.componentsLocationPaths["suctionTeesPath"] : componentsLocation.componentsLocationPaths["pressureTeesPath"]));
            }
            else if (s1[0].Equals("ШУ"))
            {
                return(componentsLocation.componentsLocationPaths["controlCabinetsPath"]);
            }
            else if (s1[0].Equals("КЭ") || s1[0].Equals("КЭР") || s1[0].Equals("КК") || s1[0].Equals("ККР") || s1[0].Equals("К") ||
                     s1[0].Equals("КР") || s1[0].Equals("КВЖ") || s1[0].Equals("КНЖ"))
            {
                string localPath = string.Empty;
                if (s1[0].Equals("КЭ"))
                {
                    localPath = componentsLocation.componentsLocationPaths["essentricCoilsPath"];
                }
                if (s1[0].Equals("КЭР"))
                {
                    localPath = componentsLocation.componentsLocationPaths["essentricCoilsPathWithNippel"];
                }
                if (s1[0].Equals("КК"))
                {
                    localPath = componentsLocation.componentsLocationPaths["concentricCoilsPath"];
                }
                if (s1[0].Equals("ККР"))
                {
                    localPath = componentsLocation.componentsLocationPaths["concentricCoilsWithNippelPath"];
                }
                if (s1[0].Equals("К"))
                {
                    localPath = componentsLocation.componentsLocationPaths["simpleCoilsPath"];
                }
                if (s1[0].Equals("КР"))
                {
                    localPath = componentsLocation.componentsLocationPaths["simpleCoilsWithNippelPath"];
                }
                if (s1[0].Equals("КВЖ"))
                {
                    localPath = componentsLocation.componentsLocationPaths["jockeySuctionCoils"];
                }
                if (s1[0].Equals("КНЖ"))
                {
                    localPath = componentsLocation.componentsLocationPaths["jockeyPressureCoils"];
                }

                return(componentsLocation.componentsLocationPaths["coilsPath"] + localPath);
            }
            else if (s1[0].Equals("Рама"))
            {
                Frame frame = (Frame)component;
                return(componentsLocation.componentsLocationPaths["framesPath"] + (frame.FrameType.Equals(FrameTypesEnum.StandartRottenFrame)
                    ? componentsLocation.componentsLocationPaths["weldedFramesPath"] : componentsLocation.componentsLocationPaths["framesFromShvellerPath"]));
            }
            else if (s1[0].Equals("ФланецСРеле"))
            {
                return(componentsLocation.componentsLocationPaths["flangesWithReley"]);
            }
            else if (s1[0].Equals("ФланцевыйПереход"))
            {
                return(componentsLocation.componentsLocationPaths["flangeOnCarveTransitionPath"]);
            }
            else if (s1[0].Equals("НиппельНН"))
            {
                return(componentsLocation.componentsLocationPaths["nippelsPath"]);
            }
            else if (s1[0].Equals("Американка"))
            {
                return(componentsLocation.componentsLocationPaths["screwFittingsPath"]);
            }

            return(string.Empty);
        }
 public static string GetComponentsPathByType(ComponentsLocationPaths componentsLocation, string pumpName, StationComponent component)
 {
     string[] startMainPumpsNameChars = pumpName.Split('_');
     return(componentsLocation.componentsLocationPaths["pumpsPath"] + startMainPumpsNameChars[0] + @"\");
 }
 public static string GetFullPathToTheComponent(ComponentsLocationPaths componentsLocation, string pumpName,
                                                StationComponent component)
 {
     return(String.Format(componentsLocation.componentsLocationPaths["mainDirPath"] +
                          GetComponentsPathByType(componentsLocation, pumpName, component) + component.ComponentName + ".SLDPRT"));
 }