Commit fa5631f1 by liulongfei

版子修改

parent 0953231d
......@@ -60,6 +60,20 @@ namespace VIZ.TVP.Golf.Domain
#endregion
#region ParItems -- 标准杆项
private List<int?> parItems;
/// <summary>
/// 标准杆项
/// </summary>
public List<int?> ParItems
{
get { return parItems; }
set { parItems = value; this.RaisePropertyChanged(nameof(ParItems)); }
}
#endregion
/// <summary>
/// 更新属性值实体模型
/// </summary>
......@@ -78,6 +92,15 @@ namespace VIZ.TVP.Golf.Domain
this.HoleID = this.Entity.HoleID;
this.Par = this.Entity.Par;
this.Picture = this.Entity.Picture;
List<int?> parItems = new List<int?>();
parItems.Add(null);
for (int i = 1; i <= this.Par; i++)
{
parItems.Add(i);
}
this.ParItems = parItems;
}
}
}
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="Button_Green" TargetType="Button">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="BorderBrush" Value="#884ec2ab"></Setter>
<Setter Property="Foreground" Value="#ff4ec2ab"></Setter>
<Setter Property="BorderThickness" Value="1"></Setter>
<Setter Property="MinWidth" Value="120"></Setter>
<Setter Property="Height" Value="40"></Setter>
<Setter Property="Padding" Value="10,0,10,0"></Setter>
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
<Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="{TemplateBinding Padding}">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"></ContentPresenter>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#444ec2ab"></Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#224ec2ab"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
......@@ -158,6 +158,9 @@
<Button Grid.Column="4" Height="20" Width="80" Content="连接" Margin="10,0,0,0"
Command="{Binding Path=ConnectCommand}"
IsEnabled="{Binding Path=IsConnectButtonEnabled}"></Button>
<Button Grid.Column="4" Height="20" Width="80" Content="断开" Margin="10,0,0,0"
Command="{Binding Path=DisconnectCommand}"
IsEnabled="{Binding Path=IsConnectButtonEnabled}"></Button>
</StackPanel>
</Border>
</Grid>
......
......@@ -107,18 +107,13 @@ namespace VIZ.TVP.Golf.Module
ApplicationDomainEx.VizEngineModel.STAGE_START($"{TvpStaticResource.SCENE_PATH}17-QDZS", "OnSetData", cmd.ToString());
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.STAGE_SET, $"{TvpStaticResource.SCENE_PATH}17-QDZS"));
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "OnSetData", cmd.ToString()));
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "setKeyframe", $"{this.HolePickerPanelModel.SelectedHoleInfo.HoleID}"));
int value = 0;
int time = 0;
value = -307;
time = 10;
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "setKeyframe", $"{value} {time}"));
ApplicationDomainEx.VizEngineModel.Send(VizEngineCommands.STAGE_START);
}
/// <summary>
/// 获取洞数据
/// </summary>
......
......@@ -40,8 +40,8 @@
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="200"></RowDefinition>
<RowDefinition Height="240"></RowDefinition>
<RowDefinition Height="260"></RowDefinition>
<RowDefinition Height="260"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 队伍 -->
......
......@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using System.Windows.Navigation;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Service;
namespace VIZ.TVP.Golf.Module
{
......@@ -102,7 +103,7 @@ namespace VIZ.TVP.Golf.Module
// 底部描述
dic["FTITLE"] = new VizControlObjectsStringValue("队伍冠军");
// 右侧小图标
dic["LOGO"] = new VizControlObjectsStringValue("IMAGE*/MyTestProject/Images/1");
dic["LOGO"] = new VizControlObjectsStringValue(this.resourceService.GetImageName(ResourceType.SHOOL, this.TeamPickerPanelModel.SelectedTeamInfo.Logo));
VizControlObjctsCommand cmd = new VizControlObjctsCommand(dic);
......@@ -131,7 +132,7 @@ namespace VIZ.TVP.Golf.Module
// 底部描述
dic["FTITLE"] = new VizControlObjectsStringValue("组队冠军");
// 右侧小图标
dic["LOGO"] = new VizControlObjectsStringValue("IMAGE*/MyTestProject/Images/1");
dic["LOGO"] = new VizControlObjectsStringValue(this.resourceService.GetImageName(ResourceType.SHOOL, this.GroupPickerPanelModel.SelectedGroupInfo.TeamLogo));
VizControlObjctsCommand cmd = new VizControlObjctsCommand(dic);
......
......@@ -188,7 +188,7 @@ namespace VIZ.TVP.Golf.Module
// 洞号
item["DBAN"] = hole.HoleID.ToString();
// 标准杆
item["PAR"] = hole.Par.ToString();
item["PAR"] = $"PAR{hole.Par}";
// 总杆数
item["SCORE"] = hole.TotalStrokes;
// 图标
......
......@@ -16,6 +16,7 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/Button/Button_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</ResourceDictionary>
......@@ -46,9 +47,9 @@
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80"></RowDefinition>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition Height="260"></RowDefinition>
<RowDefinition Height="120"></RowDefinition>
<RowDefinition Height="140"></RowDefinition>
</Grid.RowDefinitions>
<!-- 洞号 -->
<GroupBox Padding="10" Grid.Row="0">
......@@ -59,16 +60,28 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 洞号 -->
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="1" Grid.Column="0" Margin="0,0,5,0" Orientation="Horizontal">
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png" Margin="0,0,5,0"></Image>
<TextBlock Text="洞号:" ></TextBlock>
</StackPanel>
<TextBlock Text="洞号:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0"></TextBlock>
<ComboBox Height="30" Width="240" VerticalContentAlignment="Center" Grid.Column="1" HorizontalAlignment="Left"
Margin="5,0,0,0" Grid.Row="1"
SelectedValue="{Binding Path=SelectedHoleInfo,Mode=TwoWay}" DisplayMemberPath="HoleID"
ItemsSource="{Binding Source={x:Static domain:ApplicationDomainEx.HoleInfos}}"></ComboBox>
<TextBlock Text="当前第几杆:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Grid.Column="2"></TextBlock>
<ComboBox Height="30" Width="240" VerticalContentAlignment="Center" Grid.Column="3" HorizontalAlignment="Left"
Margin="5,0,0,0" Grid.Row="1"
SelectedValue="{Binding Path=SelectedCurrentStroke,Mode=TwoWay}"
ItemsSource="{Binding SelectedHoleInfo.ParItems}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Height="20">
<TextBlock Text="{Binding .}" VerticalAlignment="Center"></TextBlock>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</GroupBox>
<!-- 分组 -->
......@@ -93,15 +106,26 @@
<TextBox Grid.Column="1" Height="30" Margin="5,0,20,0" AcceptsReturn="False" TextWrapping="NoWrap"
VerticalContentAlignment="Center" Padding="3"
Text="{Binding Path=GroupDetail,Mode=TwoWay}"></TextBox>
<StackPanel Grid.Column="2" Orientation="Horizontal">
<ComboBox Height="30" Margin="5,0,0,0" Width="240" VerticalContentAlignment="Center"
SelectedValue="{Binding Path=SelectedGroupDetail,Mode=TwoWay}"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.Details}}"></ComboBox>
<fcommon:IconButton Style="{StaticResource IconButton_Green}" VerticalAlignment="Center" HorizontalAlignment="Left"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/presets_16x16.png"
Content="预设描述" Grid.Column="1" Width="80" Height="30" Margin="10,0,0,0"
Command="{Binding PresetGroupDetailCommand}"></fcommon:IconButton>
</StackPanel>
<WrapPanel Grid.Column="2">
<Button VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource Button_Green}"
Content="Par" Grid.Column="1" Width="80" Height="30" Margin="5"
Command="{Binding PresetGroupDetailCommand}" CommandParameter="Par"></Button>
<Button VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource Button_Green}"
Content="Birdie" Grid.Column="1" Width="80" Height="30" Margin="5"
Command="{Binding PresetGroupDetailCommand}" CommandParameter="Birdie"></Button>
<Button VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource Button_Green}"
Content="Eagle" Grid.Column="1" Width="80" Height="30" Margin="5"
Command="{Binding PresetGroupDetailCommand}" CommandParameter="Eagle"></Button>
<Button VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource Button_Green}"
Content="double eagle" Grid.Column="1" Width="80" Height="30" Margin="5"
Command="{Binding PresetGroupDetailCommand}" CommandParameter="double eagle"></Button>
<Button VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource Button_Green}"
Content="Albatross" Grid.Column="1" Width="80" Height="30" Margin="5"
Command="{Binding PresetGroupDetailCommand}" CommandParameter="Albatross"></Button>
<Button VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource Button_Green}"
Content="Bogey" Grid.Column="1" Width="80" Height="30" Margin="5"
Command="{Binding PresetGroupDetailCommand}" CommandParameter="Bogey"></Button>
</WrapPanel>
</Grid>
</GroupBox>
</Grid>
......
......@@ -46,7 +46,7 @@
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80"></RowDefinition>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition Height="260"></RowDefinition>
<RowDefinition Height="260"></RowDefinition>
</Grid.RowDefinitions>
......@@ -77,14 +77,14 @@
<!-- 分组1 -->
<GroupBox Grid.Row="1" Padding="10">
<GroupBox.Header>
<TextBlock Text="分组1" FontSize="18" FontWeight="Bold"></TextBlock>
<TextBlock Text="小队1" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPanelModel1}" IsShowPosition="True"></local:GroupPickerPanelNoPlayer>
</GroupBox>
<!-- 分组2 -->
<GroupBox Grid.Row="2" Padding="10">
<GroupBox.Header>
<TextBlock Text="分组2" FontSize="18" FontWeight="Bold"></TextBlock>
<TextBlock Text="小队2" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPanelModel2}" IsShowPosition="True"></local:GroupPickerPanelNoPlayer>
</GroupBox>
......
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -7,6 +8,7 @@ using System.Web.WebSockets;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Service;
namespace VIZ.TVP.Golf.Module
{
......@@ -26,7 +28,7 @@ namespace VIZ.TVP.Golf.Module
/// </summary>
private void InitCommand()
{
this.PresetGroupDetailCommand = new VCommand(this.PresetGroupDetail);
this.PresetGroupDetailCommand = new VCommand<string>(this.PresetGroupDetail);
this.StartNoDetailCommand = new VCommand(this.StartNoDetail);
}
......@@ -90,16 +92,16 @@ namespace VIZ.TVP.Golf.Module
#endregion
#region SelectedGroupDetail -- 选中的分组描述
#region SelectedCurrentStroke -- 当前击打杆数
private string selectedGroupDetail;
private int? selectedCurrentStroke;
/// <summary>
/// 选中的分组描述
/// 当前击打杆数
/// </summary>
public string SelectedGroupDetail
public int? SelectedCurrentStroke
{
get { return selectedGroupDetail; }
set { selectedGroupDetail = value; this.RaisePropertyChanged(nameof(SelectedGroupDetail)); }
get { return selectedCurrentStroke; }
set { selectedCurrentStroke = value; this.RaisePropertyChanged(nameof(SelectedCurrentStroke)); }
}
#endregion
......@@ -131,15 +133,30 @@ namespace VIZ.TVP.Golf.Module
dic["NUMBER"] = new VizControlObjectsStringValue(this.SelectedHoleInfo.HoleID.ToString());
// 得分
dic["SCORE"] = new VizControlObjectsStringValue(this.GroupPickerPanelModel.PlayersScore);
// 当前标准杆
dic["HOLENUM"] = new VizControlObjectsStringValue((this.SelectedHoleInfo.Par - 3).ToString());
// 当前杆高亮
dic["HL1"] = new VizControlObjectsStringValue("0");
dic["HL2"] = new VizControlObjectsStringValue("0");
dic["HL3"] = new VizControlObjectsStringValue("0");
dic["HL4"] = new VizControlObjectsStringValue("0");
dic["HL5"] = new VizControlObjectsStringValue("0");
if (this.SelectedCurrentStroke >= 1 && this.SelectedCurrentStroke <= 5)
{
dic[$"HL{this.SelectedCurrentStroke}"] = new VizControlObjectsStringValue("1");
}
// 队伍图标
PlayerInfoModel info_player = ApplicationDomainEx.PlayerInfos.FirstOrDefault(p => p.PlayerID == this.GroupPickerPanelModel.Player1.PlayerID);
dic["LOGO"] = new VizControlObjectsStringValue(info_player.TeamInfoModel.Logo);
dic["LOGO"] = new VizControlObjectsStringValue(this.resourceService.GetImageName(ResourceType.SHOOL, info_player.TeamInfoModel.Logo));
VizControlObjctsCommand cmd = new VizControlObjctsCommand(dic);
ApplicationDomainEx.VizEngineModel.STAGE_START($"{TvpStaticResource.SCENE_PATH}19-XZSJ-D", "OnSetData", cmd.ToString());
}
#endregion
#region StartNoDetailCommand -- 上没有描述的信息版命令
......@@ -163,7 +180,7 @@ namespace VIZ.TVP.Golf.Module
dic["SCORE"] = new VizControlObjectsStringValue(this.GroupPickerPanelModel.PlayersScore);
// 队伍图标
PlayerInfoModel info_player = ApplicationDomainEx.PlayerInfos.FirstOrDefault(p => p.PlayerID == this.GroupPickerPanelModel.Player1.PlayerID);
dic["LOGO"] = new VizControlObjectsStringValue(info_player.TeamInfoModel.Logo);
dic["LOGO"] = new VizControlObjectsStringValue(this.resourceService.GetImageName(ResourceType.SHOOL, info_player.TeamInfoModel.Logo));
VizControlObjctsCommand cmd = new VizControlObjctsCommand(dic);
......@@ -230,14 +247,15 @@ namespace VIZ.TVP.Golf.Module
/// <summary>
/// 预设分组描述命令
/// </summary>
public VCommand PresetGroupDetailCommand { get; set; }
public VCommand<string> PresetGroupDetailCommand { get; set; }
/// <summary>
/// 预设分组
/// </summary>
private void PresetGroupDetail()
/// <param name="detail">描述</param>
private void PresetGroupDetail(string detail)
{
this.GroupDetail = this.SelectedGroupDetail;
this.GroupDetail = detail;
}
#endregion
......
......@@ -232,6 +232,7 @@ namespace VIZ.TVP.Golf.Module
GroupTempModel model = new GroupTempModel();
model.Group = this.group;
model.TeamInfo = ApplicationDomainEx.TeamInfos.FirstOrDefault(p => p.TeamID == team.Key);
model.TeamLogo = model.TeamInfo?.Logo;
var players = team.ToList();
if (players.Count == 2)
{
......@@ -256,6 +257,7 @@ namespace VIZ.TVP.Golf.Module
GroupTempModel model = new GroupTempModel();
model.Group = this.group;
model.TeamInfo = ApplicationDomainEx.TeamInfos.FirstOrDefault(p => p.TeamID == team.Key);
model.TeamLogo = model.TeamInfo?.Logo;
var players = team.ToList();
if (players.Count == 2)
{
......
......@@ -88,6 +88,9 @@
Content="上版子" Command="{Binding Path=StartCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="翻页" Command="{Binding StopCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="下版子" Command="{Binding StopCommand}"></fcommon:IconButton>
</StackPanel>
</Grid>
......
......@@ -100,10 +100,10 @@ namespace VIZ.TVP.Golf.Module
VizControlObjctsCommand cmd = new VizControlObjctsCommand(dic);
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.STAGE_SET, $"{TvpStaticResource.SCENE_PATH}18-21-8"));
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "OnSetData", cmd.ToString()));
ApplicationDomainEx.VizEngineModel.Send($"RENDERER*STAGE*DIRECTOR*MAIN START");
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "reset", ""));
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "OnSetData", cmd.ToString()));
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "initList", ""));
ApplicationDomainEx.VizEngineModel.Send($"RENDERER*STAGE*DIRECTOR*MAIN START");
}
/// <summary>
......@@ -178,10 +178,66 @@ namespace VIZ.TVP.Golf.Module
/// </summary>
private void Expand()
{
// 填充展开数据
Dictionary<string, IVizControlObjctsValue> dic = new Dictionary<string, IVizControlObjctsValue>();
// 第一排数据
dic["SCORE1"] = this.GetGroupHoleRowData(1, 9);
// 第二排数据
dic["SCORE2"] = this.GetGroupHoleRowData(10, 18);
VizControlObjctsCommand cmd = new VizControlObjctsCommand(dic);
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "OnSetData", cmd.ToString()));
// 展开
int index = this.GroupTempModels.IndexOf(this.SelectedGroupTempModel);
ApplicationDomainEx.VizEngineModel.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "bigIn", index));
}
/// <summary>
/// 获取分组信息版行数据
/// </summary>
/// <param name="from">开始索引</param>
/// <param name="to">结束索引</param>
/// <param name="groups">分组集合</param>
/// <returns>分组信息版行数据</returns>
private VizControlObjectsElementValue GetGroupHoleRowData(int from, int to)
{
List<Dictionary<string, string>> md_itms = new List<Dictionary<string, string>>();
for (int i = from; i <= to; i++)
{
Dictionary<string, string> item = new Dictionary<string, string>();
HoleInfoModel holeInfo = ApplicationDomainEx.HoleInfos.FirstOrDefault(p => p.HoleID == i);
// 图标
item["DBAN"] = "0";
// 标准杆
item["PAR"] = string.Empty;
// 杆数
item["SCORE"] = string.Empty;
if (holeInfo != null && this.SelectedGroupTempModel != null && this.SelectedGroupTempModel.GroupHoleTempModels != null)
{
GroupHoleTempModel temp_hole = this.SelectedGroupTempModel.GroupHoleTempModels.FirstOrDefault(p => p.HoleID == i.ToString());
// 图标
int.TryParse(temp_hole?.TotalScore, out int score);
item["DBAN"] = this.resourceService.GetToParBgIconValue(score);
// 标准杆
item["PAR"] = $"PAR{holeInfo.Par}";
// 杆数
item["SCORE"] = temp_hole?.TotalStrokes;
}
md_itms.Add(item);
}
return new VizControlObjectsElementValue(md_itms);
}
#endregion
#region CollapseCommand -- 收拢命令
......
......@@ -41,13 +41,6 @@
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
<Rectangle Width="2" Margin="10,0,10,0" Height="30" Fill="#44000000"></Rectangle>
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/contrast_16x16.png"
Content="加载对比数据" Command="{Binding Path=LoadContrastDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_green_16x16.png" Margin="5,0,0,0"
Content="根据界面值刷新索引变化" Command="{Binding Path=RefreshIndexChangedCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
......@@ -61,7 +54,6 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
......@@ -70,19 +62,7 @@
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=GroupTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="60" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="160" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="80" Binding="{Binding Path=PlayersScore}"></DataGridTextColumn>
<DataGridTextColumn Header="之前索引" Width="60" Binding="{Binding Path=PositionOldIndex}"></DataGridTextColumn>
<DataGridTextColumn Header="之后索引" Width="60" Binding="{Binding Path=PositionNewIndex}"></DataGridTextColumn>
<DataGridTextColumn Header="索引变化" Width="80" Binding="{Binding Path=PositionChangedDesc}" IsReadOnly="True"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<GroupBox Header="对比数据" Grid.Column="2" Padding="10" Margin="5,0,0,0">
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=ConstrrastGroupTempModels}">
<DataGrid.Columns>
<DataGridCheckBoxColumn Header="高亮" Width="60" Binding="{Binding Path=IsActive}"></DataGridCheckBoxColumn>
<DataGridTextColumn Header="排名" Width="60" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="成员" Width="160" Binding="{Binding Path=PlayersDisplayName}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="80" Binding="{Binding Path=PlayersScore}"></DataGridTextColumn>
......@@ -91,26 +71,29 @@
</GroupBox>
</Grid>
</GroupBox>
</Grid>
</Border>
<!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions>
<Image Source="pack://SiteOfOrigin:,,,/images/AfterMatchGroupRanking.jpg" />
<StackPanel Orientation="Horizontal" Grid.Row="1">
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png"
Content="上版子"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="下版子"></fcommon:IconButton>
</StackPanel>
</Grid>
<StackPanel>
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="短板队伍排名" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<StackPanel>
<Image Source="pack://SiteOfOrigin:,,,/images/group_short_ranking.jpg" Height="300" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,10">
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png"
Content="上版子" Command="{Binding StartCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="下版子"
Command="{Binding Path=StopCommand}"></fcommon:IconButton>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
</Border>
</Grid>
</UserControl>
\ No newline at end of file
......@@ -7,6 +7,7 @@ using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Service;
namespace VIZ.TVP.Golf.Module
{
......@@ -28,6 +29,73 @@ namespace VIZ.TVP.Golf.Module
// Command
// ===================================================================================
#region 上板子命令
/// <summary>
/// 上版子
/// </summary>
protected override void Start()
{
Dictionary<string, IVizControlObjctsValue> dic = new Dictionary<string, IVizControlObjctsValue>();
// 第一排数据
dic["DATALINE"] = this.GetGroupRowData(0, 4);
VizControlObjctsCommand cmd = new VizControlObjctsCommand(dic);
ApplicationDomainEx.VizEngineModel.STAGE_START($"{TvpStaticResource.SCENE_PATH}23-QDPM-D", "OnSetData", cmd.ToString());
}
/// <summary>
/// 获取分组信息版行数据
/// </summary>
/// <param name="from">开始索引</param>
/// <param name="to">结束索引</param>
/// <param name="groups">分组集合</param>
/// <returns>分组信息版行数据</returns>
private VizControlObjectsElementValue GetGroupRowData(int from, int to)
{
List<Dictionary<string, string>> md_itms = new List<Dictionary<string, string>>();
for (int i = from; i <= to; i++)
{
Dictionary<string, string> item = new Dictionary<string, string>();
// 得分
item["SCORE"] = string.Empty;
// 球队logo
item["1"] = string.Empty;
// 是否高亮
item["HL.active"] = string.Empty;
// 排名
item["NUMBER"] = string.Empty;
// 队员
item["TEAMNAME"] = string.Empty;
if (this.GroupTempModels.Count > i)
{
var grpup = this.GroupTempModels[i];
// 得分
item["D2"] = grpup.PlayersScore;
// 球队logo
item["1"] = this.resourceService.GetImageName(ResourceType.SHOOL, grpup.TeamLogo);
// 是否高亮
item["HL.active"] = grpup.IsActive ? "1" : "0";
// 排名
item["NUMBER"] = grpup.Position;
// 队伍名称
item["TEAMNAME"] = grpup.PlayersDisplayName;
}
md_itms.Add(item);
}
return new VizControlObjectsElementValue(md_itms);
}
#endregion
// ===================================================================================
// Private Function
// ===================================================================================
......
......@@ -104,7 +104,7 @@ namespace VIZ.TVP.Golf.Module
// 队伍名称
dic["FD1"] = new VizControlObjectsStringValue(this.TeamPickerPanelModel.Name);
// 队伍图标
dic["FLAGE"] = new VizControlObjectsStringValue("IMAGE*/MyTestProject/Images/2");
dic["FLAGE"] = new VizControlObjectsStringValue(this.resourceService.GetImageName(ResourceType.SHOOL, this.TeamPickerPanelModel.SelectedTeamInfo.Logo));
// 分组数据
var groups = this.TeamPickerPanelModel.PlayerTempModels.Where(p => !string.IsNullOrWhiteSpace(p.Group)).GroupBy(p => p.Group).ToList();
......@@ -187,7 +187,7 @@ namespace VIZ.TVP.Golf.Module
// 队伍名称
dic["FD1"] = new VizControlObjectsStringValue(this.TeamPickerPanelModel.Name);
// 队伍图标
dic["FLAGE"] = new VizControlObjectsStringValue("IMAGE*/MyTestProject/Images/2");
dic["FLAGE"] = new VizControlObjectsStringValue(this.resourceService.GetImageName(ResourceType.SHOOL, this.TeamPickerPanelModel.SelectedTeamInfo.Logo));
// 分组数据
var players = this.TeamPickerPanelModel.PlayerTempModels.Where(p => string.IsNullOrWhiteSpace(p.Group)).ToList();
......
......@@ -41,14 +41,6 @@
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
<Rectangle Width="2" Margin="10,0,10,0" Height="30" Fill="#44000000"></Rectangle>
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/contrast_16x16.png"
Content="加载对比数据" Command="{Binding Path=LoadContrastDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_green_16x16.png" Margin="5,0,0,0"
Content="根据界面值刷新索引变化" Command="{Binding Path=RefreshIndexChangedCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
......@@ -62,7 +54,6 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
......@@ -73,7 +64,7 @@
<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=TeamTempModels}">
<DataGrid.Columns>
<DataGridCheckBoxColumn Header="聚焦" Width="60" Binding="{Binding Path=IsActive}"></DataGridCheckBoxColumn>
<DataGridCheckBoxColumn Header="高亮" Width="60" Binding="{Binding Path=IsActive}"></DataGridCheckBoxColumn>
<DataGridTextColumn Header="排名(*)" Width="60" Binding="{Binding Path=Position}"></DataGridTextColumn>
<DataGridTextColumn Header="队伍名称(*)" Width="200" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="得分(*)" Width="80" Binding="{Binding Path=TotalScore}"></DataGridTextColumn>
......@@ -83,19 +74,6 @@
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<!-- 对比数据 -->
<GroupBox Header="对比数据" Grid.Column="2" Padding="10" Margin="5,0,0,0">
<DataGrid Grid.Column="2" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=ContrastTeamTempModels}" Margin="5,0,0,0">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="60" Binding="{Binding Path=Position}"></DataGridTextColumn>
<DataGridTextColumn Header="队伍名称" Width="200" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="80" Binding="{Binding Path=TotalScore}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</Grid>
</GroupBox>
......
......@@ -80,6 +80,7 @@ namespace VIZ.TVP.Golf.Service
bool Y_player1_thru = this.RealDataService.IsPlayerThru(Y_player1, this.Round);
bool Y_player2_thru = this.RealDataService.IsPlayerThru(Y_player2, this.Round);
// 是否参赛判断
if ((!X_player1_thru && !X_player2_thru) && (!Y_player1_thru && !Y_player2_thru))
return 0;
if ((X_player1_thru || X_player2_thru) && (!Y_player1_thru && !Y_player2_thru))
......
......@@ -45,6 +45,7 @@ namespace VIZ.TVP.Golf.Service
/// </summary>
public int Compare(TeamTempModel x, TeamTempModel y)
{
// 有无成绩判断
if (x.TotalScoreValue == null && y.TotalScoreValue == null)
return 0;
......@@ -54,10 +55,16 @@ namespace VIZ.TVP.Golf.Service
if (x.TotalScoreValue == null && y.TotalScoreValue != null)
return 1;
if (x.TotalScoreValue.Value == y.TotalScoreValue.Value)
return 0;
else
return x.TotalScoreValue.Value < y.TotalScoreValue.Value ? -1 : 1;
// 成绩判断
if (x.TotalScoreValue.Value < y.TotalScoreValue.Value)
return -1;
if (x.TotalScoreValue.Value > y.TotalScoreValue.Value)
return 1;
//
return 0;
}
}
}
......@@ -40,7 +40,8 @@ namespace VIZ.TVP.Golf.Service
{
if (type == ResourceType.SHOOL)
{
return $"IMAGE*/MyTestProject/Images/shool_logo/path";
path = System.IO.Path.GetFileNameWithoutExtension(path);
return $"IMAGE*/MyTestProject/Images/shool_logo/{path}";
}
if (type == ResourceType.HOLE)
......
......@@ -438,5 +438,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="images\group_short_ranking.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
......@@ -13,7 +13,7 @@ CLIENT_VIZ_IP=127.0.0.1
; VIZ端口
CLIENT_VIZ_PORT=6100
; 备库 VIZ IP地址
CLIENT_VIZ_IP_STANDBY=127.0.0.2
CLIENT_VIZ_IP_STANDBY=82.157.67.113
; 备库 VIZ端口
CLIENT_VIZ_PORT_STANDBY=6100
; ============================================================
......
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