Skip to content

Commit

Permalink
fixed create_widget_content create,
Browse files Browse the repository at this point in the history
  • Loading branch information
trombastic committed Mar 20, 2019
1 parent 1249c72 commit 6f38e7d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
0.7.0b11
- fixed Export without mean values
- fixed managementcommand for Data Export
- added lock for Exports to prevent running of more then one export at a time
- added lock for Exports to prevent running of more than one export at a time

0.7.0b12
- fixed export
Expand Down
2 changes: 1 addition & 1 deletion pyscada/export/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def export_recordeddata_to_file(time_min=None, time_max=None, filename=None, act
else:
return

# less then 24
# less than 24
# read everything
bf.write_data('time', float64(out_timevalues),
id=0,
Expand Down
4 changes: 3 additions & 1 deletion pyscada/hmi/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ def _delete_widget_content(sender, instance, **kwargs):
wc.delete()


@receiver(post_save, sender=WidgetContentModel)
@receiver(post_save)
def _create_widget_content(sender, instance, created=False, **kwargs):
"""
create a widget content instance when a WidgetContentModel is deleted
"""
if not issubclass(sender, WidgetContentModel):
return

# create a WidgetContent Entry
if created:
instance.create_widget_content_entry()
return
6 changes: 3 additions & 3 deletions pyscada/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ def update_value(self, value=None, timestamp=None):
else:
if (self.timestamp - self.timestamp_old) >= 3600:
# store at least every hour one value
# store Value if old Value is older then 1 hour
# store Value if old Value is older than 1 hour
self.store_value = True
self.timestamp_old = self.timestamp

Expand Down Expand Up @@ -1018,7 +1018,7 @@ def __str__(self):
class RecordedDataOld(models.Model):
"""
Big Int first 42 bits are used for the unixtime in ms, unsigned because we only
store time values that are later then 1970, rest 21 bits are used for the
store time values that are later than 1970, rest 21 bits are used for the
variable id to have a uniqe primary key
63 bit 111111111111111111111111111111111111111111111111111111111111111
42 bit 111111111111111111111111111111111111111111000000000000000000000
Expand Down Expand Up @@ -1349,7 +1349,7 @@ class Event(models.Model):
variable_limit = models.ForeignKey(Variable, blank=True, null=True, default=None, on_delete=models.SET_NULL,
related_name="variable_limit",
help_text='''you can choose either an fixed limit or an variable limit that is
dependent on the current value of an variable, if you choose a value other then
dependent on the current value of an variable, if you choose a value other than
none for variable limit the fixed limit would be ignored''')
limit_type_choices = (
(0, 'value is less than limit',),
Expand Down
2 changes: 1 addition & 1 deletion pyscada/onewire/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def _reinit_daq_daemons(sender, instance, **kwargs):
elif type(instance) is ExtendedOneWireVariable:
post_save.send_robust(sender=Variable, instance=Variable.objects.get(pk=instance.pk))
elif type(instance) is ExtendedOneWireDevice:
post_save.send_robust(sender=Device, instance=Device.objects.get(pk=instance.pk))
post_save.send_robust(sender=Device, instance=Device.objects.get(pk=instance.pk))

0 comments on commit 6f38e7d

Please sign in to comment.