publish
This commit is contained in:
parent
f38388896d
commit
2f62a1a123
67 changed files with 4545 additions and 0 deletions
62
Cube_Demo/cube_demo/ReadingThread.java
Normal file
62
Cube_Demo/cube_demo/ReadingThread.java
Normal file
|
@ -0,0 +1,62 @@
|
|||
package cube_demo;
|
||||
|
||||
import de.spacecontrol.sc.dllwrapper.ScDllWrapper;
|
||||
import de.spacecontrol.sc.dllwrapper.ScEx;
|
||||
import de.spacecontrol.sc.dllwrapper.ScStdData;
|
||||
|
||||
public class ReadingThread extends Thread {
|
||||
private CubeApp mApp;
|
||||
|
||||
private int mDevIdx;
|
||||
|
||||
private boolean mIsReading;
|
||||
|
||||
public void setDevIdx(int paramInt) {
|
||||
this.mDevIdx = paramInt;
|
||||
}
|
||||
|
||||
public void stopReadingThread() {
|
||||
this.mIsReading = false;
|
||||
}
|
||||
|
||||
public ReadingThread(CubeApp paramCubeApp) {
|
||||
this.mApp = paramCubeApp;
|
||||
this.mDevIdx = paramCubeApp.getDevIdx();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
boolean bool = true;
|
||||
int i = 0;
|
||||
ScStdData scStdData = new ScStdData();
|
||||
this.mIsReading = true;
|
||||
while (this.mIsReading) {
|
||||
try {
|
||||
ScDllWrapper.scFetchStdData(this.mDevIdx, scStdData);
|
||||
if (scStdData.mEvent > -1) {
|
||||
this.mApp.handleEvent(this.mDevIdx, scStdData.mEvent);
|
||||
continue;
|
||||
}
|
||||
this.mApp.repaintDemo(scStdData);
|
||||
} catch (ScEx scEx) {
|
||||
if (bool) {
|
||||
this.mApp.repaintDemo(scStdData);
|
||||
if (i++ > 3) {
|
||||
i = 0;
|
||||
bool = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("*** Reading thread stopped.");
|
||||
}
|
||||
|
||||
public void stopp() {
|
||||
this.mIsReading = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Cube_Demo.jar!/cube_demo/ReadingThread.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue