Skip to content

Commit 3b48724

Browse files
committed
Another bulk upload
1 parent 144099d commit 3b48724

16 files changed

Lines changed: 307 additions & 255 deletions
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
namespace OSAE
2-
{
3-
using System;
4-
5-
public class OSAEScreenControl
6-
{
7-
public string ControlName { get; set; }
8-
public string ControlType { get; set; }
9-
public string ObjectName { get; set; }
10-
public string ObjectState { get; set; }
11-
public DateTime LastUpdated { get; set; }
12-
public string TimeInState { get; set; }
13-
}
14-
}
1+
namespace OSAE
2+
{
3+
using System;
4+
5+
public class OSAEScreenControl
6+
{
7+
public string ControlName { get; set; }
8+
public string ControlType { get; set; }
9+
public string ObjectName { get; set; }
10+
public string ObjectState { get; set; }
11+
public DateTime LastUpdated { get; set; }
12+
public DateTime PropertyLastUpdated { get; set; }
13+
public string TimeInState { get; set; }
14+
}
15+
}

OSAE.API/OSAEScreenControl/OSAEScreenControlManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static List<OSAEScreenControl> GetScreenControls(string screenName)
8181
DataSet dataset = new DataSet();
8282
OSAEScreenControl ctrl = new OSAEScreenControl();
8383

84-
command.CommandText = "SELECT object_name, control_name, control_type, state_name, last_updated, coalesce(time_in_state, 0) as time_in_state FROM osae_v_screen_object WHERE screen_name=@ScreenName AND control_enabled = 1";
84+
command.CommandText = "SELECT object_name, control_name, control_type, state_name, last_updated, coalesce(property_last_updated,NOW()) as property_last_updated, coalesce(time_in_state, 0) as time_in_state FROM osae_v_screen_object WHERE screen_name=@ScreenName AND control_enabled = 1";
8585
command.Parameters.AddWithValue("@ScreenName", screenName);
8686
dataset = OSAESql.RunQuery(command);
8787

@@ -96,6 +96,7 @@ public static List<OSAEScreenControl> GetScreenControls(string screenName)
9696
ctrl.ControlName = dr["control_name"].ToString();
9797
ctrl.ControlType = dr["control_type"].ToString();
9898
ctrl.LastUpdated = DateTime.Parse(dr["last_updated"].ToString());
99+
ctrl.PropertyLastUpdated = DateTime.Parse(dr["property_last_updated"].ToString());
99100
ctrl.ObjectName = dr["object_name"].ToString();
100101

101102
controls.Add(ctrl);

Plugins/OSAE.Phidget-IK/Class1.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
Try
137137
Dim bExists = OSAEObjectManager.ObjectExists(gSerial & "-DI" & i)
138138
If Not bExists = True Then
139-
OSAEObjectManager.ObjectAdd("Phidget " & gSerial & "-DI" & i, "Phidget " & gSerial & "-DI" & i, "PHIDGET DIGITAL INPUT", gSerial & "-DI" & i, "", True)
139+
OSAEObjectManager.ObjectAdd("Phidget " & gSerial & "-DI" & i, "", "Phidget " & gSerial & "-DI" & i, "PHIDGET DIGITAL INPUT", gSerial & "-DI" & i, "", True)
140140
End If
141141
Dim oObject As OSAEObject = OSAEObjectManager.GetObjectByAddress(gSerial & "-DI" & i)
142142
gDINames(i) = oObject.Name.ToString()
@@ -150,7 +150,7 @@
150150
Try
151151
Dim bExists = OSAEObjectManager.ObjectExists(gSerial & "-DO" & i)
152152
If Not bExists = True Then
153-
OSAEObjectManager.ObjectAdd("Phidget " & gSerial & "-DO" & i, "Phidget " & gSerial & "-DO" & i, "PHIDGET DIGITAL OUTPUT", gSerial & "-DO" & i, "", True)
153+
OSAEObjectManager.ObjectAdd("Phidget " & gSerial & "-DO" & i, "", "Phidget " & gSerial & "-DO" & i, "PHIDGET DIGITAL OUTPUT", gSerial & "-DO" & i, "", True)
154154
End If
155155
Dim oObject As OSAEObject = OSAEObjectManager.GetObjectByAddress(gSerial & "-DO" & i)
156156
gDONames(i) = oObject.Name.ToString()
@@ -164,7 +164,7 @@
164164
Try
165165
Dim bExists = OSAEObjectManager.ObjectExists(gSerial & "-AI" & i)
166166
If Not bExists = True Then
167-
OSAEObjectManager.ObjectAdd("Phidget " & gSerial & "-AI" & i, "Phidget " & gSerial & "-AI" & i, "PHIDGET ANALOG INPUT", gSerial & "-AI" & i, "", True)
167+
OSAEObjectManager.ObjectAdd("Phidget " & gSerial & "-AI" & i, "", "Phidget " & gSerial & "-AI" & i, "PHIDGET ANALOG INPUT", gSerial & "-AI" & i, "", True)
168168
End If
169169
Dim oObject As OSAEObject = OSAEObjectManager.GetObjectByAddress(gSerial & "-AI" & i)
170170
gAINames(i) = oObject.Name.ToString()

Plugins/OSAE.W800RF/W800RF.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ Public Class W800RF
220220
If gDevice.Device_Type = "X10_SECURITY_DS10" Then
221221
Log.Info("Adding new DS10A: " & gDevice.Device_Code)
222222
If gDebug Then Log.Debug("ObjectAdd: X10-" & gDevice.Device_Code & ",Unknown DS10A found by W800RF,BINARY SENSOR, " & gDevice.Device_Code & ", '' True)")
223-
OSAEObjectManager.ObjectAdd("X10-" & gDevice.Device_Code, "Unknown DS10A found by W800RF", "BINARY SENSOR", gDevice.Device_Code, "", True)
223+
OSAEObjectManager.ObjectAdd("X10-" & gDevice.Device_Code, "", "Unknown DS10A found by W800RF", "BINARY SENSOR", gDevice.Device_Code, "", True)
224224
Else
225225
Log.Info("Adding new X10: " & gDevice.House_Code & gDevice.Device_Code)
226226
If gDebug Then Log.Debug("ObjectAdd: X10-" & gDevice.Device_Code & ",Unknown X10 found by W800RF,BINARY SENSOR, " & gDevice.Device_Code & ", '', True)")
227-
OSAEObjectManager.ObjectAdd("X10-" & gDevice.House_Code & gDevice.Device_Code, "Unknown X10 found by W800RF", "BINARY SENSOR", gDevice.House_Code & gDevice.Device_Code, "", True)
227+
OSAEObjectManager.ObjectAdd("X10-" & gDevice.House_Code & gDevice.Device_Code, "", "Unknown X10 found by W800RF", "BINARY SENSOR", gDevice.House_Code & gDevice.Device_Code, "", True)
228228
End If
229229
End If
230230
Else

Plugins/OSAE.Zwave/Zwave.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ private void NotificationHandler()
332332
else
333333
propType = "String";
334334

335-
OSAEObjectTypeManager.ObjectTypePropertyAdd(value.Label, propType, "", objType, false);
335+
OSAEObjectTypeManager.ObjectTypePropertyAdd(value.Label, propType,"", "", objType, false);
336336
OSAEObjectTypeManager.ObjectTypeEventAdd(value.Label, value.Label, objType);
337337
}
338338
}
@@ -350,14 +350,14 @@ private void NotificationHandler()
350350
OSAEObjectTypeManager.ObjectTypeMethodAdd("ON", "On", objType, "", "", "", "");
351351
OSAEObjectTypeManager.ObjectTypeMethodAdd("OFF", "Off", objType, "", "", "", "");
352352
if(value.Label == "Level")
353-
OSAEObjectTypeManager.ObjectTypePropertyAdd("Level", "Integer", "", objType, false);
353+
OSAEObjectTypeManager.ObjectTypePropertyAdd("Level", "Integer", "", "", objType, false);
354354
}
355355
else
356356
{
357357
if (value.Type == ZWValueID.ValueType.Byte || value.Type == ZWValueID.ValueType.Decimal || value.Type == ZWValueID.ValueType.Int)
358358
{
359359
OSAEObjectTypeManager.ObjectTypeMethodAdd(value.Label, "Set " + value.Label, objType, "Value", "", "", "");
360-
OSAEObjectTypeManager.ObjectTypePropertyAdd(value.Label, "Integer", "", objType, false);
360+
OSAEObjectTypeManager.ObjectTypePropertyAdd(value.Label, "Integer", "", "", objType, false);
361361
}
362362
else if (value.Type == ZWValueID.ValueType.Button)
363363
{
@@ -370,7 +370,7 @@ private void NotificationHandler()
370370
{
371371
foreach (string option in options)
372372
OSAEObjectTypeManager.ObjectTypeMethodAdd(value.Label + " - " + option, value.Label + " - " + option, objType, "", "", "", "");
373-
OSAEObjectTypeManager.ObjectTypePropertyAdd(value.Label, "String", "", objType, false);
373+
OSAEObjectTypeManager.ObjectTypePropertyAdd(value.Label, "String", "", "", objType, false);
374374
}
375375
}
376376
}
@@ -582,8 +582,8 @@ private void NotificationHandler()
582582

583583
OSAEObjectTypeManager.ObjectTypeAdd(node.Product, node.Label, pName, baseType, false, false, false, true);
584584
OSAEObjectTypeManager.ObjectTypeMethodAdd("NODE NEIGHBOR UPDATE", "Node Neighbor Update", node.Product, "", "", "", "");
585-
OSAEObjectTypeManager.ObjectTypePropertyAdd("Home ID", "String", "", node.Product, false);
586-
OSAEObjectTypeManager.ObjectTypePropertyAdd("Poll", "Boolean", "", node.Product, false);
585+
OSAEObjectTypeManager.ObjectTypePropertyAdd("Home ID", "String", "", "", node.Product, false);
586+
OSAEObjectTypeManager.ObjectTypePropertyAdd("Poll", "Boolean", "", "", node.Product, false);
587587

588588
string propType;
589589
foreach (Value v in node.Values)
@@ -597,7 +597,7 @@ private void NotificationHandler()
597597
else
598598
propType = "String";
599599

600-
OSAEObjectTypeManager.ObjectTypePropertyAdd(v.Label, propType, "", node.Product, false);
600+
OSAEObjectTypeManager.ObjectTypePropertyAdd(v.Label, propType, "", "", node.Product, false);
601601
}
602602
else
603603
{
@@ -628,7 +628,7 @@ private void NotificationHandler()
628628
}
629629

630630

631-
OSAEObjectManager.ObjectAdd(node.Product + " - Z" + node.ID.ToString(), node.Product, node.Product, "Z" + node.ID.ToString(), "", true);
631+
OSAEObjectManager.ObjectAdd(node.Product + " - Z" + node.ID.ToString(),"", node.Product, node.Product, "Z" + node.ID.ToString(), "", true);
632632
OSAEObjectPropertyManager.ObjectPropertySet(node.Product + " - Z" + node.ID.ToString(), "Home ID", m_homeId.ToString(), pName);
633633
}
634634

UI/Manager/InstallPlugin.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public partial class InstallPlugin : Window
2424
#region variables
2525

2626
private string filename = string.Empty;
27-
private int s = 5;
27+
//private int s = 5;
2828
private PluginDescription desc = new PluginDescription();
29-
private Image MyPluginImage = null;
29+
//private Image MyPluginImage = null;
3030
public bool install = false;
3131

3232
#endregion

UI/OSAE.UI.Controls/AddControlPropertyLabel.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<Button Name="btnAdd" Content="Add" HorizontalAlignment="Left" Margin="9,239,0,0" VerticalAlignment="Top" Width="75" Click="btnAdd_Click"/>
1313
<Button Name="btnCancel" Content="Cancel" HorizontalAlignment="Left" Margin="360,239,0,0" VerticalAlignment="Top" Width="75" Click="btnCancel_Click"/>
1414
<Label Content="Object" HorizontalAlignment="Left" Margin="9,37,0,0" VerticalAlignment="Top"/>
15-
<ComboBox x:Name="cboObject" HorizontalAlignment="Left" Margin="82,39,0,0" VerticalAlignment="Top" Width="337" ItemsSource="{Binding Path=object_name}" DisplayMemberPath="object_name" SelectedValuePath="object_name" IsEditable="False" SelectionChanged="objectComboBox_SelectionChanged"/>
15+
<ComboBox x:Name="cboObject" HorizontalAlignment="Left" Margin="82,39,0,0" VerticalAlignment="Top" Width="337" ItemsSource="{Binding Path=object_name}" DisplayMemberPath="object_name" SelectedValuePath="object_name" IsEditable="False" SelectionChanged="cboObject_SelectionChanged"/>
1616
<Label Content="Suffix" HorizontalAlignment="Left" Margin="230,99,0,0" VerticalAlignment="Top"/>
17-
<ComboBox x:Name="cboProperty" HorizontalAlignment="Left" Margin="80,68,0,0" VerticalAlignment="Top" Width="337" ItemsSource="{Binding Path=property_name}" DisplayMemberPath="property_name" SelectedValuePath="property_name" IsEditable="False"/>
17+
<ComboBox x:Name="cboProperty" HorizontalAlignment="Left" Margin="80,68,0,0" VerticalAlignment="Top" Width="337" ItemsSource="{Binding Path=property_name}" DisplayMemberPath="property_name" SelectedValuePath="property_name" IsEditable="False" SelectionChanged="cboProperty_SelectionChanged"/>
1818
<TextBox x:Name="txtFont" HorizontalAlignment="Left" Height="23" Margin="81,130,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="145" PreviewMouseDown="txtFont_MouseLeftButtonUp"/>
1919
<Label Content="Font" HorizontalAlignment="Left" Margin="9,127,0,0" VerticalAlignment="Top"/>
2020
<TextBox x:Name="txtSize" HorizontalAlignment="Left" Height="23" Margin="274,131,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="145" MouseLeftButtonUp="txtFont_MouseLeftButtonUp" PreviewMouseDown="txtFont_MouseLeftButtonUp"/>

UI/OSAE.UI.Controls/AddControlPropertyLabel.xaml.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,22 @@ public AddControlPropertyLabel(string screen, string controlName = "")
4545
if (controlName == "")
4646
{
4747
//Let's create a new name
48-
sWorkingName = currentScreen + " - New State Image";
48+
sWorkingName = currentScreen + " - New Property Label";
4949
DataSet dsScreenControl = OSAESql.RunSQL("SELECT COUNT(object_name) FROM osae_v_object where object_name = '" + sWorkingName + "'");
5050
int iCount = 0;
5151

5252
while (dsScreenControl.Tables[0].Rows[0][0].ToString() == "1")
5353
{
5454
// We have a duplicate name, we must get a unique name
5555
iCount += 1;
56-
sWorkingName = currentScreen + " - New State Image" + iCount;
56+
sWorkingName = currentScreen + " - New Property Label" + iCount;
5757
dsScreenControl = OSAESql.RunSQL("SELECT COUNT(object_name) FROM osae_v_object where object_name = '" + sWorkingName + "'");
5858
}
5959
sMode = "Add";
6060
controlName = sWorkingName;
6161
txtControlName.Text = controlName;
6262

63-
LoadCurrentScreenObject(controlName);
63+
// LoadCurrentScreenObject(controlName);
6464
}
6565
Enable_Buttons();
6666

@@ -156,12 +156,17 @@ private void LoadColors()
156156

157157
}
158158

159-
private void objectComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
159+
private void cboObject_SelectionChanged(object sender, SelectionChangedEventArgs e)
160160
{
161161
DataSet dataSet = OSAESql.RunSQL("select property_name from osae_v_object_property where object_name='" + (sender as ComboBox).SelectedValue.ToString() + "' Union select 'State' order by property_name");
162162
cboProperty.ItemsSource = dataSet.Tables[0].DefaultView;
163163
}
164164

165+
private void cboProperty_SelectionChanged(object sender, SelectionChangedEventArgs e)
166+
{
167+
txtControlName.Text = currentScreen + " - " + cboObject.Text + " " + cboProperty.SelectedValue;
168+
}
169+
165170
private void txtFont_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
166171
{
167172
try
@@ -177,10 +182,8 @@ private void txtFont_MouseLeftButtonUp(object sender, System.Windows.Input.Mouse
177182
txtSize.Text = dlgFont.Font.Size.ToString();
178183
}
179184
}
180-
catch (Exception ex)
181-
{
182-
183-
}
185+
catch
186+
{ }
184187
}
185188

186189
private void btnAdd_Click(object sender, RoutedEventArgs e)

UI/OSAE.UI.Controls/AddControlStateImage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Button x:Name="btnLoadS1I1" Content="Image 1" HorizontalAlignment="Left" Margin="76,104,0,0" VerticalAlignment="Top" Width="75" Click="btnLoadS1I1_Click" RenderTransformOrigin="0.411,0.455" ToolTip="First and possibly only frame of this animation"/>
99

1010
<Label Content="Object" Height="28" HorizontalAlignment="Left" Margin="11,42,0,0" x:Name="label3" VerticalAlignment="Top" Width="53" />
11-
<ComboBox Height="23" HorizontalAlignment="Left" Margin="76,42,0,0" x:Name="cboObject" VerticalAlignment="Top" Width="357" ItemsSource="{Binding object_name}" DisplayMemberPath="object_name" SelectedValuePath="object_name" IsEditable="False" SelectionChanged="cboObject_SelectionChanged" />
11+
<ComboBox Height="23" HorizontalAlignment="Left" Margin="76,42,0,0" x:Name="cboObject" VerticalAlignment="Top" Width="357" ItemsSource="{Binding object_name}" DisplayMemberPath="object_name" SelectedValuePath="object_name" IsEditable="False" SelectionChanged="cboObject_SelectionChanged" />
1212
<Label Content="State 1" HorizontalAlignment="Left" Margin="11,71,0,0" VerticalAlignment="Top"/>
1313
<Label Content="State 2" HorizontalAlignment="Left" Margin="11,207,0,0" VerticalAlignment="Top"/>
1414
<Button x:Name="btnAdd" Content="Add" HorizontalAlignment="Left" Margin="10,468,0,0" VerticalAlignment="Top" Width="75" Click="btnAdd_Click"/>

UI/OSAE.UI.Controls/AddControlStateImage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public AddControlStateImage(string screen, string controlName = "")
6767
sMode = "Add";
6868
controlName = sWorkingName;
6969
txtControlName.Text = controlName;
70-
LoadCurrentScreenObject(controlName);
70+
//LoadCurrentScreenObject(controlName);
7171
}
7272
Enable_Buttons();
7373

@@ -386,6 +386,7 @@ private void cboObject_SelectionChanged(object sender, SelectionChangedEventArgs
386386
DataSet dataSet2 = OSAESql.RunSQL("SELECT method_name FROM osae_v_object_method where object_name = '" + cboObject.SelectedValue + "' order by method_name");
387387
cboSliderMethod.ItemsSource = dataSet2.Tables[0].DefaultView;
388388

389+
txtControlName.Text = currentScreen + " - " + cboObject.SelectedValue;
389390
}
390391

391392
private void btnAdd_Click(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)