/* compare the supplied system to the given point * this is used to identify focus for reports * if !PointValid will report TRUE for all systems */ boolean CompareSystemPoint(SystemData *systemp, Point *point) { if (!PointValid(point)) return TRUE; switch (point->Type) { case POINT_TYPE_NONE: return FALSE; case POINT_TYPE_PORT: return (systemp == point->u.portp->nodep->systemp); case POINT_TYPE_PORT_LIST: { LIST_ITERATOR i; DLIST *pList = &point->u.portList; for (i=ListHead(pList); i != NULL; i = ListNext(pList, i)) { PortData *portp = (PortData*)ListObj(i); if (systemp == portp->nodep->systemp) return TRUE; } } return FALSE; case POINT_TYPE_NODE: return (systemp == point->u.nodep->systemp); case POINT_TYPE_NODE_LIST: { LIST_ITERATOR i; DLIST *pList = &point->u.nodeList; for (i=ListHead(pList); i != NULL; i = ListNext(pList, i)) { NodeData *nodep = (NodeData*)ListObj(i); if (systemp == nodep->systemp) return TRUE; } } return FALSE; #if !defined(VXWORKS) || defined(BUILD_DMC) case POINT_TYPE_IOC: return (systemp == point->u.iocp->ioup->nodep->systemp); case POINT_TYPE_IOC_LIST: { LIST_ITERATOR i; DLIST *pList = &point->u.nodeList; for (i=ListHead(pList); i != NULL; i = ListNext(pList, i)) { IocData *iocp = (IocData*)ListObj(i); if (systemp == iocp->ioup->nodep->systemp) return TRUE; } } return FALSE; #endif case POINT_TYPE_SYSTEM: return (systemp == point->u.systemp); } return TRUE; // should not get here }
void MainFrame::mouseMoveEvent(QMouseEvent *event) { if(!m_bLeftBtnPress) { m_eDirection = PointValid(event->x(),event->y()); SetCursorStyle(m_eDirection); } else { int nXGlobal = event->globalX(); int nYGlobal = event->globalY(); SetDrayMove(nXGlobal,nYGlobal,m_eDirection); m_ptPressGlobal =QPoint(nXGlobal,nYGlobal); } }
/* compare the supplied ioc to the given point * this is used to identify focus for reports * if !PointValid will report TRUE for all iocs */ boolean CompareIocPoint(IocData *iocp, Point *point) { if (!PointValid(point)) return TRUE; switch (point->Type) { case POINT_TYPE_IOC: return (iocp == point->u.iocp); case POINT_TYPE_IOC_LIST: { LIST_ITERATOR i; DLIST *pList = &point->u.nodeList; for (i=ListHead(pList); i != NULL; i = ListNext(pList, i)) { IocData *iocp2 = (IocData*)ListObj(i); if (iocp == iocp2) return TRUE; } } return FALSE; default: return CompareNodePoint(iocp->ioup->nodep, point); } }
/* compare the supplied ExpectedLink to the given point * this is used to identify focus for reports * if !PointValid will report TRUE for all ExpectedLink */ boolean CompareExpectedLinkPoint(ExpectedLink *elinkp, Point *point) { if (!PointValid(point)) return TRUE; switch (point->ElinkType) { case POINT_ELINK_TYPE_NONE: return FALSE; case POINT_ELINK_TYPE_LINK: return (elinkp == point->u4.elinkp); case POINT_ELINK_TYPE_LINK_LIST: { LIST_ITERATOR i; DLIST *pList = &point->u4.elinkList; for (i=ListHead(pList); i != NULL; i = ListNext(pList, i)) { ExpectedLink *elinkp2 = (ExpectedLink*)ListObj(i); if (elinkp == elinkp2) return TRUE; } } return FALSE; } return TRUE; // should not get here }
/* compare the supplied ExpectedSM to the given point * this is used to identify focus for reports * if !PointValid will report TRUE for all ExpectedSM */ boolean CompareExpectedSMPoint(ExpectedSM *esmp, Point *point) { if (!PointValid(point)) return TRUE; switch (point->EsmType) { case POINT_ESM_TYPE_NONE: return FALSE; case POINT_ESM_TYPE_SM: return (esmp == point->u3.esmp); case POINT_ESM_TYPE_SM_LIST: { LIST_ITERATOR i; DLIST *pList = &point->u3.esmList; for (i=ListHead(pList); i != NULL; i = ListNext(pList, i)) { ExpectedSM *esmp2 = (ExpectedSM*)ListObj(i); if (esmp == esmp2) return TRUE; } } return FALSE; } return TRUE; // should not get here }
/* compare the supplied ExpectedNode to the given point * this is used to identify focus for reports * if !PointValid will report TRUE for all ExpectedNodes */ boolean CompareExpectedNodePoint(ExpectedNode *enodep, Point *point) { if (!PointValid(point)) return TRUE; switch (point->EnodeType) { case POINT_ENODE_TYPE_NONE: return FALSE; case POINT_ENODE_TYPE_NODE: return (enodep == point->u2.enodep); case POINT_ENODE_TYPE_NODE_LIST: { LIST_ITERATOR i; DLIST *pList = &point->u2.enodeList; for (i=ListHead(pList); i != NULL; i = ListNext(pList, i)) { ExpectedNode *enodep2 = (ExpectedNode*)ListObj(i); if (enodep == enodep2) return TRUE; } } return FALSE; } return TRUE; // should not get here }