我只是想知道它为什么会这样做。
在IBMRFT6.x版本中集成了eclipse。我运行下面的行来获取另一个程序的文本输出。
String Text = "";
String Text_Value = "";
Text = (String) outputText().getProperty(".value");
Text_Value = (String) outputText().getProperty(".value");
outputText().getProperty(".value")捕获的原始输出是
2011-09-27 19:11:05.996 [Process ID:0x00000000] show cpup sc11
************************************************************
CPU0 Usage : 3.2%
CPU1 Usage : 6.29%
Smooth CPU Usage : 4.65%
Real CPU Usage : 4.65%
------------------------------------------------------------
CPU Usage Sample Rate : 2(s)
CPU OverLoad Level[1] : 10%
CPU OverLoad Level[2] : 20%
CPU OverLoad Level[3] : 90%
CPU OverLoad Level[4] : 95%
CPU Peak Usage : 99.88%
CPU Peak Usage Time : 2008-10-31 20:12:54
------------------------------------------------------------
The History Real CPU Usage :
No %CPU %CPU %CPU %CPU %CPU %CPU %CPU %CPU
0 3.87 4.76 4.72 4.76 4.76 4.69 4.65 4.65
1 4.69 4.65
************************************************************
奇怪的事情发生在这里。我得到了字符串变量
Text = "\r\n2011-09-27 19:11:05.996 [Process ID:0x00000000] show cpup sc11"
和
Text_Value = "\r\n2011-09-27 19:11:05.996 [Process ID:0x00000000] show cpup sc11\r\n************************************************************\r\n.....4.69 4.65
\r\n************************************************************"
Text_Value正是我想要的,但是文本总是在“显示cpup sc11”中被切断。
这两个人也会做同样的事情。
当我尝试program.This的其他输出时,不会happen.The,两个变量是相同的。
发布于 2011-09-29 18:41:17
这可能是一个同步问题。您的Text
被切断,因为控件没有完全填充。在执行Text_Value
行时,outputText()对象已被完全填充,因此Text_Value
不会被截断。您可以通过在sleep(10)
行之前插入一个Text
命令来证明这一点。将值10更改为任意秒数足以使outputText()控件完全填充。
https://stackoverflow.com/questions/7568320
复制相似问题