blob: 19f51c4e61afe316bab649025a0d9e2cf3b90a5e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
using System;
using System.Text;
using System.Linq;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Tango.PMR.Hardware;
using Tango.PMR.Stubs;
using Tango.Stubs.UI;
public void OnExecute(StubManager stubManager)
{
UploadHardwareConfigurationRequest uploadHardwareConfigurationRequest = new UploadHardwareConfigurationRequest();
HardwareConfiguration hardwareConfiguration = new HardwareConfiguration();
StubMotorInitRequest stubMotorInitRequest = new StubMotorInitRequest();
stubMotorInitRequest.MotorID = 0;
stubMotorInitRequest.MicroSteps = 0;
stubMotorInitRequest.SetMicroSteps = false;
stubMotorInitRequest.ACC = 0;
stubMotorInitRequest.SetACC = false;
stubMotorInitRequest.DEC = 0;
stubMotorInitRequest.SetDec = false;
stubMotorInitRequest.MaxSpeed = 0;
stubMotorInitRequest.SetMaxSpeed = false;
HardwareMotor hardwareMotor = new HardwareMotor();
hardwareMotor.HardwareMotorType = Tango.PMR.Hardware.HardwareMotorType.MotoDryerDriving;
hardwareMotor.MinFrequency = 0;
hardwareMotor.MaxFrequency = 8000;
hardwareMotor.MinMicroStep = 8;
hardwareMotor.MaxMicroStep = 8;
hardwareMotor.LinearRatio = 0;
hardwareMotor.MedianPosition = 0;
hardwareMotor.CorrectionGain = 0;
hardwareMotor.RatioToDryerSpeed = 1;
hardwareMotor.Kp = 500;
hardwareMotor.Ki = 100;
hardwareMotor.Kd = 0;
hardwareMotor.ChangeSlope = 0;
hardwareMotor.HighLengthMicroSecond = 0;
hardwareMotor.SpeedMaster = true;
hardwareConfiguration.Motors.Add(hardwareMotor);
uploadHardwareConfigurationRequest.HardwareConfiguration = hardwareConfiguration;
var response = stubManager.Run<UploadHardwareConfigurationResponse>(uploadHardwareConfigurationRequest);
}
|