示例#1
0
 public void DeviceCmdFromView(DeviceCmdArgEvent deviceCmdArgEvent)
 {
     switch (deviceCmdArgEvent.cmd)
     {
             case DeviceCmd.START_MEASURE:
                 _device.StartMeasurement();
             break;
             case DeviceCmd.STOP_MEASURE:
                 _device.StopMeasurement();
             break;
             case DeviceCmd.ZERO_CALIBRATE:
                 _device.Calibrate(null,false,100);
             break;
             case DeviceCmd.STARTUP_CALIBRATE:
                 _device.Calibrate(null,true,100);
             break;
             case DeviceCmd.WEIGHT_CALIBRATE:
                 _device.Calibrate(deviceCmdArgEvent.Params,false);
             break;
             case DeviceCmd.WEIGHT_CALIBRATE_FAST:
                 _device.Calibrate(deviceCmdArgEvent.Params,true);
             break;
             case DeviceCmd.WEIGHT_MEASURE:
                 _device.GetWeight();
             break;
         default:
             break;
     }
 }
 private void ViewOnDeviceCmdEvent(object sender, DeviceCmdArgEvent e)
 {
     _model.DeviceCmdFromView(e);
 }