使用Sun SPOT作为构建监视器 - 编程入门网
inner class to handle the colour and behaviour (flashing, solid,
* running) of the LEDs of a SPOT.
*/
public class SetColour implements Runnable {
/**
* A reference to the SPOTs LEDs so they can be set according to the
* state of the build.
*/
private ITriColorLED[] leds = EDemoBoard.getInstance ().getLEDs();
/**
* The RGB colour to set the LEDs to.
*/
private LEDColor colour;
/**
* The current status of the build. This will be used to set the
* behaviour of the LEDs (flashing, solid, running).
*/
private String buildStatus;
public SetColour(LEDColor colour, final String buildStatus) {
this.colour = colour;
this.buildStatus = buildStatus;
}
public void run() {
try {
if (buildStatus.equals("RUN")) {
// Display running LEDs.
while (true) {
for (int i = 0; i < 8; i++) {
leds[i].setColor(colour);
leds[i].setOn();
Thread.sleep(200);
leds[i].setOff();
}
}
} else if (buildStatus.equals("FAIL")) {
// Flash the LEDs on and off.
while (true) {
for (int i = 0; i < 8; i++ ) {
leds[i].setColor(colour);
leds[i].setOn();
}
Thread.sleep(250);
for (int i = 0; i < 8; i++ ) {
leds[i].setOff();
}
Thread.sleep(250);
}
} else {
// Display the LEDs as a solid bar.
for (int i = 0; i < 8; i++) {
leds[i].setColor(colour);
leds[i].setOn();
}
}
} catch (InterruptedException ie) {
// Do nothing. Just bail out so we can set the LEDs to another colour.
}
}
}
賠汽 7 葎 SPOT 議 8 倖 LED 蛍艶譜崔冲弼?旺功象更秀議彜蓑嬉蝕賜購液 宸乂 LED。 和匯化頁繍更秀酌篇匂現紗欺隔偬更秀狛殻。 使用Sun SPOT作为构建监视器(9)时间:2011-05-25 IBM Craig W. CaulfieldCruiseControl 配置 当 CruiseControl 开始时,它在一个连续循环中运行,周期性地检查源代码 库,例如 Subversion,然后从头开始构建和测试项目。然后,CruiseControl 可 以将构建成功或失败的状态发布到网站上,供所有人查看,并发出各种不同的消 息。 CruiseControl 循环的行为由一个 XML 配置文件 config.xml 表示,如清单 8 所示: 清单 8. CruiseControl 配置文件
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |