//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "LEDDOTMATRIX.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------

//   Important: Methods and properties of objects in VCL can only be
//   used in a method called using Synchronize, for example:
//
//      Synchronize(&UpdateCaption);
//
//   where UpdateCaption could look like:
//
//      void __fastcall LEDDOTMATRIX::UpdateCaption()
//      {
//        Form1->Caption = "Updated in a thread";
//      }
//---------------------------------------------------------------------------


//[가상 전광판]
//{
    class  LEDDOTMATRIX  *_ledDOtMatrix_ = NULL;

    void __fastcall LEDDOTMATRIX_ThreadCreate(void)
    {
      //[쓰레드] 생성.

      _ledDOtMatrix_ = new LEDDOTMATRIX(false);

      return;

    }

    void __fastcall LEDDOTMATRIX_ThreadDelete(void)
    {
      //[쓰레드] 삭제.

      if(_ledDOtMatrix_ == NULL) return;

      //쓰레드를 멈춘다.
      _ledDOtMatrix_->Terminate();

      delete _ledDOtMatrix_;

      _ledDOtMatrix_ = NULL;

      return;

    }

//}

__fastcall LEDDOTMATRIX::LEDDOTMATRIX(bool CreateSuspended)
           : TThread(CreateSuspended)
{
  //[!]{-------------
  //[쓰레드] 초기화.
  //}----------------

  //[쓰레드 순위 지정]
  //{
      //[!]{------------------------------------------------------
      //VirtualBox 등에서는 tpNormal 로 설정해야 제대로 동작된다.
      //이보다 높게 설정하면 엄청나게 느리게 동작 된다.
      //}---------------------------------------------------------

      Priority = tpNormal;

  //}


}

void __fastcall LEDDOTMATRIX::Execute()
{
  //[!]{--------------------
  //[쓰레드] 동작.
  //생성될때 자동 시작된다.
  //}-----------------------







  //[Thread 종료 대기]
  //{
      while(!Terminated);

  //}

}


