Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
chanlee committed Oct 20, 2016
2 parents 21280d1 + 25b9cfa commit f3f70df
Show file tree
Hide file tree
Showing 41 changed files with 25,359 additions and 21,964 deletions.
3 changes: 3 additions & 0 deletions dist/entry.css
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,9 @@ svg .svgBlockGroup text {
.entry-field-dropdown {
cursor: default;
}
.guideGroup {
opacity: 0.3;
}
.entryWorkspaceBlockMenu {
background-color: #e5e5e5;
position: absolute;
Expand Down
35,736 changes: 17,915 additions & 17,821 deletions dist/entry.js

Large diffs are not rendered by default.

2,927 changes: 1,516 additions & 1,411 deletions dist/entry.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions extern/util/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ Lang.Menus = {
"entry_x_hardware": "엔트리 X 하드웨어 교육자료 모음",
"e_sensor": "E 센서보드",
"arduino": "아두이노",
"codestar": "코드스타",
"orange_board": "오렌지보드",
"joystick": "조이스틱 쉴드",
"materials_etc_all": "기타 교육자료 모음",
Expand Down Expand Up @@ -995,6 +996,7 @@ Lang.Menus = {
"orangeBoard": "오렌지 보드",
"robotis_carCont": "로보티즈 로봇자동차",
"robotis_IoT": "로보티즈 IoT",
"codestar": "코드스타",
"about": "알아보기",
"articles": "토론하기",
"gallery": "구경하기",
Expand Down
39 changes: 33 additions & 6 deletions extern/util/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,22 @@ EntryStatic.getAllBlocks = function() {
"CODEino_is_button_pressed",
"CODEino_get_accelerometer_direction",
"CODEino_get_accelerometer_value",
"CODEino_get_number_sensor_value",
//"CODEino_get_number_sensor_value",
"CODEino_get_digital_value",
"CODEino_toggle_led",
"CODEino_toggle_pwm",
//"CODEino_toggle_led",
//"CODEino_toggle_pwm",
"CODEino_convert_scale",
//2016-09-23
"CODEino_get_analog_value",
"CODEino_set_digital_value",
"CODEino_set_pwm_value",
"CODEino_led_by_value",
"CODEino_set_rgb_off",
"CODEino_set__led_by_rgb",
"CODEino_rgb_set_color",
"CODEino_set_rgb_value",
"CODEino_set_rgb_add_value",
//robotis_openCM70
"robotis_openCM70_sensor_value",
"robotis_openCM70_aux_sensor_value",
"robotis_openCM70_cm_buzzer_index",
Expand Down Expand Up @@ -485,13 +496,14 @@ EntryStatic.getAllBlocks = function() {
"ardublock_toggle_pwm",
"ardublock_convert_scale",
// ardublock Added 2016-06-01

"ev3_get_sensor_value",
"ev3_touch_sensor",
"ev3_color_sensor",
"ev3_motor_power",
"ev3_motor_power_on_time",
"ev3_motor_degrees",

"roduino_on_block",
"roduino_off_block",
"roduino_get_analog_value",
Expand All @@ -500,13 +512,28 @@ EntryStatic.getAllBlocks = function() {
"roduino_set_digital",
"roduino_motor",
"roduino_set_color_pin",

"schoolkit_on_block",
"schoolkit_off_block",
"schoolkit_get_input_value",
"schoolkit_set_output",
"schoolkit_motor",
"schoolkit_set_servo_value"
"schoolkit_set_servo_value",

// codestar 2016-09-26
'codestar_color_single',
'codestar_3color',
'codestar_vibration',
'codestar_buzzer',
'codestar_buzzer_stop',
'codestar_drive',
'codestar_wheel',
'codestar_light',
'codestar_button',
'codestar_ir',
'codestar_sonar',
'codestar_mic',
'codestar_temperature'
]
}
]
Expand Down
Binary file added images/hw/codestar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 61 additions & 1 deletion src/blocks/block_arduino.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,73 @@ Entry.joystick = {
name: 'joystick',
setZero: Entry.Arduino.setZero
};

/*
Entry.CODEino = {
name: 'CODEino',
setZero: Entry.Arduino.setZero,
monitorTemplate: Entry.Arduino.monitorTemplate
};
*/
Entry.CODEino = {
name: 'CODEino',
getSensorKey: function () {
return "xxxxxxxx".replace(/[xy]/g, function(f) {
var e = Math.random() * 16 | 0, d = f == "x" ? e : (e & 0 * 3 | 0 * 8);
return d.toString(16)
}).toUpperCase()
},
getSensorTime: function (type) {
return new Date().getTime() + type;
},
monitorTemplate: Entry.Arduino.monitorTemplate,
setZero: function () {
if(!Entry.hw.sendQueue.SET) {
Entry.hw.sendQueue = {
SET: {
'0': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'1': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'2': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'3': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'4': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'5': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'6': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'7': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'8': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'9': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'10': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'11': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'12': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 },
'13': { type: Entry.CODEino.sensorTypes.DIGITAL, data: 0 }
},
TIME: Entry.CODEino.getSensorTime(Entry.CODEino.sensorTypes.DIGITAL),
KEY: Entry.CODEino.getSensorKey()
}
} else {
var keySet = Object.keys(Entry.hw.sendQueue.SET);
keySet.forEach(function (key) {
Entry.hw.sendQueue.SET[key].data = 0;
Entry.hw.sendQueue.TIME = Entry.CODEino.getSensorTime(Entry.hw.sendQueue.SET[key].type);
Entry.hw.sendQueue.KEY = Entry.CODEino.getSensorKey();
});
}
Entry.hw.update();
},
sensorTypes: {
ALIVE: 0,
DIGITAL: 1,
ANALOG: 2,
PWM: 3,
RGBLED_PIN: 4,
TONE: 5,
PULSEIN: 6,
ULTRASONIC: 7,
TIMER: 8,
ADDCOLOR: 9
},
BlockState: {
}
};

Blockly.Blocks.arduino_text = {
init: function() {
Expand Down
42 changes: 42 additions & 0 deletions src/blocks/block_codestar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"use strict";

Entry.Codestar = {
name: 'codestar',
setZero: function() {
Entry.hw.sendQueue.readablePorts = [];
for (var port = 0; port < 20; port++) {
Entry.hw.sendQueue[port] = 0;
Entry.hw.sendQueue.readablePorts.push(port);
}
Entry.hw.update();
},
monitorTemplate: {
imgPath: 'hw/codestar.png',
width: 333,
height: 409,
listPorts: {
'13':{name: '진동모터', type: 'output', pos: {x: 0, y: 0}},
'6':{name: '진동센서', type: 'input', pos: {x: 0, y: 0}},
},
ports: {
'7':{name: '빨간색', type: 'output', pos: {x: 238, y: 108}},
'8':{name: '파란색', type: 'output', pos: {x: 265, y: 126}},
'9':{name: '3색 빨간색', type: 'output', pos: {x: 292, y: 34}},
'10':{name: '3색 녹색', type: 'output', pos: {x: 292, y: 34}},
'11':{name: '3색 파란색', type: 'output', pos: {x: 292, y: 34}},
'12':{name: '버튼', type: 'input', pos: {x: 248, y: 142}},
'a0':{name: '왼쪽 벽감지', type: 'input', pos: {x: 24, y: 231}},
'a2':{name: '마이크', type: 'input', pos: {x: 225, y: 67}},
'a3':{name: '부저', type: 'output', pos: {x: 283, y: 105}},
'a4':{name: '왼쪽 라인감지', type: 'input', pos: {x: 37, y: 353}},
'a5':{name: '오른쪽 라인감지', type: 'input', pos: {x: 50, y: 368}},
'a6':{name: '조도센서', type: 'input', pos: {x : 273, y: 22}},
'a7':{name: '오른쪽 벽감지', type: 'input', pos: {x: 103, y: 381}},
'temperature':{name: '온도센서', type: 'input', pos: {x: 311, y: 238}},
'sonar':{name: '초음파', type: 'input', pos: {x: 7, y: 277}},
'leftwheel':{name: '왼쪽 바퀴', type: 'output', pos: {x: 177, y: 370}},
'rightwheel':{name: '오른쪽 바퀴', type: 'output', pos: {x: 83, y: 218}},
},
mode: 'both'
}
};
24 changes: 7 additions & 17 deletions src/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,29 +341,19 @@ Entry.Container.prototype.removeObject = function(object) {
index
);
}
var state = new Entry.State(
this.addObject,
objectJSON,
index
);
var state =
new Entry.State(this.addObject, objectJSON, index);

object.destroy();
this.objects_.splice(index, 1);
this.setCurrentObjects();
Entry.stage.sortZorder();
var currentObjects = this.getCurrentObjects();

if (this.objects_.length && index !== 0) {
// Entry.container.selectObject(this.objects_[index -1].id);
var currentObjects_ = this.getCurrentObjects();
if(currentObjects_.length > 0) {
Entry.container.selectObject(this.getCurrentObjects()[0].id);
} else {
Entry.container.selectObject();
}
}
else if (this.objects_.length && index === 0)
Entry.container.selectObject(this.getCurrentObjects()[0].id);
if (currentObjects.length)
this.selectObject(currentObjects[0].id);
else {
Entry.container.selectObject();
this.selectObject();
Entry.playground.flushPlayground();
}

Expand Down
7 changes: 5 additions & 2 deletions src/core/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ goog.provide('Entry.SVG');
* @param {string} tag or html to construct dom element.
* @param {?object} options include id, classes, parent etc.
*/
Entry.SVG = function (id) {
var element = document.getElementById(id);
Entry.SVG = function (id , svgDom) {
var element = svgDom ? svgDom : document.getElementById(id);
return Entry.SVG.createElement(element);
};

Expand Down Expand Up @@ -51,6 +51,9 @@ Entry.SVG.createElement = function (tag, options) {
el.remove = Entry.SVG.remove;
el.removeAttr = Entry.SVG.removeAttr;

if (tag === "text")
el.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");

return el;
};

Expand Down
3 changes: 3 additions & 0 deletions src/css/components/block.less
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,6 @@ svg .svgBlockGroup text {
cursor: default;
}

.guideGroup {
opacity: 0.3;
}
Loading

0 comments on commit f3f70df

Please sign in to comment.