Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[第 100 期] EVM 超轻量级物联网虚拟机 #1143

Open
scriptiot-dev opened this issue Mar 23, 2020 · 2 comments
Open

[第 100 期] EVM 超轻量级物联网虚拟机 #1143

scriptiot-dev opened this issue Mar 23, 2020 · 2 comments

Comments

@scriptiot-dev
Copy link

scriptiot-dev commented Mar 23, 2020

项目推荐

  • 项目地址:https://github.com/scriptiot/evm

  • 类别:C

  • 项目描述:
    EVM 全称 Embedded Virtural Machine,本质上是一款通用、精简的嵌入式虚拟机,由语法解析前端框架和字节码运行后端构成,可运行在资源受限制的单片机上。

evm

  • 优势特点:

    • 最小编译体积40KB,最小内存占用2KB;
    • 支持多语言混合开发,目前支持Javascript、Python、Lua、QML、Json、XML等语言;
    • 先进的内存管理,无内存泄露和内存碎片问题;
    • 高效的运行性能,性能媲美QuickJs;
    • 灵活的虚拟机扩展技术,多语言可共享扩展功能;
  • EVM愿景:支持脚本语言开发嵌入式,高效的运行性能,打破物联网和互联网人才边界,赋能物联网企业和开发者全新的开发模式,降低物联网开发门槛,极速提升开发效率。

  • 基于qml的手表Demo展示
    watch

Rectangle {
    id: rect
    x: 0
    y: 0
    width: 800
    height: 600

    style:Style{
        main_color: 'lightblue'
        grad_color: 'lightblue'
    }

    Rectangle{

        x: 200
        y: 100
        width: 400
        height: 400

        style:Style{
            main_color: 'lightblue'
            grad_color: 'lightblue'
        }

        Image{
            source: 'images/wear/ico_watch_background_011.bin'
        }
        
        Gauge{
            id: g1
            x:45
            y:45
            width:300
            height:300

            min:0
            max:360

            scale: [360, 0,0]

            GaugeValue{
                id:gvsec
                index:0
                value:0
            }

            function animation(){
                var date = new Date();
                var offset = 31;
                var hx = date.getHours();
                var mx = date.getMinutes();
                var sx = date.getSeconds();

                if( hx > 12) hx = hx - 12;

                if( hx <= 6 ) hx = hx * 360 / 12 + 180;
                if( hx > 6 && hx <= 12) hx = hx * 360 / 12 - 180;

                if( sx >= 30 ) sx = sx * 6 - 180;
                else sx = sx * 6 + 180;
                
                if( mx >= 30 ) mx = mx * 6 - 180;
                else mx = mx * 6 + 180;

                hx = hx + date.getMinutes() * 30 / 60;

                print(hx, mx, sx);
                

                gvhour.value = hx;
                gvmin.value = mx;
                gvsec.value = sx;
            }

            timer_id:0

            onCompleted: {
                g1.timer_id = setInterval(g1.animation, 200);
            }
        }


        Gauge{
            x:95
            y:95
            width:200
            height:200

            min:0
            max:360

            needle: ['white']

            scale: [360, 0,0]

            GaugeValue{
                id:gvmin
                index:0
                value:20
            }
        }

        Gauge{
            x:120
            y:120
            width:150
            height:150

            needle: ['yellow']

            min:0
            max:360

            scale: [360, 0,0]

            GaugeValue{
                id:gvhour
                index:0
                value:0
            }
        }
    }
}
@JavaCS3
Copy link

JavaCS3 commented Mar 25, 2020

Evm 虚拟机部分的代码没有,就只有头文件和lib

@scriptiot-dev
Copy link
Author

scriptiot-dev commented Mar 25, 2020 via email

@ruanyf ruanyf changed the title EVM 超轻量级物联网虚拟机 [第 100 期] EVM 超轻量级物联网虚拟机 Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants