Commit c875c6ff by wangonghui

数据任务开始添加按钮选项

parent aa1d5cc6
......@@ -81,11 +81,11 @@ namespace VIZ.TVP.CBA.Module
CompareItemToNumber.Add("抢断", teamLiveH.Steals);
CompareItemToNumber.Add("盖帽", teamLiveH.Blocked);
CompareItemToNumber.Add("上场时间", teamLiveH.Minutes);
CompareItemToNumber.Add("投篮命中率", (teamLiveH.FieldGoalsPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("投篮命中率", (teamLiveH.FieldGoalsPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("两分命中率", (teamLiveH.TwoPointPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("三分命中率", (teamLiveH.ThreePointPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("罚球命中率", (teamLiveH.FreeThrowsPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("三分命中率", (teamLiveH.ThreePointPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("罚球命中率", (teamLiveH.FreeThrowsPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("篮下投篮命中率", (teamLiveH.FieldGoalsAtRimPercentage * 100).ToString("F1") + "%");
CompareItemToNumber.Add("中距离投篮命中率", (teamLiveH.FieldGoalsMidRangePercentage * 100).ToString("F1") + "%");
CompareItemToNumber.Add("三分", teamLiveH.ThreePointGoals + "/"
......@@ -113,8 +113,6 @@ namespace VIZ.TVP.CBA.Module
}
//}
......
......@@ -27,9 +27,10 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WrapPanel Width="650" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.ColumnSpan="3" Margin="-2,0,0,0" >
<WrapPanel Width="650" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-2,0,0,0" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"/>
......@@ -37,7 +38,8 @@
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="130"/>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="70"/>
<ColumnDefinition Width="70"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="标题:" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center"/>
......@@ -46,21 +48,7 @@
HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Title,Mode=TwoWay }"></dxe:TextEdit>
<TextBlock TextBlock.TextAlignment="Center" Text="日期:" Width="60" Grid.Column="2" FontSize="16" VerticalAlignment="Center"/>
<!--<DatePicker Grid.Column="3" HorizontalAlignment="Center" Name="Date_MatchDate" Width="200"
SelectedDate="{Binding MatchDate,Mode=TwoWay}" FontSize="20" >
<DatePicker.Resources>
<Style TargetType="DatePickerTextBox">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<TextBox x:Name="PART_TextBox" Text="{Binding Path=SelectedDate, StringFormat={}{0:yyyy-MM-dd}, RelativeSource={RelativeSource AncestorType={x:Type DatePicker}}}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DatePicker.Resources>
</DatePicker>-->
<dxe:DateEdit Grid.Column="3" HorizontalAlignment="Center" FontSize="16" EditValue="{Binding MatchDate,Mode=TwoWay}"
ShowToday="False" ShowClearButton="False"
......@@ -71,52 +59,31 @@
<Button Content="加载数据" Command="{Binding BtnCmd}" HorizontalContentAlignment="Center"
Grid.Column="4" Width="100" Height="30" FontSize="14" />
<!--<Button Content="赛程数据上" Command="{Binding BtnMatchDayUp}" HorizontalContentAlignment="Center"
Grid.Column="5" Width="110" Height="30" FontSize="14" />-->
</Grid>
</WrapPanel>
<WrapPanel Width="650" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Center" Margin="-2,0,0,0" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<Button Content="任务开始" Name="task_Start" Click="task_Start_Click" Grid.Column="0" FontSize="16" Height="30" Width="90"/>
<Button Content="任务暂停" Name="task_continue" Click="task_continue_Click" Grid.Column="1" FontSize="16" Height="30" Width="90"/>
<Button Content="任务停止" Name="task_Stop" Click="task_Stop_Click" Grid.Column="2" FontSize="16" Height="30" Width="90"/>
</Grid>
</WrapPanel>
<!--<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
ItemsSource="{Binding Path=MatchData}" Grid.Row="1" Background="Black" RowHeaderWidth="0" >
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
<Setter Property="Background" Value="Black"></Setter>
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="BorderThickness" Value="1"></Setter>
<Setter Property="FontSize" Value="20"/>
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<DataGridComboBoxColumn Header="" Width="100"
SelectedItemBinding="{Binding Path=Light,Mode=TwoWay,Converter={StaticResource Enum2EnumDescriptionConverter}}"
ItemsSource="{Binding Source={x:Static Member=storage:StaticEnumInfos.EnumDescriptions}}"
CellStyle="{StaticResource DataGirdView_UI}" >
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="Background" Value="Black"></Setter>
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="Background" Value="Black"/>
</Style>
</DataGridComboBoxColumn.ElementStyle>
</DataGridComboBoxColumn>
<DataGridTextColumn Header="日期" Width="*" Binding="{Binding Path=dates}" CellStyle="{StaticResource DataGirdView_UI}" ></DataGridTextColumn>
<DataGridTextColumn Header="时间" Width="*" Binding="{Binding Path=time}" CellStyle="{StaticResource DataGirdView_UI}"></DataGridTextColumn>
<DataGridTextColumn Header="主队" Width="*" Binding="{Binding Path=HomeTeamName}" CellStyle="{StaticResource DataGirdView_UI}"></DataGridTextColumn>
<DataGridTextColumn Header="主队得分" Width="*" Binding="{Binding Path=HomeTeamScore}" CellStyle="{StaticResource DataGirdView_UI}"></DataGridTextColumn>
<DataGridTextColumn Header="客队" Width="*" Binding="{Binding Path=VisitingTeamName}" CellStyle="{StaticResource DataGirdView_UI}"></DataGridTextColumn>
<DataGridTextColumn Header="客队得分" Width="*" Binding="{Binding Path=VisitingTeamScore}" CellStyle="{StaticResource DataGirdView_UI}"></DataGridTextColumn>
<DataGridTextColumn Header="比赛状态" Width="*" Binding="{Binding Path=Status}" CellStyle="{StaticResource DataGirdView_UI}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>-->
<DockPanel Grid.Row="1" Grid.ColumnSpan="2">
<DockPanel Grid.Row="2" >
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"
......
......@@ -38,8 +38,11 @@ namespace VIZ.TVP.CBA.Module
WPFHelper.BindingViewModel(this, new DayMatchViewModel());
vm=this.DataContext as DayMatchViewModel;
task_Start.IsEnabled = true;
task_Stop.IsEnabled = false;
task_continue.IsEnabled = false;
this.Loaded += DayMatchView_Load;
}
......@@ -138,11 +141,20 @@ namespace VIZ.TVP.CBA.Module
}
/// <summary>
/// 任务模型
/// </summary>
public PackageTaskModel task;
/// <summary>
/// 注册服务
/// </summary>
IPackageTaskService service;
/// <summary>
/// 注册任务
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DayMatchView_Load(object sender,RoutedEventArgs e)
private void DayMatchView_TaskInit()
{
if (task != null)
return;
......@@ -150,25 +162,27 @@ namespace VIZ.TVP.CBA.Module
task = new PackageTaskModel(this);
task.PreviewUpdateAction = OnPreviewUpdate;
task.TakeUpdateAction = OnTakeUpdate;
task.IsPreviewEnabled = true;
task.IsTakeEnabled = true;
task.IsRunning = true;
task.Name = "今日赛程";
IPackageTaskService service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
if (service == null)
return;
service.Register(task);
}
/// <summary>
/// 任务模型
/// </summary>
public PackageTaskModel task;
private void OnPreviewUpdate(ConnModel conn)
{
Log.Error(conn.IsConnected.ToString());
if (conn.IsConnected)
{
vm.GetSchedule();
......@@ -190,6 +204,41 @@ namespace VIZ.TVP.CBA.Module
}
private void task_Start_Click(object sender, RoutedEventArgs e)
{
DayMatchView_TaskInit();
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
task_continue.IsEnabled = true;
}
private void task_continue_Click(object sender, RoutedEventArgs e)
{
if(task.IsRunning)
{
task.IsRunning = false;
task_continue.Content = "任务继续";
}
else
{
task.IsRunning = true;
task_continue.Content = "任务暂停";
}
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
}
private void task_Stop_Click(object sender, RoutedEventArgs e)
{
service.Cancel(task);
task = null;
task_Start.IsEnabled = true;
task_continue.Content = "任务暂停";
task_continue.IsEnabled = false;
task_Stop.IsEnabled = false;
}
}
}
......@@ -185,89 +185,98 @@ namespace VIZ.TVP.CBA.Module
/// <returns></returns>
public string CombineMatchData()
{
string data="";
data += title+"&";
try
foreach (var tempMatchData in matchData)
{
if (tempMatchData.SelectLight=="不高亮")
{
data += "0";
}
else
{
data += "1";
}
string data = "";
data += title + "&";
data += "*";
if (string.IsNullOrEmpty(tempMatchData.dates))
{
data += "";
}
else
foreach (var tempMatchData in matchData)
{
data += tempMatchData.dates.Replace(" ", "");
}
if (tempMatchData.SelectLight == "不高亮")
{
data += "0";
}
else
{
data += "1";
}
data += "*";
data += "*";
if (string.IsNullOrEmpty(tempMatchData.dates))
{
data += "";
}
else
{
data += tempMatchData.dates.Replace(" ", "");
}
if (string.IsNullOrEmpty(tempMatchData.time))
{
data += "";
}
else
{
data += tempMatchData.time.Replace(" ", "");
}
data += "*";
data += "*";
data += tempMatchData.HomeTeamName.Replace(" ","");
if (string.IsNullOrEmpty(tempMatchData.time))
{
data += "";
}
else
{
data += tempMatchData.time.Replace(" ", "");
}
data += "*";
data += "*";
if(string.IsNullOrEmpty(tempMatchData.HomeTeamScore))
{
data += "";
}
else
{
data += tempMatchData.HomeTeamScore.Replace(" ", "");
}
data += tempMatchData.HomeTeamName.Replace(" ", "");
data += "*";
data += tempMatchData.VisitingTeamName.Replace(" ","");
data += "*";
data += "*";
if (string.IsNullOrEmpty(tempMatchData.HomeTeamScore))
{
data += "";
}
else
{
data += tempMatchData.HomeTeamScore.Replace(" ", "");
}
if(string.IsNullOrEmpty(tempMatchData.VisitingTeamScore))
{
data += "";
}
else
{
data += tempMatchData.VisitingTeamScore.Replace(" ", "");
}
data += "*";
data += "*";
data += tempMatchData.VisitingTeamName.Replace(" ", "");
data += "*";
if (string.IsNullOrEmpty(tempMatchData.VisitingTeamScore))
{
data += "";
}
else
{
data += tempMatchData.VisitingTeamScore.Replace(" ", "");
}
data += "*";
if (string.IsNullOrEmpty(tempMatchData.Status))
{
data += "";
}
else
{
data += tempMatchData.Status.Replace(" ", "");
}
data += ";";
if(string.IsNullOrEmpty(tempMatchData.Status))
{
data += "";
}
else
{
data += tempMatchData.Status.Replace(" ", "");
}
data += ";";
return data;
}
catch(Exception ex)
{
Log.Error(ex.ToString());
return "";
}
return data;
}
}
......
......@@ -114,6 +114,7 @@ namespace VIZ.TVP.CBA.Module
}
/// <summary>
/// 设置一个比赛赛程集合
......@@ -450,6 +451,67 @@ namespace VIZ.TVP.CBA.Module
public VCommand RefreshPlayerCommand { get; set; }
/// <summary>
/// 总得分
/// </summary>
private double totalScore;
public double TotalScore
{
get { return totalScore; }
set
{
totalScore = value;
this.RaisePropertyChanged(nameof(TotalScore));
}
}
/// <summary>
/// 总篮板
/// </summary>
private double totalRebounds;
public double TotalRebounds
{
get { return totalRebounds; }
set
{
totalRebounds = value;
this.RaisePropertyChanged(nameof(TotalRebounds));
}
}
/// <summary>
/// 总助攻
/// </summary>
private double totalAssists;
public double TotalAssists
{
get { return totalAssists; }
set
{
totalAssists = value;
this.RaisePropertyChanged(nameof(TotalAssists));
}
}
/// <summary>
/// 总盖帽
/// </summary>
private double totalBlocks;
public double TotalBlocks
{
get { return totalBlocks; }
set
{
totalBlocks = value;
this.RaisePropertyChanged(nameof(TotalBlocks));
}
}
private int flag = -1;
......@@ -519,21 +581,29 @@ namespace VIZ.TVP.CBA.Module
flag = 0;
ShowInfoPlayersStats = new ObservableCollection<PlayersStats>();
double scores = 0;
double rebounds=0;
double assists = 0;
double blocks = 0;
foreach (var playerStat in onAirDataModel.livePlayerStatH)
{
PlayersStats player = new PlayersStats();
player.PlayerName = playerStat.CNAlias;
scores += Convert.ToDouble(playerStat.Points);
player.Goal = playerStat.Points;
rebounds += Convert.ToDouble(playerStat.Rebounds);
player.Rebounds = playerStat.Rebounds;
player.Assists = playerStat.Assists;
assists += Convert.ToDouble(playerStat.Assists);
player.Steals = playerStat.Steals;
blocks += Convert.ToDouble(playerStat.Blocked);
player.Blocks = playerStat.Blocked;
player.PlayTime = playerStat.Minutes;
player.ShootingGoalP = (playerStat.FieldGoalsPercentage).ToString("F1") + "%";
player.ShootingGoalP = (playerStat.FieldGoalsPercentage*100).ToString("F1") + "%";
player.TwoShootingGoalP = (playerStat.TwoPointPercentage).ToString("F1") + "%";
player.ThreeShootingGoalP = (playerStat.ThreePointPercentage).ToString("F1") + "%";
player.FreeThrowP = (playerStat.FreeThrowsPercentage).ToString("F1") + "%";
player.ThreeShootingGoalP = (playerStat.ThreePointPercentage*100).ToString("F1") + "%";
player.FreeThrowP = (playerStat.FreeThrowsPercentage*100).ToString("F1") + "%";
player.ShootingUnderBaketP= (playerStat.FieldGoalsAtRimPercentage * 100).ToString("F1") + "%";
player.MidShootingP = (playerStat.FieldGoalsMidRangePercentage * 100).ToString("F1") + "%";
......@@ -553,8 +623,10 @@ namespace VIZ.TVP.CBA.Module
}
ShowInfoPlayersStats = ShowInfoPlayersStats.OrderByDescending(a => Convert.ToInt32(a.Goal)).ToObservableCollection();
TotalScore = scores;
TotalRebounds = rebounds;
TotalAssists = assists;
TotalBlocks = blocks;
}
......@@ -567,15 +639,23 @@ namespace VIZ.TVP.CBA.Module
flag = 1;
ShowInfoPlayersStats = new ObservableCollection<PlayersStats>();
double scores = 0;
double rebounds = 0;
double assists = 0;
double blocks = 0;
foreach (var playerStat in onAirDataModel.livePlayerStatV)
{
PlayersStats player = new PlayersStats();
player.PlayerName = playerStat.CNAlias;
scores += Convert.ToDouble(playerStat.Points);
player.Goal = playerStat.Points;
rebounds += Convert.ToDouble(playerStat.Rebounds);
player.Rebounds = playerStat.Rebounds;
assists += Convert.ToDouble(playerStat.Assists);
player.Assists = playerStat.Assists;
player.Steals = playerStat.Steals;
blocks += Convert.ToDouble(playerStat.Blocked);
player.Blocks = playerStat.Blocked;
player.PlayTime = playerStat.Minutes;
player.ShootingGoalP = (playerStat.FieldGoalsPercentage).ToString("F1") + "%";
......@@ -602,6 +682,10 @@ namespace VIZ.TVP.CBA.Module
ShowInfoPlayersStats = ShowInfoPlayersStats.OrderByDescending(a => Convert.ToInt32(a.Goal)).ToObservableCollection();
TotalScore = scores;
TotalRebounds = rebounds;
TotalAssists = assists;
TotalBlocks = blocks;
}
......
......@@ -34,34 +34,7 @@
<RowDefinition Height="160"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--<WrapPanel Grid.Row="0" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="280"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Text="比赛日期:" Grid.Column="0" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<dxe:DateEdit Grid.Column="1" HorizontalAlignment="Center" Name="Date_MatchDateInfo" Width="120"
EditValue="{Binding MatchDate,Mode=TwoWay}" FontSize="16" ShowToday="False" ShowClearButton="False"
VerticalAlignment="Center" MaskUseAsDisplayFormat="True" >
</dxe:DateEdit>
<TextBlock Text="赛程:" Grid.Column="2" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<dxe:ComboBoxEdit Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"
Width="280" ItemsSource="{Binding Path=MatchItems,Mode=TwoWay}"
SelectedItem="{Binding Path=SelectMatchItems,Mode=TwoWay}" >
</dxe:ComboBoxEdit>
<TextBox Grid.Column="4" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding MatchStatus,Mode=TwoWay}" Width="80"/>
</Grid>
</WrapPanel>-->
<WrapPanel Grid.Row="1" Height="160" Width="650" HorizontalAlignment="Left" VerticalAlignment="Center" >
<Grid >
<Grid.RowDefinitions>
......@@ -76,11 +49,18 @@
<ColumnDefinition Width="70"/>
<ColumnDefinition Width="130"/>
<ColumnDefinition Width="127"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="127"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="标题" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Button Grid.Row="0" Content="任务开始" Name="task_Start" Click="task_Start_Click" Grid.Column="3" FontSize="14" Height="30" Width="90"/>
<Button Grid.Row="0" Content="任务暂停" Name="task_continue" Click="task_continue_Click" Grid.Column="4" FontSize="14" Height="30" Width="90"/>
<Button Grid.Row="0" Content="任务停止" Name="task_Stop" Click="task_Stop_Click" Grid.Column="5" FontSize="14" Height="30" Width="90"/>
<dxe:TextEdit Grid.Row="0" Grid.Column="1" Width="120"
FontSize="16" HorizontalContentAlignment="Center"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Title,Mode=TwoWay }" />
......@@ -94,7 +74,7 @@
<dxe:TextEdit Text="{Binding AName,Mode=TwoWay}" Grid.Row="1" Grid.Column="3" Width="120" FontSize="16" VerticalAlignment="Center" />
<Button Content="刷新" Command="{Binding BtnCommand}" HorizontalContentAlignment="Center"
Grid.Row="1" Grid.Column="5" Width="80" Height="30" FontSize="14"/>
Grid.Row="1" Grid.Column="5" Width="90" Height="30" FontSize="14"/>
<TextBlock Grid.Row="2" TextBlock.TextAlignment="Center" Text="主队球员" Width="65" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
......
......@@ -32,7 +32,11 @@ namespace VIZ.TVP.CBA.Module
PlayerCompareViewModel.PlayerCompareViewModelInstance.Add(vm);
WPFHelper.BindingViewModel(this, vm);
this.Loaded += PlayerComPareView_Load;
task_Start.IsEnabled = true;
task_Stop.IsEnabled = false;
task_continue.IsEnabled = false;
}
public void Dispose()
......@@ -97,7 +101,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PlayerComPareView_Load(object sender, RoutedEventArgs e)
private void PlayerComPareView_Init()
{
if (task != null)
return;
......@@ -105,9 +109,15 @@ namespace VIZ.TVP.CBA.Module
task = new PackageTaskModel(this);
task.PreviewUpdateAction = OnPreviewUpdate;
task.TakeUpdateAction = OnTakeUpdate;
task.IsPreviewEnabled = true;
task.IsTakeEnabled = true;
task.IsRunning = true;
task.Name = "球员对比";
IPackageTaskService service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
if (service == null)
return;
......@@ -121,6 +131,8 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
public PackageTaskModel task;
IPackageTaskService service;
private void OnPreviewUpdate(ConnModel conn)
{
if (conn.IsConnected)
......@@ -143,5 +155,39 @@ namespace VIZ.TVP.CBA.Module
}
}
private void task_Start_Click(object sender, RoutedEventArgs e)
{
PlayerComPareView_Init();
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
task_continue.IsEnabled = true;
}
private void task_continue_Click(object sender, RoutedEventArgs e)
{
if (task.IsRunning)
{
task.IsRunning = false;
task_continue.Content = "任务继续";
}
else
{
task.IsRunning = true;
task_continue.Content = "任务暂停";
}
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
}
private void task_Stop_Click(object sender, RoutedEventArgs e)
{
service.Cancel(task);
task = null;
task_Start.IsEnabled = true;
task_continue.Content = "任务暂停";
task_continue.IsEnabled = false;
task_Stop.IsEnabled = false;
}
}
}
......@@ -149,11 +149,11 @@ namespace VIZ.TVP.CBA.Module
CompareItemToNumber.Add("抢断", teamLive.Steals);
CompareItemToNumber.Add("盖帽", teamLive.Blocked);
CompareItemToNumber.Add("上场时间", teamLive.Minutes);
CompareItemToNumber.Add("投篮命中率", (teamLive.FieldGoalsPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("投篮命中率", (teamLive.FieldGoalsPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("两分命中率", (teamLive.TwoPointPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("三分命中率", (teamLive.ThreePointPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("罚球命中率", (teamLive.FreeThrowsPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("三分命中率", (teamLive.ThreePointPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("罚球命中率", (teamLive.FreeThrowsPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("篮下投篮命中率", (teamLive.FieldGoalsAtRimPercentage * 100).ToString("F1") + "%");
CompareItemToNumber.Add("中距离投篮命中率", (teamLive.FieldGoalsMidRangePercentage * 100).ToString("F1") + "%");
CompareItemToNumber.Add("三分", teamLive.ThreePointGoals + "/"
......@@ -205,11 +205,11 @@ namespace VIZ.TVP.CBA.Module
CompareItemToNumber.Add("抢断", teamLive.Steals);
CompareItemToNumber.Add("盖帽", teamLive.Blocked);
CompareItemToNumber.Add("上场时间", teamLive.Minutes);
CompareItemToNumber.Add("投篮命中率", (teamLive.FieldGoalsPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("投篮命中率", (teamLive.FieldGoalsPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("两分命中率", (teamLive.TwoPointPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("三分命中率", (teamLive.ThreePointPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("罚球命中率", (teamLive.FreeThrowsPercentage).ToString("F1") + "%");
CompareItemToNumber.Add("三分命中率", (teamLive.ThreePointPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("罚球命中率", (teamLive.FreeThrowsPercentage*100).ToString("F1") + "%");
CompareItemToNumber.Add("篮下投篮命中率", (teamLive.FieldGoalsAtRimPercentage * 100).ToString("F1") + "%");
CompareItemToNumber.Add("中距离投篮命中率", (teamLive.FieldGoalsMidRangePercentage * 100).ToString("F1") + "%");
CompareItemToNumber.Add("三分", teamLive.ThreePointGoals + "/"
......@@ -633,7 +633,7 @@ namespace VIZ.TVP.CBA.Module
if (APlayer == null) return;
APlayerLogo = new BitmapImage(new Uri(string.Format("{0}Image\\Teamlogo\\{1}.png", baesePath, HName)));
APlayerLogo = new BitmapImage(new Uri(string.Format("{0}Image\\Teamlogo\\{1}.png", baesePath, AName)));
if (VNameNums.ContainsKey(APlayer))
{
ANums = VNameNums[APlayer];
......
......@@ -129,6 +129,7 @@
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="标题:" FontSize="16" HorizontalAlignment="Right" VerticalAlignment="Center"/>
......@@ -136,7 +137,15 @@
<dxe:TextEdit Grid.Column="1" Width="120" FontSize="16" HorizontalContentAlignment="Center"
HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Title,Mode=TwoWay }"></dxe:TextEdit>
<Button Content="刷新" Command="{Binding BtnCmd}" HorizontalContentAlignment="Center"
Grid.Column="3" Width="95" Height="30" FontSize="14"/>
Grid.Column="2" Width="95" Height="30" FontSize="14"/>
<Button Content="任务开始" Name="task_Start" Click="task_Start_Click" Grid.Column="3" FontSize="14" Height="30" Width="90"/>
<Button Content="任务暂停" Name="task_continue" Click="task_continue_Click" Grid.Column="4" FontSize="14" Height="30" Width="90"/>
<Button Content="任务停止" Name="task_Stop" Click="task_Stop_Click" Grid.Column="5" FontSize="14" Height="30" Width="90"/>
<!--<Button Content="单人球员" Command="{Binding SingleCommand}" HorizontalContentAlignment="Center"
Grid.Column="3" Width="95" Height="30" FontSize="14"/>
<Button Content="MVP球员" Command="{Binding MVPCommand}" HorizontalContentAlignment="Center"
......
......@@ -33,7 +33,10 @@ namespace VIZ.TVP.CBA.Module
//vm = new SinglePlayerViewModel(); dqyData
SinglePlayerViewModel.SinglePlayerViewModelInstance.Add(vm) ;
WPFHelper.BindingViewModel(this, vm);
this.Loaded += SinglePlayerView_Load;
task_Start.IsEnabled = true;
task_Stop.IsEnabled = false;
task_continue.IsEnabled = false;
}
public void Dispose()
......@@ -97,7 +100,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SinglePlayerView_Load(object sender, RoutedEventArgs e)
private void SinglePlayerView_Init()
{
if (task != null)
return;
......@@ -105,9 +108,15 @@ namespace VIZ.TVP.CBA.Module
task = new PackageTaskModel(this);
task.PreviewUpdateAction = OnPreviewUpdate;
task.TakeUpdateAction = OnTakeUpdate;
task.IsPreviewEnabled = true;
task.IsTakeEnabled = true;
task.IsRunning = true;
task.Name = "单个球员数据";
IPackageTaskService service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
if (service == null)
return;
......@@ -120,6 +129,7 @@ namespace VIZ.TVP.CBA.Module
/// 任务模型
/// </summary>
public PackageTaskModel task;
IPackageTaskService service;
private void OnPreviewUpdate(ConnModel conn)
{
......@@ -142,5 +152,40 @@ namespace VIZ.TVP.CBA.Module
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineSingleData()));
}
}
private void task_Start_Click(object sender, RoutedEventArgs e)
{
SinglePlayerView_Init();
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
task_continue.IsEnabled = true;
}
private void task_continue_Click(object sender, RoutedEventArgs e)
{
if (task.IsRunning)
{
task.IsRunning = false;
task_continue.Content = "任务继续";
}
else
{
task.IsRunning = true;
task_continue.Content = "任务暂停";
}
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
}
private void task_Stop_Click(object sender, RoutedEventArgs e)
{
service.Cancel(task);
task = null;
task_Start.IsEnabled = true;
task_continue.Content = "任务暂停";
task_continue.IsEnabled = false;
task_Stop.IsEnabled = false;
}
}
}
......@@ -121,14 +121,22 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="530"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="110"/>
</Grid.ColumnDefinitions>
<!--{Binding HomeTeam}-->
<Button Content="刷新" Command="{Binding BtnCommand}" HorizontalContentAlignment="Center"
Grid.Column="1" Width="95" Height="30" FontSize="14"/>
Grid.Column="0" Width="95" Height="30" FontSize="14"/>
<Button Content="任务开始" Name="task_Start" Click="task_Start_Click" Grid.Column="1" FontSize="14" Height="30" Width="90"/>
<Button Content="任务暂停" Name="task_continue" Click="task_continue_Click" Grid.Column="2" FontSize="14" Height="30" Width="90"/>
<Button Content="任务停止" Name="task_Stop" Click="task_Stop_Click" Grid.Column="3" FontSize="14" Height="30" Width="90"/>
<!--<Button Content="上数据" Command="{Binding BtnCmdUpData}" HorizontalContentAlignment="Center"
Grid.Column="1" Width="95" Height="30" FontSize="14"/>-->
</Grid>
......
......@@ -32,7 +32,11 @@ namespace VIZ.TVP.CBA.Module
TeamStatsViewModel.TeamStatsViewModelInstance.Add(vm);
WPFHelper.BindingViewModel(this, vm);
this.Loaded += TeamStatsView_Load;
task_Start.IsEnabled = true;
task_Stop.IsEnabled = false;
task_continue.IsEnabled = false;
}
public void Dispose()
......@@ -98,7 +102,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void TeamStatsView_Load(object sender, RoutedEventArgs e)
private void TeamStatsView_Init()
{
if (task != null)
return;
......@@ -106,9 +110,16 @@ namespace VIZ.TVP.CBA.Module
task = new PackageTaskModel(this);
task.PreviewUpdateAction = OnPreviewUpdate;
task.TakeUpdateAction = OnTakeUpdate;
task.IsPreviewEnabled = true;
task.IsTakeEnabled = true;
task.IsRunning = true;
task.Name = "球队对比数据";
IPackageTaskService service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
service = ApplicationDomainEx.ServiceManager.GetService<IPackageTaskService>(ViewServiceKeys.PACKAGE_TASK_SERVICE);
if (service == null)
return;
......@@ -121,6 +132,10 @@ namespace VIZ.TVP.CBA.Module
/// 任务模型
/// </summary>
public PackageTaskModel task;
/// <summary>
/// 服务
/// </summary>
IPackageTaskService service;
private void OnPreviewUpdate(ConnModel conn)
{
......@@ -143,5 +158,40 @@ namespace VIZ.TVP.CBA.Module
conn.EndpointManager.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
}
}
private void task_Start_Click(object sender, RoutedEventArgs e)
{
TeamStatsView_Init();
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
task_continue.IsEnabled = true;
}
private void task_continue_Click(object sender, RoutedEventArgs e)
{
if (task.IsRunning)
{
task.IsRunning = false;
task_continue.Content = "任务继续";
}
else
{
task.IsRunning = true;
task_continue.Content = "任务暂停";
}
task_Start.IsEnabled = false;
task_Stop.IsEnabled = true;
}
private void task_Stop_Click(object sender, RoutedEventArgs e)
{
service.Cancel(task);
task = null;
task_Start.IsEnabled = true;
task_continue.Content = "任务暂停";
task_continue.IsEnabled = false;
task_Stop.IsEnabled = false;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment