曲线图逻辑错误修改,模拟题添加信息
This commit is contained in:
commit
70a9133f5e
5 files changed
+227
-102
No files matched your search
@@ -36,7 +36,9 @@ namespace DyeingComputer
|
||||
MainWindowViewModel.ViewID = 1;
|
||||
}
|
||||
|
||||
public static SQLiteHelper SQLiteChartAdress = null; //定义数据库
|
||||
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||
private readonly string ChartAdress = Environment.CurrentDirectory + "\\DataBase\\Chart.db"; //数据库路径
|
||||
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
||||
|
||||
/// <summary>
|
||||
@@ -48,6 +50,9 @@ namespace DyeingComputer
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
|
||||
SQLiteChartAdress = new SQLiteHelper(ChartAdress); //数据库连接路径
|
||||
SQLiteChartAdress.Open(); //打开数据库
|
||||
|
||||
bool result_System = SQLiteHelpers.TableExists("System"); //检查表格是否存在(存在返回true)
|
||||
bool result_IOName = SQLiteHelpers.TableExists("IOName");
|
||||
bool result_ProgramName = SQLiteHelpers.TableExists("ProgramName");
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
<Image Width="300" Height="300" gif:ImageBehavior.AnimatedSource="/Lmage/10001.gif"
|
||||
gif:ImageBehavior.RepeatBehavior="Forever" HorizontalAlignment="Left" Canvas.Left="20"
|
||||
Canvas.Top="180" Visibility="Collapsed" x:Name="Swing_"/>
|
||||
|
||||
<TextBlock x:Name="M_T" HorizontalAlignment="Center" Height="35" Margin="0,208,0,0" TextWrapping="Wrap" Text="C" TextAlignment="Right"
|
||||
VerticalAlignment="Top" Width="160" FontSize="30" Background="White" Padding="5,0,5,0"/>
|
||||
<TextBlock x:Name="M_L" HorizontalAlignment="Center" Height="35" Margin="0,522,0,0" TextWrapping="Wrap" Text="L" TextAlignment="Right"
|
||||
VerticalAlignment="Top" Width="160" FontSize="30" Background="White" Padding="5,0,5,0"/>
|
||||
<Slider Height="30" Width="100" FontSize="30" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="620,0,0,60"/>
|
||||
|
||||
<Slider x:Name="M_D1" Height="20" Width="100" FontSize="30" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="620,0,0,80"
|
||||
Maximum="100" Minimum="0" ValueChanged="M_D1_ValueChanged"/>
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Height="75" Width="125"
|
||||
Margin="66,550,0,0" >
|
||||
<Image MouseLeftButtonDown="ID3020_MouseLeftButtonDown" HorizontalAlignment="Left">
|
||||
@@ -407,7 +406,25 @@
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,535,5,0"/>
|
||||
<TextBlock Text="排冷凝水" FontSize="30" Width="120" TextWrapping="Wrap" Height="35"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,620,5,0"/>
|
||||
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Height="100" Width="100"
|
||||
Margin="623,630,0,0" >
|
||||
<Image MouseLeftButtonDown="ID3011_MouseLeftButtonDown"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Source" Value="/Lmage/10002-1.png"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ID3011}" Value="false">
|
||||
<Setter Property="Source" Value="/Lmage/10002-1.png"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ID3011}" Value="true">
|
||||
<Setter Property="Source" Value="/Lmage/10002-2.png"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@@ -421,8 +438,8 @@
|
||||
<TextBlock x:Name="S1_L" HorizontalAlignment="Left" Height="30" TextWrapping="Wrap" Text="L"
|
||||
TextAlignment="Right" VerticalAlignment="Top" Width="100" FontSize="20" Background="White"
|
||||
Padding="5,0,5,0" Margin="150,165,331,0" />
|
||||
<Slider Height="30" Width="100" FontSize="30" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="340,0,0,0"/>
|
||||
|
||||
<Slider x:Name="S1_D2" Height="20" Width="100" FontSize="30" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,145,51,0"
|
||||
Maximum="100" Minimum="0" ValueChanged="S1_D2_ValueChanged"/>
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Height="75" Width="110"
|
||||
Margin="288,20,0,0">
|
||||
<Image MouseLeftButtonDown="ID3038_MouseLeftButtonDown" HorizontalAlignment="Left">
|
||||
@@ -619,7 +636,25 @@
|
||||
<TextBlock x:Name="SL1" HorizontalAlignment="Right" Height="35" Margin="0,215,5,0"
|
||||
Text="000.0%" TextAlignment="Right" VerticalAlignment="Top" Width="105"
|
||||
FontSize="30" Background="White" />
|
||||
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Height="100" Width="100"
|
||||
Margin="339,256,0,0" >
|
||||
<Image MouseLeftButtonDown="ID3035_MouseLeftButtonDown"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Source" Value="/Lmage/10002-1.png"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ID3035}" Value="false">
|
||||
<Setter Property="Source" Value="/Lmage/10002-1.png"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ID3035}" Value="true">
|
||||
<Setter Property="Source" Value="/Lmage/10002-2.png"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
<Grid Width="650" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="1100,480,0,0" >
|
||||
@@ -631,8 +666,8 @@
|
||||
<TextBlock x:Name="S2_L" HorizontalAlignment="Left" Height="30" TextWrapping="Wrap" Text="L"
|
||||
TextAlignment="Right" VerticalAlignment="Top" Width="100" FontSize="20" Background="White"
|
||||
Padding="5,0,5,0" Margin="150,165,20,0" />
|
||||
<Slider Height="30" Width="100" FontSize="30" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="340,0,0,0"/>
|
||||
|
||||
<Slider x:Name="S2_D3" Height="30" Width="100" FontSize="30" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,145,51,0"
|
||||
Maximum="100" Minimum="0" ValueChanged="S2_D3_ValueChanged"/>
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Height="75" Width="110"
|
||||
Margin="288,20,0,0">
|
||||
<Image MouseLeftButtonDown="ID3048_MouseLeftButtonDown" HorizontalAlignment="Left">
|
||||
@@ -830,60 +865,80 @@
|
||||
Text="000.0%" TextAlignment="Right" VerticalAlignment="Top" Width="105"
|
||||
FontSize="30" Background="White" />
|
||||
|
||||
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Height="100" Width="100"
|
||||
Margin="339,256,0,0" >
|
||||
<Image MouseLeftButtonDown="ID3045_MouseLeftButtonDown"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Source" Value="/Lmage/10002-1.png"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ID3045}" Value="false">
|
||||
<Setter Property="Source" Value="/Lmage/10002-1.png"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding ID3045}" Value="true">
|
||||
<Setter Property="Source" Value="/Lmage/10002-2.png"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Canvas>
|
||||
<Grid Width="160" Height="600" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,0,0" Background="White">
|
||||
<Grid Width="160" Height="400" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,0" Background="White">
|
||||
<Grid Margin="2,2,2,2" Background="Silver">
|
||||
<TextBlock Text="主缸压力" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,215,5,0" />
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,5,5,0" />
|
||||
<TextBlock Text="喷头压力" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,255,5,0" />
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,45,5,0" />
|
||||
<TextBlock Text="压力差" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,295,5,0" />
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,85,5,0" />
|
||||
<TextBlock Text="喷头流量" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,335,5,0" />
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,125,5,0" />
|
||||
<TextBlock Text="流量计" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,375,5,0" />
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,165,5,0" />
|
||||
<TextBlock Text="流量计2" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,415,5,0" />
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,205,5,0" />
|
||||
<TextBlock Text="空气流量计" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,455,5,0" />
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,245,5,0" />
|
||||
<TextBlock Text="电能" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,495,5,0" />
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,285,5,0" />
|
||||
<TextBlock Text="酸度" FontSize="20" Width="100" TextWrapping="Wrap" Height="25"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,535,5,0" />
|
||||
<TextBlock x:Name="M1031" HorizontalAlignment="Right" Height="25" Margin="0,215,0,0"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,325,5,0" />
|
||||
<TextBlock x:Name="M1031" HorizontalAlignment="Right" Height="25" Margin="0,5,0,0"
|
||||
Text="0.0bar" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
<TextBlock x:Name="M1032" HorizontalAlignment="Right" Height="25" Margin="0,255,0,0"
|
||||
<TextBlock x:Name="M1032" HorizontalAlignment="Right" Height="25" Margin="0,45,0,0"
|
||||
Text="0.0bar" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
<TextBlock x:Name="M1033" HorizontalAlignment="Right" Height="25" Margin="0,295,0,0"
|
||||
<TextBlock x:Name="M1033" HorizontalAlignment="Right" Height="25" Margin="0,85,0,0"
|
||||
Text="0.0bar" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
<TextBlock x:Name="M1034" HorizontalAlignment="Right" Height="25" Margin="0,335,0,0"
|
||||
<TextBlock x:Name="M1034" HorizontalAlignment="Right" Height="25" Margin="0,125,0,0"
|
||||
Text="000.0L" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
<TextBlock x:Name="A4006" HorizontalAlignment="Right" Height="25" Margin="0,375,0,0"
|
||||
<TextBlock x:Name="A4006" HorizontalAlignment="Right" Height="25" Margin="0,165,0,0"
|
||||
Text="000.0L" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
<TextBlock x:Name="A4014" HorizontalAlignment="Right" Height="25" Margin="0,415,0,0"
|
||||
<TextBlock x:Name="A4014" HorizontalAlignment="Right" Height="25" Margin="0,205,0,0"
|
||||
Text="000.0L" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
<TextBlock x:Name="A4015" HorizontalAlignment="Right" Height="25" Margin="0,455,0,0"
|
||||
<TextBlock x:Name="A4015" HorizontalAlignment="Right" Height="25" Margin="0,245,0,0"
|
||||
Text="000.0L" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
<TextBlock x:Name="A4016" HorizontalAlignment="Right" Height="25" Margin="0,495,0,0"
|
||||
<TextBlock x:Name="A4016" HorizontalAlignment="Right" Height="25" Margin="0,285,0,0"
|
||||
Text="000Kw" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
<TextBlock x:Name="A4029" HorizontalAlignment="Right" Height="25" Margin="0,535,0,0"
|
||||
<TextBlock x:Name="A4029" HorizontalAlignment="Right" Height="25" Margin="0,325,0,0"
|
||||
Text="0.0pH" TextAlignment="Right" VerticalAlignment="Top" Width="70"
|
||||
FontSize="20" Background="White" />
|
||||
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ namespace DyeingComputer.View
|
||||
CountDown();
|
||||
IOdata();
|
||||
}
|
||||
bool _ID3007, _ID3008, _ID3009, _ID3010, _ID3013, _ID3014, _ID3015,
|
||||
_ID3016, _ID3017, _ID3018, _ID3019, _ID3020, _ID3036, _ID3037,
|
||||
_ID3038, _ID3039, _ID3041, _ID3042, _ID3043, _ID3044, _ID3046,
|
||||
bool _ID3007, _ID3008, _ID3009, _ID3010, _ID3011, _ID3013, _ID3014, _ID3015,
|
||||
_ID3016, _ID3017, _ID3018, _ID3019, _ID3020, _ID3035, _ID3036, _ID3037,
|
||||
_ID3038, _ID3039, _ID3041, _ID3042, _ID3043, _ID3044, _ID3045, _ID3046,
|
||||
_ID3047, _ID3048, _ID3049, _ID3051, _ID3052, _ID3053,
|
||||
_ID3054, _ID3076, _ID3077;
|
||||
public bool ID3007
|
||||
@@ -89,6 +89,15 @@ namespace DyeingComputer.View
|
||||
OnPropertyChanged("ID3010");
|
||||
}
|
||||
}
|
||||
public bool ID3011
|
||||
{
|
||||
get => _ID3011;
|
||||
set
|
||||
{
|
||||
_ID3011 = value;
|
||||
OnPropertyChanged("ID3011");
|
||||
}
|
||||
}
|
||||
public bool ID3013
|
||||
{
|
||||
get => _ID3013;
|
||||
@@ -161,6 +170,15 @@ namespace DyeingComputer.View
|
||||
OnPropertyChanged("ID3020");
|
||||
}
|
||||
}
|
||||
public bool ID3035
|
||||
{
|
||||
get => _ID3035;
|
||||
set
|
||||
{
|
||||
_ID3035 = value;
|
||||
OnPropertyChanged("ID3035");
|
||||
}
|
||||
}
|
||||
public bool ID3036
|
||||
{
|
||||
get => _ID3036;
|
||||
@@ -233,6 +251,15 @@ namespace DyeingComputer.View
|
||||
OnPropertyChanged("ID3044");
|
||||
}
|
||||
}
|
||||
public bool ID3045
|
||||
{
|
||||
get => _ID3045;
|
||||
set
|
||||
{
|
||||
_ID3045 = value;
|
||||
OnPropertyChanged("ID3045");
|
||||
}
|
||||
}
|
||||
public bool ID3046
|
||||
{
|
||||
get => _ID3046;
|
||||
@@ -356,6 +383,20 @@ namespace DyeingComputer.View
|
||||
timer1s.Start();
|
||||
}
|
||||
|
||||
private void M_D1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
MainWindowViewModel.Updata_dtm("1020",Convert.ToInt16( M_D1.Value));
|
||||
}
|
||||
private void S1_D2_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
MainWindowViewModel.Updata_dta("5005", Convert.ToInt16(S1_D2.Value * 10));
|
||||
SL1.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5005")) / 1000);//
|
||||
}
|
||||
private void S2_D3_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
MainWindowViewModel.Updata_dta("5006", Convert.ToInt16(S2_D3.Value * 10));
|
||||
SL2.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5006"))/ 1000);//
|
||||
}
|
||||
private void ID3007_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ID3007 = !ID3007;
|
||||
@@ -376,6 +417,11 @@ namespace DyeingComputer.View
|
||||
ID3010 = !ID3010;
|
||||
MainWindowViewModel.Updata_dtd("3010", ID3010);
|
||||
}
|
||||
private void ID3011_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ID3011 = !ID3011;
|
||||
MainWindowViewModel.Updata_dtd("3011", ID3011);
|
||||
}
|
||||
private void ID3013_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ID3013 = !ID3013;
|
||||
@@ -416,6 +462,11 @@ namespace DyeingComputer.View
|
||||
ID3020 = !ID3020;
|
||||
MainWindowViewModel.Updata_dtd("3020", ID3020);
|
||||
}
|
||||
private void ID3035_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ID3035 = !ID3035;
|
||||
MainWindowViewModel.Updata_dtd("3035", ID3035);
|
||||
}
|
||||
private void ID3036_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ID3036 = !ID3036;
|
||||
@@ -456,6 +507,11 @@ namespace DyeingComputer.View
|
||||
ID3044 = !ID3044;
|
||||
MainWindowViewModel.Updata_dtd("3044", ID3044);
|
||||
}
|
||||
private void ID3045_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ID3045 = !ID3045;
|
||||
MainWindowViewModel.Updata_dtd("3045", ID3045);
|
||||
}
|
||||
private void ID3046_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ID3046 = !ID3046;
|
||||
@@ -516,15 +572,29 @@ namespace DyeingComputer.View
|
||||
S1_L.Text = string.Format("{0:D4}", Convert.ToInt16(MainWindowViewModel.Selet_dtm("1017"))) + "L";//缸1水
|
||||
S2_T.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1013"))) + "°C";//缸2温度
|
||||
S2_L.Text = string.Format("{0:D4}", Convert.ToInt16(MainWindowViewModel.Selet_dtm("1018"))) + "L";//缸2水
|
||||
MtH.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5001"))/10);//升温
|
||||
Mtl.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5002"))/10);//降温
|
||||
SL1.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5005")) / 10);//
|
||||
SL2.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5006")) / 10);//
|
||||
MtH.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5001"))/1000);//升温
|
||||
Mtl.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5002"))/1000);//降温
|
||||
SL1.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5005")) / 1000);//
|
||||
SL2.Text = string.Format(" {0:P1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("5006")) / 1000);//
|
||||
M1031.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1031")))+"bar";//
|
||||
M1032.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1032"))) + "bar";//
|
||||
M1033.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1033"))) + "bar";//
|
||||
M1034.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1034"))) + "L";//
|
||||
A4006.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("4006"))) + "L";//
|
||||
A4014.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("4014"))) + "L";//
|
||||
A4015.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("4015"))) + "L";//
|
||||
A4016.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("4016"))) + "Kw";//
|
||||
A4029.Text = string.Format(" {0:F1}", Convert.ToDouble(MainWindowViewModel.Selet_dta("4029"))) + "pH";//
|
||||
|
||||
M_D1.Value = Convert.ToDouble(MainWindowViewModel.Selet_dta("5003"));//
|
||||
S1_D2.Value = Convert.ToDouble(MainWindowViewModel.Selet_dta("5005")) / 10;//
|
||||
S2_D3.Value = Convert.ToDouble(MainWindowViewModel.Selet_dta("5006")) / 10;//
|
||||
|
||||
ID3007 = MainWindowViewModel.Selet_dtd("3007");
|
||||
ID3008 = MainWindowViewModel.Selet_dtd("3008");
|
||||
ID3009 = MainWindowViewModel.Selet_dtd("3009");
|
||||
ID3010 = MainWindowViewModel.Selet_dtd("3010");
|
||||
ID3011 = MainWindowViewModel.Selet_dtd("3011");
|
||||
ID3013 = MainWindowViewModel.Selet_dtd("3013");
|
||||
ID3014 = MainWindowViewModel.Selet_dtd("3014");
|
||||
ID3015 = MainWindowViewModel.Selet_dtd("3015");
|
||||
@@ -533,6 +603,7 @@ namespace DyeingComputer.View
|
||||
ID3018 = MainWindowViewModel.Selet_dtd("3018");
|
||||
ID3019 = MainWindowViewModel.Selet_dtd("3019");
|
||||
ID3020 = MainWindowViewModel.Selet_dtd("3020");
|
||||
ID3035 = MainWindowViewModel.Selet_dtd("3035");
|
||||
ID3036 = MainWindowViewModel.Selet_dtd("3036");
|
||||
ID3037 = MainWindowViewModel.Selet_dtd("3037");
|
||||
ID3038 = MainWindowViewModel.Selet_dtd("3038");
|
||||
@@ -541,6 +612,7 @@ namespace DyeingComputer.View
|
||||
ID3042 = MainWindowViewModel.Selet_dtd("3042");
|
||||
ID3043 = MainWindowViewModel.Selet_dtd("3043");
|
||||
ID3044 = MainWindowViewModel.Selet_dtd("3044");
|
||||
ID3045 = MainWindowViewModel.Selet_dtd("3045");
|
||||
ID3046 = MainWindowViewModel.Selet_dtd("3046");
|
||||
ID3047 = MainWindowViewModel.Selet_dtd("3047");
|
||||
ID3048 = MainWindowViewModel.Selet_dtd("3048");
|
||||
|
||||
@@ -117,79 +117,73 @@ namespace DyeingComputer.ViewModel
|
||||
private List<DateTimePoint> STTC_values;
|
||||
private List<DateTimePoint> STLC_values;
|
||||
|
||||
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||
private readonly string ChartAdress = Environment.CurrentDirectory + "\\DataBase\\Chart.db"; //数据库路径
|
||||
DataTable CDB = new DataTable();
|
||||
private int CDB_Count;//长度
|
||||
|
||||
public CurveDiagramViewModel()
|
||||
{
|
||||
if (MainWindowViewModel.WorkNumder.ToString() != "----------")
|
||||
CDB = MainWindow.SQLiteChartAdress.ExecuteDataSet("select * from Chart where Time > '" +
|
||||
DateTime.Now.AddHours(-6).ToString("yyyy/MM/dd HH:mm:ss") + "'order by Time", null).Tables[0];
|
||||
CDB_Count = CDB.Rows.Count;
|
||||
|
||||
var MTT_items = new List<DateTimePoint>();
|
||||
var MTL_items = new List<DateTimePoint>();
|
||||
var MTH_items = new List<DateTimePoint>();
|
||||
var MST_items = new List<DateTimePoint>();
|
||||
var MUT_items = new List<DateTimePoint>();
|
||||
var STTA_items = new List<DateTimePoint>();
|
||||
var STLA_items = new List<DateTimePoint>();
|
||||
var STTB_items = new List<DateTimePoint>();
|
||||
var STLB_items = new List<DateTimePoint>();
|
||||
var STTC_items = new List<DateTimePoint>();
|
||||
var STLC_items = new List<DateTimePoint>();
|
||||
for (var i = 0; i < CDB_Count; i=i+10)
|
||||
{
|
||||
SQLiteHelpers = new SQLiteHelper(ChartAdress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
CDB = SQLiteHelpers.ExecuteDataSet("select * from Chart where DYELOT = '" + MainWindowViewModel.WorkNumder + "'order by Time", null).Tables[0];
|
||||
SQLiteHelpers.Close();
|
||||
CDB_Count = CDB.Rows.Count;
|
||||
|
||||
var MTT_items = new List<DateTimePoint>();
|
||||
var MTL_items = new List<DateTimePoint>();
|
||||
var MTH_items = new List<DateTimePoint>();
|
||||
var MST_items = new List<DateTimePoint>();
|
||||
var MUT_items = new List<DateTimePoint>();
|
||||
var STTA_items = new List<DateTimePoint>();
|
||||
var STLA_items = new List<DateTimePoint>();
|
||||
var STTB_items = new List<DateTimePoint>();
|
||||
var STLB_items = new List<DateTimePoint>();
|
||||
var STTC_items = new List<DateTimePoint>();
|
||||
var STLC_items = new List<DateTimePoint>();
|
||||
for (var i = 0; i < CDB_Count; i++)
|
||||
{
|
||||
DateTime TIME = Convert.ToDateTime(CDB.Rows[i].Field<string>("Time"));
|
||||
MTT_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTT")));
|
||||
MTL_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTL")));
|
||||
MTH_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTH")));
|
||||
MST_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MST")));
|
||||
MUT_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MUT")));
|
||||
if (MainWindowViewModel.SM01 == 1)
|
||||
{
|
||||
STTA_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTA")));
|
||||
STLA_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLA")));
|
||||
}
|
||||
if (MainWindowViewModel.SM02 == 1)
|
||||
{
|
||||
STTB_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTB")));
|
||||
STLB_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLB")));
|
||||
}
|
||||
if (MainWindowViewModel.SM03 == 1)
|
||||
{
|
||||
STTC_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTC")));
|
||||
STLC_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLC")));
|
||||
}
|
||||
}
|
||||
|
||||
MTT_values = new List<DateTimePoint>(MTT_items);
|
||||
MTL_values = new List<DateTimePoint>(MTL_items);
|
||||
MTH_values = new List<DateTimePoint>(MTH_items);
|
||||
MST_values = new List<DateTimePoint>(MST_items);
|
||||
MUT_values = new List<DateTimePoint>(MUT_items);
|
||||
DateTime TIME = Convert.ToDateTime(CDB.Rows[i].Field<string>("Time"));
|
||||
MTT_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTT")));
|
||||
MTL_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTL")));
|
||||
MTH_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MTH")));
|
||||
MST_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MST")));
|
||||
MUT_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("MUT")));
|
||||
if (MainWindowViewModel.SM01 == 1)
|
||||
{
|
||||
STTA_values = new List<DateTimePoint>(STTA_items);
|
||||
STLA_values = new List<DateTimePoint>(STLA_items);
|
||||
STTA_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTA")));
|
||||
STLA_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLA")));
|
||||
}
|
||||
if (MainWindowViewModel.SM02 == 1)
|
||||
{
|
||||
STTB_values = new List<DateTimePoint>(STTB_items);
|
||||
STLB_values = new List<DateTimePoint>(STLB_items);
|
||||
STTB_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTB")));
|
||||
STLB_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLB")));
|
||||
}
|
||||
if (MainWindowViewModel.SM03 == 1)
|
||||
{
|
||||
STTC_values = new List<DateTimePoint>(STTC_items);
|
||||
STLC_values = new List<DateTimePoint>(STLC_items);
|
||||
STTC_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STTC")));
|
||||
STLC_items.Add(new DateTimePoint(TIME, CDB.Rows[i].Field<double>("STLC")));
|
||||
}
|
||||
Series = new ISeries[]
|
||||
{
|
||||
}
|
||||
|
||||
MTT_values = new List<DateTimePoint>(MTT_items);
|
||||
MTL_values = new List<DateTimePoint>(MTL_items);
|
||||
MTH_values = new List<DateTimePoint>(MTH_items);
|
||||
MST_values = new List<DateTimePoint>(MST_items);
|
||||
MUT_values = new List<DateTimePoint>(MUT_items);
|
||||
if (MainWindowViewModel.SM01 == 1)
|
||||
{
|
||||
STTA_values = new List<DateTimePoint>(STTA_items);
|
||||
STLA_values = new List<DateTimePoint>(STLA_items);
|
||||
}
|
||||
if (MainWindowViewModel.SM02 == 1)
|
||||
{
|
||||
STTB_values = new List<DateTimePoint>(STTB_items);
|
||||
STLB_values = new List<DateTimePoint>(STLB_items);
|
||||
}
|
||||
if (MainWindowViewModel.SM03 == 1)
|
||||
{
|
||||
STTC_values = new List<DateTimePoint>(STTC_items);
|
||||
STLC_values = new List<DateTimePoint>(STLC_items);
|
||||
}
|
||||
Series = new ISeries[]
|
||||
{
|
||||
new LineSeries<DateTimePoint>
|
||||
{
|
||||
Name = Properties.Resources.MasterCylinder+Properties.Resources.Temperature,
|
||||
@@ -311,9 +305,8 @@ namespace DyeingComputer.ViewModel
|
||||
LineSmoothness = 0,
|
||||
ScalesYAt = 1,
|
||||
}, //附缸3液位
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ namespace DyeingComputer.ViewModel
|
||||
System.Windows.Media.Brush Status_Black = new SolidColorBrush() { Color = System.Windows.Media.Color.FromArgb(255, 0, 0, 0) };
|
||||
// private static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||
//private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
||||
private readonly string ChartAdress = Environment.CurrentDirectory + "\\DataBase\\Chart.db"; //数据库路径
|
||||
// private readonly string ChartAdress = Environment.CurrentDirectory + "\\DataBase\\Chart.db"; //数据库路径
|
||||
private IniFile.IniFiles Configini = new IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "DyeingComputer.ini");
|
||||
private PID pid = new PID();
|
||||
public static DataTable errTabler = new DataTable();//错误表
|
||||
@@ -778,7 +778,7 @@ namespace DyeingComputer.ViewModel
|
||||
|
||||
//SQLiteHelpers = new SQLiteHelper(ChartAdress); //数据库连接路径
|
||||
//SQLiteHelpers.Open(); //打开数据库
|
||||
MainWindow.SQLiteHelpers.InsertData("Chart", Chart_new);// 执行插入
|
||||
MainWindow.SQLiteChartAdress.InsertData("Chart", Chart_new);// 执行插入
|
||||
//SQLiteHelpers.Close();
|
||||
}//历史记录
|
||||
|
||||
@@ -3630,10 +3630,10 @@ namespace DyeingComputer.ViewModel
|
||||
Updata_dtm("1014", (Convert.ToDouble(Selet_dta("4005")) + MS03) / 10);
|
||||
Updata_dta("5003", Convert.ToInt16(Selet_dtm("1020")));
|
||||
Updata_dta("5004", Convert.ToInt16(Selet_dtm("1021")));
|
||||
Updata_dta("5005", Convert.ToInt16(Selet_dtm("1022")));
|
||||
Updata_dta("5006", Convert.ToInt16(Selet_dtm("1023")));
|
||||
Updata_dta("5007", Convert.ToInt16(Selet_dtm("1024")));
|
||||
Updata_dta("5008", Convert.ToInt16(Selet_dtm("1041")));
|
||||
// Updata_dta("5005", Convert.ToInt16(Selet_dtm("1022")));
|
||||
// Updata_dta("5006", Convert.ToInt16(Selet_dtm("1023")));
|
||||
// Updata_dta("5007", Convert.ToInt16(Selet_dtm("1024")));
|
||||
Updata_dta("5008", Convert.ToInt16(Selet_dtm("1030")));
|
||||
Updata_dta("5009", Convert.ToInt16(Selet_dtm("1025")));
|
||||
Updata_dta("5010", Convert.ToInt16(Selet_dtm("1026")));
|
||||
Updata_dta("5011", Convert.ToInt16(Selet_dtm("1027")));
|
||||
|
||||
Reference in new issue
Block a user