home *** CD-ROM | disk | FTP | other *** search
/ Fifty: Elektronik / FIFTY Elektronik (PS_Computer_Vertrieb).iso / ps8 / fty1017 / gepackt.exe / DISK2 / PLOTSRC.EXE / GEDDEFS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-11-10  |  31.9 KB  |  890 lines

  1. Unit GEDDEFS;
  2.  
  3. interface
  4.  
  5. Uses Dos,StrTool,Serinout;
  6.  
  7. {$IFOPT N+}
  8.   Type Real =Double;
  9. {$ENDIF}
  10.  
  11. Const  DelFac   : Integer=10;
  12.        No_Blink : Word   = 0;
  13.        BildRecSize  =  37;       (*  Bild- Record Groesse *)
  14.        {$IFOPT N+}
  15.          Co8087 = ' / [80x87]';
  16.        {$ELSE}
  17.           Co8087 = '';
  18.        {$ENDIF}
  19.        Version='5.51';
  20.        VersionCode =$510;
  21.        copyright :Str64 = '(c) by Wolfgang Maier 1993';
  22.        MaxLayer =31;
  23.  
  24. var    DirMask,Filename,
  25.        ActivePath,
  26.        Macropath :PathStr;
  27.        DataF     :PathStr;
  28.        Outstring : Str80;
  29.  
  30.  
  31. type  {$IFDEF Schneider16}
  32.       ScrDriver = (CGA,HERC,EGA,OLI,PC1512,ACAD,MCGA);
  33.       {$ELSE}
  34.       ScrDriver = (CGA,HERC,EGA,OLI,PC15No,ACAD,MCGA);
  35.       {$ENDIF}
  36.  
  37.       DrTyp   = (Keiner,Epson120,Epson240,NEC180,Nec360,
  38.                  HP150,HP300,PT90,BJ180,BJ360,HP180,HP600);
  39.       GrLineType = (full,dashed,dotted,full1,dashed1,dotted1,
  40.                     hi1, hi2,   hi3,   hi4,  hi5,    hi6);
  41.                     (* Zusatz fuer Marktarget  (Hilite)    *)
  42.       GrChType     = Byte;
  43.                      { Bit 0 : Normal=0  Kursiv=1}
  44.                      { Bit 1 : Spiegelschrit =1  }
  45.                      { Bit 2 : Proportional  =1  }
  46.                      { Bit 3 : Schmalschrift =1  }
  47.                      { Bit 4 : 0 =Zeichensatz 1/ 1 =Zeichensatz 2}
  48.  
  49.       Koord  =Record
  50.                   X,Y :Integer;
  51.                 End;
  52.       Layer   = 0..31;
  53.       Layerset = Set of Layer;
  54.       Element =(Auge,Quadrat,Kreis,Linie,Rechteck,Schrift,
  55.                Macro,Masspfeil,Achteck,Oval,Kurve,M_line,M_arc,
  56.                M_peek,M_text,M_points,View,
  57.                ED_CON1,ED_CON2,ED_CON3,ED_Men,ED_time,ED_Info);
  58.       EDInfoTyp=(Container,FontInfo,LibInfo,Lib2,Lib3,DimRef);
  59.  
  60.       Defaults = Record
  61.                   Status   : Integer;  {+0}
  62.                   ZoomAll,
  63.                   GEDVersion:Integer;  {+2} { $402 = BVersion 4.02 }
  64.                   Ursprung  : Koord;   {+6}
  65.                   Einheit :System.Real;{+10}
  66.                   Masstab :  Integer;  {+16}
  67.                   Ebenen_alt: set of 0..7; {+18}
  68.                   Raster_alt: Byte;     {+19}
  69.                   Rin      : Byte;     {+20}
  70.                   Rout     : Byte;     {+21}
  71.                   Rebene   : Layer;    {+22}
  72.                   Qin      : Byte;     {+23}
  73.                   Qout     : Byte;     {+24}
  74.                   Qebene   : Layer;    {+25}
  75.                   Width    : Byte;     {+26}
  76.                   ChHeight : Byte;     {+27}
  77.                   ChType   : GrChType; {+28}
  78.                   Massebene :Layer;    {+29}
  79.                   Hidden_alt : Set of 0..7; {+30}
  80.                   MassHoehe :Byte;     {+31}
  81.                   AugenTyp  :Element;  {+32}
  82.                   KommaStellen:Byte;   {+33}
  83.                   Mtextebene:Layer;    {+34}
  84.                   Reserved  :Array[1..2] of Byte; {+35}
  85.                 End;
  86.  
  87.  
  88. Type FestPunkt =Record
  89.                  Case Byte of
  90.                  0 :(N :Word;    I :Longint);
  91.                  1: (N1 :LongInt;I1 :Integer);
  92.                  2: (W0,W1,W2   :Integer);
  93.                 end;
  94.  
  95.  
  96. (* 8086/88 Deklaration *)
  97. Const Augen    =0;
  98.       Linien   =1;
  99.       Kreise   =2;
  100.       Rechtecke=3;
  101.       Texte    =4;
  102.       Macros   =5;
  103.       Bemassung=6;
  104.       Kurven   =7;
  105.  
  106. Type
  107.       ElementSet =Set of Element;
  108.  
  109.       Elem_Groups = Array[Augen..Kurven] of ElementSet;
  110.  
  111. Const ElementGruppen :Elem_Groups =
  112.                ([Auge,Quadrat,Oval,AchtEck],[Linie],[Kreis],
  113.                 [Rechteck],[Schrift],[Macro],
  114.                 [Masspfeil,M_Line,M_arc,M_text,M_peek,M_points],
  115.                 [Kurve]);
  116.  
  117. Type
  118.      DateRec = Record
  119.                  Year,
  120.                  Day,
  121.                  Month,
  122.                  Hour,
  123.                  Minutes :Word;
  124.                 end;
  125.  
  126.      PinTyp  =(EAKanal,Eingang,Ausgang,Notused);
  127.  
  128.      (*  Bild- Record definition *)
  129.  
  130.      Bildelement = Record                            {rel. Offset }
  131.                      Status     : Word;               {+ 0 }
  132.                      Aufhaenger : Koord;              {+ 2 }
  133.                      Ebene      : Layer;              {+ 6 }
  134.                      Orient     : Integer;            {+ 7 }
  135.                      LTyp       : GrLineType;         {+ 9 }
  136.                    Case ElementTyp : Element  Of      {+ 10}
  137.                    Auge,
  138.                    Achteck,
  139.                    Oval  :   ( AussenD ,              {+ 11}
  140.                                InnenD      : Integer; {+ 13}
  141.                                APinNr      :Word;     {+ 15}
  142.                                APinTyp     :PinTyp;   {+ 17}
  143. {$IFDEF GEODAT}
  144.                                A_Zvalue    :String[14]; {+18}
  145. {$ELSE}
  146.                                APinName    :Str5;     {+ 18}
  147.                                ASymbname   :str8;     {+ 24..32}
  148. {$ENDIF}
  149.                                Oval_Len    :Integer); {+ 33 }
  150.                    Quadrat : ( QInnenD ,              {+ 11}
  151.                                QBreite      : Integer;{+ 13}
  152.                                QPinNr       : Word;   {+ 15}
  153.                                QPinTyp      :PinTyp;  {+ 17}
  154.                                QPinName     :Str5;    {+ 18}
  155.                                QSymbname    :Str8);   {+ 24..32}
  156.                    Kreis,
  157.                    M_arc   : ( Segmentalpha,          {+ 11}
  158.                                Segmentbeta,           {+ 13}
  159.                                HalbX ,HalbY :Integer; {+ 15,17}
  160.                                SectorFill   :Boolean; {+ 19}
  161.                                Kbreite      :Integer);{+ 20..21}
  162.  
  163.                    Linie,
  164.                    M_line   : ( Endpunkt     : Koord;   {+ 11}
  165.                                LBreite      : Integer;  {+ 15}
  166. {$IFDEF GEODAT}
  167.                                L_Zvalue     : String[14];    {+18}
  168.                                L_ZDummy     : Byte;
  169. {$ELSE}
  170.                                Signalname   : Str15;    {+ 17}
  171.  
  172. {$ENDIF}
  173.                                Signalnummer : Word);    {+ 33..34}
  174.                                { ist bei M_line Nr der Bemassungsuntergruppe}
  175.                    Rechteck: ( Rand         : Integer;     {+ 11}
  176.                                Rfill        : Boolean;     {+ 13}
  177.                                RLaenge ,                   {+ 14}
  178.                                Rbreite      : Integer );   {+ 16}
  179.                    Schrift:  ( Hoehe        : System.Real; {+ 11}
  180.                                Art          : GrChType;    {+ 17}
  181.                                Wortlaut     : Str15);      {+ 18..33}
  182.  
  183.                    Macro   : ( Faktor       : System.Real; {+ 11}
  184.                                Masterfile   : Str8;        {+ 17}
  185.                                PartNr       : Word;        {+ 26}
  186.                                PartX,PartY  : ShortInt;    {+ 28}
  187.                                {Ltyp enthält in bit 0..3 Lowbits(X) und
  188.                                              in bit 4..7 Lowbits(Y) }
  189.                                TextOrient   : Byte;        {+ 30}
  190.                                PartID       : Str3);       {+ 31,32,33,34}
  191.                    M_text :  ( M_Hoehe      : System.Real; {+ 11}
  192.                                M_Art        : GrChType;    {+ 17}
  193.                                M_Wortlaut   : String[14]); {+ 18..32}
  194.                    M_peek :  ( MP_Hoehe     : System.Real);{+ 11}
  195.                    M_points,
  196.                    Kurve    :( Defpoints    : Array[1..5]  {+ 11}
  197.                                               of Koord;
  198.                                Npoints      : Byte;       {+31}
  199.                                Bemasstyp    : Byte;       {+32}
  200.                                Kur_Breite   : Word);      {+33}
  201.  
  202.                    Masspfeil :( Masslaenge  : Integer;     {+ 11}
  203.                                 MSize       : System.Real; {+ 13}
  204.                                 Masstext    : Str15;       {+ 19}
  205.                                 GruppenNr   : Word);       {+ 35}
  206.  
  207.                    View     :(View_Ebs :Layerset;  {+11}
  208.                               View_Hid :Layerset;  {+15}
  209.                               View_zoom   :Integer;{+19}
  210.                               View_Orig   :Koord;  {+21}
  211.                               View_Name   :Str10); {+25}
  212.                               { bei View enthält Ltyp folgende Bits:
  213.                                 Bit0 = Füllen
  214.                                 Bit1 = Linienenden runden }
  215.                    ED_Men   :(Menuename :Str15);
  216.                    ED_Time  :(WorkingTime :Longint;  {+11}
  217.                               { Arbeitszeit in sekunden}
  218.                               Created     :DateRec;
  219.                               Updated     :DateRec);
  220.                         {     Orient: ist Versions-Zähler }
  221.                 End;
  222.  
  223. (* Datentypen ED_CONF1..3 sind Kompatibel zu Bildelement !!!*)
  224.  
  225.       ED_CONF1 = Record
  226.                    Status     : Word;               {+ 0 }
  227.                    Aufhaenger1: Koord;              {+ 2 }
  228.                    Ebene1     : Layer;              {+ 6 }
  229.                    Orient1    : Integer;            {+ 7 }
  230.                    LTyp1      : GrLineType;         {+ 9 }
  231.                    ElementTyp1: Element;            {+10 = ED_CON1}
  232.                    Gitter     : System.Real;        {+11}
  233.                    SnapWeite  :System.Real;         {+17}
  234.                    OrthoSnap  :Integer;             {+23}
  235.                    Osnap      :System.Real;         {+25}
  236.                    AutoTrace  :Boolean;             {+31}
  237.                    Extsearch  :Boolean;             {+32}
  238.                    Adapt      :Boolean;             {+33}
  239.                    Filling    :Boolean;             {+34}
  240.                    MACextsearch:Boolean;            {+35}
  241.                    Autoosnap  :Boolean;             {+36}
  242.                  End;
  243.       ED_CONF2 = Record
  244.                    Status     : Word;               {+ 0 }
  245.                    Relbezug   : Koord;              {+ 2 }
  246.                    Bezugsmarke: Boolean;            {+ 6 } {0 oder 1 ist <100}
  247.                    Orient2    : Integer;            {+ 7 }
  248.                    LTyp2      : GrLineType;         {+ 9 }
  249.                    ElementTyp2: Element;            {+10 = ED_CON2}
  250.                    Ebenen     :Layerset;            {+11}
  251.                    Hidden     :Layerset;            {+15}
  252.                    Suchebenen :Layerset;            {+19}
  253.                    Suchelemente:ElementSet;         {+23}
  254.                    MacroFac   :System.Real;         {+26 Default für COPY-MAC}
  255.                    Polygon,                         {+32}
  256.                    Relativ,                         {+33 , Aufhänger=Bezugspunkt}
  257.                    RastRelat  :Boolean;             {+34}
  258.                    ActualLayer:Byte;                {+35}
  259.                    ActualLTyp:GrLineType;           {+36}
  260.                  End;
  261.  
  262.       ED_CONF3 = Record
  263.                    Status     : Word;               {+ 0 }
  264.                    Aufhaenger3: Koord;              {+ 2 }
  265.                    BitFlag3   : Byte;               {+ 6 }
  266.                    DimOrient  : Integer;            {+ 7 }
  267.                    LTyp3      : GrLineType;         {+ 9 }
  268.                    ElementTyp3: Element;            {+10 = ED_CON2}
  269.                    R8in       : Byte;               {+11, Achteckige Augen}
  270.                    R8out      : Byte;               {+12}
  271.                    R8ebene    : Layer;              {+13}
  272.                    OVin       : Byte;               {+14, Ovale Augen}
  273.                    OVout      : Byte;               {+15}
  274.                    OVlen      : Byte;               {+16}
  275.                    OVebene    : Layer;              {+17}
  276.                    mm_RE,                           {+18  Angabe mm/RE}
  277.                    Drag       : Boolean;            {+19}
  278.                    HatchPhi   : Integer;            {+20}
  279.                    Hatchdist  : Integer;            {+22}
  280.                    Hatchlay   : Layer;              {+24}
  281.                    HatchWidth : Byte;               {+25}
  282.                    Hatchtyp   : GrlineType;         {+26}
  283.                    MassTyp    : GrChType;           {+27}
  284.                    GummiB     : Boolean;            {+28}
  285.                    SwitchLay  : Boolean;            {+29}
  286.                    Layer_oben,                      {+30}
  287.                    Layer_unten: Layer;              {+31}
  288.                    Fasen_Tiefe :Integer;            {+32}
  289.                    Runden_Tiefe:Integer;            {+34}
  290.                    Zusatzflags :Byte;               {+36}
  291.                  End;
  292. (*
  293.  Zusatzflags :
  294.      Bit0                                                           Bit7
  295.    ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
  296.    │ Auto-  │ Koord- │ Pfeil -│-Mode   │Hide-   │ NC-Be- │NC-Ein- │PD-Bit  │
  297.    │ Pan    │ Display│00=Pfeil│01=Line │Center  │ maßung │zel-Bem.│New DWG │
  298.    │        │        │10=Auge │11=Nix  │(Kreise)│        │        │        │
  299.    └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
  300.  Bitflag 3
  301.      Bit0                                                           Bit7
  302.    ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐
  303.    │ 45°    │Koord-  │ Zeige  │        │        │        │        │        │
  304.    │ Cursor │Display │ PinInfo│        │        │        │        │        │
  305.    │        │        │        │        │        │        │        │        │
  306.    └────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
  307.  
  308. *)       
  309.          ED_INFOTyp= Record
  310.                    Status     : Word;                {+ 0 }
  311.                    EDVERSION  : WORD;                {+ 2 }
  312.                    INDEX1     : WORD;                {+ 4 }
  313.                    INDEX2     : WORD;                {+ 6 }
  314.                    FLAGS      : WORD;                {+ 8 }
  315.                    ElementTyp : Element;             {+10 = ED_INFO}
  316.                    Case Typ   : EDInfoTyp of         {+11 }
  317.                    Container  :(LibName    :Str15;   {+12 }
  318.                                 LIBID      :Byte;    {+13 }
  319.                                 Fill:
  320.                                 array[1..8] of Byte);{+29 }
  321.                    FontInfo   :(FontName:Str15;
  322.                                 { für zukünftige GEDDY-Versionen :                                             }
  323.                                 Size    :Word; { Size<>0 : Font in BLD-Datei, Size =0 Font in CHR-Datei        }
  324.                                 StartRec:Word; { StartRec: Offset zu Bld-Datei-Anfang, falls FONT in BLD-Datei }
  325.                                 NRecs   :Word);{ Anzahl BL-Recs des Fonts                                      }
  326.                    DimRef     :(RefPointName:Str10; { für Bemassung }
  327.                                 RefGridRel:Boolean;
  328.                                 RefOrient :Integer;
  329.                                 Refpoint :Koord)
  330.                  End;
  331.  
  332. Const    AutoPan           =1;
  333.          Coord_Display     =2;
  334.          PD_DWG_Bit        =128;
  335.          PfeilModeMask     =$0C;
  336.          PfeilModeShift    =2;
  337.          Hide_Center       =16; { bestimmt, ob bei Kreis und Ellipse Mittelpunkt markiert wird }
  338.          NC_Bemassen       =32; { bestimmt, ob NC-Bemassung aktiviert                          }
  339.          NC_EinzelDim      =64; { bestimmt, ob NC-Bemassung einzelne Maßpfeile verwendet       }
  340.          Diag_CrossHair    =1  ;{ bestimmt, ob Diagonal-Cursor aktiv            }
  341.          Show_PinInfo      =4  ;
  342. Type
  343.       Knoten     =Record
  344.                     Ort        :Koord;     { derzeitiger Ort des Knotens  }
  345.                     RecNr      :Integer;   { RecNr in Datei des Obj./Macro}
  346.                     PinName    :Str5;      { PinName }
  347.                     PinNr      :Word;      { PinNr   }
  348.                     PartID     :Str3;      { Teilbez. }
  349.                     PartNr     :Word;      { TeilNr   }
  350.                     Durchmess  :Word;      { Augendurchmess}
  351.                     Augentyp   :Element;   { Augentyp (rund,Quadr)}
  352.                   end;
  353.  
  354.  
  355.       Connection =Record
  356.                     Status :Integer;
  357.                     Quelle, Ziel :Knoten;
  358.                     Done         :Boolean;
  359.                     NetzNr       :Word;
  360.                     Signalname   :Str15;
  361.                    End;
  362.  
  363.       PaletMode=(NoPal,EGApal,VGApal);
  364.  
  365.  
  366.      Plotdefs =Record
  367.                   Pspeed,
  368.                   FormX,
  369.                   FormY        :Integer;
  370.                   pendict      :Array[0..7] of Integer;
  371.                   PenWidth,
  372.                   Scaling      :System.Real;
  373.                  End;
  374.       Pinstall =Record
  375.                   HpGl                           :Boolean;
  376.                   Plottername                    :Str15;
  377.                   sepsym                         :Char;
  378.                   TermStr                        :Str5;
  379.                   ResetCom,
  380.                   ExitCom                        :Str64;
  381.                   MoveCom,DrawCom,
  382.                   SelPenCom,LTFullCom,
  383.                   LTDotCom,LTdashCom,
  384.                   LSCom,SpeedCom                 :Str10;
  385.                   PenMin,PenMax,
  386.                   Speedmin,Speedmax,
  387.                   LineScaleMin,LinescaleMax      :Integer;
  388.                   LineScaleFac,SpeedFac,
  389.                   Resolution                     :System.Real;
  390.                   PlotterNr                      :1..3;
  391.           Serial       :Boolean;
  392.           Parity       :Paritytype;
  393.           Databits,
  394.                   Stopbits     :Byte;
  395.           Xonoff       :Byte; {0 =Xon/xoff,1=DSR,2=CTS}
  396.           Baudrate     :Byte;
  397.                   SerPortNr    :Byte;
  398.                   HandshakeDSR,
  399.                   HandshakeCTS :Boolean;
  400.                  end;
  401.  
  402.       Moninst =Record
  403.                  MonitTyp     : ScrDriver;
  404.                  HiEGAmode    : Integer; { EGA/VGA-Treiber }
  405.                                          { DOT-OFFSET bei ADI-Treibern  }
  406.                  Monitname    : Str8;
  407.                  HatEGApalette: PaletMode;
  408.                 end;
  409.  
  410.       EGA_Xinfo =Record
  411.                    Is8x8      :Boolean;
  412.                    Vmode      :Word; { Video-Mode, Register AX,
  413.                                        INTVEC bei ADI-Treibern }
  414.                    Xres,
  415.                    Yres       :Word;
  416.                    ScrSav     :Word; { K-Byte Speicherbedarf für Textmode  }
  417.                    IsVideo7   :Byte;
  418.                    { Davon :Bit0 :Video7
  419.                      Bits 4..7 Page_set_mode !
  420.                      0  = none
  421.                      1= TSENG4000
  422.                      2 =Video7-Vram
  423.                    }
  424.                   end;
  425.  
  426.       Dinstall=Record
  427.                  DrYSize,
  428.                  DrXAspect       :System.Real;
  429.                  DruckerName   :Str15;
  430.                  Drucker       :DrTyp;
  431.                  Dformat       :Integer; { 3= A3, 4 =A4 }
  432.                  DruckerNr     : 1..3;
  433.                  Dinit,Dexit   :Str15;
  434.                  Dgrafik,
  435.                  Dteilzeile,
  436.                  Drestzeile,
  437.                  DLinespacing,
  438.                  DColor,
  439.                  Dunidir,
  440.                  DFWDlinefeed,
  441.                  DREVlineFeed :Str10;
  442.                 end;
  443.  
  444.        LASinst=Record
  445.                  DrYSize,
  446.                  DrXAspect     :System.Real;
  447.                  Drucker       :DrTyp;
  448.                  Farbfaehig    :Boolean;
  449.                  Bubblejet     :Boolean;
  450.                  DruckerNr     :1..3;
  451.                  InitString    :Str64;
  452.                  ExitString    :Str64;
  453.                  Packing       :Boolean;
  454.                 end;
  455.  
  456.       Bohrdefs =Record
  457.                   Sieb_u_Meyer :Boolean;
  458.                   Bohrtool     :Str8;
  459.                   Bohr_LimAuto :Boolean;
  460.                   Bohr_LimLay  :Layer;
  461.                   BohrLays     :Layerset;
  462.                   BohrSys      :1..4;
  463.                   BohrfeldW    :Integer;
  464.                   BohrNdez     :Integer;
  465.                   BohrXfirst   :Boolean;
  466.                   Bohrlinks    :Boolean;
  467.                   Bohrfest     :Boolean;
  468.                   BohrXCom,
  469.                   BohrYCom,
  470.                   BohrEnd,
  471.                   BohrStart    :Str10;
  472.                   BohrX0,BohrY0,
  473.                   BohrFX1,BohrFX2,
  474.                   BohrFY1,BohrFY2,
  475.                   BohrScaling  :System.Real;
  476.                 End;
  477.        Mausdef=Record
  478.                   Maustyp      :Byte;
  479.           Mausport     :Byte;
  480.           Parity       :Paritytype;
  481.                   Databits     :Byte;
  482.           Stopbits     :Byte;
  483.                   Baudrate     :Byte;
  484.                   Xscale,Yscale:Byte;
  485.           MausRatio    :Byte;
  486.                   Absolut      :Boolean;
  487.                   Tablettinit  :Str10;
  488.                  end;
  489.  
  490.        FileInf    =record
  491.                       DWG :Str15;
  492.                       DWGPath,
  493.                       LIBPath :Str64;
  494.                     end;
  495.  
  496.       SetUp =Record
  497.                Voreinstellung  : Defaults;
  498.                SetupPlotter    : Plotdefs;
  499.                MakeBackup      : Boolean;
  500.                EgaPalette      : Array[0..15] of Byte;
  501.                PinstInfo       : Pinstall;
  502.                MonitInfo       : Moninst;
  503.                DinstInfo       : Dinstall;
  504.                LASInfo         : Lasinst;
  505.                BohrInfo        : Bohrdefs;
  506.            MausINFO        : Mausdef;
  507.                LastTMPDrive    : Str5;
  508.                _Reserve        : Array[1..57] of Byte;
  509.                Input_NoClear   : Boolean;
  510.                ScanMACS        : Boolean;
  511.                Sernumber       : Str10;
  512.                Zeichensatz1    : Str15;
  513.                Zeichensatz2    : Str15;
  514.                Zeichensatz3    : Str15;
  515.                Zeichensatz4    : Str15;
  516.                MaxNrOfObjs_T   : Longint;
  517.                Entzerrung      : System.Real;
  518.                Zoomupdown      : System.Real;
  519.                AutoPanDelay    : Byte;    { Time  in 0.1 sec }
  520.                EGA_zusatz      : EGA_Xinfo;
  521.                Edsetup1        : ED_Conf1;
  522.                Edsetup2        : ED_Conf2;
  523.                Edsetup3        : ED_Conf3;
  524.                LayerLookup     : Array[0..MaxLayer] of Byte;
  525.                MenueFileName   : Str15;
  526.                AutoSaveTime    : Word; { Zeitintervall für autom. Sichern}
  527.               End;
  528.  
  529.      Eich_Inf =Record
  530.                  Xt1,Yt1,
  531.                  Xd1,Yd1,
  532.                  M0   :System.Real;
  533.                End;
  534.  
  535.      PickRec =Record
  536.                 DWGname,
  537.                 MACPfad :Pathstr;
  538.                 LastTime:Longint;
  539.               end;
  540. Const
  541.     SetupF          ='GED.INF';
  542.     DSuf            ='.BLD';
  543.     LibSuf          ='.LIB';
  544.     EichF           ='EICH.INF';
  545.     DSufBAK         ='.BAK';
  546.     FSetupF         ='GED.FIL';
  547.     PickFile        ='GED.PCK';
  548.     MaxFilestoEdit  = 9;
  549.     EdMaxXY         =15000;
  550.  
  551.  
  552. var   SetupInfo      :Setup;
  553.       FileSetup      :FileInf;
  554.  
  555. Function GetLayer(E:Word):Char;
  556.  
  557. Function GetEbene(L:Char):Word;
  558.  
  559. Function LayerNr(E:Word):Word;
  560.  
  561. Function EbenenIndex(Nr:Word):Word;  { 0..31  -> 1..32}
  562.  
  563. Function EbenenStr(Ebenen:Layerset):Str40;
  564.  
  565. Procedure EbenenSet(S:Str40; Var L:Layerset);
  566.  
  567. Function RealtoInt(X:Real):Integer;
  568.  
  569. Function MUL_AB_DIV_C(A,B,C :Integer):Integer;
  570. (* berechnet LongInt(A)*LongInt(B) div C *)
  571. inline($59/      { POP CX CX:=C }
  572.        $5B/      { POP BX BX:=B}
  573.        $58/      { POP AX AX:=A}
  574.        $F7/$EB/  { IMUL BX   AX/DX:=AX*BX }
  575.        $F7/$F9); { IDIV CX   AX:=AX/DX div CX }
  576.  
  577. Procedure FestP(X:Real; Var Y :Festpunkt);
  578.  
  579. Function Scale_FP(X:Integer;M :Festpunkt):Integer;
  580.  
  581. Procedure Mul_FP(Var X:Festpunkt;Y:Festpunkt);
  582.  
  583. Function  Minimal(X:Integer):Integer;
  584.  
  585. Procedure Limit(Var I:Integer;Min,Max:Integer);
  586.  
  587. Procedure FitVersionCode(Var V :Word);
  588.  
  589. Procedure Update_Obj(Var Obj :Bildelement;VersionCode:Word);
  590.  
  591. (**********************************************************************)
  592.  
  593.  
  594. implementation
  595.  
  596.  
  597. Function GetLayer(E:Word):Char;
  598. Begin
  599.   If E<8 then
  600.   begin
  601.     If E=0 Then GetLayer:='8' else Getlayer:=Chr(Ord('0')+E);
  602.   end
  603.   else GetLayer:=Chr(Ord('A')+E-8);
  604. End;
  605.  
  606. Function GetEbene(L:Char):Word;
  607. Begin
  608.   If (Ord(L)>Ord('0')) and (Ord(L)<=Ord('7')) then
  609.     GetEbene:=Ord(L)-Ord('0')
  610.    else
  611.     If (Ord(L)>=Ord('A')) and (Ord(L)<=Ord('X')) then
  612.      GetEbene:=Ord(L)-Ord('A')+8
  613.     else GetEbene:=0;
  614. End;
  615.  
  616. Function LayerNr(E:Word):Word;  {1..32 --> 0..31}
  617. begin
  618.   If (E=0) or (E>32) then LayerNr:=1
  619.   else
  620.   begin
  621.     If E>8 then LayerNr:=E-1
  622.      else
  623.        If E=8 then LayerNr:=0
  624.         else LayerNr:=E;
  625.   end;
  626. end;
  627.  
  628. Function EbenenIndex(Nr:Word):Word;  { 0..31  -> 1..32}
  629. begin
  630.   If (Nr=0)  then EbenenIndex:=8
  631.   else
  632.   begin
  633.     If Nr>7 then EbenenIndex:=Nr+1
  634.         else EbenenIndex:=Nr;
  635.   end;
  636. end;
  637.  
  638.  
  639. Function EbenenStr(Ebenen:Layerset):Str40;
  640. Var I,J:Word;
  641.     Rest:Layerset;
  642.     S:Str40;
  643. begin
  644.   S:='';
  645.   J:=0;
  646.   For I:=0 to MaxLayer do
  647.      If I in Ebenen then Inc(J);
  648.   If Ebenen=[0..MaxLayer] then S:='ALLE'
  649.   else
  650.     begin
  651.       If J>21 then
  652.         Ebenen:=[0..MaxLayer]-Ebenen;
  653.       For I:=1 to  Succ(Maxlayer) do
  654.         If LayerNr(I) in Ebenen then S:=S+Getlayer(LayerNr(I));
  655.       If J>21 then S:='ALLE-'+S;
  656.     end;
  657.   EbenenStr:=S;
  658. end;
  659.  
  660. Procedure EbenenSet(S:Str40;Var L:Layerset);
  661. Var I:Word;
  662. begin
  663.   L:=[];
  664.   For I:=1 to Length(S) do
  665.       L:=L+[GetEbene(S[I])];
  666. end;
  667.  
  668. Function RealtoInt;
  669. {$IFOPT N+}
  670.   Type R87= Record
  671.            W0,W1,W2,W3 :Word;
  672.           end;
  673.   Var Xw :R87 absolute X;
  674.       Exponent :Word;
  675.   begin
  676.     Exponent:=(Xw.W3) and $7ff0;
  677.     If Exponent<$40D0 then RealtoInt:=Round(X)
  678.     else
  679.      If Exponent=$40D0 Then begin
  680.        If Abs(X)< 32767.0 then RealtoInt:=Round(X)
  681.        else
  682.        If (Xw.W3 and $8000)<>0 then RealtoInt:=-MaxInt else RealtoInt:=Maxint;
  683.        end
  684.      else
  685.        If (Xw.W3 and $8000)<>0 then RealtoInt:=-MaxInt else RealtoInt:=Maxint;
  686.   end;
  687. {$ELSE}
  688.   Type R86= Record
  689.            B0,B1,B2,B3,B4,B5 :Byte;
  690.           end;
  691.   Var Xb :R86 absolute X;
  692.   begin
  693.     With Xb Do
  694.     If B0<$8F then RealtoInt:=Round(X)
  695.     else
  696.      If (B0=$8F) Then
  697.        begin
  698.          If Abs(X)< 32767.0 then RealtoInt:=Round(X)
  699.          else
  700.          If (B5 and $80)<>0 then RealtoInt:=-MaxInt else RealtoInt:=Maxint;
  701.        end
  702.        else
  703.        If (B5 and $80)<>0 then RealtoInt:=-MaxInt else RealtoInt:=Maxint;
  704.   end;
  705. {$ENDIF}
  706.  
  707. Procedure FestP;
  708. {$IFOPT N+}
  709.   Type R87= Record
  710.            W0,W1,W2,W3 :Word;
  711.           end;
  712.   Var Xw :R87 absolute X;
  713.       Exponent :Word;
  714.   begin
  715.     With Xw Do
  716.     begin
  717.       W3:=W3 and $7fff;
  718.       If (W3 and $7ff0)<$40D0 then
  719.         begin
  720.           Y.N1:=trunc(Frac(X)*65536);
  721.           Y.I:=Trunc(X);
  722.         end
  723.         else begin Y.N:=0;Y.I:=16384; end;
  724.     end;
  725.   end;
  726. {$ELSE}
  727.   Type R86= Record
  728.            B0,B1,B2,B3,B4,B5 :Byte;
  729.           end;
  730.   Var Xb :R86 absolute X;
  731.   begin
  732.     With Xb Do
  733.     begin
  734.       B5:=B5 and $7F ; { Sign auf Null setzen }
  735.       If B0<$8F then
  736.         begin
  737.           Y.N1:=trunc(Frac(X)*65536);
  738.           Y.I:=Trunc(X);
  739.         end
  740.         else begin Y.N:=0;Y.I:=16384; end;
  741.     end;
  742.   end;
  743. {$ENDIF}
  744.  
  745. Function Scale_FP(X:Integer;M :Festpunkt):Integer;
  746. Var R : Festpunkt;
  747. begin
  748.   Inline($8B/$46/<X/      {MOV AX,X}
  749.          $8B/$5E/<M/      {MOV BX,M.N}
  750.          $09/$C0/         {OR AX,AX set Sign Bit}
  751.          $7c/$04/         {JL neg}
  752.          $F7/$E3/         {MUL BX}
  753.          $EB/$10/         {jmp exit}
  754. {neg}    $F7/$D8/         {NEG AX}
  755.          $F7/$E3/         {MUL BX}
  756.          $31/$C9/         { XOR CX,CX }
  757.          $31/$DB/         { XOR BX,BX }
  758.          $29/$C3/         { SUB BX,AX }
  759.          $19/$D1/         { SBB CX,DX }
  760.          $89/$CA/         { MOV DX,CX }
  761.          $89/$D8/         { MOV AX,BX }
  762.          $89/$C3/         {MOV BX,AX}
  763.          $89/$D0/         {MOV AX,DX}
  764.          $99/             {CWD}
  765.          $81/$C3/$00/$80/ {Add BX,$8000}
  766.          $15/$00/$00/     {ADC AX,0    }
  767.          $83/$D2/$00/     {ADC DX,0}
  768.          $89/$46/<R+2/    {MOV R+2, AX }
  769.          $89/$56/<R+4/    {MOV R+4, DX (R.N1:=M.N*X)}
  770.          $8B/$5E/<M+4/    {MOV BX,M+4}
  771.          $8B/$4E/<M+2/    {MOV CX,M+2}
  772.          $8B/$46/<X/      {MOV AX,X}
  773.          $99/             {CWD     DX=Sign(I) }
  774.          $8B/$F0/         {MOV SI,AX}
  775.          $8B/$FA/         {MOV DI,DX}
  776.          $F7/$E1/         {MUL CX}
  777.          $50/             {Push AX}
  778.          $52/             {Push DX}
  779.          $8B/$C6/         {MOV AX,SI}
  780.          $F7/$E3/         {MUL BX}
  781.          $8B/$D8/         {MOV BX,AX}
  782.          $8B/$C7/         {MOV AX,DI}
  783.          $F7/$E1/         {MUL CX}
  784.          $8b/$C8/         {MOV CX,AX}
  785.          $5A/             {POP DX}
  786.          $58/             {POP AX}
  787.          $03/$D3/         {ADD DX,BX}
  788.          $03/$D1/         {ADD DX,CX}
  789.          $03/$46/<R+2/    {ADD AX, R.I+0 }
  790.          $13/$56/<R+4/    {ADC DX,R.I+2 }
  791.          $83/$FA/$00/     {CMP DX,0 }
  792.          $7F/$07/         {JG  L1      }
  793.          $7C/$0A/         {JL  L2      }
  794.          $3D/$FF/$7F/     {CMP AX,7fff }
  795.          $76/$05/         {JNB L2      }
  796. {L1:}    $B8/$FF/$7F/     {MOV AX,32767}
  797.          $EB/$0F/         {JMP EXIT    }
  798. {L2:}    $83/$FA/$FF/     {CMP DX,-1   }
  799.          $7C/$07/         {JL  L3      }
  800.          $7F/$08/         {JG  Exit    }
  801.          $3D/$00/$80/     {CMP AX,8000 }
  802.          $73/$03/         {JNB EXIT    }
  803.          $B8/$00/$80/     {MOV AX,8000 }
  804.          $89/$46/$FE);    {MOV [BP-2],AX }
  805. {EXIT:   ......}
  806. end;
  807.  
  808. Procedure Mul_FP(Var X:Festpunkt;Y:Festpunkt);
  809. Var I,I2,I3,I4:LongInt;
  810.     N :Word;
  811. begin
  812.  I4:=LongInt(X.N)*LongInt(Y.N);
  813.  I:=X.I*Y.I;
  814.  I2:=X.N*Y.I;
  815.  I3:=X.I*Y.N;
  816.  Inline($8B/$46/<I4+2/      {  MOV AX, I4+2 }
  817.         $31/$DB/            {  XOR BX,BX }
  818.         $31/$C9/            {  XOR CX,CX   }
  819.         $03/$46/<I2/        {  ADD AX, I2 }
  820.         $13/$5E/<I2+2/      {  ADC BX, I2+2 }
  821.         $83/$D1/$00/        { ADC CX, 0 }
  822.         $03/$46/<I3/        {  ADD AX, I3 }
  823.         $13/$5E/<I3+2/      {  ADC BX, I3+2 }
  824.         $83/$D1/$00/        { ADC CX, 0 }
  825.         $03/$5E/<I/         { ADD BX,I  }
  826.         $13/$4E/<I+2/       { ADC CX,I+2 }
  827.         $89/$46/<N/         { MOV N, AX }
  828.         $83/$F9/$00/        {CMP CX,0 }
  829.         $75/$06/            {JNZ L1      }
  830.         $81/$FB/$FF/$7F/    {CMP BX,7fff }
  831.         $7E/$05/            {JLE EXIT    }
  832. {L1:}   $BB/$FF/$7F/        {MOV BX,32767}
  833.         $31/$C9/            {XOR CX,CX   }
  834. {EXIT}  $89/$5E/<I/         { MOV I, BX }
  835.         $89/$4E/<I+2);      { MOV I+2,CX }
  836.   X.I:=I;
  837.   X.N:=N;
  838. end;
  839.  
  840.  
  841. Function  Minimal(X:Integer):Integer;
  842. Begin
  843.     If X<1 Then Minimal:=1 Else Minimal:=X;
  844. End;
  845.  
  846. Procedure Limit(Var I:Integer;Min,Max:Integer);
  847. begin
  848.   IF I>Max then I:=Max;
  849.   If I<Min Then I:=Min;
  850. end;
  851.  
  852. Procedure FitVersionCode(Var V :Word);
  853. begin
  854.   V:=V and $7FF;
  855.   If V>VersionCode+$10 then V:=0;
  856.   { Datei neuer als Zeichnungseditor }
  857. end;
  858.  
  859. Procedure Update_Obj(Var Obj :Bildelement;VersionCode:Word);
  860. {muss auch beim einkopieren von Macros durchgeführt werden}
  861. begin
  862.   With Obj Do
  863.     begin
  864.        If VersionCode<$404 then  GruppenNr:=0;
  865.        Case ElementTyp of
  866.           Auge,
  867.           Quadrat : If VersionCode<$510 then
  868.                     Begin
  869.                       APinTyp:=EAKanal;
  870.                       APinNr :=0;
  871.                       {$IFDEF GEODAT}
  872.                       A_Zvalue:='';
  873.                       {$ELSE}
  874.                       ApinName:='';
  875.                       ASymbName:='';
  876.                       {$ENDIF}
  877.                     end;
  878.           Macro   : If VersionCode<403 then
  879.                     begin
  880.                       PartID:='';
  881.                       PartX:=0;PartY:=0;
  882.                       PartNr:=0;TextOrient:=0;
  883.                     end;
  884.         end; {Case}
  885.     end;
  886. end;
  887.  
  888.  
  889. end.
  890.