Texas Instruments matrix-gui-2.0 hacking -- app_description.php

<?php

/*
 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
 *
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
*/

# 加载通用函数
require("helper_functions.php");

$var = read_desktop_file();

if($var==null)
{
    echo "Json.txt file is empty or doesn‘t exist.";
    return;
}

//Some parts of the code doesn‘t set the submenu variable when the user is at the Main Menu which is relected in the "top" variable
$submenu = isset($_GET["submenu"]) == true ? $_GET["submenu"] : "main_menu" ;

$found_app =  get_application($var,$submenu,$_GET["app"]);

$menu_title = $found_app["Name"];
$enable_main_menu_link = true;
?>
    <?php include "menubar.php"; ?>

<?php

    $title = $found_app["Name"];                # 获取app名字

    $description = "No Description";            # 描述
    $program_type = $found_app["ProgramType"];  # 获取程序类型

    if($found_app["Description_Link"]!=-1)      # 获取描述链接
    {
        # 读取描述链接文件
        $handle = fopen($found_app["Description_Link"], "rb");
        $description = fread($handle,filesize($found_app["Description_Link"]));
        fclose($handle);

        if(strlen($description)==0)             # 没有获取到文件描述数据
            $description = "Invalid link for description page";
    }

    $app_title = $found_app["Name"];            # app的标题是app的名字

    # 合成超级链接
    $link =  "run_script.php?&submenu=".urlencode($submenu)."&app=".urlencode($app_title);
?>
    <div id = "descrip_text">
        <div id ="no_display" style = "display:none;">          <!-- 没有显示出来 -->
            <h1 style = "color:red;">Sorry</h1>
            You can‘t run the GUI application <?php echo $title; ?>. The system has detected that your embedded system is not connected to a display device.
        </div>
        <div id = "running_remotely"  style = "display:none;">  <!-- 没有显示出来 -->
            <h1 style = "color:yellow;">Warning</h1>
                You are currently running Matrix remotely and <?php echo $title; ?> is a GUI based application. <br>
                After clicking run, look at the display device connected to the embedded system to see and/or interact with the application
        </div>
        <div id = "run_application" style= "text-align:center;">
            <a href = "<?php echo $link;?>"><img id = "run_img" src= "images/run-icon.png"></a>
        </div>
        <div>
            <!-- 显示描述文件内容 -->
            <?php echo $description; ?>
        </div>
    </div>

<script>
    // 自动生成js变量
    <?php
        if($program_type=="gui")
            echo "var isgraphicalApp = true;";
        else
            echo "var isgraphicalApp = false;";
    ?>

    // 这里主要是让对应的内容显示出来
    if(isgraphicalApp == true)
    {
        if(has_graphics == false)
        {

            $("#no_display").show();
            $("#run_application").hide();
        }
        else if(client_is_host == false)
        {
            $("#running_remotely").show();
        }
    }
</script>
时间: 2024-10-02 00:26:31

Texas Instruments matrix-gui-2.0 hacking -- app_description.php的相关文章

Texas Instruments matrix-gui-2.0 hacking -- submenu.php

<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribut

Texas Instruments matrix-gui-2.0 hacking -- index.php

<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribut

Texas Instruments matrix-gui-2.0 hacking -- run_script.php

<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribut

Texas Instruments matrix-gui-2.0 hacking -- menubar.php

<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribut

Texas Instruments matrix-gui-2.0 hacking -- execute_command.sh

#!/bin/sh #Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ # # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # Redistribut

Texas Instruments matrix-gui-2.0 hacking -- json.txt

{ "main_menu": { "apps": [ { "Name":"Profiling", "Order":"1", "Icon":"apps\/images\/oprofile-icon.png", "Type":"directory", "Category":"prof

ZHA profile与ZLL profile的一个例子

ZHA Coordinator 如何控制ZLL Light/Philips Hue Light 缩写: ZHA: ZigBee Home Automation profile ZLL:  ZigBee Light Link profile TCLK: Trust Center Link Key 为什么ZLL 灯加入ZHA网络 在ZLL网络中,设备支持两种方式Join ZigBee网络,一种是通过Touch Link[1]方式入网,遥控器和灯靠近配对的方式把灯拉入到ZLL网络中.另外一种是传统入网

TIMAC 学习笔记1

TIMAC是TI公司推出的基于IEEE 802.15.4的通讯协议栈,编译环境为IAR,使用IAR自带的CLIB库,CLIB库提供了轻量级的C库,它不支持嵌入式C++.适用于RF4CE协议和ZigBee-Pro产品. 目前学习的MAC层协议版本为1.5.0. 为什么要学习TIMAC呢?在开发基于ZigBee的项目中,遇到了一些底层上的问题,再深入时,发现卡在底层封装的库中去,TIMAC比ZStack的底层开放程度更高,为了更好的理解无线传输的一些细节问题,才会去看TIMAC协议. 特点 1. 多

IAR8.30.3安装破解方法及ZStack-MESH安装方法

安装前的准备 安装破解前请先关闭所有安全软件,比如360安全卫士.电脑管家.金山毒霸. 安装包地址:[http://pan.baidu.com/s/1miDBFTI] 1.     安装IAR 将压缩文件解压,打开IAR8.30.3文件夹,找到EW8051-8303-Autorun.exe双击运行,接着在弹出的安装向导窗口里选择Install IAR Embedded Workbench,按照默认的选项完成安装就行了.安装完成后退出软件,并点击Exit退出安装向导窗口. 2.     破解IAR