Применение автоматизированного адаптивного интерферометра для исследования наносмещений микрообъектов

Дипломная работа - Физика

Другие дипломы по предмету Физика

quot; menu item to system menu.

 

// IDM_ABOUTBOX must be in the system command range.((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);(IDM_ABOUTBOX < 0xF000);

* pSysMenu = GetSystemMenu(FALSE);(pSysMenu != NULL)

{strAboutMenu;.LoadString(IDS_ABOUTBOX);(!strAboutMenu.IsEmpty())

{>AppendMenu(MF_SEPARATOR);>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(m_hIcon, TRUE);// Set big icon(m_hIcon, FALSE);// Set small icon

 

// TODO: Add extra initialization here

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

}

CSerialGateTestDlg::OnSysCommand(UINT nID, LPARAM lParam)

{((nID & 0xFFF0) == IDM_ABOUTBOX)

{dlgAbout;.DoModal();

}

{::OnSysCommand(nID, lParam);

}

}

 

// If you add a minimize button to your dialog, you will need the code below

// to draw the icon. For MFC applications using the document/view model,

// this is automatically done for you by the framework.

CSerialGateTestDlg::OnPaint()

{(IsIconic())

{dc(this); // device context for painting

(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

 

// Center icon in client rectanglecxIcon = GetSystemMetrics(SM_CXICON);cyIcon = GetSystemMetrics(SM_CYICON);rect;(&rect);x = (rect.Width() - cxIcon + 1) / 2;y = (rect.Height() - cyIcon + 1) / 2;

 

// Draw the icon.DrawIcon(x, y, m_hIcon);

}

{::OnPaint();

}

}

 

// The system calls this to obtain the cursor to display while the user drags

// the minimized window.CSerialGateTestDlg::OnQueryDragIcon()

{(HCURSOR) m_hIcon;

}

CSerialGateTestDlg::OnOpen()

{

// TODO: Add your control notification handler code here

(true);

(m_port == 0 || m_rate == 0)

{("Not correct data","Error", MB_ICONERROR);;;

}

b = sg.Open(m_port, m_rate);(b == false)

{("Can`t open Port","Error", MB_ICONERROR);;;

}

{("Port open OK","Info", MB_ICONINFORMATION);

}

 

(1, 1000, NULL);

}

CSerialGateTestDlg::OnTimer(UINT nIDEvent)

{(key==0)

{// TODO: Add your message handler code here and/or call defaultbuff[128];

rcv = sg.Recv(buff, sizeof(buff));>m_recievecontr.SetWindowText("");(rcv > 0)

{(int i = 0; im_recieve += buff[i];

(false);

}

}::OnTimer(nIDEvent);

}

CSerialGateTestDlg::OnSend()

{

// TODO: Add your control notification handler code here

(true);

len = this->m_send.GetLength();(len > 0)

{* LocBuf = m_send.GetBuffer(128);.Send(LocBuf, len);_send.ReleaseBuffer();ent=0x0D;* ent2 = &ent;.Send(ent2, 1);

 

 

 

}

 

 

}

CSerialGateTestDlg::OnButton3()

{

(true);

len = this->m_send.GetLength();(len > 0)

{ent=0x01;* ent2 = &ent;.Send(ent2, 1);* LocBuf = m_send.GetBuffer(128);.Send(LocBuf, len);_send.ReleaseBuffer();

 

 

 

 

}

 

}

CSerialGateTestDlg::OnOnSetaxsis() //выбор оси

{(true);

int popytka=0;

//изменение активного мотора

 

char ctrlkey=0x01;* ctrlkey2 = &ctrlkey;.Send(ctrlkey2, 1);len=1;* LocBuf = m_axsis.GetBuffer(128);.Send(LocBuf, len);_send.ReleaseBuffer();

tp="tp";* LocBuf2 = tp.GetBuffer(128);.Send(LocBuf2, 2);.ReleaseBuffer();

//enterent=0x0D;* ent2 = &ent;.Send(ent2, 1);

 

 

}

CSerialGateTestDlg::OnOnSetacsel() //установить ускорение

{(true);

sa="sa";* LocBuf2 = sa.GetBuffer(128);.Send(LocBuf2, 2);.ReleaseBuffer();

len = this->m_asel.GetLength();(len > 0)

{* LocBuf = m_asel.GetBuffer(128);.Send(LocBuf, len);_asel.ReleaseBuffer();

//enterent=0x0D;* ent2 = &ent;.Send(ent2, 1);

 

//проверкаtltl="tl";* LocBuf3 = tl.GetBuffer(128);.Send(LocBuf3, 2);.ReleaseBuffer();

//enter.Send(ent2, 1);

 

//m_recievecontr.SetWindowText("0");

//CEdit::Clear;

//UpdateData(false);

 

}

 

 

}

CSerialGateTestDlg::OnOnSetvelos()

{(true);

sv="sv";* LocBuf2 = sv.GetBuffer(128);.Send(LocBuf2, 2);.ReleaseBuffer();

len = this->m_vel.GetLength();(len > 0)

{* LocBuf = m_vel.GetBuffer(128);.Send(LocBuf, len);_vel.ReleaseBuffer();

//enterent=0x0D;* ent2 = &ent;.Send(ent2, 1);

 

//проверкаtyty="ty";* LocBuf3 = ty.GetBuffer(128);.Send(LocBuf3, 2);.ReleaseBuffer();

//enter.Send(ent2, 1);

 

}

 

}

CSerialGateTestDlg::OnOnMotroon()

{(true); //включить мотор

mn="mn";* LocBuf2 = mn.GetBuffer(128);.Send(LocBuf2, 2);.ReleaseBuffer();// TODO: Add your control notification handler code here

//enterent=0x0D;* ent2 = &ent;.Send(ent2, 1);

}

CSerialGateTestDlg::OnOnMotoroff() //выключить мотор

{mf="mf";* LocBuf2 = mf.GetBuffer(128);.Send(LocBuf2, 2);.ReleaseBuffer();// TODO: Add your control notification handler code here

//enterent=0x0D;* ent2 = &ent;.Send(ent2, 1);

}

CSerialGateTestDlg::OnOnMr() //перемещение

{(true);

mr="mr";* LocBuf2 = mr.GetBuffer(128);.Send(LocBuf2, 2);.ReleaseBuffer();

len = this->m_gomr.GetLength();(len > 0)

{* LocBuf = m_gomr.GetBuffer(128);.Send(LocBuf, len);_gomr.ReleaseBuffer();

//enterent=0x0D;* ent2 = &ent;.Send(ent2, 1);

 

//проверкаtytp="tp";* LocBuf3 = tp.GetBuffer(128);.Send(LocBuf3, 2);.ReleaseBuffer();

//enter.Send(ent2, 1);

//m_recieve.Clear();

}

}

CSerialGateTestDlg::OnOnGo() //////////////////кнопка GO//////////////////////

{(true);=1;axis=0; res;

 

TP0:

//изменение активного мотора

 

char ctrlkey=0x01;* ctrlkey2 = &ctrlkey;.Send(ctrlkey2, 1);len=1;axsis0='0';* axsis0_2 = &axsis0;.Send(axsis0_2, 1);

 

tp="tp";* LocBuf2 = tp.GetBuffer(128);.Send(LocBuf2, 2);.ReleaseBuffer();

//enterent=0x0D;* ent2 = &ent;.Send(ent2, 1);

(700); //организуем паузу чтобы контроллер успел ответить

 

//считаем текущую позицию//

 

char buff[128];

int rcv = sg.Recv(buff, sizeof(buff));elmbuff=rcv-1;[rcv]=0;str;(int i = 0; i< rcv; i++)+= buff[i];* j = strchr(buff, '+');= atoi(j);(j==0)

{= strchr(buff, '-'); = atoi(j); //в res здесь храниться текущие положение

}

CString mraxsis0_2; //сюда записывается занчение е окошка edit axsis0

GetDlgItemText(IDC_MRAXSIS0,mraxsis0_2);posnum0=atoi(mraxsis0_2);posnum0_mr=res-posnum0/2;mraxsis0_mr;_mr =itoa(posnum0_mr,mraxsis0_mr.GetBuffer(10),10);

 

//выполним перемещение на нулевую позицию//

 

CString mr="MA";* LocBuf8 = mr.GetBuffer(128);.Send(LocBuf8, 2);.ReleaseBuffer();

 

len=mraxsis0_mr.GetLength();* LocBuf9 = mraxsis0_mr.GetBuffer(128);.Send(LocBuf9, len);_mr.ReleaseBuffer();

//enter.Send(ent2, 1);gto0=posnum0_mr;posicino00=res;(400);:

//изменение активного мотора

 

 

sg.Send(ctrlkey2, 1);

len=1;axsis1='1';* axsis1_2 = &axsis1;.Send(axsis1_2, 1);

 

="tp";

LocBuf2 = tp.GetBuffer(128);.Send(LocBuf2, 2);.ReleaseBuffer();

//enter.Send(ent2, 1);(700);

//организуем паузу чтобы контроллер успел ответить

 

//считаем текущую позицию//

char buff2[128];

rcv = sg.Recv(buff2, sizeof(buff2));

elmbuff=rcv-1;[rcv]=0;str2;(i = 0; i< rcv; i++)+= buff2[i];

j = strchr(buff2, '+');= atoi(j);(j==0)

{= strchr(buff2, '-'); = atoi(j); //в res здесь храниться текущие положение

}

 

CString mraxsis1_2; //сюда записывается занчение е окошка edit axsis0

GetDlgItemText(IDC_MRAXSIS1,mraxsis1_2);posnum1=atoi(mraxsis1_2);posnum1_mr=res-posnum1/2;mraxsis1_mr;_mr =itoa(posnum1_mr,mraxsis1_mr.GetBuffer(10),10);

 

//выполним перемещение на нулевую позицию//

 

mr="MA";= mr.GetBuffer(128);.Send(LocBuf8, 2);.ReleaseBuffer();

 

len=mraxsis1_mr.GetLength();= mraxsis1_mr.GetBuffer(128);.Send(LocBuf9, len);_mr.ReleaseBuffer();

//enter.Send(ent2, 1);gto1=posnum1_mr;posicino01=res;(130);pos01=gto1;pos00=gto0;modul;

 

{

Sleep(400);

//изменение активного мотора

 

sg.Send(ctrlkey2, 1);

sg.