Пример #1
0
 def save_main_settings(main_settings_data):
     db = DB(DatabaseHelper.database_name, DataMapping())
     old_main_settings_data = DatabaseHelper.get_main_settings_data()
     if old_main_settings_data is not None:
         main_settings_data.id = old_main_settings_data.id
     db.save_table_object(main_settings_data)
     db.execute_SQL("DELETE FROM NodeToControlNumberData")
     for nodeToControl in main_settings_data.NodeToControlNumberMapping:
         db.save_table_object(nodeToControl)
     return DatabaseHelper.get_main_settings_data()
Пример #2
0
 def save_main_settings(main_settings_data):
     db = DB(DatabaseHelper.database_name, DataMapping())
     old_main_settings_data = DatabaseHelper.get_main_settings_data()
     if old_main_settings_data is not None:
         main_settings_data.id = old_main_settings_data.id
     db.save_table_object(main_settings_data)
     db.execute_SQL("DELETE FROM NodeToControlNumberData")
     for nodeToControl in main_settings_data.NodeToControlNumberMapping:
         db.save_table_object(nodeToControl)
     return DatabaseHelper.get_main_settings_data()
Пример #3
0
 def save_radio_settings(radio_settings_data):
     db = DB(DatabaseHelper.database_name, DataMapping())
     print("save radio settings")
     saved_radio_settings_data = db.save_table_object(radio_settings_data)
     print("save radio settings 2")
     db.execute_SQL("DELETE FROM InboundRadioNodeData WHERE RadioSettingsId = " + str(saved_radio_settings_data.id))
     for node in radio_settings_data.InboundRadioNodes:
         node.id = None
         node.RadioSettingsId = saved_radio_settings_data.id
         db.save_table_object(node)
     return DatabaseHelper.get_radio_settings_data(saved_radio_settings_data.id)
Пример #4
0
 def save_radio_settings(radio_settings_data):
     db = DB(DatabaseHelper.database_name, DataMapping())
     print("save radio settings")
     saved_radio_settings_data = db.save_table_object(radio_settings_data)
     print("save radio settings 2")
     db.execute_SQL(
         "DELETE FROM InboundRadioNodeData WHERE RadioSettingsId = " +
         str(saved_radio_settings_data.id))
     for node in radio_settings_data.InboundRadioNodes:
         node.id = None
         node.RadioSettingsId = saved_radio_settings_data.id
         db.save_table_object(node)
     return DatabaseHelper.get_radio_settings_data(
         saved_radio_settings_data.id)
Пример #5
0
 def remove_all_punches():
     db = DB(DatabaseHelper.database_name, DataMapping())
     db.execute_SQL("DELETE FROM PunchData")
     db.execute_SQL("DELETE FROM RadioMessageData")
Пример #6
0
 def set_no_station_number_found(punchDataId):
     db = DB(DatabaseHelper.database_name, DataMapping())
     db.execute_SQL(
         "UPDATE PunchData SET stationNumberNotFound = 1 WHERE id=" +
         str(punchDataId))
Пример #7
0
 def set_punch_sent_to_meos(punchDataId):
     db = DB(DatabaseHelper.database_name, DataMapping())
     db.execute_SQL("UPDATE PunchData SET sentToMeos = 1 WHERE id=" +
                    str(punchDataId))
Пример #8
0
 def set_punch_sent_to_meos(punchDataId):
     db = DB(DatabaseHelper.database_name, DataMapping())
     db.execute_SQL("UPDATE PunchData SET sentToMeos = 1 WHERE id=" + str(punchDataId))
Пример #9
0
 def remove_all_punches():
     db = DB(DatabaseHelper.database_name, DataMapping())
     db.execute_SQL("DELETE FROM PunchData")
     db.execute_SQL("DELETE FROM RadioMessageData")
Пример #10
0
 def set_no_station_number_found(punchDataId):
     db = DB(DatabaseHelper.database_name, DataMapping())
     db.execute_SQL("UPDATE PunchData SET stationNumberNotFound = 1 WHERE id=" + str(punchDataId))