Exemple #1
0
        private void Integrate()
        {
            TestValue value = context.Value;

            value.Lock();
            try
            {
                value.Integral.Integrate("Judge");
            }
            finally
            {
                value.Unlock();
            }
        }
Exemple #2
0
        private void DecideJudgement()
        {
            TestValue value = context.Value;

            value.Lock();
            try
            {
                value.Integral.IntegrateSheet("Judge");
            }
            finally
            {
                value.Unlock();
            }
        }
Exemple #3
0
        private void InsertDataValue(int index)
        {
            TestValue value = context.Value;

            context.DB.Lock();

            try
            {
                value.Lock();
                sheetArgs.Report.Lock();

                FbTransaction trans = context.DB.BeginTrans();

                try
                {
                    foreach (KeyValuePair <string, ReportSheet> sheet in sheetArgs.Report.ValueSheets)
                    {
                        if (sheet.Value.Use == false)
                        {
                            continue;
                        }

                        foreach (KeyValuePair <string, ReportRow> row in sheet.Value.Rows)
                        {
                            SetDataValue(index, row.Value);
                            context.DB.DataValueSet.Insert(trans);
                        }
                    }

                    context.DB.CommitTrans();
                }
                catch (Exception e)
                {
                    Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
                    context.DB.RollbackTrans();
                }
                finally
                {
                    sheetArgs.Report.Unlock();
                    value.Unlock();
                }
            }
            finally
            {
                context.DB.Unlock();
            }
        }
Exemple #4
0
        private void SetIntegralValuesToReport(int index)
        {
            TestValue value = context.Value;
            Dictionary <string, ReportSheet> reportSheet = sheetArgs.Report.ValueSheets;

            value.Lock();
            sheetArgs.Report.Lock();

            try
            {
                foreach (KeyValuePair <string, IntegralValues> integSheet in value.Integral.Sheets)
                {
                    if (integSheet.Key == "Judge")
                    {
                        continue;
                    }
                    if (reportSheet[integSheet.Key].Use == false)
                    {
                        continue;
                    }

                    foreach (KeyValuePair <string, IntegralValue> integValue in integSheet.Value.Values)
                    {
                        if (reportSheet[integSheet.Key].Rows[integValue.Key].Row == null)
                        {
                            reportSheet[integSheet.Key].Rows[integValue.Key].Cells[index].Raw = float.NaN;
                        }
                        else
                        {
                            reportSheet[integSheet.Key].Rows[integValue.Key].Cells[index].Raw =
                                integValue.Value.AverageSum;
                        }
                    }
                }
            }
            finally
            {
                sheetArgs.Report.Unlock();
                value.Unlock();
            }
        }