|
@@ -298,8 +298,8 @@ public class MainViewModel : ViewModelBase<IModel>
|
|
}
|
|
}
|
|
public void InitServiceMsg()
|
|
public void InitServiceMsg()
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<string>(Topic.SERVICERESULT).Subscrip((_, _) => Topic.SERVICERESULT);
|
|
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<Shaker.Models.AllConfig>(Shaker.Models.Topic.SYNCCONFIG).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<string>(Topic.SERVICERESULT)?.Subscrip((_, _) => Topic.SERVICERESULT);
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<Shaker.Models.AllConfig>(Shaker.Models.Topic.SYNCCONFIG)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
return new AllConfig()
|
|
return new AllConfig()
|
|
{
|
|
{
|
|
@@ -311,150 +311,176 @@ public class MainViewModel : ViewModelBase<IModel>
|
|
SweepConfig = SweepConfigViewModel.Instance.Model,
|
|
SweepConfig = SweepConfigViewModel.Instance.Model,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<DeviceInfoModel?>().Publish(this, ViewModels.DeviceMangerViewModel.Instance.CurrentDevice?.Model);
|
|
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<RandomTestStep>().Subscrip((sender, args) =>
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<ShakerConfigModel>()?.Subscrip((sender, args) =>
|
|
|
|
+ {
|
|
|
|
+ ShakerConfigViewModel.Instance.ReceiveServiceModel(args.Data);
|
|
|
|
+ });
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<ShakerControlModel>()?.Subscrip((sender, args) =>
|
|
|
|
+ {
|
|
|
|
+ ShakerControlViewModel.Instance.ReceiveServiceModel(args.Data);
|
|
|
|
+ });
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<SweepConfigModel>()?.Subscrip((sender, args) =>
|
|
|
|
+ {
|
|
|
|
+ SweepConfigViewModel.Instance.ReceiveServiceModel(args.Data);
|
|
|
|
+ });
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<RandomConfigModel>()?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent<RandomTestStep>().Publish(this, args.Data);
|
|
|
|
|
|
+ RandomConfigViewModel.Instance.ReceiveServiceModel(args.Data);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<MainPageType>().Subscrip((sender, args) =>
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<DeviceInfoModel?>()?.Publish(this, ViewModels.DeviceMangerViewModel.Instance.CurrentDevice?.Model);
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<RandomTestStep>()?.Subscrip((sender, args) =>
|
|
|
|
+ {
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent<RandomTestStep>()?.Publish(this, args.Data);
|
|
|
|
+ });
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent<MainPageType>()?.Subscrip((sender, args) =>
|
|
|
|
+ {
|
|
|
|
+ MainPageViewModel.Instance.MainPageType = args.Data;
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent<MainPageType>()?.Publish(this, args.Data);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent<MainPageType>()?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent<MainPageType>().Publish(this, args.Data);
|
|
|
|
|
|
+ MainPageViewModel.Instance.MainPageType = args.Data;
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Shaker.Models.Topic.START).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Shaker.Models.Topic.START)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.START).Publish(this);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.START)?.Publish(this);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.STARTRANDOMTEST).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.STARTRANDOMTEST)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STARTRANDOMTEST).Publish(this);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STARTRANDOMTEST)?.Publish(this);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.STOP).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.STOP)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STOP).Publish(this);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STOP)?.Publish(this);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.RISETABLE).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.RISETABLE)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.RISETABLE).Publish(this);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.RISETABLE)?.Publish(this);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.ZEROCHANGE).Subscrip((_, e) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.ZEROCHANGE)?.Subscrip((_, e) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.ZEROCHANGE).Publish(this, null, e.Data[0]);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.ZEROCHANGE)?.Publish(this, null, e.Data[0]);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.DROPTABLE).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.DROPTABLE)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.DROPTABLE).Publish(this);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.DROPTABLE)?.Publish(this);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.STOPSIGNALGEN).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.STOPSIGNALGEN)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STOPSIGNALGEN).Publish(this);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STOPSIGNALGEN)?.Publish(this);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.VALVEPOWER).Subscrip((_, e) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.VALVEPOWER)?.Subscrip((_, e) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STOPSIGNALGEN).Publish(this, null, e.Data[0]);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STOPSIGNALGEN)?.Publish(this, null, e.Data[0]);
|
|
});
|
|
});
|
|
|
|
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.STARTSIGNALGEN).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.STARTSIGNALGEN)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STARTSIGNALGEN).Publish(this);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.STARTSIGNALGEN)?.Publish(this);
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.RESETERROR).Subscrip((_, _) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.RESETERROR)?.Subscrip((_, _) =>
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.RESETERROR).Publish(this);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.RESETERROR)?.Publish(this);
|
|
});
|
|
});
|
|
|
|
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CircuitPressure).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CircuitPressure)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is float pressure)
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is float pressure)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CircuitPressure).Publish(this, null, index, pressure);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CircuitPressure)?.Publish(this, null, index, pressure);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CircuitStart).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CircuitStart)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is bool state)
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CircuitStart).Publish(this, null, index, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CircuitStart)?.Publish(this, null, index, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CircuitLoad).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CircuitLoad)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is bool state)
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CircuitLoad).Publish(this, null, index, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CircuitLoad)?.Publish(this, null, index, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.ForerunnerPressure).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.ForerunnerPressure)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.ForerunnerPressure).Publish(this, null, pressure);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.ForerunnerPressure)?.Publish(this, null, pressure);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.ForerunnerStart).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.ForerunnerStart)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.ForerunnerStart).Publish(this, null, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.ForerunnerStart)?.Publish(this, null, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.ForerunnerLoad).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.ForerunnerLoad)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.ForerunnerLoad).Publish(this, null, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.ForerunnerLoad)?.Publish(this, null, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.AssistantPressure).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.AssistantPressure)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.AssistantPressure).Publish(this, null, pressure);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.AssistantPressure)?.Publish(this, null, pressure);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.AssistantStart).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.AssistantStart)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.AssistantStart).Publish(this, null, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.AssistantStart)?.Publish(this, null, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.AssistantLoad).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.AssistantLoad)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.AssistantLoad).Publish(this, null, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.AssistantLoad)?.Publish(this, null, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CirculatePressure).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CirculatePressure)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CirculatePressure).Publish(this, null, pressure);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CirculatePressure)?.Publish(this, null, pressure);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CirculateStart).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CirculateStart)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CirculateStart).Publish(this, null, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CirculateStart)?.Publish(this, null, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CirculateLoad).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.CirculateLoad)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CirculateLoad).Publish(this, null, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.CirculateLoad)?.Publish(this, null, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.OilEmergencyStop).Subscrip((sender, args) =>
|
|
|
|
|
|
+ CommunicationViewModel.Instance.ServiceCommunication?.GetEvent(Topic.OilEmergencyStop)?.Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
- CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.OilEmergencyStop).Publish(this, null, state);
|
|
|
|
|
|
+ CommunicationViewModel.Instance.LocalCommunication?.GetEvent(Topic.OilEmergencyStop)?.Publish(this, null, state);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|