The graph template is upgraded!

Author: The Little Dream, Created: 2016-07-26 09:47:34, Updated: 2017-10-11 10:20:34

The graph template is upgraded!

  • In order to make it easier to use the status bar tables, the data displayed is more orderly. A new feature has been added to the chart template. It is possible to customize the display of information in the policy status bar. New students no longer need to configure the status bar object.
    First, write the added export function, and the introduction.
    • TV // global object, this global object is responsible for managing the content displayed in the table, as well as modifying the contents of the table.
    • $.TableInit = function ((cols,rows) // This export function is used to initialize a state array table, declaring cols = [number],rows = [number] before using it, then passing the variable parameters↑cols//column,rows//line↑automatically generating tables↑and returning the TV object to write data in the policy of the reference template↑
    • $.UpdateLogStatus = function() // This export function is used to update the status bar tables. For example: var table = $.TableInit(6,5); after executing table.a0 = aaaa; then call the export function: $.UpdateLogStatus(), you can update the aaaa to a column, line 0..
    • The coordinates of the cols, rows, and rows are set to this. The table coordinates can be written to the a0 position of the following table. Columns can be written to the maximum of the z string.
    • Note: The table header is the cell (header) of the coordinates a0, b0, c0... [this problem has been corrected, the data content of the header can be the same].
a b c d
0 a0
1 b1
2 d2
3 c3
4
5
6
7
8

img

  • Below is the code to test the main function in the template:
//测试状态栏表格功能
    var cols = 6;//列
    var rows = 4;//行
    $.TableInit(cols,rows);

img

  • We'll continue to test the functionality:
    /*测试状态栏表格功能*/
    var cols = 6;//列 设置一个变量 代表 列
    var rows = 4;//行 设置一个变量 代表 行
    $.TableInit(cols,rows); //初始化  状态栏  会显示  各个单元格的 坐标
    ///*
    for(var x in TV){
        TV[x] = "lalala";// 全部单元格写成 lalala
    }
    //更新表格 显示  lalala, 表头 数据不能重复 ,否则显示不出来。
    TV.a0 = "a0";
    TV.b0 = "b0";
    TV.c0 = "c0";
    TV.d0 = "d0";
    TV.e0 = "e0";
    TV.f0 = "f0";//先把 表头数据写成不一样的

    $.UpdateLogStatus();//更新 状态栏表格

imgIn addition to the data written separately in the header, all other cells write the string "lalala".

  • Let's experiment and see how we write arrays, numbers, objects, text, these data.
    /*测试状态栏表格功能*/
    var cols = 6;//列 设置一个变量 代表 列
    var rows = 4;//行 设置一个变量 代表 行
    $.TableInit(cols,rows); //初始化  状态栏  会显示  各个单元格的 坐标
    ///*
    for(var x in TV){
        TV[x] = "lalala";// 全部单元格写成 lalala
    }
    //更新表格 显示  lalala, 表头 数据不能重复 ,否则显示不出来。
    TV.a0 = "a0";
    TV.b0 = "b0";
    TV.c0 = "c0";
    TV.d0 = "d0";
    TV.e0 = "e0";
    TV.f0 = "f0";//先把 表头数据写成不一样的

    $.UpdateLogStatus();//更新 状态栏表格

    ///*
    //怎么在 表格里面写入数据呢?
    var num = 100;
    var text = "文本:测试表格文本";
    var obj = {name:"对象",age:"19",sex:"girl"};
    var array = ["数组",22,33,54];
    TV.a1 = num;
    TV.c2 = text;
    TV.b3 = obj;
    TV.b0 = array;

    $.UpdateLogStatus();//再次更新 状态栏表格
    //*/

img

The above is a test within the template, please test the template function below in the policy referring to the template:
function main(){
    var i = 0;
    var table = $.TableInit(4,5);
    for(var x in table){//向表格写入数据
        table[x] = "" + i;// 全部单元格写成 递增的数字
        i++;
    }
    //更新表格 显示  递增的数字, 表头 数据不能重复 ,否则显示不出来。
    table.a0 = "a0";
    table.b0 = "b0";
    table.c0 = "c0";
    table.d0 = "d0";
    table.a1 = "a1";
    table.b1 = "b1";
    table.c1 = "c1";
    table.d1 = "d1";
    table.a4 = "a4";
    table.b4 = "b4";
    table.c4 = "c4";
    table.d4 = "d4";
    //Log("TV:",TV);//测试是否能 访问到模板中的TV 对象 
    $.UpdateLogStatus();
}

imgWe've updated this feature for a while, welcome to test it, if there are any bugs, please add more, leave a comment.^^


More

The winds of reform are blowingPlease, type error: $.UpdateLogStatus is not a function What's going on?

The winds of reform are blowingClick on the copy and retrieve button to copy the policy template, and then I refer to this template in my own policy, but the run data still returns an error: TypeError: undefined not callable (property 'TableInit' of [object Object]) at main (__FILE__:315)

hokshelatoThe re-test was normal, but the analogue disc gave an error: `ReferenceError: identifier 'indicatorsName' undefined at [anon] (__FILE__:1388) at global (__FILE__:1694) preventsyield`

FangBeiRunning the new policy, prompt main:3:19 - TypeError: $.TableInit is not a function How is the citation template test cited?

I'm going to go.This is a list of all the different ways UpdateLogStatus is credited in the database. The name of this function is somewhat problematic. Update is a word, D cannot be capitalized.

muiaLittle Dream and Hardship

The Little DreamIt's not polite.

The winds of reform are blowingI tried several times and it worked, thank you Dreamsum.

The Little DreamCheck the code on line 315 of the main function to see if the function name is misspelled.

The Little DreamIs the policy referring to this template?

The Little DreamThe error seems to be a problem with the parameter indicatorsName. This parameter is an interface parameter. You can then copy the policy again to create a new replicated robot and run it to see if it returns an error.

hokshelatoI copied the policy template by clicking on the **copy and retrieving the ** button online, and then I referenced this template in my own policy, and the policy parameters are displayed normally. The results were positive, and then I built a new robot B to test it, which proved that the strategy itself was not a problem. But I don't know why, because the error is on robot A, and the configuration of both robots is the same, even strange.

The Little DreamI'm going to test it, okay, your error message, and I'm guessing: If you're just copying code, you'll need to manually configure the parameters. The template is this post: https://www.botvs.com/strategy/20967 It is necessary to click on the copy button below.

The Little DreamIf you want to check this template in the policy, and this template is JS language, if you write the policy in Python, even if you copy this template to your Control Center, it will not be visible, it will not be referenced (i.e. check).

The Little Dream^ ^ The index finger point is used to write the outer line as~~ change it.

The Little DreamIt's easy to use.