Beispiel #1
0
 // Cellrefarrays also have to resolve to integer placement.
 // Placement errors will occur if the x, y instance counts do not divide the array X, Y values cleanly.
 private void pSaveGDS(gdsWriter gw)
 {
     //SRef
     gw.bw.Write((ushort)4);
     gw.bw.Write((byte)0x0B);
     gw.bw.Write((byte)0);
     gw.writeString(cell_ref.cellName, 0x12);
     int strans_ = 0;
     switch (trans.mirror_x)
     {
         case true:
             strans_ |= 0x8000;
             break;
     }
     //STRANS
     gw.bw.Write((ushort)6);
     gw.bw.Write((byte)0x1A);
     gw.bw.Write((byte)1);
     gw.bw.Write((short)strans_);
     //mag
     gw.bw.Write((ushort)12);
     gw.bw.Write((byte)0x1B);
     gw.bw.Write((byte)5);
     gw.write8ByteReal(trans.mag);
     //angle
     gw.bw.Write((ushort)12);
     gw.bw.Write((byte)0x1C);
     gw.bw.Write((byte)5);
     switch (trans.mirror_x)
     {
         case true when trans.angle != 0:
             gw.write8ByteReal(360 - trans.angle);
             break;
         default:
             gw.write8ByteReal(trans.angle);
             break;
     }
     //colrow
     gw.bw.Write((ushort)8);
     gw.bw.Write((byte)0x13);
     gw.bw.Write((byte)2);
     gw.bw.Write((short)count_x);
     gw.bw.Write((short)count_y);
     //xy
     gw.bw.Write((ushort)(3 * 2 * 4 + 4));
     gw.bw.Write((byte)0x10);
     gw.bw.Write((byte)3);
     gw.bw.Write(point.X);
     gw.bw.Write(point.Y);
     GeoLibPoint pos = new(pitch.X * count_x + point.X, pitch.Y + point.Y);
     gw.bw.Write(pos.X);
     gw.bw.Write(pos.Y);
     pos = new GeoLibPoint(pitch.X * +point.X, pitch.Y * count_y + point.Y);
     gw.bw.Write(pos.X);
     gw.bw.Write(pos.Y);
     // endel
     gw.bw.Write((ushort)4);
     gw.bw.Write((byte)0x11);
     gw.bw.Write((byte)0);
 }
Beispiel #2
0
 private void pSaveGDS(gdsWriter gw)
 {
     switch (cell_ref)
     {
         // Guard against incoming broken cellref information
         case null:
             return;
     }
     //SRef
     gw.bw.Write((ushort)4);
     gw.bw.Write((byte)0x0A);
     gw.bw.Write((byte)0);
     gw.writeString(cell_ref.cellName, 0x12);
     int strans_ = 0;
     switch (trans.mirror_x)
     {
         case true:
             strans_ |= 32768;
             break;
     }
     //STRANS
     gw.bw.Write((ushort)6);
     gw.bw.Write((byte)0x1A);
     gw.bw.Write((byte)1);
     gw.bw.Write((short)strans_);
     //mag
     gw.bw.Write((ushort)12);
     gw.bw.Write((byte)0x1B);
     gw.bw.Write((byte)5);
     gw.write8ByteReal(trans.mag);
     //angle
     gw.bw.Write((ushort)12);
     gw.bw.Write((byte)0x1C);
     gw.bw.Write((byte)5);
     switch (trans.mirror_x)
     {
         case true when trans.angle != 0:
             gw.write8ByteReal(360 - trans.angle);
             break;
         default:
             gw.write8ByteReal(trans.angle);
             break;
     }
     //xy
     gw.bw.Write((ushort)(2 * 4 + 4));
     gw.bw.Write((byte)0x10);
     gw.bw.Write((byte)3);
     gw.bw.Write(point.X);
     gw.bw.Write(point.Y);
     // endel
     gw.bw.Write((ushort)4);
     gw.bw.Write((byte)0x11);
     gw.bw.Write((byte)0);
 }
Beispiel #3
0
    private void pSaveGDS(gdsWriter gw)
    {
        //text
        gw.bw.Write((ushort)4);
        gw.bw.Write((byte)0x0C);
        gw.bw.Write((byte)0);
        //layer
        gw.bw.Write((ushort)6);
        gw.bw.Write((byte)0x0D);
        gw.bw.Write((byte)2);
        gw.bw.Write((short)layer_nr);
        //datatype
        gw.bw.Write((ushort)6);
        gw.bw.Write((byte)0x16);
        gw.bw.Write((byte)2);
        gw.bw.Write((short)datatype_nr);
        //presentation
        gw.bw.Write((ushort)6);
        gw.bw.Write((byte)0x17);
        gw.bw.Write((byte)1);
        gw.bw.Write((short)presentation);
        //width
        gw.bw.Write((ushort)8);
        gw.bw.Write((byte)0x0F);
        gw.bw.Write((byte)3);
        gw.bw.Write(width);
        int strans_ = 0;

        switch (trans.mirror_x)
        {
        case true:
            strans_ |= 0x8000;
            break;
        }
        //STRANS
        gw.bw.Write((ushort)6);
        gw.bw.Write((byte)0x1A);
        gw.bw.Write((byte)1);
        gw.bw.Write((short)strans_);
        //mag
        gw.bw.Write((ushort)12);
        gw.bw.Write((byte)0x1B);
        gw.bw.Write((byte)5);
        gw.write8ByteReal(trans.mag);
        //angle
        gw.bw.Write((ushort)12);
        gw.bw.Write((byte)0x1C);
        gw.bw.Write((byte)5);
        switch (trans.mirror_x)
        {
        case true when trans.angle != 0:
            gw.write8ByteReal(360 - trans.angle);
            break;

        default:
            gw.write8ByteReal(trans.angle);
            break;
        }
        //xy
        const int val = 1 * 2 * 4 + 4;

        gw.bw.Write((ushort)val);
        gw.bw.Write((byte)0x10);
        gw.bw.Write((byte)3);
        gw.bw.Write(point.X);
        gw.bw.Write(point.Y);
        gw.writeString(name, 0x19);
        // endel
        gw.bw.Write((ushort)4);
        gw.bw.Write((byte)0x11);
        gw.bw.Write((byte)0);
    }