ÇнÀ¸ñÇ¥    1

ÇнÀÁÖÁ¦    1

¿¹½À³»¿ë    1

½Ç½À¹æ¹ý    1

°ú    Á¦    1

¿ÂµµÁ¦¾î(ÇÑ¿µÀüÀÚ)

ÇнÀ¸ñÇ¥

¿ÂµµÄÜÆ®·Ñ·¯ÀÇ Á¶Àý ¿Âµµ¸¦ SV¸¦ º¯È­ ½ÃÄÑ Á¦¾îÇÑ´Ù.

ÇнÀÁÖÁ¦

¾Æ·¡ È­¸é¿¡¼­ ¿Âµµ°¡ Ç¥½ÃµÇ°í Á¦¾î ¿Âµµ SV¸¦ ¼³Á¤ÇÏ°í º¸³»±â ¹öưÀ» ´©¸£¸é ÄÜÆ®·Ñ·¯ÀÇ Á¦¾î¿Âµµ°¡ º¯ÇÏ°Ô ÇÑ´Ù.

 

ÇÁ·Î±×·¥±¸¼º

¸ÕÀú ÀÛ¼ºÇÑ ÇÁ·Î±×·¥Àº ŸÀ̸Ӹ¦ 0.5ÃÊ °£°ÝÀ¸·Î µ¿ÀÛ ½ÃŰ¸é¼­ ŸÀÌ¸Ó ÇÔ¼ö¿¡¼­ ¿Âµµ¸¦ Àоî¿À´Â Çü½ÄÀ̾ú´Ù. ÀÌ ¶§ ½Ã°£ °£°ÝÀ» 0.2ÃÊ ÀÌÇÏ·Î ÇϸéÀº ÄÜÆ®·Ñ·¯ÀÇ ÀÀ´ä½Ã°£ ÀÌÀü¿¡ Åë½ÅÀ» º¸³»°Ô µÇ¾î Åë½Å ¿À·ù°¡ ¹ß»ýÈù´Ù.

À§ ÇÁ·Î±×·¥¿¡¼­ SV °ªÀ» ÀÔ·ÂÇÏ°í º¸³»±â ¹öưÀ» ´­·¯¼­ ¹Ù·Î ¼Û½ÅÀ» Çϸé ŸÀÌ¸Ó ÇÔ¼ö¿¡¼­ º¸³»´Â Åë½Å°ú ÀÇ ½Ã°£°£°ÝÀÌ 0.2ÃÊ À̳»·Î µÇ¸é ¿¡·¯°¡ ¹ß»ýÇÑ´Ù. ±×·¯¹Ç·Î SV Åë½ÅÀº ŸÀÌ¸Ó ÇÔ¼ö¿¡¼­ Åë½Å ´ë±â¸¦ Çϰí ÀÖ´Ù. Åë½ÅÀÌ ÀÌ·çÁö°Ô ÇÏ¿©¾ß ÇÑ´Ù.

º» ÇÁ·Î±×·¥¿¡¼­´Â m_nMode¶ó´Â º¯¼ö¸¦ ¼³Á¤ÇÏ¿© m_nMode=0ÀÌ¸é ¿Âµµ¸¦ Àоî¿À°í m_nMode=1 À̸é SVÀбâ Åë½ÅÀ» ÇÏ°í ´Ù½Ã m_nMode=0·Î ÀÚµ¿ ȯ¿øµÇ°Ô ÇÁ·Î±×·¥ ÇÏ¿´´Ù.

¿¹½À³»¿ë

 

½Ç½À¹æ¹ý

¸ñ    Â÷

 

1. ¾Æ·¡ ±×¸²°ú °°ÀÌ ¡°NumEdit Control¡±À» »ç¿ëÇÏ¿© ¡°SV¡±°ªÀ» ÀÔ·Â Çϵµ·Ï ÇÑ´Ù.

¾Æ·¡¿Í °°ÀÌ Member VariableÀ» ¡°m_nSv¡±·Î Á¤ÀÇ ÇÑ´Ù.

º¸³»±â ¹öưÀ» ¸¸µé°í À̸¦ ´õºí Ŭ¸¯ÇÏ¿© ¸â¹ö ÇÔ¼ö¸¦ ¸¸µç´Ù.

¾Æ·¡¿Í °°ÀÌ m_nMode¸¦ Á¤ÀÇ ÇÏ¿© 0ÀÌ¸é ¿Âµµ¸¦ º¸³»°í 1À̸é SV°ªÀ» º¯È­ ½ÃŲ´Ù.

 

¾Æ·¡¿Í °°ÀÌ OnInitDialog() ÇÔ¼ö¿¡ m_nMode=0À¸·Î ÃʱâÈ­ ÇÑ´Ù.

BOOL CThermDlg::OnInitDialog()

{

       CDialog::OnInitDialog();

 

       // Add "About..." menu item to system menu.

 

       // IDM_ABOUTBOX must be in the system command range.

       ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);

       ASSERT(IDM_ABOUTBOX < 0xF000);

 

       CMenu* pSysMenu = GetSystemMenu(FALSE);

       if (pSysMenu != NULL)

       {

              CString strAboutMenu;

              strAboutMenu.LoadString(IDS_ABOUTBOX);

              if (!strAboutMenu.IsEmpty())

              {

                    pSysMenu->AppendMenu(MF_SEPARATOR);

                    pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);

              }

       }

 

       // Set the icon for this dialog.  The framework does this automatically

       //  when the application's main window is not a dialog

       SetIcon(m_hIcon, TRUE);                 // Set big icon

       SetIcon(m_hIcon, FALSE);         // Set small icon

      

       // TODO: Add extra initialization here

       m_iPanelNo=1;

       m_ComuPort.OpenPort( "COM1", 9600, 1 );    // RS232 Åë½ÅÀ» ¿¬´Ù.

       SetTimer(1,500,NULL); // ŸÀÌ¸Ó ½Ã°£À» ¼³Á¤ÇÑ´Ù.

       m_nMode=0;

       return TRUE;  // return TRUE  unless you set the focus to a control

}

 

º¸³»±â ¹öưÀ» ´©¸£¸é m_nMode = 1 ÀÌ µÇ°Ô ÇÁ·Î±×·¥Çϰí OnTimer ÇÔ¼ö¿¡¼­ m_nMode °ª¿¡ µû¶ó ÇØ´ç Åë½ÅÀ» Çϵµ·Ï ÇÑ´Ù.

¾Æ·¡ ¼Ò½ºÆÄÀÏÀ» ÂüÁ¶ÇÑ´Ù.

void CThermDlg::OnButton1()

{

       m_nMode = 1;

}

 

void CThermDlg::OnTimer(UINT nIDEvent)

{

       // TODO: Add your message handler code here and/or call default

       if(m_nMode == 0)

              strTemp.Format("%02dDRS,02,0001",m_iPanelNo);

       else if(m_nMode == 1) {

              strTemp.Format("%02dDWS,02,0300,0001,%04x",m_iPanelNo,(int)(m_nSv.Value*10));

              m_nMode = 0;

       }

 

       strTemp.Insert(0,0x02);

       strTemp.Insert(strTemp.GetLength()+1,0x0D);

       strTemp.Insert(strTemp.GetLength()+1,0x0A);

       strTemp.MakeUpper();

       m_ComuPort.WriteComm((unsigned char*)(LPCTSTR)strTemp,strTemp.GetLength());

       CDialog::OnTimer(nIDEvent);

}

 

óÀ½

 

°ú    Á¦