Exemplo n.º 1
0
//计算矿井的瓦斯涌出量
double CbmClientHelper::MineGasFlow(const cbm::Mine& mine)
{
	double ret = 0;
	try 
	{
		RpcClient<cbm::CbmServiceClient> service_client(HOST, PORT2);
		service_client.start();
		ret = service_client.get()->MineGasFlow(mine);
		service_client.close();
	} 
	catch (TException &tx) 
	{
		std::string error_msg = tx.what();
		//printf("ERROR: %s\n", tx.what());
		ret = 0;
	}
	return ret;
}
Exemplo n.º 2
0
//工作面开采层瓦斯涌出量
double CbmClientHelper::WorkSurfGasFlow1(const cbm::Coal& coal, const cbm::WorkArea& work_area, const cbm::WorkSurf& work_surf)
{
	double ret = 0;
	try 
	{
		RpcClient<cbm::CbmServiceClient> service_client(HOST, PORT2);
		service_client.start();
		ret = service_client.get()->WorkSurfGasFlow1(coal, work_area, work_surf);
		service_client.close();
	} 
	catch (TException &tx) 
	{
		std::string error_msg = tx.what();
		//printf("ERROR: %s\n", tx.what());
		ret = 0;
	}
	return ret;
}
Exemplo n.º 3
0
//抽采难易程度评价
int32_t CbmClientHelper::DifficultEval(const cbm::Coal& coal)
{
	int32_t ret = 0;
	try 
	{
		RpcClient<cbm::CbmServiceClient> service_client(HOST, PORT2);
		service_client.start();
		ret = service_client.get()->DifficultEval(coal);
		service_client.close();
	} 
	catch (TException &tx) 
	{
		std::string error_msg = tx.what();
		//printf("ERROR: %s\n", tx.what());
		ret = 0;
	}
	return ret;
}
Exemplo n.º 4
0
 queue_request_options cloud_queue::get_modified_options(const queue_request_options& options) const
 {
     queue_request_options modified_options(options);
     modified_options.apply_defaults(service_client().default_request_options());
     return modified_options;
 }
    TEST_FIXTURE(append_blob_test_base, append_blob_snapshot_metadata)
    {
        m_blob.metadata()[U("key1")] = U("value1");
        m_blob.metadata()[U("key2")] = U("value2");
        m_blob.create_or_replace(azure::storage::access_condition(), azure::storage::blob_request_options(), m_context);

        auto snapshot1 = m_blob.create_snapshot(azure::storage::cloud_metadata(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context);
        CHECK_EQUAL(2U, snapshot1.metadata().size());
        CHECK_UTF8_EQUAL(U("value1"), snapshot1.metadata()[U("key1")]);
        CHECK_UTF8_EQUAL(U("value2"), snapshot1.metadata()[U("key2")]);

        azure::storage::cloud_append_blob snapshot1_clone(snapshot1.uri(), snapshot1.snapshot_time(), snapshot1.service_client().credentials());
        CHECK(snapshot1_clone.metadata().empty());
        snapshot1_clone.download_attributes(azure::storage::access_condition(), azure::storage::blob_request_options(), m_context);
        CHECK_EQUAL(2U, snapshot1_clone.metadata().size());
        CHECK_UTF8_EQUAL(U("value1"), snapshot1_clone.metadata()[U("key1")]);
        CHECK_UTF8_EQUAL(U("value2"), snapshot1_clone.metadata()[U("key2")]);

        azure::storage::cloud_metadata snapshot_metadata;
        snapshot_metadata[U("key3")] = U("value1");
        snapshot_metadata[U("key4")] = U("value2");
        auto snapshot2 = m_blob.create_snapshot(snapshot_metadata, azure::storage::access_condition(), azure::storage::blob_request_options(), m_context);
        CHECK_EQUAL(2U, snapshot1.metadata().size());
        CHECK_UTF8_EQUAL(U("value1"), snapshot2.metadata()[U("key3")]);
        CHECK_UTF8_EQUAL(U("value2"), snapshot2.metadata()[U("key4")]);

        azure::storage::cloud_append_blob snapshot2_clone(snapshot2.uri(), snapshot2.snapshot_time(), snapshot2.service_client().credentials());
        CHECK(snapshot2_clone.metadata().empty());
        snapshot2_clone.download_attributes(azure::storage::access_condition(), azure::storage::blob_request_options(), m_context);
        CHECK_EQUAL(2U, snapshot2_clone.metadata().size());
        CHECK_UTF8_EQUAL(U("value1"), snapshot2_clone.metadata()[U("key3")]);
        CHECK_UTF8_EQUAL(U("value2"), snapshot2_clone.metadata()[U("key4")]);
    }