Ejemplo n.º 1
0
        public VerticalConturViewModer()
        {
            ValuesBefore1      = new ChartValues <double>();
            ValuesBefore2      = new ChartValues <double>();
            ValuesAfter1       = new ChartValues <double>();
            ValuesAfter2       = new ChartValues <double>();
            ChartValuesBefore1 = new ChartValues <MeasureModel>();
            ChartValuesBefore2 = new ChartValues <MeasureModel>();
            ChartValuesAfter1  = new ChartValues <MeasureModel>();
            ChartValuesAfter2  = new ChartValues <MeasureModel>();
            //ChartValues = new ChartValues<MeasureModel>();
            conturGrafSet      = new ConturGrafSet();
            YaxesName          = conturGrafSet.yAxesName;
            XaxesName          = conturGrafSet.xAxesName;
            conturApprox_1     = new ConturApprox();
            conturApprox_2     = new ConturApprox();
            ButtonChooseFile_1 = new RelayCommand(o => OpenFile_1("ReportsButton"));
            ButtonBuidGraf_1   = new RelayCommand(o => BuildFronCSV_1("ReportsButton"));
            ButtonChooseFile_2 = new RelayCommand(o => OpenFile_2("ReportsButton"));
            ButtonBuidGraf_2   = new RelayCommand(o => BuildFronCSV_2("ReportsButton"));
            ButtonBuildBack    = new RelayCommand(o => BuildBack("ReportsButton"));
            Messenger.Default.Register <SentModelName>(this, SetFileNameEnding);
            ListOfItemsOPC listOfItemsOPC = new ListOfItemsOPC();

            OPC_UA = new OPC_UA_Client("192.168.1.17", 500d, listOfItemsOPC.GetOPCitems());
            _      = Task();
        }
Ejemplo n.º 2
0
        public GrafViewModel(GrafSet grafSet, string cSvPath)
        {
            this.grafSet     = grafSet;
            this.cSvPath     = cSvPath;
            arSeries         = this.grafSet.GetSettings();
            SeriesCollection = new SeriesCollection();
            Labels           = new[] { System.DateTime.Now.ToString() };
            YFormatter       = value => value.ToString() + this.grafSet.unit;
            dataTable.Columns.Add("FirstValue");
            dataTable.Columns.Add("SecondValue");
            YaxesName     = grafSet.yAxesName;
            YaxesMaxValue = grafSet.maxValue;
            XaxesName     = grafSet.xAxesName;
            SeriesName    = grafSet.seriesName;
            for (int i = 0; i < arSeries.Length; i++)
            {
                SeriesCollection.Add(arSeries[i].LineSeries);
            }

            ButtonChooseFile_1 = new RelayCommand(o => OpenFile_1("ReportsButton"));
            ButtonBuidGraf_1   = new RelayCommand(o => ShowFromCSV_1("ReportsButton"));
            ButtonChooseFile_2 = new RelayCommand(o => OpenFile_2("ReportsButton"));
            ButtonBuidGraf_2   = new RelayCommand(o => ShowFromCSV_2("ReportsButton"));
            ButtonBuildBack    = new RelayCommand(o => BuildBack("ReportsButton"));

            var mapper = Mappers.Xy <MeasureModel>()
                         .X(model => model.ValueX)
                         .Y(model => model.ValueY);

            Charting.For <MeasureModel>(mapper);
            ChartValues = new ChartValues <MeasureModel>();
            ListOfItemsOPC listOfItemsOPC = new ListOfItemsOPC();

            OPC_UA = new OPC_UA_Client("192.168.1.17", 2000d, listOfItemsOPC.GetOPCitems());
            //OPC_UA.ItemsChanged += OPC_UA_ItemsChanged;
            Messenger.Default.Register <GenerateReportsMessage>(this, GenerateReports);
            Messenger.Default.Register <SentModelName>(this, SetFileNameEnding);
            _ = Task();
        }
Ejemplo n.º 3
0
        public GrafViewModel(GrafSet grafSet, string cSvPath)
        {
            this.grafSet     = grafSet;
            this.cSvPath     = cSvPath;
            arSeries         = this.grafSet.GetSettings();
            SeriesCollection = new SeriesCollection();
            Labels           = new[] { System.DateTime.Now.ToString() };
            YFormatter       = value => value.ToString() + this.grafSet.unit;
            dataTable.Columns.Add("FirstValue");
            dataTable.Columns.Add("SecondValue");
            YaxesName     = grafSet.yAxesName;
            YaxesMaxValue = grafSet.maxValue;
            XaxesName     = grafSet.xAxesName;
            for (int i = 0; i < arSeries.Length; i++)
            {
                SeriesCollection.Add(arSeries[i].LineSeries);
            }
            ListOfItemsOPC listOfItemsOPC = new ListOfItemsOPC();

            OPC_UA = new OPC_UA_Client("192.168.1.17", 2000d, listOfItemsOPC.GetOPCitems());
            //OPC_UA.ItemsChanged += OPC_UA_ItemsChanged;
            Messenger.Default.Register <GenerateReportsMessage>(this, GenerateReports);
            _ = Task();
        }