Browse Source

调试登录

dev
刘向辉 3 years ago
parent
commit
276e3fc26c
  1. 2
      src/app/babylon/controller/mode-manager.ts
  2. 3
      src/app/babylon/controller/status/login-status.ts
  3. 20
      src/app/babylon/tool/babylon-tool.ts
  4. 3
      src/app/babylon/view/building-window/building-window.ts
  5. 7
      src/app/pages/plan/plan.component.ts

2
src/app/babylon/controller/mode-manager.ts

@ -23,7 +23,7 @@ export class ModeManager {
/**
*
*/
public static s_isMakeMode = true;
public static s_isMakeMode = false;
/**
*

3
src/app/babylon/controller/status/login-status.ts

@ -229,11 +229,10 @@ export class LoginSatus extends StatusBase {
//保存新单位信息至服务器
saveNewIns(status: LoginSatus, insData: InstitutionData, key: string, id: number, onSuccess?: (insDataSimple: InsitutionDataSimple) => void) {
console.log("准备保存新单位");
ServeManager.instance.saveInstitutionData(insData, key, id, (key, result) => {
console.log("在服务器新建单位" + key);
let insDataSimple = new InsitutionDataSimple();
insDataSimple.key = key;
insDataSimple.id = id;
insDataSimple.name = insData.normalData.name;
status.onCreateInsSuccess(insDataSimple);
if (onSuccess != null) {

20
src/app/babylon/tool/babylon-tool.ts

@ -348,6 +348,10 @@ export class BabylonTool {
beta: number,
onAnimationEnd?: () => void
) {
camera.alpha = BabylonTool.limitPI(camera.alpha);
camera.beta = BabylonTool.limitPI(camera.beta);
//缓动动画
let easingFunction = new QuadraticEase();
easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEOUT);
@ -422,6 +426,22 @@ export class BabylonTool {
}
/**
* 0-2π
* @param value
*/
public static limitPI(value: number) {
let result = value;
while (result < 0) {
result += Math.PI * 2;
}
while (result > Math.PI * 2) {
result -= Math.PI * 2;
}
return result;
}
//动画移动摄像机target
public static AnimMoveCameraTarget(

3
src/app/babylon/view/building-window/building-window.ts

@ -292,8 +292,9 @@ export class BuildingWindow extends UIBase {
PlanComponent.instance.isOpenAwning = showZP;
let camera = SceneManager.Instance.defaultCamera;
if (cameraData != null) {
this.cameraAnim = BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta, onAnimationEnd);
if (Event_LoadingChange.isLoading) {
if (Event_LoadingChange.isLoading) { //加载中,暂停
this.cameraAnim.pause();
}
}

7
src/app/pages/plan/plan.component.ts

@ -80,7 +80,7 @@ export class PlanComponent implements OnInit {
ngAfterViewInit(): void {
this.getGasStationBaseInfo().then((res: any) => { //获取单位 基本信息
console.log(res, "当前加油站信息")
// console.log(res, "当前加油站信息")
let simpleData: InsitutionDataSimple = new InsitutionDataSimple();
simpleData.id = res.id || 6; //来自选中的单位的信息 ,测试:1
simpleData.key = `${res.id}` || "ceshi"; //测试:"ceshi"
@ -91,12 +91,12 @@ export class PlanComponent implements OnInit {
if (ModeManager.institutionDemoKey == ModeManager.c_demoKey_null) { //无指定测试单位,则为正式启动,根据当前单位key寻找
if (has3dData) { //如果已经有三维数据,直接进入
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
// console.log("单位数据", simpleData);
// console.log("进入三维单位", simpleData);
this.beforeOneSatus.onSelectInsSuccess(simpleData)
} else { //如果没有三维数据
if (ModeManager.s_isMakeMode) //内部制作模式下,询问新建
{
let isAdd = confirm('没有单位' + simpleData.key + ',是否进行初始化?')
let isAdd = confirm('没有单位:' + simpleData.name + ',是否进行初始化?')
if (isAdd) {
let name = simpleData.name;
let id = simpleData.id;// 单位id
@ -106,6 +106,7 @@ export class PlanComponent implements OnInit {
else //非内部制作模式,不开启
{
console.log("没有单位" + simpleData.key);
}
}
} else {

Loading…
Cancel
Save