/************************************************************************************************************************ **************************************************************************************************************************/ #include #include #include "include.h" #include "PMR/Hardware/UploadHardWareConfigurationRequest.pb-c.h" #include "PMR/Hardware/HardWareConfiguration.pb-c.h" #include "PMR/Hardware/HardwareMotor.pb-c.h" #include "PMR/Hardware/HardwareDancer.pb-c.h" #include "PMR/Hardware/HardwareWinder.pb-c.h" #include "PMR/Hardware/HardwareBreakSensor.pb-c.h" #include "PMR/Printing/JobSpool.pb-c.h" #include "PMR/common/MessageContainer.pb-c.h" #include "Common/SWUpdate/FileSystem.h" #include "drivers/Flash_Memory/fatfs/ff.h" #include "drivers/SSI_Comm/Dancer/Dancer.h" #include "drivers/Flash_ram/FlashProgram.h" #include "drivers/Flash_ram/MCU_E2Prom.h" #include "thread.h" MotorDriverConfigStruc MotorsCfg[NUM_OF_MOTORS]={0}; HardwarePidControl MotorsControl[MAX_THREAD_MOTORS_NUM] = {0}; double MotorSpeedSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES] = {0}; int MotorSpeedSamplePointer[MAX_THREAD_MOTORS_NUM] = {0}; int32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES] = {0}; int MotorSamplePointer[MAX_THREAD_MOTORS_NUM] = {0}; double NormalizedErrorCoEfficient[MAX_THREAD_MOTORS_NUM] = {0}; int DancerStopActivityLimit[MAX_THREAD_MOTORS_NUM] = {0}; HardwareDancer DancersCfg[MAX_SYSTEM_DANCERS] = {0}; #define BREAK_SENSOR_LIMIT 10 bool BreakSensorenabled; int32_t BreakSensordebouncetimemilli = BREAK_SENSOR_LIMIT; HardwarePidControlType ThreadMotorIdToControlId[MAX_THREAD_MOTORS_NUM] = {HARDWARE_PID_CONTROL_TYPE__MotorFeeder,HARDWARE_PID_CONTROL_TYPE__MotorDryer,HARDWARE_PID_CONTROL_TYPE__MotorPooler,HARDWARE_PID_CONTROL_TYPE__MotorWinder,0}; //******************************************************************************************************************** uint32_t MotorsConfigMessage(HardwareConfiguration * HWrequest) { uint32_t status = PASSED; TimerMotors_t Motor_i,MotorId; HardwareMotor *request; if (HWrequest == NULL) return ERROR; for (MotorId = 0; MotorId < HWrequest->n_motors ; MotorId++) { request = HWrequest->motors[MotorId]; if (request == NULL) return ERROR; Motor_i = request->hardwaremotortype; MotorsCfg[Motor_i].configword = request->configword; MotorsCfg[Motor_i].hardwaremotortype = request->hardwaremotortype; MotorsCfg[Motor_i].minfrequency = request->minfrequency; MotorsCfg[Motor_i].maxfrequency = request->maxfrequency; MotorsCfg[Motor_i].setmicrostep = request->setmicrostep; MotorsCfg[Motor_i].microstep = request->microstep; MotorsCfg[Motor_i].maxchangeslope = request->maxchangeslope; MotorsCfg[Motor_i].highlengthmicrosecond = request->highlengthmicrosecond; MotorsCfg[Motor_i].speedmaster = request->speedmaster; MotorsCfg[Motor_i].pulseperround = request->pulseperround; MotorsCfg[Motor_i].pulleyradius = request->pulleyradius; MotorsCfg[Motor_i].configword = request->configword; if(MotorDriverResponse[Motor_i].DriverType == CombinrdMotDriver) { MotorsCfg[Motor_i].directionthreadwize = !(request->directionthreadwize);//PowerSTEP01 } else { MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize;//L6470 + L6472 } MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize; MotorsCfg[Motor_i].kvalhold = request->kvalhold; MotorsCfg[Motor_i].kvalrun = request->kvalrun; MotorsCfg[Motor_i].kvalacc = request->kvalacc; MotorsCfg[Motor_i].kvaldec = request->kvaldec; MotorsCfg[Motor_i].overcurrentthreshold = request->overcurrentthreshold; MotorsCfg[Motor_i].stallthreshold = request->stallthreshold; MotorsCfg[Motor_i].thermalcompensationfactor = request->thermalcompensationfactor; MotorsCfg[Motor_i].lowspeedoptimization = request->lowspeedoptimization; MotorsCfg[Motor_i].stslp = request->stslp; MotorsCfg[Motor_i].intspd = request->intspd; MotorsCfg[Motor_i].fnslpacc = request->fnslpacc; MotorsCfg[Motor_i].fnslpdec = request->fnslpdec; MotorsCfg[Motor_i].fsspd = request->fsspd; MotorsCfg[Motor_i].gatecfg1 = request->gatecfg1; MotorsCfg[Motor_i].gatecfg2 = request->gatecfg2; MotorsCfg[Motor_i].tvalhold = request->tvalhold; MotorsCfg[Motor_i].tvalrun = request->tvalrun ; MotorsCfg[Motor_i].tvalacc = request->tvalacc ; MotorsCfg[Motor_i].tvaldec = request->tvaldec ; MotorsCfg[Motor_i].tfast = request->tfast ; MotorsCfg[Motor_i].tonmin = request->tonmin ; MotorsCfg[Motor_i].toffmin = request->toffmin ; status = MotorConfig( Motor_i, &MotorsCfg[Motor_i]); // if (Motor_i == MOTOR_RDRIVING) // ThreadInitialTestStub(request); } return status; } uint32_t MotorPidRequestMessage(HardwarePidControl* request) { int Motor_i,i; int temp; for (i=0;ihardwarepidcontroltype) { Motor_i = i; break; } } memcpy (&MotorsControl[Motor_i],request,sizeof(HardwarePidCon
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.MachineStudio.MachineDesigner.Views
{
    /// <summary>
    /// Interaction logic for MachineDetailsView.xaml
    /// </summary>
    public partial class MachineDetailsView : UserControl
    {
        public MachineDetailsView()
        {
            InitializeComponent();
        }
    }
}