-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFVS_ActiveRateScaler.vb
More file actions
166 lines (139 loc) · 9.1 KB
/
Copy pathFVS_ActiveRateScaler.vb
File metadata and controls
166 lines (139 loc) · 9.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Public Class FVS_ActiveRateScaler
Public GridLoading As Boolean
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Visible = False
FVS_InputMenu.Visible = True
FVS_InputMenu.Refresh()
End Sub
Private Sub FVS_ActiveRateScaler_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FormHeight = 847
FormWidth = 1049
Dim fish As Integer
' - Check if Form fits within Screen Dimensions
If (FormHeight > My.Computer.Screen.Bounds.Height Or _
FormWidth > My.Computer.Screen.Bounds.Width) Then
Me.Height = FormHeight / (DevHeight / My.Computer.Screen.Bounds.Height)
Me.Width = FormWidth / (DevWidth / My.Computer.Screen.Bounds.Width)
If FVS_ActiveRateScaler_ReSize = False Then
Resize_Form(Me)
FVS_ActiveRateScaler_ReSize = True
End If
End If
GridLoading = True
StkFishRateScalerGrid.Columns.Clear()
StkFishRateScalerGrid.ColumnHeadersDefaultCellStyle.Font = New Font("Microsoft San Serif", CInt(10 / FormWidthScaler), FontStyle.Bold)
StkFishRateScalerGrid.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
StkFishRateScalerGrid.DefaultCellStyle.Font = New Font("Microsoft San Serif", CInt(10 / FormWidthScaler), FontStyle.Bold)
StkFishRateScalerGrid.Columns.Add("Fishery", "Fishery")
StkFishRateScalerGrid.Columns("Fishery").Width = 100 / FormWidthScaler
StkFishRateScalerGrid.Columns("Fishery").ReadOnly = True
StkFishRateScalerGrid.Columns("Fishery").DefaultCellStyle.BackColor = Color.Aquamarine
StkFishRateScalerGrid.Columns.Add("FishNum", "Fish#")
StkFishRateScalerGrid.Columns("FishNum").Width = 50 / FormWidthScaler
StkFishRateScalerGrid.Columns("FishNum").ReadOnly = True
StkFishRateScalerGrid.Columns("FishNum").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
StkFishRateScalerGrid.Columns("FishNum").DefaultCellStyle.BackColor = Color.Azure
StkFishRateScalerGrid.Columns.Add("Stock", "Stock")
StkFishRateScalerGrid.Columns("Stock").Width = 100 / FormWidthScaler
StkFishRateScalerGrid.Columns("Stock").ReadOnly = True
StkFishRateScalerGrid.Columns("Stock").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
StkFishRateScalerGrid.Columns("Stock").DefaultCellStyle.BackColor = Color.Azure
StkFishRateScalerGrid.Columns.Add("StkNum", "Stk#")
StkFishRateScalerGrid.Columns("StkNum").Width = 50 / FormWidthScaler
StkFishRateScalerGrid.Columns("StkNum").ReadOnly = True
StkFishRateScalerGrid.Columns("StkNum").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
StkFishRateScalerGrid.Columns("StkNum").DefaultCellStyle.BackColor = Color.Azure
StkFishRateScalerGrid.Columns.Add("Time1", "Time1")
StkFishRateScalerGrid.Columns("Time1").Width = 100 / FormWidthScaler
StkFishRateScalerGrid.Columns("Time1").DefaultCellStyle.Format = ("###0.0000")
StkFishRateScalerGrid.Columns("Time1").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
StkFishRateScalerGrid.Columns.Add("Time2", "Time2")
StkFishRateScalerGrid.Columns("Time2").Width = 100 / FormWidthScaler
StkFishRateScalerGrid.Columns("Time2").DefaultCellStyle.Format = ("###0.0000")
StkFishRateScalerGrid.Columns("Time2").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
StkFishRateScalerGrid.Columns.Add("Time3", "Time3")
StkFishRateScalerGrid.Columns("Time3").Width = 100 / FormWidthScaler
StkFishRateScalerGrid.Columns("Time3").DefaultCellStyle.Format = ("###0.0000")
StkFishRateScalerGrid.Columns("Time3").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
StkFishRateScalerGrid.Columns.Add("Time4", "Time4")
StkFishRateScalerGrid.Columns("Time4").Width = 100 / FormWidthScaler
StkFishRateScalerGrid.Columns("Time4").DefaultCellStyle.Format = ("###0.0000")
StkFishRateScalerGrid.Columns("Time4").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
If SpeciesName = "COHO" Then
StkFishRateScalerGrid.Columns.Add("Time5", "Time5")
StkFishRateScalerGrid.Columns("Time5").Width = 100 / FormWidthScaler
StkFishRateScalerGrid.Columns("Time5").DefaultCellStyle.Format = ("###0.0000")
StkFishRateScalerGrid.Columns("Time5").DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
End If
Dim rowcount As Integer = 0
If SpeciesName = "COHO" Then
For fish = 1 To NumFish
For Stk As Integer = 1 To NumStk
If StockFishRateScalers(Stk, fish, 1) <> 1.0 Or StockFishRateScalers(Stk, fish, 2) <> 1.0 Or StockFishRateScalers(Stk, fish, 3) <> 1.0 _
Or StockFishRateScalers(Stk, fish, 4) <> 1.0 Or StockFishRateScalers(Stk, fish, 5) <> 1 Then
rowcount = rowcount + 1
End If
Next
Next
Else
For fish = 1 To NumFish
For Stk As Integer = 1 To NumStk
If StockFishRateScalers(Stk, fish, 1) <> 1.0 Or StockFishRateScalers(Stk, fish, 2) <> 1.0 Or StockFishRateScalers(Stk, fish, 3) <> 1.0 Or StockFishRateScalers(Stk, fish, 4) <> 1.0 Then
rowcount = rowcount + 1
End If
Next
Next
End If
StkFishRateScalerGrid.RowCount = rowcount + 1
rowcount = 0
If SpeciesName = "COHO" Then
For fish = 1 To NumFish
For Stk As Integer = 1 To NumStk
If StockFishRateScalers(Stk, fish, 1) <> 1.0 Or StockFishRateScalers(Stk, fish, 2) <> 1.0 Or StockFishRateScalers(Stk, fish, 3) <> 1.0 _
Or StockFishRateScalers(Stk, fish, 4) <> 1.0 Or StockFishRateScalers(Stk, fish, 5) <> 1 Then
For TStep = 1 To NumSteps
If AnyBaseRate(fish, TStep) = 0 Then
StkFishRateScalerGrid.Item(0, rowcount).Value = FisheryName(fish)
StkFishRateScalerGrid.Item(1, rowcount).Value = FisheryID(fish)
StkFishRateScalerGrid.Item(2, rowcount).Value = StockName(Stk)
StkFishRateScalerGrid.Item(3, rowcount).Value = StockID(Stk)
StkFishRateScalerGrid.Item(TStep + 3, rowcount).Value = "****"
Else
StkFishRateScalerGrid.Item(0, rowcount).Value = FisheryName(fish)
StkFishRateScalerGrid.Item(1, rowcount).Value = FisheryID(fish)
StkFishRateScalerGrid.Item(2, rowcount).Value = StockName(Stk)
StkFishRateScalerGrid.Item(3, rowcount).Value = StockID(Stk)
StkFishRateScalerGrid.Item(TStep + 3, rowcount).Value = StockFishRateScalers(Stk, fish, TStep).ToString("###0.0000")
End If
Next TStep
rowcount = rowcount + 1
End If
Next
Next
Else
For fish = 1 To NumFish
For Stk As Integer = 1 To NumStk
If StockFishRateScalers(Stk, fish, 1) <> 1.0 Or StockFishRateScalers(Stk, fish, 2) <> 1.0 Or StockFishRateScalers(Stk, fish, 3) <> 1.0 Or StockFishRateScalers(Stk, fish, 4) <> 1.0 Then
For TStep = 1 To NumSteps
If AnyBaseRate(fish, TStep) = 0 Then
StkFishRateScalerGrid.Item(0, rowcount).Value = FisheryName(fish)
StkFishRateScalerGrid.Item(1, rowcount).Value = FisheryID(fish)
StkFishRateScalerGrid.Item(2, rowcount).Value = StockName(Stk)
StkFishRateScalerGrid.Item(3, rowcount).Value = StockID(Stk)
StkFishRateScalerGrid.Item(TStep + 3, rowcount).Value = "****"
Else
StkFishRateScalerGrid.Item(0, rowcount).Value = FisheryName(fish)
StkFishRateScalerGrid.Item(1, rowcount).Value = FisheryID(fish)
StkFishRateScalerGrid.Item(2, rowcount).Value = StockName(Stk)
StkFishRateScalerGrid.Item(3, rowcount).Value = StockID(Stk)
StkFishRateScalerGrid.Item(TStep + 3, rowcount).Value = StockFishRateScalers(Stk, fish, TStep).ToString("###0.0000")
End If
Next TStep
rowcount = rowcount + 1
End If
Next
Next
End If
GridLoading = False
End Sub
End Class