mhk4.py :  » Business-Application » ThanCad » thancad-0.0.9 » p_gmhk » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Business Application » ThanCad 
ThanCad » thancad 0.0.9 » p_gmhk » mhk4.py
# -*- coding: iso-8859-7 -*-

from math import fabs,atan2,pi,sin,cos
from p_gmath import fsign
from p_gindplt import elips1
import com, mhk5

def proker():
      "Preliminary computation of grade lines."
      if com.oxiery: return
      com.xshm2p=com.xthar
      liner = 0
      for ii in xrange(com.ner):
          i=com.iseira[ii]
          m = com.icod[i] % 4
          if m==0: continue
          if m==1: liner = prokerOdop(i, liner) #go to 10   # 
          if m==2: liner = prokerApox(i, liner) #go to 20   # 
          if m==3: continue
          com.linery[i]=liner
          liner=com.laster[i]+1

def prokerApox(i, liner):
        "Preliminary computation of sewage lines."
        if com.laster[i]-liner < 1:
            mhk5.ermhks(['       %d' % i])
        com.xther2[i],com.yer2[i],com.r2[i] = com.uTer.readrec(rec=liner)   #read (7,rec=liner)com.xther2[i],com.yer2[i],com.r2[i]
        if com.xther2[i]>com.xthar+0.01:   # go to 100
            terr = ['  ..   %d (=%.2f)  ' % (i, com.xther2[i]),
                    '   ..    (=%.2f)' % com.xthar,
                   ]
            mhk5.ermhks(terr)

        while True:
            if liner>=com.laster[i]:   # go to 112
                terr = ['  (..=%.2f)  ' % com.xthar,
                        '  %d (..=%.2f)' % (i,com.xther2[i]),
                       ]
                mhk5.ermhks (terr3)
            com.xther1[i] = com.xther2[i]
            com.yer1[i]   = com.yer2[i]
            com.r1[i]     = com.r2[i]
            liner=liner+1
            com.xther2[i],com.yer2[i],com.r2[i] = com.uTer.readrec(rec=liner)   # read (7,rec=liner)com.xther2[i],com.yer2[i],com.r2[i]
            if com.xthar<=com.xther2[i]: break # go to 11

        com.ai1[i]=(com.yer2[i]-com.r1[i])/(com.xther2[i]-com.xther1[i])
        if i!=com.keryth: return liner   #go to 30
        com.xkli=(com.xthar+com.xther2[i])*0.5-1.25/com.pklx
        if com.xkli<com.xthar: com.xkli=1.0e30
        return liner
      
def prokerOdop(i, liner):
        "Preliminary computation of grade lines."
        com.oxienl[i] = True
        if com.laster[i]-liner < 1:
            mhk5.ermhks(['       %d' % i])
        com.xther2[i],com.yer2[i],com.r2[i] = com.uTer.readrec(rec=liner)  #  read (7,rec=liner)com.xther2[i],com.yer2[i],r2[i]
        if com.xther2[i]>com.xthar+0.01:                         # go to 100
            terr = ['  ..   %d (=%.2f)  ' % (i, com.xther2[i]),
                    '   ..    (=%.2f)' % com.xthar,
                   ]
            mhk5.ermhks(terr)
        if com.r2[i] != 0.0:
            mhk5.ermhks('     %d    = 0.00' % i)
        
        liner += 1
        com.xther3[i],com.yer3[i],com.r3[i] = com.uTer.readrec(rec=liner)    #read (7,rec=liner)com.xther3[i],com.yer3[i],r3[i]
        com.ai2[i]=(com.yer3[i]-com.yer2[i])/(com.xther3[i]-com.xther2[i])

        if com.laster[i]-liner <= 0: # go to 3
            if com.xthar>com.xther3[i]+0.01:
                  terr = ['  (..=%.2f)  ' % com.xthar,
                          '  %d (..=%.2f)' % (i,com.xther3[i]),
                         ]
                  mhk5.ermhks (terr)
            if com.r3[i]!=0.0:
                mhk5.ermhks(['     %d    = 0.00' % i])
            com.xther1[i] = com.xther2[i]
            com.yer1[i]   = com.yer2[i]
            com.ai1[i]    = com.ai2[i]
            com.xther2[i] = com.xther3[i]
            com.yer2[i]   = com.yer3[i]
            com.r2[i]     = com.r3[i]
            com.t[i]=0.0
            com.xshm1=1.0e30
            com.xshm2=1.0e30
            com.xstk=1.0e30
            com.xkli=(com.xthar+com.xther2[i])*0.5-1.25/com.pklx
            return liner # go to 30

        while True:
            if liner>=com.laster[i]:
                terr = ['  (..=%.2f)  ' % com.xthar,
                        '  %d (..=%.2f)' % (i,com.xther3[i]),
                       ]
                mhk5.ermhks (terr)
            com.xther1[i]=com.xther2[i]
            com.yer1[i]=com.yer2[i]
            com.ai1[i]=com.ai2[i]
            com.xther2[i]=com.xther3[i]
            com.yer2[i]=com.yer3[i]
            com.r2[i]=com.r3[i]
            liner=liner+1
            com.xther3[i],com.yer3[i],com.r3[i]=com.uTer.readrec(rec=liner)   # read (7,rec=liner)com.xther3[i],com.yer3[i],r3[i]
            if liner>=com.laster[i] and com.r3[i]!=0.0: # go to 130
                mhk5.ermhks(['     %d    = 0.00' % i])
            com.ai2[i]=(com.yer3[i]-com.yer2[i])/(com.xther3[i]-com.xther2[i])
            com.t[i]=com.r2[i]*fabs(com.ai2[i]-com.ai1[i])*0.5
            if com.xthar<=com.xther2[i]+com.t[i]: break   # go to 3

        if i!=com.keryth: return liner    # go to 30
        com.xshm1=com.xther2[i]-com.t[i]
        com.xshm2=com.xther2[i]+com.t[i]
        com.xstk=com.xther2[i]
        com.xkli=(com.xshm2p+com.xshm1)*0.5-1.25/com.pklx
        if com.xshm1<com.xthar: com.xshm1=1.0e30
        if com.xstk<com.xthar: com.xstk=1.0e30
        if com.xkli<com.xthar: com.xkli=1.0e30
        return liner   # go to 30
    
#=============================================================================

def ypkata():
      "Computation of (water)fall."
      dymax=(com.plaxar-com.platit-com.perype)/com.pkly
      akatp=1.0e30
      gymin=1.0e30
      gymax=-gymin
      npk=0
      proker()

      for ip in xrange(com.lasted+1):
#          com.xthed,(yee(ied[i]),i=1,ned),onp,akat = com.uTed.readrec(rec=ip) #read (16,rec=ip)com.xthed,(yee(ied[i]),i=1,ned),onp,akat
          com.xthed,yeed,com.onp,com.akat = com.uTed.readrec(rec=ip) #read (16,rec=ip)com.xthed,(yee(ied[i]),i=1,ned),onp,akat
    for i,yeed1 in enumerate(yeed): com.yee[com.ied[i]] = yeed1
    import mhk1
          mhk1.ypyer(True)
          ymin = min(com.yee)
          ymax = max(com.yee)
#-----------    
          while True:
              if ymin<gymin: gymin=ymin
              if ymax>gymax: gymax=ymax
              if gymax-gymin > dymax and npk<=1:
                  terr = ['     %s    ' % com.onp,
                          '      ',
                          '   %.2f      ' % dymax
                         ]
                  mhk5.ermhks(terr)
              if gymax-gymin <= dymax and akatp == 1.0e30: break
#---------------   
              com.yor = gyminp-com.perype / com.pkly
              com.yor = int(com.yor*com.pkly) / com.pkly
#              com.xthed,(yee(ied[i]),i=1,ned),onp1 = com.uTed.readrec(rec=ip-npk) #read (16, rec=ip-npk) com.xthed,(yee(ied[i]),i=1,ned),onp1
              xthed1,yeed,onp1, _ = com.uTed.readrec(rec=ip-npk) #read (16, rec=ip-npk) com.xthed,(yee(ied[i]),i=1,ned),onp1
              com.uTed.writerec(rec=ip-npk, data=(xthed1,yeed,onp1,com.yor))
              gymin=yminp
              gymax=ymaxp
              akatp=1.0e30
              npk=1
     #go to 12
#-----------  
          gyminp=gymin
          yminp=ymin
          ymaxp=ymax
          akatp=com.akat
          npk=npk+1

#----- 
      com.yor=gymin-com.perype/com.pkly
      com.yor=int(com.yor*com.pkly)/com.pkly
#      com.xthed,(yee(ied[i]),i=1,ned),onp = com.uTed.readrec(rec=lasted+1-npk)#read (16,rec=lasted+1-npk)com.xthed,(yee(ied[i]),i=1,ned),onp
      xthed1,yeed,onp1,_ = com.uTed.readrec(rec=com.lasted+1-npk)#read (16,rec=lasted+1-npk)com.xthed,(yee(ied[i]),i=1,ned),onp
      com.uTed.writerec(rec=com.lasted+1-npk, data=(xthed1,yeed,onp1,com.yor))

#==========================================================================

def sxenum (xx, prwtos):
      " ."
      uDxf = com.frw["dxf"]     
      strimog = xx-com.xnump < com.HS
      if not strimog: # then
          if not prwtos: #go to 5
              am=(com.xthed-com.xthedp)
              uDxf.thanDxfPlotNumber (xx-am*com.pklx*0.5-0.05,3.8,com.HS,am,90.0,com.ndxth)
          x=(com.xthed-com.xkmhd) % com.xthmod
          if com.ndxth==2: x=(com.xthed-com.xkmhd) % 100.0
          uDxf.thanDxfPlotNumber (xx,2.7,com.HS,x,90.0,com.ndxth)
      uDxf.thanDxfPlot (xx,3.7,3)
      uDxf.thanDxfPlot (xx,4.6,2)
      if not strimog:# go to 2
          uDxf.thanDxfPlotSymbol (xx,4.7,com.HS,com.onp,90.0)
          yy=5.5
          for i in xrange(com.nyee):
              m=com.icod[i] % 4
#c               if m==3: continue  # go to 3
              if m==0 or (not com.oxiery):
                  uDxf.thanDxfPlotNumber (xx,yy+0.1,com.HS,com.yee[i],90.0,2)
              yy+=com.DYGR
          com.xnump=xx

#-----     

      yedmax = max([com.yee[ied1] for ied1 in com.ied])
      yy=(yedmax-com.yor)*com.pkly+com.platit
      katgram(xx, yy)

      if com.akat!=1.0e30: #then
          dl = "h=%.1f" % com.akat
#c          uDxf.thanDxfPlotSymbol (xx-0.1,com.platit+0.1,0.17,'=',90.0)
#c          uDxf.thanDxfPlotNumber (xx-0.1,com.platit+0.45,com.HS,akat,90.0,1)
          uDxf.thanDxfPlotSymbol (xx-0.1,com.platit+0.1,0.17,dl,90.0)
          yy=max((yy, (yedmax-com.akat)*com.pkly+com.platit))

          uDxf.thanDxfSetLayer('noplot')        #thanasis2007_06_07:aid dxf read of grade line
          uDxf.thanDxfPlotPoint(xx, com.platit)
          uDxf.thanDxfPlotSymbol(xx-0.1,com.platit+0.1,0.17,dl,90.0)
          uDxf.thanDxfSetLayer('TEXTL')
          uDxf.thanDxfPlot (xx, yy, 3)

#------ 
      if com.oxiery: return
      if com.keryth==0: return
      if strimog: return
      yy=(com.yee[com.keryth]-com.yor)*com.pkly+com.platit
      if com.dxom>=0.0: uDxf.thanDxfPlotNumber(xx+0.25,yy+0.2,com.HS,com.dxom,90.0,2)
      else:             uDxf.thanDxfPlotNumber(xx+0.25,yy-0.9,com.HS,com.dxom,90.0,2)

#========================================================================

def katgram (xx, yy):
      "Plot vertical line with possible freatio."
      uDxf = com.frw["dxf"]
      uDxf.thanDxfPlot(xx, com.platit, 3)
      if com.sxedfreat  and  com.onp[:1] == '':
          yyfr = hfr * com.pkly
          xxfr = pfr * com.pklx * 0.5
          uDxf.thanDxfPlot (xx,      yy-yyfr, 2)
          uDxf.thanDxfPlot (xx-xxfr, yy-yyfr, 2)
          uDxf.thanDxfPlot (xx-xxfr, yy,      2)
          uDxf.thanDxfPlot (xx+xxfr, yy,      2)
          uDxf.thanDxfPlot (xx+xxfr, yy-yyfr, 2)
          uDxf.thanDxfPlot (xx-xxfr, yy-yyfr, 2)
          uDxf.thanDxfPlot (xx,      yy,      3)
      else:
          uDxf.thanDxfPlot (xx, yy, 2)

#=======================================================================

def sxelin (xx):
      "  /."
#-----  /
#      k =   
#      i =         
#      m =    i (      )

      uDxf = com.frw["dxf"]      
      antist=True
      for k in xrange(com.nyee): #do 30 k=1, nyee
        i=k
        ip = com.icod[i] / 4
#c        if (ip==0) call chpen (ipenl)     ! 9-7-1997
#c        if (ip==1) call chpen (ipenx)     ! 9-7-1997
        uDxf.thanDxfSetLayer(com.laygram[i])  # 9-7-1997
        dy = 0.0
        while True:
            m=com.icod[i] % 4
            if m!=3: break   # go to 32
            dy+=com.yer1[i]
            i=int(com.r1[i])

        if m==0:         #    #go to 40
            linant (k,com.xthedp,com.yeep[i]+dy,com.xthed,com.yee[i]+dy,antist)
            antist = not antist
        elif com.oxiery: 
            continue               # go to 30
        elif m==1:       #              # go to 50
            antist = not sxelinOdop(xx, i, dy, antist)
        elif (m==2):     #                  # go to 30
            if (com.xthedp>com.xther1[i]):   # go to 51
                linant(k,com.xthedp,com.yeep[i]+dy,com.xthed,com.yee[i]+dy,antist)
            else:    # go to 60
                linant (k,com.xthedp,com.yeep[i]+dy,com.xther1[i],com.yer1[i]+dy, antist)
                linant (k,com.xther1[i],com.yer1[i]+dy,com.xther1[i],com.r1[i]+dy,antist)
                linant (k,com.xther1[i],com.r1[i]+dy,com.xthed,com.yee[i]+dy,antist)
            antist=not antist

      if com.akat!=1.0e30: com.yor=com.akat

#-----  

      uDxf.thanDxfSetLayer ('TEXTL')
      if xx-com.xak >= 60.0:
          com.xak = xx
          if com.drawguidelines:
              uDxf.thanDxfPlot (com.xak-3.0, com.plaxar+com.plxm+com.um, 3)
              uDxf.thanDxfPlot (com.xak,     com.plaxar+com.plxm+com.um, 2)
          uDxf.thanDxfPlot (com.xak, com.plaxar+com.plxm, 3)
          uDxf.thanDxfLocref (com.xak,com.plaxar+com.plxm,1.0,1.0)
      
def sxelinOdop (xx, i, dy, antist):
            "Draw grade line of highway."
            xtemp=com.xthedp
            ytemp=com.yeep[i]
            if xtemp<=com.xther2[i]-com.t[i]:        # go to 41
                if (com.xthed<=com.xther2[i]-com.t[i]):  #go to 42
                    linant(i,xtemp,com.yeep[i]+dy,com.xthed,com.yee[i]+dy,antist)
                    return antist
                xtemp=com.xther2[i]-com.t[i]
                ytemp=com.yer1[i]+com.ai1[i]*(xtemp-com.xther1[i])
                linant(i,com.xthedp,com.yeep[i]+dy,xtemp,ytemp+dy,antist)

            if (com.xthed<=com.xther2[i]+com.t[i]): # go to 43
                elpant (i,xtemp,ytemp,com.xthed,com.yee[i],antist)
                if i==com.keryth:
                    antist = not antist
                    eyteia(i,xtemp,com.xthed,antist)
                return antist
            xtemp1=com.xther2[i]+com.t[i]
            ytemp1=com.yer2[i]+com.ai2[i]*(xtemp1-com.xther2[i])
            elpant(i,xtemp,ytemp+dy,xtemp1,ytemp1+dy,antist)
            linant(i,xtemp1,ytemp1+dy,com.xthed,com.yee[i]+dy,antist)
            if i==com.keryth:
                antist = not antist
                eyteia(i,xtemp,xtemp1,antist)
            return antist
      
def linant (i,x1,y1,x2,y2,antist):
      "Plot a line, possible reversed."
      uDxf = com.frw["dxf"]      
      xp1 = (x1-com.xthar)*com.pklx
      yp1 = (y1-com.yor)*com.pkly+com.platit
      xp2 = (x2-com.xthar)*com.pklx
      yp2 = (y2-com.yor)*com.pkly+com.platit

      if com.diak1[i][0] == 0.0:
          if antist:
              uDxf.thanDxfPlot (xp2, yp2, 3)
              uDxf.thanDxfPlot (xp1, yp1, 2)
          else:
              uDxf.thanDxfPlot (xp1, yp1, 3)
              uDxf.thanDxfPlot (xp2, yp2, 2)
      else:
#c          call defchn (diak1[i],diak2[i],diak3[i])
          uDxf.thanDxfSetLtype ('dashed2')
          if antist:
#c              call chain (xp2,yp2,xp1,yp1)
              uDxf.thanDxfPlot (xp2,yp2,3)
              uDxf.thanDxfPlot (xp1,yp1,2)
          else:
#c              call chain (xp1,yp1,xp2,yp2)
              uDxf.thanDxfPlot (xp1,yp1,3)
              uDxf.thanDxfPlot (xp2,yp2,2)
          uDxf.thanDxfSetLtype ('continuous')


def eyteia(i,x1,x2,antist):
      "Plot dotted line to the corner of the vertical curve."
      uDxf = com.frw["dxf"]      
      if x1<=com.xther2[i]:
          y1=com.yer1[i]+com.ai1[i]*(x1-com.xther1[i])
      else:
          y1=com.yer2[i]+com.ai2[i]*(x1-com.xther2[i])

      if x2<=com.xther2[i]:
          y2=com.yer1[i]+com.ai1[i]*(x2-com.xther1[i])
      else:
          y2=com.yer2[i]+com.ai2[i]*(x2-com.xther2[i])

#------      x1  x2

      uDxf.thanDxfSetLtype ('dotr')
      xp1=(x1-com.xthar)*com.pklx
      yp1=(y1-com.yor)*com.pkly+com.platit

      if x1<com.xther2[i] and x2>com.xther2[i]:
          xp2=(com.xther2[i]-com.xthar)*com.pklx
          yp2=(com.yer2[i]-com.yor)*com.pkly+com.platit
          if antist:
              uDxf.thanDxfPlot (xp2,yp2,3)
              uDxf.thanDxfPlot (xp1,yp1,2)
          else:
              uDxf.thanDxfPlot (xp1,yp1,3)
              uDxf.thanDxfPlot (xp2,yp2,2)
          xp1=xp2
          yp1=yp2

      xp2=(x2-com.xthar)*com.pklx
      yp2=(y2-com.yor)*com.pkly+com.platit
      if antist:
          uDxf.thanDxfPlot (xp2,yp2,3)
          uDxf.thanDxfPlot (xp1,yp1,2)
      else:
          uDxf.thanDxfPlot (xp1,yp1,3)
          uDxf.thanDxfPlot (xp2,yp2,2)

      uDxf.thanDxfSetLtype ('bylayer')


def elpant (i,x1,y1,x2,y2,antist):
      "Plot an elliptical arc, possibly reversed."
      if com.r2[i]==0.0: return
      uDxf = com.frw["dxf"]
      PI2=2.0*com.PI
      xp1=(x1-com.xthar)*com.pklx
      yp1=(y1-com.yor)*com.pkly+com.platit
      xp2=(x2-com.xthar)*com.pklx
      yp2=(y2-com.yor)*com.pkly+com.platit
      if xp2-xp1<=0.1:  # go to 20
          uDxf.thanDxfPlot (xp1,yp1,3)
          uDxf.thanDxfPlot (xp2,yp2,2)
          return

      th=atan2((com.xther2[i]-com.xther1[i]),com.yer2[i]-com.yer1[i])+0.5*pi
      if com.ai2[i]-com.ai1[i]>=0.0: th=th+com.PI
      xc=((com.xther2[i]-com.xthar)-com.t[i]+com.r2[i]*sin(th))*com.pklx
      yc=com.yer1[i]+com.ai1[i]*((com.xther2[i]-com.xther1[i])-com.t[i])
      yc=(yc+com.r2[i]*cos(th)-com.yor)*com.pkly+com.platit

      th=270.0
      idr=0
      if com.ai2[i]-com.ai1[i]<0.0: #go to 2
          theta=90.0
          idr=1
      if not antist: #go to 10
          elips1(uDxf, xp1,yp1,xp2,yp2,xc,yc,com.r2[i]*com.pkly,com.r2[i]*com.pklx,th,idr,3)
      else:
        th=th+180.0
        elips1(uDxf, xp2,yp2,xp1,yp1,xc,yc,com.r2[i]*com.pkly,com.r2[i]*com.pklx,th,idr-1,3)

#==========================================================================

def sxeakr():
      "  ."
      xx = (com.xthed-com.xthar) * com.pklx
      if (xx-com.xak < 60.0): return xx
      uDxf = com.frw["dxf"]
      uDxf.thanDxfSetLayer ('TEXTL')
      if com.drawguidelines:
          uDxf.thanDxfPlot (xx-3.0, 0.0-com.dm, 3)
          uDxf.thanDxfPlot (xx,     0.0-com.dm, 2)
      return xx

#======================================================================

formx = "%-8s" + 8*"%10.2f" + "\n"
def sxekam (xxtm):
      "Plot horizontal curves if available."

#-----

#c     rewind 16
      uDxf = com.frw["dxf"]
      com.uTeo.rewind()
      ip=-1
      xthtp=com.xthar
      uDxf.thanDxfPlot (0.0,1.5,3)
#
#-------      
#          
#
      while not com.uTeo.eof():
        onp,v,b,r,dr,e,d = com.uTeo.readrec()

#c       call msts (' ',1,1,1,onp,4,1,i)
        onp = ''+onp[1:]
        while True:
            ip+=1
            if ip>com.lasted: 
                terr = ['    %s' % onp,
                        '      .',
           ]
                mhk5.ermhks(terr)
#            com.xthed,(yee(ied[i]),i=1,ned),onpm = com.uTed.readrec(rec=ip)  #read (16,rec=ip)com.xthed,(yee(ied[i]),i=1,ned),onpm
            com.xthed,yeed,onpm,_ = com.uTed.readrec(rec=ip)  #read (16,rec=ip)com.xthed,(yee(ied[i]),i=1,ned),onpm
            if onpm==onp: break
        xtha=com.xthed

        onp1 = '' + onp[1:]
        onp  = '' + onp[1:]
  while True:
            ip+=1
            if ip>com.lasted:
                terr = ['    %s    %s' % (onp1, onp),
                        '      .',
                ]
                mhk5.ermhks(terr)
#            com.xthed,(yee(ied[i]),i=1,ned),onpm = com.uTed.readrec(rec=ip) #read (16,rec=ip)com.xthed,(yee(ied[i]),i=1,ned),onpm
            com.xthed,yeed,onpm,_ = com.uTed.readrec(rec=ip) #read (16,rec=ip)com.xthed,(yee(ied[i]),i=1,ned),onpm
            if onpm==onp:
                xthx=xtha       # Start of circular arc is point A
          break
            elif onpm==onp1:
                xthx=com.xthed  # Start of circular arc is point Omega
    break
        onp = '' + onp[1:]
        while True:
            ip+=1
            if ip>com.lasted:
                terr = ['    %s' % onp,
                        '      .',
           ]
                mhk5.ermhks(terr)
#            com.xthed,(yee(ied[i]),i=1,ned),onpm = com.uTed.readrec(rec=ip) #read (16,rec=ip)com.xthed,(yee(ied[i]),i=1,ned),onpm
            com.xthed,yeed,onpm,_ = com.uTed.readrec(rec=ip) #read (16,rec=ip)com.xthed,(yee(ied[i]),i=1,ned),onpm
            if onpm==onp: break

#-------

        xx=((xthtp+xtha)*0.5-com.xthar)*com.pklx
        uDxf.thanDxfPlot10 (xx,1.5,2)
        uDxf.thanDxfPlotNumber (xx-0.9,1.6,com.HS,(xtha-xthtp),0.0,2)
        uDxf.thanDxfPlot10 (xx,1.5,3)

        xx=(xtha-com.xthar)*com.pklx
        uDxf.thanDxfPlot10 (xx,1.5,2)
        yy=1.5+fsign(0.4,-r)
        uDxf.thanDxfPlot10 (xx,yy,2)

        xx=((com.xthed+xtha)*0.5-com.xthar)*com.pklx
        uDxf.thanDxfPlot10 (xx,yy,2)

        al=com.xthed-xtha
        s=xthx-xtha
        uDxf.thanDxfPlotSymbol (xx-2.0,1.45,com.HS,'b=',0.0)
        uDxf.thanDxfPlotNumber (xx-1.65,1.45,com.HS,b,0.0,2)
        uDxf.thanDxfPlotSymbol (xx-0.55,1.45,com.HS,'r=',0.0)
        uDxf.thanDxfPlotNumber (xx-0.2,1.45,com.HS,fabs(r),0.0,-1)
        uDxf.thanDxfPlotSymbol (xx+0.9,1.45,com.HS,'dr=',0.0)
        uDxf.thanDxfPlotNumber (xx+1.4,1.45,com.HS,dr,0.0,2)
        uDxf.thanDxfPlotSymbol (xx-2.0,1.2,com.HS,'=',0.0)
        uDxf.thanDxfPlotNumber (xx-1.65,1.2,com.HS,d,0.0,2)
        uDxf.thanDxfPlotSymbol (xx-0.7,1.2,com.HS,'l=',0.0)
        uDxf.thanDxfPlotNumber (xx-0.35,1.2,com.HS,al,0.0,2)
        uDxf.thanDxfPlotSymbol (xx+0.75,1.2,com.HS,'v=',0.0)
        uDxf.thanDxfPlotNumber (xx+1.1,1.2,com.HS,v,0.0,-1)

        uDxf.thanDxfPlot10 (xx,yy,3)
        xx=(com.xthed-com.xthar)*com.pklx
        uDxf.thanDxfPlot10 (xx,yy,2)
        uDxf.thanDxfPlot (xx,1.5,2)

        xthtp=com.xthed
#c       call msts (' ',1,1,1,onp,4,1,i)
        onp = '' + onp[1:]
        com.frw["oka"].write(formx % (onp,v,b,r,dr,e,d,al,s))

#-----.   

      xtha=com.xthedp
      xx=((xthtp+xtha)*0.5-com.xthar)*com.pklx
      uDxf.thanDxfPlot10 (xx,1.5,2)
      uDxf.thanDxfPlotNumber (xx-0.9,1.6,com.HS,(xtha-xthtp),0.0,2)
      uDxf.thanDxfPlot10 (xx,1.5,3)
      uDxf.thanDxfPlot10 (xxtm,1.5,2)

#======================================================================

def orkam (xxtm):
      "Plot lines to make drawing look tidy."

#-----   

      uDxf = com.frw["dxf"]
      xxa=-0.5
      xxt=xxtm+0.5
      uDxf.thanDxfPlot (xxt,0.0,3)
      uDxf.thanDxfPlot10 (xxa,0.0,2)
      uDxf.thanDxfPlot (xxa,com.platit,2)

#-----    

      if not com.oxikam:
          sxekam (xxtm)
          xxa=xxt
          xxt=-0.5

#-----    

      uDxf.thanDxfPlot (xxa,1.0,3)
      uDxf.thanDxfPlot10 (xxt,1.0,2)

      uDxf.thanDxfPlot (xxt,2.0,3)
      uDxf.thanDxfPlot10 (xxa,2.0,2)

      uDxf.thanDxfPlot (xxa,2.6,3)
      uDxf.thanDxfPlot10 (xxt,2.6,2)

      uDxf.thanDxfPlot (xxt,3.7,3)
      uDxf.thanDxfPlot10 (xxa,3.7,2)

      uDxf.thanDxfPlot (xxa,4.6,3)
      uDxf.thanDxfPlot10 (xxt,4.6,2)

      uDxf.thanDxfPlot (xxt,5.5,3)
      uDxf.thanDxfPlot10 (xxa,5.5,2)

      yy=5.5
      for i in xrange(com.nyee):
#c       if (mod(com.icod[i],4)==3) go to 20
          yy+=com.DYGR
          uDxf.thanDxfPlot (xxa,yy,3)
          uDxf.thanDxfPlot10 (xxt,yy,2)
          xxa, xxt = xxt, xxa

      if xxa>xxt: xxt=xxa
      uDxf.thanDxfPlot10 (xxt,com.platit,3)
      uDxf.thanDxfPlot (xxt,0.0,2)
      uDxf.thanDxfPlot (xxt+4.5,0.0,-3)

#==============================================================

it1 = " - ", " / "
it2 = "-", " "
def titlos():
      "Plots the title of the section."
      if com.odopoi: ie = 0
      else:          ie = 1
      uDxf = com.frw["dxf"]

#-----  

      uDxf.thanDxfSetLayer ('TEXTX')
      uDxf.thanDxfPlotSymbol (0.5,0.4,0.25,it1[ie],0.0)

      uDxf.thanDxfPlot (6.0,1.0,3)
      uDxf.thanDxfPlot (0.0,1.0,2)
      uDxf.thanDxfPlotSymbol (0.5,1.4,0.25,it2[ie],0.0)

      uDxf.thanDxfPlot (6.0,2.0,3)
      uDxf.thanDxfPlot (0.0,2.0,2)
      uDxf.thanDxfPlotSymbol (0.5,2.1,0.25,'',0.0)

      uDxf.thanDxfPlot (6.0,2.6,3)
      uDxf.thanDxfPlot (0.0,2.6,2)
      uDxf.thanDxfPlotSymbol (0.5,3.0,0.25,'  ',0.0)

      uDxf.thanDxfPlot (6.0,3.7,3)
      uDxf.thanDxfPlot (0.0,3.7,2)
      uDxf.thanDxfPlotSymbol (0.5,4.0,0.25,' ',0.0)

      uDxf.thanDxfPlot (6.0,4.6,3)
      uDxf.thanDxfPlot (0.0,4.6,2)
      uDxf.thanDxfPlotSymbol (0.5,5.0,0.25,' ',0.0)

#-----  

      com.platit=5.5
      for i in xrange(com.nyee):
          if com.icod1[i] % 4 == 3: continue      #Thanasis2007_09_09:icod(i)->icod1(i)
          uDxf.thanDxfPlot (6.0,com.platit,3)
          uDxf.thanDxfPlot (0.0,com.platit,2)
          uDxf.thanDxfPlotSymbol (0.5,com.platit+0.4,0.25,com.ititl[i],0.0)
          com.platit += com.DYGR
      titper=com.platit+com.perype

#----- 

      uDxf.thanDxfPlot (6.0,com.platit,3)
      uDxf.thanDxfPlot (0.0,com.platit,2)

      temp1 = '  = 1/%d' % int(com.aklx)
      uDxf.thanDxfPlotSymbol (0.0,com.platit+0.5,0.25, temp1, 0.0)
      temp2 = '   = 1/%d' % int(com.akly)
      uDxf.thanDxfPlotSymbol (0.0,com.platit+1.2,0.25, temp2, 0.0)

      uDxf.thanDxfSetLayer('noplot')        #thanasis2007_06_07:aid dxf read of grade line
      uDxf.thanDxfPlotSymbol (0.0,com.platit+0.5,0.25, temp1, 0.0)
      uDxf.thanDxfPlotSymbol (0.0,com.platit+1.2,0.25, temp2, 0.0)
      uDxf.thanDxfSetLayer ('TEXTX')

#-----   -    

      uDxf.thanDxfPlot (6.0,com.platit,3)
      uDxf.thanDxfPlot (6.0,0.0,2)
      uDxf.thanDxfPlot (0.0,0.0,2)
      uDxf.thanDxfPlot (0.0,com.platit,2)
      uDxf.thanDxfPlot (6.5,0.0,-3)
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.