Example #1
0
        /// <summary>
        /// Initialize the view model.
        /// </summary>
        public OutputDataViewModel(string name)
        {
            base.DisplayName = name;

            NumBinsSelected = 4;
            MinBin          = 1;
            MaxBin          = 200;
            SelectedFormat  = ENCODING_PD6_PD13;
            FormatList      = new List <string>();
            FormatList.Add(ENCODING_Binary_ENS);
            FormatList.Add(ENCODING_PD0);
            FormatList.Add(ENCODING_PD6_PD13);
            FormatList.Add(ENCODING_VMDAS);
            //FormatList.Add(ENCODING_PD0);
            //FormatList.Add(ENCODING_RETRANSFORM_PD6);

            SelectedCoordTransform  = PD0.CoordinateTransforms.Coord_Earth;
            CoordinateTransformList = new List <PD0.CoordinateTransforms>();
            CoordinateTransformList.Add(PD0.CoordinateTransforms.Coord_Beam);
            CoordinateTransformList.Add(PD0.CoordinateTransforms.Coord_Instrument);
            CoordinateTransformList.Add(PD0.CoordinateTransforms.Coord_Ship);
            CoordinateTransformList.Add(PD0.CoordinateTransforms.Coord_Earth);

            _serialOptions = new SerialOptions();
            CommPortList   = SerialOptions.PortOptions;
            BaudRateList   = SerialOptions.BaudRateOptions;
            _SelectedBaud  = 115200;

            IsRetransformData = true;

            IsRecording = false;

            IsUseGpsHeading = true;
            HeadingOffset   = 0.0f;

            ShipXdcrOffset = 0.0f;

            DataOutput = "";

            _codecVmDas  = new VmDasAsciiCodec();
            _codecPd6_13 = new EnsToPd6_13Codec();

            // Bin List
            BinList = new List <int>();
            for (int x = 1; x <= 200; x++)
            {
                BinList.Add(x);
            }

            // Scan for ADCP command
            ScanCommand = ReactiveUI.Legacy.ReactiveCommand.Create();
            ScanCommand.Subscribe(_ => ScanForSerialPorts());

            // Disconnect Serial
            ConnectCommand = ReactiveUI.Legacy.ReactiveCommand.Create();
            ConnectCommand.Subscribe(_ => ConnectAdcpSerial());

            // Disconnect Serial
            DisconnectCommand = ReactiveUI.Legacy.ReactiveCommand.Create();
            DisconnectCommand.Subscribe(_ => DisconnectSerial());
        }
Example #2
0
        /// <summary>
        /// Initialize the object.
        /// </summary>
        public DataOutputViewModel()
            : base("Data Output")
        {
            base.DisplayName = "Data Output";

            // Subscribe to receive ensembles
            _eventAggregator = IoC.Get <IEventAggregator>();
            _eventAggregator.Subscribe(this);

            // Get PulseManager
            _pm = IoC.Get <PulseManager>();

            // Get the options from the database
            GetOptionsFromDatabase();

            NumBinsSelected = 4;
            FormatList      = new List <string>();
            FormatList.Add(DataOutputViewOptions.ENCODING_Binary_ENS);
            FormatList.Add(DataOutputViewOptions.ENCODING_PD0);
            FormatList.Add(DataOutputViewOptions.ENCODING_PD6_PD13);
            FormatList.Add(DataOutputViewOptions.ENCODING_VMDAS);
            //FormatList.Add(ENCODING_PD0);
            //FormatList.Add(ENCODING_RETRANSFORM_PD6);

            CoordinateTransformList = new List <PD0.CoordinateTransforms>();
            CoordinateTransformList.Add(PD0.CoordinateTransforms.Coord_Beam);
            CoordinateTransformList.Add(PD0.CoordinateTransforms.Coord_Instrument);
            CoordinateTransformList.Add(PD0.CoordinateTransforms.Coord_Ship);
            CoordinateTransformList.Add(PD0.CoordinateTransforms.Coord_Earth);

            HeadingSourceList = Enum.GetValues(typeof(Transform.HeadingSource)).Cast <Transform.HeadingSource>().ToList();

            _serialOptions = new SerialOptions();
            CommPortList   = SerialOptions.PortOptions;
            BaudRateList   = SerialOptions.BaudRateOptions;

            _manualWT = new VesselMount.VmManualWaterTrack();
            NumBins   = 200;

            DataOutput = "";

            _codecVmDas  = new VmDasAsciiCodec();
            _codecPd6_13 = new EnsToPd6_13Codec();

            // Bin List
            BinList = new List <int>();
            for (int x = 1; x <= 200; x++)
            {
                BinList.Add(x);
            }

            // Scan for ADCP command
            ScanCommand = ReactiveUI.ReactiveCommand.Create();
            ScanCommand.Subscribe(_ => ScanForSerialPorts());

            // Disconnect Serial
            ConnectCommand = ReactiveUI.ReactiveCommand.Create();
            ConnectCommand.Subscribe(_ => ConnectAdcpSerial());

            // Disconnect Serial
            DisconnectCommand = ReactiveUI.ReactiveCommand.Create();
            DisconnectCommand.Subscribe(_ => DisconnectSerial());
        }