解决黄蓝代码不同步问题

Signed-off-by: hanlibin <hanlibin3@huawei.com>
This commit is contained in:
hanlibin 2024-07-20 11:24:07 +08:00
parent d9a5d81a7c
commit 5f5eb3cdc6
4 changed files with 17 additions and 43 deletions

View File

@ -1,15 +1,2 @@
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks

View File

@ -159,7 +159,7 @@ export default {
name: dbName,
securityLevel: relationalStore.SecurityLevel.S1,
};
let results: TGeneralInfo[] = [];
let results = Array<TGeneralInfo>();
try {
return await relationalStore
.getRdbStore(globalThis.abilityContext, STORE_CONFIG)
@ -247,7 +247,6 @@ export default {
return results;
}
},
//查询表( T_INDEX_INFO) 2022-02-23 改为传时间戳
async queryData(dbPath: string): Promise<Array<TIndexInfo>> {
const STORE_CONFIG: relationalStore.StoreConfig = {
@ -711,6 +710,7 @@ export default {
.then(async (rdbStore) => {
let strSQL: string =
'select * ' + 'from task_powersensor_info order by power desc ';
return rdbStore.querySql(strSQL);
})
.then((resultSet) => {
@ -781,7 +781,7 @@ export default {
return results;
});
} catch (err) {
return results;
return results;
}
},
//查询表detailed_applications_gpu
@ -860,7 +860,8 @@ export default {
let current = resultSet.getString(
resultSet.getColumnIndex('current')
);
let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, ''
);
results.push(tPowerSensorInfo);
}
return results;
@ -1036,8 +1037,7 @@ export default {
} catch (err) {
return results;
}
},
//查询表detailed_applications_sensor
}, //查询表detailed_applications_sensor
async query_applications_sensor(
start_time: String,
end_time: String,
@ -1070,7 +1070,8 @@ export default {
let current = resultSet.getString(
resultSet.getColumnIndex('current')
);
let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, '');
let tPowerSensorInfo = new TPowerSensorInfo('', sensor, power, current, ''
);
results.push(tPowerSensorInfo);
}
return results;

View File

@ -20,11 +20,10 @@ import Paint from '../data/Paint';
import { XAxis } from './XAxis';
import YAxis from './YAxis';
import {PathPaint} from '../data/Paint';
import { CirclePaint, PathFillPaint, TextPaint, LinePaint, ImagePaint} from '../data/Paint'
import { CirclePaint, PathFillPaint, TextPaint, LinePaint, ImagePaint} from '../data/Paint';
import LineChartRenderer from '../renderer/LineChartRenderer';
import LineData from '../data/LineData';
import Utils from '../utils/Utils'
import SPLogger from '../../../../utils/SPLogger';
import Utils from '../utils/Utils';
@Component
@Preview
@ -223,18 +222,13 @@ export class PathViewModel extends ScaleMode {
public onDoubleClick(event: ClickEvent) {
this.currentXSpace = this.centerX * this.scaleX - this.centerX;
this.currentYSpace = this.centerY * this.scaleY - this.centerY;
// let maxXBefore: number = this.paintArry[this.paintArry.length - 1].x;
let maxXBefore: number = 0;
try{
SPLogger.INFO(PathViewModel.name,'定义maxXBefore===========');
if(this.paintArry.length > 0){
SPLogger.INFO(PathViewModel.name,'maxXBefore :: this.paintArry.length = ' + this.paintArry.length);
let maxXBefore: number = 0;
try {
if (this.paintArry.length > 0) {
maxXBefore = this.paintArry[this.paintArry.length - 1].x;
}
SPLogger.INFO(PathViewModel.name,'给maxXBefore赋值成功===========');
} catch (error) {
console.log(error);
SPLogger.ERROR(PathViewModel.name,'maxXBefore::' + error);
}
let maxYBefore: number = Number.MIN_VALUE;
let minYBefore: number = Number.MAX_VALUE;
@ -246,25 +240,18 @@ export class PathViewModel extends ScaleMode {
minYBefore = this.valuePaint[i].y;
}
}
this.ondraw();
let tag: string = 'maxXAfter';
// let maxXAfter: number = this.paintArry[this.paintArry.length - 1].x;
let maxXAfter: number = 0;
try {
SPLogger.INFO(tag,'定义maxXAfter===========');
if(this.paintArry.length > 0) {
SPLogger.INFO(tag,'this.paintArry.length = ' + this.paintArry.length);
if (this.paintArry.length > 0) {
maxXAfter = this.paintArry[this.paintArry.length - 1].x;
}
SPLogger.INFO(tag,'给maxXAfter赋值成功===========');
} catch(error) {
} catch (error) {
console.log(error);
SPLogger.ERROR(tag,'maxXAfter::' + error);
}
let maxYAfter: number = Number.MIN_VALUE;
let minYAfter: number = Number.MAX_VALUE;
for (let i = 0; i < this.valuePaint.length; i++) {
if (maxYAfter < this.valuePaint[i].y) {
maxYAfter = this.valuePaint[i].y;
@ -273,7 +260,6 @@ export class PathViewModel extends ScaleMode {
minYAfter = this.valuePaint[i].y;
}
}
this.transX += maxXAfter - maxXBefore;
this.transMaxY += maxYAfter - maxYBefore;
this.transMinY += minYAfter - minYBefore;

View File

@ -47,7 +47,7 @@
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:logo",
"icon": "$media:logo_set",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [