Ejemplo n.º 1
0
        public override SGHalfPeriod[] GetHalfPeriods(SOPPars _sop)
        {
            SGPars pars            = ParAll.ST.Defect.Cross.SolidGroup.sgPars;
            List <SGHalfPeriod> L  = new List <SGHalfPeriod>();
            IEnumerator         ie = SGCalc.Calc(
                SqlBoolean.False,
                new SqlString(GetImg()),
                GetThech(),
                new SqlInt32(pars.HalfPeriod),
                new SqlInt32(pars.HalfPeriodDif),
                new SqlBoolean(pars.FullPeriod),
                new SqlString(pars.AlgorithmPoints.ToString()),
                new SqlString(pars.ValIU.ToString()),
                new SqlInt32(pars.BorderBegin),
                new SqlInt32(pars.BorderEnd),
                _sop == null ? SqlInt32.Null : new SqlInt32(_sop.Length),
                _sop == null ? SqlInt32.Null : new SqlInt32(_sop.BeginPoint),
                _sop == null ? SqlInt32.Null : new SqlInt32(_sop.EndPoint)
                );
            int index = 0;

            while (ie.MoveNext())
            {
                SGCalc.Result result = ie.Current as SGCalc.Result;
                L.Add(new SGHalfPeriod(result.par, Convert.ToInt32(result.val), index++));
            }
            return(L.ToArray());
        }
Ejemplo n.º 2
0
 public FTubeGraph(GraphObject _O, SOPPars _sopp)
 {
     InitializeComponent();
     TSName    = _O.TypeSizeName;
     miu       = _O.GetMIU();
     ValIU     = ParAll.SG.sgPars.ValIU;
     DescValIU = new PARLIB.EnumTypeConverter(typeof(SGPars.EValIU)).Desc(ValIU);
     if (!miu.Ok)
     {
         Ok = "Данных нет";
         return;
     }
     Msghp = _O.GetHalfPeriods(_sopp);
 }
Ejemplo n.º 3
0
        public override bool CalcPars(SOPPars _sop)
        {
            ExecuteX E = new ExecuteX(string.Format("{0}.CalcSGTubeParsSOP", BaseItem.Schema));

            E.Input("@pars", DbType.Boolean, true);
            E.Input("@id", DbType.Int64, Convert.ToInt64(Id));
            E.Input("@SOPLenght", DbType.Int32, _sop == null ? DBNull.Value : (object)_sop.Length);
            E.Input("@SOPStart", DbType.Int32, _sop == null ? DBNull.Value : (object)_sop.BeginPoint);
            E.Input("@SOPStop", DbType.Int32, _sop == null ? DBNull.Value : (object)_sop.EndPoint);
            E.Read();
            bool ret = (int)E.Param("@RC") == 1;

            E.Dispose();
            return(ret);
        }
Ejemplo n.º 4
0
        public override void UpdateSOP(SOPPars _sop)
        {
            SOP = _sop == null ? null : _sop.Name;
            ExecSQLX E = new ExecSQLX(string.Format("update {0}.SGTubes set SOP={1} where id={2}",
                                                    BaseItem.Schema,
                                                    SOP == null ? "null" : "'" + SOP + "'",
                                                    Id.ToString()
                                                    ));
            bool ret = E.Exec() == 1;

            if (!ret)
            {
                throw new Exception("Tube: не могу записать SOP");
            }
        }
Ejemplo n.º 5
0
        public override void UpdateSOP(SOPPars _sop)
        {
            SOP = _sop == null ? null : _sop.Name;
            ExecSQLX E = new ExecSQLX(string.Format("update {0}.SGEtalons set SOP={1} where typeSize='{2}' and sGroup='{3}' and id={4}",
                                                    BaseItem.Schema,
                                                    SOP == null ? "null" : "'" + SOP + "'",
                                                    ownKey.TSName,
                                                    ownKey.GroupName,
                                                    Id.ToString()));
            bool ret = E.Exec() == 1;

            if (!ret)
            {
                throw new Exception("Etalon: не могу записать SOP");
            }
        }
Ejemplo n.º 6
0
 void Calc0(SOPPars _sop, GraphObject _go)
 {
     if (!_go.CalcPars(_sop))
     {
         prs("Не смогли рассчитать");
     }
     if (_go is Tube)
     {
         dgvTube.bs.ResetCurrentItem();
         dgvTubePars.RLoad((_go as Tube).Key);
     }
     if (_go is Etalon)
     {
         dgvEtalon.bs.ResetCurrentItem();
         dgvEtalonPars.RLoad((_go as Etalon).Key);
     }
 }
Ejemplo n.º 7
0
        public override SGHalfPeriod[] GetHalfPeriods(SOPPars _sop)
        {
            ExecuteX E = new ExecuteX(string.Format("{0}.CalcSGTubeParsSOP", BaseItem.Schema));

            E.Input("@pars", DbType.Boolean, false);
            E.Input("@id", DbType.Int64, Convert.ToInt64(Id));
            E.Input("@SOPLenght", DbType.Int32, _sop == null ? DBNull.Value : (object)_sop.Length);
            E.Input("@SOPStart", DbType.Int32, _sop == null ? DBNull.Value : (object)_sop.BeginPoint);
            E.Input("@SOPStop", DbType.Int32, _sop == null ? DBNull.Value : (object)_sop.EndPoint);
            List <SGHalfPeriod> L = new List <SGHalfPeriod>();
            int index             = 0;

            while (E.Read())
            {
                L.Add(new SGHalfPeriod((int)E["par"], Convert.ToInt32((Single)E["val"]), index++));
            }
            E.Dispose();
            return(L.ToArray());
        }
Ejemplo n.º 8
0
 abstract public SGHalfPeriod[] GetHalfPeriods(SOPPars _sop);
Ejemplo n.º 9
0
 abstract public bool CalcPars(SOPPars _sop);
Ejemplo n.º 10
0
 abstract public void UpdateSOP(SOPPars _sop);
Ejemplo n.º 11
0
 public tagSOP(GraphObject _current, SOPPars _sop)
 {
     current = _current;
     sop     = _sop;
 }