Exemple #1
0
        private void SetDisplayTextForBoxedDevice(BoxedDevice boxedDevice, string dtTextPrefix, int dtTextIndex)
        {
            string dtText = string.Format("{0}_{1,3:D3}", dtTextPrefix, dtTextIndex);

            boxedDevice.Name        = dtText;
            boxedDevice.VisibleName = dtText;
            boxedDevice.Properties[Properties.Function.FUNC_TECHNICAL_CHARACTERISTIC] = string.Format("BlackBox_기술특성_{0}", dtTextPrefix);
        }
        public static string InsertDevice(ref Page refPage, EplDeviceProperties deviceProperties)
        {
            string msg = EplDefinition.EPL_INSERT_DEVICE.ToString();

            try
            {
                using (LockingStep oLS = new LockingStep())
                {
                    refPage.Project.LockAllObjects();
                    BoxedDevice   oBoxedDevice = new BoxedDevice();
                    string        slib         = string.IsNullOrEmpty(deviceProperties.SymbolLibraryName) ? "GB_symbol" : deviceProperties.SymbolLibraryName;
                    SymbolLibrary sLibrary     = new SymbolLibrary(refPage.Project, slib);
                    Symbol        s            = new Symbol(sLibrary, deviceProperties.SymbolName);
                    SymbolVariant sv           = new SymbolVariant();
                    sv.Initialize(s, 0);
                    oBoxedDevice.Create(refPage);
                    oBoxedDevice.SymbolVariant = sv;
                    //oBoxedDevice.Properties.FUNC_DES = deviceProperties.SymbolDescription;
                    if (!string.IsNullOrEmpty(deviceProperties.PartName))
                    {
                        oBoxedDevice.AddArticleReference(deviceProperties.PartName);
                    }
                    oBoxedDevice.VisibleName                 = deviceProperties.DisplayText;
                    oBoxedDevice.Properties.FUNC_TEXT        = deviceProperties.FunctionText;
                    oBoxedDevice.Location                    = deviceProperties.Location;
                    oBoxedDevice.Properties.FUNC_GRAVINGTEXT = deviceProperties.EngravingText;
                    oBoxedDevice.Properties.FUNC_TECHNICAL_CHARACTERISTIC = deviceProperties.Characteristics;
                    if (deviceProperties.ConnectionDesignations != null)
                    {
                        for (int i = 0; i < deviceProperties.ConnectionDesignations.Length; i++)
                        {
                            oBoxedDevice.Properties.FUNC_CONNECTIONDESIGNATION[i + 1] = deviceProperties.ConnectionDesignations[i];
                            if (deviceProperties.ConnectionPointDescription != null)
                            {
                                if (deviceProperties.ConnectionPointDescription.Length > i)
                                {
                                    oBoxedDevice.Properties.FUNC_CONNECTIONDESCRIPTION[i + 1] = deviceProperties.ConnectionPointDescription[i];
                                }
                            }
                        }
                    }
                    oBoxedDevice.Properties.FUNC_MOUNTINGLOCATION = deviceProperties.MountingSite;
                }
            }
            catch (Exception ex)
            {
                EplException("Insert device error.", ex);
                msg = EplError.EPL_ERROR.ToString();
            }
            return(msg);
        }
Exemple #3
0
        private void AddLandPanel(Page page, string macroPath, int nVariant, double x, double y, Data.MvFeeder feeder)
        {
            StorableObject[] sos = Util.eplan.AddGraphicMacro(page, macroPath, nVariant, x, _origin.Y);
            foreach (StorableObject so in sos)
            {
                BoxedDevice bd = so as BoxedDevice;
                if (bd == null)
                {
                    continue;
                }

                bd.Name = bd.Name.Substring(0, bd.Name.IndexOf("=") + 1) + feeder.FeederNo + bd.Name.Substring(bd.Name.IndexOf("+"));
                break;
            }
        }
Exemple #4
0
        private void AddToSelections(MouseEventArgs e)
        {
            if (this._singleline == null)
            {
                return;
            }
            if (this.SelectedSymbols == null)
            {
                this.SelectedSymbols = new List <Data.Symbol>();
            }

            Point point = GetCurrentLocation(e.X, e.Y);

            BoxedDevice bd = Util.eplan.GetBoxedDevice(this._singleline.Page, point);

            if (bd != null)
            {
                this.SelectedSymbols.Add(new Data.Symbol(bd));
            }

            toolStripLabel1.Text = this.SelectedSymbols.Count.ToString() + "개가 선택됨";
        }