/****************************************************************************** * * Title : loadExitHost.c * Version 0.0, 6 July 2000, * * Description: loadExit host routines. * * Author: Lukas Tomasek, tomasekl@fzu.cz * ******************************************************************************/ /****************************************************************************** * Header files * ******************************************************************************/ #include #include #include "loadExitHost.h" #include "mainUir.h" #include "primListEditUir.h" #include "hostUtility.h" #include "mainUir.h" #include "commandListExecution.h" #include "vmeAddressMap.h" #include "vmeHpiUtility.h" #include "timUir.h" #include "rodMemoryUir.h" #include "fpgaUir.h" #include "commandListEditUir.h" #include "commandParamsUir.h" #include "commandFunctionInit.h" #include "communicationLoop.h" #include "primFunctionInit.h" #include "flashUtility.h" #include "threadUtility.h" #include "primParamsUir.h" #include "uirUtility.h" #include "fillUirControls.h" #include "primFunctionInit.h" /****************************************************************************** * Static Function Declarations * ******************************************************************************/ static ERROR_ID startHost(struct HOST *host); /****************************************************************************** * Global functions * ******************************************************************************/ #define SET_ADDRESS_LIMITS(panel, control) \ SetCtrlVal(panel, control##_START_ADDR, FPGA_FLASH_0_BOTTOM_REL_ADDR);\ status=SetCtrlAttribute (panel, control##_START_ADDR, ATTR_MIN_VALUE, FPGA_FLASH_0_BOTTOM_REL_ADDR);\ UIR_STATUS_CHECK(status, SetCtrlAttr());\ status = SetCtrlAttribute (panel, control##_START_ADDR, ATTR_MAX_VALUE, FPGA_FLASH_2_BOTTOM_REL_ADDR+FLASH_MEMORY_SIZE);\ UIR_STATUS_CHECK(status, SetCtrlAttr());\ SetCtrlVal(panel, control##_END_ADDR, FPGA_FLASH_0_BOTTOM_REL_ADDR);\ status=SetCtrlAttribute (panel, control##_END_ADDR, ATTR_MIN_VALUE, FPGA_FLASH_0_BOTTOM_REL_ADDR);\ UIR_STATUS_CHECK(status, SetCtrlAttr());\ status = SetCtrlAttribute (panel, control##_END_ADDR, ATTR_MAX_VALUE, FPGA_FLASH_2_BOTTOM_REL_ADDR+FLASH_MEMORY_SIZE);\ UIR_STATUS_CHECK(status, SetCtrlAttr()); /*============================================================================= * hostGlobalInit() *============================================================================= * * Global initialization after program startup. * */ ERROR_ID hostGlobalInit(struct GLOBAL_VARIABLES *global){ ERROR_ID errorId; int panel, control; char *buffer; long fileSize; char file[300]; int status; int i; int slot; int id; char string[PATHNAME_LENGTH]; int delete; int primArrayId; int *primPanelPtr; // if(ConfirmPopup ("ConfirmPopup", "Delete ErrorFile and all RodData files?")){ if( GenericMessagePopup ("ConfirmPopup", "Delete ErrorFile and all RodData files?", "Yes", "No", 0, 0, 0, 0, VAL_GENERIC_POPUP_BTN2, VAL_GENERIC_POPUP_NO_CTRL, VAL_GENERIC_POPUP_NO_CTRL) == 1){ /* delete rod subdirectories */ DeleteFile(global->errorFileName); strcpy(string, global->mainDir); DeleteFile(strcat(string, TEMPORARY_DATA_SUBDIR"*.*")); delete=1; }else{ delete=0; } for(slot=FIRST_ROD_VME_SLOT; slot<=LAST_ROD_VME_SLOT; ++slot){ strcpy(string, global->mainDir); strcat(string, ROD_SUBDIR); sprintf(string+strlen(string), "%d\\", slot); strcpy(global->rodDataDir[HOST_INDEX(slot)], string); strcat(string, "*.*"); if(delete) DeleteFile(string); } /* init data directory names */ strcpy(global->rodGeneralDataDir, global->mainDir); strcat(global->rodGeneralDataDir, ROD_SUBDIR"#\\"); strcpy(global->commonDataDir, global->mainDir); strcat(global->commonDataDir, COMMON_DATA_SUBDIR); strcpy(global->testingDataDir, global->mainDir); strcat(global->testingDataDir, TESTING_DATA_SUBDIR); strcpy(global->fpgaDataDir, global->mainDir); strcat(global->fpgaDataDir, FPGA_DATA_SUBDIR); strcpy(global->dspPrgDataDir, global->mainDir); strcat(global->dspPrgDataDir, DSP_PRG_DATA_SUBDIR); strcpy(global->listRingsDir, global->mainDir); strcat(global->listRingsDir, LISTRINGS_SUBDIR); strcpy(global->moduleCfgDir, global->mainDir); strcat(global->moduleCfgDir, MODULECFG_SUBDIR); /* load main panel */ LOAD_PANEL(&global->panel.main,0, "mainUir.uir", MAIN); /* init global variables */ global->hostCount=0; /* hostCount - no active */ global->option.programExit=FALSE; /* programExit */ GetCtrlVal(global->panel.main, MAIN_VME_BYTE_ORDER, &global->option.intelNotMotorola); GetCtrlVal(global->panel.main, MAIN_CHECKSUM_MASTER, &global->option.masterChecksum); GetCtrlVal(global->panel.main, MAIN_CHECKSUM_SLAVE, &global->option.slaveChecksum); GetCtrlVal(global->panel.main, MAIN_SAVE_LISTS_OPTION, &global->option.saveLists); global->cmdListExecThreadPriority=THREAD_PRIORITY_NORMAL; status=SetMouseCursor(VAL_POINTING_FINGER_CURSOR); UIR_STATUS_CHECK(status, SetMouseCursor()); status=SetSleepPolicy(VAL_SLEEP_MORE); //!! UIR_STATUS_CHECK(status, SetSleepPolicy()); LOAD_PANEL(&global->panel.loadHost, global->panel.main, "mainUir.uir", NEWROD_PN); strcpy(string, global->listRingsDir); strcat(string, LISTRINGS_CFG_FILE); errorId=loadListRings(global->panel.main, string); ERROR_CHECK(errorId, loadListRings()); /* load distributionPlot panel */ LOAD_PANEL(&global->panel.distributionPlot,0, "mainUir.uir", GRAPHP); /* load tim panel */ LOAD_PANEL(&global->panel.tim, 0, "timUir.uir", TIMP); errorId=loadTimRegFile(global->panel.tim, 0); /* init to reg0 */ ERROR_CHECK(errorId, loadTimRegFile()); /* load VME memory panel */ LOAD_PANEL(&global->panel.vmeMemory,0, "rodMemoryUir.uir", VME_MEM); panel=global->panel.vmeMemory; control=VME_MEM_ADDRESS_TABLE; LOAD_PANEL(&global->panel.writeBuffVme, panel, "rodMemoryUir.uir", WRBUFF_VME); i=0; fillAddrTable(panel, control, "HPIC",HPIC_REL_ADDR, sizeof(UINT32)); fillAddrTable(panel, control, "HPIA",HPIA_REL_ADDR, 0x4); fillAddrTable(panel, control, "HPID++",HPID_AUTOINC_REL_ADDR, sizeof(UINT32)); fillAddrTable(panel, control, "HPID",HPID_NO_AUTOINC_REL_ADDR, sizeof(UINT32)); fillAddrTable(panel, control, "FPGA Ctrl&Stat",FPGA_CONTROL_0_REL_ADDR, 24*sizeof(UINT32)); /* load MasterDSP memory panel */ LOAD_PANEL(&global->panel.masterDspMemory,0, "rodMemoryUir.uir", MASTER_MEM); panel=global->panel.masterDspMemory; control=MASTER_MEM_ADDRESS_TABLE; LOAD_PANEL(&global->panel.writeBuffMaster, panel, "rodMemoryUir.uir", WRBUFF_M); fillAddrTable(panel, control, "Formatter 0",0x00400000, 0x3E0); fillAddrTable(panel, control, "Formatter 1",0x00400400, 0x3E0); fillAddrTable(panel, control, "Formatter 2",0x00400800, 0x3E0); fillAddrTable(panel, control, "Formatter 3",0x00400c00, 0x3E0); fillAddrTable(panel, control, "Formatter 4",0x00401000, 0x3E0); fillAddrTable(panel, control, "Formatter 5",0x00401400, 0x3E0); fillAddrTable(panel, control, "Formatter 6",0x00401800, 0x3E0); fillAddrTable(panel, control, "Formatter 7",0x00401c00, 0x3E0); fillAddrTable(panel, control, "EFB FPGA",0x00402000, 0x280); fillAddrTable(panel, control, "EFB Diag Regs",0x00402200, 0x80); fillAddrTable(panel, control, "Router FPGA", 0x00402400, 0x110); fillAddrTable(panel, control, "Controller FPGA", 0x00404400, 0x100); //CE0_BASE 0x80000 fillAddrTable(panel, control, "FE Occupancy", 0x00404500, 0x30); fillAddrTable(panel, control, "ModeBits LUT", 0x00404600, 0x80); fillAddrTable(panel, control, "EFB DMask LUT", 0x00404700, 0x74); fillAddrTable(panel, control, "BOC Status",0x00408F00, 0xC4); fillAddrTable(panel, control, "BOC",0x00408000, 0xFC4); fillAddrTable(panel, control, "ROD Status",STATUS_REG_0, 12); fillAddrTable(panel, control, "VME Command",COMMAND_REG_0, 8); fillAddrTable(panel, control, "Expert Cmd", EXPERT_REG, 4); fillAddrTable(panel, control, "Histogram Cmd", HCMD_STAT_REG_0, 8); fillAddrTable(panel, control, "Histogram Stat", HSTAT_REG_0, 8); fillAddrTable(panel, control, "Trap Req",TRAPREQ_REG, 4); fillAddrTable(panel, control, "Trap Stat",TRAPSTAT_REG, 4); fillAddrTable(panel, control, "Error Buffer",ERR_BUFF_BASE, TXT_BUFF_SIZE); fillAddrTable(panel, control, "Info Buffer",INFO_BUFF_BASE, TXT_BUFF_SIZE); fillAddrTable(panel, control, "Diag Buffer",DIAG_BUFF_BASE, TXT_BUFF_SIZE); fillAddrTable(panel, control, "Xfer Buffer",XFER_BUFF_BASE, TXT_BUFF_SIZE); fillAddrTable(panel, control, "Prim Buffer",PRIM_BUFF_BASE, PRIM_BUFF_SIZE); fillAddrTable(panel, control, "Reply Buffer",REP_BUFF_BASE, REP_BUFF_SIZE); fillAddrTable(panel, control, "EMIF Control",0x01800000, 0x20); fillAddrTable(panel, control, "DMA Control",0x01840000, 0x74); fillAddrTable(panel, control, "McBSP0 Control",0x018C0000, 0x28); fillAddrTable(panel, control, "McBSP1 Control",0x01900000, 0x28); fillAddrTable(panel, control, "DSP Flash",BOOT_ROM_BASE, 0x80000); fillAddrTable(panel, control, "IPRAM",IPRAM_BASE, IPRAM_SZ); fillAddrTable(panel, control, "IDRAM",IDRAM_BASE, IDRAM_SZ); fillAddrTable(panel, control, "SDRAM0",SDRAM0_BASE, SDRAM0_SZ); fillAddrTable(panel, control, "SDRAM1",SDRAM1_BASE, SDRAM1_SZ); fillAddrTable(panel, control, "Slave0 HPI",SLAVE_HPI_BASE_ADDR(0), 0x10); fillAddrTable(panel, control, "Slave1 HPI",SLAVE_HPI_BASE_ADDR(1), 0x10); fillAddrTable(panel, control, "Slave2 HPI",SLAVE_HPI_BASE_ADDR(2), 0x10); fillAddrTable(panel, control, "Slave3 HPI",SLAVE_HPI_BASE_ADDR(3), 0x10); fillAddrTable(panel, control, "ModuleDataBase", MODULE_DATA_BASE, MODULE_DATA_SZ); fillAddrTable(panel, control, "IDATA",IDATA_BASE, IDATA_SZ); /* load SlaveDSP memory panel */ LOAD_PANEL(&global->panel.slaveDspMemory,0, "rodMemoryUir.uir", SLAVE_MEM); panel=global->panel.slaveDspMemory; control=SLAVE_MEM_ADDRESS_TABLE; LOAD_PANEL(&global->panel.writeBuffSlave, panel, "rodMemoryUir.uir", WRBUFF_S); fillAddrTable(panel, control, "SDSP Status",STATUS_REG_0, 12); fillAddrTable(panel, control, "MDSP Command",COMMAND_REG_0, 8); fillAddrTable(panel, control, "Expert Cmd", EXPERT_REG, 4); fillAddrTable(panel, control, "Histogram Cmd", HCMD_STAT_REG_0, 8); fillAddrTable(panel, control, "Histogram Stat", HSTAT_REG_0, 8); fillAddrTable(panel, control, "Trap Req",TRAPREQ_REG, 4); fillAddrTable(panel, control, "Trap Stat",TRAPSTAT_REG, 4); fillAddrTable(panel, control, "Error Buffer",ERR_BUFF_BASE, TXT_BUFF_SIZE); fillAddrTable(panel, control, "Info Buffer",INFO_BUFF_BASE, TXT_BUFF_SIZE); fillAddrTable(panel, control, "Diag Buffer",DIAG_BUFF_BASE, TXT_BUFF_SIZE); fillAddrTable(panel, control, "Prim Buffer",SDSP_PRM_BFR_BASE, SDSP_PRM_BFR_SZ); fillAddrTable(panel, control, "Reply Buffer",SDSP_REP_BFR_BASE, SDSP_REP_BFR_SZ); fillAddrTable(panel, control, "RouterOutFifo",0x01400000, 0x100); fillAddrTable(panel, control, "EMIF Control",0x01800000, 0x20); fillAddrTable(panel, control, "DMA Control",0x01840000, 0x74); fillAddrTable(panel, control, "IPRAM",IPRAM_BASE, IPRAM_SZ); fillAddrTable(panel, control, "IDRAM",IDRAM_BASE, IDRAM_SZ); fillAddrTable(panel, control, "SDRAM0",0x02000000, 0x1000000); fillAddrTable(panel, control, "SDRAM1",0x03000000, 0x1000000); fillAddrTable(panel, control, "TrapBufferBase",EVENT_TRAP_DEFAULT_BASE, EVENT_TRAP_DEFAULT_SZ); #ifndef COMPACT fillAddrTable(panel, control, "HistogramBase",HISTOGRAM_DEFAULT_BASE, 0x100); #endif /* COMPACT */ fillAddrTable(panel, control, "IDATA",IDATA_BASE, IDATA_SZ); /* load FPGA and Flash panels */ LOAD_PANEL(&global->panel.fpga,0, "fpgaUir.uir", PANEL_FPGA); LOAD_PANEL(&global->panel.flash,0, "fpgaUir.uir", PAN_FLASH); panel=global->panel.flash; // set FPGA Flash limits SET_ADDRESS_LIMITS(panel, PAN_FLASH_LOCATION); SET_ADDRESS_LIMITS(panel, PAN_FLASH_RRIF); SET_ADDRESS_LIMITS(panel, PAN_FLASH_FORM); SET_ADDRESS_LIMITS(panel, PAN_FLASH_EFB); SET_ADDRESS_LIMITS(panel, PAN_FLASH_ROUTER); // set MDSP Flash limits SetCtrlVal(panel, PAN_FLASH_DSP_PRG_START_ADDR, MDSP_FLASH_BOTTOM_REL_ADDR); status=SetCtrlAttribute (panel, PAN_FLASH_DSP_PRG_START_ADDR, ATTR_MIN_VALUE, MDSP_FLASH_BOTTOM_REL_ADDR); UIR_STATUS_CHECK(status, SetCtrlAttr()); status = SetCtrlAttribute (panel, PAN_FLASH_DSP_PRG_START_ADDR, ATTR_MAX_VALUE, MDSP_FLASH_BOTTOM_REL_ADDR+FLASH_MEMORY_SIZE); UIR_STATUS_CHECK(status, SetCtrlAttr()); SetCtrlVal(panel, PAN_FLASH_DSP_PRG_END_ADDR, MDSP_FLASH_BOTTOM_REL_ADDR); status=SetCtrlAttribute (panel, PAN_FLASH_DSP_PRG_END_ADDR, ATTR_MIN_VALUE, MDSP_FLASH_BOTTOM_REL_ADDR); UIR_STATUS_CHECK(status, SetCtrlAttr()); status = SetCtrlAttribute (panel, PAN_FLASH_DSP_PRG_END_ADDR, ATTR_MAX_VALUE, MDSP_FLASH_BOTTOM_REL_ADDR+FLASH_MEMORY_SIZE); UIR_STATUS_CHECK(status, SetCtrlAttr()); // set base addr SetCtrlVal(panel, PAN_FLASH_FLASH_0_START_ADDR, FPGA_FLASH_0_BOTTOM_REL_ADDR); SetCtrlVal(panel, PAN_FLASH_FLASH_1_START_ADDR, FPGA_FLASH_1_BOTTOM_REL_ADDR); SetCtrlVal(panel, PAN_FLASH_FLASH_2_START_ADDR, FPGA_FLASH_2_BOTTOM_REL_ADDR); strcpy(string, global->fpgaDataDir); strcat(string, FLASH_CFG_FILE); status = RecallPanelState (panel, string, 0); if(status!=0){ /* do nothing */ } LOAD_PANEL(&global->panel.flashInfo, global->panel.flash, "fpgaUir.uir", FLASH_INFO); /* load prim list editor + primitive panels*/ LOAD_PANEL(&global->panel.primListEdit, 0, "primListEditUir.uir", LIST_EDIT); panel=global->panel.primListEdit; fillPrimParams(panel); LOAD_PANEL(&global->panel.slaveList, panel, "primListEditUir.uir", SLAVE_LST); status=SetPanelPos(global->panel.slaveList, 98, 364); UIR_STATUS_CHECK(status, SetPanelPos()); /* common primitives */ LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(ECHO)], panel, "primParamsUir.uir", PANEL_ECHO); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(SET_ERRMSG_MASK)], panel, "primParamsUir.uir", SET_ERRMSK); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(PAUSE_LIST)], panel, "primParamsUir.uir", PAUSE_L); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(EVENT_TRAP_SETUP)], panel, "primParamsUir.uir", EVENT_TRAP); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(SET_MEMORY)], panel, "primParamsUir.uir", SET_MEMP); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(COPY_MEMORY)], panel, "primParamsUir.uir", CPY_MEMP); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(MEMORY_TEST)], panel, "primParamsUir.uir", MEM_TEST); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(SET_LED)], panel, "primParamsUir.uir", SET_LEDP); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(FLASH_LED)], panel, "primParamsUir.uir", FLASH_LEDP); primArrayId=getPrimArrayId(SEND_DATA); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", SEND_DATAP); fillDataTypeRing(*primPanelPtr, SEND_DATAP_DATA_TYPE); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(MODULE_MASK)], panel, "primParamsUir.uir", MDL_MASKP); primArrayId=getPrimArrayId(SET_TRIGGER); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", SET_TRGP); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD0_0, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD0_1, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD0_2, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD0_3, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD0_4, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD0_5, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD1_0, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD1_1, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD1_2, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD1_3, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD1_4, 0); fillABCDcommandTypeRing(*primPanelPtr, SET_TRGP_CMD1_5, 0); primArrayId=getPrimArrayId(START_TASK); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", START_TSKP); fillTaskRing(*primPanelPtr, START_TSKP_TASK_TYPE); fillTaskLabel(*primPanelPtr, START_TSKP_TASK_UNION, HISTOGRAM_CTRL_TASK); /* fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD0_0, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD0_1, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD0_2, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD0_3, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD0_4, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD0_5, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD1_0, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD1_1, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD1_2, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD1_3, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD1_4, 0); fillABCDcommandTypeRing(*primPanelPtr, START_TSKP_CMD1_5, 0); */ primArrayId=getPrimArrayId(TASK_OPERATION); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", TSK_OPER); fillTaskRing(*primPanelPtr, TSK_OPER_TYPE); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(TEST)], panel, "primParamsUir.uir", TESTP); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(WRITE_BUFFER)], panel, "primParamsUir.uir", WR_BUFFP); /* slave primitives */ LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(START_EVENT_TRAPPING)], panel, "primParamsUir.uir", START_DATA); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(STOP_EVENT_TRAPPING)], panel, "primParamsUir.uir", STOP_DATA); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(HISTOGRAM_SETUP)], panel, "primParamsUir.uir", HIST_SETP); #ifndef COMPACT SetCtrlVal(global->panel.primEdit[getPrimArrayId(HISTOGRAM_SETUP)], HIST_SETP_BASE, HISTOGRAM_DEFAULT_BASE); #endif /* COMPACT */ /* master primitives */ LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(RW_SLAVE_MEMORY)], panel, "primParamsUir.uir", RW_SLAVE); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(TRANS_SERIAL_DATA)], panel, "primParamsUir.uir", X_SER_DATA); primArrayId=getPrimArrayId(START_SLAVE_EXECUTING); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", START_SLV); fillSlaveTypeRing(*primPanelPtr, START_SLV_TYPE); primArrayId=getPrimArrayId(CONFIG_SLAVE); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", CONFIG_SLV); fillSlaveTypeRing(*primPanelPtr, CONFIG_SLV_TYPE); primArrayId=getPrimArrayId(RW_REG_FIELD); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", RW_FIELDP); fillRegisterIdRing(*primPanelPtr, RW_FIELDP_BASE_ID); errorId=loadRodRegFile(*primPanelPtr, RW_FIELDP_REG_BOX, 0); /* init */ ERROR_CHECK(errorId, loadRodRegFile()); primArrayId=getPrimArrayId(POLL_REG_FIELD); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", POLL_FIELD); fillRegisterIdRing(*primPanelPtr, POLL_FIELD_BASE_ID); errorId=loadRodRegFile(*primPanelPtr, POLL_FIELD_REG_BOX, 0); /* init */ ERROR_CHECK(errorId, loadRodRegFile()); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(RW_FIFO)], panel, "primParamsUir.uir", RW_FIFOP); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(SEND_SLAVE_LIST)], panel, "primParamsUir.uir", SEND_SLIST); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(START_SLAVE_LIST)], panel, "primParamsUir.uir", START_SLIS); primArrayId=getPrimArrayId(SLAVE_LIST_OP); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", SLIST_OP); fillSlaveListOptionRing(*primPanelPtr, SLIST_OP_LIST_OP); primArrayId=getPrimArrayId(BUILD_STREAM); primPanelPtr=&global->panel.primEdit[primArrayId]; LOAD_PANEL(primPanelPtr, panel, "primParamsUir.uir", BUILD_STRM); fillABCDcommandTypeRing(*primPanelPtr, BUILD_STRM_CMD0, 1); fillABCDcommandTypeRing(*primPanelPtr, BUILD_STRM_CMD1, 1); fillABCDcommandTypeRing(*primPanelPtr, BUILD_STRM_CMD2, 1); fillABCDcommandTypeRing(*primPanelPtr, BUILD_STRM_CMD3, 1); fillABCDcommandTypeRing(*primPanelPtr, BUILD_STRM_CMD4, 1); fillABCDcommandTypeRing(*primPanelPtr, BUILD_STRM_CMD5, 1); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(SEND_STREAM)], panel, "primParamsUir.uir", SEND_STRM); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(RW_MODULE_DATA)], panel, "primParamsUir.uir", RW_MODULEP); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(SEND_CONFIG)], panel, "primParamsUir.uir", SEND_CFGP); LOAD_PANEL(&global->panel.primEdit[getPrimArrayId(DSP_RESET)], panel, "primParamsUir.uir", DSPRESETP); /* set prim panels position */ for(id=COMMON_PRIMITIVES_BASE; id<(NUM_PRIMITIVES); ++id){ status=SetPanelPos(global->panel.primEdit[id], 98, 10); UIR_STATUS_CHECK(status, SetPanelPos()); } /* load command list editor + command panels */ LOAD_PANEL(&global->panel.commandListEdit, 0, "commandListEditUir.uir", CLIST_EDIT); panel=global->panel.commandListEdit; fillCommandIdRing(panel, CLIST_EDIT_COMMAND_RING); LOAD_PANEL(&global->panel.commandEdit[RW_VME_COMMAND_ID], panel, "commandParamsUir.uir", RW_VMEP); LOAD_PANEL(&global->panel.commandEdit[RW_MASTER_COMMAND_ID], panel, "commandParamsUir.uir", RW_MASTERP); LOAD_PANEL(&global->panel.commandEdit[RW_SLAVE_COMMAND_ID], panel, "commandParamsUir.uir", RW_SLAVEP); LOAD_PANEL(&global->panel.commandEdit[SEND_PRIM_LIST_COMMAND_ID], panel, "commandParamsUir.uir", SEND_PLIST); LOAD_PANEL(&global->panel.commandEdit[COMPARE_FILES_COMMAND_ID], panel, "commandParamsUir.uir", COMP_FILES); LOAD_PANEL(&global->panel.commandEdit[BUS_TEST_ID], panel, "commandParamsUir.uir", BUS_TEST); LOAD_PANEL(&global->panel.commandEdit[RUN_CHILD_COMMAND_LIST_ID], panel, "commandParamsUir.uir", RUN_CLIST); LOAD_PANEL(&global->panel.commandEdit[RW_FPGA_FLASH_ID], panel, "commandParamsUir.uir", RW_FPGAF); // set limits status=SetCtrlAttribute (global->panel.commandEdit[RW_FPGA_FLASH_ID], RW_FPGAF_START_ADDRESS, ATTR_MIN_VALUE, FPGA_FLASH_0_BOTTOM_REL_ADDR); UIR_STATUS_CHECK(status, SetCtrlAttr()); status = SetCtrlAttribute (global->panel.commandEdit[RW_FPGA_FLASH_ID], RW_FPGAF_START_ADDRESS, ATTR_MAX_VALUE, FPGA_FLASH_2_BOTTOM_REL_ADDR+FLASH_MEMORY_SIZE); UIR_STATUS_CHECK(status, SetCtrlAttr()); status=SetCtrlAttribute (global->panel.commandEdit[RW_FPGA_FLASH_ID], RW_FPGAF_SIZE, ATTR_MIN_VALUE, 0); UIR_STATUS_CHECK(status, SetCtrlAttr()); status = SetCtrlAttribute (global->panel.commandEdit[RW_FPGA_FLASH_ID], RW_FPGAF_SIZE, ATTR_MAX_VALUE, 3*FLASH_MEMORY_SIZE); UIR_STATUS_CHECK(status, SetCtrlAttr()); SetCtrlVal(global->panel.commandEdit[RW_FPGA_FLASH_ID], RW_FPGAF_START_ADDRESS, FPGA_FLASH_0_BOTTOM_REL_ADDR); LOAD_PANEL(&global->panel.commandEdit[WRITE_MDSP_FLASH_ID], panel, "commandParamsUir.uir", W_MDSPF); // set limits status=SetCtrlAttribute (global->panel.commandEdit[WRITE_MDSP_FLASH_ID], W_MDSPF_START_ADDRESS, ATTR_MIN_VALUE, MDSP_FLASH_BOTTOM_REL_ADDR); UIR_STATUS_CHECK(status, SetCtrlAttr()); status = SetCtrlAttribute (global->panel.commandEdit[WRITE_MDSP_FLASH_ID], W_MDSPF_START_ADDRESS, ATTR_MAX_VALUE, MDSP_FLASH_BOTTOM_REL_ADDR+FLASH_MEMORY_SIZE); UIR_STATUS_CHECK(status, SetCtrlAttr()); status=SetCtrlAttribute (global->panel.commandEdit[WRITE_MDSP_FLASH_ID], W_MDSPF_SIZE, ATTR_MIN_VALUE, 0); UIR_STATUS_CHECK(status, SetCtrlAttr()); status = SetCtrlAttribute (global->panel.commandEdit[WRITE_MDSP_FLASH_ID], W_MDSPF_SIZE, ATTR_MAX_VALUE, FLASH_MEMORY_SIZE); UIR_STATUS_CHECK(status, SetCtrlAttr()); SetCtrlVal(global->panel.commandEdit[WRITE_MDSP_FLASH_ID], W_MDSPF_START_ADDRESS, MDSP_FLASH_BOTTOM_REL_ADDR); LOAD_PANEL(&global->panel.commandEdit[BOC_SETUP_ID], panel, "commandParamsUir.uir", BOC_SETUP); LOAD_PANEL(&global->panel.commandEdit[RUN_EXTERNAL_PROGRAM_ID], panel, "commandParamsUir.uir", RUN_EXTPRG); LOAD_PANEL(&global->panel.commandEdit[DELAY_COMMAND_ID], panel, "commandParamsUir.uir", DELAY_CMDP); for(id=0; id<=LAST_COMMAND_ID; ++id){ status=SetPanelPos(global->panel.commandEdit[id], 85, 10); UIR_STATUS_CHECK(status, SetPanelPos()); } /* init timeouts */ GetCtrlVal(global->panel.main, MAIN_ROD_INIT_TIMEOUT, &global->rodInitTimeout); GetCtrlVal(global->panel.main, MAIN_DSP_ACK_CLEAR_TIMEOUT, &global->dspAckClearTimeout); GetCtrlVal(global->panel.main, MAIN_DSP_SET_TIMEOUT, &global->option.dspAckSetTimeoutOn); GetCtrlVal(global->panel.main, MAIN_DSP_ACK_SET_TIMEOUT, &global->dspAckSetTimeout); GetCtrlVal(global->panel.main, MAIN_TEXTBUFF_TIMEOUT, &global->textBuffTimeout); errorId=setPriorityClass(NORMAL_PRIORITY_CLASS); ERROR_CHECK(errorId, setPriorityClass()); global->mainThread.handle=GetCurrentThread(); errorId=setThreadPriority(global->mainThread.handle, THREAD_PRIORITY_ABOVE_NORMAL); ERROR_CHECK(errorId, setThreadPriority()); global->option.stopCommLoop=TRUE; /* don't run commThread */ errorId=createThread(&global->communLoopThread, (LPTHREAD_START_ROUTINE) communicationLoop_thread, global, THREAD_PRIORITY_BELOW_NORMAL); ERROR_CHECK(errorId, createThread(commonCommunicationLoop_thread)); if(errorId!=SUCCESS) return(errorId); /* set prim. function pointers */ primFunctionInit(global->primFunction); /* set command function pointers */ commandFunctionInit(global->commandFunction); /* display panels */ status=DisplayPanel(global->panel.main); UIR_STATUS_CHECK(status, DisplayPanel()); status=DisplayPanel(global->panel.primEdit[global->editPrimitiveId=ECHO]); UIR_STATUS_CHECK(status, DisplayPanel()); SetCtrlVal(global->panel.commandListEdit, CLIST_EDIT_COMMAND_RING, global->editCommandId=SEND_PRIM_LIST_COMMAND_ID); status=DisplayPanel(global->panel.commandEdit[global->editCommandId]); UIR_STATUS_CHECK(status, DisplayPanel()); return(errorId); } /*============================================================================= * loadNewHost() *============================================================================= * * Loads new host[n] into memory and initialize host[n] struct. * */ ERROR_ID loadNewHost(struct GLOBAL_VARIABLES *global, unsigned char slotNumber){ UINT32 baseAddress; char errorMessage[200]; char string[100]; struct HOST *host; int status,i=0; ERROR_ID errorId=SUCCESS; int panelHandle; UINT8 hostIndex=HOST_INDEX(slotNumber); if(global->hostCounthostCount)>=(MAXRODS-1)){ status=SetInputMode(GetPanelMenuBar(global->panel.main), MAIN_MENU_LOAD_ROD, 0); UIR_STATUS_CHECK(status, SetInputMode()); } host=calloc(1, sizeof(struct HOST)); /* allocate and clear memory for new Host struct */ if(host==NULL){ errorId=FATAL_ERROR; programError(__FILE__,__LINE__, errorId, "calloc(host)", errorId, ""); return(errorId); } /* * host variables intitialization */ host->slotNumber=slotNumber; host->dataDir=global->rodDataDir[HOST_INDEX(slotNumber)]; host->option.repeatExecNotBuild=1; /* the others are 0 or FALSE */ errorId=startHost(host); /* load newHost UIR and start its threads */ ERROR_CHECK(errorId, startHost(host)); if(errorId!=SUCCESS){ free(host); /* FREE MEMORY !!!!!*/ host=NULL; return(errorId); } ++global->hostCount; /* increment hostCount */ /* update display */ SetCtrlVal(global->panel.main, MAIN_ROD_COUNTER, global->hostCount); if(global->hostCount>=1){ /* resume communLoop thread */ global->option.stopCommLoop=FALSE; errorId=resumeThread(global->communLoopThread.handle); ERROR_CHECK(errorId,resumeThread(communLoopThread)); } } else { errorId=PROGRAM_WARNING; programError(__FILE__, __LINE__, errorId,"",errorId, "ROD count limit reached!"); } /* load global pointer */ global->host[hostIndex]=host; return (errorId); } /*============================================================================= * exitHost() *============================================================================= * * Exit host - returns from host threads and releases memory. * */ ERROR_ID exitHost(struct HOST **host, struct GLOBAL_VARIABLES *global){ int status; char errorMessage[200]; ERROR_ID errorId=SUCCESS; int i; (**host).option.hostExit=TRUE; (**host).option.rodEnabled=FALSE; Sleep(100); status=HidePanel((**host).panel.parent); UIR_STATUS_CHECK(status, HidePanel()); /* resume Control thread */ (**host).cmdListExecState=CMDLISTEXEC_IDLE; errorId=setEvent((**host).commandDone_event); ERROR_CHECK(errorId, setEvent(primListDone_event)); errorId=resumeThread((**host).cmdListExecThread.handle); ERROR_CHECK(errorId, resumeThread(hostControlThread)); /* close threads */ errorId=closeThread((**host).cmdListExecThread.handle); ERROR_CHECK(errorId, closeThread(host->hostControlThread.handle)); /* close handles */ errorId=closeHandle((**host).commandDone_event); ERROR_CHECK(errorId, closeHandle(resumeControlThread_event)); status=DiscardPanel((**host).panel.parent); UIR_STATUS_CHECK(status, DiscardPanel()); free(*host); /* FREE MEMORY !!!!! */ *host=(struct HOST *) NULL; --global->hostCount; SetCtrlVal(global->panel.main, MAIN_ROD_COUNTER, global->hostCount); return(errorId); } /*============================================================================= * shutdownApplication() *============================================================================= * * Shutdowns Rcc process. * */ ERROR_ID shutdownApplication(struct GLOBAL_VARIABLES *global){ int hostIndex; struct HOST *host; int status; char errorMessage[200]; ERROR_ID errorId=SUCCESS; global->option.programExit=TRUE; status=HidePanel(global->panel.main); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.fpga); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.flash); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.masterDspMemory); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.slaveDspMemory); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.vmeMemory); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.primListEdit); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.commandListEdit); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.tim); UIR_STATUS_CHECK(status, HidePanel()); status=HidePanel(global->panel.distributionPlot); UIR_STATUS_CHECK(status, HidePanel()); errorId=setThreadPriority(GetCurrentThread(),THREAD_PRIORITY_NORMAL); ERROR_CHECK(errorId,setThreadPriority()); errorId=closeThread(global->communLoopThread.handle); ERROR_CHECK(errorId,closeThread(global->communLoopThread.handle)); /* exit loaded hosts */ for (hostIndex=0; hostIndexhost[hostIndex]; if(host!=NULL){ errorId=exitHost(&host, global); ERROR_CHECK(errorId, exitHost()); } } status=DiscardPanel(global->panel.tim); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.main); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.fpga); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.flash); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.masterDspMemory); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.slaveDspMemory); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.vmeMemory); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.primListEdit); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.commandListEdit); UIR_STATUS_CHECK(status, DiscardPanel()); status=DiscardPanel(global->panel.error); UIR_STATUS_CHECK(status, DiscardPanel()) status=DiscardPanel(global->panel.distributionPlot); UIR_STATUS_CHECK(status, DiscardPanel()); return(SUCCESS); } /****************************************************************************** * Static Functions * ******************************************************************************/ /*============================================================================= * startHost() *============================================================================= * * Load newHost UIR and starts its own threads. * */ static ERROR_ID startHost(struct HOST *host){ ERROR_ID result; char string[100]; int status; char errorMessage[200]; ERROR_ID errorId=SUCCESS; int primId; UINT8 hostIndex=HOST_INDEX(host->slotNumber); strcpy(host->txtBuffFileName[ERR_BUFF], host->dataDir); strcpy(host->txtBuffFileName[INFO_BUFF], host->dataDir); strcpy(host->txtBuffFileName[DIAG_BUFF], host->dataDir); strcpy(host->txtBuffFileName[XFER_BUFF], host->dataDir); strcat(host->txtBuffFileName[ERR_BUFF], ERROR_BUFFER_FILE_NAME); strcat(host->txtBuffFileName[INFO_BUFF], INFO_BUFFER_FILE_NAME); strcat(host->txtBuffFileName[DIAG_BUFF], DIAG_BUFFER_FILE_NAME); strcat(host->txtBuffFileName[XFER_BUFF], XFER_BUFFER_FILE_NAME); sprintf(string,"%d.TXT", host->slotNumber); strcat(host->txtBuffFileName[ERR_BUFF], string); strcat(host->txtBuffFileName[INFO_BUFF], string); strcat(host->txtBuffFileName[DIAG_BUFF], string); strcat(host->txtBuffFileName[XFER_BUFF], string); strcpy(host->primListFile, host->dataDir); sprintf(&host->primListFile[strlen(host->dataDir)], PRIMITIVE_BUFFER_FILE_NAME"%d.bin", host->slotNumber); strcpy(host->primTableFile, host->dataDir); sprintf(&host->primTableFile[strlen(host->dataDir)], PRIMLIST_TABLE_FILE_NAME"%d.mlist", host->slotNumber); /* * Load UIR panels */ LOAD_PANEL(&host->panel.parent, 0, "mainUir.uir", ROD); /* duplicate prim list ring from Main panel */ host->controlId.primRing = DuplicateCtrl (global.panel.main, MAIN_PLIST_RING, host->panel.parent, "", 462, 6); LOAD_PANEL(&host->panel.commandListStatus, host->panel.parent, "mainUir.uir", CLISTP); fillCommandIdRing(host->panel.commandListStatus, CLISTP_COMMAND_RING); status=SetPanelPos(host->panel.commandListStatus, 50, 400); UIR_STATUS_CHECK(status, SetPanelPos()); /* duplicate command list ring from Main panel */ host->controlId.commandRing = DuplicateCtrl (global.panel.main, MAIN_CLIST_RING, host->panel.commandListStatus, "", 162, 7); LOAD_PANEL(&host->panel.txtBuff[ERR_BUFF], host->panel.parent, "mainUir.uir", TEXT_PANEL); LOAD_PANEL(&host->panel.txtBuff[INFO_BUFF], host->panel.parent, "mainUir.uir", TEXT_PANEL); LOAD_PANEL(&host->panel.txtBuff[DIAG_BUFF], host->panel.parent, "mainUir.uir", TEXT_PANEL); LOAD_PANEL(&host->panel.txtBuff[XFER_BUFF], host->panel.parent, "mainUir.uir", TEXT_PANEL); status=SetPanelPos(host->panel.txtBuff[ERR_BUFF], 47, 400); UIR_STATUS_CHECK(status, SetPanelPos()); status=SetPanelPos(host->panel.txtBuff[INFO_BUFF], 47, 400); UIR_STATUS_CHECK(status, SetPanelPos()); status=SetPanelPos(host->panel.txtBuff[DIAG_BUFF], 47, 400); UIR_STATUS_CHECK(status, SetPanelPos()); status=SetPanelPos(host->panel.txtBuff[XFER_BUFF], 47, 400); UIR_STATUS_CHECK(status, SetPanelPos()); sprintf(string, "ROD slot#%d", host->slotNumber); status = SetPanelAttribute(host->panel.parent, ATTR_TITLE, string); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute(host->panel.txtBuff[ERR_BUFF], ATTR_TITLE, "ERROR BUFFER"); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute(host->panel.txtBuff[INFO_BUFF], ATTR_TITLE,"INFO BUFFER"); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute(host->panel.txtBuff[DIAG_BUFF], ATTR_TITLE, "DIAG BUFFER"); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute(host->panel.txtBuff[XFER_BUFF], ATTR_TITLE,"XFER BUFFER"); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute (host->panel.txtBuff[ERR_BUFF], ATTR_FRAME_COLOR, VAL_DK_RED); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute (host->panel.txtBuff[ERR_BUFF], ATTR_TITLE_BACKCOLOR,VAL_DK_RED); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute (host->panel.txtBuff[INFO_BUFF], ATTR_FRAME_COLOR, 0x00B89A21); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute (host->panel.txtBuff[INFO_BUFF], ATTR_TITLE_BACKCOLOR, 0x00B89A21); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute (host->panel.txtBuff[XFER_BUFF], ATTR_FRAME_COLOR,VAL_DK_CYAN); UIR_STATUS_CHECK(status, SetPanelAttribute()); status = SetPanelAttribute (host->panel.txtBuff[XFER_BUFF], ATTR_TITLE_BACKCOLOR, VAL_DK_CYAN); UIR_STATUS_CHECK(status, SetPanelAttribute()); SetCtrlVal(host->panel.parent, ROD_HOST_INDEX, hostIndex); SetCtrlVal(host->panel.parent, ROD_SLOT_NUMBER, host->slotNumber); SetCtrlVal(host->panel.commandListStatus, CLISTP_HOST_INDEX, hostIndex); SetCtrlVal(host->panel.txtBuff[ERR_BUFF], TEXT_PANEL_HOST_INDEX, hostIndex); SetCtrlVal(host->panel.txtBuff[INFO_BUFF], TEXT_PANEL_HOST_INDEX, hostIndex); SetCtrlVal(host->panel.txtBuff[DIAG_BUFF], TEXT_PANEL_HOST_INDEX, hostIndex); SetCtrlVal(host->panel.txtBuff[XFER_BUFF], TEXT_PANEL_HOST_INDEX, hostIndex); LOAD_PANEL(&host->panel.dspMonitor, host->panel.parent, "mainUir.uir", DSPMONP); SetCtrlVal(host->panel.dspMonitor, DSPMONP_HOST_INDEX, hostIndex); /* * create interthread synchronization events */ errorId=createEvent(&host->commandDone_event, FALSE); ERROR_CHECK(errorId,createEvent(primListDone_event)); if(errorId!=SUCCESS) return(errorId); /* * Create and start the threads specific for this host */ /* hostControlThread */ errorId=createThread(&host->cmdListExecThread, (LPTHREAD_START_ROUTINE) cmdListExec_thread, host, global.cmdListExecThreadPriority); ERROR_CHECK(errorId,createThread(hostControl_thread)); if(errorId!=SUCCESS) return(errorId); status=DisplayPanel(host->panel.parent); UIR_STATUS_CHECK(status, DisplayPanel()); status=DisplayPanel(host->panel.commandListStatus); UIR_STATUS_CHECK(status, DisplayPanel()); return (SUCCESS); } /******************************************************************************/