• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ProcessEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中tuwien.auto.calimero.process.ProcessEvent的典型用法代码示例。如果您正苦于以下问题:Java ProcessEvent类的具体用法?Java ProcessEvent怎么用?Java ProcessEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProcessEvent类属于tuwien.auto.calimero.process包,在下文中一共展示了ProcessEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fireGroupReadWrite

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
private void fireGroupReadWrite(final CEMILData f, final byte[] asdu, final int svc,
        final boolean optimized) {
    final ProcessEvent e = new ProcessEvent(SlicKnxProcessCommunicatorImpl.this, f.getSource(),
            (GroupAddress) f.getDestination(), svc, asdu, optimized);
    final EventListener[] el = listeners.listeners();
    for (EventListener l : el) {
        try {
            if (svc == GROUP_READ && l instanceof ProcessListenerEx) {
                ((ProcessListenerEx) l).groupReadRequest(e);
            } else if (svc == GROUP_RESPONSE && l instanceof ProcessListenerEx) {
                ((ProcessListenerEx) l).groupReadResponse(e);
            } else {
                ((ProcessListener) l).groupWrite(e);
            }
        } catch (final RuntimeException rte) {
            removeProcessListener((ProcessListener) l);
            logger.error("removed event listener", rte);
        }
    }
}
 
开发者ID:tuxedo0801,项目名称:slicKnx,代码行数:21,代码来源:SlicKnxProcessCommunicatorImpl.java


示例2: notifyListeners

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
public void notifyListeners(ProcessEvent p_evt) {
	Iterator<Entry<String, Datapoint>> l_it = m_Listening.entrySet()
			.iterator();
	while (l_it.hasNext()) {
		Map.Entry<String, Datapoint> l_entry = l_it.next();
		if (l_entry.getValue().getMainAddress().getRawAddress() == p_evt
				.getDestination().getRawAddress()) {
			DPTXlator l_translator;
			try {
				l_translator = TranslatorTypes.createTranslator(l_entry
						.getValue().getMainNumber(), l_entry.getValue()
						.getDPT());
				l_translator.setData(p_evt.getASDU());

				setChanged();
				notifyObservers(new DatapointEvent(l_entry.getValue(),
						l_translator.getValue(), l_entry.getKey()));
				break;
			} catch (KNXException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
 
开发者ID:heia-fr,项目名称:wot_gateways,代码行数:26,代码来源:KNXManagement.java


示例3: groupWrite

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
public final void groupWrite(ProcessEvent e) {
    try {

        GroupAddress source=new GroupAddress(e.getSourceAddr().toString());
        GroupAddress destination=e.getDestination();
        GroupAddress currentDevice=new GroupAddress(getGroupaddr());

        if(destination.equals(currentDevice)){
            messageReceived(e);
        }else if(source.equals(currentDevice)){
            messageSent(e);
        }

    } catch (KNXFormatException e1) {
        LOG.warn("Invalid group address {}",getGroupaddr(),e1);
    }
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:18,代码来源:KNXDeviceAbstract.java


示例4: groupWrite

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
/**
 * If <code>knx:ignorelocalevents=true</code> is set in configuration, it prevents internal events 
 * coming from 'openHAB event bus' a second time to be sent back to the 'openHAB event bus'.
 *  
 * @param e the {@link ProcessEvent} to handle.
 */
@Override
public void groupWrite(ProcessEvent e) {
	logger.debug("Received groupWrite Event.");
	if (!(KNXConnection.getIgnoreLocalSourceEvents() && e.getSourceAddr().toString().equalsIgnoreCase(KNXConnection.getLocalSourceAddr()))) {
		readFromKNX(e);
	}else logger.warn("Ignoring local Event, received from my local Source address {} for Group address {}.", e.getSourceAddr().toString(), e.getDestination().toString());
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:14,代码来源:KNXBinding.java


示例5: groupReadRequest

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupReadRequest(ProcessEvent arg0)
{
    /*
    System.out.println("groupReadReq " + arg0.getSourceAddr().toString() + " - " + 
            arg0.getDestination().toString() + " : " +
            arg0.getASDU());
            */
}
 
开发者ID:gskbyte,项目名称:kora,代码行数:10,代码来源:KNXListener.java


示例6: groupReadResponse

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupReadResponse(ProcessEvent arg0)
{
    /*System.out.println("groupReadResp " + arg0.getSourceAddr().toString() + " - " + 
            arg0.getDestination().toString() + " : " +
            arg0.getASDU());*/
}
 
开发者ID:gskbyte,项目名称:kora,代码行数:8,代码来源:KNXListener.java


示例7: groupWrite

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
/**
 * If <code>knx:ignorelocalevents=true</code> is set in configuration, it prevents internal events
 * coming from 'openHAB event bus' a second time to be sent back to the 'openHAB event bus'.
 *
 * @param e the {@link ProcessEvent} to handle.
 */
@Override
public void groupWrite(ProcessEvent e) {
    logger.debug("Received groupWrite Event.");
    if (!(KNXConnection.getIgnoreLocalSourceEvents()
            && e.getSourceAddr().toString().equalsIgnoreCase(KNXConnection.getLocalSourceAddr()))) {
        readFromKNX(e);
    } else {
        logger.debug("Ignoring local Event, received from my local Source address {} for Group address {}.",
                e.getSourceAddr().toString(), e.getDestination().toString());
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:18,代码来源:KNXBinding.java


示例8: groupReadRequest

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupReadRequest(ProcessEvent e) {
    convertAndForward(e);
}
 
开发者ID:tuxedo0801,项目名称:slicKnx,代码行数:5,代码来源:GeneralGroupAddressListener.java


示例9: groupReadResponse

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupReadResponse(ProcessEvent e) {
    convertAndForward(e);
}
 
开发者ID:tuxedo0801,项目名称:slicKnx,代码行数:5,代码来源:GeneralGroupAddressListener.java


示例10: groupWrite

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupWrite(ProcessEvent e) {
    convertAndForward(e);
}
 
开发者ID:tuxedo0801,项目名称:slicKnx,代码行数:5,代码来源:GeneralGroupAddressListener.java


示例11: notifyListeners

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
public void notifyListeners(ProcessEvent p_evt){
	setChanged();
	notifyObservers(p_evt);
}
 
开发者ID:heia-fr,项目名称:wot_gateways,代码行数:5,代码来源:KNXLogger.java


示例12: readFromKNX

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
/**
 * Handles the given {@link ProcessEvent}. After finding the corresponding
 * Item (by iterating through all known group addresses) this Item is updated.
 * Each item is added to a special list to identify and avoid echo's in
 * the <code>receiveUpdate</code> and <code>receiveCommand</code> methods.  
 *  
 * @param e the {@link ProcessEvent} to handle.
 */
private void readFromKNX(ProcessEvent e) {
	try {
		GroupAddress destination = e.getDestination();
		byte[] asdu = e.getASDU();
		if (asdu.length==0) {
			return;
		}
		String [] itemList = getItemNames(destination);
		if (itemList.length == 0) {
			logger.debug("Received telegram for unknown group address {}", destination.toString());
		}
		for (String itemName : itemList) {
			Iterable<Datapoint> datapoints = getDatapoints(itemName, destination);
			if (datapoints != null) {
				for (Datapoint datapoint : datapoints) {
					Type type = getType(datapoint, asdu);					
					if (type!=null) {
						// we need to make sure that we won't send out this event to
						// the knx bus again, when receiving it on the openHAB bus
						ignoreEventList.add(itemName + type.toString());
						logger.trace("Added event (item='{}', type='{}') to the ignore event list", itemName, type.toString());

						if (type instanceof Command && isCommandGA(destination)) {
							eventPublisher.postCommand(itemName, (Command) type);
						} else if (type instanceof State) {
							eventPublisher.postUpdate(itemName, (State) type);
						} else {
							throw new IllegalClassException("Cannot process datapoint of type " + type.toString());
						}								

						logger.trace("Processed event (item='{}', type='{}', destination='{}')", itemName, type.toString(), destination.toString());
					}
					else {
						final char[] hexCode = "0123456789ABCDEF".toCharArray();
						StringBuilder sb = new StringBuilder(2+asdu.length * 2);
						sb.append("0x");
						for (byte b : asdu) {
							sb.append(hexCode[(b >> 4) & 0xF]);
							sb.append(hexCode[(b & 0xF)]);
						}

						logger.debug("Ignoring KNX bus data: couldn't transform to an openHAB type (not supported). Destination='{}', datapoint='{}', data='{}'",
								new Object[] {destination.toString(), datapoint.toString(), sb.toString() });
					}
				}
			}
		}
	} catch(RuntimeException re) {
		logger.error("Error while receiving event from KNX bus: " + re.toString());
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:60,代码来源:KNXBinding.java


示例13: groupReadRequest

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupReadRequest(final ProcessEvent e)
{
    add(model.get(e.getDestination()), "read request", e);
}
 
开发者ID:gskbyte,项目名称:kora,代码行数:6,代码来源:Listener.java


示例14: groupReadResponse

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupReadResponse(final ProcessEvent e)
{
    add(model.get(e.getDestination()), "read response", e);
}
 
开发者ID:gskbyte,项目名称:kora,代码行数:6,代码来源:Listener.java


示例15: groupWrite

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
public void groupWrite(final ProcessEvent e)
{
    add(model.get(e.getDestination()), "write", e);
}
 
开发者ID:gskbyte,项目名称:kora,代码行数:5,代码来源:Listener.java


示例16: groupWrite

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupWrite(ProcessEvent evt)
{
    final String source = evt.getSource().toString();
    final String destination = evt.getDestination().toString();
    final String devName = KNXDevice.addrMap.get(destination);
    final KNXDevice dev = (KNXDevice) DeviceManager.instance().getDevice(devName);
    
    if(dev != null){
        /*try {
            dev.readValue();
        } catch (Throwable e) {
            Log.log("Error reading from device "+devName);
        }*/
        Event e = new Event(DeviceChangeEvent.TOPIC);

        Value deviceName = new Value(),
              deviceValue = new Value();
        
        deviceName.setString(devName);

        try {
            switch(dev.getValue().type){
            case Value.BOOLEAN_TYPE:
                final boolean b = asBool(evt);
                deviceValue.setBoolean(b);
                dev.setValue(deviceValue);
                Log.log("New boolean value for "+devName+": "+b);
                break;
            case Value.INTEGER_TYPE:
                final int i = asUnsigned(evt, "5.001");
                deviceValue.setInteger(i);
                Log.log("New integer value for "+devName+": "+i);
                break;
            }
            
            e.setMember("name", deviceName);
            e.setMember("value", deviceValue);
            
            org.ugr.bluerose.events.EventHandler.publish(e, false);
        } catch (KNXFormatException e1) {
            Log.log("KNXFormatException: "+e1.getMessage());
        } catch (Exception e2) {
            Log.log("KNXException: "+e2.getMessage());
        }
    }
}
 
开发者ID:gskbyte,项目名称:kora,代码行数:48,代码来源:KNXListener.java


示例17: readFromKNX

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
/**
 * Handles the given {@link ProcessEvent}. After finding the corresponding
 * Item (by iterating through all known group addresses) this Item is updated.
 * Each item is added to a special list to identify and avoid echo's in
 * the <code>receiveUpdate</code> and <code>receiveCommand</code> methods.
 *
 * @param e the {@link ProcessEvent} to handle.
 */
private void readFromKNX(ProcessEvent e) {
    try {
        GroupAddress destination = e.getDestination();
        byte[] asdu = e.getASDU();
        if (asdu.length == 0) {
            return;
        }
        String[] itemList = getItemNames(destination);
        if (itemList.length == 0) {
            logger.debug("Received telegram for unknown group address {}", destination.toString());
        }
        for (String itemName : itemList) {
            Iterable<Datapoint> datapoints = getDatapoints(itemName, destination);
            if (datapoints != null) {
                for (Datapoint datapoint : datapoints) {
                    Type type = getType(datapoint, asdu);
                    if (type != null) {
                        if (type instanceof Command && isStartStopEnabled(itemName, destination, datapoint)) {
                            if (isDimmerThreadRunning(itemName) && type == IncreaseDecreaseType.INCREASE) {
                                stopDimmerThread(itemName);
                            } else {
                                startDimmerThread(destination, itemName, (Command) type);
                            }
                        } else {
                            sendTypeToItemButNotToKnx(destination, itemName, type);
                        }
                    } else {
                        final char[] hexCode = "0123456789ABCDEF".toCharArray();
                        StringBuilder sb = new StringBuilder(2 + asdu.length * 2);
                        sb.append("0x");
                        for (byte b : asdu) {
                            sb.append(hexCode[(b >> 4) & 0xF]);
                            sb.append(hexCode[(b & 0xF)]);
                        }

                        logger.debug(
                                "Ignoring KNX bus data: couldn't transform to an openHAB type (not supported). Destination='{}', datapoint='{}', data='{}'",
                                new Object[] { destination.toString(), datapoint.toString(), sb.toString() });
                    }
                }
            }
        }
    } catch (RuntimeException re) {
        logger.error("Error while receiving event from KNX bus: " + re.toString());
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:55,代码来源:KNXBinding.java


示例18: messageReceived

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
public void messageReceived(ProcessEvent e) {
    LOG.info("Device {} received message from {}",e.getDestination(),e.getSourceAddr());
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:4,代码来源:KNXDeviceAbstract.java


示例19: messageSent

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
public void messageSent(ProcessEvent e){
    LOG.info("Device {} sent message to {}",e.getSourceAddr(),e.getDestination());
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:4,代码来源:KNXDeviceAbstract.java


示例20: groupWrite

import tuwien.auto.calimero.process.ProcessEvent; //导入依赖的package包/类
@Override
public void groupWrite(ProcessEvent ev) {

	if (m_Logger != null)
		m_Logger.notifyListeners(ev);

	if (m_Management != null)
		m_Management.notifyListeners(ev);

}
 
开发者ID:heia-fr,项目名称:wot_gateways,代码行数:11,代码来源:KNXComm.java



注:本文中的tuwien.auto.calimero.process.ProcessEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ILineVertexBufferObject类代码示例发布时间:2022-05-23
下一篇:
Java Expression类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap