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

本文涉及的产品
云数据库 Tair(兼容Redis),内存型 2GB
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
简介: . The system has detected that your embedded system is not connected to a display device. Warning ...
<?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>

 

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore &nbsp; &nbsp; ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库&nbsp;ECS 实例和一台目标数据库&nbsp;RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&amp;RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
前端开发 JavaScript PHP
Texas Instruments matrix-gui-2.0 hacking -- index.php
Matrix Application Launcher var has_graphics = true; var link_history = ["submenu.
1053 0
|
2月前
|
前端开发 关系型数据库 MySQL
PHP与MySQL动态网站开发实战指南####
【10月更文挑战第21天】 本文将深入浅出地探讨如何使用PHP与MySQL构建一个动态网站,从环境搭建到项目部署,全程实战演示。无论你是编程新手还是希望巩固Web开发技能的老手,都能在这篇文章中找到实用的技巧和启发。我们将一起探索如何通过PHP处理用户请求,利用MySQL存储数据,并最终呈现动态内容给用户,打造属于自己的在线平台。 ####
64 0
|
1月前
|
存储 关系型数据库 MySQL
PHP与MySQL动态网站开发:从基础到实践####
本文将深入探讨PHP与MySQL的结合使用,展示如何构建一个动态网站。通过一系列实例和代码片段,我们将逐步了解数据库连接、数据操作、用户输入处理及安全防护等关键技术点。无论您是初学者还是有经验的开发者,都能从中获益匪浅。 ####
|
2月前
|
安全 关系型数据库 MySQL
PHP与MySQL动态网站开发实战指南####
——深入探索LAMP栈下的高效数据交互与处理技巧 ####
|
1月前
|
关系型数据库 MySQL PHP
php实现一个简单的MySQL分页
通过本文的详细步骤和代码示例,我们实现了一个简单的PHP MySQL分页功能。主要步骤包括计算总记录数、设置分页参数、查询当前页的数据以及生成分页链接。这种分页方式适用于大多数Web应用,能够有效提升用户体验和页面响应速度。
30 4