コード例 #1
0
 public void Add(CONDTESTPARAM paramname, object paramvalue)
 {
     if (condtestidx < 0)
     {
         return;
     }
     if (condtest.ContainsKey(paramname))
     {
         var vs = condtest[paramname];
         for (var i = vs.Count; i < condtestidx; i++)
         {
             vs.Add(null);
         }
         vs.Add(paramvalue);
     }
     else
     {
         var vs = new List <object>();
         for (var i = 0; i < condtestidx; i++)
         {
             vs.Add(null);
         }
         vs.Add(paramvalue);
         condtest[paramname] = vs;
     }
 }
コード例 #2
0
 public void AddInList <TKey, TValue>(CONDTESTPARAM paramname, TKey listkey, TValue listvalue)
 {
     if (condtestidx < 0)
     {
         return;
     }
     if (condtest.ContainsKey(paramname))
     {
         var vs = condtest[paramname];
         for (var i = vs.Count; i < condtestidx; i++)
         {
             vs.Add(null);
         }
         if (vs.Count < (condtestidx + 1))
         {
             vs.Add(new List <Dictionary <TKey, TValue> >()
             {
                 new Dictionary <TKey, TValue>()
                 {
                     [listkey] = listvalue
                 }
             });
         }
         else
         {
             var lvs = (List <Dictionary <TKey, TValue> >)vs[condtestidx];
             lvs.Add(new Dictionary <TKey, TValue>()
             {
                 [listkey] = listvalue
             });
         }
     }
     else
     {
         var vs = new List <object>();
         for (var i = 0; i < condtestidx; i++)
         {
             vs.Add(null);
         }
         vs.Add(new List <Dictionary <TKey, TValue> >()
         {
             new Dictionary <TKey, TValue>()
             {
                 [listkey] = listvalue
             }
         });
         condtest[paramname] = vs;
     }
 }
コード例 #3
0
 public void AddInList <T>(CONDTESTPARAM paramname, T listvalue)
 {
     if (condtestidx < 0)
     {
         return;
     }
     if (condtest.ContainsKey(paramname))
     {
         var vs = condtest[paramname];
         for (var i = vs.Count; i < condtestidx; i++)
         {
             vs.Add(null);
         }
         if (vs.Count < (condtestidx + 1))
         {
             vs.Add(new List <T>()
             {
                 listvalue
             });
         }
         else
         {
             var lvs = (List <T>)vs[condtestidx];
             lvs.Add(listvalue);
         }
     }
     else
     {
         var vs = new List <object>();
         for (var i = 0; i < condtestidx; i++)
         {
             vs.Add(null);
         }
         vs.Add(new List <T>()
         {
             listvalue
         });
         condtest[paramname] = vs;
     }
 }
コード例 #4
0
ファイル: UIController.cs プロジェクト: Experica/Command
        public bool OnNotifyCondTest(CONDTESTPARAM name, List <object> value)
        {
            var hr = false;

            if (alsmanager != null)
            {
                switch (name)
                {
                case CONDTESTPARAM.BlockRepeat:
                case CONDTESTPARAM.BlockIndex:
                case CONDTESTPARAM.TrialRepeat:
                case CONDTESTPARAM.TrialIndex:
                case CONDTESTPARAM.CondRepeat:
                case CONDTESTPARAM.CondIndex:
                    //MsgPack.ListIntSerializer.Pack(stream, value.ConvertAll(i => (int)i), PackerCompatibilityOptions.None);
                    break;

                case CONDTESTPARAM.SyncEvent:
                    //MsgPack.ListListStringSerializer.Pack(stream, value.ConvertAll(i => (List<string>)i), PackerCompatibilityOptions.None);
                    break;

                case CONDTESTPARAM.Event:
                case CONDTESTPARAM.TASKSTATE:
                case CONDTESTPARAM.BLOCKSTATE:
                case CONDTESTPARAM.TRIALSTATE:
                case CONDTESTPARAM.CONDSTATE:
                    //MsgPack.ListListEventSerializer.Pack(stream, value.ConvertAll(i => (List<Dictionary<string, double>>)i), PackerCompatibilityOptions.None);
                    break;
                }
                var data = value.SerializeMsgPack();
                if (data.Length > 0)
                {
                    alsmanager.RpcNotifyCondTest(name, data);
                    hr = true;
                }
            }
            return(hr);
        }
コード例 #5
0
ファイル: AnalysisManager.cs プロジェクト: Experica/Command
 public void RpcNotifyCondTest(CONDTESTPARAM name, byte[] value)
 {
 }