-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CfgEditor] Fill .cfg parameters by default values #1493
Conversation
e209415
to
b325949
Compare
b21cee9
to
4797076
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thank you!
src/CfgEditor/CfgEditorPanel.ts
Outdated
if (this._activeWebviewPanel === webviewPanel) { | ||
// there are race conditions with visibility | ||
// another webviewPanel becomes visible while this one is disposed | ||
// so 'activeCfgIsVisible' will not be set to false | ||
vscode.commands.executeCommand( | ||
"setContext", | ||
"one.CfgEditor:activeCfgIsVisible", | ||
false | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using the given context below, you don't need to be bothered to implement this custom context.
"when": "activeCustomEditorId == one.editor.cfg"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh... Ok. Thank you. I'll try!
media/CfgEditor/index.js
Outdated
@@ -101,6 +104,61 @@ function main() { | |||
postMessageToVsCode({ type: "requestDisplayCfg" }); | |||
} | |||
|
|||
function setDefaultValues(name) { | |||
const optimizationUsed = document.getElementById("checkboxOptimize").checked; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Not for functionality, but for readability)
How about collecting related lines?
These optimization-related lines can be moved below, near to the updating lines,
const optimizationUsed = document.getElementById("checkboxOptimize").checked;
let optimizedPath = importedPath + ".opt";
and these quantization-related lines too.
const qType = document.getElementById("DefaultQuantQuantizedDtype").value;
const qSuffix = qType === "uint8" ? ".q8" : ".q16";
let quantizedPath = optimizationUsed
? optimizedPath + qSuffix
: importedPath + qSuffix;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I'll try to make it more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks clear, thanks!
This commit fills .cfg paramters by default values using keyboard shortcut. ONE-vscode-DCO-1.0-Signed-off-by: s.malakhov <[email protected]>
6f15213
to
0955fb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This commit fills .cfg paramters by default values using keyboard shortcut.
This commit fills default values in .cfg file (input and output paths for import/optimization/quantization).
Currently its optimal usage would be:
Issue: #1487
ONE-vscode-DCO-1.0-Signed-off-by: s.malakhov [email protected]