aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechGraphController.cs
blob: ca132095c4124f8859b7c5f18126e94051279297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using RealTimeGraphX;
using RealTimeGraphX.DataPoints;
using RealTimeGraphX.Renderers;
using RealTimeGraphX.WPF;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.MachineStudio.Technician
{
    public class TechGraphController : WpfGraphController<TimeSpanDataPoint, DoubleDataPoint>
    {
        public TechGraphController(int refreshRate = 50)
        {
            RefreshRate = TimeSpan.FromMilliseconds(50);
        }
    }
}
/span>); assert (isValid(deviceId)); //call driver action to device id with the parameter //SetMotorSpeed (deviceId, parameter); KeepParameter = parameter; ModuleCallback = callback; //start control: uint32_t ControlId = AddControlCallback( callback, eOneMillisecond, NULL, (IfTypeNone*0x100+deviceId),deviceId, parameter ); return ControlId; } uint32_t ControlCallBackFunction(uint32_t deviceId, uint32_t ReadValue) { if (ReadValue == KeepParameter) { //stop this control loop RemoveControlCallback(deviceId, ControlCallBackFunction ); //possibly: start regular control (speed etc) //uint32_t ControlId = AddControlCallback(ControlCBFunction Callback, eOneMillisecond, NULL, deviceId, Parameter ); //call the module callback ModuleCallback(deviceId,ReadValue); } return OK; } bool isValid (uint32_t deviceID) { return true; }