目 次 目 次... 2 第 一 章 とにかく 使 ってみる... 3 フレームワーク... 3 Kadecot のインストール... 4 Kadeckly から Kadecot への 接 続 とプログラムの 実 行... 6 ファイル 入 出 力... 8 第 二 章 ブロックリファレンスとサンプ



Similar documents
V-T500

Netcommunity SYSTEM WEBアドレス帳ボックス 取扱説明書

2

JA

2

ScanFront300/300P セットアップガイド

まなビューア 使用許諾書

ScanFront 220/220P 取扱説明書

ScanFront 220/220P セットアップガイド

ContentDistributor for FlashAir

Cloud Audio Recorder for MOTIF XF マニュアル

Cloud Audio Recorder マニュアル

エレクトーンのお客様向けiPhone/iPad接続マニュアル

ご利用にあたって サイボウズ Office 新着通知 for Android には 製品の改善および向上のため 本ソフトウェアがクラッシュした場合のログの送信を行う機能を搭載しております クラッシュログ等の情報は 収集 解析に必要な範囲においてサイボウズグループ内で利用することがあります また サイ

インターネット接続ガイド v110

MusicSoft Manager

2

Windows での 設 定 ソフトウェアの 起 動 Technics Audio Player にインストーラは ありません ダウンロードした 自 己 解 凍 ファイルを 展 開 したフォ ルダ 内 にある TechnicsAudioPlayer.exe ファイルを 実 行 してください 展 開

Chapter

iPhone/iPad接続マニュアル

WYE771W取扱説明書

JavaScriptライブラリユーザーズガイド

サイボウズ 株 式 会 社 使 用 許 諾 契 約 書 サイボウズ 株 式 会 社 ( 以 下 サイボウズ といいます )の 上 記 のソフトウェア( 以 下 本 ソフトウェア といいます )を 使 用 されようとしている 法 人 団 体 のみな さま( 以 下 お 客 様 といいます )へのご 注


より 高 音 質 で 再 生 する(Macの 場 合 ) [11] プレイリスト 作 成 / 編 集 プレイリストを 新 規 作 成 する [12] プレイリストを 保 存 する [13] プレイリストを 編 集 する [14] お 知 らせ 仕 様 必 要 なシステム 環 境 [15] 対 応 フ

NetVehicle GX5取扱説明書 基本編

Windows での設定 ソフトウェアの起動 Technics Audio Player にインストーラは ありません ダウンロードした自己解凍ファイルを展開したフォルダ内にある TechnicsAudioPlayer.exe ファイルを実行してください 展開したフォルダは デスクトップなどの任意の

2

2

TH-47LFX60 / TH-47LFX6N


プレイバックメニューを使う [9] より高音質で再生する (Windows の場合 ) [10] より高音質で再生する (Mac の場合 ) [11] プレイリスト作成 / 編集 プレイリストを新規作成する [12] プレイリストを保存する [13] プレイリストを編集する [14] お知らせ 仕様

DDK-7 取扱説明書 v1.10

DS-860

準備と設定

準備と設定

準備と設定

DS-30


License


My Music Recorder マニュアル

Readme


TH-80LF50J TH-70LF50J

ES-D400/ES-D200


ES-D400/ES-D350

IM 21B04C50-01


試用版ソフトウェア説明書

PX-403A

DS-70000/DS-60000/DS-50000






EPSON ES-D200 パソコンでのスキャンガイド

EPSON PX-503A ユーザーズガイド

GT-F740/GT-S640

PX-504A

GT-X980

PX-434A/PX-404A

1.indd

GT-X830

BRA1209A_Ja_001_009.p65

EPSON EP-803A/EP-803AW ユーザーズガイド

EPSON EP-703A ユーザーズガイド

EP-704A

PX-673F

スライド 1

内線プラス クライアントソフトB (ユーザ編) Android版 V1

外部SQLソース入門

Operating Instructions

PX-B750F

DS-510

基本操作ガイド

LWN-A54APS 設定ガイド

操作ガイド(本体操作編)

ルームエアコン



目 次 1. Web メールのご 利 用 について Web メール 画 面 のフロー 図 Web メールへのアクセス ログイン 画 面 ログイン 後 (メール 一 覧 画 面 ) 画 面 共 通 項 目

操作ガイド(本体操作編)

WEB保守パック申込

 

設定フロー ★印は必須の設定です

<4D F736F F D208F5A91EE8CFC82AF E C815B835E B B837D836A B>

4.5. < 参 加 表 明 書 を 提 出 する> 調 達 案 件 一 覧 の 表 示 対 象 となる 案 件 を 検 索 し 調 達 案 件 一 覧 に 表 示 させます 参 加 したい 案 件 の 調 達 案 件 名 称 行 - 入 札 参 加 資 格 確 認 申 請 / 技 術 資 料 /

WebReportCafe

Microsoft Word - LaCie Manual_JA080719doc.doc

PowerPoint プレゼンテーション

2 課 題 管 理 ( 科 学 研 究 費 補 助 金 ) 画 面 が 表 示 されます 補 助 事 業 期 間 終 了 後 欄 の[ 入 力 ] をクリックします [ 入 力 ]ボタンが 表 示 されていない 場 合 には 所 属 する 研 究 機 関 の 事 務 局 等 へお 問 い 合 わせく

Untitled

Microsoft Word - 参考資料:SCC_IPsec_win8__リモート設定手順書_

PowerPoint プレゼンテーション

変 更 履 歴 日 付 Document ver. 変 更 箇 所 変 更 内 容 2015/3/ 新 規 追 加 2015/9/24 誤 字 修 正 2016/2/ 動 作 環 境 最 新 のものへ 変 更 全 体 オペレーター の 表 記 を 削 除 2016/5/

REDCap_EULA_FAQ

基本操作ガイド

Transcription:

Kadeckly / KAIT-4S -Canvas- ドキュメンテーション 2014 年 12 月 26 日 株 式 会 社 ソニーコンピュータサイエンス 研 究 所 本 文 書 では 神 奈 川 工 科 大 学 HEMS 認 証 センターからの 委 託 を 受 けて 株 式 会 社 ソニーコンピュータサイエンス 研 究 所 で 開 発 された Kadeckly / KAIT-4S -Canvas- ( 以 下 Kadeckly と 呼 称 )の 使 い 方 やインストール 方 法 などを 記 しています 本 アプリは HTML5 によって 記 述 された Web アプリであり 動 作 させるためには Apache などの Web サーバ 配 下 に 設 置 し PC などのブラウザで 読 みこんで 実 行 される 必 要 があります また 宅 内 機 器 やセンサーにアクセスするために Google Play から 公 開 されている Android アプリ Kadecot が 必 要 です 全 体 のアーキテクチャ また Twitter や Google カレンダーの 機 能 を 用 いる 場 合 は API Key の 上 限 が 各 事 業 主 によって 定 められていますのでご 注 意 ください (2014 年 11 月 現 在 Twitter は 15 回 /15 分 Google カレンダーは 10 万 回 / 日 です 前 者 は1ユーザー 当 たりの 制 限 後 者 は 全 ユーザーの 総 和 の 制 限 です) ご 了 承 ください

目 次 目 次... 2 第 一 章 とにかく 使 ってみる... 3 フレームワーク... 3 Kadecot のインストール... 4 Kadeckly から Kadecot への 接 続 とプログラムの 実 行... 6 ファイル 入 出 力... 8 第 二 章 ブロックリファレンスとサンプルコード... 9 機 器 ブロック... 9 ECHONET Lite 定 数 ブロック... 10 ECHONET Lite 値 変 換 ブロック... 12 Wait ブロック... 13 条 件 ブロック... 14 天 気 ブロック... 14 Twitter ブロック... 15 Google Calendar ブロック... 16 サンプルプログラム 集... 16 第 三 章 自 分 の Web サーバへのインストール 方 法... 18 Web サーバへのファイルの 展 開... 18 Twitter ブロックの 設 定... 18 Google Calendar ブロックの 設 定... 20 天 気 ブロックの 設 定... 23 Appendix... 24 Kadeckly で 使 っているオープンソース... 24 Blockly... 24 jquery/jquery UI... 26 TwitterOAuth... 26

第 一 章 とにかく 使 ってみる 本 アプリが http://app.kadecot.net/apps/kadeckly/ に 設 置 されています 実 験 目 的 にのみアクセスしてください まずはこれを 使 ってエアコンを ON するプログラム を 書 いてみましょう フレームワーク 上 記 URL にアクセスすると 以 下 のような 起 動 画 面 が 現 れます この 画 面 で これから 作 るプログラムで 用 いる 機 器 の 種 類 と 数 を 設 定 します 例 え ば 照 明 2つとエアコン1 台 を 使 うプログラムを 作 りたかったら GeneralLighting の 行 と HomeAirConditioner の 行 を 探 し 次 のようにチェックを 入 れ 機 器 の 数 を 指 定 し てください

そうしたら 下 の 方 に 表 示 されている Create New Project ボタンを 押 してください プログラムのエディット 画 面 が 現 れます 基 本 的 な 操 作 は 左 側 に 並 んでいるブロックを 右 側 の 白 い 領 域 にドラッグして 相 互 につなげてプログラムを 作 っていくというものです 試 しにエアコンを ON するプログ ラムを 書 いてみましょう 左 側 からブロックをドラッグして 次 のようなプログラムを 作 ってみてください このように Kadeckly では 右 のブロックから 出 力 されるものを 左 のブロックに 入 力 す るのが 基 本 です これだけでプログラミングが 完 了 です! 次 は 早 速 これを 動 かしてみましょう! Kadecot のインストール まず プログラムの 実 行 には Android アプリの Kadecot が 必 要 なので お 手 持 ちの Android に Google Play から Kadecot をインストールします https://play.google.com/store/apps/details?id=com.sonycsl.kadecot EULA にご 同 意 いただき チュートリアルをご 覧 いただいた 上 で Kadecot のアカ ウントを 設 定 してください 名 前 もパスワードも 個 性 的 なものにしてください

アカウント 設 定 が 完 了 すると デバイス 一 覧 画 面 になります 画 面 下 の SERVER OFF というボタンをタッチして ON にし Wi-Fi に 接 続 すると 対 応 機 器 が 機 器 発 見 さ れます 所 望 の 機 器 が 見 つからない 場 合 は 左 下 の Refresh ボタンを 押 してください もし ECHONET Lite 対 応 機 器 をお 持 ちでない 場 合 は SonyCSL から フリーのエミュレータ(PC 用 )も 配 布 されていますので よろしければお 試 しく ださい 機 器 が 見 つかったら Kadecot が 実 行 されている Android の IP アドレスを 調 べて おいてください IP アドレスは 通 知 領 域 を 引 き 出 せば 見 られますし Kadecot の 設 定 画 面 から 一 番 上 の 開 発 者 モードを 有 効 にする にチェックを 入 れると そのすぐ 下 や 機 器 一 覧 画 面 で 見 られるようになります 今 は 192.168.10.202 のようですね

Kadeckly から Kadecot への 接 続 とプログラムの 実 行 Kadeckly に 戻 り 右 上 の Run ボタンを 押 すことでプログラムの 実 行 ダイアログ が 開 きます IP アドレスを 入 力 するところがあるので ここに 先 程 の Kadecot の IP アドレスを 入 力 し 右 側 の Set を 押 してください もしうまくKadecot につながれば 一 旦 Kadecotの 認 証 画 面 に 遷 移 します これは app.kadecot.net に 対 して Kadecot へのアクセスを 許 可 するためのものです Kadecot インストール 時 に 指 定 したパスワードを 入 力 して 送 信 を 押 してください すると エディット 画 面 に 戻 ります

ここで もう 一 度 Run を 押 します この 作 業 は 一 度 行 えばブラウザに 情 報 が 残 り 次 回 からはスキップされます 以 下 のように 表 が 挿 入 されているはずです この 表 は これまでプログラムしてきた 仮 想 的 な 機 器 を 宅 内 に 実 在 する 機 器 と 対 応 付 けるためのものです 左 側 はプログラミングに 用 いた 仮 想 的 な 機 器 右 側 は 実 在 の 機 器 です 例 えば HomeAirConditioner1 の 右 のドロップダウンリストの 内 訳 をみると エアコンが 二 つ 表 示 されています このエアコンは 実 際 に Kadecot が 認 識 しているエ アコンで Kadecot で 設 定 したニックネームが 表 示 されています ドロップダウンリス トで 選 んだ 方 が 実 際 にプログラムからの 制 御 対 象 となります 割 り 当 てが 完 了 したら あとは 実 行 するだけです ダイアログ 右 下 の Run once または Run interval を 押 すことで 実 行 が 始 まります エアコンの 電 源 が 入 りました か?

なお Run once は 一 回 のみ 実 行 します Run interval は Stop を 押 すまで 数 秒 お きに 何 度 も 繰 り 返 し 実 行 します ファイル 入 出 力 作 ったプログラムはファイルとして 保 存 することができます (Chrome と Firefox でのみ 動 作 確 認 しています) それには メインの 画 面 右 上 の Open File と Export File ボタンを 用 います Export File を 押 すと ローカル 環 境 にプログラムをファイルとしてダウンロードすることがで きます Firefox の 場 合 には 拡 張 子 すらないランダムなファイル 名 になるので[ファイル 名 ].kadeckly という 名 前 に 変 更 しておくとよいと 思 います Chrome の 場 合 は 自 動 的 に blocks.kadeckly という 名 前 で 保 存 されてしまうので こちらは 拡 張 子 は 維 持 して フ ァイル 名 のみプログラムの 内 容 を 反 映 したものに 変 更 するとよいと 思 います ダウンロードしたファイルは あとで 他 の 環 境 で Open File ボタンから 読 み 込 ませ ることができます 実 機 器 構 成 が 異 なれば 機 器 の 割 り 当 ても 異 なってくるので 実 行 時 にはまた 機 器 の 対 応 を 指 定 する 必 要 があります

第 二 章 ブロックリファレンスとサンプルコード さて 第 一 章 ではいきなりエアコンの 電 源 を 操 作 してみました 本 章 ではそこで 使 わなかったブロックも 含 め Kadeckly に 入 っている 様 々なブロックの 説 明 を 行 います とは 言 え 以 下 イメージしやすくするため 一 章 で 作 ったサンプル 画 面 をもう 一 度 見 てみ ましょう 機 器 ブロック 上 の 方 にある4 枚 の 黄 緑 色 のブロックは 機 器 ブロックと 言 って 今 回 の 例 では 最 初 に 指 定 した 照 明 とエアコンを 表 現 するブロックになります 入 力 用 と 出 力 用 に2 枚 づつあり 微 妙 に 形 状 と 色 合 いが 違 うことに 注 意 してくださ い ( 上 段 が 出 力 用 下 段 が 入 力 用 ) それぞれ No.1 と 書 かれており 1 の 部 分 がドロップダウンになっています これは 最 初 に 複 数 存 在 すると 設 定 した 機 器 ( 一 章 の 例 では 照 明 が2つあることとしていました) に それらを 区 別 するためのものです GeneralLighting の 方 は1 台 目 か2 台 目 かを 選

べますが HomeAirConditioner は1つしかないことにしていたので 今 回 は 選 択 の 余 地 はありません その 右 にある 電 源 というドロップダウンリストは 機 器 が 持 つ 個 別 の 機 能 (プ ロパティ) を 表 しています ECHONET Lite ではこの 機 能 を EPC という 数 値 で 表 していますが これでは わかりづらいので 名 前 で 特 定 できるようにしているわけです と 言 っても ECHONET Lite で 規 格 化 されている 機 能 は 膨 大 であり 現 在 の Kadeckly では 主 要 な 機 器 の 主 要 な プロパティのみ 名 前 で 表 示 されるようになっています ここに 望 みの 名 前 がない 場 合 は Others を 選 び 新 しく 表 れるテキスト 領 域 に EPC を 直 接 数 値 で 指 定 しなければなりま せん EPC については ECHONET Lite の 規 格 書 から APPENDIX ECHONET 機 器 オ ブジェクト 詳 細 規 定 を 参 照 してください ECHONET Lite 定 数 ブロック 紫 のブロックは ECHONET Lite ブロックというもので ECHONET Lite 対 応 機 器 ブロックを 使 いやすくするためのものです 現 在 の 例 では4 種 類 のブロックが 表 示 さ

れています 最 初 の 二 つ エアコン 設 定 値 一 般 照 明 設 定 値 と 表 示 されているブロ ックは 定 数 ブロック と 呼 び 機 器 特 有 の(ここではエアコンと 一 般 照 明 )の 機 能 について 定 数 値 を 出 力 するためのものです ECHONET Lite では 機 器 の 機 能 を EPC という 数 値 で 表 していると 述 べました が そこに 設 定 されている 値 の 方 も EDT という 数 値 の 配 列 で 特 定 するのであまり わかりやすくありません よく 使 うものだけはこのブロックに 定 義 されているので 簡 単 に 名 前 で 扱 えるようにしているわけです 結 果 として 照 明 の2 番 とエアコン(の1 番 )の 電 源 を ON にする というプログ ラムは 次 のようになります

ECHONET Lite 値 変 換 ブロック 今 回 の 例 において 紫 の 残 りの2 枚 のブロックは ECHONET Lite の 値 全 般 につ いて 扱 いやすくするためのものです Kadeckly では やりとりされる 情 報 は 内 部 的 に 8ビットの 数 値 の 配 列 を 文 字 列 化 したものになっています この 値 を 直 接 指 定 して 作 り 出 すのが 次 のブロックです このブロックは 主 に 先 程 の エアコン 設 定 値 のような ECHONET Lite 定 数 ブ ロックに 所 望 の 値 が 含 まれていないときに 用 います 例 えば フルカラー 照 明 に 色 を 付 けたいとき その 色 を 指 定 する 値 ブロックは 現 状 では 存 在 しません 所 望 の 色 を 表 す 配 列 を 自 分 で 作 る 必 要 があります 赤 い 色 は RGB で[255,0,0]と 表 せるので 次 のように 書 けば 赤 を 表 す ECHONET Lite の 値 を 作 ることができます 値 は 10 進 数 または 0x を 頭 につけた 16 進 数 をカンマ 区 切 りで 並 べることで 指 定 してください なお これを 受 け 取 る 側 である 照 明 の 方 も 色 の 設 定 対 象 となるような 名 前 付 きの 機 能 はまだありませんので 機 能 を others に 設 定 の 上 値 を 16 進 数 で 直 接 指 定 し ます 色 を 指 定 する 機 能 に 対 応 する EPC は 0xC0 です 結 局 フルカラー 照 明 の 色 を 赤 に 設 定 するプログラムは 次 のようになります さて 先 程 ECHONET Lite の 情 報 は 配 列 を 文 字 列 化 したものだと 述 べました こ の 情 報 をまとめて 一 つの 整 数 値 に 変 換 して 出 力 するのが2 枚 目 のブロックです

これは 配 列 をまとめて 一 つの 値 にして 出 力 します 配 列 は 上 の 桁 から 先 に 並 ぶ ビッグエンディアンだと 解 釈 されます 例 えば 以 下 のプログラムは 0xFF0000 すなわち 10 進 数 で 16711680 を 表 示 します ( 表 示 します パネルは alert を 呼 び 出 します Wait ブロック 赤 茶 色 の Wait ブロックは 機 器 操 作 コマンドの 間 に 待 ち 時 間 を 挿 入 するというもの です 例 えば 以 下 のプログラムは 3.5 秒 間 だけ 照 明 を ON にするというプログラムに なります (ブロックを 縦 に 並 べると 順 々に 実 行 されます) Wait ブロックはその 中 に 含 まれるコマンドを 遅 らせることができますが 外 側 では 遅 延 は 発 生 しないので 次 の 例 ではまず 1 3 が 表 示 された 後 しばらくしてか ら2が 表 示 されることになります また 待 ち 時 間 の 設 定 は 1ms 単 位 で(つまり 0.001 秒 単 位 で) 行 うことができます が あまり 厳 密 に 実 行 されるものでもないことにもご 了 承 ください これはメッセージ 送 信 が 一 般 には 時 間 がかかる 機 器 との 送 受 信 と 歩 調 を 合 わせながら 行 われるためです

条 件 ブロック 条 件 も 設 定 することができます 例 えばエアコンのモードが 冷 房 のときは 温 度 を 28 に 暖 房 の 時 は 18 にするプログラムを 書 いてみます これには もし~して ください というブロックと 真 ん 中 に=が 書 かれた 比 較 用 のブロックを 用 います これを 使 うと さきのプログラムはこのように 実 現 されます このように もし~してください というブロックは 条 件 を 入 力 とし それが 満 たされているときは してください の 右 側 を 実 行 します 上 のまとまりは 冷 房 の 時 に 28 設 定 とするもので 下 のまとまりは 暖 房 の 時 に 18 設 定 にするというもので す 天 気 ブロック Kadeckly の 画 面 右 上 のブロックのうち Set Location というボタンを 押 すと Kadeckly はブ ラウザから 緯 度 経 度 の 情 報 を 取 得 し OpenWeatherMap という API を 用 いて 宅 外 環 境 情 報 を 取 得 するようになります この 機 能 を 実 現 す るのは Weather というブロックです 位 置 情 報 を 取 得 したときのみ 現 れます 出 力 専 用 です これを 使 うと 暑 いときに 自 動 的 にエアコンを つけるようなプログラムを 書 くことができます

このように 順 々にメッセージを 送 りますが 白 物 家 電 機 器 のネットワーク 機 能 は 比 較 的 非 力 なことが 多 いので このようにコマンドを 続 けて 送 る 場 合 は 途 中 に Wait を 挟 んだ 方 がよいかもしれません Twitter ブロック Login Twitter ボタンを 押 すと Twitter のログイン 画 面 が 出 ます ログインすると Twitter ブロックが 出 現 します これは ログインしたアカウントでダイレ クトメッセージを 受 け 取 ると その 中 に 設 定 した 文 字 列 が 入 っていたらトリガーを 出 すと いうものです これをつかうと 例 えば 宅 外 にいて Twitter に DM を 送 ることで 照 明 と エアコンをコントロールするようなことがで きます 以 下 は つけて という 言 葉 が 含 まれるメッセージを 受 信 すると 照 明 とエアコン が ON になり けして というメッセージが 来 ると 両 方 OFF になるというものです

Google Calendar ブロック Login GCalendar ボタンを 押 すと Google のログイン 画 面 が 出 ます ログイン すると カレンダー 用 のブロックが 現 れます このカレンダーブロックは 指 定 した Google カレンダーの 予 定 情 報 を 取 得 し 実 行 時 間 になった 時 にその 予 定 のタイトルに 特 定 の 文 字 列 が 含 まれていたらトリガーを 出 すというブロックです これを 用 いることで 例 えば 目 覚 ましプ ログラムを 簡 単 に 書 くことができます 以 下 の 例 は スケジュール/WorkLog という 名 前 のカレンダーに 起 きる という 文 字 列 が 含 まれたスケジュールがあり Kadeckly の 実 行 中 にその 時 間 になったとする と 照 明 とエアコンを ON にするというプログラムになります サンプルプログラム 集 ここまでの 知 識 で 様 々なプログラムを 作 成 できますが 使 っているうちにいろいろと 疑 問 点 も 出 てくるかもしれません ここではちょっとトリッキーな 例 も 含 めて 様 々な 使 い 方 をお 見 せしたいと 思 います エアコンをつけると 照 明 も 自 動 的 につき エアコンを 消 すと 照 明 も 自 動 的 に 消 えると いうものです 照 明 の 電 源 とエアコンの 電 源 の 形 式 が 実 は 同 じであることを 利 用 して います

鍵 が 閉 まったらブラインドを 閉 める 実 際 には 鍵 はほとんど 常 に 施 錠 されているので 実 用 性 は 低 いかもしれません 条 件 はなにがしか 他 の 在 宅 状 況 を 示 す 値 がよいかと 思 われます 気 温 が 28 を 超 えたら 28 設 定 で 冷 房 をつける 温 度 は 0.1 単 位 の 整 数 なので そのまま 整 数 にすると 28 =280 となります コマンドを 続 けて 送 る 場 合 は 途 中 に Wait を 挟 んだ 方 がよい 場 合 もあります

第 三 章 自 分 の Web サーバへのインストール 方 法 本 章 では Kadeckly を 新 たな Web サーバにインストールするときに 必 要 な 設 定 につ いて 解 説 します 主 に 外 部 WebAPI ブロックの API キー 設 定 が 必 要 になります これ らは API 提 供 者 の 都 合 によりいつでも 変 更 の 可 能 性 があります Web サーバへのファイルの 展 開 まず Kadeckly.zip をどこかの Web サーバの htdocs (Apache の 場 合 )に 展 開 しま す これを http アクセスした 場 合 の URL を ここでは 仮 に http://tinpu.info/visualkadecot/とします (tinpu.info は 今 は 存 在 しないテスト 用 のサ ーバであり VisualKadecot とは Kadeckly / KAIT-4S -Canvas- の 開 発 中 コードネー ムです) Twitter ブロックの 設 定 Kadeckly から Twitter 機 能 を 使 うには Twitter アプリの 登 録 と そのキー 情 報 を Kadeckly のファイル 内 に 張 り 付 けることが 必 要 です それには まず https://dev.twitter.com にアクセスしてください 右 上 の Sign in からログインします (アカウントがなければ 作 ってください) そしてまた 元 の 画 面 に 戻 ってください 右 下 の 方 に Manage Your Apps というリン クがあるのでクリックします

アプリ 一 覧 が 出 るので 右 上 の Create New App をクリックします ( 図 の 中 にある Moekaden Ogiri DB updater というのは 他 のアプリなので 気 にしないでくださ い) アプリの 情 報 を 入 力 する 画 面 が 出 るので http://tinpu.info/visualkadecot をベー スに 埋 めていってください 重 要 なのは Callback URL なので ここには 必 ずアプリの URL http://tinpu.info/visualkadecot/index.html と 入 れて 下 さい 入 れ 終 わったらページ 一 番 下 の Yes, I agree にチェックを 入 れて 一 番 下 の Create your Twitter application ボタンを 押 してください 次 に 出 る 画 面 で このアプリの 権 限 を 拡 大 しておく 必 要 があります(ダイレクトメ ッセージを 読 み 取 るため) Application Settings Access Level から modify app permission を 押 します

Access を Read, Write and Access direct messages を 選 び ページ 下 の Update Settings をクリックしてください 次 に Keys and Access Tokens のタブをクリック します ここに 表 示 される Consumer Key と Consumer Secret が 重 要 です これを 先 程 http://tinpu.info/visualkadecot の 下 に 展 開 したファイルのうち /settings.php の 中 に 書 き 込 みます <?php $twitter_consumer_key = '[Please input your twitter consumer key]'; $twitter_consumer_secret = '[Please input your twitter consumer secret]';?> の 文 字 列 をキー 文 字 列 に 書 き 換 えてください ( 角 括 弧 も 消 してください) これで Twitter の 設 定 は 終 了 です ブラウザで 開 いている Kadeckly の Login Twitter ボタンを 押 したときに 一 章 で 説 明 したような Twitter へのログイン 画 面 が 出 て Kadeckly に 戻 ってきたときに Twitter ブロックが 出 現 するかどうかご 確 認 ください Google Calendar ブロックの 設 定 まず https://code.google.com/apis/console/にアクセスします

お 手 持 ちの Google アカウント でログインします すると このような 画 面 になる ので 左 の APIs&auth から APIs を 選 びます どの API を ON にするか 設 定 す る 画 面 になるので Calendar API を 探 して ON にします

選 ばれたものは 画 面 の 上 の 方 に 移 動 します 次 は キーを 生 成 します 左 のメニューから APIs & auth Credentials を 選 ぶと Public API access のところに API KEY が 表 示 されているので これをど こかにコピーしておきます 次 に アプリの 登 録 を 行 いま す 画 面 上 の 方 の Create new Client ID をクリックすると 確 認 が 出 るので Configure consent screen を 押 します アプリの URL http://tinpu.info/visualkade cot/index.html をベースに 適 当 に 埋 めていきます ページ 一 番 下 の Save を 押 します

すると Client ID の 発 行 のため の 情 報 を 入 力 する 画 面 になります 上 のラジオボタンは Web application AUTHORIZED JAVASCRIPT ORIGINS は http://tinpu.info AUTHORIZED REDIRECT URLS は http://tinpu.info/visualkadecot/i ndex.html としてください 最 後 にページ 下 の Create Client ID ボタンを 押 します する と Client ID が 生 成 されます この Client ID と 先 程 の API KEY は Web 上 の Kadeckly 内 の settings.js の 中 に 書 き 込 みます こ の2つの 変 数 の 値 をキーの 値 にし てください var google_apikey = '[Please input the registered api key for your app.]' ; var google_client_id = '[Please input the registered client id for your app.]' ; これで 設 定 は 完 了 です 天 気 ブロックの 設 定 天 気 ブロックを 動 作 させるのには 特 別 なにもする 必 要 はありません OpenWeatherMap というオープンな 天 気 API にアクセスして 動 作 します

Appendix Kadeckly で 使 っているオープンソース Kadeckly では 以 下 のオープンソース 成 果 物 を 利 用 しています Blockly Blockly は Apache License, Version 2.0 のライセンスで 配 布 されています Blockly は 以 下 のサイトから 入 手 できます https://developers.google.com/blockly/ ただし Kadeckly では オリジナルの Blockly の msg/js/ja.js の 338 行 目 に 以 下 の 変 更 を 加 えています オリジナル: Blockly.Msg.TEXT_PRINT_TITLE = "%1 を 印 刷 します "; 変 更 後 : Blockly.Msg.TEXT_PRINT_TITLE = "%1 を 表 示 します "; License 1. Definitions. Apache License Version 2.0, January 2011 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of

authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on

behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS jquery/jquery UI jquery / jquery UI は MIT ライセンスで 以 下 のサイトから 配 布 されています http://jquery.com/ http://jqueryui.com/ License Copyright 2005, 2014 jquery Foundation and other contributors, https://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history available at https://github.com/jquery/jquery The following license applies to all parts of this software except as documented below: ==== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ==== All files located in the node_modules and external directories are externally maintained libraries used by this software which have their own licenses; we recommend you read them, as their terms may differ from the terms above. TwitterOAuth TwitterOAuth は Abraham Williams によって 開 発 されている php のソフトウェア 成 果 物 です MIT ライセンスと 同 文 です こちらからダウンロードできます https://github.com/abraham/twitteroauth License Copyright (c) 2009 Abraham Williams - http://abrah.am - abraham@abrah.am

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.