⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 udictionary.cpp

📁 dicom file 查看工具 DICOM文件是医疗设备使用的文件格式。
💻 CPP
字号:
//---------------------------------------------------------------------------
// This file is part of Dicom Explorer, see http://www.sourceforge.net/projects/dcmsee
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.                                 
// 
// This software is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Liu Jie (liucoldstar@yahoo.com)
//
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "uDictionary.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
__fastcall TfrmDictionary::TfrmDictionary(TComponent* Owner)
        : TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
__fastcall  TfrmDictionary::~TfrmDictionary()
{
  Disconnect();
}
//---------------------------------------------------------------------------
void __fastcall TfrmDictionary::Connect(void)
{
   ADOConnection->Connected=false;
   ADOConnection->Connected=true;
   ADOTable->Open();
}
//---------------------------------------------------------------------------
void __fastcall TfrmDictionary::Disconnect(void)
{
   ADOTable->Close();
   ADOConnection->Connected=false;
}
//---------------------------------------------------------------------------
bool __fastcall TfrmDictionary::Search(AnsiString Tag,TData *pData)
{
  AnsiString RET,VR;
  int nVR;
  bool bFound;
  TLocateOptions Opts;

  Opts.Clear();
  bFound=ADOTable->Locate("Tag",Tag,Opts);
 
  if(bFound)
  {
    pData->Tag=Tag;
    pData->Name=ADOTable->FieldByName("Name")->AsString;

    VR=ADOTable->FieldByName("VR")->AsString;
    pData->VR=VR;
    nVR=TypeToInt(VR);
    pData->Type=nVR;

    RET=ADOTable->FieldByName("RET")->AsString;
    if(RET=='Y') pData->IsRetired=true;
    else pData->IsRetired=false;
  }
  return bFound;
}

//---------------------------------------------------------------------------
int __fastcall TfrmDictionary::TypeToInt(AnsiString Name)
{
  int nHigh,nLow;

  nHigh=Name[2];
  nLow=Name[1];
  return ((nHigh<<8)+nLow);
}




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -