Coder Social home page Coder Social logo

marty-codiny's Introduction

AI Codiny PC 프로그램

AI Codiny에서 하드웨어 제어를 위한 PC용 프로그램입니다. electron 기반으로 구현되었습니다.

2023년 3월 새로운 환경

통신 프로토콜의 변경(HCP)

  • 그 동안 블록코딩과 PC 프로그램의 통신 방식은 socket.io를 사용해왔습니다. 하지만 안드로이드를 포함하여 다양한 하드웨어 및 프로그래밍 언어를 지원하기에는 socket.io는 부족하여, raw websocket위에 코디니 자체적으로 설계한 통신 프로토콜(HCP)을 사용하도록 변경했습니다. 이를 위해 하드웨어 제어 관련하여 많은 변경이 필요했고, 기존에 작성된 하드웨어의 소스코드들도 변경해야 했습니다.

  • 기존의 하드웨어 제어 코드들은 간소화하는 방향으로 변경했고, 작성법도 유사하여 크게 어려움이 없을 것 같습니다. 기존 하드웨어 소스 코드는 코디니 연구소에서 모두 수정했습니다.

  • PC 프로그램은 electron 기반으로 작성되었는데, 이번에 최신 버전으로 함께 업그래이드 했습니다. PC 프로그램의 주요 역할은 시리얼포트를 이용한 하드웨어 제어입니다. serialport 라이브러리도 최신 버전으로 업그래이드 했습니다.

변경사항 요약

변경사항을 요약하면 다음과 같습니다.

기존 2023년 3월부터
통신 socket.io websocket
electron 15.x 23.x
electron-forge 6.0.0-beta.64 6.0.5
node 16.x 이상 18.x 이상
React 17 18
Package Manager yarn classic npm
serialport 9.x 10.x

Technical stacks

  • 패키지 매니저 npm 8.x
  • react 18
  • electron 23.x
  • electron-forge 6.x
  • serialport 10.x
  • nobx 6.x
  • rxjs 7.x
  • xterm 5.x
  • socket.io 4.6
  • mui 5.x
  • webosocket 8.x

Quick Start

빠르게 실행하는 방법은 다음과 같습니다.

$  git clone https://github.com/ktaicoder/hw-pc.git
$  cd hw-pc
$  npm install
$  npm run dev

커스텀 하드웨어 작성

  • 모든 하드웨어에는 하드웨어 ID(hwId)를 부여합니다.
  • src/custom/hw 폴더에 hwId 폴더를 만드세요.
  • hwId는 원하는 것으로 결정하면 되고,
  • 만약 hwId가 awesome인 하드웨어를 추가한다면 src/custom/hw/awesome 폴더를 만들면 됩니다.

hwId 규칙

  • hwId는 소문자로 시작해야 하고, 공백이 없습니다.
  • camel case 표기법을 권장합니다.

작성할 내용

  • hwIdawesome인 하드웨어를 예로 든다면,

  • 구현할 내용은 IAwesomeControl.ts , AwesomeControl.tsindex.ts 파일입니다.

    • IAwesomeControl.ts 은 하드웨어 인터페이스에 대한 내용이고
    • AwesomeControl.ts 은 하드웨어 인터페이스의 구현체입니다. 실제로 하드웨어와 통신하는 코드가 포함됩니다.
    • index.ts는 기타 부가적인 정보와 함께 인터페이스와 구현체를 export합니다.

개발자 가이드

marty-codiny's People

Contributors

cp949 avatar ktaicoder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.