Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"rules": {
"no-console": "off"
},
"parserOptions": {
"parser": "babel-eslint"
}
Expand All @@ -48,4 +50,4 @@
"> 1%",
"last 2 versions"
]
}
}
92 changes: 38 additions & 54 deletions dash/src/components/Cards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default {
this.cardtext = text;
this.switchbtn(btn);
this.step = step;
console.log(step)
},
switchbtn: function (mode) {
if (mode == 1) {
Expand Down Expand Up @@ -117,27 +118,18 @@ export default {
} else {
if (this.product > 2073600) {
res = this.res;
newproduct = 0;
newproduct = res[0]*res[1];
ratio = res[0] / res[1];
if (res[0] % 4 != 0) {
res[0] = res[0] - 2;
while (newproduct <= 2073600) {
res[0] = res[0] - 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
}
if (res[1] % 4 != 0) {
res[1] = res[1] - (res[1] % 4);
}
} else {
while (newproduct <= 2073600) {
res[0] = res[0] - 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
}
if (res[1] % 4 != 0) {
res[1] = res[1] - (res[1] % 4);
}
}
while (newproduct > 2073600) {
res[0] = res[0] - 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
}
if (res[1] % 4 != 0) {
res[1] = res[1] - (res[1] % 4);
}
if (this.interlace == 1) {
this.setcard("请输入宽度" + res[0] + "和高度" + res[1] + ",并按照码率B来处理,并按照手册文末问答2执行反交错操作", 3, 10000);
Expand Down Expand Up @@ -169,54 +161,46 @@ export default {
}
if (this.hfps == 0 && this.interlace == 0) {
res = this.res;
newproduct = 0;
newproduct = res[0]*res[1];
ratio = res[0] / res[1];
if (res[0] % 4 != 0) {
res[0] = res[0] + 2;
while (newproduct > 921600) {
res[0] = res[0] + 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
}
if (res[1] % 4 != 0) {
res[1] = res[1] + (4 - (res[1] % 4));
}
} else {
while (newproduct > 921600) {
res[0] = res[0] + 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
}
if (res[1] % 4 != 0) {
res[1] = res[1] + (4 - (res[1] % 4));
}
}
console.log('-----------')
console.log(res)
console.log(ratio)
console.log(newproduct)
console.log('-----------')
while (newproduct <= 921600) {
res[0] = res[0] + 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
console.log('-----------')
console.log(res)
console.log(ratio)
console.log(newproduct)
console.log('-----------')
}
if (res[1] % 4 != 0) {
res[1] = res[1] + (4 - (res[1] % 4));
}
this.setcard("请输入宽度" + res[0] + "和高度" + res[1] + ",并按照码率B来处理", 3, 10000);
return;
} else {
if (this.product <= 409920) {
res = this.res;
newproduct = 0;
newproduct = res[0]*res[1];
ratio = res[0] / res[1];
if (res[0] % 4 != 0) {
res[0] = res[0] + 2;
while (newproduct > 409920) {
res[0] = res[0] + 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
}
if (res[1] % 4 != 0) {
res[1] = res[1] + (4 - (res[1] % 4));
}
} else {
while (newproduct > 409920) {
res[0] = res[0] + 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
}
if (res[1] % 4 != 0) {
res[1] = res[1] + (4 - (res[1] % 4));
}
}
while (newproduct <= 409920) {
res[0] = res[0] + 4;
res[1] = Math.round(res[0] / ratio);
newproduct = res[0] * res[1];
}
if (res[1] % 4 != 0) {
res[1] = res[1] + (4 - (res[1] % 4));
}
if (this.interlace == 1) {
this.setcard("请输入宽度" + res[0] + "和高度" + res[1] + ",并按照码率A来处理,并按照手册文末问答2执行反交错操作", 3, 10000);
Expand Down