示例#1
0
void    MakeExtended4T(void)
{
  if ((fExt4TFlag == true) && (mpfExt4EnblCan[ibDig] == true))
  {
    ShowHi(szExtended4T);
    Clear(); sprintf(szLo+3,"глубина: %u", bExt4TMonths);
    DelayInf();

    ibMonthP = 0xFF;

    uchar m;
    for (m=0; m<bExt4TMonths; m++)
    {
      if (fKey == true) break;

      uchar ibMon = (bMONTHS + ibHardMon - m) % bMONTHS;
      LoadExt4TValues(ibMon);

      status bStatus = mpCntMonCan4T[ibDig].bStatus;
      if ((bStatus == ST_OK) || (bStatus == ST_NOTPRESENTED)) continue;

      uchar t;
      for (t=0; t<bTARIFFS; t++)
      {
        Clear(); sprintf(szLo+3,"мес¤ц: %-2u",ibMon+1); sprintf(szLo+14,"T%u",t+1); DelayInf();

        if (MakeDevices(ibMon, t) == 0) break;
        ibMonthP = ibMon;
      }

      SaveExt4TValues(ibMon);
    }

    ShowCanalNumber(ibDig);
    Clear();
  }
}
示例#2
0
void    Automatic(uchar  ibMin, uchar  ibMax)
{
uchar   i;

      enKeyboard = KBD_POSTENTER;

      ShowHi(szAutomatic);
      Clear(); DelayInf();

      for (ibPort=0; ibPort<bPORTS; ibPort++)
      {
        ShowPortDelayLo(ibPort);
        DelayInf(); fKey = 0;
      }

      Clear();
      InitConnectKey();

      ibX = 0;

      for (i=ibMin; i<ibMax; i++)
      {
        if (GetDigitalDevice(i) == 0) continue;

        uchar bRes = 0;

        LoadCurrDigital(i);
        ibPort = diCurr.ibPort;

        if (GetDigitalDevice(i) != 0)
        {
          if (StreamPortCan(GetDigitalPort(i),i) == 0)
          { bRes = 0xEE; break; }
        }

        ShowCanalNumber(i);
        ShowProgress(12,(ulong)100*i/(bCANALS-1)); DelayInf();

        if (LoadConnect(i) == 0) break;
        Clear();

        if (mpboEnblCan[i] == false)
        {
          ShowLo(szBlocked);
          DelayMsg();
        }
        else switch (diCurr.bDevice)
        {
#ifndef SKIP_A
          case 15:
          case 1:  if (AutomaticA() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_B
          case 12: if (AutomaticJ() != 1) bRes = 0xEE; break;

          case 8:
          case 2:  if (AutomaticB() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_C
          case 3:  if (AutomaticC() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_D
          case 4:  if (AutomaticD() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_E
          case 7:
          case 5:  if (AutomaticE() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_F
          case 6:  if (AutomaticF() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_G
          case 9:  if (AutomaticG() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_H
          case 10: if (AutomaticH() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_I
          case 11: if (AutomaticI() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_K
          case 14:
          case 13: if (AutomaticK() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_L
          case 17:
          case 16: if (AutomaticK() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_M
          case 18: if (AutomaticM() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_N
          case 19: if (AutomaticN() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_O
          case 20: if (AutomaticO() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_P
          case 21: if (AutomaticP() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_Q
          case 22: if (AutomaticK() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_R
          case 23: if (AutomaticR() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_S
          case 24: if (AutomaticS() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_T
          case 25: if (AutomaticT() != 1) bRes = 0xEE; break;
#endif

#ifndef SKIP_V
          case 27: if (AutomaticV() != 1) bRes = 0xEE; break;
#endif
        }

        SaveConnect();

        if (bRes == 0xEE)
        {
          ibX++;
          Error(); Beep(); DelayMsg();
        }

        if (fKey == true) bRes = 0xFF;
        fKey = 0;

        if (bRes == 0xFF) break;
      }

      ShowHi(szAutomatic);
      if (ibX != 0) { Clear(); sprintf(szLo+3, "ошибок: %-2u", ibX); LongBeep(); DelayMsg(); }  else OK();

      DelayMsg();
      KeyBreakConnect();

      SaveFactors();
}