Exemple #1
0
        /*internal bool GraphicHide(List<Graphic> graphics)
         * {
         *  bool fg = false;
         *  foreach (var gr in graphics)
         *  {
         *      if (gr.IsVisible)
         *      {
         *          fg = true;
         *          break;
         *      }
         *  }
         *
         *  if (fg)
         *  {
         *      var cmd = new UserCommand(EUserCommand.GraphicsHide, graphics, null);
         *      AddCommand(cmd);
         *      return true;
         *  }
         *
         *  return false;
         * }*/

        //internal bool GraphicSelect(Graphic graphic){}

        //axY = null, если в новую ось
        internal bool GraphicChangeAxY(AnalogGraphic graphic, GroupY axY)
        {
            if ((graphic.GroupY != axY) && ((graphic.GroupY.IsOverlayed) || (axY != null)))
            {
                var cmd = new UserCommand(EUserCommand.GraphicChangeAxY, graphic, axY, graphic.GroupY);
                AddCommand(cmd);
                return(true);
            }

            return(false);
        }
Exemple #2
0
        internal bool AxYHide(GroupY axY)
        {
            if (axY.IsVisible)
            {
                var cmd = new UserCommand(EUserCommand.AxYHide, axY, null);
                AddCommand(cmd);
                return(true);
            }

            return(false);
        }
Exemple #3
0
        //internal bool AxYJunction(GroupY axY, GroupY axCatcher)
        //{
        //    var pz = new List<object> { axCatcher };
        //    var cpz = new List<object> { curViewTimeBegin, curViewTimeEnd, curScaleType };

        //    var cmd = new UserCommand(EUserCommand.AxYJunction, graphic, axY, graphic.GroupY);
        //}

        //internal bool AxYChangeSizePos(GroupY axY, double newSize, double newPos){}

        //internal bool AllAxYChangeSizePos(List<GroupY> axY, List<double> newSizes, List<double> newPoses){}

        internal bool AxYSetViewY(GroupY axY, double viewYMin, double viewYMax, bool inPercent)
        {
            if ((viewYMin != axY.ViewMin) || (viewYMax != axY.ViewMax) || (inPercent != axY.IsInPercent))
            {
                var pz = new List <object> {
                    viewYMin, viewYMax, inPercent
                };
                var cpz = new List <object> {
                    axY.ViewMin, axY.ViewMax, axY.IsInPercent
                };
                var cmd = new UserCommand(EUserCommand.AxYSetViewY, axY, pz, cpz);
                //var cmd = new UserCommand(EUserCommand.AxYSetViewY, axY.UpperGraphic, pz, cpz);
                AddCommand(cmd);
                return(true);
            }
            return(false);
        }
Exemple #4
0
        internal bool AxYSizePosChanged(GroupY axY, double curSize, double curPos)
        {
            if ((axY.CurAxSize != curSize) || (axY.CurAxPos != curPos))
            {
                var pz = new List <object> {
                    axY.CurAxSize, axY.CurAxPos
                };
                var cpz = new List <object> {
                    curSize, curPos
                };
                var cmd = new UserCommand(EUserCommand.AxYChangeSizePos, axY, pz, cpz);
                AddCommand(cmd, false);
                return(true);
            }

            return(false);
        }
Exemple #5
0
        /*internal bool AxYSetViewY(List<GroupY> axYs, List<double> viewYMins, List<double> viewYMaxs, List<bool> inPercents)
         * {
         *  var cViewYMin = new List<double>();
         *  var cViewYMax = new List<double>();
         *  var cInPercents = new List<bool>();
         *  bool fg = false;
         *  int i = -1;
         *  foreach (var axY in axYs)
         *  {
         *      i++;
         *      cViewYMin.Add(axY.ViewMin);
         *      cViewYMax.Add(axY.ViewMax);
         *      cInPercents.Add(axY.IsInPercent);
         *
         *      if ((viewYMins[i] != axY.ViewMin) || (viewYMaxs[i] != axY.ViewMax) || (inPercents[i] != axY.IsInPercent))
         *          fg = true;
         *  }
         *
         *  if (fg)
         *  {
         *      var pz = new List<object> { viewYMins, viewYMaxs, inPercents };
         *      var cpz = new List<object> { cViewYMin, cViewYMax, cInPercents };
         *      var cmd = new UserCommand(EUserCommand.AxYsSetViewY, axYs, pz, cpz);
         *      AddCommand(cmd);
         *      return true;
         *  }
         *
         *  return false;
         * }*/

        //internal bool AxYJunction(GroupY catcher, GroupY pitcher)
        //{
        //    if (catcher != pitcher)
        //    {
        //        var cpz = new List<Object>();

        //        var grs = new List<AnalogGraphic>();
        //        foreach (var gr in pitcher.Graphics) grs.Add(gr);
        //        cpz.Add(grs);
        //        cpz.Add(pitcher.ViewMin);
        //        cpz.Add(pitcher.ViewMax);
        //        cpz.Add(pitcher.IsInPercent);
        //        cpz.Add(pitcher.CurAxSize);
        //        cpz.Add(pitcher.CurAxPos);

        //        var cmd = new UserCommand(EUserCommand.AxYJunction, catcher.UpperGraphic, pitcher.UpperGraphic, cpz);
        //        AddCommand(cmd);
        //        return true;
        //    }

        //    return false;
        //}

        internal bool AxYJunction(GroupY catcher, GroupY pitcher)
        {
            if (catcher != pitcher)
            {
                var cpz = new List <Object>();
                var grs = new List <AnalogGraphic>();
                foreach (var gr in pitcher.Graphics)
                {
                    grs.Add(gr);
                }
                cpz.Add(grs);
                cpz.Add(catcher.UpperGraphic);
                cpz.Add(pitcher.UpperGraphic);

                var cmd = new UserCommand(EUserCommand.AxYJunction, catcher, pitcher, cpz);
                AddCommand(cmd);
                return(true);
            }

            return(false);
        }