📄 servodescriptor.java
字号:
package net.sf.dz.setup.core;import org.freehold.servomaster.device.model.Meta;import org.freehold.servomaster.device.model.Servo;/** * A servo descriptor. * * @author Copyright © <a href="mailto:vt@freehold.crocodile.org">Vadim Tkachenko</a> 2004 * @version $Id: ServoDescriptor.java,v 1.3 2004/07/27 05:15:08 vtt Exp $ */class ServoDescriptor implements Comparable { /** * Servo instance. * * Used to retrieve the servo identifier and controller class. */ public Servo servo; /** * Zone to which this servo is assigned, if any. */ public ZoneDescriptor zone; public ServoDescriptor(Servo servo) { this.servo = servo; } public String toString() { return getComparable() + (zone != null ? "+" : ""); } public int compareTo(Object other) { return getComparable().compareTo(((ServoDescriptor)other).getComparable()); } public String getComparable() { return getControllerId() + "/" + servo.getName(); } /** * Get a unique servo controller identifier. */ public String getControllerId() { // Let's concoct it on the fly. Meta meta = servo.getController().getMeta(); String model = (String)meta.getProperty("manufacturer/model"); String port = servo.getController().getPort(); return model + "/" + port; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -