Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 3
0
 def save_radio_message(radioMessageData):
     db = DB(DatabaseHelper.database_name, DataMapping())
     rm = db.save_table_object(radioMessageData)
     print(radioMessageData.dataRecordArray)
     if radioMessageData.dataRecordArray is not None:
         for rec in radioMessageData.dataRecordArray:
             rec.radioMessageId = rm.id
             if rm.messageType == PUNCH:
                 rec.origFromNode = rm.fromNode
             db.save_table_object(rec)
     return DatabaseHelper.get_radio_message(rm.id)
Exemplo n.º 4
0
 def save_radio_message(radioMessageData):
     db = DB(DatabaseHelper.database_name, DataMapping())
     rm = db.save_table_object(radioMessageData)
     print(radioMessageData.dataRecordArray)
     if radioMessageData.dataRecordArray is not None:
         for rec in radioMessageData.dataRecordArray:
             rec.radioMessageId = rm.id
             if rm.messageType == PUNCH:
                 rec.origFromNode = rm.fromNode
             db.save_table_object(rec)
     return DatabaseHelper.get_radio_message(rm.id)
Exemplo n.º 5
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)
Exemplo n.º 6
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)
Exemplo n.º 7
0
 def save_channel(channel):
     db = DB(DatabaseHelper.database_name, DataMapping())
     db.save_table_object(channel)
Exemplo n.º 8
0
 def save_channel(channel):
     db = DB(DatabaseHelper.database_name, DataMapping())
     db.save_table_object(channel)