Ejemplo n.º 1
3
// -------------------------------------------------------------------
void
DPRegression::SetDisplays(BMessage* theMesg)
{
	record_key theKey;
	theMesg->FindInt64(disp_set_name,&theKey);
	for(int32 setNum = 0; setNum < NumSets(); setNum++) {
		DRRegrData* theRData = (DRRegrData*)DisplayData(setNum);
		if(theRData != NULL) {
			const DPData* theData = theRData->Data();
			if(theKey == theData->Key()) {
				int16 val = theMesg->FindInt16(disp_mark_name);
				int16 lVal = theMesg->FindInt16(disp_line_name);
				theRData->SetPlotMark((EPlotMark)val);
				theRData->SetDataColor(::ValueToColor(theMesg->FindInt32(mark_col_name)));
				theRData->SetLineType((ERegrLineType)lVal);
				mRegrWindow->ReDraw();
				return;	// *** EXIT HERE if found
			}
		}
	}
}	
Ejemplo n.º 2
0
/******************************************************************************
 * Function name:	cmd_data
 *
 * Description:		Displays control data
 *
 * Arguments:		NULL: Displays data for both axes
 * 					l: Displays data for lateral axis
 * 					v: Displays data for vertical axis
 *
 *****************************************************************************/
static void cmd_data(BaseSequentialStream *chp, int argc, char *argv[]) {

	(void)argv; (void)argc;

	if(U8ShellMode != 2) {
		chprintf(chp, "\tShell Override ");
		if(U8ShellMode == 1) {
			chprintf(chp, "Mode : Position\r\n");
		}
		else {
			chprintf(chp, "Mode : Velocity\r\n");
		}
	}
	else {
		if(U8PosnVelModeSwitch == 1) {
			chprintf(chp, "Mode : Position\r\n");
		}
		else {
			chprintf(chp, "Mode : Velocity\r\n");
		}
	}
	// Lateral axis data
	if(argc == 0 || *argv[0] != 'v') {
	chprintf(chp, "Lateral Axis : \r\n");
	DisplayData(chp, &latAxisStruct);
	}
	// Vertical axis data
	if(argc == 0 || *argv[0] != 'l') {
	chprintf(chp, "Vertical Axis : \r\n");
	DisplayData(chp, &vertAxisStruct);
	}
}
Ejemplo n.º 3
0
/**
 * Set the display controller to accept a stream of RGB display data.  The
 * StopWrite method must be called when the data write is complete.
 */
void OSD0201QILK::StartWrite()
{
    DisplayData(false);
    ChipSelect(false);

    Write (0x22);

    DisplayData(true);
}
Ejemplo n.º 4
0
qtDLGHexView::qtDLGHexView(QWidget *parent, Qt::WFlags flags,unsigned long dwPID, unsigned long long StartOffset,unsigned long long Size)
	: QWidget(parent, flags)
{
	setupUi(this);
	this->setAttribute(Qt::WA_DeleteOnClose,true);
	this->setLayout(horizontalLayout);
	this->setWindowTitle(QString("[ Nanomite ] - Show Memory - PID - %1 - From: %2 - To: %3").arg(dwPID,8,16,QChar('0')).arg(StartOffset,8,16,QChar('0')).arg(StartOffset + Size,8,16,QChar('0')));

	tblHexView->horizontalHeader()->resizeSection(0,75);
	tblHexView->horizontalHeader()->resizeSection(1,135);
	tblHexView->horizontalHeader()->resizeSection(2,375);
	tblHexView->horizontalHeader()->resizeSection(3,230);
	tblHexView->horizontalHeader()->setFixedHeight(21);

	qtDLGNanomite *MyMainWindow = qtDLGNanomite::GetInstance();

	tblHexView->setRowCount(0);

	HANDLE hProcess = NULL;
	for(size_t i = 0;i < MyMainWindow->coreDebugger->PIDs.size();i++)
	{
		if(dwPID == MyMainWindow->coreDebugger->PIDs[i].dwPID)
			hProcess = MyMainWindow->coreDebugger->PIDs[i].hProc;
	}

	m_pHexDataWorker = new clsHexViewWorker(dwPID,hProcess,StartOffset,Size);
	connect(m_pHexDataWorker,SIGNAL(finished()),this,SLOT(DisplayData()),Qt::QueuedConnection);
	connect(memoryScroll,SIGNAL(valueChanged(int)),this,SLOT(InsertDataFrom(int)));
}
Ejemplo n.º 5
0
void CSocketManager::OnDataReceived(const LPBYTE lpBuffer, DWORD dwCount)
{
	
	
	LPBYTE lpData = lpBuffer;
	SockAddrIn origAddr;
	stMessageProxy msgProxy;
	if (IsSmartAddressing())
	{
		dwCount = __min(sizeof(msgProxy), dwCount);
		memcpy(&msgProxy, lpBuffer, dwCount);
		origAddr = msgProxy.address;
		if (IsServer())
		{
			// broadcast message to all
			msgProxy.address.sin_addr.s_addr = htonl(INADDR_BROADCAST);
			WriteComm((const LPBYTE)&msgProxy, dwCount, 0L);
		}
		dwCount -= sizeof(msgProxy.address);
		lpData = msgProxy.byData;
	}
	
	
	// Display data to message list
	DisplayData( lpData, dwCount, origAddr );
}
Ejemplo n.º 6
0
int SectorEditDialog::LoadData(void)
{
    //LOGI("SED LoadData");
    ASSERT(fpDiskFS != NULL);
    ASSERT(fpDiskFS->GetDiskImg() != NULL);

    if (ReadSpinner(IDC_DISKEDIT_TRACKSPIN, &fTrack) != 0)
        return -1;
    if (ReadSpinner(IDC_DISKEDIT_SECTORSPIN, &fSector) != 0)
        return -1;

    LOGI("LoadData reading t=%d s=%d", fTrack, fSector);

    fAlertMsg = "";
    DIError dierr;
    dierr = fpDiskFS->GetDiskImg()->ReadTrackSector(fTrack, fSector, fSectorData);
    if (dierr != kDIErrNone) {
        LOGI("SED sector read failed: %hs", DiskImgLib::DIStrError(dierr));
        //CString msg;
        //CString err;
        //err.LoadString(IDS_ERROR);
        //msg.Format(IDS_DISKEDIT_NOREADTS, fTrack, fSector);
        //MessageBox(msg, err, MB_OK|MB_ICONSTOP);
        fAlertMsg.LoadString(IDS_DISKEDITMSG_BADSECTOR);
        //return -1;
    }

    DisplayData();

    return 0;
}
Ejemplo n.º 7
0
// -------------------------------------------------------------------
//	* Protected Methods
// ------------------------------------------------------------------ 
void
DPRegression::MarkData(BMessage* theMesg)
{
	if(mRegrWindow->AllowMarking()) {
		int32 setNum = 0;
		DRRegrData* theRData = (DRRegrData*)DisplayData(setNum++);
		while (theRData != NULL) {
			DPData* theData = (DPData*)theRData->Data();
			theData->MarkData(theMesg);
			theRData->Recalculate();
			theRData = (DRRegrData*)DisplayData(setNum++);
		}
		mRegrWindow->ReDraw();
	}
	delete theMesg;
}
Ejemplo n.º 8
0
int BlockEditDialog::LoadData(void)
{
    //LOGI("BED LoadData");
    ASSERT(fpDiskFS != NULL);
    ASSERT(fpDiskFS->GetDiskImg() != NULL);

    if (ReadSpinner(IDC_DISKEDIT_TRACKSPIN, &fBlock) != 0)
        return -1;

    LOGI("LoadData reading block=%d", fBlock);

    fAlertMsg = "";
    DIError dierr;
    dierr = fpDiskFS->GetDiskImg()->ReadBlock(fBlock, fBlockData);
    if (dierr != kDIErrNone) {
        LOGI("BED block read failed: %hs", DiskImgLib::DIStrError(dierr));
        //CString msg;
        //CString err;
        //err.LoadString(IDS_ERROR);
        //msg.Format(IDS_DISKEDIT_NOREADBLOCK, fBlock);
        //MessageBox(msg, err, MB_OK|MB_ICONSTOP);
        fAlertMsg.LoadString(IDS_DISKEDITMSG_BADBLOCK);
        //return -1;
    }

    DisplayData();

    return 0;
}
Ejemplo n.º 9
0
int main(int argc, char* argv[])
{
  std::vector<NumberType> input(0);
  std::ifstream ifs;
  if (argc < 2) // expects keyboard input
  {
    if (sizeof(NumberType) == sizeof(char))
      // keyboard input of type char is un-intuitve
      // when interpreted as a numerical type
    {
      std::cout << "Please provide filename containing data.\n";
      exit(EXIT_SUCCESS);
    }
    std::cout << "Enter numerical data: ";
    ReadData(input, std::cin);
  }
  else // reads from file - command line argument
  {
    ifs.open(argv[1]);
    if (ifs.fail())
    {
      std::cerr << "** Unable to open file " << argv[1] << " -- please try again\n";
      exit(EXIT_FAILURE);
    }
    ReadData(input, ifs);
  }

  // show data in original object:
  std::cout << "Data as entered: ";
  DisplayData(input, std::cout, ' ');
  std::cout << '\n';
  // */

  // display mean and median:
  std::cout << "Mean:   " << Mean(input) << '\n';
  std::cout << "Median: " << Median(input) << '\n';

  // display data after calls:
  std::cout << "Data after sort: ";
  DisplayData(input, std::cout, ' ');
  std::cout << '\n';
  // */

  return 0;
}
Ejemplo n.º 10
0
/************************************************************************
* SOURCE FILE : WndProc.cpp 
* PROGRAM     : Dumb Terminal
* FUNCTION    : LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
*                    HWND hwnd     - A handle to the window
*                    UINT Message  - The message to handle
*                    WPARAM wParam - wParam parameters
*                    LPARAM lParam - lParam parameters
* RETURNS     : LRESULT
* DATE        : September 27, 2010a
* REVISIONS   : None
* DESIGNER    : Nick Huber
* PROGRAMMER  : Nick Huber
* NOTES       : 
* 
* The WndProc for the terminal program, all messages are handled here
*************************************************************************/
LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
    PCPARAMS    cp;
    HDC         hdc;
    PAINTSTRUCT ps;

    switch (Message)
	{

    case WM_COMMAND:
        cp = (PCPARAMS)GetWindowLongPtr(hwnd, 0);
        if (cp->connectMode) {
            MessageBox(NULL, TEXT("Unable to change settings while in Connect Mode, press ESC to return to Command Mode"), TEXT(""), MB_OK);
            return 0;
        }
        MainMenu(hwnd, LOWORD (wParam), cp);
        return 0;

    case WM_CHAR:
        cp = (PCPARAMS) GetWindowLongPtr(hwnd,0);
        if (cp->connectMode) {
            if(VK_ESCAPE == wParam) {
                SetWindowText(hwnd, TEXT("Dumb Terminal - Command Mode"));
                CloseHandle(cp->hComm);
                cp->connectMode = FALSE;
                return 0;
            }
            if(!Transmit(wParam, cp)) {
                MessageBox (NULL, TEXT("Error sending data"), TEXT(""), MB_OK);
                return 0;
            }
        }
        return 0;

    case WM_PAINT:
        cp = (PCPARAMS) GetWindowLongPtr(hwnd,0);
        hdc = BeginPaint(hwnd, &ps);

        DisplayData(hwnd, hdc, cp);

        EndPaint(hwnd,&ps);
        return 0;

    case WM_DESTROY:
        cp = (PCPARAMS) GetWindowLongPtr(hwnd,0);
      	PostQuitMessage (0);
		return 0;
	}

	return DefWindowProc(hwnd, Message, wParam, lParam);
}
Ejemplo n.º 11
0
/**
	@brief	선택한 CONDUIT TABLE을 삭제한다.

	@author	BHK
*/
void CConduitTableDlg::OnBnClickedButtonDeleteConduitTable()
{
	CELoadDocData& docData = CELoadDocData::GetInstance();

	POSITION pos = m_wndConduitTableListCtrl.GetFirstSelectedItemPosition();
	if(NULL != pos)
	{
		const int nSelItem = m_wndConduitTableListCtrl.GetNextSelectedItem(pos);
		if(-1 != nSelItem)
		{
			CString rTableName = m_wndConduitTableListCtrl.GetItemText(nSelItem , 0);
			if(ERROR_SUCCESS == CConduitListTable::GetInstance().DeleteTable(rTableName.operator LPCSTR()))
			{
				DisplayData();
				
				const int nTableCount = m_wndConduitTableListCtrl.GetItemCount();
				if(nTableCount > 0)
				{
					UINT flag = LVIS_SELECTED | LVIS_FOCUSED;
					m_wndConduitTableListCtrl.SetItemState(nTableCount - 1 , flag, flag);

					const CString rTableName = m_wndConduitTableListCtrl.GetItemText(nTableCount - 1 , 0);
					DisplayConduitData(rTableName.operator LPCSTR());

					m_wndConduitTableListCtrl.SetFocus();
				}
				else
				{
					m_wndCONDSpread.SetMaxRows(2);
					m_wndCONDSpread.put_RowHeight(1,13);
					m_wndCONDSpread.SetText(0,1,COleVariant("SIZE"));
					m_wndCONDSpread.SetText(1,1,COleVariant(""));
					m_wndCONDSpread.put_RowHeight(2,13);
					m_wndCONDSpread.SetText(0,2,COleVariant("DIA."));
					m_wndCONDSpread.SetText(1,2,COleVariant(""));
					m_wndCONDSpread.SetMaxCols(1);
				}
			}
		}
	}
}
Ejemplo n.º 12
0
/**
	@brief	DIALOG 초기화 부분

	@author	BHK
*/
BOOL CConduitTableDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_wndConduitTableListCtrl.InsertColumn(0 , _T("Table Name")  , LVCFMT_LEFT , 200);
	m_wndConduitTableListCtrl.InsertColumn(1 , _T("Table Desc.") , LVCFMT_LEFT , 300);
        m_wndConduitTableListCtrl.SendMessage (LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);

	CELoadDocData & docData = CELoadDocData::GetInstance();
	const COLORREF TextHotColor = docData.GetColorCode(_T("TEXT_HOT_COLOR"));
	m_wndAddButton.SetTextHotColor(TextHotColor);
	m_wndDelButton.SetTextHotColor(TextHotColor);
	m_wndCancelButton.SetTextHotColor(TextHotColor);

	m_wndAddButton.SetIcon(IDI_ADD);
	m_wndDelButton.SetIcon(IDI_DEL);
	m_wndCancelButton.SetIcon(IDI_CANCEL_18X18);

	LoadData();

	m_wndCONDSpread.SetMaxRows(2);
	m_wndCONDSpread.put_RowHeight(1,13);
	m_wndCONDSpread.SetText(0,1,COleVariant("SIZE"));
	m_wndCONDSpread.put_RowHeight(2,13);
	m_wndCONDSpread.SetText(0,2,COleVariant("DIA."));
	m_wndCONDSpread.SetMaxCols(1);
	DisplayData();

	if(m_wndConduitTableListCtrl.GetItemCount() > 0)
	{
		UINT flag = LVIS_SELECTED | LVIS_FOCUSED;
		m_wndConduitTableListCtrl.SetItemState(0 , flag, flag);

		const CString rTableName = m_wndConduitTableListCtrl.GetItemText(0 , 0);
		DisplayConduitData(rTableName.operator LPCSTR());
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Ejemplo n.º 13
0
void CConduitTableDlg::OnBnClickedButtonAddConduitTable()
{
	UpdateData(TRUE);

	CFileDialog fileDlg(TRUE, NULL, NULL, OFN_HIDEREADONLY  ,"Excel Files(*.xls)|*.xls|All Files(*.*)|*.*||");
	if(IDOK == fileDlg.DoModal())
	{
		CString rFileName        = fileDlg.GetFileName();
		CString strFilePathName  = fileDlg.GetPathName();
		CString strFileTitle     = fileDlg.GetFileTitle();
		CFileException fileException;

		if(ERROR_SUCCESS == ImportConduitTableFromExcelFile(strFilePathName))
		{
			CELoadDocData& docData = CELoadDocData::GetInstance();
			string rCommonLibraryMDBFilePath = docData.GetCommonLibraryMDBFilePath();

			const int nFound = rFileName.ReverseFind('.');
			if(-1 != nFound) rFileName = rFileName.Left(nFound);
			rFileName.MakeUpper();

			//! ELOAD: COMMON LIBRARY MDB에 TABLE 정보를 INSERT한다.
			CConduitListTable::GetInstance().AddTable(rFileName.operator LPCSTR() , m_rTableDesc.operator LPCSTR());
			DisplayData();

			const int nTableCount = m_wndConduitTableListCtrl.GetItemCount();
			if(nTableCount > 0)
			{
				UINT flag = LVIS_SELECTED | LVIS_FOCUSED;
				m_wndConduitTableListCtrl.SetItemState(nTableCount - 1 , flag, flag);

				const CString rTableName = m_wndConduitTableListCtrl.GetItemText(nTableCount - 1 , 0);
				DisplayConduitData(rTableName.operator LPCSTR());

				m_wndConduitTableListCtrl.SetFocus();
			}
		}
	}
}
Ejemplo n.º 14
0
/*--------------------------------------*/
void CFrontier_API_SVDlg::RecGlobViewData(char PciViewData[],short length)
{
	int* point;

	point = (int *)PciViewData;

	int i,j;
	for (i=0;i<6;i++)
	{
		for (j=0;j<3;j++)
		{
			VisionBlob[i][j].centrex =  *(point+1+i*3*8+j*8);
			VisionBlob[i][j].centrey =  *(point+2+i*3*8+j*8);
			VisionBlob[i][j].bottom =  *(point+3+i*3*8+j*8);
			VisionBlob[i][j].top =  *(point+4+i*3*8+j*8);
			VisionBlob[i][j].left =  *(point+5+i*3*8+j*8);
			VisionBlob[i][j].right =  *(point+6+i*3*8+j*8);
			VisionBlob[i][j].area =  *(point+7+i*3*8+j*8);
			VisionBlob[i][j].hue = *(point+8+i*3*8+j*8);
			
			if (VisionBlob[i][j].area > 0)
			{
				RViewInfoProcess(&VisionBlob[i][j], &VisionDistAng[i][j].Dist, &VisionDistAng[i][j].Angle);
			}
			else
			{
				VisionDistAng[i][j].Angle = 0;
				VisionDistAng[i][j].Dist = 0;
				VisionDistAng[i][j].Area = 0;
			}
			VisionDistAng[i][j].Area = VisionBlob[i][j].area;
		}
	}

	OnPaitMap();
	DisplayData();
}
Ejemplo n.º 15
0
int NibbleEditDialog::LoadData(void)
{
    //LOGI("BED LoadData");
    ASSERT(fpDiskFS != NULL);
    ASSERT(fpDiskFS->GetDiskImg() != NULL);

    if (ReadSpinner(IDC_DISKEDIT_TRACKSPIN, &fTrack) != 0)
        return -1;

    LOGI("LoadData reading track=%d", fTrack);

    fAlertMsg = "";
    DIError dierr;
    dierr = fpDiskFS->GetDiskImg()->ReadNibbleTrack(fTrack, fNibbleData,
                &fNibbleDataLen);
    if (dierr != kDIErrNone) {
        LOGI("NED track read failed: %hs", DiskImgLib::DIStrError(dierr));
        fAlertMsg.LoadString(IDS_DISKEDITMSG_BADTRACK);
    }

    DisplayData();

    return 0;
}
Ejemplo n.º 16
0
void WaterTool::Show()
{
	DisplayData();
	show();
}
Ejemplo n.º 17
0
int SectorFileEditDialog::LoadData(void)
{
    ASSERT(fpDiskFS != NULL);
    ASSERT(fpDiskFS->GetDiskImg() != NULL);

    DIError dierr;
    LOGI("SFED LoadData reading index=%d", fSectorIdx);

#if 0
    LOGI("LoadData reading offset=%d", fOffset);
    size_t actual = 0;
    dierr = fpFile->Seek(fOffset, EmbeddedFD::kSeekSet);
    if (dierr == kDIErrNone) {
        dierr = fpFile->Read(fSectorData, 1 /*kSectorSize*/, &actual);
    }
    if (dierr != kDIErrNone) {
        CString msg, failed;
        failed.LoadString(IDS_FAILED);
        msg.Format(IDS_DISKEDIT_FIRDFAILED, DiskImg::DIStrError(dierr));
        MessageBox(msg, failed, MB_OK);
        // TO DO: mark contents as invalid, so editing fails
        return -1;
    }

    if (actual != kSectorSize) {
        LOGI(" SFED partial read of %d bytes", actual);
        ASSERT(actual < kSectorSize && actual >= 0);
    }

    /*
     * We've read the data, but we can't use it.  We're a sector editor,
     * not a file editor, and we need to get the actual sector data without
     * EOF trimming or CP/M 0xe5 removal.
     */
    fpFile->GetLastLocationRead(&fTrack, &fSector);
    if (fTrack == A2File::kLastWasSparse && fSector == A2File::kLastWasSparse)

        ;
#endif

    fAlertMsg = "";

    dierr = fpOpenFile->GetStorage(fSectorIdx, &fTrack, &fSector);
    if (dierr == kDIErrInvalidIndex && fSectorIdx == 0) {
        // no first sector; should only happen on CP/M
        //FillWithPattern(fSectorData, sizeof(fSectorData), _T("EMPTY "));
        fAlertMsg.LoadString(IDS_DISKEDITMSG_EMPTY);
    } else if (dierr != kDIErrNone) {
        CString msg, failed;
        failed.LoadString(IDS_FAILED);
        msg.Format(IDS_DISKEDIT_FIRDFAILED, DiskImgLib::DIStrError(dierr));
        MessageBox(msg, failed, MB_OK);
        fAlertMsg.LoadString(IDS_FAILED);
        // TO DO: mark contents as invalid, so editing fails
        return -1;
    } else {
        if (fTrack == 0 && fSector == 0) {
            LOGI("LoadData Sparse sector");
            //FillWithPattern(fSectorData, sizeof(fSectorData), _T("SPARSE "));
            fAlertMsg.Format(IDS_DISKEDITMSG_SPARSE, fSectorIdx);
        } else {
            LOGI("LoadData reading T=%d S=%d", fTrack, fSector);

            dierr = fpDiskFS->GetDiskImg()->ReadTrackSector(fTrack, fSector,
                        fSectorData);
            if (dierr != kDIErrNone) {
                //CString msg;
                //CString err;
                //err.LoadString(IDS_ERROR);
                //msg.Format(IDS_DISKEDIT_NOREADTS, fTrack, fSector);
                //MessageBox(msg, err, MB_OK|MB_ICONSTOP);
                fAlertMsg.LoadString(IDS_DISKEDITMSG_BADSECTOR);
                //return -1;
            }
        }
    }

    SetSpinner(IDC_DISKEDIT_TRACKSPIN, fTrack);
    SetSpinner(IDC_DISKEDIT_SECTORSPIN, fSector);

    CWnd* pWnd;
    pWnd = GetDlgItem(IDC_DISKEDIT_PREV);
    ASSERT(pWnd != NULL);
    pWnd->EnableWindow(fSectorIdx > 0);
    if (!pWnd->IsWindowEnabled() && GetFocus() == NULL)
        GetDlgItem(IDC_DISKEDIT_NEXT)->SetFocus();

    pWnd = GetDlgItem(IDC_DISKEDIT_NEXT);
    ASSERT(pWnd != NULL);
    pWnd->EnableWindow(fSectorIdx+1 < fpOpenFile->GetSectorCount());
    if (!pWnd->IsWindowEnabled() && GetFocus() == NULL)
        GetDlgItem(IDC_DISKEDIT_PREV)->SetFocus();

    DisplayData();

    return 0;
}
Ejemplo n.º 18
0
/*
 *
 * Entry point into program
 *
 */
int main()
{
	RAM_DATA_BYTE state[BLOCK_SIZE];

	RAM_DATA_BYTE key[KEY_SIZE];

	RAM_DATA_BYTE roundKeys[ROUND_KEYS_SIZE];


	InitializeDevice();	
	
		
	InitializeState(state);

#if defined(DEBUG) && (DEBUG_LOW == (DEBUG_LOW & DEBUG))
	DisplayVerifyData(state, BLOCK_SIZE, PLAINTEXT_NAME);
#endif
	
	
	InitializeKey(key);

#if defined(DEBUG) && (DEBUG_MEDIUM == (DEBUG_MEDIUM & DEBUG))
	DisplayVerifyData(key, KEY_SIZE, KEY_NAME);
#endif
#if defined(DEBUG) && (DEBUG_HIGH == (DEBUG_HIGH & DEBUG))
	DisplayData(roundKeys, ROUND_KEYS_SIZE, ROUND_KEYS_NAME);
#endif
		
	
	BEGIN_ENCRYPTION_KEY_SCHEDULE();
	RunEncryptionKeySchedule(key, roundKeys);
	END_ENCRYPTION_KEY_SCHEDULE();

#if defined(DEBUG) && (DEBUG_MEDIUM == (DEBUG_MEDIUM & DEBUG))
	DisplayVerifyData(key, KEY_SIZE, KEY_NAME);
#endif
#if defined(DEBUG) && (DEBUG_HIGH == (DEBUG_HIGH & DEBUG))
	DisplayData(roundKeys, ROUND_KEYS_SIZE, ROUND_KEYS_NAME);
#endif	


#if defined(DEBUG) && (DEBUG_LOW == (DEBUG_LOW & DEBUG))
	DisplayVerifyData(state, BLOCK_SIZE, PLAINTEXT_NAME);
#endif

	BEGIN_ENCRYPTION();
	Encrypt(state, roundKeys);
	END_ENCRYPTION();

#if defined(DEBUG) && (DEBUG_LOW == (DEBUG_LOW & DEBUG))
	DisplayVerifyData(state, BLOCK_SIZE, CIPHERTEXT_NAME);
#endif
	
		
	BEGIN_DECRYPTION_KEY_SCHEDULE();
	RunDecryptionKeySchedule(key, roundKeys);
	END_DECRYPTION_KEY_SCHEDULE();

#if defined(DEBUG) && (DEBUG_MEDIUM == (DEBUG_MEDIUM & DEBUG))
	DisplayVerifyData(key, KEY_SIZE, KEY_NAME);
#endif
#if defined(DEBUG) && (DEBUG_HIGH == (DEBUG_HIGH & DEBUG))
	DisplayData(roundKeys, ROUND_KEYS_SIZE, ROUND_KEYS_NAME);
#endif
	

#if defined(DEBUG) && (DEBUG_LOW == (DEBUG_LOW & DEBUG))
	DisplayVerifyData(state, BLOCK_SIZE, CIPHERTEXT_NAME);
#endif

	BEGIN_DECRYPTION();
	Decrypt(state, roundKeys);
	END_DECRYPTION();

#if defined(DEBUG) && (DEBUG_LOW == (DEBUG_LOW & DEBUG))
	DisplayVerifyData(state, BLOCK_SIZE, PLAINTEXT_NAME);
#endif
	
	
	DONE();


	StopDevice();
	
	
	return 0;
}
Ejemplo n.º 19
0
void Editor_Frame() {
	FPSFrame();
	DisplayData();
}
//==================================================================================================
LRESULT TestDialog_2::OnSerialMsg (WPARAM wParam, LPARAM /*lParam*/)
{
	CSerial::EEvent eEvent = CSerial::EEvent(LOWORD(wParam));
	CSerial::EError eError = CSerial::EError(HIWORD(wParam));

	if (eError)
		DisplayEvent(_T("An internal error occurred."));

	if (eEvent & CSerial::EEventBreak)
		DisplayEvent(_T("Break detected on input."));

	if (eEvent & CSerial::EEventError)
		DisplayEvent(_T("A line-status error occurred."));
	
	if (eEvent & CSerial::EEventRcvEv)
		DisplayEvent(_T("Event character has been received."));

	if (eEvent & CSerial::EEventRing)
		DisplayEvent(_T("Ring detected"));
	
	if (eEvent & CSerial::EEventSend)
		DisplayEvent(_T("All data is send"));
	
	if (eEvent & CSerial::EEventCTS)
		DisplayEventSetting(_T("CTS signal change"), _T("CTS"), serial.GetCTS());
	
	if (eEvent & CSerial::EEventDSR)
		DisplayEventSetting(_T("DSR signal change"), _T("DSR"), serial.GetDSR());
	
	if (eEvent & CSerial::EEventRLSD)
		DisplayEventSetting(_T("RLSD signal change"), _T("RLSD"), serial.GetRLSD());
	
	if (eEvent & CSerial::EEventRecv)
	{
		// Create a clean buffer
		DWORD dwRead;
		char szData[101];
		const int nBuflen = sizeof(szData)-1;

		// Obtain the data from the serial port
		do
		{
			serial.Read(szData,nBuflen,&dwRead);
			szData[dwRead] = '\0';

			// Scan the string for unwanted characters
			for (DWORD dwChar=0; dwChar<dwRead; dwChar++)
			{
				if (!isprint(szData[dwChar]) && !isspace(szData[dwChar]))
				{
					szData[dwChar] = '.';
				}
			}

#ifdef _UNICODE
			// Convert the ANSI data to Unicode
			LPTSTR lpszData = LPTSTR(_alloca((dwRead+1)*sizeof(TCHAR)));
			if (!::MultiByteToWideChar(CP_ACP, 0, szData, -1, lpszData, dwRead+1))
				return 0;

			// Display the fetched string
			DisplayData(lpszData);
#else
			// Display the fetched string
			DisplayData(szData);
#endif
		} while (dwRead == nBuflen);
	}

	return 0;
}
Ejemplo n.º 21
0
// Process the bytes to show on User Dialog Box with GUI
CString CLogPid::ProcessStreamBytes( char *str, DWORD iStreamCnt )
{
	int tick;
	int index=0;
	int pidInx=0;
	CString cs;
	char *p;

	static int bFirstTime=0;

	CString csMsg = str;
	CString csPrint = "";

	// RES, 0000001105, Input=+112.41, Output=+100.0, Setpoint=120.00, DTime: 00.100, Error=+07.59, PT=+075.9, IT=+000.8, DT=+000.0

	// Do strok
    char *pt;
    pt = strtok (str,",");
    while (pt != NULL) {

		// Get the PID loop
		if (index==0)
		{
			csPrint += str + CString(",");
			if (strstr(str,"RES")!=NULL)
			{
				pidInx=0;
			}
			else if (strstr(str,"CBR")!=NULL)
			{
				pidInx=1;
			}
			else if (strstr(str,"SIP")!=NULL)
			{
				pidInx=2;
			}
		}
		else if (index==1)
		{
			csPrint += pt + CString(",");
			tick = atoi(pt);
		}
		else
		{
			if ((p=strstr(pt,"Input="))!=NULL)
			{
				cs = &p[6];
				csPrint += cs + CString(",");
				switch(pidInx)
				{
				  case 0:
					m_stPid1Temp.SetWindowText(cs);
					break;
				  case 1:
					m_stPid2Temp.SetWindowText(cs);
					break;
				  case 2:
					m_stPid3Temp.SetWindowText(cs);
					break;
				}
			}
			else if ((p=strstr(pt,"Output="))!=NULL)
			{
				cs = &p[7];
				csPrint += cs + CString(",");
				switch(pidInx)
				{
				  case 0:
					m_stPid1Heat.SetWindowText(cs);
					break;
				  case 1:
					m_stPid2Heat.SetWindowText(cs);
					break;
				  case 2:
					m_stPid3Heat.SetWindowText(cs);
					break;
				}
			}
			else if ((p=strstr(pt,"Setpoint="))!=NULL)
			{
				cs = &p[9];
				// m_stPid1KI.SetWindowText(cs);
				csPrint += cs + CString(",");
			}
			else if ((p=strstr(pt,"DTime: "))!=NULL)
			{
				cs = &p[7];
				// m_stPid1KI.SetWindowText(cs);
				csPrint += cs + CString(",");
			}
			else if ((p=strstr(pt,"Error="))!=NULL)
			{
				cs = &p[6];
				// m_stPid1KI.SetWindowText(cs);
				csPrint += cs + CString(",");
			}
			else if ((p=strstr(pt,"Output="))!=NULL)
			{
				csPrint += cs + CString(",");
			}
			else if ((p=strstr(pt,"PT="))!=NULL)
			{
				cs = &p[3];
				csPrint += cs + CString(",");
				switch(pidInx)
				{
				  case 0:
					m_stPid1KP.SetWindowText(cs);
					break;
				  case 1:
					m_stPid2KP.SetWindowText(cs);
					break;
				  case 2:
					m_stPid3KP.SetWindowText(cs);
					break;
				}
			}
			else if ((p=strstr(pt,"IT="))!=NULL)
			{
				cs = &p[3];
				csPrint += cs + CString(",");
				switch(pidInx)
				{
				  case 0:
					m_stPid1KI.SetWindowText(cs);
					break;
				  case 1:
					m_stPid2KI.SetWindowText(cs);
					break;
				  case 2:
					m_stPid3KI.SetWindowText(cs);
					break;
				}
			}
			else if ((p=strstr(pt,"DT="))!=NULL)
			{
				cs = &p[3];

				// Remove trailing linefeeds and CRs
				while (cs.GetAt(cs.GetLength()-1) < ' ')
					cs = cs.Left( cs.GetLength() - 1);
				csPrint += cs;
				switch(pidInx)
				{
				  case 0:
					m_stPid1KD.SetWindowText(cs);
					break;
				  case 1:
					m_stPid2KD.SetWindowText(cs);
					break;
				  case 2:
					m_stPid3KD.SetWindowText(cs);
					break;
				}
			}
		}

		pt = strtok (NULL, ",");
		index++;
    }

	csPrint += "\r\n";

	// Add to the control
	DisplayData( csMsg.GetString() );

	if (!bFirstTime)
	{
		bFirstTime = 1;
		csPrint = "RES, Tick, Input, Output, Setpoint, DTime, Error, PT, IT, DT\r\n";
	}

	return csPrint;
}
Ejemplo n.º 22
0
/**
 * Initialize the display controller.
 */
void OSD0201QILK::Enable()
{
    ChipSelect(true);

    Reset(false);
    SystemControl::Sleep(500);

    Reset(true);
    SystemControl::Sleep(10);

    // Select the 8-bit interface mode.
    DisplayData(false);

    ChipSelect (false);
    Write (0x24);
    ChipSelect (true);

    // Set RGB Interface control.
    WriteRegister (0x02, 0x0000);

    // Set entry mode for 262K colors, auto increment address pointer.
    WriteRegister (0x03, 0x4130);

    // Standby off.
    WriteRegister (0x10, 0x0000);

    // Required delay to allow display converts to come up.
    SystemControl::Sleep(100);

    WriteRegister (0x70, 0x2900);
    WriteRegister (0x71, 0x2A00);
    WriteRegister (0x72, 0x3700);
    WriteRegister (0x73, 0x1912);
    WriteRegister (0x74, 0x1B0D);
    WriteRegister (0x75, 0x2014);
    WriteRegister (0x76, 0x1812);
    WriteRegister (0x77, 0x2118);
    WriteRegister (0x78, 0x2111);


    // Set the window size.
    Window (0, 0, this->sizeX, this->sizeY);

    // Clear the screen.
    StartWrite();

    uint32_t pixelCount = this->sizeX * this->sizeY;

    while (pixelCount-- != 0)
        WritePixel(GUI::ColorBlack);

    StopWrite();

    // Turn on the ARVDD/ARVSS supplies.
    PowerConverter(true);

    // Allow the converters time to stabilize.
    SystemControl::Sleep(32);

    // Display on.
    WriteRegister (0x05, 0x0001);
}