sc 11 months ago
parent
commit
927cd77b79
  1. 1
      ConvertMoels/StateToColorConvert.cs
  2. 9
      Properties/Resources.zh-TW.resx
  3. 3
      SunlightCentralizedControlManagement_SCCM_.csproj
  4. 11
      View/CurveView.xaml
  5. 2
      View/CurveView.xaml.cs
  6. 26
      ViewModel/CurveDiagramViewModel.cs

1
ConvertMoels/StateToColorConvert.cs

@ -19,7 +19,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels
}
else
{
string Staten = null;
string i = value.ToString();
if (i == "101") return "Gray";

9
Properties/Resources.zh-TW.resx

@ -915,4 +915,13 @@
<data name="Group" xml:space="preserve">
<value>組</value>
</data>
<data name="DayAfter" xml:space="preserve">
<value>後一天</value>
</data>
<data name="Before" xml:space="preserve">
<value>前一天</value>
</data>
<data name="Today" xml:space="preserve">
<value>今天</value>
</data>
</root>

3
SunlightCentralizedControlManagement_SCCM_.csproj

@ -289,6 +289,9 @@
<PackageReference Include="System.Management">
<Version>8.0.0</Version>
</PackageReference>
<PackageReference Include="System.ObjectModel">
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="TouchSocket">
<Version>2.1.10</Version>
</PackageReference>

11
View/CurveView.xaml

@ -108,15 +108,8 @@
</DataGrid.Columns>
</DataGrid>
<lvc:CartesianChart x:Name="OscChart" MinWidth="400" MinHeight="300" EasingFunction="{x:Null}"
Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}" Margin="0,500,300,60">
<lvc:CartesianChart.Style>
<Style TargetType="{x:Type lvc:CartesianChart}">
<Setter Property="ZoomMode" Value="PanX"/>
<Setter Property="ZoomMode" Value="ZoomX"/>
</Style>
</lvc:CartesianChart.Style>
</lvc:CartesianChart>
<lvc:CartesianChart x:Name="OscChart" MinWidth="400" MinHeight="300" EasingFunction="{x:Null}" ZoomMode="X"
Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}" Margin="0,500,300,60"/>
<StackPanel x:Name="s1cr" VerticalAlignment="Bottom" Height="60" Background="#FF00204E" Orientation="Horizontal">
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">

2
View/CurveView.xaml.cs

@ -65,6 +65,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
Griddata.ItemsSource = MainWindowViewModel.Machines.DefaultView;
Sdatepicker.Text = DateTime.Now.ToString("yyyy/MM/dd");
CurveDiagramViewModel.Curve("738891980000");
}
private void WorkOrderNumder_Click(object sender, RoutedEventArgs e)

26
ViewModel/CurveDiagramViewModel.cs

@ -25,30 +25,14 @@ using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
using TouchSocket.Core;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
{
public class NotifyPropertyBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void Notify([CallerMemberName] string propName = "")
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propName));
}
protected void SetProperty<T>(ref T prop, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(prop, value) == false)
{
prop = value;
Notify(propertyName);
}
}
}
public partial class CurveDiagramViewModel : ObservableObject//ViewModelBase
{
public static ISeries[] Series { get; set; }
public static ObservableCollection<ObservableValue> ObservableValues { get; set; }
//x轴时间格式
public Axis[] XAxes { get; set; } =
{
@ -144,7 +128,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
public CurveDiagramViewModel()
{
Curve("");
}
public static void Curve(string SYSWorkNumder)
@ -213,6 +196,10 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
STTC_values = new ObservableCollection<DateTimePoint>(STTC_items);
STLC_values = new ObservableCollection<DateTimePoint>(STLC_items);
}
Series = new ISeries[]
{
new LineSeries<DateTimePoint>
@ -337,6 +324,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
ScalesYAt = 1,
}, //附缸3 液位
};
}
}
}

Loading…
Cancel
Save