void ArxDbgUiTdcOptions::OnMainDialogOK() { CAcUiTabChildDialog::OnMainDialogOK(); // set the final values on our global object. NOTE: can't just // put these directly in the DDX map since MFC doesn't map anything // to type "bool", only to type "BOOL" ArxDbgOptions::m_instance.m_showDwgFilerMessages = intToBool(m_showDwgFilerMsgs); ArxDbgOptions::m_instance.m_showWblockCloneDetails = intToBool(m_showWblockCloneDetails); ArxDbgOptions::m_instance.m_showDeepCloneDetails = intToBool(m_showDeepCloneDetails); ArxDbgOptions::m_instance.m_doDictRecordInsertByHand = intToBool(m_doDictInsertByHand); }
void ArxDbgUiTdcSysReactors::doInputReactor() { if (m_doInput) { if (m_inputReactor == NULL) { m_inputReactor = new ArxDbgEdInputContextReactor; acutPrintf(_T("\nEditor Input Reactor Spy Turned On ...")); ArxDbgUiTdcSysReactors::attachInputReactorToAll(); } m_inputReactor->setShowDetails(intToBool(m_showInputDetails)); m_inputReactor->setSuppressDetailsDuringDrag(intToBool(m_suppressInputDetailsDuringDrag)); } else { if (m_inputReactor != NULL) { ArxDbgUiTdcSysReactors::removeInputReactorFromAll(); delete m_inputReactor; m_inputReactor = NULL; acutPrintf(_T("\nEditor Input Reactor Spy Turned Off ...")); } } }
void ArxDbgUiTdcInsert::OnInsertBlkDef() { CString blkName; m_ebDestName1.GetWindowText(blkName); if (!acdbSNValid(blkName, false)) { CString str; str.Format(_T("%s is not a valid block name."), blkName); ArxDbgUtils::alertBox(str); return; } UpdateData(TRUE); bool isExternal; AcDbDatabase* sourceDb = getSourceDb(isExternal); AcDbDatabase* destDb = getDestDb(); ASSERT(sourceDb != destDb); Acad::ErrorStatus es; // lock the document we are inserting into ArxDbgDocLockWrite docLock(destDb); if (docLock.lockAndSetCurrent() != Acad::eOk) return; bool preserveSrcDb = intToBool(m_preserveOriginalDb); if (!preserveSrcDb && !isExternal) { ArxDbgUtils::alertBox(_T("Ignoring setting of \"Preserve source database\" since destroying\na database associated with a Document would be harsh.")); preserveSrcDb = true; } AcDbObjectId blkId; es = destDb->insert(blkId, blkName, sourceDb, preserveSrcDb); if (es == Acad::eOk) { ArxDbgUiTdmDatabase dbox(destDb, this, _T("Inserted Database")); dbox.DoModal(); doSaveOption(destDb); if (isExternal && !preserveSrcDb) reloadRaidedExternalDwg(sourceDb); } else { CString str; str.Format(_T("Insert failed: %s"), ArxDbgUtils::rxErrorStr(es)); ArxDbgUtils::stopAlertBox(str); } }
void ArxDbgUiTdcSysReactors::doLongTransReactor() { if (m_doLongTrans) { if (m_longTransReactor == NULL) { m_longTransReactor = new ArxDbgLongTransactionReactor; acutPrintf(_T("\nLong Transaction Reactor Spy Turned On ...")); } m_longTransReactor->setShowDetails(intToBool(m_showLongTransDetails)); } else { if (m_longTransReactor != NULL) { delete m_longTransReactor; m_longTransReactor = NULL; acutPrintf(_T("\nLong Transaction Reactor Spy Turned Off ...")); } } }
void ArxDbgUiTdcSysReactors::doEventReactor() { if (m_doEvent) { if (m_eventReactor == NULL) { m_eventReactor = new ArxDbgEventReactor; acutPrintf(_T("\nEvent Reactor Spy Turned On ...")); } m_eventReactor->setShowDetails(intToBool(m_showEventDetails)); } else { if (m_eventReactor != NULL) { delete m_eventReactor; m_eventReactor = NULL; acutPrintf(_T("\nEvent Reactor Spy Turned Off ...")); } } }
void ArxDbgUiTdcSysReactors::doDbReactor() { if (m_doDatabase) { if (m_dbReactor == NULL) { m_dbReactor = new ArxDbgDatabaseReactor; acutPrintf(_T("\nDatabase Reactor Spy Turned On ...")); ArxDbgUiTdcSysReactors::attachDbReactorToAll(); } m_dbReactor->setShowDetails(intToBool(m_showDbDetails)); } else { if (m_dbReactor != NULL) { ArxDbgUiTdcSysReactors::removeDbReactorFromAll(); delete m_dbReactor; m_dbReactor = NULL; acutPrintf(_T("\nDatabase Reactor Spy Turned Off ...")); } } }
void ArxDbgUiTdcInsert::OnInsertDb() { UpdateData(TRUE); bool isExternal; AcDbDatabase* sourceDb = getSourceDb(isExternal); AcDbDatabase* destDb = getDestDb(); ASSERT(sourceDb != destDb); Acad::ErrorStatus es; // lock the document we are inserting into ArxDbgDocLockWrite docLock(destDb); if (docLock.lockAndSetCurrent() != Acad::eOk) return; bool preserveSrcDb = intToBool(m_preserveOriginalDb); if (!preserveSrcDb && !isExternal) { ArxDbgUtils::alertBox(_T("Ignoring setting of \"Preserve source database\" since destroying\na database associated with a Document would be harsh.")); preserveSrcDb = true; } es = destDb->insert(AcGeMatrix3d::kIdentity, sourceDb, preserveSrcDb); if (es == Acad::eOk) { ArxDbgUiTdmDatabase dbox(destDb, this, _T("Inserted Database")); dbox.DoModal(); doSaveOption(destDb); if (isExternal && !preserveSrcDb) reloadRaidedExternalDwg(sourceDb); } else { CString str; str.Format(_T("Insert failed: %s"), ArxDbgUtils::rxErrorStr(es)); ArxDbgUtils::stopAlertBox(str); } }
void StepperControl::loadMotorSettings() { // Load settings homeIsUp[0] = ParameterList::getInstance()->getValue(MOVEMENT_HOME_UP_X); homeIsUp[1] = ParameterList::getInstance()->getValue(MOVEMENT_HOME_UP_Y); homeIsUp[2] = ParameterList::getInstance()->getValue(MOVEMENT_HOME_UP_Z); speedMax[0] = ParameterList::getInstance()->getValue(MOVEMENT_MAX_SPD_X); speedMax[1] = ParameterList::getInstance()->getValue(MOVEMENT_MAX_SPD_Y); speedMax[2] = ParameterList::getInstance()->getValue(MOVEMENT_MAX_SPD_Z); speedMin[0] = ParameterList::getInstance()->getValue(MOVEMENT_MIN_SPD_X); speedMin[1] = ParameterList::getInstance()->getValue(MOVEMENT_MIN_SPD_Y); speedMin[2] = ParameterList::getInstance()->getValue(MOVEMENT_MIN_SPD_Z); speedHome[0] = ParameterList::getInstance()->getValue(MOVEMENT_HOME_SPEED_X); speedHome[1] = ParameterList::getInstance()->getValue(MOVEMENT_HOME_SPEED_Y); speedHome[2] = ParameterList::getInstance()->getValue(MOVEMENT_HOME_SPEED_Z); stepsAcc[0] = ParameterList::getInstance()->getValue(MOVEMENT_STEPS_ACC_DEC_X); stepsAcc[1] = ParameterList::getInstance()->getValue(MOVEMENT_STEPS_ACC_DEC_Y); stepsAcc[2] = ParameterList::getInstance()->getValue(MOVEMENT_STEPS_ACC_DEC_Z); motorInv[0] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_X)); motorInv[1] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_Y)); motorInv[2] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_Z)); endStInv[0] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_ENDPOINTS_X); endStInv[1] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_ENDPOINTS_Y); endStInv[2] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_ENDPOINTS_Z); endStInv2[0] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_2_ENDPOINTS_X); endStInv2[1] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_2_ENDPOINTS_Y); endStInv2[2] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_2_ENDPOINTS_Z); endStEnbl[0] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_ENABLE_ENDPOINTS_X)); endStEnbl[1] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_ENABLE_ENDPOINTS_Y)); endStEnbl[2] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_ENABLE_ENDPOINTS_Z)); timeOut[0] = ParameterList::getInstance()->getValue(MOVEMENT_TIMEOUT_X); timeOut[1] = ParameterList::getInstance()->getValue(MOVEMENT_TIMEOUT_Y); timeOut[2] = ParameterList::getInstance()->getValue(MOVEMENT_TIMEOUT_Z); motorKeepActive[0] = ParameterList::getInstance()->getValue(MOVEMENT_KEEP_ACTIVE_X); motorKeepActive[1] = ParameterList::getInstance()->getValue(MOVEMENT_KEEP_ACTIVE_Y); motorKeepActive[2] = ParameterList::getInstance()->getValue(MOVEMENT_KEEP_ACTIVE_Z); motorMaxSize[0] = ParameterList::getInstance()->getValue(MOVEMENT_AXIS_NR_STEPS_X); motorMaxSize[1] = ParameterList::getInstance()->getValue(MOVEMENT_AXIS_NR_STEPS_Y); motorMaxSize[2] = ParameterList::getInstance()->getValue(MOVEMENT_AXIS_NR_STEPS_Z); motor2Inv[0] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_SECONDARY_MOTOR_INVERT_X)); motor2Inv[1] = false; motor2Inv[2] = false; motor2Enbl[0] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_SECONDARY_MOTOR_X)); motor2Enbl[1] = false; motor2Enbl[2] = false; motorStopAtHome[0] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_STOP_AT_HOME_X)); motorStopAtHome[1] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_STOP_AT_HOME_Y)); motorStopAtHome[2] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_STOP_AT_HOME_Z)); motorStopAtMax[0] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_STOP_AT_MAX_X)); motorStopAtMax[1] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_STOP_AT_MAX_Y)); motorStopAtMax[2] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_STOP_AT_MAX_Z)); stepsPerMm[0] = ParameterList::getInstance()->getValue(MOVEMENT_STEP_PER_MM_X); stepsPerMm[1] = ParameterList::getInstance()->getValue(MOVEMENT_STEP_PER_MM_Y); stepsPerMm[2] = ParameterList::getInstance()->getValue(MOVEMENT_STEP_PER_MM_Z); if (stepsPerMm[0] < 1) { stepsPerMm[0] = 1; } if (stepsPerMm[1] < 1) { stepsPerMm[1] = 1; } if (stepsPerMm[2] < 1) { stepsPerMm[2] = 1; } CurrentState::getInstance()->setStepsPerMm(stepsPerMm[0], stepsPerMm[1], stepsPerMm[2]); axisX.loadMotorSettings(speedMax[0], speedMin[0], speedHome[0], stepsAcc[0], timeOut[0], homeIsUp[0], motorInv[0], endStInv[0], endStInv2[0], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[0], motor2Inv[0], endStEnbl[0], motorStopAtHome[0], motorMaxSize[0] *= stepsPerMm[0], motorStopAtMax[0]); axisY.loadMotorSettings(speedMax[1], speedMin[1], speedHome[1], stepsAcc[1], timeOut[1], homeIsUp[1], motorInv[1], endStInv[1], endStInv2[1], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[1], motor2Inv[1], endStEnbl[1], motorStopAtHome[1], motorMaxSize[1] *= stepsPerMm[1], motorStopAtMax[1]); axisZ.loadMotorSettings(speedMax[2], speedMin[2], speedHome[2], stepsAcc[2], timeOut[2], homeIsUp[2], motorInv[2], endStInv[2], endStInv2[2], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[2], motor2Inv[2], endStEnbl[2], motorStopAtHome[2], motorMaxSize[2] *= stepsPerMm[2], motorStopAtMax[2]); #if defined(FARMDUINO_EXP_V20) loadSettingsTMC2130(); #endif primeMotors(); }
void ArxDbgUiTdcInsert::OnTransferBlkDef() { // get the block we're suppose to be wblocking int index = m_puBlockDef.GetCurSel(); ASSERT(index != CB_ERR); CString srcBlkName; AcDbObjectId blkDefId; if (!m_blockList.GetAtIndex(index, srcBlkName, blkDefId)) { ASSERT(0); return; } // get name of destination block name CString destBlkName; m_ebDestName2.GetWindowText(destBlkName); if (!acdbSNValid(destBlkName, false)) { CString str; str.Format(_T("%s is not a valid block name."), destBlkName); ArxDbgUtils::alertBox(str); return; } UpdateData(TRUE); bool isExternal; AcDbDatabase* sourceDb = getSourceDb(isExternal); AcDbDatabase* destDb = getDestDb(); ASSERT(sourceDb != destDb); // lock the document we are inserting into ArxDbgDocLockWrite docLock(destDb); if (docLock.lockAndSetCurrent() != Acad::eOk) return; // lock the document we are inserting from ArxDbgDocLockWrite docLock2(sourceDb); if (docLock2.lock() != Acad::eOk) return; bool preserveSrcDb = intToBool(m_preserveOriginalDb); if (!preserveSrcDb && !isExternal) { ArxDbgUtils::alertBox(_T("Ignoring setting of \"Preserve source database\" since destroying\na database associated with a Document would be harsh.")); preserveSrcDb = true; } AcDbObjectId blkId; Acad::ErrorStatus es; es = destDb->insert(blkId, srcBlkName, destBlkName, sourceDb, preserveSrcDb); if (es == Acad::eOk) { ArxDbgUiTdmDatabase dbox(destDb, this, _T("Inserted Database")); dbox.DoModal(); doSaveOption(destDb); if (isExternal && !preserveSrcDb) reloadRaidedExternalDwg(sourceDb); } else { CString str; str.Format(_T("Insert failed: %s"), ArxDbgUtils::rxErrorStr(es)); ArxDbgUtils::stopAlertBox(str); } }