use of com.cas.circuit.state.MultimeterState_MF47 in project TeachingInSimulation by ScOrPiOzzy.
the class ConnectionController method multimeterClick.
// private void setMouseVisible(boolean visible) {
// // 鼠标显示或隐藏
// SimpleApplication app = Dispatcher.getIns().getMainApp();
// InputManager inputManager = app.getInputManager();
// app.getFlyByCamera().setEnabled(!visible);
// app.getStateManager().getState(AimPointState.class).setVisible(!visible);
// inputManager.setCursorVisible(visible);
// }
public void multimeterClick() {
SimpleApplication app = Dispatcher.getIns().getMainApp();
MultimeterState_MF47 multimeterState = app.getStateManager().getState(MultimeterState_MF47.class);
if (multimeterState != null) {
multimeterState.setEnabled(!multimeterState.isEnabled());
}
}
use of com.cas.circuit.state.MultimeterState_MF47 in project TeachingInSimulation by ScOrPiOzzy.
the class LinkTargetHandler method select.
public void select() {
MultimeterState_MF47 multimeterState = stateManager.getState(MultimeterState_MF47.class);
if (multimeterState.isEnabled() && target instanceof Terminal) {
multimeterState.putPenToTerminal((Terminal) target, target.getModel());
return;
}
if (!handler.checkConnect(target)) {
return;
}
LinkerMsg reqMsg = handler.offlineConnect(target);
// 如果当前为多人联机模式则向服务器发送连线请求
if (!handler.isAlone()) {
reqMsg.setType(LinkerMsg.ADD_LINKER);
ClientMgr.send(reqMsg);
}
if (!(target instanceof Terminal)) {
return;
}
// 螺丝拧上拧下
Node parent = (Node) target.getModel();
// findCylinder(parent);
final Spatial luosi = parent.getChild("screw");
if (luosi == null) {
throw new RuntimeException("螺丝的模型结构有问题, 没有指出螺杆节点");
}
if (luosi.getNumControls() > 0) {
AbstractControl control = (AbstractControl) luosi.getControl(0);
control.setEnabled(true);
}
}
Aggregations