⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 walker.prg

📁 抄表机的抄表程序源码
💻 PRG
📖 第 1 页 / 共 2 页
字号:
    redraw = .F.
  endif
  return    


procedure SearchMeterNo

  if eof()
    return
  endif
  t = YBH
  do _LcdPullMode with 0
  if Httype = 6
     do _LcdWinOpen with 44,12,81,113,2,16
  else 
     do _LcdWinOpen with 11,12,47,113,4,16
  endif      
  do _ShowCursor
  do _LcdPullMode with 0
  @0,0 say '输入电表编号'
  @1,1 get t
  read
  do _HideCursor
  c = Recno()
  if updated()
    f = _FastLocate('YBH', '=', t, c) .or. _FastLocate('YBH', '=', t, -c)
    if f
      redraw = .T.
    else
      l = Show2LnBox('电表表号', '没有找到', 0, 0)
      go c
    endif
  endif
  do _LcdWinClose
  return

procedure SearchUserBH

  if eof()
    return
  endif
  t = BH
  do _LcdPullMode with 0
  if Httype = 6
     do _LcdWinOpen with 44,12,81,113,2,16
  else
     do _LcdWinOpen with 11,12,47,113,4,16
  endif   
  do _ShowCursor
  do _LcdPullMode with 0
  @0,0 say '输入电脑编号'
  @1,1 get t
  read
  do _HideCursor
  c = Recno()
  if updated()
    f = _FastLocate('BH', '=', t, c) .or. _FastLocate('BH', '=', t, -c)
    if f
      redraw = .T.
    else
      l = Show2LnBox('电脑表号', '没有找到', 0, 0)
      go c
    endif
  endif
  do _LcdWinClose
  return

procedure ShowInform

  if Httype = 6 
     do _LcdWinOpen with 30,10, 99,120, 4,10
  else
     do _LcdWinOpen with 0,10, 63, 120, 6, 10
  endif   
  do _LcdPullMode with 0
  @1,0 say '  正在统计'
  @2,0 say ' 请等待....'

  countNormal = 0
  countBad = 0
  i = 1
  t = RecNo()
  go top
  do while .not. eof()
    if CBBZ = 1
      do _inc with countNormal
    endif
     if CBBZ > 1
       do _inc with countBad
     endif
    skip
  enddo
  go t
  if Httype = 6
     do _LcdWinClose
     do _LcdWinOpen with 14,10,115,120, 6,10
     do _LcdPullMode with 0
  else
     clear
  endif   
  @0,0 say '当前记录:'+Str(RecNo(),1)
  @1,0 say '应抄表数:'+Str(RecCount(),1)
  @2,0 say '已抄表数:'+Str(countNormal,1)
  @3,0 say '换表数:'+Str(countBad,1)
  @4,0 say '日期:'+DtoC(Date())
  @5,0 say '时间:'+Time()
  k = Inkey(0)
  do _LcdWinClose
  return

procedure EnterServer
  select 1
  use
  select 2
  use
  clear
  do while .T.
    if (.not. File("cbdata.dbf"))
      do Show2lnBox with '未下装数据', '任一键继续', 0, 0
    endif
    do _EnterServer
    if File("cbdata.dbf")
      exit
    endif
  enddo
  clear
  select 1
  use cbdata

  redraw = .T.
  return

procedure SearchNotRead
parameters start
  if eof()
    return
  endif
  t = RecNo()
  go start
  do while .not. eof()
    if CBBZ = 0
      exit
    endif
    skip 1
  enddo
  if .not. eof()
    redraw = .T.
  else
    if start > 1
      do Show2LnBox with '本记录以后','无未抄电表', 0, 0
    else
      do  Show2LnBox  with ' 所有抄表', '工作已完成', 0, 0
    endif
    go t
  endif
  return

procedure ShowHMPage
  l = 0
  oldcur = recno()
  clear
  if Httype = 6
     do while .not. eof() .and. (l < 8)
       @l,1 say HM
       skip
       l = l + 1
     enddo
  else
     do while .not. eof() .and. (l < 4)
      @l,1 say HM
     skip
       l = l + 1
     enddo
  endif      
  go oldcur
  return


procedure SearchHM
  if Httype = 6
     do _LcdWinopen with 0,0, 128, 128, 8, 25
  else
     do _LcdWinopen with 0,0, 64, 128, 4, 25
  endif   
  do _LcdPullMode with 0
  ks=0
  r0=recno()
  do while ks<>key_Enter
    do ShowHMPage
    comfirm = .F.
    i=0
    do while .not. comfirm
      @i,0 say '>'
      ks = inkey(0)
      @i,0 say ' '
      do case
      case ks=KEY_ESC
        do _LcdWinclose
        go r0
        redraw = .F.
        return
      case ks=asc('+')
        if Httype = 6
          if recno()>7
            skip(-8)
          else
            go top
          endif
        else
          if recno()>3
            skip(-4)
          else
            go top
          endif
        endif  
        comfirm = .T.
      case ks=asc('-')
        if Httype = 6
           skip 8
        else
           skip 4
        endif   
        if eof()
          go bottom
        endif
        comfirm = .T.
      case ks=key_UP
        skip(-1)
        if bof()
          go top
        endif
        if i>0
          i=i-1
        else
          comfirm = .T.
        endif
      case ks=key_Down
        skip
        if eof()
          go bottom
        endif
        if Httype = 6
          if i<7
            i=i+1
          else
            comfirm = .T.
          endif
        else
          if i<3
            i=i+1
          else
            comfirm = .T.
          endif  
        endif  
      case ks=key_Enter
        comfirm = .T.
      case ks=asc('*')
        go top
        comfirm = .T.
      case ks=asc('/')
        go bottom
        comfirm = .T.
      endcase
    enddo
  enddo
  redraw = .T.
  do _LcdWinclose
  return

procedure ShowNext
  ks =0
  do while ks<>asc(' ')
    clear
    V2=BYG1
    if V2<SYG1
      do case
      case SYG1 < 1000
        V2=V2+1000
      case SYG1 < 10000
        V2=V2+10000
      other
        V2=V2+100000
      endcase
    endif
    if CBBZ=1
      v0 = (v2-SYG1)*BL
    else
    *  if val(YC)>1
    *    v0 = PJ
    *  else
        v0 = 0
    * endif
    endif
    @0,0 say BH
    if substr(BH,8,1)='W'
      set color to n/w
      @0,14 say '无功'
      set color to w/n
    endif
    @1,0 say '子母关系:'
    ?? flagBZ(val(BZ)+1)
    set numwidth to 8
    set decimal to 0
    @2,0 say '上月量:'
    ?? CS1
    @3,0 say '今月量:'
    ?? v0
    set numwidth to 8
    set decimal to 1
    ks=inkey(0)
    do case
    case ks=key_Up
      skip -1
   *  do while (right(ybh,1)='W').and.(.not.bof())
   *    skip -1
   *  enddo
      if bof()
        go top
      endif
    case ks=key_Down
      skip 1
   *  do while (right(ybh,1)='W').and.(.not.eof())
   *    skip 1
   *  enddo
      if eof()
        go bott
      endif
    case ks=asc('*')
      go top
    case ks=asc('/')
      go bottom
    case ks=asc(' ')
*      if (k>'5').and.(right(ybh,1)='Y')
*       skip
*       ks=0
*      else
*        if k>'5'
*          skip -1
*        endif
*      endif
    endcase
  enddo
  redraw = .T.
  return


procedure SetPercent

  if Httype = 6 
     do _LcdWinOpen with 44,8, 81,128, 2,16
  else
     do _LcdWinopen with 9,8, 47, 125, 4, 16
  endif   
  do _LcdPullMode with 0
  @0,0 say '差数比较百分率'
  do while .t.
    @1,0 say '              '
    @1,0 say ' ±'
    ?? Percent
    ??'%'
    ks = 0
    do while ks=0
      ks = inkey(0)
    enddo
    do case
    case ks=asc('+')
      if Percent < 100
        Percent=Percent+10
      endif
    case ks=asc('-')
      if Percent >0
        Percent=percent-10
      endif
    case ks=key_Enter
      exit
    endcase
  enddo
  do _LcdWinClose
  return


procedure MeterReading

  if (.not. File("cbdata.dbf"))
    do EnterServer
  endif

  select 1
  use cbdata

  do while .not. exitBrowse
    if Httype = 6
       do DispThis28
    else 
       do DispThis18   
    endif   
    ks = InKey(0)
    do case
    case ks = KEY_ENTER
      do ReadThis
    case ks = KEY_DEL
      do BadMeter
    case ks = KEY_UP
      do LastRecord
    case ks = KEY_DOWN
      do NextRecord
    case ks = KEY_ASTERISK
      go top
      redraw = .T.
    case ks = KEY_SLANT
      go bottom
      redraw = .T.
    case ks = KEY_PLUS
      do SearchUserBH
    case ks = KEY_MINUS
      do SearchMeterNo
    case ks = KEY_LEFT
      do SearchNotRead with 1
    case ks = KEY_RIGHT
      do SearchNotRead with recno()
    case ks = asc(' ')
      do ShowNext
    case ks = asc('%')
      do SearchHM
    case ks = KEY_F1
      helpContext = 1
      do HelpHdl
      helpContext = 0
    case ks = KEY_BS
      @1,0 say '                        '
      if PointOfHM >1
         PointOfHM = 1
         @1,0 say HM
      else
        i = 1
        chinese = 0
        do while i < 9
           c1=substr(HM,i,1)
           if c1 > chr(159)
            chinese = iif(chinese=0,1,0)
           endif
          i=i+1
        enddo
        if chinese = 1
          i = i + 1
        endif
         c=right(HM,21-i)
        PointOfHM = i
         @1,0 say c
      endif
    case ks = KEY_F10
      m = MainMenu()
      do case
      case m=1
        do while password <> GetPassword('密码:')
        enddo
      case m=2
        do ShowInform
      case m=3
        do EnterServer
      case m=4
        do SetPercent
      case m=5
      	if Httype = 6
           do _LcdWinopen with 0,0,128,128, 8, 16
        else
           do _LcdWinopen with 0,0,64,128, 4, 16
        endif      
        clea
        do _ShowBattery
        do _LcdWinClose
      case m=6
        if ib_swith
          ib_swith = .f.
          * disable taskswitch
          * int 10h, ax=1438h, bx=0201h, cl=1
          do _int86 with 16, 5176, 513, 1, 0, 0, 0, 0, 0, 0
        else
          ib_swith = .t.
          * Enable taskswitch
          * int 10h, ax=1438h, bx=0201h, cl=0
          do _int86 with 16, 5176, 513, 0, 0, 0, 0, 0, 0, 0
        endif
      endcase
    endcase
  enddo

  return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -