示例#1
0
文件: SetUi.cs 项目: sandhaka/libsann
        protected void Setup()
        {
            try
            {
                set = NinjectBinding.GetKernel.Get <SetModel>();

                if (set.inMatrix != null && set.outMatrix != null && set.inValMatrix != null && set.outValMatrix != null &&
                    set.inMatrix.Any() && set.outMatrix.Any() && set.inValMatrix.Any() && set.outValMatrix.Any())
                {
                    inputSetDataGridView.DataSource         = BuildDataTable(set.inMatrix);
                    outputSetDataGridView.DataSource        = BuildDataTable(set.outMatrix);
                    inValidationSetDataGridView.DataSource  = BuildDataTable(set.inValMatrix);
                    outValidationSetDataGridView.DataSource = BuildDataTable(set.outValMatrix);
                }

                saveInputBtn.Enabled  = false;
                saveOutputBtn.Enabled = false;
                saveInValBtn.Enabled  = false;
                saveOutValBtn.Enabled = false;
            }
            catch (Exception exception)
            {
                ExceptionManager.LogAndShowException(exception, "Error", logger);
            }
        }
示例#2
0
        protected static void Assemble(List <double[]> i, List <double[]> o, List <double[]> vi, List <double[]> vo, int size, int vSize)
        {
            if (i.Count != size || o.Count != size || vi.Count != vSize || vo.Count != vSize)
            {
                throw new Exception("");
            }

            SetModel set = NinjectBinding.GetKernel.Get <SetModel>();

            set.inMatrix     = i.ToArray();
            set.outMatrix    = o.ToArray();
            set.inValMatrix  = vi.ToArray();
            set.outValMatrix = vo.ToArray();
        }