本文整理汇总了C++中Initial函数的典型用法代码示例。如果您正苦于以下问题:C++ Initial函数的具体用法?C++ Initial怎么用?C++ Initial使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Initial函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Open
int CSMDevice::Open()
{
if(Initial() != 0)
return 1;
hMapFile = CreateFileMapping(
INVALID_HANDLE_VALUE, // use paging file
NULL, // default security
PAGE_READWRITE, // read/write access
0, // maximum object size (high-order DWORD)
this->gComm_SMsize, // maximum object size (low-order DWORD)
this->gComm_SMName); // name of mapping object
if (hMapFile == NULL)
{
MessageBox(NULL, TEXT("CreateFileMapping Fail"), TEXT("CSMDevice::Open"), MB_OK);
return 2;
}
pBuf = (unsigned short*) MapViewOfFile(hMapFile, // handle to map object
FILE_MAP_ALL_ACCESS, // read/write permission
0,
0,
this->gComm_SMsize);
if (pBuf == NULL)
{
MessageBox(NULL, TEXT("MapViewOfFile Fail"), TEXT("CSMDevice::Open"), MB_OK);
CloseHandle(hMapFile);
return 3;
}
return 0;
}
开发者ID:cckuang6319,项目名称:Test,代码行数:33,代码来源:SMDevice.cpp
示例2: main
void main()
{
Initial(); //Initialize all settings required for general QwikFlash and LCD operation
DisplayC(Clear1); //Clear the LCD one time at the beginning of your program
DisplayC(Clear2);
//Your personal PORT/TRIS/ADCON/etc settings or configurations can go here
//Or make your own function and call it
TRISBbits.RB0 = 1; // set PortB0 as input port
TRISBbits.RB1 = 1; // set PortB1 as input port
TRISBbits.RB2 = 1; // set PortB2 as input port
TRISBbits.RB3 = 1; // set PortB3 as input port
T0CON = 0b00000101; // timer 0 configuration register bit settings
INTCON = 0b00110000; // interrupt configuration register bit settings
INTCON2 = 0b11110000; // interrupt configuration register 2 bit settings
INTCON3 = 0b00001000; // interrupt configuration register 3 bit settings
RCON = 0b10000000;
TMR0H = 0x67; // Load preload value in timer 0 in high byte
TMR0L = 0x69; // Load preload value in timer 0 in low byte
INTCONbits.PEIE = 1; // Set PEIE enable bit
INTCONbits.GIE = 1; // GIE enable bit
T0CONbits.TMR0ON = 1; // turn timer 0 on
while (1)
{
// switch1 is a flag that is set from the low
// priority interrupt
if (switch1)
{
DisplayC(pause1); // display the pause symbol
Str_2[1] = 0x03;
}
else
{
DisplayC(play1); // display the play symbol
Str_2[1] = 0x04;
}
// if switch 1, switch 2, and pushbutton 1 are set
// then increment timer
if (switch1 == 1 && PORTBbits.RB2 == 1 && PORTBbits.RB3 == 1)
{
Str_2[7] = '+'; // display ++ for increment
Str_2[8] = '+';
timeInDay();
}
else
{
Str_2[7] = ' '; // clear ++ for increment
Str_2[8] = ' ';
}
DisplayC(Str_2);
}
}
开发者ID:Eddie-Molina,项目名称:Embedded-Systems,代码行数:59,代码来源:LAB6.c
示例3: main
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "Remotely.uir", PANEL)) < 0)
return -1;
if ((configHandle = LoadPanel (0, "Remotely.uir", CONFIG)) < 0)
return -1;
if ((itemHandle = LoadPanel (0, "Remotely.uir", FILE_ITEM)) < 0)
return -1;
menubarHandle = GetPanelMenuBar (panelHandle);
GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 0, &bbucommonHandle);
GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 1, &rrucommonHandle);
GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 2, &customizingHandle);
SetActiveTabPage (panelHandle, PANEL_TAB, 0);
if(Initial(0, 0)<0 || Initial(1, 0)<0 || Initial(2, 0)<0 || Initial(3, 0)<0)
{
SetLed("Read file type information from config.ini to UI error,please try again!",0);
}
WriteLog();
DisplayPanel (panelHandle);
RunUserInterface ();
return 0;
}
开发者ID:jufei,项目名称:BtsShell,代码行数:25,代码来源:Remotely.c
示例4: DancePartner
void DancePartner(Person dancer[],int num)
{ //结构数组dancer中存放跳舞的男女,num是跳舞的人数。
int i;
Person p;
CirQueue Mdancers,Fdancers;
Initial(&Mdancers);//男士队列初始化
Initial(&Fdancers);//女士队列初始化
for(i=0; i<num; i++) { //依次将跳舞者依其性别入队
p=dancer[i];
if(p.sex=='F')
EnQueue(&Fdancers,p); //排入女队
else
EnQueue(&Mdancers,p); //排入男队
}
printf("舞队是:\n");
while(!IsEmpty(&Fdancers)&&!IsEmpty(&Mdancers)) {
//依次输入男女舞伴名
p=DeQueue(&Fdancers); //女士出队
printf("%s ",p.name);//打印出队女士名
p=DeQueue(&Mdancers); //男士出队
printf("%s\n",p.name); //打印出队男士名
}
if(!IsEmpty(&Fdancers)) { //输出女士剩余人数及队头女士的名字
printf("还有 %d 个女士等下一轮.\n",Fdancers.count);
p=Front(&Fdancers); //取队头
printf("%s will be the first to get a partner. \n",p.name);
}
else if(!IsEmpty(&Mdancers)) { //输出男队剩余人数及队头者名字
printf("还有%d 个男士等下一轮.\n",Mdancers.count);
p=Front(&Mdancers);
printf("%s will be the first to get a partner.\n",p.name);
}
}
开发者ID:Jzhi,项目名称:C-repository,代码行数:33,代码来源:1-31.c
示例5: ConfigItem
void CVICALLBACK ConfigItem (int menuBar, int menuItem, void *callbackData,
int panel)
{
if((Initial(1, 0)>=0) && (Initial(2, 0)>=0) && (Initial(3, 0)>=0))
{
InstallPopup(itemHandle);
}
else
{
SetLed("Read file type or filter information from config.ini to UI error,please try again!",0);
}
}
开发者ID:jufei,项目名称:BtsShell,代码行数:13,代码来源:Remotely.c
示例6: main
int main(){
int k, n, N, p, q, r;
double *y_r, *y_i, *x_r, *x_i, w_r, w_i;
printf("Please input p q r=");
scanf("%d %d %d", &p, &q, &r);
N = Generate_N(p, q, r);
printf("N=2^%d 3^%d 5^%d = %d\n",p,q,r,N);
x_r = (double *) malloc(N*sizeof(double));
x_i = (double *) malloc(N*sizeof(double));
y_r = (double *) malloc(N*sizeof(double));
y_i = (double *) malloc(N*sizeof(double));
Initial(x_r, x_i, N);
FFTv3(x_r, x_i, y_r, y_i, N);
/*
for(int i=0;i<N;++i){
printf("%f\n",y_r[i]);
}
*/
Print_Complex_Vector(y_r, y_i, N);
return 0;
}
开发者ID:james000022001,项目名称:Homeworks,代码行数:25,代码来源:FFT-radix-3.cpp
示例7: CriticalPath
Status CriticalPath(GRAPHIC_TYPE graphic, GRAPHIC_TYPE* result) {
int i = 0;
int vertex_count = graphic -> vertex_count;
int *topological_sort_result_index = (int*)malloc(sizeof(int) * vertex_count),
*vertex_earliest_start_time = (int*)malloc(sizeof(int) * vertex_count),
*vertex_latest_start_time = (int*)malloc(sizeof(int) * vertex_count);
//initial
for (i = 0; i < vertex_count; i++) {
vertex_earliest_start_time[i] = -1;
vertex_latest_start_time[i] = -1;
}
calculate_topological_sort_result_index(graphic, topological_sort_result_index);
calculate_vertex_earliest_start_time(graphic, topological_sort_result_index, vertex_earliest_start_time);
vertex_latest_start_time[vertex_count - 1] = vertex_earliest_start_time[vertex_count - 1];
calculate_vertex_latest_start_time(graphic, topological_sort_result_index, vertex_latest_start_time);
Initial(result);
calculate_critical_path_result(graphic, topological_sort_result_index, vertex_earliest_start_time, vertex_latest_start_time, result);
free(topological_sort_result_index);
free(vertex_earliest_start_time);
free(vertex_latest_start_time);
return OK;
}
开发者ID:yuandong1222,项目名称:DataStructureInC,代码行数:29,代码来源:adjacent_matrix_graphic.c
示例8: Reset
void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType)
{
m_sAPType = sAPType;
Reset();
Initial();
}
开发者ID:Gardenya,项目名称:pdfium,代码行数:7,代码来源:FFL_CBA_Fontmap.cpp
示例9: memset
__fastcall PCIM114GL::PCIM114GL()
{
m_byteDIPort=NULL;
m_byteDOPort=NULL;
m_bAutoMode=false;
m_bInitOK=Initial(0);
if(!m_bInitOK)
{
m_byteDIPort=new byte[12];
m_byteDOPort=new byte[12];
}
m_dMMtoPLS[Axis_Const::LDY]=10000.0/10.0;
m_dMMtoPLS[Axis_Const::LDZ]=10000.0/10.0;
m_dMMtoPLS[Axis_Const::SPZ]=10000.0/5.0;
m_dMMtoPLS[Axis_Const::MGZ]=10000.0/5.0;
m_dMMtoPLS[Axis_Const::LLC]=10000.0/16.0;
m_dMMtoPLS[Axis_Const::SPX]=10000.0/16.0;
m_dMMtoPLS[Axis_Const::SPY]=10000.0/16.0;
m_dMMtoPLS[Axis_Const::CDX]=10000.0/16.0;
m_dMMtoPLS[Axis_Const::RLC]=10000.0/16.0;
for(int nIndex=0;nIndex<AXIS_SIZE;nIndex++) m_dLastTargetPos[nIndex]=0.0;
memset(m_byteDOPort,0,sizeof(byte)*m_vectDIOMap.size() * 2);
}
开发者ID:Raxtion,项目名称:CT83,代码行数:33,代码来源:PCIM114GL.cpp
示例10: Initial
void CJS_EventHandler::OnMenu_Exec(
CPDFSDK_FormFillEnvironment* pTargetFormFillEnv,
const CFX_WideString& strTargetName) {
Initial(JET_MENU_EXEC);
m_pTargetFormFillEnv.Reset(pTargetFormFillEnv);
m_strTargetName = strTargetName;
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:7,代码来源:JS_EventHandler.cpp
示例11: main
// <<< main function >>>
//*****************************************************************************
void main(void)
{
unsigned char i;
Initial(); //initial .....
#if (SFNsimple ==0)
//char *mySTR = "Complete mode!";
static char *mySTR[3] = {
"S-Font test...",
"Complete mode!",
"Www.Elasa.ir!"
};
N11_TypeStr(1, 1, mySTR[1], N11_GetStrLenC(mySTR[1]), BLACK, 150);
_delay_ms(2000);
N11_TypeStr(1, 1, mySTR[1], N11_GetStrLenC(mySTR[1]), WHITE, 50);
_delay_ms(1000);
N11_TypeStr(0, 1, mySTR[0], N11_GetStrLenC(mySTR[0]), BLACK, 100);
N11_TypeStr(2, 1, mySTR[1], N11_GetStrLenC(mySTR[1]), BLACK, 100);
N11_TypeStr(4, 1, mySTR[2], N11_GetStrLenC(mySTR[2]), BLACK, 100);
N11_TypeStr(6, 1, mySTR[3], N11_GetStrLenC(mySTR[3]), BLACK, 100);
_delay_ms(3000);
N11_ChrCls(100);
_delay_ms(500);
StringAt(1, 1, "YES!!! :)", BLACK);
#endif
//----- main loop!!!
while(1);
} //main
开发者ID:soheilpaper,项目名称:soheil-avr-studiov4,代码行数:37,代码来源:main.c
示例12: main
int main(int argc, char* argv[])
{
int * x = NULL;
int row = 2;
int col = 2;
int i, j;
int layer = 3;
if(argc >= 2)
layer = atoi(argv[1]);
x = (int*)malloc(row * col * sizeof(int));
memset(x, 0, sizeof(int) * row * col);
Initial(x, 2, 2);
Hilbert(&x, row, col, layer);
printf("Hilbert list:\n");
for(i = 0;i < row * pow(2, layer - 1);i ++)
{
for(j = 0;j < col * pow(2, layer - 1);j ++)
printf("%d \t", x[i * col * (int)pow(2, layer - 1) + j]);
printf("\n");
}
printf("\nEnd Hilbert layer = %d.\n", layer);
free(x);
x = NULL;
getchar();
return 0;
}
开发者ID:ycj28c,项目名称:543-Computer-Graphic,代码行数:35,代码来源:hilbert.c
示例13: Initial
void CJS_EventHandler::OnDoc_Open(CPDFSDK_Document* pDoc,
const CFX_WideString& strTargetName) {
Initial(JET_DOC_OPEN);
m_pTargetDoc = pDoc;
m_strTargetName = strTargetName;
}
开发者ID:hoanganhx86,项目名称:pdfium,代码行数:7,代码来源:JS_EventHandler.cpp
示例14: Initial
CDataBlockAllocator::CDataBlockAllocator(int nDBNum, int nDBSize, int bIniShareDB )
:m_nMaxDBNum(nDBNum)
,m_nDBSize(nDBSize)
{
Initial(bIniShareDB);
m_MapTest.clear();
}
开发者ID:Kiddinglife,项目名称:tpgame,代码行数:7,代码来源:DataBlockAllocator.cpp
示例15: main
int main(int argc,char **argv)
{
PetscErrorCode ierr;
PetscInt time_steps = 100,steps;
PetscMPIInt size;
Vec global;
PetscReal dt,ftime;
TS ts;
MatStructure A_structure;
Mat A = 0;
ierr = PetscInitialize(&argc,&argv,(char*)0,help);CHKERRQ(ierr);
ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr);
ierr = PetscOptionsGetInt(NULL,"-time",&time_steps,NULL);CHKERRQ(ierr);
/* set initial conditions */
ierr = VecCreate(PETSC_COMM_WORLD,&global);CHKERRQ(ierr);
ierr = VecSetSizes(global,PETSC_DECIDE,3);CHKERRQ(ierr);
ierr = VecSetFromOptions(global);CHKERRQ(ierr);
ierr = Initial(global,NULL);CHKERRQ(ierr);
/* make timestep context */
ierr = TSCreate(PETSC_COMM_WORLD,&ts);CHKERRQ(ierr);
ierr = TSSetProblemType(ts,TS_NONLINEAR);CHKERRQ(ierr);
ierr = TSMonitorSet(ts,Monitor,NULL,NULL);CHKERRQ(ierr);
dt = 0.1;
/*
The user provides the RHS and Jacobian
*/
ierr = TSSetRHSFunction(ts,NULL,RHSFunction,NULL);CHKERRQ(ierr);
ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr);
ierr = MatSetSizes(A,PETSC_DECIDE,PETSC_DECIDE,3,3);CHKERRQ(ierr);
ierr = MatSetFromOptions(A);CHKERRQ(ierr);
ierr = MatSetUp(A);CHKERRQ(ierr);
ierr = RHSJacobian(ts,0.0,global,&A,&A,&A_structure,NULL);CHKERRQ(ierr);
ierr = TSSetRHSJacobian(ts,A,A,RHSJacobian,NULL);CHKERRQ(ierr);
ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
ierr = TSSetInitialTimeStep(ts,0.0,dt);CHKERRQ(ierr);
ierr = TSSetDuration(ts,time_steps,1);CHKERRQ(ierr);
ierr = TSSetSolution(ts,global);CHKERRQ(ierr);
ierr = TSSolve(ts,global);CHKERRQ(ierr);
ierr = TSGetSolveTime(ts,&ftime);CHKERRQ(ierr);
ierr = TSGetTimeStepNumber(ts,&steps);CHKERRQ(ierr);
/* free the memories */
ierr = TSDestroy(&ts);CHKERRQ(ierr);
ierr = VecDestroy(&global);CHKERRQ(ierr);
ierr = MatDestroy(&A);CHKERRQ(ierr);
ierr = PetscFinalize();
return 0;
}
开发者ID:feelpp,项目名称:debian-petsc,代码行数:60,代码来源:ex2.c
示例16: main
void main()
{
Initial(); //Initialize all settings required for general QwikFlash and LCD operation
DisplayC(Clear1); //Clear the LCD one time at the beginning of your program
DisplayC(Clear2);
long retTen; // initialize variable for 10K ohm potentiometer
long retPot; // initialize variable for Potentiometer 1 on circuit board
SSPSTAT = 0b11000000; // SMP and CKE
SSPCON1 = 0b00100000; // Enable SPI serial port
//Your personal PORT/TRIS/ADCON/etc settings or configurations can go here
//Or make your own function and call it
while(1)
{
Delay10KTCYx(25);
retTen = tenK(); // Store value from 10K ohm potentiometer
Delay10KTCYx(25);
retPot = pot1(); // Store value from Potentiometer 1 on circuit board
displayAnalog(retTen, retPot);
}
}
开发者ID:Eddie-Molina,项目名称:Embedded-Systems,代码行数:25,代码来源:LAB5.c
示例17: Multiply
Status Multiply(SPARSE_MATRIX_TYPE a, SPARSE_MATRIX_TYPE b,
SPARSE_MATRIX_TYPE *product) {
if (a -> column_length != b -> row_length)
return ERROR;
Status status = Initial(product, a -> row_length, b -> column_length);
if (status != OK)
return status;
int index_a = 0, index_b = 0;
ElementType element;
for (index_a = 0; index_a < a -> value_count; index_a++) {
for (index_b = 0; index_b < b -> value_count; index_b++) {
Triplet *triplet_a = (a -> data) + index_a;
Triplet *triplet_b = (b -> data) + index_b;
if (triplet_a -> column_index != triplet_b -> row_index)
continue;
Value(*product, &element, triplet_a -> row_index,
triplet_b -> column_index);
element += (triplet_a -> value) * (triplet_b -> value);
Assign(*product, triplet_a -> row_index, triplet_b -> column_index,
element);
}
}
return OK;
}
开发者ID:yuandong1222,项目名称:DataStructureInC,代码行数:29,代码来源:triplet_sparse_matrix.c
示例18: main
/*******************************************************************************
* main subroutine
*
* This routine will run continuously after program initialization
*
* Within each iteration it will collect 1 temperature reading, 1 humidity
* reading, save the latest data, and check if it should transmit the last
* chunk of data from EEPROM
*
* Inputs: None
* Outputs: None
******************************************************************************/
void main(void) {
Initial();
while (1) {
if ( USARTFlag ) { //Checks if there was a new byte from USART
CheckUSART();
}
if ( OKGOFlag ) { //Check if "ok to send" has been received
if ( SENDFlag ) { //Check if latest data block is ready
SendDATA(TTRAN); //Send temperature data
FIRST = 0; //Clear flag for first time transmission
SENDFlag = 0; //Clear flag for latest chunk of data
}
}
if ( TimeStamp > 900 ) {
WakeXBEE(); //Wake up XBEE if more than 15 minutes has
} // passed
if ( TimeStamp > 3600 ) { //One hour has passed
T0CONbits.TMR0ON = 0; //Turn off TMR0
SendBYTE(0xFF); //Send Ack command to tell GSMRS we are done
while( 1 ) {
TxERROR(TTRAN);
}
}
while ( SECFlag == 0 ) {} //Waits until 1 second has passed
ADCON0bits.GO = 1; //Start collecting temperature data
while ( ADCON0bits.GO ) {} //Wait for collection to finish
ADConverter();
SECFlag = 0; //Reset 1 second counter
Store(); //Store latest readings in RAM or EEPROM
}
}
开发者ID:JohnThom212,项目名称:INFERNO,代码行数:45,代码来源:SP_2_19.c
示例19: main
int main()
{
int k, n, p, q, r, N;
double *y_r, *y_i, *x_r, *x_i, w_r, w_i;
clock_t t1, t2;
printf("Please input p q r=");
scanf("%d %d %d", &p, &q, &r);
N = Generate_N(p, q, r);
printf("N=2^%d 3^%d 5^%d = %d\n",p,q,r,N);
x_r = (double *) malloc(N*sizeof(double));
x_i = (double *) malloc(N*sizeof(double));
y_r = (double *) malloc(N*sizeof(double));
y_i = (double *) malloc(N*sizeof(double));
Initial(x_r, x_i, N);
t1 = clock();
FFTr3(x_r, x_i, y_r, y_i, N);
t2 = clock();
printf("Fast FT3: %f secs\n", 1.0*(t2-t1)/CLOCKS_PER_SEC);
// Print_Complex_Vector(y_r, y_i, N);
return 0;
}
开发者ID:xflying777,项目名称:Fast_Computing,代码行数:25,代码来源:fft_radix_3.cpp
示例20: Initial
XArc::XArc(const PNT &c, const PNT &s, const PNT &e, const PNT &n)
{
m_Cen = c;
m_StartPt = s;
m_EndPt = e;
Initial();
}
开发者ID:perlinson,项目名称:ETE,代码行数:7,代码来源:XArc.cpp
注:本文中的Initial函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论