📄 generator.c
字号:
sprintf(sql, "INSERT INTO Interaction_Properties (Object_Interaction_ID, Property_ID) VALUES (%d, %d)", object_interaction_id, "1906704a17fa473398b7a3dae5a2b013");
db_execute_sql(dbip, sql);
sprintf(sql, "INSERT INTO Interaction_Properties (Object_Interaction_ID, Property_ID) VALUES (%d, %d)", object_interaction_id, "33b87fb6cf0547e793779df6ebcca013");
db_execute_sql(dbip, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "3169342e968a4f979cb821e4419c2520", "9121a51fafd449788c563b33a9ac64ef");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "30e-4");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "236c832aface444ca9805391cf9def17", "9121a51fafd449788c563b33a9ac64ef");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "30e-4");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "68ff54756ad34491ab95aaa71dfe2c63", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "-59.4");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "33b87fb6cf0547e793779df6ebcca013", "ed695ad4181347928611c6b9d2a3410e");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "a9dc2d7b5c024585a11636de04431775", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "-70");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "72999ab0a09145719a6de10b68c67313", "692cafddc34e4d22b886e28ae00b880a");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "10.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "226b8d30341f46bab8d36de6c939f16b", "696fc081f35d401fbf0052619aca133a");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "1.00");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "4924c4377f23425fba8a88a328f6497f", "dc01a06a5b03485bb71ade588c380a0a");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.05");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "39ae2d31712a4c6ead50a89a5aa4bb02", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "10.6");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "1fab5b8826a64302a0531c1d5a4869a9", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "334df63bdfea4199b9aaf68c34fe118e", "b9622b84193e415895b7975bbd1e59e8");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "57026a08960c4e958d363a43b2e9085e", "3d770ed0324843929a6b24611cd1656a");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "4b1dec6029c94078bb37376fb7f5cd79", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "24f98f5d116f49d495b5cc34135ca818", "a85f16a616834375aab7560727d33d5c");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "d7b67ecb882c43e1b50ef9d52fd62a4f", "ba7f2fdd782d4ac8baa6e5d0d8c0668c");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "soma");
db_execute_sql(dbpv, sql);
}
else /* i % 2 = 0 dendrite */
{
/* write the interaction_id between first and second object */
sprintf(sql, "INSERT INTO Object_Interactions (Object_Interaction_ID, Object_ID) VALUES (%d, %d)", object_interaction_id, object_id);
db_execute_sql(dboi, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "3169342e968a4f979cb821e4419c2520", "9121a51fafd449788c563b33a9ac64ef");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "30e-4");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "236c832aface444ca9805391cf9def17", "9121a51fafd449788c563b33a9ac64ef");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "30e-4");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "68ff54756ad34491ab95aaa71dfe2c63", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "-59.4");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "1906704a17fa473398b7a3dae5a2b013", "ed695ad4181347928611c6b9d2a3410e");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "a9dc2d7b5c024585a11636de04431775", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "-70");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "72999ab0a09145719a6de10b68c67313", "692cafddc34e4d22b886e28ae00b880a");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "10.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "226b8d30341f46bab8d36de6c939f16b", "696fc081f35d401fbf0052619aca133a");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "1.00");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "4924c4377f23425fba8a88a328f6497f", "dc01a06a5b03485bb71ade588c380a0a");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.05");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "39ae2d31712a4c6ead50a89a5aa4bb02", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "10.6");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "1fab5b8826a64302a0531c1d5a4869a9", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "334df63bdfea4199b9aaf68c34fe118e", "b9622b84193e415895b7975bbd1e59e8");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "57026a08960c4e958d363a43b2e9085e", "3d770ed0324843929a6b24611cd1656a");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "4b1dec6029c94078bb37376fb7f5cd79", "3f905435f4824d539327c1c5cc9acc40");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "24f98f5d116f49d495b5cc34135ca818", "a85f16a616834375aab7560727d33d5c");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "33b87fb6cf0547e793779df6ebcca013", "ed695ad4181347928611c6b9d2a3410e");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
db_execute_sql(dbpv, sql);
object_property_id++;
sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES (NULL, %d, %d, %d)", object_id, "d7b67ecb882c43e1b50ef9d52fd62a4f", "ba7f2fdd782d4ac8baa6e5d0d8c0668c");
db_execute_sql(dbop, sql);
sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES (%d, %d, '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "dendrite");
db_execute_sql(dbpv, sql);
}
}
/* commit transactions */
strcpy(sql, "COMMIT TRANSACTION");
db_execute_sql(dbo, sql);
db_execute_sql(dboi, sql);
db_execute_sql(dbop, sql);
db_execute_sql(dbip, sql);
db_execute_sql(dbpv, sql);
db_execute_sql(dbapv, sql);
/* create database indexes */
/* Objects */
strcpy(sql, "CREATE UNIQUE INDEX idxObjects ON Objects (ID ASC);");
db_execute_sql(dbo, sql);
/* Object_Properties */
strcpy(sql, "CREATE UNIQUE INDEX idxObjectProperties ON Object_Properties (ID ASC);");
db_execute_sql(dbop, sql);
strcpy(sql, "CREATE INDEX idxObjectPropertyIDs ON Object_Properties (Object_ID ASC);");
db_execute_sql(dbop, sql);
/* Object_Interactions */
strcpy(sql, "CREATE UNIQUE INDEX idxObjectInteractions ON Object_Interactions (Object_Interaction_ID ASC, Object_ID ASC);");
db_execute_sql(dboi, sql);
strcpy(sql, "CREATE INDEX idxObjectInteractionIDs ON Object_Interactions (Object_ID ASC);");
db_execute_sql(dboi, sql);
/* Interaction_Properties */
strcpy(sql, "CREATE UNIQUE INDEX idxInteractionProperties ON Interaction_Properties (Object_Interaction_ID ASC, Property_ID ASC);");
db_execute_sql(dbip, sql);
/* Property_Values */
strcpy(sql, "CREATE UNIQUE INDEX idxPropertyValues ON Property_Values (Object_Property_ID ASC);");
db_execute_sql(dbpv, sql);
strcpy(sql, "CREATE UNIQUE INDEX idxPropertyTimes ON Property_Values (Object_Property_ID ASC, Time_ID ASC);");
db_execute_sql(dbpv, sql);
/* Archive_Property_Values */
strcpy(sql, "CREATE INDEX idxArchivePropertyValues ON Archive_Property_Values (Object_Property_ID ASC);");
db_execute_sql(dbapv, sql);
strcpy(sql, "CREATE UNIQUE INDEX idxArchivePropertyTimes ON Archive_Property_Values (Object_Property_ID ASC, Time_ID ASC);");
db_execute_sql(dbapv, sql);
/* free memory */
free(file_path);
free(file_object_path);
free(file_object_property_path);
free(file_object_interaction_path);
free(file_interaction_property_path);
free(file_property_value_path);
free(file_archive_property_value_path);
free(sql);
/* close database files */
db_cache_close(file_object_id, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
db_cache_close(file_object_property_id, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
db_cache_close(file_object_interaction_id, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
db_cache_close(file_interaction_property_id, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
db_cache_close(file_property_value_id, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
db_cache_close(file_archive_property_value_id, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
/* free memory */
free(archive_property_value_id);
free(property_value_id);
free(property_id);
free(interaction_property_id);
free(object_interaction_id);
free(object_property_id);
free(object_id);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -