void CCollocateRoom::OnBnClickedOk() { //保存参数 if(SaveParameter()==false)return; //变量定义 ASSERT(CParameterGlobal::GetInstance()!=NULL); CParameterGlobal * pParameterGlobal=CParameterGlobal::GetInstance(); //房间配置 if ((m_pParameterServer!=NULL)&&(m_pParameterGame!=NULL)) { //其他配置 pParameterGlobal->m_bLimitDetest=m_bLimitDetest; pParameterGlobal->m_bLimitSameIP=m_bLimitSameIP; //游戏配置 m_pParameterGame->m_wMinWinRate=m_wMinWinRate; m_pParameterGame->m_wMaxFleeRate=m_wMaxFleeRate; m_pParameterGame->m_lMaxGameScore=m_lMaxGameScore; m_pParameterGame->m_lMinGameScore=m_lMinGameScore; m_pParameterGame->m_bLimitWinRate=m_bLimitWinRate; m_pParameterGame->m_bLimitFleeRate=m_bLimitFleeRate; m_pParameterGame->m_bLimitGameScore=m_bLimitGameScore; //房间配置 m_pParameterServer->m_bTakePassword=m_bTakePassword; lstrcpyn(m_pParameterServer->m_szPassword,m_szPassword,CountArray(m_pParameterServer->m_szPassword)); } OnOK(); }
main (int argc, char *argv[]) { int done; char buffer[256]; char msge[10]; char *bptr, *tmpptr; char Current_InjectValve_Loc; int CurrentXYmm[2],CurrentZmm,Current_AirValve_Loc,CurrentVol; int xAxis,yAxis; int i,maxflow; int sampZtop,sampZbottom; /* int xyzMinMax[6]; */ double flowrate, zspeed,ztravel; int buflen = 1; if (argc < 2) { fprintf(stdout, "usage: %s <devicename> (i.e. /dev/term/b)\n", argv[0]); exit(1); } if (argc > 2) { verbose = 0; } /* initialize environment parameter vnmrsystem value */ tmpptr = getenv("vnmrsystem"); /* vnmrsystem */ if (tmpptr != (char *) 0) { strcpy(systemdir,tmpptr); /* copy value into global */ } else { strcpy(systemdir,"/vnmr"); /* use /vnmr as default value */ } if (verbose) fprintf(stdout, "Init Default Injector 'm215_inj.grk' at 558.2, 3.8\n"); strcpy(path,systemdir); strcat(path,"/asm/racks/m215_inj.grk"); inject = rackCreate(path); if (inject == NULL) { fprintf(stderr, "\nSystem failed to init '%s'\n", path); fprintf(stderr,"\ngilalign Aborted.\n"); exit(1); } rackCenter(inject, 5582 ,38); /* 558.2, 3.8, 84.2 Gilson position */ if (verbose) rackShow(inject, 1); if (verbose) fprintf(stdout,"Init Default Rack 'code_205.grk' at 54.6, 187.2\n"); strcpy(path,systemdir); strcat(path,"/asm/racks/code_205.grk"); rack = rackCreate(path); if (rack == NULL) { fprintf(stderr,"\nSystem failed to init '%s'\n", path); fprintf(stderr,"\ngilalign Aborted.\n"); exit(1); } rackCenter(rack, 546,1872); if (verbose) rackShow(rack, 1); if (verbose) fprintf(stdout,"Init Device: %s\n",argv[1]); /* * Convert old style comm description to new style: * Old Style: /dev/term/a * New Style: GIL_TTYA */ if ( (!strcmp(argv[1], "/dev/term/a")) || (!strcmp(argv[1], "/dev/ttya")) ) pGilObjId = gilsonCreate("GIL_TTYA", 22, 29, 3); else if ( (!strcmp(argv[1], "/dev/term/b")) || (!strcmp(argv[1], "/dev/ttyb")) ) pGilObjId = gilsonCreate("GIL_TTYB", 22, 29, 3); else if (!strcmp(argv[1], "/dev/ttyS0")) pGilObjId = gilsonCreate("GIL_COM1", 22, 29, 3); else pGilObjId = gilsonCreate(argv[1], 22, 29, 3); if (pGilObjId == NULL) { fprintf(stderr,"\nFailure to initialize Gilson '%s'\n", argv[1]); fprintf(stderr,"\nCheck that the i/o cable is properly attached.\n"); fprintf(stderr,"\ngilalign Aborted.\n"); exit(1); } /* Initialize Rinse Station Location */ RinseStation[0] = pGilObjId->RinseStation[0]; RinseStation[1] = pGilObjId->RinseStation[1]; RinseStationZ = pGilObjId->RinseStation[2]; xAxis = rackGetX(inject, ZONE1,1); yAxis = rackGetY(inject, ZONE1,1); sampZtop = rackSampTop(inject,ZONE1,1); sampZbottom = rackSampBottom(inject,ZONE1,1); /* gilInitInjLoc(pGilObjId,xAxis, yAxis, bottom); */ gilInitInjLoc(pGilObjId,xAxis, yAxis, InjectorBot); MaxFlow = gilsonMaxFlowRate(pGilObjId); /* ml/min */ MaxVolume = gilsonMaxVolume(pGilObjId); /* ul */ gilGetContacts(pGilObjId, 2, &Current_AirValve_Loc); gilGetInjectValveLoc(pGilObjId,&Current_InjectValve_Loc); gilGetXY(pGilObjId,CurrentXYmm); gilGetZ(pGilObjId,&CurrentZmm); CurrentVol = gilsonCurrentVolume(pGilObjId); if (verbose) PrintSet(); done = 1; fprintf(stdout,"\n\n"); gilXYZMinMax(pGilObjId,xyzMinMax); /**********/ fprintf(stdout,"%d %d %d %d %d %d %d %lf %d %c %d %d %d %d\n", xyzMinMax[0],xyzMinMax[1], xyzMinMax[2],xyzMinMax[3], xyzMinMax[4],xyzMinMax[5], MaxVolume,MaxFlow, Current_AirValve_Loc,Current_InjectValve_Loc, CurrentXYmm[0],CurrentXYmm[1], CurrentZmm,CurrentVol); fflush(stdout); while (done) { if (verbose) { fprintf(stdout,"T)ray Alignment, R)inse Station Alignment, " "I)njector Alignment, \n"); fprintf(stdout,"N)ew Syringe, C) Set Injector/Rack Centers, " "L)ist Present Settings \n"); fprintf(stdout,"K - Reset&Home Gilson, V)alve, " "inJ)ector Valve, \n"); fprintf(stdout,"D)efine Rack, A)rm Hight, P)rime pump, " "S)ave Parameters, Q)uit, \n"); fprintf(stdout,"F)req Liq Detect X)GoToHome " "Z)Test Rack Definition \n"); fprintf(stdout,"O)utputs - sets Gilson contact states, " "E)xternal Inputs, Y) Transparent Mode \n"); fprintf(stdout,"\nCmds: "); } else if (buflen) { fprintf(stdout,"Cmds:\n"); } /**********/ fflush(stdout); bptr = gets(buffer); buflen = strlen(buffer); if (bptr == NULL) break; switch( toupper(buffer[0]) ) { case 'D': DefineRack(); break; case 'R': RinseAlignment(); break; case 'I': InjectAlignment(); break; case 'T': TrayAlignment(); break; case 'N': PumpReplace(); break; case 'C': /* set rack centers */ setCenters(); break; case 'L': PrintSet(); break; case 'O': setOutputs(); break; case 'E': getInputs(); break; case 'P': PrimePump(); break; case 'V': setValve(); break; case 'J': setInjector(); break; case 'K': gilsonReset(pGilObjId); gilsonHome(pGilObjId); break; /* * case 'B': * saveAlignments(); * break; */ case 'A': setArmHeight(); break; case 'Q': done = 0; gilsonDelete(pGilObjId); return; break; case 'S': /* Store alignment parameters */ SaveParameter(); break; case 'X': /* Move to Home Position */ gotoHome(); break; case 'F': chkLQZ(); break; case 'Y': GilsonTransparentMode(); break; case 'Z': chkRack(); break; } } }