protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Graph);
            PlotView plotView = FindViewById <PlotView>(Resource.Id.plotView1);

            plotView.SetBackgroundColor(new Color(Color.White));

//            var param = plotView.LayoutParameters;
//            param.Height = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 250, Resources.DisplayMetrics);
//            plotView.LayoutParameters = param;

            var modelName = "vrmaglev";

            servicesProvider = new MatlabServicesProvider();

            var serviceOutput = servicesProvider.GetScopeData();

            JObject jsonObject = JObject.Parse(serviceOutput);

            if (jsonObject[modelName + "/Scope"]["1.0"] != null)
            {
                var scopeOneOutput = jsonObject[modelName + "/Scope"]["1.0"];
                plotView.Model = CreatePlotModel(scopeOneOutput[0].ToList(), scopeOneOutput[1].ToList());
            }

            if (jsonObject[modelName + "/Scope"]["2.0"] != null)
            {
            }
        }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.MainMenu);

            //Inicializing of static class
            BlockCustomizationHelper.LoadCustomizationXml();
            ConfigHelper.LoadXmlData();

            var servicesProvider = new MatlabServicesProvider();



            #region Basic Inicialization
            DrawAGraphButton        = FindViewById <Button>(Resource.Id.drawGraphButton);
            CheckMatlabStatusButton = FindViewById <Button>(Resource.Id.matlabStatusButton);
//            StopMatlabButton = FindViewById<Button>(Resource.Id.stopMatlabButton);
            ErrorText             = FindViewById <TextView>(Resource.Id.errorText);
            CustomizeSchemaButton = FindViewById <Button>(Resource.Id.customizeSchemaButton);
            localWebView          = FindViewById <WebView>(Resource.Id.uploadFileView);
            #endregion

            DrawAGraphButton.Click += delegate
            {
                StartActivity(typeof(DrawAGraphActivity));
//                servicesProvider.StartMatlab();
            };

            CheckMatlabStatusButton.Click += delegate
            {
                ErrorText.Text = servicesProvider.CheckMatlabStatus() ? "ide" : "nejde";
                //                Intent intent = new Intent(Intent.ActionGetContent);
                //                intent.SetType(".txt -> text/plain");
                //                StartActivityForResult(intent, PICKFILE_RESULT_CODE);
                //                ErrorText.Text = (servicesProvider.CheckMatlabStatus() == true)
                //                    ? "Matlab is running"
                //                    : "Matlab is not running";
            };



            CustomizeSchemaButton.Click += delegate
            {
                StartActivity(typeof(BlockCustomizationMain));
            };
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SetBlockParamValue);
            var servicesProvider = new MatlabServicesProvider();
            var editText         = FindViewById <EditText>(Resource.Id.changeParamValueEditText);

            var value = Intent.GetStringArrayListExtra("Block");

            FindViewById <TextView>(Resource.Id.textView1).Text = "Change value of " + value[0] + " -> " + value[1];
            editText.Text =
                servicesProvider.GetParamValue(BlockCustomizationHelper.GetSchemaName(), value[0], value[1]);
            FindViewById <Button>(Resource.Id.submitButton).Click += delegate
            {
//                servicesProvider.ChangeParamValue("model", value[0], value[1], 1);
                Android.Widget.Toast.MakeText(this, value[0] + " -> " + value[1] + " = " + FindViewById <EditText>(Resource.Id.changeParamValueEditText).Text, Android.Widget.ToastLength.Short).Show();
                servicesProvider.ChangeParamValue(BlockCustomizationHelper.GetSchemaName(), value[0], value[1], editText.Text);
                StartActivity(typeof(MainActivity));
            };


            // Create your application here
        }