/// <summary>
        /// Creates a PrinterViewModel with one X Axis ViewModel, one Y Axis ViewModel, one Z Axis ViewModel, and one PrintheadViewModel.
        /// </summary>
        /// <param name="PrinterModel"></param>
        public PrinterViewModel(PrinterModel PrinterModel, SerialCommunicationCommandSetsModel SerialCommunicationCommandSetsModel)
        {
            _printerModel = PrinterModel;
            _serialCommunicationCommandSetsModel = SerialCommunicationCommandSetsModel;
            _gPIOPinListsViewModel = new GPIOPinListsViewModel();

            _microcontrollerViewModel = new MicrocontrollerViewModel(_printerModel.MicroControllerModel, _gPIOPinListsViewModel);

            //Populates the Axis ViewModel lists with their Axis Model counterparts.
            foreach (AxisModel axisModel in _printerModel.AxisModelList)
            {
                AxisViewModel newAxisViewModel = new AxisViewModel(axisModel, _gPIOPinListsViewModel);

                _axisViewModelList.Add(newAxisViewModel);
                if (newAxisViewModel.Name.Contains('Z'))
                {
                    _zAxisViewModelList.Add(newAxisViewModel);
                }
            }

            //Populates the Printhead ViewModel lists with their Printhead Model counterparts.
            foreach (PrintheadModel printheadModel in _printerModel.PrintheadModelList)
            {
                _printheadViewModelList.Add(new PrintheadViewModel(printheadModel, _gPIOPinListsViewModel));
            }

            //Populates the empty PrintheadViewModel list with an empty Printhead.
            _emptyPrintheadViewModelList.Add(new PrintheadViewModel(new PrintheadModel(""), _gPIOPinListsViewModel));

            //Subscribe to events.
            SerialCommunicationCommandSetsModel.RealTimeStatusDataModel.RecordLimitExecuted += new RecordLimitExecutedEventHandler(UpdateMinMaxPositions);
            SerialCommunicationCommandSetsModel.CommandSetMinMaxPositionChanged             += new CommandSetMinMaxPositionChangedEventHandler(UpdateMinMaxPositions);
        }
예제 #2
0
        public PrinterXMLDeserializerModel(GPIOPinListsViewModel GPIOPinListsViewModel, PrinterViewModel PrinterViewModel, ErrorListViewModel ErrorListViewModel) : base(ErrorListViewModel)
        {
            _gPIOPinListsViewModel = GPIOPinListsViewModel;
            _printerViewModel      = PrinterViewModel;

            _axisXMLDeserializerModel      = new AxisXMLDeserializerModel(_printerViewModel, base._errorListViewModel);
            _printheadXMLDeserializerModel = new PrintheadXMLDeserializerModel(_printerViewModel, base._errorListViewModel);
        }
예제 #3
0
        public ModiPrintXMLDeserializerModel(GCodeManagerViewModel GCodeManagerViewModel, PrinterViewModel PrinterViewModel, GPIOPinListsViewModel GPIOPinListsViewModel, PrintViewModel PrintViewModel,
                                             ErrorListViewModel ErrorListViewModel) : base(ErrorListViewModel)
        {
            //ModiPrint parts.
            _gCodeManagerViewModel = GCodeManagerViewModel;
            _printerViewModel      = PrinterViewModel;
            _gPIOPinListsViewModel = GPIOPinListsViewModel;
            _printViewModel        = PrintViewModel;

            //XML Serializers.
            _gCodeManagerXMLDeserializerModel = new GCodeManagerXMLDeserializerModel(_errorListViewModel);
            _printerXMLDeserializerModel      = new PrinterXMLDeserializerModel(_gPIOPinListsViewModel, _printerViewModel, _errorListViewModel);
            _printXMLDeserializerModel        = new PrintXMLDeserializerModel(_printerViewModel, _errorListViewModel);
        }
예제 #4
0
 public AxisViewModel(AxisModel AxisModel, GPIOPinListsViewModel GPIOPinListsViewModel)
 {
     _axisModel             = AxisModel;
     _gPIOPinListsViewModel = GPIOPinListsViewModel;
 }
예제 #5
0
 public PrintheadViewModel(PrintheadModel PrintheadModel, GPIOPinListsViewModel GPIOPinListsViewModel)
 {
     _printheadModel        = PrintheadModel;
     _gPIOPinListsViewModel = GPIOPinListsViewModel;
 }
예제 #6
0
 public ValvePrintheadTypeViewModel(ValvePrintheadTypeModel ValvePrintheadTypeModel, GPIOPinListsViewModel GPIOPinListsViewModel) : base(ValvePrintheadTypeModel, GPIOPinListsViewModel)
 {
     _valvePrintheadTypeModel = ValvePrintheadTypeModel;
 }
예제 #7
0
 public CustomPrintheadTypeViewModel(CustomPrintheadTypeModel CustomPrintheadTypeModel, GPIOPinListsViewModel GPIOPinListsViewModel) : base(CustomPrintheadTypeModel, GPIOPinListsViewModel)
 {
     _customPrintheadTypeModel = CustomPrintheadTypeModel;
 }
 public MotorizedPrintheadTypeViewModel(MotorizedPrintheadTypeModel MotorizedPrintheadTypeModel, GPIOPinListsViewModel GPIOPinListsViewModel) : base(MotorizedPrintheadTypeModel, GPIOPinListsViewModel)
 {
     _motorizedPrintheadTypeModel = MotorizedPrintheadTypeModel;
 }