예제 #1
0
 public void GetOldDatabase()
 {
     if (!VedicDatabase.isDatabaseNull)
     {
         ViewAssembler.GenerateViewObject(VedicDatabase.db, false, false, -1);
     }
 }
예제 #2
0
    private void BuildAnalytic1()
    {
        Database db1 = VedicDatabase.SortTablesByColumnQuantity();

        AnalyticObject1 = ViewAssembler.GenerateViewObject(db1, false, true, 0);
        AnalyticObject1.transform.SetParent(gameObject.transform);
        AnalyticObject1.transform.localPosition = new Vector3(0, 0, 0);
        genuineScale = AnalyticObject1.transform.localScale;
    }
예제 #3
0
    public void BuildPod(Database obj)
    {
        checkActivePods();

        for (int i = 0; i < podStates.Length; i++)
        {
            if (podStates[i])
            {
                GameObject assembledHarness = ViewAssembler.GenerateViewObject(obj, true, false, -1);
                pods[i].GetComponent <Pod>().AllocateTableHarness(assembledHarness);
            }
        }
    }
예제 #4
0
    // Update is called once per frame
    void Update()
    {
        if (virgin)
        {
            virgin = false;
            T_Column col1 = new T_Column();
            col1.Name      = "Name1";
            col1.ColumnKey = 0;

            T_Column col2 = new T_Column();
            col2.Name      = "Name2";
            col2.ColumnKey = 1;

            List <T_Column> colSet = new List <T_Column>();
            colSet.Add(col1);
            colSet.Add(col2);

            List <T_Column> colSet2 = new List <T_Column>();
            colSet2.Add(col1);
            colSet2.Add(col2);

            T_Table tab1 = new T_Table();
            tab1.TableKey     = 0;
            tab1.Name         = "TabName1";
            tab1.ChildColumns = colSet;

            T_Table tab2 = new T_Table();
            tab2.TableKey     = 1;
            tab2.Name         = "TabName2";
            tab2.ChildColumns = colSet2;

            List <T_Table> tabSet = new List <T_Table>();
            tabSet.Add(tab1);
            tabSet.Add(tab2);

            T_Harness harness = new T_Harness();
            harness.childTables = tabSet;

            GameObject sample = ViewAssembler.GenerateViewObject(harness);
            sample.name = "Rex";
        }
    }
예제 #5
0
    private void BuildAnalytic3(bool initial)
    {
        if (initial)
        {
            //Call the initial build of object
            Database dInitial = VedicDatabase.ChangeColorsForKeys("T0", "T0-C0");
            AnalyticObject3 = ViewAssembler.GenerateViewObject(dInitial, false, true, 2);
            AnalyticObject3.transform.SetParent(gameObject.transform);
            AnalyticObject3.transform.localPosition = new Vector3(0, 0, 0);
            return;
        }

        int cacheType = cacheHandle.ReadPingType();

        if (cacheType == 2)
        {
            string message = cacheHandle.ReadCacheMessage();
            //Build db based off of column id retrieval from cache
            if (AnalyticObject3 != null)
            {
                GameObject.Destroy(AnalyticObject3);
                AnalyticObject3 = null;
            }

            string tableId = message.Substring(0, message.IndexOf('-'));
            //Build the object if we got this far with the info proivided by database (Use function to be created)
            Database d = VedicDatabase.ChangeColorsForKeys(tableId, message);
            AnalyticObject3 = ViewAssembler.GenerateViewObject(d, false, true, 2);
            AnalyticObject3.transform.SetParent(gameObject.transform);
            AnalyticObject3.transform.localPosition = new Vector3(0, 0, 0);
        }
        else
        {
            return;
        }
    }
예제 #6
0
    IEnumerator GetKeyColumnsQ(String input)
    {
        string  url  = "http://www.williamrobertfunk.com/applications/vedic/actions/query.php";
        WWWForm form = new WWWForm();

        form.AddField("dbname", dbname.text);
        form.AddField("hostname", hostname.text);
        form.AddField("username", username.text);
        form.AddField("password", password.text);
        form.AddField("query", input);

        UnityWebRequest www = UnityWebRequest.Post(url, form);

        yield return(www.Send());

        if (www.isError)
        {
            Debug.Log(www.error);
        }
        else
        {
            string reply   = www.downloadHandler.text;
            string podData = reply.Substring(reply.IndexOf("##SelectTable##:{") + 17);
            // This Table ID sould be unlike original import
            // It should consist of a combo db name it came from, and select query random unique hash
            SelectTable             sTable = new SelectTable(podData, "Keys", "FunkKeysTable");
            DatabaseUtilities.Table t      = sTable.GetTable();
            for (int i = 0; i < t.columns[0].fields.Count; i++)
            {
                int    tabIndex   = -1;
                int    colIndex   = -1;
                string fKey       = t.columns[0].fields[i];
                string referenced = t.columns[1].fields[i];
                if (fKey != null && referenced != null && fKey.Length > 0 && referenced.Length > 0)
                {
                    for (int j = 0; j < VedicDatabase.db.tables.Count; j++)
                    {
                        if (VedicDatabase.db.tables[j].GetName() == referenced.Substring(0, referenced.IndexOf('.')))
                        {
                            tabIndex = j;
                            break;
                        }
                    }
                    if (tabIndex < 0)
                    {
                        continue;
                    }
                    for (int k = 0; k < VedicDatabase.db.tables[tabIndex].columns.Count; k++)
                    {
                        if (VedicDatabase.db.tables[tabIndex].columns[k].GetName() == referenced.Substring(referenced.IndexOf('.') + 1))
                        {
                            colIndex = k;
                            break;
                        }
                    }
                    if (colIndex < 0)
                    {
                        continue;
                    }
                    VedicDatabase.db.tables[tabIndex].columns[colIndex].AddFKey(fKey.Substring(0, fKey.IndexOf('.')), fKey.Substring(fKey.IndexOf('.') + 1));
                }
            }

            GameObject.FindGameObjectWithTag("Analytics").GetComponent <AnalyticManager>().BuildAnalytics();

            ViewAssembler.GenerateViewObject(VedicDatabase.db, false, false, -1);
        }
    }