Esempio n. 1
0
bool CXtfReader::GetXYXPos(INT_PT& p_)
{
    double _dX, _dY;
    string::size_type  _tPosX ,_tPosY;

    _tPosY = FindLabel('Y');
    if (_tPosY != string::npos)
    {
        m_nLinePos = _tPosY + 1;
        GetDouble(_dY);
        m_cModeInfo.cLastAxis = LABEL_asY;
        m_cModeInfo.cValid[LABEL_asY] = VALID_LABEL;
        p_.y =  _dY * g_fDataMult;
        m_cModeInfo.nXYZ[LABEL_asY] = p_.y;
    }

    _tPosX = FindLabel('X');
    if (_tPosX != string::npos)
    {
        m_nLinePos = _tPosX + 1;
        GetDouble(_dX);
        m_cModeInfo.cLastAxis = LABEL_asX;
        m_cModeInfo.cValid[LABEL_asX] = VALID_LABEL;
        p_.x =  _dX * g_fDataMult;
        m_cModeInfo.nXYZ[LABEL_asX] = p_.x;
    }

    if ((_tPosY == string::npos) && (_tPosX == string::npos))
    {

        if (m_cModeInfo.cLastAxis != INVALID_LABEL && FindFirstDigit(m_nLinePos))
        { 
            double _dVal;
            if (!GetDouble(_dVal))
                return false;
            if (LABEL_asY == m_cModeInfo.cLastAxis)
            {
                p_.y =  _dVal * g_fDataMult;
                m_cModeInfo.nXYZ[LABEL_asY] = p_.y;
            }
            else if (LABEL_asX == m_cModeInfo.cLastAxis)
            {
                p_.x =  _dVal * g_fDataMult;
                m_cModeInfo.nXYZ[LABEL_asX] = p_.x;
            }
            else
                return false;
        }
    }
    else if (_tPosX == string::npos)
    {
        if (m_cModeInfo.cValid[LABEL_asX] == VALID_LABEL)
        {
            p_.x = m_cModeInfo.nXYZ[LABEL_asX];
        }
        else
            return false;
    }
    else if (_tPosY == string::npos)
    {
        if (m_cModeInfo.cValid[LABEL_asY] == VALID_LABEL)
        {
            p_.y = m_cModeInfo.nXYZ[LABEL_asY];
        }
        else
            return false;
    }
    return true;
}
Esempio n. 2
0
void Do_FCode_Command(void)
{
  unsigned char FrameInstructionCode;
  int FIC_Ptr;
#ifdef USE_LVROM_LOG
  fprintf(LVROM_LOG,"%s\n",FCode_Buf);
  fflush(LVROM_LOG);
#endif

  /**************************
   * The FCodes listed in the documentation are: [DMS 02/12/2002]
   * !xy	- sound insert
   * #xy	- RC-5 command out via A/V Euroconnector
   * $0		- replay switch disable 
   * $1		- replay switch enable 
   * '		- Eject
   * )0		- Transmission delay off
   * )1		- Transmission delay on
   * *		- Halt (still mode)
   * *xxxxx+yy	- Repetitive halt and jump forward
   * *xxxxx-yy	- Repetitive halt and jump backward
   * +yy	- Instant jump forward yy tracks
   * ,0		- Standby (unload)
   * ,1		- On (load)
   * -yy	- Instant jump backward yy tracks
   * /		- Pause (halt + all muted)
   * :		- Reset to default values
   * ?F		- Picture number request
   * ?C		- Chapter number request
   * ?D		- Disc program status request
   * ?P		- Player status request
   * ?U		- User code request
   * ?=		- Revision level request
   * A0		- Audio 1-off
   * A1		- Audio 1-on
   * B0		- Audio 2-off
   * B1		- Audio 2-on
   * C0		- Chapter no display off
   * C1		- Chapter no display on
   * D0		- Picture no display off
   * D1		- Picture no display on
   * E0		- Video off
   * E1		- Video on
   * FxxxxxI	- Load picture number information register
   * FxxxxxS	- Load picture number stop register
   * FxxxxxR	- Load picture number then Still mode
   * FxxxxxN	- Load picture number then Normal play
   * FxxxxxQ	- Load picture number and continue previous play mode
   * H0		- Remote control not routed to computer
   * H1		- Remote control routed to computer
   * I0		- Local front-panel buttons disabled
   * I1		- Local front-panel buttons enabled
   * J0		- Remote control diabled
   * J1		- Remote control enabled
   * L		- Still forward
   * M		- Still reverse
   * N		- Normal play forward
   * Nxxxxx+yy	- Repetitive play forward and jump forward
   * Nxxxxx-yy	- Repetitive play forward and jump backward
   * O		- Play reverse
   * Oxxxxx+yy	- Play reverse and jump forward
   * Oxxxxx-yy	- Play reverse and jump forward jump backward
   * QxxR	- Goto chapter and halt
   * QxxN	- Goto chapter and play
   * QxxyyzzS	- Goto chapter and halt
   * SxxF	- Set fast speed value
   * SxxS	- Set slow speed value
   * TxxyyN	- Set fast speed value
   * TxxyyI	- Set slow speed value
   * U		- Slow motion forward
   * V		- Slow motion reverse
   * VPy	- Video overlay (VP1 is default)
   * VPX	- Request current VP mode
   * W		- Fast forward
   * X		- Clear
   * Z		- Fast reverse
   * [0		- Audio-1 from internal
   * [1		- Audio-1 from external
   * \0		- Video from internal
   * \1		- Video from external
   * ]0		- Audio-2 from internal
   * ]1		- Audio-2 from external
   * _0		- Teletext from disc off
   * _1		- Teletext from disc on
   ******************/

  FCode_Ptr=0;
  if (FCode_Buf[0]=='F')
  {
    // Frame code
    FIC_Ptr=FindFirstDigit(FCode_Buf);
    FrameInstructionCode=FCode_Buf[FIC_Ptr];
    FCode_Buf[FIC_Ptr]=0;
    if (FrameInstructionCode=='R')
    {
      FrameMode=V_STILL;
      GotoFrame(atoi(FCode_Buf+1),F_HALT);
      sprintf(FCode_Reply_Buf,"A0\r");
      LVAudioEnabled=0;
    }
    if (FrameInstructionCode=='S')
    {
      StopReg=atoi(FCode_Buf+1);
      sprintf(FCode_Reply_Buf,"\r");
    }
    if ((FrameInstructionCode=='I') || (FrameInstructionCode=='N') ||
    	(FrameInstructionCode=='Q'))
    {
//      MessageBox(GETHWND, FCode_Buf,"Unimplemented F-code",MB_OK|MB_ICONERROR);
    }
  }
  if ((FCode_Buf[0]=='N') && (FCode_Buf[1]<32))
  {
	  FrameMode=V_FORWARD1;
	  sprintf(FCode_Reply_Buf,"\r");
  }
  if ((FCode_Buf[0]=='A') || (FCode_Buf[0]=='B'))
  {
	  // Audio command - get state
	  LVA=FCode_Buf[1]-48;
	  sprintf(FCode_Reply_Buf,"\r");
  }
  if (FCode_Buf[0]=='E')
  {
	  // Video command - get state
	  LVE=FCode_Buf[1]-48;
	  sprintf(FCode_Reply_Buf,"\r");
  }
  if (strncmp(FCode_Buf,"?U",2)==0)
  {
    sprintf(FCode_Reply_Buf, "%s\r", lvDiscUsercode[currLvDisc]);
  }
  if (strncmp(FCode_Buf,"VP",2)==0)
  {
    unsigned char testchar;
    // Select Mix Modee
    testchar=FCode_Buf[2];
    if (testchar=='X')
    {
      // report it
      sprintf(FCode_Reply_Buf, "VP%c\n", 48+MixMode);
    }
    else
    {
      if ((testchar>='1') && (testchar<='5'))
      {
	MixMode=testchar-48;
	sprintf(FCode_Reply_Buf,"\r");
      }
    }
  }
  if (FCode_Buf[0]=='D')
  {
	  // Picture Number/Time Code Display Off/On
          lvPictureNumDisplay = FCode_Buf[1]-48;
	  sprintf(FCode_Reply_Buf,"\r");
  }
  if (strncmp(FCode_Buf,"?=",2)==0)
    sprintf(FCode_Reply_Buf,"=01718\r");

  if (FCode_Buf[0] == 'X')
  {
    StopReg=MAX_LV_FRAME_NUM;
    LVAudioEnabled=0;
    FrameMode=V_STILL;
  }
}