-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bugfix/v4.0.0_alpha5_test' into 4.0-flash-github
* bugfix/v4.0.0_alpha5_test: (98 commits) flash打开了arduino模式,菜单需勾选 点击帽子,由js去调用flash接口,flash不再自己改变状态 点击帽子语句块进入Arduino时发送指令通知js勾选菜单 fix 非机器人模块的帽子语句块点击会打开Arduino模式 fix 【上传Arduino】与编码电机有关的语句块上传Arduino失败 fix mbot主板切换不了的问题,原因是新旧版本的mbot命名不统一 打开保存文件时,选择主控板兼容之前保存的文件 将参数修改形式 兼容以前保存的文件 修改提供给flash的接口 优化 选择主控板相关代码 添加不支持的端口弹框提示 修改函数名 给flash提供设置当前的主控板的接口 回退固件版本,更新swf loading_panda.png loading 【上传到Arduino】上传到Arduino过程中,按钮依然可以Cloes 校正arduino log时间格式 修复翻译问题 下拉控件在角色面板上有问题,把小部分功能回退 ... Conflicts: ReadMe.md
- Loading branch information
Showing
101 changed files
with
7,189 additions
and
27,418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
*.actionScriptProperties | ||
/bin-debug | ||
/bin-release | ||
/bin-release-temp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Created by kun on 2/13/17. | ||
* 保存用户配置 | ||
*/ | ||
const fs = require("fs"); | ||
const path = require('path'); | ||
|
||
var _this, _dir, _file; | ||
var Configuration = function () { | ||
_this = this; | ||
_dir = path.join(__root_path, "/../mblock-setting"); | ||
_file = path.resolve(_dir, 'settings.json'); | ||
|
||
this.read = function () { | ||
if (!fs.existsSync(_file)) { | ||
return {}; | ||
} | ||
var res = JSON.parse(fs.readFileSync(_file)); | ||
if (!res) return {}; | ||
return res; | ||
} | ||
|
||
this.get = function (name) { | ||
var result = _this.read(); | ||
return result[name]; | ||
} | ||
|
||
this.mkdirsSync = function(dirpath) { | ||
if (!fs.existsSync(dirpath)) { | ||
var pathtmp; | ||
dirpath.split(path.sep).forEach(function(dirname) { | ||
if (pathtmp) { | ||
pathtmp = path.join(pathtmp, dirname); | ||
} else { | ||
pathtmp = dirname; | ||
} | ||
if ('' === pathtmp) { | ||
pathtmp = '/'; | ||
return; | ||
} | ||
|
||
if (!fs.existsSync(pathtmp)) { | ||
if (!fs.mkdirSync(pathtmp)) { | ||
return false; | ||
} | ||
} | ||
}); | ||
} | ||
return true; | ||
} | ||
|
||
this.set = function (name, value) { | ||
var result = _this.read(); | ||
result[name] = value; | ||
if (!_this.mkdirsSync(_dir)) { | ||
return; | ||
} | ||
fs.writeFile(_file, JSON.stringify(result), function (err) { | ||
if (err) return; | ||
console.log(_file + ' is saved!'); | ||
}); | ||
} | ||
} | ||
module.exports = Configuration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.