Update: 合并master分支提交记录

This commit is contained in:
王立帮
2024-12-14 23:49:21 +08:00
26 changed files with 127 additions and 186 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -196,6 +196,10 @@
"__file__": true,
"__name__": "22-2-射频识别-持续写卡(MIG2).mix"
},
"22-2射频识别-模拟公交卡.mix": {
"__file__": true,
"__name__": "22-2射频识别-模拟公交卡.mix"
},
"23-1-蓝牙通讯-主机模式.mix": {
"__file__": true,
"__name__": "23-1-蓝牙通讯-主机模式.mix"

View File

@@ -221,7 +221,7 @@ export const display_rgb = function (_, generator) {
var value_led = generator.valueToCode(this, '_LED_', generator.ORDER_ATOMIC);
var COLOR = generator.valueToCode(this, 'COLOR', generator.ORDER_ATOMIC);
COLOR = COLOR.replace(/#/g, "0x");
var code = 'rgb_display_' + dropdown_rgbpin + '.setPixelColor((' + value_led + ')-1, ' + COLOR + ');\n';
var code = 'rgb_display_' + dropdown_rgbpin + '.setPixelColor(' + value_led + ' - 1, ' + COLOR + ');\n';
return code;
};
@@ -231,7 +231,7 @@ export const RGB_color_HSV = function (_, generator) {
var H = generator.valueToCode(this, 'H', generator.ORDER_ATOMIC);
var S = generator.valueToCode(this, 'S', generator.ORDER_ATOMIC);
var V = generator.valueToCode(this, 'V', generator.ORDER_ATOMIC);
var code = 'rgb_display_' + dropdown_rgbpin + '.setPixelColor((' + value_led + ')-1, ' + 'rgb_display_' + dropdown_rgbpin + '.ColorHSV(' + H + ',' + S + ',' + V + '));\n';
var code = 'rgb_display_' + dropdown_rgbpin + '.setPixelColor(' + value_led + ' - 1, ' + 'rgb_display_' + dropdown_rgbpin + '.ColorHSV(' + H + ',' + S + ',' + V + '));\n';
return code;
};

View File

@@ -61,7 +61,7 @@ export const handbit_rgb = function (_, generator) {
generator.definitions_['include_Adafruit_NeoPixel'] = '#include <Adafruit_NeoPixel.h>';
generator.definitions_['var_declare_rgb_display17'] = 'Adafruit_NeoPixel rgb_display_17= Adafruit_NeoPixel(3,17,NEO_GRB + NEO_KHZ800);';
generator.setups_['setup_rgb_display_begin_17'] = 'rgb_display_17.begin();';
var code = 'rgb_display_17.setPixelColor(' + value_led + '-1,' + COLOR + ');\n';
var code = 'rgb_display_17.setPixelColor(' + value_led + ' - 1,' + COLOR + ');\n';
return code;
}
@@ -177,6 +177,6 @@ export const handbit_RGB_color_HSV = function (_, generator) {
var H = generator.valueToCode(this, 'H', generator.ORDER_ATOMIC);
var S = generator.valueToCode(this, 'S', generator.ORDER_ATOMIC);
var V = generator.valueToCode(this, 'V', generator.ORDER_ATOMIC);
var code = 'rgb_display_' + dropdown_rgbpin + '.setPixelColor(' + value_led + ')-1, ' + 'rgb_display_' + dropdown_rgbpin + '.ColorHSV(' + H + ',' + S + ',' + V + '));\n';
var code = 'rgb_display_' + dropdown_rgbpin + '.setPixelColor(' + value_led + ' - 1, ' + 'rgb_display_' + dropdown_rgbpin + '.ColorHSV(' + H + ',' + S + ',' + V + '));\n';
return code;
}

File diff suppressed because one or more lines are too long

View File

@@ -196,6 +196,10 @@
"__file__": true,
"__name__": "22-2-射频识别-持续写卡(MIG2).mix"
},
"22-2射频识别-模拟公交卡.mix": {
"__file__": true,
"__name__": "22-2射频识别-模拟公交卡.mix"
},
"23-1-蓝牙通讯-主机模式.mix": {
"__file__": true,
"__name__": "23-1-蓝牙通讯-主机模式.mix"

View File

@@ -16,8 +16,16 @@
.blocklyToolboxDiv {
overflow-x: hidden;
overflow-y: scroll;
padding: 0px;
overflow-y: auto;
padding: 0 2px 0 0;
}
.classic-theme .blocklyToolboxDiv {
border-right: 1px solid #c9c9c9;
}
.dark-theme .blocklyToolboxDiv {
border-right: 1px solid rgba(128, 128, 128, 0.35);
}
.blocklyTreeLabel {

View File

@@ -357,10 +357,14 @@ html[data-bs-theme=dark] .chrome-tabs .chrome-tab.dirty .chrome-tab-close:hover
background-color: #5f6368 !important;
}
html[data-bs-theme=light] .chrome-tabs .chrome-tab.dirty .chrome-tab-close {
background-color: #000;
.chrome-tabs .chrome-tab.dirty .chrome-tab-close.positive {
background-color: #ffb800;
}
html[data-bs-theme=dark] .chrome-tabs .chrome-tab.dirty .chrome-tab-close {
background-color: #fff;
html[data-bs-theme=light] .chrome-tabs .chrome-tab.dirty .chrome-tab-close.negative {
background-color: var(--app-light-color);
}
html[data-bs-theme=dark] .chrome-tabs .chrome-tab.dirty .chrome-tab-close.negative {
background-color: var(--app-dark-color);
}

View File

@@ -6,7 +6,6 @@
@import "../ui/layui/css/layui-theme-dark.css";
@import "./interface.css";
@import "./fontello.css";
@import "./nav.css";
@import "./library.css";
@import "./drag.css";
@import "./button.css";

View File

@@ -1,124 +0,0 @@
#table_whole {
height: calc(100vh - 2.6em) !important;
}
.layui-form-label > .layui-unselect.layui-form-checkbox > span {
height: 25px;
}
.layui-layout-left {
position: absolute !important;
left: 0px;
top: 0;
}
.layui-nav .layui-nav-item a {
position: relative;
overflow: hidden;
}
.layui-nav .layui-nav-item a:after {
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
pointer-events: none;
background-image: radial-gradient(circle, #666 10%, transparent 10.01%);
background-repeat: no-repeat;
background-position: 50%;
transform: scale(10, 10);
opacity: 0;
transition: transform 0.3s, opacity 0.5s;
}
.layui-nav .layui-nav-item a:active:after {
transform: scale(0, 0);
opacity: 0.3;
transition: 0s;
}
html[data-bs-theme=light] .layui-layer-tips .layui-layer-content {
background-color: #f2f2f2;
color: #000;
box-shadow: 1px 1px 3px rgb(0 0 0 / 20%);
}
html[data-bs-theme=dark] .layui-layer-tips .layui-layer-content {
background-color: #646363;
color: #fff;
box-shadow: 1px 1px 3px rgb(0 0 0 / 20%);
}
.footer-tips .layui-layer-content {
padding: 3px 12px;
}
html[data-bs-theme=light] .layui-layer-tips i.layui-layer-TipsL {
border-left-color: #f2f2f2;
}
html[data-bs-theme=dark] .layui-layer-tips i.layui-layer-TipsL {
border-left-color: #646363;
}
html[data-bs-theme=light] .layui-layer-tips i.layui-layer-TipsR {
border-right-color: #f2f2f2;
}
html[data-bs-theme=dark] .layui-layer-tips i.layui-layer-TipsR {
border-right-color: #646363;
}
html[data-bs-theme=light] .layui-layer-tips i.layui-layer-TipsT {
border-top-color: #f2f2f2;
}
html[data-bs-theme=dark] .layui-layer-tips i.layui-layer-TipsT {
border-top-color: #646363;
}
html[data-bs-theme=light] .layui-layer-tips i.layui-layer-TipsB {
border-bottom-color: #f2f2f2;
}
html[data-bs-theme=dark] .layui-layer-tips i.layui-layer-TipsB {
border-bottom-color: #646363;
}
.layui-table-fixed-r > .layui-table-header {
border-bottom-width: 0px;
}
.layui-table-fixed-r > .layui-table-body > table {
width: 100%;
}
html[data-bs-theme=dark] .layui-table-body .layui-none {
color: #fff;
}
html[data-bs-theme=dark] .layui-form-checkbox[lay-skin=primary] span {
color: #fff;
}
html[data-bs-theme=light] .layui-table-tips-main {
background-color: #fff;
color: #5f5f5f;
}
html[data-bs-theme=dark] .layui-table-tips-main {
background-color: #8d8888;
color: #fff;
}
html[data-bs-theme=light] input[m-id="search-area"] {
background-color: #f3efef;
border-color: #ddd;
}
html[data-bs-theme=light] input[m-id="search-area"] + button.layui-btn-disabled {
background-color: #f3efef !important;
}

View File

@@ -10,7 +10,7 @@ body ::-webkit-scrollbar {
/* 设置滚动条滑槽 */
::-webkit-scrollbar-track,
body ::-webkit-scrollbar-track {
background-color: rgba(255, 255, 255, 0.1);
background-color: transparent;
border-radius: 1px;
}
@@ -74,7 +74,7 @@ html[data-bs-theme=dark] body ::-webkit-scrollbar-thumb:active {
/* 设置滚动条滑槽 */
.mixly-scrollbar ::-webkit-scrollbar-track,
.mixly-scrollbar::-webkit-scrollbar-track {
background-color: rgba(255, 255, 255, 0.1);
background-color: transparent;
border-radius: 0px;
}
@@ -142,7 +142,7 @@ html[data-bs-theme=dark] ::-webkit-scrollbar-corner {
/* 设置滚动条滑槽 */
.blocklyDropDownDiv ::-webkit-scrollbar-track,
.blocklyWidgetDiv ::-webkit-scrollbar-track {
background-color: rgba(255, 255, 255, 0.1);
background-color: transparent;
border-radius: 0px;
}

View File

@@ -99,6 +99,7 @@ class App extends Component {
constructor(element) {
super();
const $content = $(HTMLTemplate.get('html/app.html').render());
$content.on('contextmenu', (e) => e.preventDefault());
this.setContent($content);
this.mountOn($(element));
this.#nav_ = new Nav();

View File

@@ -85,6 +85,10 @@ class FSBoard {
getHandler() {
return this.#handler_;
}
dispose() {
this.#handler_ = null;
}
}
Mixly.FSBoard = FSBoard;

View File

@@ -15,6 +15,7 @@ const {
class PageBase extends Component {
#pages_ = new Registry();
#$tab_ = null;
#$close_ = null;
#dirty_ = false;
#active_ = true;
#inited_ = false;
@@ -64,7 +65,9 @@ class PageBase extends Component {
dispose() {
this.#forward_('dispose');
this.#pages_.reset();
this.#$close_ = null;
this.#$tab_ && this.#$tab_.remove();
this.#$tab_ = null;
super.dispose();
}
@@ -97,22 +100,25 @@ class PageBase extends Component {
setTab($tab) {
this.#$tab_ = $tab;
this.#$close_ = $tab.find('.chrome-tab-close');
}
hideCloseBtn() {
const $closeBtn = this.getTab().find('.chrome-tab-close');
$closeBtn.css('display', 'none');
this.#$close_.css('display', 'none');
}
showCloseBtn() {
const $closeBtn = this.getTab().find('.chrome-tab-close');
$closeBtn.css('display', 'block');
this.#$close_.css('display', 'block');
}
getTab() {
return this.#$tab_;
}
setMarkStatus(styleClass) {
this.#$close_.attr('class', `chrome-tab-close layui-badge-dot ${styleClass}`);
}
addDirty() {
this.#forward_('addDirty');
const $tab = this.getTab();

View File

@@ -46,7 +46,6 @@ class StatusBarAmpy extends PageBase {
);
}
#$close_ = null;
#$fileTree_ = null;
#$editor_ = null;
#$openFS_ = null;
@@ -370,9 +369,7 @@ class StatusBarAmpy extends PageBase {
init() {
super.init();
this.addDirty();
const $tab = this.getTab();
this.#$close_ = $tab.find('.chrome-tab-close');
this.#$close_.addClass('layui-badge-dot layui-bg-blue');
this.setMarkStatus('negative');
this.#editor_.init();
this.#addEventsListener_();
const editor = this.#editor_.getEditor();
@@ -434,22 +431,28 @@ class StatusBarAmpy extends PageBase {
}
setStatus(isChanged) {
if (this.#changed_ === isChanged || !this.#$close_) {
if (this.#changed_ === isChanged) {
return;
}
this.#changed_ = isChanged;
if (isChanged) {
this.#$close_.removeClass('layui-bg-blue');
this.#$close_.addClass('layui-bg-orange');
this.setMarkStatus('positive');
} else {
this.#$close_.removeClass('layui-bg-orange');
this.#$close_.addClass('layui-bg-blue');
this.setMarkStatus('negative');
}
}
dispose() {
this.#$fileTree_ = null;
this.#$editor_ = null;
this.#$openFS_ = null;
this.#$editorEmpty_ = null;
this.#editor_.dispose();
this.#editor_ = null;
this.#fileTree_.dispose();
this.#fileTree_ = null;
this.#drag_.dispose();
this.#drag_ = null;
super.dispose();
}
}

View File

@@ -179,6 +179,13 @@ class Panel extends Component {
dispose() {
this.#$fsSelect_.select2('destroy');
this.#$folderInput_ = null;
this.#$closeBtn_ = null;
this.#$selectFolderBtn_ = null;
this.#$downloadBtn_ = null;
this.#$uploadBtn_ = null;
this.#$fsSelect_ = null;
this.#$progress_ = null;
super.dispose();
}
}
@@ -193,9 +200,8 @@ class StatusBarFS extends PageBase {
}
#$btn_ = null;
#fsBoard_ = null;
#$close_ = null;
#$mask_ = null;
#fsBoard_ = null;
#registry_ = new Registry();
#opened_ = false;
@@ -221,24 +227,20 @@ class StatusBarFS extends PageBase {
init() {
this.addDirty();
const $tab = this.getTab();
this.#$close_ = $tab.find('.chrome-tab-close');
this.#$close_.addClass('layui-badge-dot layui-bg-blue');
this.setMarkStatus('negative');
}
setStatus(isOpened) {
if (this.#opened_ === isOpened || !this.#$close_) {
if (this.#opened_ === isOpened) {
return;
}
this.#opened_ = isOpened;
if (isOpened) {
this.#$mask_.css('display', 'block');
this.#$close_.removeClass('layui-bg-blue');
this.#$close_.addClass('layui-bg-orange');
this.setMarkStatus('positive');
} else {
this.#$mask_.css('display', 'none');
this.#$close_.removeClass('layui-bg-orange');
this.#$close_.addClass('layui-bg-blue');
this.setMarkStatus('negative');
}
}
@@ -310,7 +312,12 @@ class StatusBarFS extends PageBase {
for (let id of this.#registry_.keys()) {
this.#registry_.getItem(id).dispose();
}
this.#$btn_ = null;
this.#$mask_ = null;
this.#fsBoard_.dispose();
this.#fsBoard_ = null;
this.#registry_.reset();
this.#registry_ = null;
super.dispose();
}

View File

@@ -39,7 +39,6 @@ class StatusBarLibs extends PageBase {
}
#manager_ = null;
#$close_ = null;
constructor() {
super();
@@ -56,8 +55,7 @@ class StatusBarLibs extends PageBase {
init() {
this.addDirty();
const $tab = this.getTab();
this.#$close_ = $tab.find('.chrome-tab-close');
this.#$close_.addClass('layui-badge-dot layui-bg-blue');
this.setMarkStatus('negative');
}
getManager() {
@@ -78,6 +76,12 @@ class StatusBarLibs extends PageBase {
this.#manager_.onUnmounted();
super.onUnmounted();
}
dispose() {
this.#manager_.dispose();
this.#manager_ = null;
super.dispose();
}
}
Mixly.StatusBarLibs = StatusBarLibs;

View File

@@ -76,9 +76,6 @@ class StatusBarSerial extends PageBase {
}
}
#$close_ = null;
#opened_ = false;
#valueTemp_ = '';
#$sendInput_ = null;
#$settingMenu_ = null;
#$scroll_ = null;
@@ -86,6 +83,8 @@ class StatusBarSerial extends PageBase {
#$dtr_ = null;
#$rts_ = null;
#$hex_ = null;
#opened_ = false;
#valueTemp_ = '';
#manager_ = null;
#output_ = null;
#chart_ = null;
@@ -98,7 +97,6 @@ class StatusBarSerial extends PageBase {
sendWith: '\r\n',
hex: false
};
#dropdownMenu_ = null;
#addTimestamp_ = false;
#maxLine_ = 200;
#lastUpdate_ = 0;
@@ -444,9 +442,8 @@ class StatusBarSerial extends PageBase {
init() {
super.init();
this.addDirty();
this.setMarkStatus('negative');
const $tab = this.getTab();
this.#$close_ = $tab.find('.chrome-tab-close');
this.#$close_.addClass('layui-badge-dot layui-bg-blue');
this.#port_ = $tab.attr('data-tab-id');
this.#serial_ = new Serial(this.getPortName());
this.#serial_.config(this.#config_).catch(Debug.error);
@@ -513,16 +510,14 @@ class StatusBarSerial extends PageBase {
}
setStatus(isOpened) {
if (this.isOpened() === isOpened || !this.#$close_) {
if (this.isOpened() === isOpened) {
return;
}
this.#opened_ = isOpened;
if (isOpened) {
this.#$close_.removeClass('layui-bg-blue');
this.#$close_.addClass('layui-bg-orange');
this.setMarkStatus('positive');
} else {
this.#$close_.removeClass('layui-bg-orange');
this.#$close_.addClass('layui-bg-blue');
this.setMarkStatus('negative');
}
this.#output_.setStatus(isOpened);
this.#chart_.setStatus(isOpened);
@@ -576,9 +571,17 @@ class StatusBarSerial extends PageBase {
this.#serial_.close()
.catch(Debug.error)
.finally(() => {
this.#$sendInput_ = null;
this.#$settingMenu_ = null;
this.#$scroll_ = null;
this.#$timestamp_ = null;
this.#$dtr_ = null;
this.#$rts_ = null;
this.#$hex_ = null;
this.#output_ = null;
this.#chart_ = null;
this.#manager_.dispose();
this.#manager_ = null;
this.#$close_ = null;
this.#serial_.dispose();
this.#serial_ = null;
super.dispose();

View File

@@ -134,9 +134,9 @@ BU.initBurn = () => {
BU.burnWithSpecialBin();
} else {
if (boardKey.indexOf('micropython:esp32s2') !== -1) {
BU.burnWithAdafruitEsptool(web.burn.binFile);
BU.burnWithAdafruitEsptool(web.burn.binFile, web.burn.erase);
} else {
BU.burnWithEsptool(web.burn.binFile);
BU.burnWithEsptool(web.burn.binFile, web.burn.erase);
}
}
}
@@ -224,7 +224,7 @@ BU.burnByUSB = () => {
});
}
BU.burnWithEsptool = async (binFile) => {
BU.burnWithEsptool = async (binFile, erase) => {
const { mainStatusBarTabs } = Mixly;
let portName = Serial.getSelectedPortName();
if (!portName) {
@@ -324,7 +324,9 @@ BU.burnWithEsptool = async (binFile) => {
}
});
try {
await esploader.eraseFlash();
if (erase) {
await esploader.eraseFlash();
}
await esploader.writeFlash(flashOptions);
layer.msg(Msg.Lang['shell.burnSucc'], { time: 1000 });
statusBarTerminal.addValue(`==${Msg.Lang['shell.burnSucc']}==\n`);
@@ -341,7 +343,7 @@ BU.burnWithEsptool = async (binFile) => {
});
}
BU.burnWithAdafruitEsptool = async (binFile) => {
BU.burnWithAdafruitEsptool = async (binFile, erase) => {
const { mainStatusBarTabs } = Mixly;
let portName = Serial.getSelectedPortName();
if (!portName) {
@@ -425,6 +427,9 @@ BU.burnWithAdafruitEsptool = async (binFile) => {
let cancel = false;
$("#mixly-loader-btn").hide();
try {
if (erase) {
await espStub.eraseFlash();
}
for (let file of data) {
await espStub.flashData(
file.data,

View File

@@ -11,6 +11,14 @@
color: var(--lay-color-white) !important;
}
html[data-bs-theme=light] ul[m-id="{{d.mId}}"] {
border-bottom: 1px solid #c9c9c9;
}
html[data-bs-theme=dark] ul[m-id="{{d.mId}}"] {
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
}
ul[m-id="{{d.mId}}"] button {
position: relative;
overflow: hidden;

View File

@@ -33,6 +33,7 @@ const { PythonShell } = Electron;
Loader.init = () => {
$('body').append(XML.TEMPLATE_STR['INTERFACE']);
$('body').on('contextmenu', (e) => e.preventDefault());
if (goog.isElectron) {
PythonShell.init();
}