Exemplo n.º 1
0
        /// <summary>
        /// Imports data (and optionally metadata) into the document.
        /// </summary>
        /// <param name="table">The table.</param>
        /// <param name="data">The data, which may just be <paramref name="table"/>.Rows.</param>
        public void ImportData(DataTable table, IEnumerable <DataRow> data)
        {
            if (this.IsAuthoringDictionary)
            {
                // First import schema
                this.Variables.ImportSchema(table);
                this.CommitDictionary();
            }

            System.Collections.IEnumerable dataRows = data;
            if (dataRows == null)
            {
                dataRows = table.Rows;
            }

            foreach (DataRow row in dataRows)
            {
                SpssCase caseRow = this.Cases.New();
                for (int col = 0; col < table.Columns.Count; col++)
                {
                    caseRow.SetDBValue(this.Variables.GenerateColumnName(table.Columns[col].ColumnName), row[col]);
                }

                caseRow.Commit();
            }
        }
Exemplo n.º 2
0
 private static void CopyVariablesData(Entity e, SpssCase case1)
 {
     // pone el valor de cada variable
     foreach (Variable v in e.Variables)
     {
         case1[v.Name] = v.GetData();
     }
 }
Exemplo n.º 3
0
        public static SpssCase AddTechniqueData(SpssCase gestureAttempt, GestureType type, Attempt attempt)
        {
            gestureAttempt[$"{type}Efficiency"] = attempt.Time.TotalSeconds;
            gestureAttempt[$"{type}Effectiveness"] = attempt.Hit;
            gestureAttempt[$"{type}Accuracy"] = MathHelper.GetDistance(attempt);
            gestureAttempt[$"{type}TargetSize"] = attempt.Size;
            gestureAttempt[$"{type}Direction"] = attempt.Direction;

            return gestureAttempt;
        }
Exemplo n.º 4
0
 private static void ResolveParentId(Entity parentEntity, string parentId, ref int currentParent, ref int parentLimit, int n, SpssCase case1)
 {
     if (parentId != "")
     {
         while (n > parentLimit)
         {
             parentLimit = parentEntity.GetPointerData();
             currentParent++;
         }
         case1[parentId] = currentParent;
     }
 }