public void Vertex()
        {
            //Nuevo ObjectId
            ObjectId objid = new ObjectId();

            //Obtengo la entidad que es polilínea
            Met_Autodesk.Entity("Selecciona Polilinea", out objid, typeof(Polyline));

            //Abro entidad y la convierto en Polilinea
            Polyline pl = objid.OpenEntity() as Polyline;

            List <Point3d> listPoints = pl.ClockwisePoints();

            for (int i = 0; i < listPoints.Count; i++)
            {
                ////Punto A
                Point3d ptActual = listPoints[i];

                int idxPtActual = Met_Autodesk.GetPointIndex(pl, ptActual);

                SegmentType seg = pl.GetSegmentType(idxPtActual);

                string.Format("El Seg {0}:{1} en el punto X:{2} y Y:{3}\n",
                              seg.ToString(), i + 1, Math.Round(ptActual.X, 2), Math.Round(ptActual.Y, 2)).ToEditor();
            }
        }
예제 #2
0
 public void Describe()
 {
     Console.WriteLine("{0} PROGRAM HEADER", Type.ToString().ToUpperInvariant());
     Console.WriteLine("Data Offset: {0,8:X}  Data Size: {1}B", ImageOffset, SegmentImageSize);
     Console.WriteLine("Virt Address: {0,8:X}   Phys Address: {1,8:X}", InMemVirtualAddress, InMemPhysicalAddress);
     Console.WriteLine("Loaded Image Size: {0}B  Alignment: {1}B", SegmentInMemSize, Math.Pow(Alignment, 2));
     Console.WriteLine("Flags: {0}", Flags);
 }
예제 #3
0
        public static Field getFieldByPos(HL7Message message,
                                          SegmentType segmentType,
                                          int position,
                                          int segmentOrder = -1)
        {
            Field          f        = new Field();
            List <Segment> segments = new List <Segment>();

            try
            {
                if (segmentOrder == NEG_ONE)
                {
                    segments = message.segments.FindAll(x => x.segmentType == segmentType);
                }
                else
                {
                    segments = message.segments.FindAll(x => x.segmentType == segmentType &&
                                                        x.fields[FIRST_ELEMENT].value == segmentOrder.ToString());
                }

                int fieldIndex = NEG_ONE;
                foreach (Segment s in segments)
                {
                    if (fieldIndex == NEG_ONE)
                    {
                        fieldIndex = s.fields.FindIndex(x => x.position == position);
                        // adding to avoid bad locations
                        if (fieldIndex == NEG_ONE && segmentType == SegmentType.PV1 && position == 11)
                        {
                            // build empty location
                            f = HL7MessageUtility.getEmptyLocationNotFound();
                        }
                        else
                        {
                            f = s.fields[fieldIndex];
                        }
                    }
                }
            }
            catch (Exception e)
            {
                List <string> parameters = new List <string>();

                parameters.Add(message.segments.Count.ToString());
                parameters.Add(segmentType.ToString());
                parameters.Add(position.ToString());
                parameters.Add(segmentOrder.ToString());

                ErrorLogger.LogError(e, "Field.getFieldByPos(HL7Message message, SegmentType segmentType, int position, int segmentOrder = -1)"
                                     , String.Join(Generic.PIPE.ToString(), parameters.ToArray()));
            }

            return(f);
        }
        public SettingsResponse GetSegmentInfo(int accountId, SegmentType segmentType)
        {
            var list = new List <SegmentInfo>();

            for (var i = 0; i < 20; i++)
            {
                list.Add(new SegmentInfo {
                    Id = i, Name = String.Format("{0} #{1}", segmentType.ToString(), i)
                });
            }

            return(new SettingsResponse {
                SegmentList = list
            });
        }
예제 #5
0
 /// <summary>
 /// Returns the name of the segment register.
 /// </summary>
 /// <returns>The name of the segment register.</returns>
 public override string ToString()
 {
     return(segment.ToString());
 }
 public ISubscriberState GetSubscriberStateBySegmentType(SegmentType segmentType)
 {
     return _subscriberStates.FirstOrDefault(x => x.SegmentType == segmentType.ToString());
 }